@anker-in/headless-ui 1.1.80 → 1.1.81

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 (179) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.d.ts +36 -1
  2. package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +3 -1
  3. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +13 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  5. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  6. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
  7. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js +2 -0
  8. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
  9. package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +2 -7
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/AplusDesc/index.d.ts +17 -1
  13. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
  14. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
  15. package/dist/cjs/biz-components/Category/index.d.ts +1 -1
  16. package/dist/cjs/biz-components/CreativeModule/index.d.ts +7 -1
  17. package/dist/cjs/biz-components/DownLoad/index.d.ts +6 -1
  18. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
  19. package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -2
  20. package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
  21. package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
  22. package/dist/cjs/biz-components/Features/index.d.ts +8 -1
  23. package/dist/cjs/biz-components/FootCharger/index.d.ts +7 -1
  24. package/dist/cjs/biz-components/FooterNavigation/index.d.ts +2 -1
  25. package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -1
  26. package/dist/cjs/biz-components/GiftShelf/index.d.ts +3 -1
  27. package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +3 -1
  28. package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
  29. package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  30. package/dist/cjs/biz-components/GraphicMore/index.d.ts +7 -1
  31. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
  32. package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +3 -1
  33. package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
  34. package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
  35. package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
  36. package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
  37. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
  38. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
  39. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
  40. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
  41. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
  42. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
  43. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
  44. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
  45. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
  46. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
  47. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
  48. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +3 -2
  49. package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
  50. package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +2 -1
  51. package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +2 -1
  52. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  53. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
  54. package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +2 -1
  55. package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +5 -1
  56. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
  57. package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
  58. package/dist/cjs/biz-components/MemberEquity/index.d.ts +3 -1
  59. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
  60. package/dist/cjs/biz-components/NavigationSearch/index.d.ts +2 -2
  61. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  62. package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
  63. package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
  64. package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +3 -1
  65. package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +2 -1
  66. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
  67. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +2 -7
  68. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  69. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  70. package/dist/cjs/biz-components/SelectStore/index.d.ts +7 -1
  71. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +3 -1
  72. package/dist/cjs/biz-components/Slogan/index.d.ts +3 -1
  73. package/dist/cjs/biz-components/Spacer/index.d.ts +3 -1
  74. package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
  75. package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
  76. package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
  77. package/dist/cjs/biz-components/Tabs/Tabs.d.ts +3 -1
  78. package/dist/cjs/biz-components/TabsGroup/index.d.ts +3 -1
  79. package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
  80. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
  81. package/dist/cjs/biz-components/Title/index.d.ts +1 -1
  82. package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
  83. package/dist/cjs/biz-components/WheelLottery/index.d.ts +1 -1
  84. package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
  85. package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
  86. package/dist/cjs/helpers/ScrollLoadVideo.js.map +2 -2
  87. package/dist/cjs/shared/Styles.d.ts +2 -1
  88. package/dist/cjs/shared/Styles.js +1 -1
  89. package/dist/cjs/shared/Styles.js.map +2 -2
  90. package/dist/esm/biz-components/AccordionCards/index.d.ts +36 -1
  91. package/dist/esm/biz-components/ActivitySchedule/index.d.ts +3 -1
  92. package/dist/esm/biz-components/AiuiProvider/index.d.ts +13 -1
  93. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  94. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  95. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
  96. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js +2 -0
  97. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
  98. package/dist/esm/biz-components/AnchorNavigation/index.d.ts +2 -7
  99. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  100. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  101. package/dist/esm/biz-components/AplusDesc/index.d.ts +17 -1
  102. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
  103. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
  104. package/dist/esm/biz-components/Category/index.d.ts +1 -1
  105. package/dist/esm/biz-components/CreativeModule/index.d.ts +7 -1
  106. package/dist/esm/biz-components/DownLoad/index.d.ts +6 -1
  107. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
  108. package/dist/esm/biz-components/Faq/Faq.d.ts +3 -2
  109. package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
  110. package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
  111. package/dist/esm/biz-components/Features/index.d.ts +8 -1
  112. package/dist/esm/biz-components/FootCharger/index.d.ts +7 -1
  113. package/dist/esm/biz-components/FooterNavigation/index.d.ts +2 -1
  114. package/dist/esm/biz-components/GiftBox/index.d.ts +3 -1
  115. package/dist/esm/biz-components/GiftShelf/index.d.ts +3 -1
  116. package/dist/esm/biz-components/GiftTierShelf/index.d.ts +3 -1
  117. package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
  118. package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  119. package/dist/esm/biz-components/GraphicMore/index.d.ts +7 -1
  120. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
  121. package/dist/esm/biz-components/HeaderNavigation/index.d.ts +3 -1
  122. package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
  123. package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
  124. package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
  125. package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
  126. package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
  127. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
  128. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
  129. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
  130. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
  131. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
  132. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
  133. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
  134. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
  135. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
  136. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
  137. package/dist/esm/biz-components/Marquee/Marquee.d.ts +3 -2
  138. package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
  139. package/dist/esm/biz-components/MediaEndorsement/index.d.ts +2 -1
  140. package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +2 -1
  141. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  142. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
  143. package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +2 -1
  144. package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +5 -1
  145. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
  146. package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
  147. package/dist/esm/biz-components/MemberEquity/index.d.ts +3 -1
  148. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
  149. package/dist/esm/biz-components/NavigationSearch/index.d.ts +2 -2
  150. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  151. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  152. package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
  153. package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +3 -1
  154. package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +2 -1
  155. package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
  156. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +2 -7
  157. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  158. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  159. package/dist/esm/biz-components/SelectStore/index.d.ts +7 -1
  160. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +3 -1
  161. package/dist/esm/biz-components/Slogan/index.d.ts +3 -1
  162. package/dist/esm/biz-components/Spacer/index.d.ts +3 -1
  163. package/dist/esm/biz-components/Specs/index.d.ts +1 -1
  164. package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
  165. package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
  166. package/dist/esm/biz-components/Tabs/Tabs.d.ts +3 -1
  167. package/dist/esm/biz-components/TabsGroup/index.d.ts +3 -1
  168. package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
  169. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
  170. package/dist/esm/biz-components/Title/index.d.ts +1 -1
  171. package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
  172. package/dist/esm/biz-components/WheelLottery/index.d.ts +1 -1
  173. package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
  174. package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
  175. package/dist/esm/helpers/ScrollLoadVideo.js.map +2 -2
  176. package/dist/esm/shared/Styles.d.ts +2 -1
  177. package/dist/esm/shared/Styles.js +1 -1
  178. package/dist/esm/shared/Styles.js.map +2 -2
  179. package/package.json +1 -1
@@ -48,5 +48,40 @@ export type AccordionCardsType = Omit<React.HTMLAttributes<HTMLDivElement>, 'cla
48
48
  primaryButton?: (_v: any, _index: number) => void;
49
49
  };
50
50
  };
51
- declare const _default: any;
51
+ declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
52
+ className?: string;
53
+ data: {
54
+ key?: string;
55
+ title?: string;
56
+ products: Array<ItemType>;
57
+ /** 按钮形状 */
58
+ shape?: "round" | "square";
59
+ /** 卡片形状 */
60
+ itemShape?: "round" | "square";
61
+ /** 主按钮配置 */
62
+ primaryButton?: string;
63
+ theme?: "light" | "dark";
64
+ };
65
+ /**
66
+ * 自动播放配置
67
+ */
68
+ autoplay?: {
69
+ /**
70
+ * 是否开启自动播放
71
+ */
72
+ enabled: boolean;
73
+ /**
74
+ * 是否循环播放
75
+ */
76
+ loop?: boolean;
77
+ /**
78
+ * 自动播放间隔时间,单位毫秒
79
+ */
80
+ interval?: number;
81
+ };
82
+ /** 按钮事件*/
83
+ event?: {
84
+ primaryButton?: (_v: any, _index: number) => void;
85
+ };
86
+ } & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
52
87
  export default _default;
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import * as React from 'react';
2
+ import type { ActivityScheduleProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<ActivityScheduleProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
3
5
  export type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './types.js';
@@ -54,6 +54,18 @@ interface AiuiContextType {
54
54
  * 文案配置,商户可通过此字段覆盖默认文案
55
55
  */
56
56
  copyWriting?: Record<string, string>;
57
+ /**
58
+ * 是否启用自动埋点(点击事件追踪),默认为 true
59
+ * 设置为 false 可关闭自动埋点,适用于需要完全自定义埋点的场景
60
+ *
61
+ * @default true
62
+ * @example
63
+ * // 关闭自动埋点
64
+ * <AiuiProvider trackingData={{ pageGroup: 'Home' }} autoTracking={false}>
65
+ * {children}
66
+ * </AiuiProvider>
67
+ */
68
+ autoTracking?: boolean;
57
69
  /**
58
70
  * 自定义曝光回调。传入后会替代默认的 GA 埋点逻辑。
59
71
  *
@@ -72,7 +84,7 @@ interface AiuiContextType {
72
84
  }
73
85
  export declare const AiuiContext: React.Context<AiuiContextType>;
74
86
  export declare const useAiuiContext: () => AiuiContextType;
75
- declare const AiuiProvider: ({ children, ...rest }: {
87
+ declare const AiuiProvider: ({ children, autoTracking, ...rest }: {
76
88
  children: React.ReactNode;
77
89
  } & AiuiContextType) => import("react/jsx-runtime").JSX.Element;
78
90
  export default AiuiProvider;
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var k=(e,n)=>{for(var o in n)p(e,o,{get:n[o],enumerable:!0})},A=(e,n,o,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of v(n))!x.call(e,t)&&t!==o&&p(e,t,{get:()=>n[t],enumerable:!(s=f(n,t))||s.enumerable});return e};var C=e=>A(p({},"__esModule",{value:!0}),e);var P={};k(P,{AiuiContext:()=>d,default:()=>D,useAiuiContext:()=>E});module.exports=C(P);var g=require("react/jsx-runtime"),y=require("../../shared/track.js"),i=require("react");const d=(0,i.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),E=()=>{const e=(0,i.useContext)(d);if(!e)throw new Error("useAiui must be used in <AiuiProvider>");return e},T=({children:e,...n})=>((0,i.useEffect)(()=>{const o=(t,a)=>{const r={};if(!a||!a.attributes)return r;for(const h of Array.from(a.attributes)){const u=h?.name;u?.startsWith("data-headless-")&&(r[u]=a.getAttribute(u))}const b=r?.["data-headless-sku"],l=r?.["data-headless-type-name"]?.split?.("#"),c=r?.["data-headless-title-desc-button"]?.split?.("#"),m=r?.["data-headless-nav-position"]?.split?.("#");(0,y.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:n?.trackingData?.pageGroup||"Home Page",component_type:l?.[0]||"",component_name:l?.[1]||"",position:m?.[1]||"",navigation:m?.[0]||"",button_name:c?.[2]||"",SKU:b||"",component_title:c?.[0]||"",component_description:c?.[1]||""}})},s=new MutationObserver(()=>{document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",a=>o(a,t)),t.setAttribute("data-headless-track-bound","true"))})});return s.observe(document.body,{childList:!0,subtree:!0}),document.querySelectorAll("[data-headless-type-name]").forEach(t=>{t.hasAttribute("data-headless-track-bound")||(t.addEventListener("click",a=>o(a,t)),t.setAttribute("data-headless-track-bound","true"))}),()=>s.disconnect()},[]),(0,g.jsx)(d.Provider,{value:n,children:e}));var D=T;
1
+ "use strict";var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},m=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of g(t))!l.call(e,o)&&o!==r&&i(e,o,{get:()=>t[o],enumerable:!(s=u(t,o))||s.enumerable});return e};var x=e=>m(i({},"__esModule",{value:!0}),e);var T={};y(T,{AiuiContext:()=>a,default:()=>A,useAiuiContext:()=>d});module.exports=x(T);var c=require("react/jsx-runtime"),n=require("react"),p=require("./useAutoTracking.js");const a=(0,n.createContext)({trackingData:{},locale:void 0,copyWriting:{}}),d=()=>{const e=(0,n.useContext)(a);if(!e)throw new Error("useAiui must be used in <AiuiProvider>");return e},C=({children:e,autoTracking:t=!0,...r})=>((0,p.useAutoTracking)(r?.trackingData,t),(0,c.jsx)(a.Provider,{value:r,children:e}));var A=C;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AiuiProvider/index.tsx"],
4
- "sourcesContent": ["import { gaTrack } from '../../shared/track.js'\nimport React, { createContext, useContext, useEffect } from 'react'\nimport type { CurrencyDisplayType } from '../../types/props.js'\n\n/**\n * Exposure tracking parameters\n */\nexport interface ExposureParams {\n componentType: string\n componentName: string\n componentTitle?: string\n componentDescription?: string\n navigation?: string\n pageGroup?: string\n position?: number\n}\n\n/**\n * Callback function for custom exposure handling\n */\nexport type OnExposureCallback = (params: ExposureParams) => void\n\ninterface AiuiContextType {\n /**\n * \u5168\u5C40\u57CB\u70B9\u6570\u636E\uFF0C\u81F3\u5C11\u5E94\u5305\u542B pageGroup \u5B57\u6BB5\u7528\u4E8E\u533A\u5206\u9875\u9762\uFF0C\u5176\u4ED6\u5B57\u6BB5\u53EF\u6839\u636E\u9700\u8981\u6DFB\u52A0\n */\n trackingData: Record<string, any>\n /**\n * \u5F53\u524D\u8BED\u8A00\u73AF\u5883\uFF0C\u9ED8\u8BA4\u4E3A\u6D4F\u89C8\u5668\u8BED\u8A00\n */\n locale?: string\n /**\n * \u5F53\u524D\u9875\u9762\u8DEF\u5F84\uFF0C\u7528\u4E8E\u57CB\u70B9\u533A\u5206\u4E0D\u540C\u9875\u9762\uFF0C\u9ED8\u8BA4\u4E3A window.location.pathname\n */\n pathname?: string\n /**\n * \u5546\u6237\u81EA\u5B9A\u4E49\u7684\u5E97\u94FA\u57DF\u540D\uFF0C\u7528\u4E8E\u57CB\u70B9\u533A\u5206\u4E0D\u540C\u5546\u6237\uFF0C\u9ED8\u8BA4\u4E3A\u7A7A\u5B57\u7B26\u4E32\n */\n storeDomain?: string\n /**\n * \u7528\u6237\u662F\u5426\u767B\u5F55\n */\n isLogin?: boolean\n\n /**\n * \u7528\u6237\u662F\u5426\u4E3APlus\u4F1A\u5458\n */\n isPlusMember?: boolean\n /**\n * \u8D27\u5E01\u4EE3\u7801\uFF0C\u9ED8\u8BA4\u4E3AUSD\n */\n currencyCode?: string\n /**\n * \u8D27\u5E01\u663E\u793A\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3Asymbol\uFF08\u7B26\u53F7\uFF09\uFF0C\u53EF\u9009\u503C\u5305\u62EC\uFF1A'symbol'\uFF08\u7B26\u53F7\uFF0C\u5982$\uFF09\u3001'code'\uFF08\u8D27\u5E01\u4EE3\u7801\uFF0C\u5982USD\uFF09\u548C'name'\uFF08\u8D27\u5E01\u540D\u79F0\uFF0C\u5982\u7F8E\u5143\uFF09\u3002\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay for more details\n */\n currencyDisplay?: CurrencyDisplayType\n /**\n * \u6587\u6848\u914D\u7F6E\uFF0C\u5546\u6237\u53EF\u901A\u8FC7\u6B64\u5B57\u6BB5\u8986\u76D6\u9ED8\u8BA4\u6587\u6848\n */\n copyWriting?: Record<string, string>\n /**\n * \u81EA\u5B9A\u4E49\u66DD\u5149\u56DE\u8C03\u3002\u4F20\u5165\u540E\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 GA \u57CB\u70B9\u903B\u8F91\u3002\n *\n * @example\n * <AiuiProvider\n * trackingData={{ pageGroup: 'Home Page' }}\n * onExposure={(params) => {\n * // \u4F7F\u7528\u5546\u6237\u81EA\u5DF1\u7684\u57CB\u70B9\u7CFB\u7EDF\u8BB0\u5F55\u66DD\u5149\u4E8B\u4EF6\n * ga.track('component_impression', params)\n * }}\n * >\n * {children}\n * </AiuiProvider>\n */\n onExposure?: OnExposureCallback\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return context\n}\n\nconst AiuiProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n useEffect(() => {\n const handleTrackClick = (e: any, el: any) => {\n // e?.stopPropagation?.()\n const out: any = {}\n if (!el || !el.attributes) return out\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as any)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name)\n }\n }\n const sku = out?.['data-headless-sku']\n const nameType = out?.['data-headless-type-name']?.split?.('#')\n const titleDesc = out?.['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out?.['data-headless-nav-position']?.split?.('#')\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: rest?.trackingData?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n const observer = new MutationObserver(() => {\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true') // \u907F\u514D\u91CD\u590D\u7ED1\u5B9A\n }\n })\n })\n observer.observe(document.body, { childList: true, subtree: true })\n // \u521D\u59CB\u5316\u4E00\u6B21\u73B0\u6709\u8282\u70B9\n document.querySelectorAll('[data-headless-type-name]').forEach(el => {\n if (!el.hasAttribute('data-headless-track-bound')) {\n el.addEventListener('click', e => handleTrackClick(e, el))\n el.setAttribute('data-headless-track-bound', 'true')\n }\n })\n return () => observer.disconnect()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAqJS,IAAAM,EAAA,6BArJTC,EAAwB,iCACxBC,EAA4D,iBA6ErD,MAAMN,KAAc,iBAA+B,CACxD,aAAc,CAAC,EACf,OAAQ,OACR,YAAa,CAAC,CAChB,CAAC,EAEYE,EAAiB,IAAM,CAClC,MAAMK,KAAU,cAAWP,CAAW,EACtC,GAAI,CAACO,EACH,MAAM,IAAI,MAAM,wCAAwC,EAE1D,OAAOA,CACT,EAEMC,EAAe,CAAC,CACpB,SAAAC,EACA,GAAGC,CACL,QAGE,aAAU,IAAM,CACd,MAAMC,EAAmB,CAACC,EAAQC,IAAY,CAE5C,MAAMC,EAAW,CAAC,EAClB,GAAI,CAACD,GAAM,CAACA,EAAG,WAAY,OAAOC,EAClC,UAAWC,KAAQ,MAAM,KAAKF,EAAG,UAAU,EAAG,CAC5C,MAAMG,EAAQD,GAAc,KACxBC,GAAM,WAAW,gBAAgB,IACnCF,EAAIE,CAAI,EAAIH,EAAG,aAAaG,CAAI,EAEpC,CACA,MAAMC,EAAMH,IAAM,mBAAmB,EAC/BI,EAAWJ,IAAM,yBAAyB,GAAG,QAAQ,GAAG,EACxDK,EAAYL,IAAM,iCAAiC,GAAG,QAAQ,GAAG,EACjEM,EAAcN,IAAM,4BAA4B,GAAG,QAAQ,GAAG,KACpE,WAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAYJ,GAAM,cAAc,WAAa,YAC7C,eAAgBQ,IAAW,CAAC,GAAK,GACjC,eAAgBA,IAAW,CAAC,GAAK,GACjC,SAAUE,IAAc,CAAC,GAAK,GAC9B,WAAYA,IAAc,CAAC,GAAK,GAChC,YAAaD,IAAY,CAAC,GAAK,GAC/B,IAAKF,GAAO,GACZ,gBAAiBE,IAAY,CAAC,GAAK,GACnC,sBAAuBA,IAAY,CAAC,GAAK,EAC3C,CACF,CAAC,CACH,EACME,EAAW,IAAI,iBAAiB,IAAM,CAC1C,SAAS,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,CACH,CAAC,EACD,OAAAQ,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,EAAK,CAAC,EAElE,SAAS,iBAAiB,2BAA2B,EAAE,QAAQR,GAAM,CAC9DA,EAAG,aAAa,2BAA2B,IAC9CA,EAAG,iBAAiB,QAASD,GAAKD,EAAiBC,EAAGC,CAAE,CAAC,EACzDA,EAAG,aAAa,4BAA6B,MAAM,EAEvD,CAAC,EACM,IAAMQ,EAAS,WAAW,CAEnC,EAAG,CAAC,CAAC,KAEE,OAACrB,EAAY,SAAZ,CAAqB,MAAOU,EAAO,SAAAD,EAAS,GAGtD,IAAOR,EAAQO",
6
- "names": ["AiuiProvider_exports", "__export", "AiuiContext", "AiuiProvider_default", "useAiuiContext", "__toCommonJS", "import_jsx_runtime", "import_track", "import_react", "context", "AiuiProvider", "children", "rest", "handleTrackClick", "e", "el", "out", "attr", "name", "sku", "nameType", "titleDesc", "navPosition", "observer"]
4
+ "sourcesContent": ["import React, { createContext, useContext } from 'react'\nimport type { CurrencyDisplayType } from '../../types/props.js'\nimport { useAutoTracking } from './useAutoTracking.js'\n\n/**\n * Exposure tracking parameters\n */\nexport interface ExposureParams {\n componentType: string\n componentName: string\n componentTitle?: string\n componentDescription?: string\n navigation?: string\n pageGroup?: string\n position?: number\n}\n\n/**\n * Callback function for custom exposure handling\n */\nexport type OnExposureCallback = (params: ExposureParams) => void\n\ninterface AiuiContextType {\n /**\n * \u5168\u5C40\u57CB\u70B9\u6570\u636E\uFF0C\u81F3\u5C11\u5E94\u5305\u542B pageGroup \u5B57\u6BB5\u7528\u4E8E\u533A\u5206\u9875\u9762\uFF0C\u5176\u4ED6\u5B57\u6BB5\u53EF\u6839\u636E\u9700\u8981\u6DFB\u52A0\n */\n trackingData: Record<string, any>\n /**\n * \u5F53\u524D\u8BED\u8A00\u73AF\u5883\uFF0C\u9ED8\u8BA4\u4E3A\u6D4F\u89C8\u5668\u8BED\u8A00\n */\n locale?: string\n /**\n * \u5F53\u524D\u9875\u9762\u8DEF\u5F84\uFF0C\u7528\u4E8E\u57CB\u70B9\u533A\u5206\u4E0D\u540C\u9875\u9762\uFF0C\u9ED8\u8BA4\u4E3A window.location.pathname\n */\n pathname?: string\n /**\n * \u5546\u6237\u81EA\u5B9A\u4E49\u7684\u5E97\u94FA\u57DF\u540D\uFF0C\u7528\u4E8E\u57CB\u70B9\u533A\u5206\u4E0D\u540C\u5546\u6237\uFF0C\u9ED8\u8BA4\u4E3A\u7A7A\u5B57\u7B26\u4E32\n */\n storeDomain?: string\n /**\n * \u7528\u6237\u662F\u5426\u767B\u5F55\n */\n isLogin?: boolean\n\n /**\n * \u7528\u6237\u662F\u5426\u4E3APlus\u4F1A\u5458\n */\n isPlusMember?: boolean\n /**\n * \u8D27\u5E01\u4EE3\u7801\uFF0C\u9ED8\u8BA4\u4E3AUSD\n */\n currencyCode?: string\n /**\n * \u8D27\u5E01\u663E\u793A\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3Asymbol\uFF08\u7B26\u53F7\uFF09\uFF0C\u53EF\u9009\u503C\u5305\u62EC\uFF1A'symbol'\uFF08\u7B26\u53F7\uFF0C\u5982$\uFF09\u3001'code'\uFF08\u8D27\u5E01\u4EE3\u7801\uFF0C\u5982USD\uFF09\u548C'name'\uFF08\u8D27\u5E01\u540D\u79F0\uFF0C\u5982\u7F8E\u5143\uFF09\u3002\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay for more details\n */\n currencyDisplay?: CurrencyDisplayType\n /**\n * \u6587\u6848\u914D\u7F6E\uFF0C\u5546\u6237\u53EF\u901A\u8FC7\u6B64\u5B57\u6BB5\u8986\u76D6\u9ED8\u8BA4\u6587\u6848\n */\n copyWriting?: Record<string, string>\n /**\n * \u662F\u5426\u542F\u7528\u81EA\u52A8\u57CB\u70B9\uFF08\u70B9\u51FB\u4E8B\u4EF6\u8FFD\u8E2A\uFF09\uFF0C\u9ED8\u8BA4\u4E3A true\n * \u8BBE\u7F6E\u4E3A false \u53EF\u5173\u95ED\u81EA\u52A8\u57CB\u70B9\uFF0C\u9002\u7528\u4E8E\u9700\u8981\u5B8C\u5168\u81EA\u5B9A\u4E49\u57CB\u70B9\u7684\u573A\u666F\n *\n * @default true\n * @example\n * // \u5173\u95ED\u81EA\u52A8\u57CB\u70B9\n * <AiuiProvider trackingData={{ pageGroup: 'Home' }} autoTracking={false}>\n * {children}\n * </AiuiProvider>\n */\n autoTracking?: boolean\n /**\n * \u81EA\u5B9A\u4E49\u66DD\u5149\u56DE\u8C03\u3002\u4F20\u5165\u540E\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 GA \u57CB\u70B9\u903B\u8F91\u3002\n *\n * @example\n * <AiuiProvider\n * trackingData={{ pageGroup: 'Home Page' }}\n * onExposure={(params) => {\n * // \u4F7F\u7528\u5546\u6237\u81EA\u5DF1\u7684\u57CB\u70B9\u7CFB\u7EDF\u8BB0\u5F55\u66DD\u5149\u4E8B\u4EF6\n * ga.track('component_impression', params)\n * }}\n * >\n * {children}\n * </AiuiProvider>\n */\n onExposure?: OnExposureCallback\n}\n\nexport const AiuiContext = createContext<AiuiContextType>({\n trackingData: {},\n locale: undefined,\n copyWriting: {},\n})\n\nexport const useAiuiContext = () => {\n const context = useContext(AiuiContext)\n if (!context) {\n throw new Error('useAiui must be used in <AiuiProvider>')\n }\n return context\n}\n\nconst AiuiProvider = ({\n children,\n autoTracking = true,\n ...rest\n}: {\n children: React.ReactNode\n} & AiuiContextType) => {\n // \u4F7F\u7528\u81EA\u52A8\u57CB\u70B9 Hook\n useAutoTracking(rest?.trackingData, autoTracking)\n\n return <AiuiContext.Provider value={rest}>{children}</AiuiContext.Provider>\n}\n\nexport default AiuiProvider\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,YAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAkHS,IAAAM,EAAA,6BAlHTC,EAAiD,iBAEjDC,EAAgC,gCAwFzB,MAAMN,KAAc,iBAA+B,CACxD,aAAc,CAAC,EACf,OAAQ,OACR,YAAa,CAAC,CAChB,CAAC,EAEYE,EAAiB,IAAM,CAClC,MAAMK,KAAU,cAAWP,CAAW,EACtC,GAAI,CAACO,EACH,MAAM,IAAI,MAAM,wCAAwC,EAE1D,OAAOA,CACT,EAEMC,EAAe,CAAC,CACpB,SAAAC,EACA,aAAAC,EAAe,GACf,GAAGC,CACL,QAIE,mBAAgBA,GAAM,aAAcD,CAAY,KAEzC,OAACV,EAAY,SAAZ,CAAqB,MAAOW,EAAO,SAAAF,EAAS,GAGtD,IAAOR,EAAQO",
6
+ "names": ["AiuiProvider_exports", "__export", "AiuiContext", "AiuiProvider_default", "useAiuiContext", "__toCommonJS", "import_jsx_runtime", "import_react", "import_useAutoTracking", "context", "AiuiProvider", "children", "autoTracking", "rest"]
7
7
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * 自动点击埋点 Hook
3
+ *
4
+ * 通过事件委托监听所有带有 `data-headless-type-name` 属性的元素点击事件
5
+ *
6
+ * @param trackingData - 埋点数据对象,包含 pageGroup 等字段
7
+ * @param enabled - 是否启用自动埋点,默认为 true
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * function App() {
12
+ * useAutoTracking({ pageGroup: 'Home Page' }, true)
13
+ * return <div>...</div>
14
+ * }
15
+ * ```
16
+ */
17
+ export declare function useAutoTracking(trackingData: Record<string, any>, enabled?: boolean): void;
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var k=(e,t)=>{for(var o in t)u(e,o,{get:t[o],enumerable:!0})},w=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of y(t))!h.call(e,n)&&n!==o&&u(e,n,{get:()=>t[n],enumerable:!(s=v(t,n))||s.enumerable});return e};var E=e=>w(u({},"__esModule",{value:!0}),e);var A={};k(A,{useAutoTracking:()=>b});module.exports=E(A);var r=require("react"),l=require("../../shared/track.js");function b(e,t=!0){const o=(0,r.useRef)(e);(0,r.useEffect)(()=>{o.current=e},[e]),(0,r.useEffect)(()=>{if(!t||typeof window>"u")return;const s="__headless_ui_tracking_bound__";if(window[s])return;const n=f=>{const i=f.target.closest("[data-headless-type-name]");if(!i)return;const a={};for(const g of Array.from(i.attributes)){const d=g?.name;d?.startsWith("data-headless-")&&(a[d]=i.getAttribute(d)||"")}const _=a["data-headless-sku"],m=a["data-headless-type-name"]?.split?.("#"),c=a["data-headless-title-desc-button"]?.split?.("#"),p=a["data-headless-nav-position"]?.split?.("#");(0,l.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:o.current?.pageGroup||"Home Page",component_type:m?.[0]||"",component_name:m?.[1]||"",position:p?.[1]||"",navigation:p?.[0]||"",button_name:c?.[2]||"",SKU:_||"",component_title:c?.[0]||"",component_description:c?.[1]||""}})};return document.addEventListener("click",n),window[s]=!0,()=>{document.removeEventListener("click",n),delete window[s]}},[t])}
2
+ //# sourceMappingURL=useAutoTracking.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/AiuiProvider/useAutoTracking.ts"],
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react'\nimport { gaTrack } from '../../shared/track.js'\n\n/**\n * \u81EA\u52A8\u70B9\u51FB\u57CB\u70B9 Hook\n *\n * \u901A\u8FC7\u4E8B\u4EF6\u59D4\u6258\u76D1\u542C\u6240\u6709\u5E26\u6709 `data-headless-type-name` \u5C5E\u6027\u7684\u5143\u7D20\u70B9\u51FB\u4E8B\u4EF6\n *\n * @param trackingData - \u57CB\u70B9\u6570\u636E\u5BF9\u8C61\uFF0C\u5305\u542B pageGroup \u7B49\u5B57\u6BB5\n * @param enabled - \u662F\u5426\u542F\u7528\u81EA\u52A8\u57CB\u70B9\uFF0C\u9ED8\u8BA4\u4E3A true\n *\n * @example\n * ```tsx\n * function App() {\n * useAutoTracking({ pageGroup: 'Home Page' }, true)\n * return <div>...</div>\n * }\n * ```\n */\nexport function useAutoTracking(trackingData: Record<string, any>, enabled: boolean = true) {\n // \u4F7F\u7528 ref \u4FDD\u5B58\u6700\u65B0\u7684 trackingData\uFF0C\u907F\u514D\u95ED\u5305\u9648\u65E7\n const trackingDataRef = useRef(trackingData)\n\n useEffect(() => {\n trackingDataRef.current = trackingData\n }, [trackingData])\n\n useEffect(() => {\n // \u5982\u679C\u5173\u95ED\u4E86\u81EA\u52A8\u57CB\u70B9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (!enabled) return\n\n // SSR \u73AF\u5883\u68C0\u6D4B\n if (typeof window === 'undefined') return\n\n // \u5168\u5C40\u6807\u8BB0\uFF1A\u9632\u6B62\u591A\u4E2A Provider \u5B9E\u4F8B\u91CD\u590D\u7ED1\u5B9A\n const TRACKING_KEY = '__headless_ui_tracking_bound__'\n if ((window as any)[TRACKING_KEY]) return\n\n /**\n * \u4E8B\u4EF6\u59D4\u6258\u5904\u7406\u51FD\u6570\n * \u70B9\u51FB\u4E8B\u4EF6\u5192\u6CE1\u5230 document\uFF0C\u68C0\u6D4B\u662F\u5426\u70B9\u51FB\u4E86\u8FFD\u8E2A\u5143\u7D20\n */\n const handleClick = (e: MouseEvent) => {\n const target = e.target as Element\n const el = target.closest('[data-headless-type-name]')\n if (!el) return\n\n // \u63D0\u53D6 data-headless-* \u5C5E\u6027\n const out: Record<string, string> = {}\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as Attr)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name) || ''\n }\n }\n\n // \u89E3\u6790\u8FFD\u8E2A\u6570\u636E\n const sku = out['data-headless-sku']\n const nameType = out['data-headless-type-name']?.split?.('#')\n const titleDesc = out['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out['data-headless-nav-position']?.split?.('#')\n\n // \u53D1\u9001 GA \u57CB\u70B9\u4E8B\u4EF6\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: trackingDataRef.current?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n\n // \u7ED1\u5B9A\u5168\u5C40\u70B9\u51FB\u4E8B\u4EF6\n document.addEventListener('click', handleClick)\n ;(window as any)[TRACKING_KEY] = true\n\n // \u6E05\u7406\u51FD\u6570\n return () => {\n document.removeEventListener('click', handleClick)\n delete (window as any)[TRACKING_KEY]\n }\n }, [enabled])\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkC,iBAClCC,EAAwB,iCAkBjB,SAASH,EAAgBI,EAAmCC,EAAmB,GAAM,CAE1F,MAAMC,KAAkB,UAAOF,CAAY,KAE3C,aAAU,IAAM,CACdE,EAAgB,QAAUF,CAC5B,EAAG,CAACA,CAAY,CAAC,KAEjB,aAAU,IAAM,CAKd,GAHI,CAACC,GAGD,OAAO,OAAW,IAAa,OAGnC,MAAME,EAAe,iCACrB,GAAK,OAAeA,CAAY,EAAG,OAMnC,MAAMC,EAAeC,GAAkB,CAErC,MAAMC,EADSD,EAAE,OACC,QAAQ,2BAA2B,EACrD,GAAI,CAACC,EAAI,OAGT,MAAMC,EAA8B,CAAC,EACrC,UAAWC,KAAQ,MAAM,KAAKF,EAAG,UAAU,EAAG,CAC5C,MAAMG,EAAQD,GAAe,KACzBC,GAAM,WAAW,gBAAgB,IACnCF,EAAIE,CAAI,EAAIH,EAAG,aAAaG,CAAI,GAAK,GAEzC,CAGA,MAAMC,EAAMH,EAAI,mBAAmB,EAC7BI,EAAWJ,EAAI,yBAAyB,GAAG,QAAQ,GAAG,EACtDK,EAAYL,EAAI,iCAAiC,GAAG,QAAQ,GAAG,EAC/DM,EAAcN,EAAI,4BAA4B,GAAG,QAAQ,GAAG,KAGlE,WAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAYL,EAAgB,SAAS,WAAa,YAClD,eAAgBS,IAAW,CAAC,GAAK,GACjC,eAAgBA,IAAW,CAAC,GAAK,GACjC,SAAUE,IAAc,CAAC,GAAK,GAC9B,WAAYA,IAAc,CAAC,GAAK,GAChC,YAAaD,IAAY,CAAC,GAAK,GAC/B,IAAKF,GAAO,GACZ,gBAAiBE,IAAY,CAAC,GAAK,GACnC,sBAAuBA,IAAY,CAAC,GAAK,EAC3C,CACF,CAAC,CACH,EAGA,gBAAS,iBAAiB,QAASR,CAAW,EAC5C,OAAeD,CAAY,EAAI,GAG1B,IAAM,CACX,SAAS,oBAAoB,QAASC,CAAW,EACjD,OAAQ,OAAeD,CAAY,CACrC,CACF,EAAG,CAACF,CAAO,CAAC,CACd",
6
+ "names": ["useAutoTracking_exports", "__export", "useAutoTracking", "__toCommonJS", "import_react", "import_track", "trackingData", "enabled", "trackingDataRef", "TRACKING_KEY", "handleClick", "e", "el", "out", "attr", "name", "sku", "nameType", "titleDesc", "navPosition"]
7
+ }
@@ -60,10 +60,5 @@ export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivEleme
60
60
  */
61
61
  buttonStyle?: AnchorButtonStyle;
62
62
  }
63
- /**
64
- * AnchorNavigation - 锚点导航
65
- *
66
- * @description 锚点导航
67
- */
68
- declare const AnchorNavigation: React.ForwardRefExoticComponent<AnchorNavigationProps & React.RefAttributes<HTMLDivElement>>;
69
- export default AnchorNavigation;
63
+ declare const _default: React.ForwardRefExoticComponent<AnchorNavigationProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
64
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var k=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},R=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of V(e))!M.call(t,l)&&l!==n&&u(t,l,{get:()=>e[l],enumerable:!(c=B(e,l))||c.enumerable});return t};var x=(t,e,n)=>(n=t!=null?k(z(t)):{},R(e||!t||!t.__esModule?u(n,"default",{value:t,enumerable:!0}):n,t)),q=t=>R(u({},"__esModule",{value:!0}),t);var K={};P(K,{default:()=>G});module.exports=q(K);var g=require("react/jsx-runtime"),i=x(require("react")),m=require("../../helpers/utils.js"),v=require("class-variance-authority"),S=x(require("./useAnchorPosition.js")),w=require("../../components/container.js");const F=(0,v.cva)("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),j=(0,v.cva)("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),U=(0,v.cva)("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),W={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},_={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},T=i.forwardRef(({classNames:t={},data:e,onItemClick:n,buttonStyle:c,className:l,...D},E)=>{const{alignment:L="start",theme:b="light",size:y="small"}=e,f=(0,S.default)(e.sectionIds?.map(o=>o.targetId)||[]),d=i.useRef(null),h=i.useRef(null),N=i.useRef([]);i.useImperativeHandle(E,()=>d.current);const p=b==="dark"?_:W,I={defaultColor:c?.defaultColor??p.defaultColor,activeColor:c?.activeColor??p.activeColor,activeIndicatorColor:c?.activeIndicatorColor??p.activeIndicatorColor},C=i.useCallback(o=>{const r=N.current[o];if(r&&h.current){const s=h.current,a=r,A=a.offsetLeft-s.offsetWidth/2+a.offsetWidth/2;typeof s.scrollTo=="function"&&s.scrollTo({left:A,behavior:"smooth"})}},[]);return i.useEffect(()=>{if(!f)return;const o=e.sectionIds?.findIndex(r=>r.targetId===f);o!==void 0&&o!==-1&&C(o)},[f,e.sectionIds,C]),(0,g.jsx)(w.Container,{ref:d,className:(0,m.cn)(U({theme:b}),t?.root),...D,children:(0,g.jsx)("div",{ref:h,className:(0,m.cn)(F({alignment:L,size:y}),"relative",t?.content),children:e.sectionIds?.map((o,r)=>{const s=f===o.targetId;return(0,g.jsx)("button",{ref:a=>{a&&(N.current[r]=a)},"aria-current":s?!0:void 0,onClick:()=>{if(C(r),n){n(o,r);return}const a=document.getElementById(o.targetId);if(a&&d.current){const A=d.current.offsetHeight,H=a.getBoundingClientRect().top+window.scrollY-A;window.scrollTo({top:H,behavior:"smooth"})}},className:(0,m.cn)(j({size:y}),s?[I.activeColor,I.activeIndicatorColor,"after:w-full after:opacity-100"]:I.defaultColor,t?.item),children:o.label},o.targetId)})})})});T.displayName="AnchorNavigation";var G=T;
1
+ "use strict";"use client";var B=Object.create;var d=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var q=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},R=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of z(e))!P.call(t,l)&&l!==r&&d(t,l,{get:()=>e[l],enumerable:!(c=V(e,l))||c.enumerable});return t};var x=(t,e,r)=>(r=t!=null?B(M(t)):{},R(e||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>R(d({},"__esModule",{value:!0}),t);var Y={};q(Y,{default:()=>K});module.exports=F(Y);var g=require("react/jsx-runtime"),i=x(require("react")),m=require("../../helpers/utils.js"),v=require("class-variance-authority"),w=x(require("./useAnchorPosition.js")),L=require("../../components/container.js"),S=require("../../shared/Styles.js");const j=(0,v.cva)("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),U=(0,v.cva)("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),W=(0,v.cva)("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),_={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},G={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},T=i.forwardRef(({classNames:t={},data:e,onItemClick:r,buttonStyle:c,className:l,...D},E)=>{const{alignment:H="start",theme:b="light",size:y="small"}=e,f=(0,w.default)(e.sectionIds?.map(o=>o.targetId)||[]),u=i.useRef(null),h=i.useRef(null),N=i.useRef([]);i.useImperativeHandle(E,()=>u.current);const p=b==="dark"?G:_,I={defaultColor:c?.defaultColor??p.defaultColor,activeColor:c?.activeColor??p.activeColor,activeIndicatorColor:c?.activeIndicatorColor??p.activeIndicatorColor},C=i.useCallback(o=>{const n=N.current[o];if(n&&h.current){const s=h.current,a=n,A=a.offsetLeft-s.offsetWidth/2+a.offsetWidth/2;typeof s.scrollTo=="function"&&s.scrollTo({left:A,behavior:"smooth"})}},[]);return i.useEffect(()=>{if(!f)return;const o=e.sectionIds?.findIndex(n=>n.targetId===f);o!==void 0&&o!==-1&&C(o)},[f,e.sectionIds,C]),(0,g.jsx)(L.Container,{ref:u,className:(0,m.cn)(W({theme:b}),t?.root),...D,children:(0,g.jsx)("div",{ref:h,className:(0,m.cn)(j({alignment:H,size:y}),"relative",t?.content),children:e.sectionIds?.map((o,n)=>{const s=f===o.targetId;return(0,g.jsx)("button",{ref:a=>{a&&(N.current[n]=a)},"aria-current":s?!0:void 0,onClick:()=>{if(C(n),r){r(o,n);return}const a=document.getElementById(o.targetId);if(a&&u.current){const A=u.current.offsetHeight,k=a.getBoundingClientRect().top+window.scrollY-A;window.scrollTo({top:k,behavior:"smooth"})}},className:(0,m.cn)(U({size:y}),s?[I.activeColor,I.activeIndicatorColor,"after:w-full after:opacity-100"]:I.defaultColor,t?.item),children:o.label},o.targetId)})})})});T.displayName="AnchorNavigation";var K=(0,S.withLayout)(T);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
5
- "mappings": "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",
6
- "names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "import_container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "useAnchorPosition", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
+ "mappings": "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",
6
+ "names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "import_container", "import_Styles", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "useAnchorPosition", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition"]
7
7
  }
@@ -1,2 +1,18 @@
1
- declare const _default: any;
1
+ import type { Img } from '../../types/props.js';
2
+ type AplusItem = {
3
+ img: Img;
4
+ mobileImg: Img;
5
+ title: string;
6
+ desc: string;
7
+ theme: 'light' | 'dark';
8
+ };
9
+ interface AplusDescType extends React.HTMLAttributes<HTMLDivElement> {
10
+ data: {
11
+ title: string;
12
+ img: Img;
13
+ mobileImg: Img;
14
+ list: AplusItem[];
15
+ };
16
+ }
17
+ declare const _default: import("react").ForwardRefExoticComponent<AplusDescType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
18
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { BrandCardLinkProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<BrandCardLinkProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { BrandEquityProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<BrandEquityProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
3
  export default _default;
@@ -27,5 +27,5 @@ export interface CategoryProps extends React.HTMLAttributes<HTMLDivElement> {
27
27
  };
28
28
  key?: string;
29
29
  }
30
- declare const _default: any;
30
+ declare const _default: React.ForwardRefExoticComponent<CategoryProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
31
31
  export default _default;
@@ -7,5 +7,11 @@ export type CreativeModuleDataType = {
7
7
  theme: 'light' | 'dark';
8
8
  span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
9
9
  };
10
- declare const _default: any;
10
+ interface CreativeModuleType extends React.HTMLAttributes<HTMLDivElement> {
11
+ data: {
12
+ shape?: 'rounded' | 'square';
13
+ productsTab: CreativeModuleDataType[];
14
+ };
15
+ }
16
+ declare const _default: import("react").ForwardRefExoticComponent<CreativeModuleType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
11
17
  export default _default;
@@ -7,5 +7,10 @@ export type DownLoadDataType = {
7
7
  line: Img;
8
8
  icon: Img;
9
9
  };
10
- declare const _default: any;
10
+ interface DownLoadType extends React.HTMLAttributes<HTMLDivElement> {
11
+ data: {
12
+ list: DownLoadDataType[];
13
+ };
14
+ }
15
+ declare const _default: import("react").ForwardRefExoticComponent<DownLoadType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
11
16
  export default _default;
@@ -29,5 +29,5 @@ export interface EvaluateProps extends React.HTMLAttributes<HTMLDivElement> {
29
29
  };
30
30
  key?: string;
31
31
  }
32
- declare const _default: any;
32
+ declare const _default: React.ForwardRefExoticComponent<EvaluateProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
33
33
  export default _default;
@@ -1,4 +1,5 @@
1
- import type { FaqItem as ItemType, FaqSemanticName } from './types.js';
1
+ import React from 'react';
2
+ import type { FaqProps, FaqItem as ItemType, FaqSemanticName } from './types.js';
2
3
  interface FaqItemProps {
3
4
  data: ItemType;
4
5
  defaultOpen?: boolean;
@@ -8,6 +9,6 @@ declare const FaqItem: {
8
9
  ({ data, defaultOpen, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  displayName: string;
10
11
  };
11
- declare const _default: any;
12
+ declare const _default: React.ForwardRefExoticComponent<FaqProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
12
13
  export default _default;
13
14
  export { FaqItem };
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { FeatureCardsProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<FeatureCardsProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { FeatureShowcaseProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<FeatureShowcaseProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -10,5 +10,12 @@ export type FeaturesDataType = {
10
10
  textTwo: string;
11
11
  icon: Img;
12
12
  };
13
- declare const _default: any;
13
+ declare const _default: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
14
+ data: {
15
+ title: string;
16
+ img: Img;
17
+ mobileImg: Img;
18
+ list: FeaturesDataType[];
19
+ };
20
+ } & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
14
21
  export default _default;
@@ -1,2 +1,8 @@
1
- declare const _default: any;
1
+ interface FootChargerType extends React.HTMLAttributes<HTMLDivElement> {
2
+ data: {
3
+ title: string;
4
+ text: string;
5
+ };
6
+ }
7
+ declare const _default: import("react").ForwardRefExoticComponent<FootChargerType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
8
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { FooterNavigationProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<FooterNavigationProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
3
  export default _default;
@@ -1,5 +1,7 @@
1
+ import React from 'react';
1
2
  import 'swiper/css';
2
3
  import 'swiper/css/navigation';
3
4
  import 'swiper/css/pagination';
4
- declare const _default: any;
5
+ import type { GiftBoxType } from './types.js';
6
+ declare const _default: React.ForwardRefExoticComponent<GiftBoxType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
5
7
  export default _default;
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import * as React from 'react';
2
+ import type { GiftShelfProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<GiftShelfProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
3
5
  export type { GiftShelfProps, GiftShelfData, GiftShelfItem, GiftShelfProduct, CountdownConfig, ResponsiveBackgroundImage, } from './types.js';
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import * as React from 'react';
2
+ import type { GiftTierShelfProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<GiftTierShelfProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
3
5
  export type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './types.js';
@@ -37,5 +37,5 @@ export interface GraphicProps extends ComponentCommonProps, React.HTMLAttributes
37
37
  itemTheme?: Theme;
38
38
  };
39
39
  }
40
- declare const _default: any;
40
+ declare const _default: React.ForwardRefExoticComponent<GraphicProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
41
41
  export default _default;
@@ -17,6 +17,6 @@ interface GraphicAttractionBlockProps extends React.HTMLAttributes<HTMLElement>
17
17
  attractionItems?: AttractionItem[];
18
18
  };
19
19
  }
20
- declare const _default: any;
20
+ declare const _default: React.ForwardRefExoticComponent<GraphicAttractionBlockProps & React.RefAttributes<HTMLElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
21
21
  export default _default;
22
22
  export type { GraphicAttractionBlockProps };
@@ -8,5 +8,11 @@ export type GraphicMoreDataType = {
8
8
  fullWidth: 'true' | 'false';
9
9
  span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
10
  };
11
- declare const _default: any;
11
+ interface GraphicMoreType extends React.HTMLAttributes<HTMLDivElement> {
12
+ data: {
13
+ shape?: 'rounded' | 'square';
14
+ productsTab: GraphicMoreDataType[];
15
+ };
16
+ }
17
+ declare const _default: import("react").ForwardRefExoticComponent<GraphicMoreType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
12
18
  export default _default;
@@ -1,4 +1,12 @@
1
- import type { GraphicOverlayProps } from './types';
2
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { GraphicOverlayProps, Item } from './types';
3
+ declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
+ data: {
5
+ shape?: import("../../types/props").Shape;
6
+ items: ({
7
+ width?: "full" | "half" | "one-third";
8
+ } & Item)[];
9
+ };
10
+ } & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
3
11
  export default _default;
4
12
  export type { GraphicOverlayProps };
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { HeaderNavigationProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<HeaderNavigationProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,3 +1,7 @@
1
+ import React from 'react';
2
+ import type { HeroBannerProps } from './types.js';
1
3
  export type HeroBannerSemanticName = 'root' | 'title' | 'subtitle' | 'buttonGroup' | 'primaryButton' | 'secondaryButton' | 'captionGroup';
2
- declare const _default: any;
4
+ declare const _default: React.ForwardRefExoticComponent<HeroBannerProps & {
5
+ classNames?: Partial<Record<HeroBannerSemanticName, string>>;
6
+ } & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
3
7
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { ImageTextFeatureProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<ImageTextFeatureProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { ImageWithTextProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<ImageWithTextProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -75,5 +75,5 @@ export interface KspProps extends Omit<React.HTMLAttributes<HTMLElement>, 'class
75
75
  /** 语义化类名配置 */
76
76
  classNames?: KspClassNames;
77
77
  }
78
- declare const _default: any;
78
+ declare const _default: import("react").ForwardRefExoticComponent<KspProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
79
79
  export default _default;
@@ -1,2 +1,12 @@
1
- declare const _default: any;
1
+ import type { Product, ProductVariant } from '../../types/product';
2
+ import type { DeliveryCustom } from './type';
3
+ declare const _default: import("react").ForwardRefExoticComponent<{
4
+ metafields: any;
5
+ productList: Array<Product & {
6
+ variant: ProductVariant;
7
+ }>;
8
+ variant: ProductVariant;
9
+ onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
10
+ className?: string;
11
+ } & Partial<import("../../../../shared/Styles.js").StylesProps & import("../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
12
  export default _default;