@anker-in/headless-ui 1.1.36 → 1.1.37

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 (85) hide show
  1. package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +42 -0
  2. package/dist/cjs/biz-components/AnchorNavigation/index.js +2 -0
  3. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +7 -0
  4. package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.d.ts +2 -0
  5. package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js +2 -0
  6. package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js.map +7 -0
  7. package/dist/cjs/biz-components/EventSchedule/index.d.ts +69 -0
  8. package/dist/cjs/biz-components/EventSchedule/index.js +2 -0
  9. package/dist/cjs/biz-components/EventSchedule/index.js.map +7 -0
  10. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  11. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  12. package/dist/cjs/biz-components/HeroBanner/types.d.ts +3 -0
  13. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  14. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  15. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +49 -0
  16. package/dist/cjs/biz-components/PromotionalBar/index.js +2 -0
  17. package/dist/cjs/biz-components/PromotionalBar/index.js.map +7 -0
  18. package/dist/cjs/biz-components/Title/Countdown.d.ts +14 -0
  19. package/dist/cjs/biz-components/Title/Countdown.js +2 -0
  20. package/dist/cjs/biz-components/Title/Countdown.js.map +7 -0
  21. package/dist/cjs/biz-components/Title/index.js +1 -1
  22. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Title/types.d.ts +55 -0
  24. package/dist/cjs/biz-components/Title/types.js +1 -1
  25. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  26. package/dist/cjs/biz-components/index.d.ts +3 -0
  27. package/dist/cjs/biz-components/index.js +1 -1
  28. package/dist/cjs/biz-components/index.js.map +3 -3
  29. package/dist/cjs/shared/Styles.js +1 -1
  30. package/dist/cjs/shared/Styles.js.map +2 -2
  31. package/dist/cjs/stories/anchorNavigation.stories.d.ts +61 -0
  32. package/dist/cjs/stories/anchorNavigation.stories.js +2 -0
  33. package/dist/cjs/stories/anchorNavigation.stories.js.map +7 -0
  34. package/dist/cjs/stories/eventSchedule.stories.d.ts +70 -0
  35. package/dist/cjs/stories/eventSchedule.stories.js +2 -0
  36. package/dist/cjs/stories/eventSchedule.stories.js.map +7 -0
  37. package/dist/cjs/stories/promotionalBar.stories.d.ts +44 -0
  38. package/dist/cjs/stories/promotionalBar.stories.js +2 -0
  39. package/dist/cjs/stories/promotionalBar.stories.js.map +7 -0
  40. package/dist/cjs/stories/title.stories.d.ts +75 -0
  41. package/dist/cjs/stories/title.stories.js +2 -0
  42. package/dist/cjs/stories/title.stories.js.map +7 -0
  43. package/dist/esm/biz-components/AnchorNavigation/index.d.ts +42 -0
  44. package/dist/esm/biz-components/AnchorNavigation/index.js +2 -0
  45. package/dist/esm/biz-components/AnchorNavigation/index.js.map +7 -0
  46. package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.d.ts +2 -0
  47. package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js +2 -0
  48. package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js.map +7 -0
  49. package/dist/esm/biz-components/EventSchedule/index.d.ts +69 -0
  50. package/dist/esm/biz-components/EventSchedule/index.js +2 -0
  51. package/dist/esm/biz-components/EventSchedule/index.js.map +7 -0
  52. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  53. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  54. package/dist/esm/biz-components/HeroBanner/types.d.ts +3 -0
  55. package/dist/esm/biz-components/PromotionalBar/index.d.ts +49 -0
  56. package/dist/esm/biz-components/PromotionalBar/index.js +2 -0
  57. package/dist/esm/biz-components/PromotionalBar/index.js.map +7 -0
  58. package/dist/esm/biz-components/Title/Countdown.d.ts +14 -0
  59. package/dist/esm/biz-components/Title/Countdown.js +2 -0
  60. package/dist/esm/biz-components/Title/Countdown.js.map +7 -0
  61. package/dist/esm/biz-components/Title/index.js +1 -1
  62. package/dist/esm/biz-components/Title/index.js.map +3 -3
  63. package/dist/esm/biz-components/Title/types.d.ts +55 -0
  64. package/dist/esm/biz-components/index.d.ts +3 -0
  65. package/dist/esm/biz-components/index.js +1 -1
  66. package/dist/esm/biz-components/index.js.map +2 -2
  67. package/dist/esm/shared/Styles.js +1 -1
  68. package/dist/esm/shared/Styles.js.map +2 -2
  69. package/dist/esm/stories/anchorNavigation.stories.d.ts +61 -0
  70. package/dist/esm/stories/anchorNavigation.stories.js +2 -0
  71. package/dist/esm/stories/anchorNavigation.stories.js.map +7 -0
  72. package/dist/esm/stories/eventSchedule.stories.d.ts +70 -0
  73. package/dist/esm/stories/eventSchedule.stories.js +2 -0
  74. package/dist/esm/stories/eventSchedule.stories.js.map +7 -0
  75. package/dist/esm/stories/promotionalBar.stories.d.ts +44 -0
  76. package/dist/esm/stories/promotionalBar.stories.js +2 -0
  77. package/dist/esm/stories/promotionalBar.stories.js.map +7 -0
  78. package/dist/esm/stories/title.stories.d.ts +75 -0
  79. package/dist/esm/stories/title.stories.js +2 -0
  80. package/dist/esm/stories/title.stories.js.map +7 -0
  81. package/dist/tokens/anker.css +1 -0
  82. package/dist/tokens/base.css +7 -0
  83. package/dist/tokens/solix.css +1 -0
  84. package/package.json +1 -1
  85. package/tailwind.config.js +1 -0
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ export interface AnchorNavigationSemanticName {
4
+ root: 'root';
5
+ content: 'content';
6
+ item: 'item';
7
+ }
8
+ /**
9
+ * 导航项对齐方向样式变体
10
+ */
11
+ declare const anchorNavigationVariants: (props?: ({
12
+ alignment?: "end" | "start" | "center" | null | undefined;
13
+ size?: "small" | "large" | null | undefined;
14
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
+ /**
16
+ * AnchorNavigation 业务组件数据接口
17
+ */
18
+ export interface AnchorNavigationData {
19
+ /** 锚点列表 */
20
+ sectionIds: {
21
+ targetId: string;
22
+ label: string;
23
+ }[];
24
+ /** 导航项水平对齐方式 */
25
+ alignment?: 'start' | 'center' | 'end';
26
+ /** 主题模式 */
27
+ theme?: 'light' | 'dark';
28
+ /** 导航大小 */
29
+ size?: 'small' | 'large';
30
+ }
31
+ export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {
32
+ /** 业务数据 */
33
+ data: AnchorNavigationData;
34
+ classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>;
35
+ }
36
+ /**
37
+ * AnchorNavigation - 锚点导航
38
+ *
39
+ * @description 锚点导航
40
+ */
41
+ declare const AnchorNavigation: React.ForwardRefExoticComponent<AnchorNavigationProps & React.RefAttributes<HTMLDivElement>>;
42
+ export default AnchorNavigation;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var T=Object.create;var g=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var V=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},y=(t,e,n,f)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of H(e))!L.call(t,o)&&o!==n&&g(t,o,{get:()=>e[o],enumerable:!(f=E(e,o))||f.enumerable});return t};var A=(t,e,n)=>(n=t!=null?T(D(t)):{},y(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),z=t=>y(g({},"__esModule",{value:!0}),t);var S={};V(S,{default:()=>B});module.exports=z(S);var v=require("react/jsx-runtime"),l=A(require("react")),u=require("../../helpers/utils.js"),p=require("class-variance-authority"),k=A(require("./useAnchorPosition.js"));const M=(0,p.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"}}),P=(0,p.cva)("anchor-navigation-item after:bg-brand 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"}}),C=(0,p.cva)("tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] sticky top-0 z-40 w-full px-4",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),N=l.forwardRef(({classNames:t={},data:e},n)=>{const{alignment:f="start",theme:o="light",size:x="small"}=e,m=(0,k.default)(e.sectionIds?.map(a=>a.targetId)||[]),d=l.useRef(null),h=l.useRef(null),I=l.useRef([]);l.useImperativeHandle(n,()=>d.current);const b=l.useCallback(a=>{const i=I.current[a];if(i&&h.current){const r=h.current,s=i,c=s.offsetLeft-r.offsetWidth/2+s.offsetWidth/2;typeof r.scrollTo=="function"&&r.scrollTo({left:c,behavior:"smooth"})}},[]);return l.useEffect(()=>{if(!m)return;const a=e.sectionIds?.findIndex(i=>i.targetId===m);a!==void 0&&a!==-1&&b(a)},[m,e.sectionIds,b]),(0,v.jsx)("div",{ref:d,className:(0,u.cn)(C({theme:o}),t?.root),children:(0,v.jsx)("div",{ref:h,className:(0,u.cn)(M({alignment:f,size:x}),"relative",t?.content),children:e.sectionIds?.map((a,i)=>{const r=m===a.targetId,s=o==="dark";return(0,v.jsx)("button",{ref:c=>{c&&(I.current[i]=c)},onClick:()=>{b(i);const c=document.getElementById(a.targetId);if(c&&d.current){const w=d.current.offsetHeight,R=c.getBoundingClientRect().top+window.scrollY-w;window.scrollTo({top:R,behavior:"smooth"})}},className:(0,u.cn)(P({size:x}),{"text-[#4A4C56]":!s&&!r,"text-[#080A0F] after:w-full after:opacity-100":!s&&r,"text-[#8A8D92]":s&&!r,"text-white after:w-full after:opacity-100":s&&r},t?.item),children:a.label},a.targetId)})})})});N.displayName="AnchorNavigation";var B=N;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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'\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\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item after:bg-brand 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(\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] sticky top-0 z-40 w-full px-4',\n {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: {\n targetId: string\n label: string\n }[]\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 classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(({ classNames = {}, data }, 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 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 <div ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)}>\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 const isDark = theme === 'dark'\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n onClick={() => {\n autoScrollToActiveItem(index)\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 {\n // Light theme colors\n 'text-[#4A4C56]': !isDark && !isActive,\n 'text-[#080A0F] after:w-full after:opacity-100': !isDark && isActive,\n // Dark theme colors\n 'text-[#8A8D92]': isDark && !isActive,\n 'text-white after:w-full after:opacity-100': isDark && isActive,\n },\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </div>\n )\n})\n\nAnchorNav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AACD,EAC7B,4CAA6CC,GAAUD,CACzD,EACApB,GAAY,IACd,EAEC,SAAAQ,EAAK,OAlCDA,EAAK,QAmCZ,CAEJ,CAAC,EACH,EACF,CAEJ,CAAC,EAEDT,EAAiB,YAAc,mBAC/B,IAAOV,EAAQU",
6
+ "names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "AnchorNavigation", "classNames", "data", "ref", "alignment", "theme", "size", "activeId", "useAnchorPosition", "item", "rootRef", "containerRef", "sectionRefs", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "isDark", "el", "targetElement", "navHeight", "targetPosition"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const useAnchorPosition: (sectionIds: string[], offset?: number) => string;
2
+ export default useAnchorPosition;
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var v=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},p=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of g(t))!h.call(e,o)&&o!==n&&i(e,o,{get:()=>t[o],enumerable:!(l=m(t,o))||l.enumerable});return e};var E=e=>p(i({},"__esModule",{value:!0}),e);var S={};v(S,{default:()=>A});module.exports=E(S);var c=require("react"),s=require("es-toolkit");const b=(e,t=100)=>{const[n,l]=(0,c.useState)(e[0]||"");return(0,c.useEffect)(()=>{const o=()=>{const a=Math.ceil(window.scrollY+t+10);let u=!1;for(let r=e.length-1;r>=0;r--){const f=document.getElementById(e[r]);if(f){const w=Math.ceil(f.getBoundingClientRect().top+window.scrollY);if(a>=w){l(e[r]),u=!0;break}}}!u&&e.length>0&&l(e[0])};o();const d=(0,s.debounce)(o,50);return window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[e,t]),n};var A=b;
2
+ //# sourceMappingURL=useAnchorPosition.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/AnchorNavigation/useAnchorPosition.tsx"],
4
+ "sourcesContent": ["import { useState, useEffect } from 'react'\nimport { debounce } from 'es-toolkit'\n\nconst useAnchorPosition = (sectionIds: string[], offset = 100) => {\n const [activeId, setActiveId] = useState(sectionIds[0] || '')\n\n useEffect(() => {\n const handleScroll = () => {\n const scrollPosition = Math.ceil(window.scrollY + offset + 10)\n\n let foundActiveId = false\n\n // \u904D\u5386\u6240\u6709section\uFF0C\u627E\u5230\u5F53\u524D\u53EF\u89C6\u533A\u57DF\u5185\u7684section\n for (let i = sectionIds.length - 1; i >= 0; i--) {\n const section = document.getElementById(sectionIds[i])\n if (section) {\n const offsetTop = Math.ceil(section.getBoundingClientRect().top + window.scrollY)\n if (scrollPosition >= offsetTop) {\n setActiveId(sectionIds[i])\n foundActiveId = true\n break\n }\n }\n }\n\n // \u5982\u679C\u6EDA\u52A8\u8DDD\u79BB\u5C0F\u4E8E\u7B2C\u4E00\u4E2Asection\u7684offset\uFF0C\u8BBE\u7F6E\u4E3A\u7B2C\u4E00\u4E2Asection\n if (!foundActiveId && sectionIds.length > 0) {\n setActiveId(sectionIds[0])\n }\n }\n\n // \u521D\u59CB\u5316\u65F6\u6267\u884C\u4E00\u6B21\n handleScroll()\n\n // \u521B\u5EFAdebounce\u51FD\u6570\u5E76\u4FDD\u5B58\u5F15\u7528\uFF0C\u786E\u4FDD\u80FD\u6B63\u786E\u79FB\u9664\u76D1\u542C\u5668\n const debouncedHandleScroll = debounce(handleScroll, 50)\n window.addEventListener('scroll', debouncedHandleScroll)\n\n return () => {\n window.removeEventListener('scroll', debouncedHandleScroll)\n }\n }, [sectionIds, offset])\n\n return activeId\n}\n\nexport default useAnchorPosition\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,iBACpCC,EAAyB,sBAEzB,MAAMC,EAAoB,CAACC,EAAsBC,EAAS,MAAQ,CAChE,KAAM,CAACC,EAAUC,CAAW,KAAI,YAASH,EAAW,CAAC,GAAK,EAAE,EAE5D,sBAAU,IAAM,CACd,MAAMI,EAAe,IAAM,CACzB,MAAMC,EAAiB,KAAK,KAAK,OAAO,QAAUJ,EAAS,EAAE,EAE7D,IAAIK,EAAgB,GAGpB,QAASC,EAAIP,EAAW,OAAS,EAAGO,GAAK,EAAGA,IAAK,CAC/C,MAAMC,EAAU,SAAS,eAAeR,EAAWO,CAAC,CAAC,EACrD,GAAIC,EAAS,CACX,MAAMC,EAAY,KAAK,KAAKD,EAAQ,sBAAsB,EAAE,IAAM,OAAO,OAAO,EAChF,GAAIH,GAAkBI,EAAW,CAC/BN,EAAYH,EAAWO,CAAC,CAAC,EACzBD,EAAgB,GAChB,KACF,CACF,CACF,CAGI,CAACA,GAAiBN,EAAW,OAAS,GACxCG,EAAYH,EAAW,CAAC,CAAC,CAE7B,EAGAI,EAAa,EAGb,MAAMM,KAAwB,YAASN,EAAc,EAAE,EACvD,cAAO,iBAAiB,SAAUM,CAAqB,EAEhD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAqB,CAC5D,CACF,EAAG,CAACV,EAAYC,CAAM,CAAC,EAEhBC,CACT,EAEA,IAAOP,EAAQI",
6
+ "names": ["useAnchorPosition_exports", "__export", "useAnchorPosition_default", "__toCommonJS", "import_react", "import_es_toolkit", "useAnchorPosition", "sectionIds", "offset", "activeId", "setActiveId", "handleScroll", "scrollPosition", "foundActiveId", "i", "section", "offsetTop", "debouncedHandleScroll"]
7
+ }
@@ -0,0 +1,69 @@
1
+ import * as React from 'react';
2
+ import type { Media } from '../../types/props.js';
3
+ export type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard';
4
+ /**
5
+ * 时间状态类型
6
+ */
7
+ export type TimeStatus = 'completed' | 'in-progress' | 'not-started';
8
+ /**
9
+ * 状态化图标配置
10
+ */
11
+ export interface StateIcon {
12
+ /** 激活状态的图标(进行中) */
13
+ active: Media;
14
+ /** 非激活状态的图标(未开始) */
15
+ inactive: Media;
16
+ /** 已完成状态的图标(可选,不提供则使用 inactive) */
17
+ completed?: Media;
18
+ }
19
+ /**
20
+ * 活动日程项数据接口
21
+ */
22
+ export interface EventScheduleItem {
23
+ /** 标题 */
24
+ title: string;
25
+ /** 开始日期(ISO 8601 格式或任何 dayjs 支持的格式,如 '2024-12-01') */
26
+ startDate: string;
27
+ /** 结束日期(ISO 8601 格式或任何 dayjs 支持的格式,如 '2024-12-31') */
28
+ endDate: string;
29
+ /**
30
+ * 卡片背景图标配置,状态化图标(必须包含 active 和 inactive)
31
+ *
32
+ * @example
33
+ * icon: {
34
+ * active: { url: "https://example.com/active-icon.svg", alt: "Active Icon" },
35
+ * inactive: { url: "https://example.com/inactive-icon.svg", alt: "Inactive Icon" }
36
+ * }
37
+ */
38
+ icon?: StateIcon;
39
+ /** 详细信息列表 */
40
+ items: {
41
+ /** 图标 (SVG 字符串或 URL) */
42
+ icon?: string;
43
+ /** 文本内容 */
44
+ label: string;
45
+ }[];
46
+ }
47
+ /**
48
+ * EventSchedule 业务组件数据接口
49
+ */
50
+ export interface EventScheduleData {
51
+ /** 日程列表 */
52
+ scheduleList: EventScheduleItem[];
53
+ /** 是否显示时间轴,默认为 true */
54
+ showTimeline?: boolean;
55
+ /** 主题模式 */
56
+ theme?: 'light' | 'dark';
57
+ }
58
+ export interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {
59
+ /** 业务数据 */
60
+ data: EventScheduleData;
61
+ classNames?: Partial<Record<EventScheduleSemanticName, string>>;
62
+ }
63
+ /**
64
+ * EventSchedule - 活动日程组件
65
+ *
66
+ * @description 显示活动日程时间轴和活动卡片列表
67
+ */
68
+ declare const EventSchedule: React.ForwardRefExoticComponent<EventScheduleProps & React.RefAttributes<HTMLDivElement>>;
69
+ export default EventSchedule;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var P=Object.create;var x=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var $=(t,e)=>{for(var i in e)x(t,i,{get:e[i],enumerable:!0})},D=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of z(e))!H.call(t,n)&&n!==i&&x(t,n,{get:()=>e[n],enumerable:!(o=R(e,n))||o.enumerable});return t};var F=(t,e,i)=>(i=t!=null?P(j(t)):{},D(e||!t||!t.__esModule?x(i,"default",{value:t,enumerable:!0}):i,t)),O=t=>D(x({},"__esModule",{value:!0}),t);var X={};$(X,{default:()=>W});module.exports=O(X);var r=require("react/jsx-runtime"),l=F(require("react")),u=require("../../helpers/index.js"),g=require("../../components/index.js"),f=require("swiper/react"),b=F(require("dayjs")),S=require("class-variance-authority");const w=(t,e)=>{const i=(0,b.default)(),o=(0,b.default)(t).startOf("day"),n=(0,b.default)(e).endOf("day");return i.isAfter(n)?"completed":i.isBefore(o)?"not-started":"in-progress"},q=(0,S.cva)("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),G=(0,S.cva)("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=(0,S.cva)("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),J=(0,S.cva)("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),K=({timeStatus:t,theme:e="light",className:i,index:o,nodeLength:n})=>{const d=`${t}-${e}`,a=o===0,c=o===n-1;return(0,r.jsxs)("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[(0,r.jsx)("div",{className:(0,u.cn)(q({state:d}),a&&"rounded-l-full",c&&"rounded-r-full",i)}),(0,r.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,r.jsx)("div",{className:G({state:d})})})]})},Q=(t,e)=>{if(t)return e==="in-progress"?t.active:e==="completed"&&t.completed||t.inactive},U=({timeStatus:t,item:e,theme:i="light",className:o,scheduleCount:n})=>{const d=l.useMemo(()=>Q(e.icon,t),[e.icon,t]),a=`${t}-${i}`;return(0,r.jsxs)("div",{className:(0,u.cn)(J({state:a}),o),children:[d&&(0,r.jsx)("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:(0,r.jsx)(g.Picture,{source:d.url,alt:d.alt,className:"aspect-square"})}),(0,r.jsxs)("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[(0,r.jsx)(g.Heading,{html:e.title,className:(0,u.cn)(n>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:a}))}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",children:e.items.map((c,h)=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[c.icon&&(0,r.jsx)(g.Text,{className:(0,u.cn)("desktop:size-6 size-5 shrink-0",k({state:a})),html:c.icon}),(0,r.jsx)(g.Text,{html:c.label,className:(0,u.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",k({state:a}))})]},h))})]})]})},L=l.forwardRef(({classNames:t={},data:e},i)=>{const o=e.theme||"light",n=l.useRef(null),d=l.useRef(null),a=l.useRef(!1),c=l.useMemo(()=>e?.scheduleList?.length||2,[e?.scheduleList]),h=l.useMemo(()=>e.scheduleList.findIndex(s=>w(s.startDate,s.endDate)==="in-progress"),[e.scheduleList]),v=l.useCallback((s,m=!1)=>{const p=B=>{switch(B){case"mobile":return{slidesPerView:1.17};case"tablet":return s===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return s===2?{}:s===4?{slidesPerView:3.2}:{slidesPerView:s};case"desktop":return s===2?{slidesPerView:2}:{slidesPerView:s}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),y=p("desktop");return m?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{...y,spaceBetween:16}}:{0:T,768:C,1024:N,1440:y}},[]),V=l.useMemo(()=>v(c,!0),[c,v]),A=l.useMemo(()=>v(c,!1),[c,v]),E=e.showTimeline!==!1,I=l.useCallback(s=>{a.current||!d.current||(a.current=!0,d.current.slideTo(s.activeIndex,s.params.speed),setTimeout(()=>{a.current=!1},50))},[]),M=l.useCallback(s=>{a.current||!n.current||(a.current=!0,n.current.slideTo(s.activeIndex,s.params.speed),setTimeout(()=>{a.current=!1},50))},[]);return l.useEffect(()=>{n.current&&d.current&&h>=0&&setTimeout(()=>{a.current=!0,n.current?.slideTo(h,500),d.current?.slideTo(h,500),setTimeout(()=>{a.current=!1},600)},100)},[h]),(0,r.jsxs)("div",{ref:i,className:(0,u.cn)("tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] overflow-hidden px-4",t?.root),children:[E&&(0,r.jsx)(f.Swiper,{breakpoints:A,className:"h-4 w-full !overflow-visible",onSwiper:s=>{d.current=s},onSlideChange:M,children:e.scheduleList.map((s,m)=>{const p=w(s.startDate,s.endDate);return(0,r.jsx)(f.SwiperSlide,{className:"",children:(0,r.jsx)(K,{className:t?.timeline,timeStatus:p,theme:o,index:m,nodeLength:e.scheduleList.length})},"timelineNode"+m)})}),(0,r.jsx)(f.Swiper,{breakpoints:V,className:"w-full !overflow-visible",onSwiper:s=>{n.current=s},onSlideChange:I,children:e.scheduleList.map((s,m)=>{const p=w(s.startDate,s.endDate);return(0,r.jsx)(f.SwiperSlide,{children:(0,r.jsx)(U,{timeStatus:p,className:(0,u.cn)(E?"laptop:mt-4 mt-2":"",t?.eventScheduleCard),item:s,theme:o,scheduleCount:e.scheduleList.length})},"SwiperSlideItem"+m)})})]})});L.displayName="EventSchedule";var W=L;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/EventSchedule/index.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Heading } from '../../components/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper'\nimport dayjs from 'dayjs'\nimport { cva } from 'class-variance-authority'\nimport type { Media } from '../../types/props.js'\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u65F6\u95F4\u72B6\u6001\u7C7B\u578B\n */\nexport type TimeStatus = 'completed' | 'in-progress' | 'not-started'\n\n/**\n * \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n */\nexport interface StateIcon {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u8FDB\u884C\u4E2D\uFF09 */\n active: Media\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807\uFF08\u672A\u5F00\u59CB\uFF09 */\n inactive: Media\n /** \u5DF2\u5B8C\u6210\u72B6\u6001\u7684\u56FE\u6807\uFF08\u53EF\u9009\uFF0C\u4E0D\u63D0\u4F9B\u5219\u4F7F\u7528 inactive\uFF09 */\n completed?: Media\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleItem {\n /** \u6807\u9898 */\n title: string\n /** \u5F00\u59CB\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-01'\uFF09 */\n startDate: string\n /** \u7ED3\u675F\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-31'\uFF09 */\n endDate: string\n /**\n * \u5361\u7247\u80CC\u666F\u56FE\u6807\u914D\u7F6E\uFF0C\u72B6\u6001\u5316\u56FE\u6807\uFF08\u5FC5\u987B\u5305\u542B active \u548C inactive\uFF09\n *\n * @example\n * icon: {\n * active: { url: \"https://example.com/active-icon.svg\", alt: \"Active Icon\" },\n * inactive: { url: \"https://example.com/inactive-icon.svg\", alt: \"Inactive Icon\" }\n * }\n */\n icon?: StateIcon\n /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon?: string\n /** \u6587\u672C\u5185\u5BB9 */\n label: string\n }[]\n}\n\n/**\n * EventSchedule \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleData {\n /** \u65E5\u7A0B\u5217\u8868 */\n scheduleList: EventScheduleItem[]\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n}\n\nexport interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: EventScheduleData\n classNames?: Partial<Record<EventScheduleSemanticName, string>>\n}\n\n/**\n * \u83B7\u53D6\u65F6\u95F4\u72B6\u6001\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u65F6\u95F4\u72B6\u6001\uFF1Acompleted\uFF08\u5DF2\u5B8C\u6210\uFF09\u3001in-progress\uFF08\u8FDB\u884C\u4E2D\uFF09\u3001not-started\uFF08\u672A\u5F00\u59CB\uFF09\n */\nconst getTimeStatus = (startDate: string, endDate: string): TimeStatus => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E - \u5DF2\u5B8C\u6210\n if (now.isAfter(end)) {\n return 'completed'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u65F6\u95F4\u4E4B\u524D - \u672A\u5F00\u59CB\n if (now.isBefore(start)) {\n return 'not-started'\n }\n\n // \u5F53\u524D\u65F6\u95F4\u5728\u5F00\u59CB\u548C\u7ED3\u675F\u4E4B\u95F4 - \u8FDB\u884C\u4E2D\n return 'in-progress'\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8FDB\u5EA6\u6761\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineProgressActiveVariants = cva('h-1 w-full overflow-hidden', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst timelineNodeActiveVariants = cva('size-4 rounded-full transition-colors', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F6CD4E]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\uFF08\u4E0E\u8FDB\u884C\u4E2D\u989C\u8272\u4E00\u81F4\uFF09\n 'completed-light': 'bg-[#F6CD4E]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u6587\u672C\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst cardTextVariants = cva('font-bold leading-[1.2]', {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\uFF08\u4FDD\u6301\u539F\u6709\u989C\u8272\uFF09\n 'in-progress-light': 'text-[#080A0F]',\n 'in-progress-dark': 'text-white',\n // \u672A\u5F00\u59CB\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'not-started-light': 'text-[#080A0F]',\n 'not-started-dark': 'text-[#F5F6F7]',\n // \u5DF2\u5B8C\u6210\uFF0860% \u900F\u660E\u5EA6\uFF09\n 'completed-light': 'text-[#4A4C56]/60',\n 'completed-dark': 'text-[#F5F6F7]/60',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n})\n\n/**\n * \u5361\u7247\u5BB9\u5668\u6837\u5F0F\u53D8\u4F53\uFF08\u652F\u6301\u4E09\u79CD\u65F6\u95F4\u72B6\u6001\uFF09\n */\nconst eventScheduleCardVariants = cva(\n 'laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden',\n {\n variants: {\n state: {\n // \u8FDB\u884C\u4E2D\n 'in-progress-light': 'bg-[#F4E8BC]',\n 'in-progress-dark': 'bg-[#D79941]',\n // \u672A\u5F00\u59CB\n 'not-started-light': 'bg-[#EAEAEC]',\n 'not-started-dark': 'bg-[#1E2024]',\n // \u5DF2\u5B8C\u6210\n 'completed-light': 'bg-[#F4E8BC]',\n 'completed-dark': 'bg-[#D79941]',\n },\n },\n defaultVariants: {\n state: 'not-started-light',\n },\n }\n)\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6 Props\n */\ninterface TimelineNodeProps {\n /** \u65F6\u95F4\u72B6\u6001 */\n timeStatus: TimeStatus\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n /** \u5F53\u524D\u8282\u70B9\u7D22\u5F15 */\n index: number\n /** \u8282\u70B9\u603B\u6570 */\n nodeLength: number\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ timeStatus, theme = 'light', className, index, nodeLength }: TimelineNodeProps) => {\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const state = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n // \u5224\u65AD\u9996\u5C3E\u4F4D\u7F6E\n const isFirst = index === 0\n const isLast = index === nodeLength - 1\n\n return (\n <div className=\"relative my-2 flex h-1 w-full items-center justify-center\">\n {/* \u8FDB\u5EA6\u6761\u80CC\u666F */}\n <div\n className={cn(\n timelineProgressActiveVariants({ state }),\n isFirst && 'rounded-l-full',\n isLast && 'rounded-r-full',\n className\n )}\n />\n {/* \u65F6\u95F4\u8282\u70B9\u5706\u70B9 */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className={timelineNodeActiveVariants({ state })} />\n </div>\n </div>\n )\n}\n\n/**\n * \u6839\u636E\u65F6\u95F4\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u56FE\u6807\n * @param icon \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n * @param timeStatus \u65F6\u95F4\u72B6\u6001\n * @returns \u56FE\u6807 Media \u5BF9\u8C61\n */\nconst getIconByTimeStatus = (icon: StateIcon | undefined, timeStatus: TimeStatus): Media | undefined => {\n if (!icon) return undefined\n // \u8FDB\u884C\u4E2D\u4F7F\u7528 active \u56FE\u6807\n if (timeStatus === 'in-progress') return icon.active\n // \u5DF2\u5B8C\u6210\u4F7F\u7528 completed \u56FE\u6807\uFF08\u5982\u679C\u6709\uFF09\uFF0C\u5426\u5219\u4F7F\u7528 inactive\n if (timeStatus === 'completed') return icon.completed || icon.inactive\n // \u672A\u5F00\u59CB\u4F7F\u7528 inactive \u56FE\u6807\n return icon.inactive\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n timeStatus,\n item,\n theme = 'light',\n className,\n scheduleCount,\n}: {\n timeStatus: TimeStatus\n item: EventScheduleItem\n theme?: 'light' | 'dark'\n className?: string\n scheduleCount: number\n}) => {\n const currentIcon = React.useMemo(() => {\n return getIconByTimeStatus(item.icon, timeStatus)\n }, [item.icon, timeStatus])\n\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const cardState = `${timeStatus}-${theme}` as\n | 'in-progress-light'\n | 'in-progress-dark'\n | 'not-started-light'\n | 'not-started-dark'\n | 'completed-light'\n | 'completed-dark'\n\n return (\n <div className={cn(eventScheduleCardVariants({ state: cardState }), className)}>\n {/* \u80CC\u666F\u56FE\u6807 */}\n {currentIcon && (\n <div className=\"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]\">\n <Picture source={currentIcon.url} alt={currentIcon.alt} className=\"aspect-square\" />\n </div>\n )}\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8\">\n <Heading\n html={item.title}\n className={cn(\n scheduleCount >= 4 ? 'desktop:text-[24px]' : 'desktop:text-[32px]',\n 'laptop:text-[24px] line-clamp-1 text-[20px]',\n cardTextVariants({ state: cardState })\n )}\n />\n {/* \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */}\n <div className=\"flex flex-col gap-0.5\">\n {item.items.map((detail, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n {/* \u56FE\u6807 */}\n {detail.icon && (\n <Text\n className={cn('desktop:size-6 size-5 shrink-0', cardTextVariants({ state: cardState }))}\n html={detail.icon}\n />\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]',\n cardTextVariants({ state: cardState })\n )}\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * EventSchedule - \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6\n *\n * @description \u663E\u793A\u6D3B\u52A8\u65E5\u7A0B\u65F6\u95F4\u8F74\u548C\u6D3B\u52A8\u5361\u7247\u5217\u8868\n */\nconst EventSchedule = React.forwardRef<HTMLDivElement, EventScheduleProps>(({ classNames = {}, data }, ref) => {\n const theme = data.theme || 'light'\n const swiperRef = React.useRef<SwiperType | null>(null)\n const timelineSwiperRef = React.useRef<SwiperType | null>(null)\n const isSyncingRef = React.useRef(false) // \u9632\u6B62\u5FAA\u73AF\u89E6\u53D1\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u8BA1\u7B97\u8FDB\u884C\u4E2D item \u7684\u7D22\u5F15\uFF08\u7528\u4E8E\u81EA\u52A8\u6EDA\u52A8\uFF09\n const activeIndex = React.useMemo(() => {\n return data.scheduleList.findIndex(item => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return timeStatus === 'in-progress'\n })\n }, [data.scheduleList])\n\n /**\n * \u751F\u6210\u7EDF\u4E00\u7684 Swiper \u65AD\u70B9\u914D\u7F6E\n * @param itemsPerRow \u6BCF\u884C\u663E\u793A\u7684\u9879\u76EE\u6570\n * @param withSpaceBetween \u662F\u5426\u5305\u542B\u95F4\u8DDD\u914D\u7F6E\n * @returns Swiper \u65AD\u70B9\u914D\u7F6E\u5BF9\u8C61\n */\n const generateSwiperBreakpoints = React.useCallback((itemsPerRow: number, withSpaceBetween: boolean = false) => {\n // \u6839\u636E itemsPerRow \u786E\u5B9A\u4E0D\u540C\u65AD\u70B9\u4E0B\u7684 slidesPerView\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.17 }\n case 'tablet':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: 2.4 }\n case 'laptop':\n if (itemsPerRow === 2) return {}\n if (itemsPerRow === 4) return { slidesPerView: 3.2 }\n return { slidesPerView: itemsPerRow }\n case 'desktop':\n if (itemsPerRow === 2) return { slidesPerView: 2 }\n return { slidesPerView: itemsPerRow }\n }\n }\n\n const mobileConfig = getBreakpointConfig('mobile')\n const tabletConfig = getBreakpointConfig('tablet')\n const laptopConfig = getBreakpointConfig('laptop')\n const desktopConfig = getBreakpointConfig('desktop')\n\n // \u5982\u679C\u9700\u8981 spaceBetween\uFF0C\u5219\u6DFB\u52A0\u5230\u914D\u7F6E\u4E2D\n if (withSpaceBetween) {\n return {\n 0: { ...mobileConfig, spaceBetween: 12 },\n 768: { ...tabletConfig, spaceBetween: 12 },\n 1024: { ...laptopConfig, spaceBetween: 16 },\n 1440: { ...desktopConfig, spaceBetween: 16 },\n }\n }\n\n return {\n 0: mobileConfig,\n 768: tabletConfig,\n 1024: laptopConfig,\n 1440: desktopConfig,\n }\n }, [])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\uFF08\u5361\u7247 Swiper - \u5305\u542B\u95F4\u8DDD\uFF09\n const swiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, true)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n // \u65F6\u95F4\u8F74 Swiper \u65AD\u70B9\u914D\u7F6E\uFF08\u4E0D\u5305\u542B\u95F4\u8DDD\uFF09\n const timeNodeSwiperBreakpoints = React.useMemo(() => {\n return generateSwiperBreakpoints(itemsPerRow, false)\n }, [itemsPerRow, generateSwiperBreakpoints])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\n\n // \u540C\u6B65\u4E24\u4E2A Swiper \u7684\u6ED1\u52A8\n const handleCardSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !timelineSwiperRef.current) return\n isSyncingRef.current = true\n timelineSwiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n const handleTimelineSwiperSlideChange = React.useCallback((swiper: SwiperType) => {\n if (isSyncingRef.current || !swiperRef.current) return\n isSyncingRef.current = true\n swiperRef.current.slideTo(swiper.activeIndex, swiper.params.speed)\n // \u5EF6\u8FDF\u91CD\u7F6E\u6807\u5FD7\uFF0C\u786E\u4FDD\u540C\u6B65\u5B8C\u6210\n setTimeout(() => {\n isSyncingRef.current = false\n }, 50)\n }, [])\n\n // \u81EA\u52A8\u6EDA\u52A8\u5230 active item\n React.useEffect(() => {\n if (swiperRef.current && timelineSwiperRef.current && activeIndex >= 0) {\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u786E\u4FDD Swiper \u5DF2\u7ECF\u5B8C\u5168\u521D\u59CB\u5316\n setTimeout(() => {\n isSyncingRef.current = true\n swiperRef.current?.slideTo(activeIndex, 500)\n timelineSwiperRef.current?.slideTo(activeIndex, 500)\n setTimeout(() => {\n isSyncingRef.current = false\n }, 600)\n }, 100)\n }\n }, [activeIndex])\n\n return (\n <div\n ref={ref}\n className={cn(\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] overflow-hidden px-4',\n classNames?.root\n )}\n >\n {showTimeline && (\n <Swiper\n breakpoints={timeNodeSwiperBreakpoints}\n className=\"h-4 w-full !overflow-visible\"\n onSwiper={swiper => {\n timelineSwiperRef.current = swiper\n }}\n onSlideChange={handleTimelineSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'timelineNode' + index} className=\"\">\n <TimelineNode\n className={classNames?.timeline}\n timeStatus={timeStatus}\n theme={theme}\n index={index}\n nodeLength={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n )}\n <Swiper\n breakpoints={swiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={swiper => {\n swiperRef.current = swiper\n }}\n onSlideChange={handleCardSwiperSlideChange}\n >\n {data.scheduleList.map((item, index) => {\n const timeStatus = getTimeStatus(item.startDate, item.endDate)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n <EventScheduleCard\n timeStatus={timeStatus}\n className={cn(showTimeline ? 'laptop:mt-4 mt-2' : '', classNames?.eventScheduleCard)}\n item={item}\n theme={theme}\n scheduleCount={data.scheduleList.length}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n </div>\n )\n})\n\nEventSchedule.displayName = 'EventSchedule'\nexport default EventSchedule\n\n// \u5BFC\u51FA\u7C7B\u578B\u4F9B\u5916\u90E8\u4F7F\u7528\n// export type { StateIcon, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAkOI,IAAAI,EAAA,6BAhOJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAuC,qCACvCC,EAAoC,wBAEpCC,EAAkB,oBAClBC,EAAoB,oCA0EpB,MAAMC,EAAgB,CAACC,EAAmBC,IAAgC,CACxE,MAAMC,KAAM,EAAAC,SAAM,EACZC,KAAQ,EAAAD,SAAMH,CAAS,EAAE,QAAQ,KAAK,EACtCK,KAAM,EAAAF,SAAMF,CAAO,EAAE,MAAM,KAAK,EAGtC,OAAIC,EAAI,QAAQG,CAAG,EACV,YAILH,EAAI,SAASE,CAAK,EACb,cAIF,aACT,EAKME,KAAiC,OAAI,6BAA8B,CACvE,SAAU,CACR,MAAO,CAEL,oBAAqB,eACrB,mBAAoB,eAEpB,oBAAqB,eACrB,mBAAoB,eAEpB,kBAAmB,eACnB,iBAAkB,cACpB,CACF,EACA,gBAAiB,CACf,MAAO,mBACT,CACF,CAAC,EAKKC,KAA6B,OAAI,wCAAyC,CAC9E,SAAU,CACR,MAAO,CAEL,oBAAqB,eACrB,mBAAoB,eAEpB,oBAAqB,eACrB,mBAAoB,eAEpB,kBAAmB,eACnB,iBAAkB,cACpB,CACF,EACA,gBAAiB,CACf,MAAO,mBACT,CACF,CAAC,EAKKC,KAAmB,OAAI,0BAA2B,CACtD,SAAU,CACR,MAAO,CAEL,oBAAqB,iBACrB,mBAAoB,aAEpB,oBAAqB,iBACrB,mBAAoB,iBAEpB,kBAAmB,oBACnB,iBAAkB,mBACpB,CACF,EACA,gBAAiB,CACf,MAAO,mBACT,CACF,CAAC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"names": ["EventSchedule_exports", "__export", "EventSchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_react", "import_dayjs", "import_class_variance_authority", "getTimeStatus", "startDate", "endDate", "now", "dayjs", "start", "end", "timelineProgressActiveVariants", "timelineNodeActiveVariants", "cardTextVariants", "eventScheduleCardVariants", "TimelineNode", "timeStatus", "theme", "className", "index", "nodeLength", "state", "isFirst", "isLast", "getIconByTimeStatus", "icon", "EventScheduleCard", "item", "scheduleCount", "currentIcon", "cardState", "detail", "EventSchedule", "classNames", "data", "ref", "swiperRef", "timelineSwiperRef", "isSyncingRef", "itemsPerRow", "activeIndex", "generateSwiperBreakpoints", "withSpaceBetween", "getBreakpointConfig", "breakpoint", "mobileConfig", "tabletConfig", "laptopConfig", "desktopConfig", "swiperBreakpoints", "timeNodeSwiperBreakpoints", "showTimeline", "handleCardSwiperSlideChange", "swiper", "handleTimelineSwiperSlideChange"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var ie=Object.create;var N=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var ue=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var de=(t,a)=>{for(var l in a)N(t,l,{get:a[l],enumerable:!0})},Q=(t,a,l,k)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of ce(a))!me.call(t,d)&&d!==l&&N(t,d,{get:()=>a[d],enumerable:!(k=pe(a,d))||k.enumerable});return t};var B=(t,a,l)=>(l=t!=null?ie(ue(t)):{},Q(a||!t||!t.__esModule?N(l,"default",{value:t,enumerable:!0}):l,t)),ge=t=>Q(N({},"__esModule",{value:!0}),t);var fe={};de(fe,{default:()=>xe});module.exports=ge(fe);var e=require("react/jsx-runtime"),o=B(require("react")),v=B(require("gsap")),w=require("gsap/dist/ScrollTrigger"),R=require("react-responsive"),G=require("react-intersection-observer"),J=B(require("../../helpers/ScrollLoadVideo.js")),r=require("../../components/index.js"),K=B(require("./Countdown.js")),m=require("../../helpers/index.js"),O=require("../../shared/Styles.js"),W=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),X=require("../../components/button.js"),Y=require("../VideoModal/index.js");const c="image",u="hero_banner",be=({size:t="base"})=>{const{width:a,height:l}=X.sizeMap[t];return(0,e.jsx)("svg",{width:a,height:l,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},Z=o.default.forwardRef(({data:t,className:a,onSecondaryClick:l,onPrimaryClick:k},d)=>{const{label:M,title:n,subtitle:i,endDate:S,endDate_tz:ee,dateFormat:te,pcImage:z,padImage:L,mobileImage:$,pcVideo:ae,padVideo:oe,mobileVideo:D,isShowVideo:re,primaryButton:g,secondaryButton:s,theme:le="light",size:H="default",caption:C=[],blockLink:E,iconArray:se}=t,U=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),_=(0,R.useMediaQuery)({query:"(max-width: 1024px)"}),[j,F]=(0,o.useState)(!1),{ref:ne,inView:q}=(0,G.useInView)(),V=(0,o.useRef)(null),I=(0,o.useRef)(null),P=(0,o.useRef)(null),f=(0,o.useRef)(null),b=(0,o.useRef)(null);return(0,W.useExposure)(b,{componentType:c,componentName:u,componentTitle:n,componentDescription:i}),(0,o.useImperativeHandle)(d,()=>b.current),(0,o.useEffect)(()=>{v.default.registerPlugin(w.ScrollTrigger);function p(){if(!f.current)return;const x=b.current?.clientHeight||100;window.innerHeight<=x?V.current=w.ScrollTrigger.create({trigger:b.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:h=>{const y=h.progress*40-20;v.default.set(f.current,{yPercent:y})}}):(P.current=w.ScrollTrigger.create({trigger:b.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:h=>{const y=h.progress*20-20;v.default.set(f.current,{yPercent:y})}}),I.current=w.ScrollTrigger.create({trigger:b.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:h=>{const y=h.progress*20;v.default.set(f.current,{yPercent:y})}}))}return q&&p(),()=>{V.current&&V.current.kill(),P.current&&P.current.kill(),I.current&&I.current.kill()}},[q]),(0,e.jsx)("div",{ref:ne,"data-ui-component-id":"HeroBanner",children:(0,e.jsxs)("div",{ref:b,className:(0,m.cn)(le==="dark"?"aiui-dark":""," tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]":H==="default","lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]":H==="sm"},a),children:[E&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,T.trackUrlRef)(E,`${c}_${u}`),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}`,tabIndex:-1,"aria-hidden":"true","aria-label":n}),(0,e.jsx)("div",{ref:f,className:(0,m.cn)("absolute left-0 top-0 size-full"),children:re?(0,e.jsx)(J.default,{poster:U?$?.url:_?L?.url||$?.url:z?.url,src:U?D?.url:_?oe?.url||D?.url:ae?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:!0,playsInline:!0}):(0,e.jsx)(r.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:z?.alt||"",source:`${z?.url||""} , ${L?.url??($?.url||"")} 1024, ${$?.url||""} 767`})}),(0,e.jsxs)("div",{className:"hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]",children:[(0,e.jsxs)("div",{className:"laptop:text-left hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",children:[M&&(0,e.jsx)(r.Heading,{as:"h3",className:(0,m.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:M}),n&&(0,e.jsx)(r.Heading,{as:"h2",size:H==="sm"?4:5,className:(0,m.cn)("hero-banner-title"),html:n}),i&&(0,e.jsx)(r.Heading,{as:"h3",className:(0,m.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm"),html:i}),S&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(K.default,{endDate:S,endDate_tz:ee,dateFormat:te})})]}),(0,e.jsxs)("div",{className:"hero-banner-button-group laptop:justify-start lg-desktop:gap-3 flex items-center gap-2",children:[s?.isShowPlayVideoButton&&s?.playVideoButtonText?(0,e.jsxs)(r.Button,{onClick:()=>F(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button","data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${s?.playVideoButtonText}`,children:[s?.playVideoButtonText," ",(0,e.jsx)(be,{size:"lg"})]}):s?.text?(0,e.jsxs)(r.Button,{"aria-label":n??i,size:"lg",variant:"secondary",className:"hero-banner-secondary-button",as:s?.isCustomSecondaryButton?"button":"a",href:(0,T.trackUrlRef)(s?.link,`${c}_${u}`),onClick:p=>s?.isCustomSecondaryButton&&l?.(t,p),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${s?.text}`,children:[s?.text,(0,e.jsx)("span",{className:"sr-only",children:n??i})]}):null,g&&g.text&&(0,e.jsx)(r.Button,{"aria-label":n??i,size:"lg",variant:"primary",className:"hero-banner-primary-button",as:g?.isCustomPrimaryButton?"button":"a",href:(0,T.trackUrlRef)(g.link,`${c}_${u}`),onClick:p=>g?.isCustomPrimaryButton&&k?.(t,p),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${g?.text}`,children:g.text})]}),(0,e.jsx)("div",{className:"hero-banner-icon-group flex items-center gap-2",children:se?.map((p,x)=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(r.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:p?.pcImage?.alt||"",source:p?.pcImage?.url})},x))})]}),C.length>0&&(0,e.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:C.map((p,x)=>(0,e.jsxs)(o.default.Fragment,{children:[(0,e.jsx)(r.Text,{size:2,className:(0,m.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:p.title}),x<C.length-1&&(0,e.jsx)("div",{className:(0,m.cn)("bg-info-primary w-px")})]},x))}),j&&(0,e.jsx)(Y.VideoModal,{visible:j,videoUrl:s?.videoUrl?.url,youTubeId:s?.youtubeId,onCloseModal:()=>F(!1)})]})})});Z.displayName="HeroBanner";var xe=(0,O.withLayout)(Z);
1
+ "use strict";"use client";var pe=Object.create;var $=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var me=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var ge=(t,a)=>{for(var l in a)$(t,l,{get:a[l],enumerable:!0})},Z=(t,a,l,k)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of ue(a))!de.call(t,d)&&d!==l&&$(t,d,{get:()=>a[d],enumerable:!(k=ce(a,d))||k.enumerable});return t};var B=(t,a,l)=>(l=t!=null?pe(me(t)):{},Z(a||!t||!t.__esModule?$(l,"default",{value:t,enumerable:!0}):l,t)),be=t=>Z($({},"__esModule",{value:!0}),t);var he={};ge(he,{default:()=>fe});module.exports=be(he);var e=require("react/jsx-runtime"),o=B(require("react")),v=B(require("gsap")),w=require("gsap/dist/ScrollTrigger"),R=require("react-responsive"),J=require("react-intersection-observer"),K=B(require("../../helpers/ScrollLoadVideo.js")),r=require("../../components/index.js"),O=B(require("./Countdown.js")),m=require("../../helpers/index.js"),W=require("../../shared/Styles.js"),X=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),Y=require("../../components/button.js"),ee=require("../VideoModal/index.js");const c="image",u="hero_banner",xe=({size:t="base"})=>{const{width:a,height:l}=Y.sizeMap[t];return(0,e.jsx)("svg",{width:a,height:l,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},G=o.default.forwardRef(({data:t,className:a,onSecondaryClick:l,onPrimaryClick:k},d)=>{const{label:S,title:n,subtitle:i,endDate:M,endDate_tz:te,dateFormat:ae,pcImage:z,padImage:L,mobileImage:N,pcVideo:oe,padVideo:re,mobileVideo:D,isShowVideo:le,primaryButton:g,secondaryButton:s,theme:se="light",size:H="default",titleSize:E,caption:C=[],blockLink:U,iconArray:ne}=t,_=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),j=(0,R.useMediaQuery)({query:"(max-width: 1024px)"}),[F,q]=(0,o.useState)(!1),{ref:ie,inView:A}=(0,J.useInView)(),V=(0,o.useRef)(null),I=(0,o.useRef)(null),P=(0,o.useRef)(null),f=(0,o.useRef)(null),b=(0,o.useRef)(null);return(0,X.useExposure)(b,{componentType:c,componentName:u,componentTitle:n,componentDescription:i}),(0,o.useImperativeHandle)(d,()=>b.current),(0,o.useEffect)(()=>{v.default.registerPlugin(w.ScrollTrigger);function p(){if(!f.current)return;const x=b.current?.clientHeight||100;window.innerHeight<=x?V.current=w.ScrollTrigger.create({trigger:b.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:h=>{const y=h.progress*40-20;v.default.set(f.current,{yPercent:y})}}):(P.current=w.ScrollTrigger.create({trigger:b.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:h=>{const y=h.progress*20-20;v.default.set(f.current,{yPercent:y})}}),I.current=w.ScrollTrigger.create({trigger:b.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:h=>{const y=h.progress*20;v.default.set(f.current,{yPercent:y})}}))}return A&&p(),()=>{V.current&&V.current.kill(),P.current&&P.current.kill(),I.current&&I.current.kill()}},[A]),(0,e.jsx)("div",{ref:ie,"data-ui-component-id":"HeroBanner",children:(0,e.jsxs)("div",{ref:b,className:(0,m.cn)(se==="dark"?"aiui-dark":""," tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden",{"lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]":H==="default","lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]":H==="sm"},a),children:[U&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,T.trackUrlRef)(U,`${c}_${u}`),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}`,tabIndex:-1,"aria-hidden":"true","aria-label":n}),(0,e.jsx)("div",{ref:f,className:(0,m.cn)("absolute left-0 top-0 size-full"),children:le?(0,e.jsx)(K.default,{poster:_?N?.url:j?L?.url||N?.url:z?.url,src:_?D?.url:j?re?.url||D?.url:oe?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:!0,playsInline:!0}):(0,e.jsx)(r.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:z?.alt||"",source:`${z?.url||""} , ${L?.url??(N?.url||"")} 1024, ${N?.url||""} 767`})}),(0,e.jsxs)("div",{className:"hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]",children:[(0,e.jsxs)("div",{className:"laptop:text-left hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",children:[S&&(0,e.jsx)(r.Heading,{as:"h3",className:(0,m.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:S}),n&&(0,e.jsx)(r.Heading,{as:"h2",html:n,className:(0,m.cn)("hero-banner-title"),size:E?Number(E||"5"):H==="sm"?4:5}),i&&(0,e.jsx)(r.Heading,{as:"h3",className:(0,m.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm"),html:i}),M&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(O.default,{endDate:M,endDate_tz:te,dateFormat:ae})})]}),(0,e.jsxs)("div",{className:"hero-banner-button-group laptop:justify-start lg-desktop:gap-3 flex items-center gap-2",children:[s?.isShowPlayVideoButton&&s?.playVideoButtonText?(0,e.jsxs)(r.Button,{onClick:()=>q(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button","data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${s?.playVideoButtonText}`,children:[s?.playVideoButtonText," ",(0,e.jsx)(xe,{size:"lg"})]}):s?.text?(0,e.jsxs)(r.Button,{"aria-label":n??i,size:"lg",variant:"secondary",className:"hero-banner-secondary-button",as:s?.isCustomSecondaryButton?"button":"a",href:(0,T.trackUrlRef)(s?.link,`${c}_${u}`),onClick:p=>s?.isCustomSecondaryButton&&l?.(t,p),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${s?.text}`,children:[s?.text,(0,e.jsx)("span",{className:"sr-only",children:n??i})]}):null,g&&g.text&&(0,e.jsx)(r.Button,{"aria-label":n??i,size:"lg",variant:"primary",className:"hero-banner-primary-button",as:g?.isCustomPrimaryButton?"button":"a",href:(0,T.trackUrlRef)(g.link,`${c}_${u}`),onClick:p=>g?.isCustomPrimaryButton&&k?.(t,p),"data-headless-type-name":`${c}#${u}`,"data-headless-title-desc-button":`${n}#${i}#${g?.text}`,children:g.text})]}),(0,e.jsx)("div",{className:"hero-banner-icon-group flex items-center gap-2",children:ne?.map((p,x)=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(r.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:p?.pcImage?.alt||"",source:p?.pcImage?.url})},x))})]}),C.length>0&&(0,e.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:C.map((p,x)=>(0,e.jsxs)(o.default.Fragment,{children:[(0,e.jsx)(r.Text,{size:2,className:(0,m.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:p.title}),x<C.length-1&&(0,e.jsx)("div",{className:(0,m.cn)("bg-info-primary w-px")})]},x))}),F&&(0,e.jsx)(ee.VideoModal,{visible:F,videoUrl:s?.videoUrl?.url,youTubeId:s?.youtubeId,onCloseModal:()=>q(!1)})]})})});G.displayName="HeroBanner";var fe=(0,W.withLayout)(G);
2
2
  //# sourceMappingURL=HeroBanner.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeroBanner/HeroBanner.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Countdown from './Countdown.js'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(\n ({ data, className, onSecondaryClick, onPrimaryClick }, ref) => {\n const {\n label,\n title,\n subtitle,\n endDate,\n endDate_tz,\n dateFormat,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n caption = [],\n blockLink,\n iconArray,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef} data-ui-component-id=\"HeroBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n ' tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]': size === 'default',\n 'lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]': size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}`}\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileImage?.url : isPad ? padImage?.url || mobileImage?.url : pcImage?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]\">\n <div className=\"laptop:text-left hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]\">\n {label && (\n <Heading\n as=\"h3\"\n className={cn('hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm')}\n html={label}\n />\n )}\n {title && (\n <Heading as=\"h2\" size={size === 'sm' ? 4 : 5} className={cn('hero-banner-title')} html={title} />\n )}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm'\n )}\n html={subtitle}\n />\n )}\n {endDate && (\n <div className=\"mt-3\">\n <Countdown endDate={endDate} endDate_tz={endDate_tz} dateFormat={dateFormat} />\n </div>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"hero-banner-button-group laptop:justify-start lg-desktop:gap-3 flex items-center gap-2\">\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.playVideoButtonText}`}\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-secondary-button\"\n as={secondaryButton?.isCustomSecondaryButton ? 'button' : 'a'}\n href={trackUrlRef(secondaryButton?.link, `${componentType}_${componentName}`)}\n onClick={e => secondaryButton?.isCustomSecondaryButton && onSecondaryClick?.(data, e)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.text}`}\n >\n {secondaryButton?.text}\n <span className=\"sr-only\">{title ?? subtitle}</span>\n </Button>\n ) : null}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"primary\"\n className=\"hero-banner-primary-button\"\n as={primaryButton?.isCustomPrimaryButton ? 'button' : 'a'}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n onClick={e => primaryButton?.isCustomPrimaryButton && onPrimaryClick?.(data, e)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${primaryButton?.text}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n <div className=\"hero-banner-icon-group flex items-center gap-2\">\n {iconArray?.map((icon, index) => (\n <div key={index} className=\"h-12\">\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n alt={icon?.pcImage?.alt || ''}\n source={icon?.pcImage?.url}\n />\n </div>\n ))}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div className=\"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]\">\n {caption.map((c, index) => (\n <React.Fragment key={index}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.youtubeId}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n </div>\n )\n }\n)\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withLayout(HeroBanner)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAwBM,IAAAI,EAAA,6BAvBNC,EAAwE,oBACxEC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA0B,uCAC1BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAsB,6BACtBC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,sCACxBC,EAA2B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I,UAAU,iMACZ,SAAAA,EAAQ,IAAI,CAACwB,EAAGD,OACf,QAAC,EAAA7C,QAAM,SAAN,CACC,oBAAC,QACC,KAAM,EACN,aAAW,MACT,yIACF,EACA,KAAM8C,EAAE,MACV,EACCD,EAAQvB,EAAQ,OAAS,MAAK,OAAC,OAAI,aAAW,MAAG,sBAAsB,EAAG,IARxDuB,CASrB,CACD,EACH,EAIDlB,MACC,OAAC,cACC,QAASA,EACT,SAAUP,GAAiB,UAAU,IACrC,UAAWA,GAAiB,UAC5B,aAAc,IAAMQ,EAAW,EAAK,EACtC,GAEJ,EACF,CAEJ,CACF,EAEA7B,EAAW,YAAc,aAEzB,IAAOvB,MAAQ,cAAWuB,CAAU",
6
- "names": ["HeroBanner_exports", "__export", "HeroBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_ScrollTrigger", "import_react_responsive", "import_react_intersection_observer", "import_ScrollLoadVideo", "import_components", "import_Countdown", "import_helpers", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_button", "import_VideoModal", "componentType", "componentName", "PlayButtonAppendIcon", "size", "width", "height", "HeroBanner", "React", "data", "className", "onSecondaryClick", "onPrimaryClick", "ref", "label", "title", "subtitle", "endDate", "endDate_tz", "dateFormat", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "primaryButton", "secondaryButton", "theme", "caption", "blockLink", "iconArray", "isMobile", "isPad", "visible", "setVisible", "inViewRef", "inView", "scrollTriggerRef", "bgTriggerRef", "boxTriggerRef", "bgRef", "boxRef", "gsap", "gsapResize", "clientHeight", "self", "value", "ScrollLoadVideo", "Countdown", "e", "icon", "index", "c"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { HeroBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Countdown from './Countdown.js'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'hero_banner'\n\nconst PlayButtonAppendIcon = ({ size = 'base' }: { size: 'base' | 'lg' | 'sm' }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"currentcolor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z\"\n fill=\"currentcolor\"\n />\n </svg>\n )\n}\n\nconst HeroBanner = React.forwardRef<HTMLDivElement, HeroBannerProps>(\n ({ data, className, onSecondaryClick, onPrimaryClick }, ref) => {\n const {\n label,\n title,\n subtitle,\n endDate,\n endDate_tz,\n dateFormat,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n primaryButton,\n secondaryButton,\n theme = 'light',\n size = 'default',\n titleSize,\n caption = [],\n blockLink,\n iconArray,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const [visible, setVisible] = useState<boolean>(false)\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef} data-ui-component-id=\"HeroBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n ' tablet:aspect-[768/660] text-info-primary relative aspect-[390/660] w-full overflow-hidden',\n {\n 'lg-desktop:aspect-[1920/930] desktop:aspect-[1440/700] laptop:aspect-[1024/520]': size === 'default',\n 'lg-desktop:aspect-[1920/720] desktop:aspect-[1440/576] laptop:aspect-[1024/432]': size === 'sm',\n },\n className\n )}\n >\n {blockLink && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}`}\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n ></a>\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileImage?.url : isPad ? padImage?.url || mobileImage?.url : pcImage?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n fetchPriority=\"high\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"hero-banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-[32px] absolute top-24 z-10 flex flex-col gap-[24px] px-[16px]\">\n <div className=\"laptop:text-left hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]\">\n {label && (\n <Heading\n as=\"h3\"\n className={cn('hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm')}\n html={label}\n />\n )}\n {title && (\n <Heading\n as=\"h2\"\n html={title}\n className={cn('hero-banner-title')}\n size={titleSize ? (Number(titleSize || '5') as any) : size === 'sm' ? 4 : 5}\n />\n )}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm'\n )}\n html={subtitle}\n />\n )}\n {endDate && (\n <div className=\"mt-3\">\n <Countdown endDate={endDate} endDate_tz={endDate_tz} dateFormat={dateFormat} />\n </div>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div className=\"hero-banner-button-group laptop:justify-start lg-desktop:gap-3 flex items-center gap-2\">\n {secondaryButton?.isShowPlayVideoButton && secondaryButton?.playVideoButtonText ? (\n <Button\n onClick={() => setVisible(true)}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-play-video-button\"\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.playVideoButtonText}`}\n >\n {secondaryButton?.playVideoButtonText} <PlayButtonAppendIcon size=\"lg\" />\n </Button>\n ) : secondaryButton?.text ? (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"secondary\"\n className=\"hero-banner-secondary-button\"\n as={secondaryButton?.isCustomSecondaryButton ? 'button' : 'a'}\n href={trackUrlRef(secondaryButton?.link, `${componentType}_${componentName}`)}\n onClick={e => secondaryButton?.isCustomSecondaryButton && onSecondaryClick?.(data, e)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${secondaryButton?.text}`}\n >\n {secondaryButton?.text}\n <span className=\"sr-only\">{title ?? subtitle}</span>\n </Button>\n ) : null}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? subtitle}\n size=\"lg\"\n variant=\"primary\"\n className=\"hero-banner-primary-button\"\n as={primaryButton?.isCustomPrimaryButton ? 'button' : 'a'}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n onClick={e => primaryButton?.isCustomPrimaryButton && onPrimaryClick?.(data, e)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${subtitle}#${primaryButton?.text}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n <div className=\"hero-banner-icon-group flex items-center gap-2\">\n {iconArray?.map((icon, index) => (\n <div key={index} className=\"h-12\">\n <Picture\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n loading=\"eager\"\n alt={icon?.pcImage?.alt || ''}\n source={icon?.pcImage?.url}\n />\n </div>\n ))}\n </div>\n </div>\n\n {/* \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */}\n {caption.length > 0 && (\n <div className=\"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]\">\n {caption.map((c, index) => (\n <React.Fragment key={index}>\n <Text\n size={2}\n className={cn(\n 'hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]'\n )}\n html={c.title}\n />\n {index < caption.length - 1 && <div className={cn('bg-info-primary w-px')} />}\n </React.Fragment>\n ))}\n </div>\n )}\n\n {/* \u89C6\u9891\u5F39\u7A97 */}\n {visible && (\n <VideoModal\n visible={visible}\n videoUrl={secondaryButton?.videoUrl?.url}\n youTubeId={secondaryButton?.youtubeId}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </div>\n </div>\n )\n }\n)\n\nHeroBanner.displayName = 'HeroBanner'\n\nexport default withLayout(HeroBanner)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAwBM,IAAAI,EAAA,6BAvBNC,EAAwE,oBACxEC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA0B,uCAC1BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAsB,6BACtBC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAw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CAQV,CACD,EACH,GACF,EAGCvB,EAAQ,OAAS,MAChB,OAAC,OAAI,UAAU,iMACZ,SAAAA,EAAQ,IAAI,CAACwB,EAAGD,OACf,QAAC,EAAA9C,QAAM,SAAN,CACC,oBAAC,QACC,KAAM,EACN,aAAW,MACT,yIACF,EACA,KAAM+C,EAAE,MACV,EACCD,EAAQvB,EAAQ,OAAS,MAAK,OAAC,OAAI,aAAW,MAAG,sBAAsB,EAAG,IARxDuB,CASrB,CACD,EACH,EAIDlB,MACC,OAAC,eACC,QAASA,EACT,SAAUR,GAAiB,UAAU,IACrC,UAAWA,GAAiB,UAC5B,aAAc,IAAMS,EAAW,EAAK,EACtC,GAEJ,EACF,CAEJ,CACF,EAEA9B,EAAW,YAAc,aAEzB,IAAOvB,MAAQ,cAAWuB,CAAU",
6
+ "names": ["HeroBanner_exports", "__export", "HeroBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_ScrollTrigger", "import_react_responsive", "import_react_intersection_observer", "import_ScrollLoadVideo", "import_components", "import_Countdown", "import_helpers", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_button", "import_VideoModal", "componentType", "componentName", "PlayButtonAppendIcon", "size", "width", "height", "HeroBanner", "React", "data", "className", "onSecondaryClick", "onPrimaryClick", "ref", "label", "title", "subtitle", "endDate", "endDate_tz", "dateFormat", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "primaryButton", "secondaryButton", "theme", "titleSize", "caption", "blockLink", "iconArray", "isMobile", "isPad", "visible", "setVisible", "inViewRef", "inView", "scrollTriggerRef", "bgTriggerRef", "boxTriggerRef", "bgRef", "boxRef", "gsap", "gsapResize", "clientHeight", "self", "value", "ScrollLoadVideo", "Countdown", "e", "icon", "index", "c"]
7
7
  }
@@ -1,5 +1,6 @@
1
1
  import type { ButtonProps } from '../../components/button.js';
2
2
  import type { Media, Theme } from '../../types/props.js';
3
+ type TitleSizeType = '5' | '4' | '3' | '2' | '1';
3
4
  export interface HeroBannerProps {
4
5
  data: {
5
6
  /** 标签 */
@@ -44,6 +45,7 @@ export interface HeroBannerProps {
44
45
  theme?: Theme;
45
46
  /** 大小, 默认default,单banner, 可选sm, 用于多banner场景 */
46
47
  size?: 'default' | 'sm';
48
+ titleSize?: TitleSizeType;
47
49
  /** 底部产品列表 */
48
50
  caption?: Array<{
49
51
  title: string;
@@ -54,3 +56,4 @@ export interface HeroBannerProps {
54
56
  onSecondaryClick?: (data: any, e: any) => void;
55
57
  onPrimaryClick?: (data: any, e: any) => void;
56
58
  }
59
+ export {};
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var l=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of s(t))!d.call(e,i)&&i!==a&&n(e,i,{get:()=>t[i],enumerable:!(o=r(t,i))||o.enumerable});return e};var m=e=>l(n({},"__esModule",{value:!0}),e);var p={};module.exports=m(p);
1
+ "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var l=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of s(t))!d.call(e,i)&&i!==a&&n(e,i,{get:()=>t[i],enumerable:!(o=r(t,i))||o.enumerable});return e};var p=e=>l(n({},"__esModule",{value:!0}),e);var y={};module.exports=p(y);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeroBanner/types.ts"],
4
- "sourcesContent": ["import type { ButtonProps } from '../../components/button.js'\nimport type { Media, Theme } from '../../types/props.js'\n\nexport interface HeroBannerProps {\n data: {\n /** \u6807\u7B7E */\n label?: string\n /** \u4E3B\u6807\u9898 */\n title: string\n /** \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u672C */\n subtitle: string\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n dateFormat?: string\n /** \u56FE\u6807\u5217\u8868 */\n iconArray?: Array<any>\n pcImage: Media\n padImage?: Media\n mobileImage: Media\n pcVideo?: Media\n padVideo?: Media\n mobileVideo?: Media\n isShowVideo?: boolean\n blockLink?: string\n /** \u4E3B\u6309\u94AE\u6587\u672C\u548C\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n isCustomPrimaryButton?: boolean\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C\u548C\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n isShowPlayVideoButton?: boolean\n playVideoButtonText?: string\n playIcon?: boolean\n videoUrl?: Media\n youtubeId?: string\n isCustomSecondaryButton?: boolean\n } & Omit<ButtonProps, 'children'>\n /** \u4E3B\u9898 */\n theme?: Theme\n /** \u5927\u5C0F, \u9ED8\u8BA4default,\u5355banner, \u53EF\u9009sm, \u7528\u4E8E\u591Abanner\u573A\u666F */\n size?: 'default' | 'sm'\n /** \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */\n caption?: Array<{\n title: string\n }>\n }\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n onSecondaryClick?: (data: any, e: any) => void\n onPrimaryClick?: (data: any, e: any) => void\n}\n"],
4
+ "sourcesContent": ["import type { ButtonProps } from '../../components/button.js'\nimport type { Media, Theme } from '../../types/props.js'\n\ntype TitleSizeType = '5' | '4' | '3' | '2' | '1'\nexport interface HeroBannerProps {\n data: {\n /** \u6807\u7B7E */\n label?: string\n /** \u4E3B\u6807\u9898 */\n title: string\n /** \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u672C */\n subtitle: string\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n dateFormat?: string\n /** \u56FE\u6807\u5217\u8868 */\n iconArray?: Array<any>\n pcImage: Media\n padImage?: Media\n mobileImage: Media\n pcVideo?: Media\n padVideo?: Media\n mobileVideo?: Media\n isShowVideo?: boolean\n blockLink?: string\n /** \u4E3B\u6309\u94AE\u6587\u672C\u548C\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n isCustomPrimaryButton?: boolean\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u8981\u6309\u94AE\u6587\u672C\u548C\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n isShowPlayVideoButton?: boolean\n playVideoButtonText?: string\n playIcon?: boolean\n videoUrl?: Media\n youtubeId?: string\n isCustomSecondaryButton?: boolean\n } & Omit<ButtonProps, 'children'>\n /** \u4E3B\u9898 */\n theme?: Theme\n /** \u5927\u5C0F, \u9ED8\u8BA4default,\u5355banner, \u53EF\u9009sm, \u7528\u4E8E\u591Abanner\u573A\u666F */\n size?: 'default' | 'sm'\n titleSize?: TitleSizeType\n /** \u5E95\u90E8\u4EA7\u54C1\u5217\u8868 */\n caption?: Array<{\n title: string\n }>\n }\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n onSecondaryClick?: (data: any, e: any) => void\n onPrimaryClick?: (data: any, e: any) => void\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -0,0 +1,49 @@
1
+ import * as React from 'react';
2
+ import type { Media } from '../../types/props.js';
3
+ export interface PromotionalBarSemanticName {
4
+ root: 'root';
5
+ content: 'content';
6
+ title: 'title';
7
+ description: 'description';
8
+ button: 'button';
9
+ }
10
+ /**
11
+ * 响应式背景图片配置
12
+ */
13
+ export interface ResponsiveBackgroundImage {
14
+ /** 移动端图片 (<768px) */
15
+ mobile?: Media;
16
+ /** 平板图片 (768-1440px) */
17
+ tablet?: Media;
18
+ /** 笔记本图片 (1025-1440px) */
19
+ laptop?: Media;
20
+ /** 桌面图片 (1441-1920px) */
21
+ desktop?: Media;
22
+ /** 超大桌面图片 (≥1921px) */
23
+ lgDesktop?: Media;
24
+ }
25
+ /**
26
+ * PromotionalBar 业务组件数据接口
27
+ */
28
+ export interface PromotionalBarData {
29
+ /** 组件内容标题 */
30
+ contentTitle?: string;
31
+ /** 组件内容描述 */
32
+ contentDesc?: string;
33
+ /** 按钮文本 */
34
+ buttonText?: string;
35
+ /** 按钮链接 */
36
+ buttonLink?: string;
37
+ /** 背景图片 - 响应式图片对象 */
38
+ backgroundImage?: ResponsiveBackgroundImage;
39
+ }
40
+ export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {
41
+ /** 业务数据 */
42
+ data: PromotionalBarData;
43
+ classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>;
44
+ }
45
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<PromotionalBarProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
46
+ className?: string;
47
+ data?: Record<string, any>;
48
+ }, "ref"> & React.RefAttributes<any>>;
49
+ export default _default;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var M=Object.create;var g=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var F=(t,e)=>{for(var o in e)g(t,o,{get:e[o],enumerable:!0})},x=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of T(e))!N.call(t,r)&&r!==o&&g(t,r,{get:()=>e[r],enumerable:!(a=P(e,r))||a.enumerable});return t};var y=(t,e,o)=>(o=t!=null?M(D(t)):{},x(e||!t||!t.__esModule?g(o,"default",{value:t,enumerable:!0}):o,t)),R=t=>x(g({},"__esModule",{value:!0}),t);var I={};F(I,{default:()=>w});module.exports=R(I);var i=require("react/jsx-runtime"),h=y(require("react")),c=require("../../helpers/index.js"),m=require("../../components/index.js"),v=require("../../shared/Styles.js");const L=t=>{if(!t)return;const{mobile:e,tablet:o,laptop:a,desktop:r,lgDesktop:k}=t,n=[],u=B=>B?.url,l=u(k),s=u(r),p=u(a),d=u(o),f=u(e);return l?n.push(l):s?n.push(s):p?n.push(p):d?n.push(d):f&&n.push(f),s&&l&&n.push(`${s} 1920`),p&&(s||l)&&n.push(`${p} 1440`),d&&(p||s||l)&&n.push(`${d} 1024`),f&&(d||p||s||l)&&n.push(`${f} 768`),n.length>0?n.join(", "):void 0},b=h.forwardRef(({classNames:t,data:e},o)=>{const{backgroundImage:a}=e,r=h.useMemo(()=>L(a),[a]);return(0,i.jsx)("div",{ref:o,className:(0,c.cn)("laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",t?.root),children:(0,i.jsxs)("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[(0,i.jsxs)("div",{className:(0,c.cn)("laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",t?.content),children:[e.contentTitle&&(0,i.jsx)(m.Heading,{className:(0,c.cn)("line-clamp-2 text-[#F5F6F7]",t?.title),html:e.contentTitle,size:3}),e.contentDesc&&(0,i.jsx)("p",{className:(0,c.cn)("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]",t?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),(0,i.jsx)("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&(0,i.jsx)(m.Button,{as:"a",variant:"link",className:(0,c.cn)("!p-0 text-[#F5F6F7]",t?.button),href:e.buttonLink,iconClassName:"size-4",children:e.buttonText})})]}),(0,i.jsx)(m.Picture,{source:r,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});b.displayName="PromotionalBar";var w=(0,v.withLayout)(b);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/PromotionalBar/index.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Picture } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { Media } from '../../types/props.js'\n\nexport interface PromotionalBarSemanticName {\n root: 'root'\n content: 'content'\n title: 'title'\n description: 'description'\n button: 'button'\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 (<768px) */\n mobile?: Media\n /** \u5E73\u677F\u56FE\u7247 (768-1440px) */\n tablet?: Media\n /** \u7B14\u8BB0\u672C\u56FE\u7247 (1025-1440px) */\n laptop?: Media\n /** \u684C\u9762\u56FE\u7247 (1441-1920px) */\n desktop?: Media\n /** \u8D85\u5927\u684C\u9762\u56FE\u7247 (\u22651921px) */\n lgDesktop?: Media\n}\n\n/**\n * PromotionalBar \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface PromotionalBarData {\n /** \u7EC4\u4EF6\u5185\u5BB9\u6807\u9898 */\n contentTitle?: string\n /** \u7EC4\u4EF6\u5185\u5BB9\u63CF\u8FF0 */\n contentDesc?: string\n /** \u6309\u94AE\u6587\u672C */\n buttonText?: string\n /** \u6309\u94AE\u94FE\u63A5 */\n buttonLink?: string\n /** \u80CC\u666F\u56FE\u7247 - \u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61 */\n backgroundImage?: ResponsiveBackgroundImage\n}\n\nexport interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: PromotionalBarData\n classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>\n}\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3A Picture \u7EC4\u4EF6\u6240\u9700\u7684\u5B57\u7B26\u4E32\u683C\u5F0F\n */\nconst convertResponsiveImageToString = (backgroundImage: ResponsiveBackgroundImage | undefined): string | undefined => {\n if (!backgroundImage) return undefined\n\n const { mobile, tablet, laptop, desktop, lgDesktop } = backgroundImage\n const parts: string[] = []\n\n // \u8F85\u52A9\u51FD\u6570\uFF1A\u4ECE Media \u5BF9\u8C61\u4E2D\u63D0\u53D6 URL\n const getUrl = (media: Media | undefined): string | undefined => {\n return media?.url\n }\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n const lgDesktopUrl = getUrl(lgDesktop)\n const desktopUrl = getUrl(desktop)\n const laptopUrl = getUrl(laptop)\n const tabletUrl = getUrl(tablet)\n const mobileUrl = getUrl(mobile)\n\n if (lgDesktopUrl) parts.push(lgDesktopUrl)\n else if (desktopUrl) parts.push(desktopUrl)\n else if (laptopUrl) parts.push(laptopUrl)\n else if (tabletUrl) parts.push(tabletUrl)\n else if (mobileUrl) parts.push(mobileUrl)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktopUrl && lgDesktopUrl) parts.push(`${desktopUrl} 1920`)\n if (laptopUrl && (desktopUrl || lgDesktopUrl)) parts.push(`${laptopUrl} 1440`)\n if (tabletUrl && (laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${tabletUrl} 1024`)\n if (mobileUrl && (tabletUrl || laptopUrl || desktopUrl || lgDesktopUrl)) parts.push(`${mobileUrl} 768`)\n\n return parts.length > 0 ? parts.join(', ') : undefined\n}\n\n/**\n * PromotionalBar - \u63A8\u5E7F\u680F\n *\n * @description \u63A8\u5E7F\u680F\n */\nconst PromotionalBar = React.forwardRef<HTMLDivElement, PromotionalBarProps>(({ classNames, data }, ref) => {\n const { backgroundImage } = data\n const pictureSource = React.useMemo(() => {\n return convertResponsiveImageToString(backgroundImage)\n }, [backgroundImage])\n return (\n <div ref={ref} className={cn('laptop:h-[192px] lg-desktop:h-[240px] h-[240px]', classNames?.root)}>\n {/* \u63A8\u5E7F\u680F\u5185\u5BB9\u533A\u57DF - \u6839\u636E\u5177\u4F53\u4E1A\u52A1\u9700\u6C42\u5B9A\u5236 */}\n <div className=\"promotional-bar-content rounded-card relative h-full overflow-hidden\">\n <div\n className={cn(\n 'laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4',\n classNames?.content\n )}\n >\n {data.contentTitle && (\n <Heading\n className={cn('line-clamp-2 text-[#F5F6F7]', classNames?.title)}\n html={data.contentTitle}\n size={3}\n />\n )}\n {data.contentDesc && (\n <p\n className={cn(\n 'laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] text-[#F5F6F7]',\n classNames?.description\n )}\n dangerouslySetInnerHTML={{ __html: data.contentDesc }}\n />\n )}\n <div className=\"laptop:mt-4 mt-2\">\n {data.buttonText && (\n <Button\n as=\"a\"\n variant=\"link\"\n className={cn('!p-0 text-[#F5F6F7]', classNames?.button)}\n href={data.buttonLink}\n iconClassName=\"size-4\"\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n <Picture\n source={pictureSource}\n className=\"absolute inset-0 z-10 \"\n imgClassName=\"h-full object-cover transition-transform duration-300 ease-in-out hover:scale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tBE,EAAgBvB,EAAM,QAAQ,IAC3BI,EAA+BC,CAAe,EACpD,CAACA,CAAe,CAAC,EACpB,SACE,OAAC,OAAI,IAAKiB,EAAK,aAAW,MAAG,kDAAmDF,GAAY,IAAI,EAE9F,oBAAC,OAAI,UAAU,uEACb,qBAAC,OACC,aAAW,MACT,mLACAA,GAAY,OACd,EAEC,UAAAC,EAAK,iBACJ,OAAC,WACC,aAAW,MAAG,8BAA+BD,GAAY,KAAK,EAC9D,KAAMC,EAAK,aACX,KAAM,EACR,EAEDA,EAAK,gBACJ,OAAC,KACC,aAAW,MACT,6HACAD,GAAY,WACd,EACA,wBAAyB,CAAE,OAAQC,EAAK,WAAY,EACtD,KAEF,OAAC,OAAI,UAAU,mBACZ,SAAAA,EAAK,eACJ,OAAC,UACC,GAAG,IACH,QAAQ,OACR,aAAW,MAAG,sBAAuBD,GAAY,MAAM,EACvD,KAAMC,EAAK,WACX,cAAc,SAEb,SAAAA,EAAK,WACR,EAEJ,GACF,KACA,OAAC,WACC,OAAQE,EACR,UAAU,yBACV,aAAa,uFACf,GACF,EACF,CAEJ,CAAC,EAEDJ,EAAe,YAAc,iBAC7B,IAAOtB,KAAQ,cAAWsB,CAAc",
6
+ "names": ["PromotionalBar_exports", "__export", "PromotionalBar_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_Styles", "convertResponsiveImageToString", "backgroundImage", "mobile", "tablet", "laptop", "desktop", "lgDesktop", "parts", "getUrl", "media", "lgDesktopUrl", "desktopUrl", "laptopUrl", "tabletUrl", "mobileUrl", "PromotionalBar", "classNames", "data", "ref", "pictureSource"]
7
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { CountdownConfig } from './types.js';
3
+ import type { Theme } from '../../types/props.js';
4
+ interface CountdownProps {
5
+ config: CountdownConfig;
6
+ className?: string;
7
+ onCountdownEnd?: () => void;
8
+ theme?: Theme;
9
+ }
10
+ /**
11
+ * Countdown - 倒计时组件
12
+ */
13
+ declare const Countdown: React.ForwardRefExoticComponent<CountdownProps & React.RefAttributes<HTMLDivElement>>;
14
+ export default Countdown;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var S=Object.create;var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var H=(e,t)=>{for(var s in t)p(e,s,{get:t[s],enumerable:!0})},v=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of V(t))!F.call(e,a)&&a!==s&&p(e,a,{get:()=>t[a],enumerable:!(n=D(t,a))||n.enumerable});return e};var w=(e,t,s)=>(s=e!=null?S(j(e)):{},v(t||!e||!e.__esModule?p(s,"default",{value:e,enumerable:!0}):s,e)),I=e=>v(p({},"__esModule",{value:!0}),e);var U={};H(U,{default:()=>P});module.exports=I(U);var o=require("react/jsx-runtime"),i=w(require("react")),b=w(require("dayjs")),h=require("../../helpers/utils.js"),y=require("class-variance-authority");const T=e=>{const t=(0,b.default)(),n=(0,b.default)(e).diff(t,"second");if(n<=0)return{days:0,hours:0,minutes:0,seconds:0};const a=Math.floor(n/(24*60*60)),c=Math.floor(n%(24*60*60)/(60*60)),g=Math.floor(n%(60*60)/60),x=n%60;return{days:a,hours:c,minutes:g,seconds:x}},R=(0,y.cva)("lg-desktop:size-12 lg-desktop:px-1 flex size-10 flex-col items-center justify-center px-[2px] text-center",{variants:{theme:{light:"bg-info-primary",dark:"bg-[#f5f6f7]"}},defaultVariants:{theme:"light"}}),k=(0,y.cva)("",{variants:{theme:{light:"text-white",dark:"text-[#080A0F]"}},defaultVariants:{theme:"light"}}),z=({value:e,label:t,theme:s="light"})=>(0,o.jsxs)("div",{className:R({theme:s}),children:[(0,o.jsx)("p",{className:(0,h.cn)("lg-desktop:text-2xl text-[20px] font-bold leading-[1.2] tracking-[-0.96px]",k({theme:s})),children:String(e).padStart(2,"0")}),(0,o.jsx)("p",{className:(0,h.cn)("mt-[-6px] text-[12px] font-bold leading-[1.4] tracking-[-0.24px]",k({theme:s})),children:t})]}),E=()=>(0,o.jsx)("p",{className:"lg-desktop:text-2xl text-info-primary text-center text-xl font-bold leading-[1.2] tracking-[-0.96px]",children:":"}),C=i.default.forwardRef(({config:e,className:t,onCountdownEnd:s,theme:n="light"},a)=>{const{targetDate:c,showDays:g=!0,showHours:x=!0,showMinutes:L=!0,showSeconds:N=!0,labels:m={}}=e,[d,M]=(0,i.useState)(()=>T(c));(0,i.useEffect)(()=>{const u=setInterval(()=>{const r=T(c);M(r),r.days===0&&r.hours===0&&r.minutes===0&&r.seconds===0&&(s?.(),clearInterval(u))},1e3);return()=>clearInterval(u)},[c,s]);const f={days:m.days||"Day",hours:m.hours||"Hours",minutes:m.minutes||"Mins",seconds:m.seconds||"Secs"},l=[];return g&&l.push({value:d.days,label:f.days}),x&&l.push({value:d.hours,label:f.hours}),L&&l.push({value:d.minutes,label:f.minutes}),N&&l.push({value:d.seconds,label:f.seconds}),(0,o.jsx)("div",{ref:a,className:(0,h.cn)("flex items-center gap-1",t),children:l.map((u,r)=>(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(z,{value:u.value,label:u.label,theme:n}),r<l.length-1&&(0,o.jsx)(E,{})]},u.label))})});C.displayName="Countdown";var P=C;
2
+ //# sourceMappingURL=Countdown.js.map