@anker-in/headless-ui 1.0.14 → 1.0.16

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 (125) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  3. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  5. package/dist/cjs/biz-components/Category/index.js +1 -1
  6. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  7. package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
  8. package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  10. package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
  11. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  12. package/dist/cjs/biz-components/Faq/Faq.js.map +1 -1
  13. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  14. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  15. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  16. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  17. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  18. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  19. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  20. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +2 -2
  21. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  22. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  23. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  25. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +1 -64
  26. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -5
  27. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  28. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +74 -0
  29. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  30. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  31. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.d.ts +8 -0
  32. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +10 -0
  33. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +7 -0
  34. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  35. package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
  36. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  37. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  38. package/dist/cjs/biz-components/SwiperBox/types.d.ts +1 -0
  39. package/dist/cjs/biz-components/SwiperBox/types.js +1 -1
  40. package/dist/cjs/biz-components/SwiperBox/types.js.map +1 -1
  41. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  42. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  43. package/dist/cjs/biz-components/Tabs/types.d.ts +4 -1
  44. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  45. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  46. package/dist/cjs/biz-components/TextModal/index.js +1 -1
  47. package/dist/cjs/biz-components/TextModal/index.js.map +2 -2
  48. package/dist/cjs/biz-components/Title/index.js +1 -1
  49. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  50. package/dist/cjs/biz-components/VideoModal/YouTubePlayer.js +1 -1
  51. package/dist/cjs/biz-components/VideoModal/YouTubePlayer.js.map +2 -2
  52. package/dist/cjs/biz-components/VideoModal/index.js +1 -1
  53. package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
  54. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js +1 -1
  55. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js.map +2 -2
  56. package/dist/cjs/components/button.d.ts +1 -0
  57. package/dist/cjs/components/button.js +1 -1
  58. package/dist/cjs/components/button.js.map +3 -3
  59. package/dist/cjs/components/tabs.js +1 -1
  60. package/dist/cjs/components/tabs.js.map +3 -3
  61. package/dist/cjs/stories/graphic.stories.d.ts +1 -1
  62. package/dist/cjs/stories/shelfDisplay.stories.d.ts +1 -1
  63. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  64. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  65. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  66. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  67. package/dist/esm/biz-components/Category/index.js +1 -1
  68. package/dist/esm/biz-components/Category/index.js.map +2 -2
  69. package/dist/esm/biz-components/CreativeModule/index.js +1 -1
  70. package/dist/esm/biz-components/CreativeModule/index.js.map +2 -2
  71. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  72. package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
  73. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  74. package/dist/esm/biz-components/Faq/Faq.js.map +1 -1
  75. package/dist/esm/biz-components/Graphic/index.js +1 -1
  76. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  77. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  78. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +2 -2
  79. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  80. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +2 -2
  81. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  82. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
  83. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  84. package/dist/esm/biz-components/MemberEquity/index.js.map +2 -2
  85. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  86. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  87. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +1 -64
  88. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -5
  89. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  90. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +74 -0
  91. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  92. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  93. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.d.ts +8 -0
  94. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +10 -0
  95. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +7 -0
  96. package/dist/esm/biz-components/Slogan/index.js +1 -1
  97. package/dist/esm/biz-components/Slogan/index.js.map +2 -2
  98. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  99. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  100. package/dist/esm/biz-components/SwiperBox/types.d.ts +1 -0
  101. package/dist/esm/biz-components/SwiperBox/types.js.map +1 -1
  102. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  103. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  104. package/dist/esm/biz-components/Tabs/types.d.ts +4 -1
  105. package/dist/esm/biz-components/TextModal/index.js +1 -1
  106. package/dist/esm/biz-components/TextModal/index.js.map +2 -2
  107. package/dist/esm/biz-components/Title/index.js +1 -1
  108. package/dist/esm/biz-components/Title/index.js.map +2 -2
  109. package/dist/esm/biz-components/VideoModal/YouTubePlayer.js +1 -1
  110. package/dist/esm/biz-components/VideoModal/YouTubePlayer.js.map +2 -2
  111. package/dist/esm/biz-components/VideoModal/index.js +1 -1
  112. package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
  113. package/dist/esm/biz-components/WhyChoose/WhyChoose.js +1 -1
  114. package/dist/esm/biz-components/WhyChoose/WhyChoose.js.map +2 -2
  115. package/dist/esm/components/button.d.ts +1 -0
  116. package/dist/esm/components/button.js +1 -1
  117. package/dist/esm/components/button.js.map +3 -3
  118. package/dist/esm/components/tabs.js +1 -1
  119. package/dist/esm/components/tabs.js.map +3 -3
  120. package/dist/esm/stories/graphic.stories.d.ts +1 -1
  121. package/dist/esm/stories/shelfDisplay.stories.d.ts +1 -1
  122. package/dist/tokens/base.css +6 -0
  123. package/package.json +1 -1
  124. package/style.css +7 -4
  125. package/tailwind.config.js +2 -0
@@ -1,3 +1,4 @@
1
+ import type { ContainerProps } from '../../types/props.js';
1
2
  export declare const PRICE_SYMBOL: any;
2
3
  export declare const languageTerritory: (locale: string) => string;
3
4
  export declare function formatPrice({ amount, currencyCode, locale, maximumFractionDigits, minimumFractionDigits, removeTrailingZeros, }: {
@@ -21,3 +22,76 @@ export declare function formatVariantPrice({ amount, baseAmount, currencyCode, l
21
22
  basePrice: string | undefined;
22
23
  discount: string | null;
23
24
  };
25
+ type EventType = {
26
+ primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void;
27
+ secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void;
28
+ };
29
+ export interface ShelfDisplayItem {
30
+ id?: string;
31
+ /** 产品图片*/
32
+ img?: {
33
+ url: string;
34
+ };
35
+ handle?: string;
36
+ sku?: string;
37
+ /** 折扣后价格*/
38
+ price?: string;
39
+ title?: string;
40
+ /** 折扣前价格*/
41
+ basePrice?: string;
42
+ subTitle?: string;
43
+ /** 标签*/
44
+ tagItems?: string[];
45
+ tab?: string;
46
+ data?: ShelfDisplayItem[];
47
+ custom_name?: string;
48
+ custom_description?: string;
49
+ }
50
+ export type ShelfDisplayType = {
51
+ title?: string;
52
+ isShowTab?: boolean;
53
+ isShowTag?: boolean;
54
+ isShowRecommendedCard?: boolean;
55
+ isShowOriginalPrice?: boolean;
56
+ direction?: 'horizontal' | 'vertical';
57
+ align?: 'left' | 'center' | 'right';
58
+ productsTab?: any[];
59
+ productsCard?: any[];
60
+ /** 卡片形状 */
61
+ itemShape?: 'round' | 'square';
62
+ /** 按钮形状 */
63
+ shape?: 'round' | 'square';
64
+ /** 标签页形状*/
65
+ tabShape?: 'rounded' | 'square';
66
+ /** 主按钮配置 */
67
+ primaryButton?: string;
68
+ primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore';
69
+ /** 副按钮配置 */
70
+ secondaryButton?: string;
71
+ secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore';
72
+ theme?: 'light' | 'dark';
73
+ containerProps?: ContainerProps;
74
+ };
75
+ export interface ShelfDisplayProps {
76
+ data: ShelfDisplayType;
77
+ buildData?: {
78
+ categories: any[];
79
+ products: any[];
80
+ };
81
+ recommendedData?: any[];
82
+ /** 按钮事件*/
83
+ event?: EventType;
84
+ className?: string;
85
+ key?: string;
86
+ target?: '_self' | '_blank';
87
+ breakpoints?: {
88
+ [key: number]: {
89
+ spaceBetween: number;
90
+ freeMode: boolean;
91
+ slidesPerView: number;
92
+ };
93
+ };
94
+ isDisplayGudgments?: boolean;
95
+ isDisplayBackImage?: boolean;
96
+ }
97
+ export {};
@@ -1,2 +1,2 @@
1
- const a={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},o=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en",fr:"de-DE","eu-fr":"de-DE",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl","eu-de":"de-de"})[e]||"";function m({amount:e,currencyCode:n,locale:i,maximumFractionDigits:r,minimumFractionDigits:u,removeTrailingZeros:c=!1}){let t=new Intl.NumberFormat(o(i),{style:"currency",currency:n||"USD",minimumFractionDigits:r===0?0:u,maximumFractionDigits:r}).format(e);return["eu-de","eu-en","de","eu"].includes(i)&&(t=t?.toString()?.replace(/[\s]/g,"")),c&&(t=t.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),t}function b({amount:e,baseAmount:n,currencyCode:i,locale:r,maximumFractionDigits:u,minimumFractionDigits:c,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${a[r]}${e}`,basePrice:`${a[r]}${n}`,discount:`${a[r]}${n-e||0}`};const t=n>e,d=new Intl.NumberFormat(o(r),{style:"percent"}),f=t?d.format((n-e)/n):null,g=m({amount:e,currencyCode:i,locale:r,removeTrailingZeros:s}),l=t?m({amount:n,currencyCode:i,locale:r,maximumFractionDigits:u,minimumFractionDigits:c,removeTrailingZeros:s}):void 0;return{price:g,basePrice:l,discount:f}}export{a as PRICE_SYMBOL,m as formatPrice,b as formatVariantPrice,o as languageTerritory};
1
+ const u={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},c=e=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en",fr:"de-DE","eu-es":"de-DE","eu-fr":"de-DE","eu-it":"de-DE","eu-de":"de-DE","eu-en":"en-US","cz-en":"de-DE",nl:"de-DE",de:"de-DE",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl"})[e]||"";function d({amount:e,currencyCode:n,locale:i,maximumFractionDigits:r,minimumFractionDigits:a,removeTrailingZeros:s=!1}){let t=new Intl.NumberFormat(c(i),{style:"currency",currency:n||"USD",minimumFractionDigits:r===0?0:a,maximumFractionDigits:r}).format(e);return["eu-de","eu-en","de","eu"].includes(i)&&(t=t?.toString()?.replace(/[\s]/g,"")),s&&(t=t.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),t}function y({amount:e,baseAmount:n,currencyCode:i,locale:r,maximumFractionDigits:a,minimumFractionDigits:s,removeTrailingZeros:o}){if(typeof Intl>"u")return{price:`${u[r]}${e}`,basePrice:`${u[r]}${n}`,discount:`${u[r]}${n-e||0}`};const t=n>e,l=new Intl.NumberFormat(c(r),{style:"percent"}),p=t?l.format((n-e)/n):null,m=d({amount:e,currencyCode:i,locale:r,removeTrailingZeros:o}),g=t?d({amount:n,currencyCode:i,locale:r,maximumFractionDigits:a,minimumFractionDigits:s,removeTrailingZeros:o}):void 0;return{price:m,basePrice:g,discount:p}}export{u as PRICE_SYMBOL,d as formatPrice,y as formatVariantPrice,c as languageTerritory};
2
2
  //# sourceMappingURL=shelfDisplay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplay.ts"],
4
- "sourcesContent": ["/* eslint-disable no-useless-escape */\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n} as any\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n eu: 'en',\n fr: 'de-DE',\n 'eu-fr': 'de-DE',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n 'eu-de': 'de-de',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
5
- "mappings": "AACO,MAAMA,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaC,EAAqBC,IAE/B,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,KAErFI,EAAQZ,EAAY,CAAE,OAAAC,EAAQ,aAAAC,EAAc,OAAAH,EAAQ,oBAAAM,CAAoB,CAAC,EACzEQ,EAAYJ,EACdT,EAAY,CACV,OAAQQ,EACR,aAAAN,EACA,OAAAH,EACA,sBAAAI,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAO,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
4
+ "sourcesContent": ["import type { ContainerProps } from '../../types/props.js'\n/* eslint-disable no-useless-escape */\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n} as any\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n eu: 'en',\n fr: 'de-DE',\n 'eu-es': 'de-DE',\n 'eu-fr': 'de-DE',\n 'eu-it': 'de-DE',\n 'eu-de': 'de-DE',\n 'eu-en': 'en-US',\n 'cz-en': 'de-DE',\n nl: 'de-DE',\n de: 'de-DE',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n}\n\nexport type ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n isDisplayGudgments?: boolean\n isDisplayBackImage?: boolean\n}"],
5
+ "mappings": "AAEO,MAAMA,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaC,EAAqBC,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,KACJ,GAAI,QACJ,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,GAAI,QACJ,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,EAAYJ,EACdT,EAAY,CACV,OAAQQ,EACR,aAAAN,EACA,OAAAH,EACA,sBAAAI,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAO,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
6
6
  "names": ["PRICE_SYMBOL", "languageTerritory", "locale", "formatPrice", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "formatVariantPrice", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
7
7
  }
@@ -0,0 +1,8 @@
1
+ export declare const ShelfDisplayWrapItem: ({ data, configuration }: {
2
+ data: any;
3
+ configuration?: any;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ShelfDisplayHorizontalItem: ({ data, configuration }: {
6
+ data: any;
7
+ configuration?: any;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import{Fragment as D,jsx as l,jsxs as p}from"react/jsx-runtime";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{formatVariantPrice as T}from"./shelfDisplay.js";import C from"../../components/picture.js";import P from"../../components/badge.js";import{cn as m}from"../../helpers/utils.js";import{Text as $}from"../../components/text.js";import y from"../../components/button.js";import{gaTrack as j}from"../../shared/track.js";import{trackUrlRef as O}from"../../shared/trackUrlRef.js";import{Heading as z}from"../../components/heading.js";const F="image",H="product_shelf",L=999999999e-2,Q=({data:e,configuration:t})=>{const{isDisplayBackImage:f=!1,itemShape:h}=t||{},{locale:r="us",copyWriting:k}=I(),w=(o,s,i)=>t?.event?.primaryButton?.(o,s+1,i),g=(o,s,i)=>t?.event?.secondaryButton?.(o,s+1,i),a=e?.variants?.find(o=>o?.sku===e?.sku)||e?.variants?.[0]||{},S=!a?.availableForSale&&a?.price?.amount===L,_=t?.isShowTag,u=t?.isShowOriginalPrice,c=a?.coupons?.[0],{price:N,basePrice:B}=T({locale:r,amount:u&&c?c.variant_price4wscode:a.price,baseAmount:u&&c?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),b=()=>{const o=e?.sku,s=e?.variants;return s?.find(x=>x?.sku===o)?.image?.url||s?.[0]?.image?.url||""},n=e?.custom_name||e?.title,v=e?.custom_description||e?.description,d=()=>p(D,{children:[_?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((o,s)=>l(P,{children:o},s))}):null,n?l(z,{as:"h3",title:n||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:n||""}):null,v?l($,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:v||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:S?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:k?.soldOutText}):p(D,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&N||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&B||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?l(y,{variant:"secondary",onClick:()=>g(e,t?.index,t),className:`
2
+ ${t.direction==="vertical"?"w-full":""}
3
+ `,children:t?.secondaryButton||""}):null,t?.primaryButton?l(y,{variant:"primary",onClick:()=>w(e,t?.index,t),className:`
4
+ ${t.direction==="vertical"?"w-full":""}
5
+ `,children:t?.primaryButton||""}):null]})]});return l("div",{className:m("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",h==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:f?l("div",{className:"absolute inset-0 box-border overflow-hidden",children:p("div",{className:"relative inset-0 size-full",children:[l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"}),l("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:d()})]})}):p("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[l("div",{className:m("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:l("a",{"aria-label":n,target:t?.target,href:O(`${r==="us"||!r?"":`/${r}`}/products/${e?.handle}`,`${F}_${H}`),onClick:()=>{j({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),d()]})},e?.id||e?.handle)},X=({data:e,configuration:t})=>{const{itemShape:f,itemLength:h}=t||{},{locale:r="us",copyWriting:k}=I(),w=(s,i,x)=>t?.event?.primaryButton?.(s,i+1,x),g=(s,i,x)=>t?.event?.secondaryButton?.(s,i+1,x),a=e?.variants?.find(s=>s?.sku===e?.sku)||e?.variants?.[0]||{},S=!a?.availableForSale&&a?.price?.amount===L,_=t?.isShowTag,u=t?.isShowOriginalPrice,c=a?.coupons?.[0],{price:N,basePrice:B}=T({locale:r,amount:u&&c?c.variant_price4wscode:a.price,baseAmount:u&&c?a.price:0,currencyCode:e?.price?.currencyCode||"USD"}),b=()=>{const s=e?.sku,i=e?.variants;return i?.find(U=>U?.sku===s)?.image?.url||i?.[0]?.image?.url||""},n=e?.custom_name||e?.title,v=e?.custom_description||e?.description,d=()=>h>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},o=()=>h>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col";return l("div",{className:m(d().wrap,f==="round"?"rounded-2xl":"rounded-none","bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6","box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]"),children:p("div",{className:m(o(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[l("div",{className:m(d().imgItem,"relative overflow-hidden desktop:mb-0 mb-1"),children:l("a",{"aria-label":n,target:t?.target,href:O(`${r==="us"||!r?"":`/${r}`}/products/${e?.handle}`,`${F}_${H}`),onClick:()=>{j({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||a?.sku,item_name:e?.name,item_variant:a?.name,price:a?.price,index:t?.index+1}]}})},children:l(C,{source:b(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),p("div",{className:m("flex flex-col justify-center items-start",d().boxItem),children:[_?l("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((s,i)=>l(P,{children:s},i))}):null,n?l(z,{as:"h3",title:n||"",size:2,className:"shelf-display-product-title mb-1 line-clamp-2",html:n||""}):null,v?l($,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:v||""}):null,l("div",{className:"mb-2 mt-5 flex items-center",children:S?l("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:k?.soldOutText}):p(D,{children:[l("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:a?.availableForSale&&N||""}),l("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:a?.availableForSale&&B||""})]})}),p("div",{className:m("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?l(y,{variant:"secondary",onClick:()=>g(e,t?.index,t),className:`
6
+ ${t.direction==="vertical"?"w-full":""}
7
+ `,children:t?.secondaryButton||""}):null,t?.primaryButton?l(y,{variant:"primary",onClick:()=>w(e,t?.index,t),className:`
8
+ ${t.direction==="vertical"?"w-full":""}
9
+ `,children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{X as ShelfDisplayHorizontalItem,Q as ShelfDisplayWrapItem};
10
+ //# sourceMappingURL=shelfDisplayItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplayItem.tsx"],
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { isDisplayBackImage = false, itemShape } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength } = configuration || {}\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n const showSizeClass = (): {\n boxItem: string \n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n \n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'bg-container-secondary-1 tablet:hover:bg-info-white duration-300 gap-6',\n 'box-border w-full cursor-pointer overflow-hidden relative md-tablet:h-[360px]'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'relative overflow-hidden desktop:mb-0 mb-1')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n <div className={cn('flex flex-col justify-center items-start', showSizeClass().boxItem)}>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title mb-1 line-clamp-2\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "AA8DoD,OAuBxC,YAAAA,EAvBwC,OAAAC,EAuBxC,QAAAC,MAvBwC,oBA9D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AM+B,GAAsB,GAC9B,EACE,KACJtC,EAAC,OAAI,UAAU,8BACZ,SAAA4B,EACC5B,EAAC,OAAI,UAAU,sDAAuD,SAAAqB,GAAa,YAAY,EAE/FpB,EAAAF,EAAA,CACE,UAAAC,EAAC,OAAI,UAAU,kEACZ,SAAA0B,GAAS,kBAAmBM,GAAS,GACxC,EACAhC,EAAC,OAAI,UAAU,sFACZ,SAAA0B,GAAS,kBAAmBO,GAAa,GAC5C,GACF,EAEJ,EAEAhC,EAAC,OACC,UAAWK,EACT,0BACA,2CACAW,EAAc,YAAc,WAAa,WAAa,EACxD,EAEC,UAAAA,GAAe,gBACdjB,EAACQ,EAAA,CACC,QAAQ,YACR,QAAS,IAAMiB,EAAkBT,EAAMC,GAAe,MAAOA,CAAa,EAC1E,UAAW;AAAA,kBACTA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,gBAGvD,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,cACdjB,EAACQ,EAAA,CACC,QAAQ,UACR,QAAS,IAAMc,EAAgBN,EAAMC,GAAe,MAAOA,CAAa,EACxE,UAAW;AAAA,gBACXA,EAAc,YAAc,WAAa,SAAW,EAAE;AAAA,cAGrD,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAhHKD,GAAM,IAAMA,GAAM,MAiHzB,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "formatVariantPrice", "Picture", "Badge", "cn", "Text", "Button", "gaTrack", "trackUrlRef", "Heading", "componentType", "componentName", "SOLD_OUT_PRICE", "ShelfDisplayWrapItem", "data", "configuration", "isDisplayBackImage", "itemShape", "locale", "copyWriting", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "bottomContent", "ShelfDisplayHorizontalItem", "itemLength", "showSizeClass", "handleWrapClass"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as n,jsxs as D}from"react/jsx-runtime";import l,{useImperativeHandle as q,useRef as i,useEffect as B}from"react";import"@gsap/react";import{gsap as h}from"gsap";import{SplitText as G}from"gsap/dist/SplitText";import{ScrollTrigger as H}from"gsap/dist/ScrollTrigger";import{cn as p}from"../../helpers/utils.js";import{Heading as J,Text as K}from"../../components/index.js";import{withLayout as O}from"../../shared/Styles.js";import{useInView as Q}from"react-intersection-observer";import{useExposure as W}from"../../hooks/useExposure.js";const X="copy",Z="brand_slogan";function tt(f=[],m=3){const g=[];for(let e=0;e<f.length;e+=m)g.push(f.slice(e,e+m));return g}const z=l.forwardRef(({data:f,className:m=""},g)=>{const{title:e,features:o=[],featureChunkSize:N=3}=f,[v,k]=l.useState(0),[P,w]=l.useState(!0),y=i(null),T=i(null),b=i(null),d=tt(o,N),E=d.length,a=o.length>N,j=a?[...d,d[0]]:d,S=40;q(g,()=>y.current);const{ref:C,inView:I}=Q();W(y,{componentType:X,componentName:Z,componentTitle:e}),l.useEffect(()=>{if(!a)return;const t=setInterval(()=>{k(r=>r+1),w(!0)},3e3);return()=>clearInterval(t)},[E,a]),l.useEffect(()=>{if(a)if(v===E){const t=setTimeout(()=>{w(!1),k(0)},500);return()=>clearTimeout(t)}else w(!0)},[v,E,a]);const c=i(null),M=i(null),x=i(null);return B(()=>{h.registerPlugin(H,G);function t(){if(!c.current)return;x.current=new G(c.current,{type:"words",wordsClass:"word"});const r=c.current?.clientHeight||100,u=x.current.words;h.set(u,{opacity:0}),T.current=H.create({trigger:c.current,start:"bottom bottom-=4%",end:`bottom+=${r*1.5}px bottom-=4%`,scrub:!0,onUpdate:s=>{const V=s.progress,L=u.length,A=1/L,$=.5;u.forEach((F,U)=>{const Y=U/L*(1-$),_=A*(1+$);let R=(V-Y)/_;R=Math.max(0,Math.min(R,1)),h.set(F,{opacity:R})})}}),o&&o.length>0&&(b.current=H.create({trigger:M.current,start:`bottom+=${r*2}px bottom-=6%`,end:`bottom+=${r*2+100}px bottom-=6%`,onUpdate:s=>{h.set(M.current,{opacity:s.progress})}}))}return I&&t(),setTimeout(()=>{t()},1e3),()=>{x.current&&x.current.revert(),T.current&&T.current.kill(),b.current&&b.current.kill()}},[I]),n("div",{ref:C,children:D("div",{ref:y,className:p("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(J,{ref:c,as:"h2",size:2,weight:"bold",align:"left",className:p("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:p("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:n("div",{className:p(["flex flex-col",P?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${v*S}px)`},children:j.map((t,r)=>n("div",{className:p("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:t.map((u,s)=>D(l.Fragment,{children:[s>0&&n("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),n(K,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:u.title})]},s))},r))})})]})})});z.displayName="Slogan";var ft=O(z);export{Z as componentName,X as componentType,ft as default};
1
+ "use client";import{jsx as n,jsxs as D}from"react/jsx-runtime";import l,{useImperativeHandle as q,useRef as i,useEffect as B}from"react";import"@gsap/react";import{gsap as h}from"gsap";import{SplitText as G}from"gsap/dist/SplitText";import{ScrollTrigger as H}from"gsap/dist/ScrollTrigger";import{cn as p}from"../../helpers/utils.js";import{Heading as J,Text as K}from"../../components/index.js";import{withLayout as O}from"../../shared/Styles.js";import{useInView as Q}from"react-intersection-observer";import{useExposure as W}from"../../hooks/useExposure.js";const X="copy",Z="brand_slogan";function tt(f=[],m=3){const g=[];for(let t=0;t<f.length;t+=m)g.push(f.slice(t,t+m));return g}const z=l.forwardRef(({data:f,className:m=""},g)=>{const{title:t,features:o=[],featureChunkSize:N=3}=f,[v,k]=l.useState(0),[P,w]=l.useState(!0),y=i(null),T=i(null),b=i(null),d=tt(o,N),E=d.length,a=o.length>N,j=a?[...d,d[0]]:d,S=40;q(g,()=>y.current);const{ref:C,inView:I}=Q();W(y,{componentType:X,componentName:Z,componentTitle:t}),l.useEffect(()=>{if(!a)return;const e=setInterval(()=>{k(r=>r+1),w(!0)},3e3);return()=>clearInterval(e)},[E,a]),l.useEffect(()=>{if(a)if(v===E){const e=setTimeout(()=>{w(!1),k(0)},500);return()=>clearTimeout(e)}else w(!0)},[v,E,a]);const c=i(null),M=i(null),x=i(null);return B(()=>{h.registerPlugin(H,G);function e(){if(!c.current)return;x.current=new G(c.current,{type:"words",wordsClass:"word"});const r=c.current?.clientHeight||100,u=x.current.words;h.set(u,{opacity:0}),T.current=H.create({trigger:c.current,start:"bottom bottom-=4%",end:`bottom+=${r*1.5}px bottom-=4%`,scrub:!0,onUpdate:s=>{const V=s.progress,L=u.length,A=1/L,$=.5;u.forEach((F,U)=>{const Y=U/L*(1-$),_=A*(1+$);let R=(V-Y)/_;R=Math.max(0,Math.min(R,1)),h.set(F,{opacity:R})})}}),o&&o.length>0&&(b.current=H.create({trigger:M.current,start:`bottom+=${r*2}px bottom-=6%`,end:`bottom+=${r*2+100}px bottom-=6%`,onUpdate:s=>{h.set(M.current,{opacity:s.progress})}}))}return I&&e(),()=>{x.current&&x.current.revert(),T.current&&T.current.kill(),b.current&&b.current.kill()}},[I]),n("div",{ref:C,children:D("div",{ref:y,className:p("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(J,{ref:c,as:"h2",size:2,weight:"bold",align:"left",className:p("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:t}),o&&o.length>0&&n("div",{className:p("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:n("div",{className:p(["flex flex-col",P?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${v*S}px)`},children:j.map((e,r)=>n("div",{className:p("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:e.map((u,s)=>D(l.Fragment,{children:[s>0&&n("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),n(K,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:u.title})]},s))},r))})})]})})});z.displayName="Slogan";var ft=O(z);export{Z as componentName,X as componentType,ft 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, 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 scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const featuresTriggerRef = useRef<ScrollTrigger | null>(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 scrollTriggerRef.current = 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 featuresTriggerRef.current = 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 setTimeout(() => {\n gsapResize()\n }, 1000)\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n featuresTriggerRef.current && featuresTriggerRef.current.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": "aAiJQ,cAAAA,EAiCY,QAAAC,MAjCZ,oBAhJR,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,GAAWC,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,EAAO,SAAAC,EAAW,CAAC,EAAG,iBAAAC,EAAmB,CAAE,EAAIL,EACjD,CAACM,EAAYC,CAAa,EAA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I,IAAKyC,EACR,SAAAxC,EAAC,OACC,IAAKgC,EACL,UAAWxB,EACT,2KACAe,CACF,EAEA,UAAAxB,EAACU,EAAA,CACC,IAAKmC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWpC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa+B,CAAW,KAAK,EAC/F,SAAAxC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaW,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB7D,EAAC,OACC,UAAWS,EACT,8EACA,aAAa+B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB9D,EAACC,EAAM,SAAN,CACE,UAAA6D,EAAQ,GAAK/D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMmD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDvC,EAAO,YAAc,SAErB,IAAO0C,GAAQpD,EAAWU,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 scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const featuresTriggerRef = useRef<ScrollTrigger | null>(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 scrollTriggerRef.current = 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 featuresTriggerRef.current = 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 scrollTriggerRef.current && scrollTriggerRef.current.kill()\n featuresTriggerRef.current && featuresTriggerRef.current.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": "aA8IQ,cAAAA,EAiCY,QAAAC,MAjCZ,oBA7IR,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,GAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG,E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T,GACFM,EAAW,EAGN,IAAM,CACXD,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9Db,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,EAC1DC,EAAmB,SAAWA,EAAmB,QAAQ,KAAK,CAChE,CACF,EAAG,CAACO,CAAM,CAAC,EAGT1C,EAAC,OAAI,IAAKyC,EACR,SAAAxC,EAAC,OACC,IAAKgC,EACL,UAAWxB,EACT,2KACAe,CACF,EAEA,UAAAxB,EAACU,EAAA,CACC,IAAKmC,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,UAAWpC,EACT,sGACF,EACA,KAAMiB,EACR,EACCC,GAAYA,EAAS,OAAS,GAC7B3B,EAAC,OAAI,UAAWS,EAAG,gDAAiD,aAAa+B,CAAW,KAAK,EAC/F,SAAAxC,EAAC,OACC,UAAWS,EAAG,CACZ,gBACAsB,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaW,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,IACzB7D,EAAC,OACC,UAAWS,EACT,8EACA,aAAa+B,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,IACnB9D,EAACC,EAAM,SAAN,CACE,UAAA6D,EAAQ,GAAK/D,EAAC,OAAI,UAAU,wDAAwD,EACrFA,EAACW,EAAA,CACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMmD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDvC,EAAO,YAAc,SAErB,IAAO0C,GAAQpD,EAAWU,CAAM",
6
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", "scrollTriggerRef", "featuresTriggerRef", "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
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as s}from"react/jsx-runtime";import m,{useState as t}from"react";import{cn as u}from"../../helpers/utils.js";import{Swiper as c,SwiperSlide as d}from"swiper/react";import{Navigation as S,FreeMode as g,Mousewheel as x}from"swiper/modules";const n=m.forwardRef(({data:o,breakpoints:p,Slide:a,className:l,id:i})=>{const[B,f]=t(!0),[M,w]=t(!1);return s(c,{className:u(l),navigation:{nextEl:`.${i}-custom-swiper-button-next`,prevEl:`.${i}-custom-swiper-button-prev`},onProgress:e=>{f(e.isBeginning),w(e.isEnd)},modules:[S,g,x],freeMode:!0,mousewheel:{forceToAxis:!0},breakpoints:p||{0:{spaceBetween:12,slidesPerView:1,freeMode:!1},374:{spaceBetween:12,slidesPerView:1.2,freeMode:!1},768:{spaceBetween:16,slidesPerView:2,freeMode:!1}},children:o?.list?.map((e,r)=>s(d,{className:"!flex !h-[unset]",children:s(a,{data:e,configuration:o?.configuration?{...o?.configuration,index:r}:{index:r},jIndex:r})},i+"SwiperSlide"+r))})});n.displayName="SwiperBox";var N=n;export{N as default};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import c,{useState as t}from"react";import{cn as n}from"../../helpers/utils.js";import{Swiper as d,SwiperSlide as S}from"swiper/react";import{Navigation as g,FreeMode as x,Mousewheel as B}from"swiper/modules";const p=c.forwardRef(({data:o,breakpoints:a,Slide:l,className:f,id:i,itemClassName:w})=>{const[M,m]=t(!0),[E,u]=t(!1);return s(d,{className:n(f),navigation:{nextEl:`.${i}-custom-swiper-button-next`,prevEl:`.${i}-custom-swiper-button-prev`},onProgress:e=>{m(e.isBeginning),u(e.isEnd)},modules:[g,x,B],freeMode:!0,mousewheel:{forceToAxis:!0},breakpoints:a||{0:{spaceBetween:12,slidesPerView:1,freeMode:!1},374:{spaceBetween:12,slidesPerView:1.2,freeMode:!1},768:{spaceBetween:16,slidesPerView:2,freeMode:!1}},children:o?.list?.map((e,r)=>s(S,{className:n("!flex !h-[unset]",w),children:s(l,{data:e,configuration:o?.configuration?{...o?.configuration,index:r}:{index:r},jIndex:r})},i+"SwiperSlide"+r))})});p.displayName="SwiperBox";var b=p;export{b as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/SwiperBox/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\n// import 'swiper/css'\n// import 'swiper/css/free-mode'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, FreeMode, Mousewheel } from 'swiper/modules'\nimport type { SwiperBoxProps } from './types.js'\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(({ data, breakpoints, Slide, className, id }) => {\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n\n return (\n <Swiper\n className={cn(className)}\n navigation={{\n nextEl: `.${id}-custom-swiper-button-next`,\n prevEl: `.${id}-custom-swiper-button-prev`,\n }}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n modules={[Navigation, FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1,\n freeMode: false,\n },\n 374: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n freeMode: false,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: 2,\n freeMode: false,\n },\n }\n }\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!flex !h-[unset]\">\n <Slide\n data={item}\n configuration={data?.configuration ? { ...data?.configuration, index: jIndex } : { index: jIndex }}\n jIndex={jIndex}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
- "mappings": "aAmDU,cAAAA,MAAA,oBAlDV,OAAOC,GAAS,YAAAC,MAAgB,QAChC,OAAS,MAAAC,MAAU,yBAGnB,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,YAAAC,EAAU,cAAAC,MAAkB,iBAGjD,MAAMC,EAAYR,EAAM,WAA2C,CAAC,CAAE,KAAAS,EAAM,YAAAC,EAAa,MAAAC,EAAO,UAAAC,EAAW,GAAAC,CAAG,IAAM,CAClH,KAAM,CAACC,EAASC,CAAQ,EAAId,EAAS,EAAI,EACnC,CAACe,EAAOC,CAAM,EAAIhB,EAAS,EAAK,EAEtC,OACEF,EAACI,EAAA,CACC,UAAWD,EAAGU,CAAS,EACvB,WAAY,CACV,OAAQ,IAAIC,CAAE,6BACd,OAAQ,IAAIA,CAAE,4BAChB,EACA,WAAYK,GAAU,CACpBH,EAASG,EAAO,WAAW,EAC3BD,EAAOC,EAAO,KAAK,CACrB,EACA,QAAS,CAACb,EAAYC,EAAUC,CAAU,EAC1C,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,YACEG,GAAe,CACb,EAAG,CACD,aAAc,GACd,cAAe,EACf,SAAU,EACZ,EACA,IAAK,CACH,aAAc,GACd,cAAe,IACf,SAAU,EACZ,EACA,IAAK,CACH,aAAc,GACd,cAAe,EACf,SAAU,EACZ,CACF,EAGD,SAAAD,GAAM,MAAM,IAAI,CAACU,EAAMC,IACtBrB,EAACK,EAAA,CAA8C,UAAU,mBACvD,SAAAL,EAACY,EAAA,CACC,KAAMQ,EACN,cAAeV,GAAM,cAAgB,CAAE,GAAGA,GAAM,cAAe,MAAOW,CAAO,EAAI,CAAE,MAAOA,CAAO,EACjG,OAAQA,EACV,GALgBP,EAAK,cAAgBO,CAMvC,CACD,EACH,CAEJ,CAAC,EAEDZ,EAAU,YAAc,YAExB,IAAOa,EAAQb",
6
- "names": ["jsx", "React", "useState", "cn", "Swiper", "SwiperSlide", "Navigation", "FreeMode", "Mousewheel", "SwiperBox", "data", "breakpoints", "Slide", "className", "id", "isStart", "setStart", "isEnd", "setEnd", "swiper", "item", "jIndex", "SwiperBox_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\n// import 'swiper/css'\n// import 'swiper/css/free-mode'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, FreeMode, Mousewheel } from 'swiper/modules'\nimport type { SwiperBoxProps } from './types.js'\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(({ data, breakpoints, Slide, className, id, itemClassName }) => {\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n\n return (\n <Swiper\n className={cn(className)}\n navigation={{\n nextEl: `.${id}-custom-swiper-button-next`,\n prevEl: `.${id}-custom-swiper-button-prev`,\n }}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n modules={[Navigation, FreeMode, Mousewheel]}\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n slidesPerView: 1,\n freeMode: false,\n },\n 374: {\n spaceBetween: 12,\n slidesPerView: 1.2,\n freeMode: false,\n },\n 768: {\n spaceBetween: 16,\n slidesPerView: 2,\n freeMode: false,\n },\n }\n }\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className={cn('!flex !h-[unset]', itemClassName)}>\n <Slide\n data={item}\n configuration={data?.configuration ? { ...data?.configuration, index: jIndex } : { index: jIndex }}\n jIndex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,CAMvC,CACD,EACH,CAEJ,CAAC,EAEDb,EAAU,YAAc,YAExB,IAAOc,EAAQd",
6
+ "names": ["jsx", "React", "useState", "cn", "Swiper", "SwiperSlide", "Navigation", "FreeMode", "Mousewheel", "SwiperBox", "data", "breakpoints", "Slide", "className", "id", "itemClassName", "isStart", "setStart", "isEnd", "setEnd", "swiper", "item", "jIndex", "SwiperBox_default"]
7
7
  }
@@ -7,6 +7,7 @@ export interface SwiperBoxProps {
7
7
  };
8
8
  id: string;
9
9
  className?: string;
10
+ itemClassName?: string;
10
11
  breakpoints?: Record<number, Object>;
11
12
  Slide: React.ComponentType<{
12
13
  data: any;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/SwiperBox/types.ts"],
4
- "sourcesContent": ["import React from 'react'\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n onVideoPlayBtnClick?: (jIndex: number) => void\n }\n id: string\n className?: string\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any; jIndex?: number }>\n}\n"],
4
+ "sourcesContent": ["import React from 'react'\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n onVideoPlayBtnClick?: (jIndex: number) => void\n }\n id: string\n className?: string\n itemClassName?: string\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any; jIndex?: number }>\n}\n"],
5
5
  "mappings": "AAAA,MAAkB",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{withLayout as n}from"../../shared/Styles.js";import*as i from"../../components/tabs.js";import{cn as f}from"../../helpers/index.js";import u from"react";import d from"../ShelfDisplay/index.js";import y from"../AccordionCards/index.js";import N from"../Faq/index.js";import k from"../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js";import g from"../Title/index.js";const h=u.forwardRef(({data:o,className:m},l)=>{const{theme:c,shape:p,align:T,tabs:r,sectionTitle:s}=o,b=a=>a?.blockType==="ipc-shelfdisplay"?e(d,{data:a}):a?.blockType==="ipc-multiLayoutGraphicBlock"?e(k,{data:a}):a?.blockType==="ipc-accordioncards"?e(y,{data:a}):a?.blockType==="ipc-faq"?e(N,{data:a}):null;return t("section",{ref:l,className:f(c==="dark"?"aiui-dark":"",m),children:[s&&e(g,{className:"section-title",data:{title:s}}),t(i.Tabs,{shape:p,align:T,defaultValue:r[0].tabName,children:[e(i.TabsList,{className:"tabs-list",children:r.map(a=>e(i.TabsTrigger,{value:a.tabName,className:"tabs-trigger",children:a.tabName},a.tabName))}),r.map(a=>e(i.TabsContent,{value:a.tabName,className:"tabs-content",children:a.tabContent?.[0]?b(a.tabContent?.[0]):null},a.tabName))]})]})});var M=n(h);export{M as default};
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{withLayout as f}from"../../shared/Styles.js";import*as i from"../../components/tabs.js";import{cn as u}from"../../helpers/index.js";import n from"react";import d from"../ShelfDisplay/index.js";import y from"../AccordionCards/index.js";import k from"../Faq/index.js";import N from"../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js";import h from"../Title/index.js";import g from"../Graphic/index.js";const v=n.forwardRef(({data:o,className:m},l)=>{const{theme:p,shape:c,align:T,tabs:r,sectionTitle:s}=o,b=a=>a?.blockType==="ipc-shelfdisplay"?e(d,{data:a}):a?.blockType==="ipc-multiLayoutGraphicBlock"?e(N,{data:a}):a?.blockType==="ipc-accordioncards"?e(y,{data:a}):a?.blockType==="ipc-faq"?e(k,{data:a}):a?.blockType==="ipc-graphic"?e(g,{data:a}):null;return t("section",{ref:l,className:u(p==="dark"?"aiui-dark":"",m),children:[s&&e(h,{className:"section-title",data:{title:s}}),t(i.Tabs,{shape:c,align:T,defaultValue:r[0].tabName,children:[e(i.TabsList,{className:"tabs-list",children:r.map(a=>e(i.TabsTrigger,{value:a.tabName,className:"tabs-trigger",children:a.tabName},a.tabName))}),r.map(a=>e(i.TabsContent,{value:a.tabName,className:"tabs-content",children:a.tabContent?.[0]?b(a.tabContent?.[0]):null},a.tabName))]})]})});var A=f(v);export{A as default};
2
2
  //# sourceMappingURL=Tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Tabs/Tabs.tsx"],
4
- "sourcesContent": ["'use client'\nimport { withLayout } from '../../shared/Styles.js'\nimport * as TabsPrimitive from '../../components/tabs.js'\nimport { cn } from '../../helpers/index.js'\nimport type { TabsProps } from './types.js'\nimport React from 'react'\nimport ShelfDisplay from '../ShelfDisplay/index.js'\nimport AccordionCards from '../AccordionCards/index.js'\nimport Faq from '../Faq/index.js'\nimport MultiLayoutGraphicBlock from '../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js'\nimport Title from '../Title/index.js'\n\nconst Tabs = React.forwardRef<HTMLDivElement, TabsProps>(({ data, className }, forwardedRef) => {\n const { theme, shape, align, tabs, sectionTitle } = data\n\n const renderTabContent = (tabContent: TabsProps['data']['tabs'][number]['tabContent'][number]) => {\n if (tabContent?.blockType === 'ipc-shelfdisplay') {\n return <ShelfDisplay data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-multiLayoutGraphicBlock') {\n return <MultiLayoutGraphicBlock data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-accordioncards') {\n return <AccordionCards data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-faq') {\n return <Faq data={tabContent} />\n } else {\n return null\n }\n }\n\n return (\n <section ref={forwardedRef} className={cn(theme === 'dark' ? 'aiui-dark' : '', className)}>\n {sectionTitle && <Title className=\"section-title\" data={{ title: sectionTitle }} />}\n <TabsPrimitive.Tabs shape={shape} align={align} defaultValue={tabs[0].tabName}>\n <TabsPrimitive.TabsList className=\"tabs-list\">\n {tabs.map(tab => (\n <TabsPrimitive.TabsTrigger key={tab.tabName} value={tab.tabName} className=\"tabs-trigger\">\n {tab.tabName}\n </TabsPrimitive.TabsTrigger>\n ))}\n </TabsPrimitive.TabsList>\n {tabs.map(tab => (\n <TabsPrimitive.TabsContent key={tab.tabName} value={tab.tabName} className=\"tabs-content\">\n {tab.tabContent?.[0] ? renderTabContent(tab.tabContent?.[0]) : null}\n </TabsPrimitive.TabsContent>\n ))}\n </TabsPrimitive.Tabs>\n </section>\n )\n})\n\nexport default withLayout(Tabs)\n"],
5
- "mappings": "aAiBa,cAAAA,EAeP,QAAAC,MAfO,oBAhBb,OAAS,cAAAC,MAAkB,yBAC3B,UAAYC,MAAmB,2BAC/B,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAW,QAClB,OAAOC,MAAkB,2BACzB,OAAOC,MAAoB,6BAC3B,OAAOC,MAAS,kBAChB,OAAOC,MAA6B,wDACpC,OAAOC,MAAW,oBAElB,MAAMC,EAAON,EAAM,WAAsC,CAAC,CAAE,KAAAO,EAAM,UAAAC,CAAU,EAAGC,IAAiB,CAC9F,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAM,aAAAC,CAAa,EAAIP,EAE9CQ,EAAoBC,GACpBA,GAAY,YAAc,mBACrBrB,EAACM,EAAA,CAAa,KAAMe,EAAY,EAC9BA,GAAY,YAAc,8BAC5BrB,EAACS,EAAA,CAAwB,KAAMY,EAAY,EACzCA,GAAY,YAAc,qBAC5BrB,EAACO,EAAA,CAAe,KAAMc,EAAY,EAChCA,GAAY,YAAc,UAC5BrB,EAACQ,EAAA,CAAI,KAAMa,EAAY,EAEvB,KAIX,OACEpB,EAAC,WAAQ,IAAKa,EAAc,UAAWV,EAAGW,IAAU,OAAS,YAAc,GAAIF,CAAS,EACrF,UAAAM,GAAgBnB,EAACU,EAAA,CAAM,UAAU,gBAAgB,KAAM,CAAE,MAAOS,CAAa,EAAG,EACjFlB,EAACE,EAAc,KAAd,CAAmB,MAAOa,EAAO,MAAOC,EAAO,aAAcC,EAAK,CAAC,EAAE,QACpE,UAAAlB,EAACG,EAAc,SAAd,CAAuB,UAAU,YAC/B,SAAAe,EAAK,IAAII,GACRtB,EAACG,EAAc,YAAd,CAA4C,MAAOmB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SADyBA,EAAI,OAEpC,CACD,EACH,EACCJ,EAAK,IAAII,GACRtB,EAACG,EAAc,YAAd,CAA4C,MAAOmB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,aAAa,CAAC,EAAIF,EAAiBE,EAAI,aAAa,CAAC,CAAC,EAAI,MADjCA,EAAI,OAEpC,CACD,GACH,GACF,CAEJ,CAAC,EAED,IAAOC,EAAQrB,EAAWS,CAAI",
6
- "names": ["jsx", "jsxs", "withLayout", "TabsPrimitive", "cn", "React", "ShelfDisplay", "AccordionCards", "Faq", "MultiLayoutGraphicBlock", "Title", "Tabs", "data", "className", "forwardedRef", "theme", "shape", "align", "tabs", "sectionTitle", "renderTabContent", "tabContent", "tab", "Tabs_default"]
4
+ "sourcesContent": ["'use client'\nimport { withLayout } from '../../shared/Styles.js'\nimport * as TabsPrimitive from '../../components/tabs.js'\nimport { cn } from '../../helpers/index.js'\nimport type { TabsProps } from './types.js'\nimport React from 'react'\nimport ShelfDisplay from '../ShelfDisplay/index.js'\nimport AccordionCards from '../AccordionCards/index.js'\nimport Faq from '../Faq/index.js'\nimport MultiLayoutGraphicBlock from '../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js'\nimport Title from '../Title/index.js'\nimport Graphic from '../Graphic/index.js'\n\nconst Tabs = React.forwardRef<HTMLDivElement, TabsProps>(({ data, className }, forwardedRef) => {\n const { theme, shape, align, tabs, sectionTitle } = data\n\n const renderTabContent = (tabContent: TabsProps['data']['tabs'][number]['tabContent'][number]) => {\n if (tabContent?.blockType === 'ipc-shelfdisplay') {\n return <ShelfDisplay data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-multiLayoutGraphicBlock') {\n return <MultiLayoutGraphicBlock data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-accordioncards') {\n return <AccordionCards data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-faq') {\n return <Faq data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-graphic') {\n return <Graphic data={tabContent} />\n } else {\n return null\n }\n }\n\n return (\n <section ref={forwardedRef} className={cn(theme === 'dark' ? 'aiui-dark' : '', className)}>\n {sectionTitle && <Title className=\"section-title\" data={{ title: sectionTitle }} />}\n <TabsPrimitive.Tabs shape={shape} align={align} defaultValue={tabs[0].tabName}>\n <TabsPrimitive.TabsList className=\"tabs-list\">\n {tabs.map(tab => (\n <TabsPrimitive.TabsTrigger key={tab.tabName} value={tab.tabName} className=\"tabs-trigger\">\n {tab.tabName}\n </TabsPrimitive.TabsTrigger>\n ))}\n </TabsPrimitive.TabsList>\n {tabs.map(tab => (\n <TabsPrimitive.TabsContent key={tab.tabName} value={tab.tabName} className=\"tabs-content\">\n {tab.tabContent?.[0] ? renderTabContent(tab.tabContent?.[0]) : null}\n </TabsPrimitive.TabsContent>\n ))}\n </TabsPrimitive.Tabs>\n </section>\n )\n})\n\nexport default withLayout(Tabs)\n"],
5
+ "mappings": "aAkBa,cAAAA,EAiBP,QAAAC,MAjBO,oBAjBb,OAAS,cAAAC,MAAkB,yBAC3B,UAAYC,MAAmB,2BAC/B,OAAS,MAAAC,MAAU,yBAEnB,OAAOC,MAAW,QAClB,OAAOC,MAAkB,2BACzB,OAAOC,MAAoB,6BAC3B,OAAOC,MAAS,kBAChB,OAAOC,MAA6B,wDACpC,OAAOC,MAAW,oBAClB,OAAOC,MAAa,sBAEpB,MAAMC,EAAOP,EAAM,WAAsC,CAAC,CAAE,KAAAQ,EAAM,UAAAC,CAAU,EAAGC,IAAiB,CAC9F,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAM,aAAAC,CAAa,EAAIP,EAE9CQ,EAAoBC,GACpBA,GAAY,YAAc,mBACrBtB,EAACM,EAAA,CAAa,KAAMgB,EAAY,EAC9BA,GAAY,YAAc,8BAC5BtB,EAACS,EAAA,CAAwB,KAAMa,EAAY,EACzCA,GAAY,YAAc,qBAC5BtB,EAACO,EAAA,CAAe,KAAMe,EAAY,EAChCA,GAAY,YAAc,UAC5BtB,EAACQ,EAAA,CAAI,KAAMc,EAAY,EACrBA,GAAY,YAAc,cAC5BtB,EAACW,EAAA,CAAQ,KAAMW,EAAY,EAE3B,KAIX,OACErB,EAAC,WAAQ,IAAKc,EAAc,UAAWX,EAAGY,IAAU,OAAS,YAAc,GAAIF,CAAS,EACrF,UAAAM,GAAgBpB,EAACU,EAAA,CAAM,UAAU,gBAAgB,KAAM,CAAE,MAAOU,CAAa,EAAG,EACjFnB,EAACE,EAAc,KAAd,CAAmB,MAAOc,EAAO,MAAOC,EAAO,aAAcC,EAAK,CAAC,EAAE,QACpE,UAAAnB,EAACG,EAAc,SAAd,CAAuB,UAAU,YAC/B,SAAAgB,EAAK,IAAII,GACRvB,EAACG,EAAc,YAAd,CAA4C,MAAOoB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SADyBA,EAAI,OAEpC,CACD,EACH,EACCJ,EAAK,IAAII,GACRvB,EAACG,EAAc,YAAd,CAA4C,MAAOoB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,aAAa,CAAC,EAAIF,EAAiBE,EAAI,aAAa,CAAC,CAAC,EAAI,MADjCA,EAAI,OAEpC,CACD,GACH,GACF,CAEJ,CAAC,EAED,IAAOC,EAAQtB,EAAWU,CAAI",
6
+ "names": ["jsx", "jsxs", "withLayout", "TabsPrimitive", "cn", "React", "ShelfDisplay", "AccordionCards", "Faq", "MultiLayoutGraphicBlock", "Title", "Graphic", "Tabs", "data", "className", "forwardedRef", "theme", "shape", "align", "tabs", "sectionTitle", "renderTabContent", "tabContent", "tab", "Tabs_default"]
7
7
  }
@@ -1,8 +1,9 @@
1
1
  import type { Align, Shape, Theme } from '../../types/props.js';
2
2
  import type { MultiLayoutGraphicBlockProps } from '../MultiLayoutGraphicBlock/types.js';
3
- import type { ShelfDisplayProps } from '../ShelfDisplay/index.js';
3
+ import type { ShelfDisplayProps } from '../ShelfDisplay/shelfDisplay.js';
4
4
  import type { AccordionCardsType } from '../AccordionCards/index.js';
5
5
  import type { FaqProps } from '../Faq/types.js';
6
+ import type { GraphicProps } from '../Graphic/index.js';
6
7
  export type TabsProps = {
7
8
  data: {
8
9
  sectionTitle?: string;
@@ -19,6 +20,8 @@ export type TabsProps = {
19
20
  blockType: 'ipc-accordioncards';
20
21
  })[] | (FaqProps['data'] & {
21
22
  blockType: 'ipc-faq';
23
+ })[] | (GraphicProps['data'] & {
24
+ blockType: 'ipc-graphic';
22
25
  })[];
23
26
  }[];
24
27
  };
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Dialog as x,DialogContent as p}from"../../components/dialog.js";import{Picture as n,Text as l}from"../../components/index.js";import"../../helpers/index.js";const m=a=>{const{textVisible:s,extension:e,onCloseModal:i}=a;return t(x,{open:s,onOpenChange:()=>i(),children:t(p,{className:" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:o("div",{className:" relative",children:[t(n,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:" w-full",imgClassName:" object-cover"}),t("div",{className:" tablet:inset-x-[32px] tablet:top-[32px] absolute inset-x-[16px] top-[16px]",children:o("div",{className:"flex items-center justify-between text-white",children:[t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"}),t("div",{onClick:()=>i(),className:" cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})})]})}),o("div",{className:"tablet:p-[32px] p-[16px] text-[#1D1D1F]",children:[t(l,{html:e?.text,className:" tablet:text-[24px] text-[20px] font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-[16px] font-bold leading-[1.4]"})]})]})})})};export{m as TextModal};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Dialog as n,DialogContent as x}from"../../components/dialog.js";import{Picture as d,Text as l}from"../../components/index.js";import"../../helpers/index.js";const p=i=>{const{textVisible:s,extension:e,onCloseModal:o}=i;return t(n,{open:s,onOpenChange:()=>o(),children:t(x,{className:" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden",children:a("div",{className:"tablet:rounded-2xl overflow-hidden rounded-lg",children:[t("div",{className:"min-h-[260px] w-full",children:t(d,{source:`${e?.textPcImg?.url||""} , ${e?.textMobileImg?.url||""} 767`,className:"size-full",imgClassName:"w-full h-full object-cover"})}),t("div",{className:"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4",children:t(l,{html:e?.textTitle,className:"tablet:text-[24px] text-[20px] font-bold leading-[1.2]"})}),t("div",{onClick:()=>o(),className:"absolute right-4 top-4 cursor-pointer",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:t("g",{"clip-path":"url(#clip0_2548_10038)",children:t("path",{d:"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z",fill:"white"})})})}),a("div",{className:"tablet:p-8 p-4 text-[#1D1D1F]",children:[t(l,{html:e?.text,className:" tablet:text-2xl text-xl font-bold leading-[1.2]"}),t("br",{}),t(l,{html:e?.textDesc,className:"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]"})]})]})})})};export{p as TextModal};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/TextModal/index.tsx"],
4
- "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\" relative\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\" w-full\"\n imgClassName=\" object-cover\"\n />\n <div className=\" tablet:inset-x-[32px] tablet:top-[32px] absolute inset-x-[16px] top-[16px]\">\n <div className=\"flex items-center justify-between text-white\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n <div onClick={() => onCloseModal()} className=\" cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n </div>\n </div>\n <div className=\"tablet:p-[32px] p-[16px] text-[#1D1D1F]\">\n <Text html={extension?.text} className=\" tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n <br />\n <Text\n html={extension?.textDesc}\n className=\"tablet:leading-[1.2] pt-1 text-[16px] font-bold leading-[1.4]\"\n />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
5
- "mappings": "AAyBU,cAAAA,EAME,QAAAC,MANF,oBAxBV,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,MAAmB,yBAenB,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,aAAAC,CAAa,EAAIH,EAEjD,OACEP,EAACE,EAAA,CAAO,KAAMM,EAAa,aAAc,IAAME,EAAa,EAC1D,SAAAV,EAACG,EAAA,CAAc,UAAU,sKACvB,SAAAF,EAAC,OAAI,UAAU,YACb,UAAAD,EAACI,EAAA,CACC,OAAQ,GAAGK,GAAW,WAAW,KAAO,EAAE,MAAMA,GAAW,eAAe,KAAO,EAAE,OACnF,UAAU,UACV,aAAa,gBACf,EACAT,EAAC,OAAI,UAAU,8EACb,SAAAC,EAAC,OAAI,UAAU,+CACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,UAAW,UAAU,yDAAyD,EACrGT,EAAC,OAAI,QAAS,IAAMU,EAAa,EAAG,UAAU,kBAC5C,SAAAV,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,SAAAA,EAAC,KAAE,YAAU,yBACX,SAAAA,EAAC,QACC,EAAE,0gBACF,KAAK,QACP,EACF,EACF,EACF,GACF,EACF,EACAC,EAAC,OAAI,UAAU,0CACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,KAAM,UAAU,0DAA0D,EACjGT,EAAC,OAAG,EACJA,EAACK,EAAA,CACC,KAAMI,GAAW,SACjB,UAAU,gEACZ,GACF,GACF,EACF,EACF,CAEJ",
4
+ "sourcesContent": ["import type { Media } from '../../types/props.js'\nimport { Dialog, DialogContent } from '../../components/dialog.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Img } from '../../types/props.js'\n\nexport type TextModalType = {\n textVisible: boolean\n extension?: {\n textPcImg: Img\n textMobileImg: Img\n textTitle: string\n text: string\n textDesc: string\n }\n onCloseModal: () => void\n}\n\nconst TextModal = (props: TextModalType) => {\n const { textVisible, extension, onCloseModal } = props\n\n return (\n <Dialog open={textVisible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\" tablet:max-h-[535px] tablet:max-w-[896px] md-tablet:h-[490px] md-tablet:w-[358px] tablet:rounded-2xl mx-auto rounded-lg border-none bg-white p-0 [&_button]:hidden\">\n <div className=\"tablet:rounded-2xl overflow-hidden rounded-lg\">\n <div className=\"min-h-[260px] w-full\">\n <Picture\n source={`${extension?.textPcImg?.url || ''} , ${extension?.textMobileImg?.url || ''} 767`}\n className=\"size-full\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n <div className=\"tablet:inset-x-8 tablet:top-8 absolute inset-x-4 top-4\">\n <Text html={extension?.textTitle} className=\"tablet:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n </div>\n <div onClick={() => onCloseModal()} className=\"absolute right-4 top-4 cursor-pointer\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"25\" viewBox=\"0 0 24 25\" fill=\"none\">\n <g clip-path=\"url(#clip0_2548_10038)\">\n <path\n d=\"M5.63545 6.13604C6.02592 5.74546 6.65913 5.74551 7.04966 6.13604L11.9994 11.0858L16.9492 6.13604C17.3397 5.74552 17.9729 5.74546 18.3634 6.13604C18.7538 6.52659 18.7538 7.15972 18.3634 7.55025L13.4136 12.5L18.3634 17.4497C18.7538 17.8403 18.7538 18.4734 18.3634 18.864C17.9729 19.2545 17.3397 19.2545 16.9492 18.864L11.9994 13.9142L7.04966 18.864C6.65913 19.2545 6.02592 19.2545 5.63545 18.864C5.24501 18.4734 5.24502 17.8403 5.63545 17.4497L10.5852 12.5L5.63545 7.55025C5.24502 7.15972 5.24501 6.52658 5.63545 6.13604Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n </div>\n <div className=\"tablet:p-8 p-4 text-[#1D1D1F]\">\n <Text html={extension?.text} className=\" tablet:text-2xl text-xl font-bold leading-[1.2]\" />\n <br />\n <Text html={extension?.textDesc} className=\"tablet:leading-[1.2] pt-1 text-base font-bold leading-[1.4]\" />\n </div>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { TextModal }\n"],
5
+ "mappings": "AA0BY,cAAAA,EAmBF,QAAAC,MAnBE,oBAzBZ,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,MAAmB,yBAenB,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,YAAAC,EAAa,UAAAC,EAAW,aAAAC,CAAa,EAAIH,EAEjD,OACEP,EAACE,EAAA,CAAO,KAAMM,EAAa,aAAc,IAAME,EAAa,EAC1D,SAAAV,EAACG,EAAA,CAAc,UAAU,sKACvB,SAAAF,EAAC,OAAI,UAAU,gDACb,UAAAD,EAAC,OAAI,UAAU,uBACb,SAAAA,EAACI,EAAA,CACC,OAAQ,GAAGK,GAAW,WAAW,KAAO,EAAE,MAAMA,GAAW,eAAe,KAAO,EAAE,OACnF,UAAU,YACV,aAAa,6BACf,EACF,EACAT,EAAC,OAAI,UAAU,yDACb,SAAAA,EAACK,EAAA,CAAK,KAAMI,GAAW,UAAW,UAAU,yDAAyD,EACvG,EACAT,EAAC,OAAI,QAAS,IAAMU,EAAa,EAAG,UAAU,wCAC5C,SAAAV,EAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,SAAAA,EAAC,KAAE,YAAU,yBACX,SAAAA,EAAC,QACC,EAAE,0gBACF,KAAK,QACP,EACF,EACF,EACF,EACAC,EAAC,OAAI,UAAU,gCACb,UAAAD,EAACK,EAAA,CAAK,KAAMI,GAAW,KAAM,UAAU,mDAAmD,EAC1FT,EAAC,OAAG,EACJA,EAACK,EAAA,CAAK,KAAMI,GAAW,SAAU,UAAU,8DAA8D,GAC3G,GACF,EACF,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "Dialog", "DialogContent", "Picture", "Text", "TextModal", "props", "textVisible", "extension", "onCloseModal"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as n,jsxs as b}from"react/jsx-runtime";import z,{useEffect as U,useRef as r,useImperativeHandle as j}from"react";import{gsap as c}from"gsap";import{SplitText as w}from"gsap/dist/SplitText";import{ScrollTrigger as x}from"gsap/dist/ScrollTrigger";import{cn as v}from"../../helpers/utils.js";import{Heading as B}from"../../components/index.js";import{withLayout as C}from"../../shared/Styles.js";import{useExposure as F}from"../../hooks/useExposure.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useInView as q}from"react-intersection-observer";const T="link",k="title",y=z.forwardRef(({data:m,className:L},R)=>{const{title:p,caption:u,theme:f,extensions:o}=m,i=r(null),t=r(null),e=r(null),s=r(null),{ref:H,inView:d}=q();return j(R,()=>i.current),F(i,{componentType:T,componentName:k,componentTitle:m?.title}),U(()=>{c.registerPlugin(w,x);function E(){if(!t.current)return;const M=t.current?.clientHeight||80;e.current=new w(t.current,{type:"words",wordsClass:"word"});const l=e.current.words;c.set(l,{opacity:0}),s.current=x.create({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${M*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:N=>{const D=N.progress,g=l.length,S=1/g,h=.5;l.forEach((I,P)=>{const V=P/g*(1-h),$=S*(1+h);let a=(D-V)/$;a=Math.max(0,Math.min(a,1)),c.set(I,{opacity:a})})}})}return d&&E(),()=>{e.current&&e.current.revert(),s.current&&s.current.kill()}},[d]),(p||u)&&b("div",{className:"mb-6 flex items-end justify-between overflow-hidden",ref:i,children:[n("div",{ref:H,className:v("space-y-4 flex-1",L,{"aiui-dark":f==="dark"}),children:n(B,{ref:t,as:"h2",size:4,html:u||p})}),o?.textLink&&b("a",{className:v({"aiui-dark":f==="dark"},"flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:_(o?.link,`${T}_${k}`),children:[o?.textLink,n("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:n("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777","stroke-width":"1.5","stroke-linecap":"round"})})]})]})});y.displayName="Title";var tt=C(y);export{tt as default};
1
+ "use client";import{jsx as n,jsxs as b}from"react/jsx-runtime";import z,{useEffect as U,useRef as r,useImperativeHandle as j}from"react";import{gsap as p}from"gsap";import{SplitText as v}from"gsap/dist/SplitText";import{ScrollTrigger as T}from"gsap/dist/ScrollTrigger";import{cn as k}from"../../helpers/utils.js";import{Heading as B}from"../../components/index.js";import{withLayout as C}from"../../shared/Styles.js";import{useExposure as F}from"../../hooks/useExposure.js";import{trackUrlRef as _}from"../../shared/trackUrlRef.js";import{useInView as q}from"react-intersection-observer";const u="link",f="title",y=z.forwardRef(({data:d,className:L},R)=>{const{title:o,caption:i,theme:g,extensions:s}=d,l=r(null),t=r(null),e=r(null),a=r(null),{ref:H,inView:h}=q();return j(R,()=>l.current),F(l,{componentType:u,componentName:f,componentTitle:d?.title}),U(()=>{p.registerPlugin(v,T);function E(){if(!t.current)return;const M=t.current?.clientHeight||80;e.current=new v(t.current,{type:"words",wordsClass:"word"});const c=e.current.words;p.set(c,{opacity:0}),a.current=T.create({trigger:t.current,start:"bottom bottom-=4%",end:`bottom+=${M*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:N=>{const $=N.progress,w=c.length,D=1/w,x=.5;c.forEach((S,I)=>{const P=I/w*(1-x),V=D*(1+x);let m=($-P)/V;m=Math.max(0,Math.min(m,1)),p.set(S,{opacity:m})})}})}return h&&E(),()=>{e.current&&e.current.revert(),a.current&&a.current.kill()}},[h]),(o||i)&&b("div",{className:"mb-6 flex items-end justify-between overflow-hidden title-box",ref:l,children:[n("div",{ref:H,className:k("space-y-4 flex-1",L,{"aiui-dark":g==="dark"}),children:n(B,{ref:t,as:"h1",size:4,html:i||o})}),s?.textLink&&b("a",{className:k({"aiui-dark":g==="dark"},"flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:_(s?.link,`${u}_${f}`),"data-headless-type-name":`${u}#${f}`,"data-headless-title-desc-button":`${o}#${i}`,children:[s?.textLink,n("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:n("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777","stroke-width":"1.5","stroke-linecap":"round"})})]})]})});y.displayName="Title";var tt=C(y);export{tt as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, caption, theme, extensions } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div className=\"mb-6 flex items-end justify-between overflow-hidden\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4 flex-1', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={caption || title} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n >\n {extensions?.textLink}\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "aAgFU,cAAAA,EAGA,QA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GAAQjC,EAAWM,CAAK",
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, caption, theme, extensions } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div className=\"mb-6 flex items-end justify-between overflow-hidden title-box\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4 flex-1', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h1\" size={4} html={caption || title} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n {extensions?.textLink}\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n ></path>\n </svg>\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "aAgFU,cAAAA,EAGA,QAAAC,MAHA,oBA/EV,OAAOC,GAAS,aAAAC,EAAW,UAAAC,EAAQ,uBAAAC,MAA2B,QAC9D,OAAS,QAAAC,MAAY,OACrB,OAAS,aAAAC,MAAiB,sBAC1B,OAAS,iBAAAC,MAAqB,0BAC9B,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,MAAe,4BACxB,OAAS,cAAAC,MAAkB,yBAE3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,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AI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1CrC,EAAK,IAAIiC,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIb,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,GAGRT,GAASC,IACRrB,EAAC,OAAI,UAAU,gEAAgE,IAAKwB,EAClF,UAAAzB,EAAC,OAAI,IAAK6B,EAAW,UAAWpB,EAAG,mBAAoBU,EAAW,CAAE,YAAaI,IAAU,MAAO,CAAC,EACjG,SAAAvB,EAACU,EAAA,CAAQ,IAAKgB,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMJ,GAAWD,EAAO,EACnE,EACCG,GAAY,UACXvB,EAAC,KACC,UAAWQ,EACT,CAAE,YAAac,IAAU,MAAO,EAChC,sHACF,EACA,KAAMV,EAAYW,GAAY,KAAM,GAAGT,CAAa,IAAIC,CAAa,EAAE,EACvE,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGK,CAAK,IAAIC,CAAO,GAEnD,UAAAE,GAAY,SACbxB,EAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,SAAAA,EAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,eAAa,MACb,iBAAe,QAChB,EACH,GACF,GAEJ,CAGN,CAAC,EAEDiB,EAAM,YAAc,QAEpB,IAAO2B,GAAQjC,EAAWM,CAAK",
6
6
  "names": ["jsx", "jsxs", "React", "useEffect", "useRef", "useImperativeHandle", "gsap", "SplitText", "ScrollTrigger", "cn", "Heading", "withLayout", "useExposure", "trackUrlRef", "useInView", "componentType", "componentName", "Title", "data", "className", "ref", "title", "caption", "theme", "extensions", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "Title_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{cn as l}from"../../helpers/utils.js";import o from"react-youtube";function u({youTubeId:e,className:r}){return e?t(o,{className:l("relative size-full",r),videoId:e,opts:{playerVars:{autoplay:1,rel:0,mute:1},width:"100%",height:"100%"}}):null}export{u as YouTubePlayer};
1
+ import{jsx as t}from"react/jsx-runtime";import{cn as r}from"../../helpers/utils.js";import l from"react-youtube";function a({youTubeId:e,className:o}){return e?t(l,{className:r("relative size-full overflow-hidden rounded-2xl",o),videoId:e,opts:{playerVars:{autoplay:1,rel:0,mute:1},width:"100%",height:"100%"}}):null}export{a as YouTubePlayer};
2
2
  //# sourceMappingURL=YouTubePlayer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/VideoModal/YouTubePlayer.tsx"],
4
- "sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport YouTube from 'react-youtube'\n\nexport function YouTubePlayer({ youTubeId, className }: { youTubeId?: string; className?: string }) {\n // const onReady = event => {\n // // event.target.playVideo();\n // }\n\n return youTubeId ? (\n <YouTube\n className={cn('relative size-full', className)}\n videoId={youTubeId}\n opts={{\n playerVars: { autoplay: 1, rel: 0, mute: 1 },\n width: '100%',\n height: '100%',\n }}\n />\n ) : null\n}\n"],
5
- "mappings": "AASI,cAAAA,MAAA,oBATJ,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,gBAEb,SAASC,EAAc,CAAE,UAAAC,EAAW,UAAAC,CAAU,EAA+C,CAKlG,OAAOD,EACLJ,EAACE,EAAA,CACC,UAAWD,EAAG,qBAAsBI,CAAS,EAC7C,QAASD,EACT,KAAM,CACJ,WAAY,CAAE,SAAU,EAAG,IAAK,EAAG,KAAM,CAAE,EAC3C,MAAO,OACP,OAAQ,MACV,EACF,EACE,IACN",
4
+ "sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport YouTube from 'react-youtube'\n\nexport function YouTubePlayer({ youTubeId, className }: { youTubeId?: string; className?: string }) {\n // const onReady = event => {\n // // event.target.playVideo();\n // }\n\n return youTubeId ? (\n <YouTube\n className={cn('relative size-full overflow-hidden rounded-2xl', className)}\n videoId={youTubeId}\n opts={{\n playerVars: { autoplay: 1, rel: 0, mute: 1 },\n width: '100%',\n height: '100%',\n }}\n />\n ) : null\n}\n"],
5
+ "mappings": "AASI,cAAAA,MAAA,oBATJ,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,gBAEb,SAASC,EAAc,CAAE,UAAAC,EAAW,UAAAC,CAAU,EAA+C,CAKlG,OAAOD,EACLJ,EAACE,EAAA,CACC,UAAWD,EAAG,iDAAkDI,CAAS,EACzE,QAASD,EACT,KAAM,CACJ,WAAY,CAAE,SAAU,EAAG,IAAK,EAAG,KAAM,CAAE,EAC3C,MAAO,OACP,OAAQ,MACV,EACF,EACE,IACN",
6
6
  "names": ["jsx", "cn", "YouTube", "YouTubePlayer", "youTubeId", "className"]
7
7
  }