@anker-in/headless-ui 1.1.17-alpha.1766575112329 → 1.1.17-alpha.1766632484945

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 (27) hide show
  1. package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +6 -0
  2. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  3. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  4. package/dist/cjs/biz-components/EventSchedule/index.d.ts +23 -34
  5. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  6. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  7. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +21 -14
  8. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  9. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  10. package/dist/cjs/stories/eventSchedule.stories.js +1 -1
  11. package/dist/cjs/stories/eventSchedule.stories.js.map +2 -2
  12. package/dist/cjs/stories/promotionalBar.stories.js +1 -1
  13. package/dist/cjs/stories/promotionalBar.stories.js.map +2 -2
  14. package/dist/esm/biz-components/AnchorNavigation/index.d.ts +6 -0
  15. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  16. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  17. package/dist/esm/biz-components/EventSchedule/index.d.ts +23 -34
  18. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  19. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  20. package/dist/esm/biz-components/PromotionalBar/index.d.ts +21 -14
  21. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  22. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  23. package/dist/esm/stories/eventSchedule.stories.js +1 -1
  24. package/dist/esm/stories/eventSchedule.stories.js.map +2 -2
  25. package/dist/esm/stories/promotionalBar.stories.js +1 -1
  26. package/dist/esm/stories/promotionalBar.stories.js.map +2 -2
  27. package/package.json +1 -1
@@ -1,5 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
+ export interface AnchorNavigationSemanticName {
4
+ root: 'root';
5
+ content: 'content';
6
+ item: 'item';
7
+ }
3
8
  /**
4
9
  * 导航项对齐方向样式变体
5
10
  */
@@ -23,6 +28,7 @@ export interface AnchorNavigationData {
23
28
  export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {
24
29
  /** 业务数据 */
25
30
  data: AnchorNavigationData;
31
+ classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>;
26
32
  }
27
33
  /**
28
34
  * AnchorNavigation - 锚点导航
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var R=Object.create;var d=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!L.call(t,a)&&a!==n&&d(t,a,{get:()=>e[a],enumerable:!(l=V(e,a))||l.enumerable});return t};var A=(t,e,n)=>(n=t!=null?R(D(t)):{},p(e||!t||!t.__esModule?d(n,"default",{value:t,enumerable:!0}):n,t)),E=t=>p(d({},"__esModule",{value:!0}),t);var P={};T(P,{default:()=>M});module.exports=E(P);var c=require("react/jsx-runtime"),m=A(require("react")),g=require("../../helpers/utils.js"),I=require("../../components/container.js"),u=require("class-variance-authority"),N=A(require("./useAnchorPosition.js"));const C=(0,u.cva)("anchor-navigation-content desktop:gap-6 flex items-center gap-4 overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{alignment:"start"}}),H=(0,u.cva)("sticky top-0 z-10 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),k=m.forwardRef(({className:t,data:e,...n},l)=>{const{alignment:a="start",theme:b="light"}=e,y=(0,N.default)(e.sectionIds?.map(r=>r.targetId)||[]),h=m.useRef(null),v=m.useRef([]),x=m.useCallback(r=>{const s=v.current[r];if(s&&h.current){const o=h.current,i=s,f=i.offsetLeft-o.offsetWidth/2+i.offsetWidth/2;o.scrollTo({left:f,behavior:"smooth"})}},[]);return(0,c.jsx)("div",{ref:l,className:(0,g.cn)(H({theme:b}),t),...n,children:(0,c.jsx)(I.Container,{children:(0,c.jsx)("div",{ref:h,className:(0,g.cn)(C({alignment:a})),children:e.sectionIds?.map((r,s)=>{const o=y===r.targetId,i=b==="dark";return(0,c.jsx)("button",{ref:f=>{f&&(v.current[s]=f)},onClick:()=>{x(s),document.getElementById(r.targetId)?.scrollIntoView({behavior:"smooth"})},className:(0,g.cn)("anchor-navigation-item desktop:py-4 shrink-0 border-b-4 border-b-transparent py-3 text-base font-bold",{"text-[#4A4C56]":!i&&!o,"border-b-brand text-[#080A0F]":!i&&o,"text-[#8A8D92]":i&&!o,"border-b-brand text-white":i&&o}),children:r.label},r.targetId)})})})})});k.displayName="AnchorNavigation";var M=k;
1
+ "use strict";"use client";var y=Object.create;var d=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},v=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of R(e))!w.call(t,o)&&o!==n&&d(t,o,{get:()=>e[o],enumerable:!(c=I(e,o))||c.enumerable});return t};var b=(t,e,n)=>(n=t!=null?y(V(t)):{},v(e||!t||!t.__esModule?d(n,"default",{value:t,enumerable:!0}):n,t)),L=t=>v(d({},"__esModule",{value:!0}),t);var H={};D(H,{default:()=>P});module.exports=L(H);var p=require("react/jsx-runtime"),f=b(require("react")),m=require("../../helpers/utils.js"),h=require("class-variance-authority"),k=b(require("./useAnchorPosition.js"));const T=(0,h.cva)("anchor-navigation-content desktop:gap-6 flex items-center gap-4 overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{alignment:"start"}}),E=(0,h.cva)("tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] sticky top-0 z-[60] w-full px-4",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),x=f.forwardRef(({classNames:t={},data:e},n)=>{const{alignment:c="start",theme:o="light"}=e,A=(0,k.default)(e.sectionIds?.map(a=>a.targetId)||[]),g=f.useRef(null),u=f.useRef([]),N=f.useCallback(a=>{const s=u.current[a];if(s&&g.current){const r=g.current,i=s,l=i.offsetLeft-r.offsetWidth/2+i.offsetWidth/2;r.scrollTo({left:l,behavior:"smooth"})}},[]);return(0,p.jsx)("div",{ref:n,className:(0,m.cn)(E({theme:o}),t?.root),children:(0,p.jsx)("div",{ref:g,className:(0,m.cn)(T({alignment:c}),t?.content),children:e.sectionIds?.map((a,s)=>{const r=A===a.targetId,i=o==="dark";return(0,p.jsx)("button",{ref:l=>{l&&(u.current[s]=l)},onClick:()=>{N(s),document.getElementById(a.targetId)?.scrollIntoView({behavior:"smooth"})},className:(0,m.cn)("anchor-navigation-item desktop:py-4 shrink-0 border-b-4 border-b-transparent py-3 text-base font-bold",{"text-[#4A4C56]":!i&&!r,"border-b-brand text-[#080A0F]":!i&&r,"text-[#8A8D92]":i&&!r,"border-b-brand text-white":i&&r},t?.item),children:a.label},a.targetId)})})})});x.displayName="AnchorNavigation";var P=x;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Container } from '../../components/container.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content desktop:gap-6 flex items-center gap-4 overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n },\n },\n defaultVariants: {\n alignment: 'start',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('sticky top-0 z-10 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * 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}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ className, data, ...props }, ref) => {\n const { alignment = 'start', theme = 'light' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\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 container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [])\n\n return (\n <div ref={ref} className={cn(containerVariants({ theme }), className)} {...props}>\n <Container>\n <div ref={containerRef} className={cn(anchorNavigationVariants({ alignment }))}>\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 document.getElementById(item.targetId)?.scrollIntoView({ behavior: 'smooth' })\n }}\n className={cn(\n 'anchor-navigation-item desktop:py-4 shrink-0 border-b-4 border-b-transparent py-3 text-base font-bold',\n {\n // Light theme colors\n 'text-[#4A4C56]': !isDark && !isActive,\n 'border-b-brand text-[#080A0F]': !isDark && isActive,\n // Dark theme colors\n 'text-[#8A8D92]': isDark && !isActive,\n 'border-b-brand text-white': isDark && isActive,\n }\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n </div>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmGgB,IAAAI,EAAA,6BAjGhBC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAA0B,yCAC1BC,EAAuC,oCACvCC,EAA8B,qCAK9B,MAAMC,KAA2B,OAC/B,gHACA,CACE,SAAU,CACR,UAAW,CACT,MAAO,gBACP,OAAQ,iBACR,IAAK,aACP,CACF,EACA,gBAAiB,CACf,UAAW,OACb,CACF,CACF,EAKMC,KAAoB,OAAI,2BAA4B,CACxD,SAA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wGACA,CAEE,iBAAkB,CAACW,GAAU,CAACD,EAC9B,gCAAiC,CAACC,GAAUD,EAE5C,iBAAkBC,GAAU,CAACD,EAC7B,4BAA6BC,GAAUD,CACzC,CACF,EAEC,SAAAV,EAAK,OAtBDA,EAAK,QAuBZ,CAEJ,CAAC,EACH,EACF,EACF,CAEJ,CACF,EAEAT,EAAiB,YAAc,mBAC/B,IAAOV,EAAQU",
6
- "names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_container", "import_class_variance_authority", "import_useAnchorPosition", "anchorNavigationVariants", "containerVariants", "AnchorNavigation", "className", "data", "props", "ref", "alignment", "theme", "activeId", "useAnchorPosition", "item", "containerRef", "sectionRefs", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "index", "isActive", "isDark", "el"]
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 desktop:gap-6 flex items-center gap-4 overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n },\n },\n defaultVariants: {\n alignment: 'start',\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-[60] 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}\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' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\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 container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [])\n\n return (\n <div ref={ref} className={cn(containerVariants({ theme }), classNames?.root)}>\n <div ref={containerRef} className={cn(anchorNavigationVariants({ alignment }), classNames?.content)}>\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 document.getElementById(item.targetId)?.scrollIntoView({ behavior: 'smooth' })\n }}\n className={cn(\n 'anchor-navigation-item desktop:py-4 shrink-0 border-b-4 border-b-transparent py-3 text-base font-bold',\n {\n // Light theme colors\n 'text-[#4A4C56]': !isDark && !isActive,\n 'border-b-brand text-[#080A0F]': !isDark && isActive,\n // Dark theme colors\n 'text-[#8A8D92]': isDark && !isActive,\n 'border-b-brand text-white': isDark && isActive,\n },\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </div>\n )\n})\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0GY,IAAAI,EAAA,6BAxGZC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAuC,oCACvCC,EAA8B,qCAW9B,MAAMC,KAA2B,OAC/B,gHACA,CACE,SAAU,CACR,UAAW,CACT,MAAO,gBACP,OAAQ,iBACR,IAAK,aACP,CACF,EACA,gBAAiB,CACf,UAAW,OACb,CACF,CACF,EAKMC,KAAoB,OACxB,yGACA,CACE,SAAU,CACR,MAAO,CACL,MAAO,WACP,KAAM,cACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CACF,EA6BMC,EAAmBN,EAAM,WAAkD,CAAC,CAAE,WAAAO,EAAa,CAAC,EAAG,KAAAC,CAAK,EAAGC,IAAQ,CACnH,KAAM,CAAE,UAAAC,EAAY,QAAS,MAAAC,EAAQ,OAAQ,EAAIH,EAC3CI,KAAW,EAAAC,SAAkBL,EAAK,YAAY,IAAIM,GAAQA,EAAK,QAAQ,GAAK,CAAC,CAAC,EAC9EC,EAAef,EAAM,OAAuB,IAAI,EAChDgB,EAAchB,EAAM,OAA4B,CAAC,CAAC,EAElDiB,EAAyBjB,EAAM,YAAakB,GAA0B,CAC1E,MAAMC,EAASH,EAAY,QAAQE,CAAa,EAEhD,GAAIC,GAAUJ,EAAa,QAAS,CAClC,MAAMK,EAAYL,EAAa,QACzBM,EAASF,EACTG,EAAaD,EAAO,WAAaD,EAAU,YAAc,EAAIC,EAAO,YAAc,EAExFD,EAAU,SAAS,CACjB,KAAME,EACN,SAAU,QACZ,CAAC,CACH,CACF,EAAG,CAAC,CAAC,EAEL,SACE,OAAC,OAAI,IAAKb,EAAK,aAAW,MAAGJ,EAAkB,CAAE,MAAAM,CAAM,CAAC,EAAGJ,GAAY,IAAI,EACzE,mBAAC,OAAI,IAAKQ,EAAc,aAAW,MAAGX,EAAyB,CAAE,UAAAM,CAAU,CAAC,EAAGH,GAAY,OAAO,EAC/F,SAAAC,EAAK,YAAY,IAAI,CAACM,EAAMS,IAAU,CACrC,MAAMC,EAAWZ,IAAaE,EAAK,SAC7BW,EAASd,IAAU,OAEzB,SACE,OAAC,UAEC,IAAKe,GAAM,CACLA,IACFV,EAAY,QAAQO,CAAK,EAAIG,EAEjC,EACA,QAAS,IAAM,CACbT,EAAuBM,CAAK,EAC5B,SAAS,eAAeT,EAAK,QAAQ,GAAG,eAAe,CAAE,SAAU,QAAS,CAAC,CAC/E,EACA,aAAW,MACT,wGACA,CAEE,iBAAkB,CAACW,GAAU,CAACD,EAC9B,gCAAiC,CAACC,GAAUD,EAE5C,iBAAkBC,GAAU,CAACD,EAC7B,4BAA6BC,GAAUD,CACzC,EACAjB,GAAY,IACd,EAEC,SAAAO,EAAK,OAvBDA,EAAK,QAwBZ,CAEJ,CAAC,EACH,EACF,CAEJ,CAAC,EAEDR,EAAiB,YAAc,mBAC/B,IAAOT,EAAQS",
6
+ "names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "anchorNavigationVariants", "containerVariants", "AnchorNavigation", "classNames", "data", "ref", "alignment", "theme", "activeId", "useAnchorPosition", "item", "containerRef", "sectionRefs", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "index", "isActive", "isDark", "el"]
7
7
  }
@@ -1,26 +1,27 @@
1
1
  import * as React from 'react';
2
+ import type { Media } from '../../types/props.js';
2
3
  export type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard';
3
4
  /**
4
5
  * 响应式背景图片配置
5
6
  */
6
7
  export interface ResponsiveBackgroundImage {
7
8
  /** 移动端图片 (<1024px) */
8
- mobile?: string;
9
+ mobile?: Media;
9
10
  /** 笔记本图片 (1025-1440px) */
10
- laptop?: string;
11
+ laptop?: Media;
11
12
  /** 桌面图片 (1441-1920px) */
12
- desktop?: string;
13
+ desktop?: Media;
13
14
  /** 超大桌面图片 (≥1921px) */
14
- lgDesktop?: string;
15
+ lgDesktop?: Media;
15
16
  }
16
17
  /**
17
18
  * 状态化背景图片配置
18
19
  */
19
20
  export interface StateBackgroundImage {
20
21
  /** 激活状态的背景图片 */
21
- active: string | ResponsiveBackgroundImage;
22
+ active: ResponsiveBackgroundImage;
22
23
  /** 非激活状态的背景图片 */
23
- inactive: string | ResponsiveBackgroundImage;
24
+ inactive: ResponsiveBackgroundImage;
24
25
  }
25
26
  /**
26
27
  * 活动日程项数据接口
@@ -35,7 +36,7 @@ export interface EventScheduleItem {
35
36
  /** 详细信息列表 */
36
37
  items: {
37
38
  /** 图标 (SVG 字符串或 URL) */
38
- icon: React.ReactNode;
39
+ icon?: Media;
39
40
  /** 文本内容 */
40
41
  label: string;
41
42
  }[];
@@ -49,48 +50,36 @@ export interface EventScheduleData {
49
50
  /**
50
51
  * 背景图片配置,支持响应式图片和状态化图片
51
52
  * 可以传入:
52
- * 1. 字符串(单一图片URL)
53
- * 2. ResponsiveBackgroundImage(多尺寸图片)
54
- * 3. StateBackgroundImage(激活/非激活状态图片)
55
- *
56
- * @example
57
- * // 单一图片
58
- * backgroundImage: "https://example.com/image.jpg"
53
+ * 1. ResponsiveBackgroundImage(多尺寸 Media 对象)
54
+ * 2. StateBackgroundImage(激活/非激活状态的响应式图片)
59
55
  *
60
56
  * @example
61
57
  * // 响应式图片
62
58
  * backgroundImage: {
63
- * mobile: "https://example.com/mobile.jpg",
64
- * laptop: "https://example.com/laptop.jpg",
65
- * desktop: "https://example.com/desktop.jpg",
66
- * lgDesktop: "https://example.com/lg-desktop.jpg"
67
- * }
68
- *
69
- * @example
70
- * // 状态化图片(单一URL)
71
- * backgroundImage: {
72
- * active: "https://example.com/active.jpg",
73
- * inactive: "https://example.com/inactive.jpg"
59
+ * mobile: { url: "https://example.com/mobile.jpg", alt: "...", ... },
60
+ * laptop: { url: "https://example.com/laptop.jpg", alt: "...", ... },
61
+ * desktop: { url: "https://example.com/desktop.jpg", alt: "...", ... },
62
+ * lgDesktop: { url: "https://example.com/lg-desktop.jpg", alt: "...", ... }
74
63
  * }
75
64
  *
76
65
  * @example
77
66
  * // 状态化 + 响应式图片
78
67
  * backgroundImage: {
79
68
  * active: {
80
- * mobile: "https://example.com/active-mobile.jpg",
81
- * laptop: "https://example.com/active-laptop.jpg",
82
- * desktop: "https://example.com/active-desktop.jpg",
83
- * lgDesktop: "https://example.com/active-lg-desktop.jpg"
69
+ * mobile: { url: "https://example.com/active-mobile.jpg", alt: "...", ... },
70
+ * laptop: { url: "https://example.com/active-laptop.jpg", alt: "...", ... },
71
+ * desktop: { url: "https://example.com/active-desktop.jpg", alt: "...", ... },
72
+ * lgDesktop: { url: "https://example.com/active-lg-desktop.jpg", alt: "...", ... }
84
73
  * },
85
74
  * inactive: {
86
- * mobile: "https://example.com/inactive-mobile.jpg",
87
- * laptop: "https://example.com/inactive-laptop.jpg",
88
- * desktop: "https://example.com/inactive-desktop.jpg",
89
- * lgDesktop: "https://example.com/inactive-lg-desktop.jpg"
75
+ * mobile: { url: "https://example.com/inactive-mobile.jpg", alt: "...", ... },
76
+ * laptop: { url: "https://example.com/inactive-laptop.jpg", alt: "...", ... },
77
+ * desktop: { url: "https://example.com/inactive-desktop.jpg", alt: "...", ... },
78
+ * lgDesktop: { url: "https://example.com/inactive-lg-desktop.jpg", alt: "...", ... }
90
79
  * }
91
80
  * }
92
81
  */
93
- backgroundImage?: string | ResponsiveBackgroundImage | StateBackgroundImage;
82
+ backgroundImage?: ResponsiveBackgroundImage | StateBackgroundImage;
94
83
  /** 是否显示时间轴,默认为 true */
95
84
  showTimeline?: boolean;
96
85
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var B=Object.create;var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},v=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of N(t))!b.call(e,n)&&n!==s&&c(e,n,{get:()=>t[n],enumerable:!(a=E(t,n))||a.enumerable});return e};var w=(e,t,s)=>(s=e!=null?B(k(e)):{},v(t||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),P=e=>v(c({},"__esModule",{value:!0}),e);var L={};I(L,{default:()=>C});module.exports=P(L);var i=require("react/jsx-runtime"),d=w(require("react")),l=require("../../helpers/index.js"),p=require("../../components/index.js"),m=require("swiper/react"),u=w(require("dayjs"));const R=(e,t)=>{const s=(0,u.default)(),a=(0,u.default)(e).startOf("day"),n=(0,u.default)(t).endOf("day");return s.isAfter(a)&&s.isBefore(n)},V=e=>R(e.startDate,e.endDate),y=({active:e,className:t})=>(0,i.jsxs)("div",{className:(0,l.cn)("relative my-1 flex h-2 flex-1 items-center justify-center",t),children:[(0,i.jsx)("div",{className:(0,l.cn)("h-2 w-full ",{"bg-[#F6CD4E] rounded-full":e,"bg-[#EAEAEC]":!e})}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("div",{className:(0,l.cn)("size-4 rounded-full border-2 transition-colors",{"border-[#F6CD4E] bg-[#F6CD4E]":e,"border-[#EAEAEC] bg-[#EAEAEC]":!e})})})]}),D=e=>typeof e=="object"&&("active"in e||"inactive"in e),h=e=>{if(!e)return;if(typeof e=="string")return e;const{mobile:t,laptop:s,desktop:a,lgDesktop:n}=e,r=[];return n&&r.push(n),a&&r.push(`${a} 1920`),s&&r.push(`${s} 1440`),t&&r.push(`${t} 1024`),r.length>0?r.join(", "):void 0},A=(e,t)=>{if(e){if(D(e)){const s=t?e.active:e.inactive;return h(s)}return h(e)}},T=({active:e,item:t,backgroundImage:s,className:a})=>{const n=d.useMemo(()=>A(s,e),[s,e]);return(0,i.jsxs)("div",{className:(0,l.cn)("rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden",a),children:[(0,i.jsx)(p.Picture,{source:n,alt:"",className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"}),(0,i.jsxs)("div",{className:"relative z-20 size-full p-4",children:[(0,i.jsx)("h2",{className:(0,l.cn)("desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]"),dangerouslySetInnerHTML:{__html:t.title}}),(0,i.jsx)("div",{className:"flex flex-col gap-0.5",children:t.items.map((r,o)=>(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[r.icon&&(0,i.jsx)("div",{className:"desktop:size-6 size-5 shrink-0",children:(0,i.jsx)("img",{src:r.icon,alt:"",className:"size-full"})}),(0,i.jsx)(p.Text,{html:r.label,className:(0,l.cn)("desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]")})]},o))})]})]})},x=d.forwardRef(({classNames:e={},data:t,...s},a)=>{const n=d.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),r=d.useMemo(()=>{switch(n){case 2:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2},1024:{spaceBetween:16},1440:{spaceBetween:16,slidesPerView:2}};case 3:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:n,spaceBetween:16},1440:{spaceBetween:16,slidesPerView:n}};case 4:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:3.2,spaceBetween:16},1440:{slidesPerView:n}};default:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:1},1024:{slidesPerView:n,spaceBetween:16},1440:{slidesPerView:n}}}},[n]),o=t.showTimeline!==!1;return(0,i.jsx)("div",{ref:a,className:(0,l.cn)("desktop:px-16 laptop:px-16 tablet:px-8 w-full overflow-hidden px-4",e?.root),...s,children:(0,i.jsx)("div",{className:"flex w-full flex-col gap-4",children:(0,i.jsx)(m.Swiper,{breakpoints:r,className:"w-full !overflow-visible",children:t.scheduleList.map((g,S)=>{const f=V(g);return(0,i.jsxs)(m.SwiperSlide,{children:[o&&(0,i.jsx)(y,{active:f}),(0,i.jsx)(T,{active:f,className:o?"mt-4":"",item:g,backgroundImage:t.backgroundImage})]},"SwiperSlideItem"+S)})})})})});x.displayName="EventSchedule";var C=x;
1
+ "use strict";"use client";var b=Object.create;var u=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var s in t)u(e,s,{get:t[s],enumerable:!0})},h=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of I(t))!P.call(e,a)&&a!==s&&u(e,a,{get:()=>t[a],enumerable:!(n=E(t,a))||n.enumerable});return e};var x=(e,t,s)=>(s=e!=null?b(N(e)):{},h(t||!e||!e.__esModule?u(s,"default",{value:e,enumerable:!0}):s,e)),V=e=>h(u({},"__esModule",{value:!0}),e);var L={};R(L,{default:()=>z});module.exports=V(L);var i=require("react/jsx-runtime"),m=x(require("react")),l=require("../../helpers/index.js"),c=require("../../components/index.js"),g=require("swiper/react"),f=x(require("dayjs"));const y=(e,t)=>{const s=(0,f.default)(),n=(0,f.default)(e).startOf("day"),a=(0,f.default)(t).endOf("day");return s.isAfter(n)&&s.isBefore(a)},D=e=>y(e.startDate,e.endDate),M=({active:e,className:t})=>(0,i.jsxs)("div",{className:(0,l.cn)("relative my-1 flex h-2 flex-1 items-center justify-center",t),children:[(0,i.jsx)("div",{className:(0,l.cn)("h-2 w-full ",{"bg-[#F6CD4E] rounded-full":e,"bg-[#EAEAEC]":!e})}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("div",{className:(0,l.cn)("size-4 rounded-full border-2 transition-colors",{"border-[#F6CD4E] bg-[#F6CD4E]":e,"border-[#EAEAEC] bg-[#EAEAEC]":!e})})})]}),A=e=>typeof e=="object"&&("active"in e||"inactive"in e),S=e=>{if(!e)return;const{mobile:t,laptop:s,desktop:n,lgDesktop:a}=e,r=[],o=B=>B?.url,p=o(a),d=o(n),v=o(s),w=o(t);return p&&r.push(p),d&&r.push(`${d} 1920`),v&&r.push(`${v} 1440`),w&&r.push(`${w} 1024`),r.length>0?r.join(", "):void 0},C=(e,t)=>{if(e){if(A(e)){const s=t?e.active:e.inactive;return S(s)}return S(e)}},T=({active:e,item:t,backgroundImage:s,className:n})=>{const a=m.useMemo(()=>C(s,e),[s,e]);return(0,i.jsxs)("div",{className:(0,l.cn)("rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden",n),children:[(0,i.jsx)(c.Picture,{source:a,alt:"",className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"}),(0,i.jsxs)("div",{className:"relative z-20 size-full p-4",children:[(0,i.jsx)(c.Heading,{html:t.title,className:(0,l.cn)("desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]")}),(0,i.jsx)("div",{className:"flex flex-col gap-0.5",children:t.items.map((r,o)=>(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[r.icon&&(0,i.jsx)("div",{className:"desktop:size-6 size-5 shrink-0",children:(0,i.jsx)(c.Picture,{source:r.icon.url,alt:r.icon.alt,className:"size-full"})}),(0,i.jsx)(c.Text,{html:r.label,className:(0,l.cn)("desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]")})]},o))})]})]})},k=m.forwardRef(({classNames:e={},data:t},s)=>{const n=m.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),a=m.useMemo(()=>{switch(n){case 2:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2},1024:{spaceBetween:16},1440:{spaceBetween:16,slidesPerView:2}};case 3:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:n,spaceBetween:16},1440:{spaceBetween:16,slidesPerView:n}};case 4:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:3.2,spaceBetween:16},1440:{slidesPerView:n}};default:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:1},1024:{slidesPerView:n,spaceBetween:16},1440:{slidesPerView:n}}}},[n]),r=t.showTimeline!==!1;return(0,i.jsx)("div",{ref:s,className:(0,l.cn)("tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] flex w-full flex-col gap-4 overflow-hidden px-4",e?.root),children:(0,i.jsx)(g.Swiper,{breakpoints:a,className:"w-full !overflow-visible",children:t.scheduleList.map((o,p)=>{const d=D(o);return(0,i.jsxs)(g.SwiperSlide,{children:[r&&(0,i.jsx)(M,{className:e?.timeline,active:d}),(0,i.jsx)(T,{active:d,className:(0,l.cn)(r?"mt-4":"",e?.eventScheduleCard),item:o,backgroundImage:t.backgroundImage})]},"SwiperSlideItem"+p)})})})});k.displayName="EventSchedule";var z=k;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 } from '../../components/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport dayjs from 'dayjs'\n\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 (<1024px) */\n mobile?: string\n /** \u7B14\u8BB0\u672C\u56FE\u7247 (1025-1440px) */\n laptop?: string\n /** \u684C\u9762\u56FE\u7247 (1441-1920px) */\n desktop?: string\n /** \u8D85\u5927\u684C\u9762\u56FE\u7247 (\u22651921px) */\n lgDesktop?: string\n}\n\n/**\n * \u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface StateBackgroundImage {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u80CC\u666F\u56FE\u7247 */\n active: string | ResponsiveBackgroundImage\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u80CC\u666F\u56FE\u7247 */\n inactive: string | ResponsiveBackgroundImage\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 /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon: React.ReactNode\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 /**\n * \u80CC\u666F\u56FE\u7247\u914D\u7F6E\uFF0C\u652F\u6301\u54CD\u5E94\u5F0F\u56FE\u7247\u548C\u72B6\u6001\u5316\u56FE\u7247\n * \u53EF\u4EE5\u4F20\u5165\uFF1A\n * 1. \u5B57\u7B26\u4E32\uFF08\u5355\u4E00\u56FE\u7247URL\uFF09\n * 2. ResponsiveBackgroundImage\uFF08\u591A\u5C3A\u5BF8\u56FE\u7247\uFF09\n * 3. StateBackgroundImage\uFF08\u6FC0\u6D3B/\u975E\u6FC0\u6D3B\u72B6\u6001\u56FE\u7247\uFF09\n *\n * @example\n * // \u5355\u4E00\u56FE\u7247\n * backgroundImage: \"https://example.com/image.jpg\"\n *\n * @example\n * // \u54CD\u5E94\u5F0F\u56FE\u7247\n * backgroundImage: {\n * mobile: \"https://example.com/mobile.jpg\",\n * laptop: \"https://example.com/laptop.jpg\",\n * desktop: \"https://example.com/desktop.jpg\",\n * lgDesktop: \"https://example.com/lg-desktop.jpg\"\n * }\n *\n * @example\n * // \u72B6\u6001\u5316\u56FE\u7247\uFF08\u5355\u4E00URL\uFF09\n * backgroundImage: {\n * active: \"https://example.com/active.jpg\",\n * inactive: \"https://example.com/inactive.jpg\"\n * }\n *\n * @example\n * // \u72B6\u6001\u5316 + \u54CD\u5E94\u5F0F\u56FE\u7247\n * backgroundImage: {\n * active: {\n * mobile: \"https://example.com/active-mobile.jpg\",\n * laptop: \"https://example.com/active-laptop.jpg\",\n * desktop: \"https://example.com/active-desktop.jpg\",\n * lgDesktop: \"https://example.com/active-lg-desktop.jpg\"\n * },\n * inactive: {\n * mobile: \"https://example.com/inactive-mobile.jpg\",\n * laptop: \"https://example.com/inactive-laptop.jpg\",\n * desktop: \"https://example.com/inactive-desktop.jpg\",\n * lgDesktop: \"https://example.com/inactive-lg-desktop.jpg\"\n * }\n * }\n */\n backgroundImage?: string | ResponsiveBackgroundImage | StateBackgroundImage\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\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 * \u5224\u65AD\u5F53\u524D\u65F6\u95F4\u662F\u5426\u5728\u6307\u5B9A\u7684\u65F6\u95F4\u533A\u95F4\u5185\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u662F\u5426\u5728\u533A\u95F4\u5185\n */\nconst isInTimeRange = (startDate: string, endDate: string): boolean => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n return now.isAfter(start) && now.isBefore(end)\n}\n\n/**\n * \u83B7\u53D6\u6D3B\u52A8\u9879\u7684\u6FC0\u6D3B\u72B6\u6001\n * @param item \u6D3B\u52A8\u9879\n * @returns \u662F\u5426\u6FC0\u6D3B\n */\nconst getItemActiveStatus = (item: EventScheduleItem): boolean => {\n // \u5426\u5219\u6839\u636E\u65F6\u95F4\u533A\u95F4\u81EA\u52A8\u5224\u65AD\n return isInTimeRange(item.startDate, item.endDate)\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ active, className }: { active: boolean; className?: string }) => {\n return (\n <div className={cn('relative my-1 flex h-2 flex-1 items-center justify-center', className)}>\n {/* \u8FDB\u5EA6\u6761 */}\n <div\n className={cn('h-2 w-full ', {\n 'bg-[#F6CD4E] rounded-full': active,\n 'bg-[#EAEAEC]': !active,\n })}\n />\n {/* \u65F6\u95F4\u8282\u70B9 */}\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <div\n className={cn('size-4 rounded-full border-2 transition-colors', {\n 'border-[#F6CD4E] bg-[#F6CD4E]': active,\n 'border-[#EAEAEC] bg-[#EAEAEC]': !active,\n })}\n />\n </div>\n </div>\n )\n}\n\n/**\n * \u5224\u65AD\u662F\u5426\u4E3A\u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @param obj \u5F85\u68C0\u67E5\u7684\u5BF9\u8C61\n * @returns \u662F\u5426\u4E3AStateBackgroundImage\u7C7B\u578B\n */\nconst isStateBackgroundImage = (\n obj: string | ResponsiveBackgroundImage | StateBackgroundImage\n): obj is StateBackgroundImage => {\n return typeof obj === 'object' && ('active' in obj || 'inactive' in obj)\n}\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3APicture\u7EC4\u4EF6\u6240\u9700\u7684\u5B57\u7B26\u4E32\u683C\u5F0F\n * @param backgroundImage \u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @returns Picture\u7EC4\u4EF6\u53EF\u7528\u7684source\u5B57\u7B26\u4E32\n */\nconst convertResponsiveImageToString = (backgroundImage: string | ResponsiveBackgroundImage): string | undefined => {\n if (!backgroundImage) return undefined\n if (typeof backgroundImage === 'string') return backgroundImage\n\n const { mobile, laptop, desktop, lgDesktop } = backgroundImage\n const parts: string[] = []\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n if (lgDesktop) parts.push(lgDesktop)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktop) parts.push(`${desktop} 1920`)\n if (laptop) parts.push(`${laptop} 1440`)\n if (mobile) parts.push(`${mobile} 1024`)\n\n return parts.length > 0 ? parts.join(', ') : undefined\n}\n\n/**\n * \u6839\u636E\u6FC0\u6D3B\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u80CC\u666F\u56FE\u7247\n * @param backgroundImage \u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @param isActive \u662F\u5426\u6FC0\u6D3B\u72B6\u6001\n * @returns Picture\u7EC4\u4EF6\u53EF\u7528\u7684source\u5B57\u7B26\u4E32\n */\nconst formatBackgroundImage = (\n backgroundImage: string | ResponsiveBackgroundImage | StateBackgroundImage | undefined,\n isActive: boolean\n): string | undefined => {\n if (!backgroundImage) return undefined\n\n // \u5982\u679C\u662F\u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\uFF0C\u6839\u636E\u6FC0\u6D3B\u72B6\u6001\u9009\u62E9\u5BF9\u5E94\u7684\u56FE\u7247\n if (isStateBackgroundImage(backgroundImage)) {\n const stateImage = isActive ? backgroundImage.active : backgroundImage.inactive\n return convertResponsiveImageToString(stateImage)\n }\n\n // \u5426\u5219\u76F4\u63A5\u8F6C\u6362\n return convertResponsiveImageToString(backgroundImage)\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n active,\n item,\n backgroundImage,\n className,\n}: {\n active: boolean\n item: EventScheduleItem\n backgroundImage: string | ResponsiveBackgroundImage | StateBackgroundImage | undefined\n className?: string\n}) => {\n const pictureSource = React.useMemo(() => {\n return formatBackgroundImage(backgroundImage, active)\n }, [backgroundImage, active])\n\n return (\n <div\n className={cn(\n 'rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden',\n className\n )}\n >\n <Picture source={pictureSource} alt=\"\" className=\"absolute inset-0 z-10\" imgClassName=\"h-full object-cover\" />\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-20 size-full p-4\">\n <h2\n className={cn('desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]')}\n dangerouslySetInnerHTML={{ __html: item.title }}\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 <div className=\"desktop:size-6 size-5 shrink-0\">\n <img src={detail.icon as string} alt=\"\" className=\"size-full\" />\n </div>\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn('desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]')}\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>(\n ({ classNames = {}, data, ...props }, ref) => {\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\n const swiperBreakpoints = React.useMemo(() => {\n switch (itemsPerRow) {\n case 2:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2,\n },\n 1024: {\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: 2,\n },\n }\n case 3:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: itemsPerRow,\n },\n }\n case 4:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: 3.2,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n },\n }\n default:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 1,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n },\n }\n }\n }, [itemsPerRow])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\n\n return (\n <div\n ref={ref}\n className={cn('desktop:px-16 laptop:px-16 tablet:px-8 w-full overflow-hidden px-4', classNames?.root)}\n {...props}\n >\n <div className=\"flex w-full flex-col gap-4\">\n <Swiper breakpoints={swiperBreakpoints} className=\"w-full !overflow-visible\">\n {data.scheduleList.map((item, index) => {\n const isActive = getItemActiveStatus(item)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n {/* \u65F6\u95F4\u8F74 */}\n {showTimeline && <TimelineNode active={isActive} />}\n <EventScheduleCard\n active={isActive}\n className={showTimeline ? 'mt-4' : ''}\n item={item}\n backgroundImage={data.backgroundImage}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n </div>\n </div>\n )\n }\n)\n\nEventSchedule.displayName = 'EventSchedule'\nexport default EventSchedule\n\n// \u5BFC\u51FA\u7C7B\u578B\u4F9B\u5916\u90E8\u4F7F\u7528\n// export type { ResponsiveBackgroundImage, StateBackgroundImage, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8II,IAAAI,EAAA,6BA5IJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAAoC,wBACpCC,EAAkB,oBAkHlB,MAAMC,EAAgB,CAACC,EAAmBC,IAA6B,CACrE,MAAMC,KAAM,EAAAC,SAAM,EACZC,KAAQ,EAAAD,SAAMH,CAAS,EAAE,QAAQ,KAAK,EACtCK,KAAM,EAAAF,SAAMF,CAAO,EAAE,MAAM,KAAK,EACtC,OAAOC,EAAI,QAAQE,CAAK,GAAKF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Ac,EAChB,EACA,IAAK,CACH,cAAe,GACjB,EACA,KAAM,CACJ,cAAe,IACf,aAAc,EAChB,EACA,KAAM,CACJ,cAAeA,CACjB,CACF,EACF,QACE,MAAO,CACL,EAAG,CACD,cAAe,KACf,aAAc,EAChB,EACA,IAAK,CACH,cAAe,CACjB,EACA,KAAM,CACJ,cAAeA,EACf,aAAc,EAChB,EACA,KAAM,CACJ,cAAeA,CACjB,CACF,CACJ,CACF,EAAG,CAACA,CAAW,CAAC,EAEVE,EAAeL,EAAK,eAAiB,GAE3C,SACE,OAAC,OACC,IAAKE,EACL,aAAW,MAAG,qEAAsEH,GAAY,IAAI,EACnG,GAAGE,EAEJ,mBAAC,OAAI,UAAU,6BACb,mBAAC,UAAO,YAAaG,EAAmB,UAAU,2BAC/C,SAAAJ,EAAK,aAAa,IAAI,CAACtB,EAAMmB,IAAU,CACtC,MAAML,EAAWf,EAAoBC,CAAI,EACzC,SACE,QAAC,eAEE,UAAA2B,MAAgB,OAAC1B,EAAA,CAAa,OAAQa,EAAU,KACjD,OAACE,EAAA,CACC,OAAQF,EACR,UAAWa,EAAe,OAAS,GACnC,KAAM3B,EACN,gBAAiBsB,EAAK,gBACxB,IARgB,kBAAoBH,CAStC,CAEJ,CAAC,EACH,EACF,EACF,CAEJ,CACF,EAEAC,EAAc,YAAc,gBAC5B,IAAOpC,EAAQoC",
6
- "names": ["EventSchedule_exports", "__export", "EventSchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_react", "import_dayjs", "isInTimeRange", "startDate", "endDate", "now", "dayjs", "start", "end", "getItemActiveStatus", "item", "TimelineNode", "active", "className", "isStateBackgroundImage", "obj", "convertResponsiveImageToString", "backgroundImage", "mobile", "laptop", "desktop", "lgDesktop", "parts", "formatBackgroundImage", "isActive", "stateImage", "EventScheduleCard", "pictureSource", "detail", "index", "EventSchedule", "classNames", "data", "props", "ref", "itemsPerRow", "swiperBreakpoints", "showTimeline"]
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 dayjs from 'dayjs'\nimport type { Media } from '../../types/props.js'\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u79FB\u52A8\u7AEF\u56FE\u7247 (<1024px) */\n mobile?: 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 * \u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n */\nexport interface StateBackgroundImage {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u80CC\u666F\u56FE\u7247 */\n active: ResponsiveBackgroundImage\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u80CC\u666F\u56FE\u7247 */\n inactive: ResponsiveBackgroundImage\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 /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon?: Media\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 /**\n * \u80CC\u666F\u56FE\u7247\u914D\u7F6E\uFF0C\u652F\u6301\u54CD\u5E94\u5F0F\u56FE\u7247\u548C\u72B6\u6001\u5316\u56FE\u7247\n * \u53EF\u4EE5\u4F20\u5165\uFF1A\n * 1. ResponsiveBackgroundImage\uFF08\u591A\u5C3A\u5BF8 Media \u5BF9\u8C61\uFF09\n * 2. StateBackgroundImage\uFF08\u6FC0\u6D3B/\u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u54CD\u5E94\u5F0F\u56FE\u7247\uFF09\n *\n * @example\n * // \u54CD\u5E94\u5F0F\u56FE\u7247\n * backgroundImage: {\n * mobile: { url: \"https://example.com/mobile.jpg\", alt: \"...\", ... },\n * laptop: { url: \"https://example.com/laptop.jpg\", alt: \"...\", ... },\n * desktop: { url: \"https://example.com/desktop.jpg\", alt: \"...\", ... },\n * lgDesktop: { url: \"https://example.com/lg-desktop.jpg\", alt: \"...\", ... }\n * }\n *\n * @example\n * // \u72B6\u6001\u5316 + \u54CD\u5E94\u5F0F\u56FE\u7247\n * backgroundImage: {\n * active: {\n * mobile: { url: \"https://example.com/active-mobile.jpg\", alt: \"...\", ... },\n * laptop: { url: \"https://example.com/active-laptop.jpg\", alt: \"...\", ... },\n * desktop: { url: \"https://example.com/active-desktop.jpg\", alt: \"...\", ... },\n * lgDesktop: { url: \"https://example.com/active-lg-desktop.jpg\", alt: \"...\", ... }\n * },\n * inactive: {\n * mobile: { url: \"https://example.com/inactive-mobile.jpg\", alt: \"...\", ... },\n * laptop: { url: \"https://example.com/inactive-laptop.jpg\", alt: \"...\", ... },\n * desktop: { url: \"https://example.com/inactive-desktop.jpg\", alt: \"...\", ... },\n * lgDesktop: { url: \"https://example.com/inactive-lg-desktop.jpg\", alt: \"...\", ... }\n * }\n * }\n */\n backgroundImage?: ResponsiveBackgroundImage | StateBackgroundImage\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\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 * \u5224\u65AD\u5F53\u524D\u65F6\u95F4\u662F\u5426\u5728\u6307\u5B9A\u7684\u65F6\u95F4\u533A\u95F4\u5185\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u662F\u5426\u5728\u533A\u95F4\u5185\n */\nconst isInTimeRange = (startDate: string, endDate: string): boolean => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n return now.isAfter(start) && now.isBefore(end)\n}\n\n/**\n * \u83B7\u53D6\u6D3B\u52A8\u9879\u7684\u6FC0\u6D3B\u72B6\u6001\n * @param item \u6D3B\u52A8\u9879\n * @returns \u662F\u5426\u6FC0\u6D3B\n */\nconst getItemActiveStatus = (item: EventScheduleItem): boolean => {\n // \u5426\u5219\u6839\u636E\u65F6\u95F4\u533A\u95F4\u81EA\u52A8\u5224\u65AD\n return isInTimeRange(item.startDate, item.endDate)\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ active, className }: { active: boolean; className?: string }) => {\n return (\n <div className={cn('relative my-1 flex h-2 flex-1 items-center justify-center', className)}>\n {/* \u8FDB\u5EA6\u6761 */}\n <div\n className={cn('h-2 w-full ', {\n 'bg-[#F6CD4E] rounded-full': active,\n 'bg-[#EAEAEC]': !active,\n })}\n />\n {/* \u65F6\u95F4\u8282\u70B9 */}\n <div className=\"absolute inset-0 flex items-center justify-center\">\n <div\n className={cn('size-4 rounded-full border-2 transition-colors', {\n 'border-[#F6CD4E] bg-[#F6CD4E]': active,\n 'border-[#EAEAEC] bg-[#EAEAEC]': !active,\n })}\n />\n </div>\n </div>\n )\n}\n\n/**\n * \u5224\u65AD\u662F\u5426\u4E3A\u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @param obj \u5F85\u68C0\u67E5\u7684\u5BF9\u8C61\n * @returns \u662F\u5426\u4E3AStateBackgroundImage\u7C7B\u578B\n */\nconst isStateBackgroundImage = (obj: ResponsiveBackgroundImage | StateBackgroundImage): obj is StateBackgroundImage => {\n return typeof obj === 'object' && ('active' in obj || 'inactive' in obj)\n}\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3APicture\u7EC4\u4EF6\u6240\u9700\u7684\u5B57\u7B26\u4E32\u683C\u5F0F\n * @param backgroundImage \u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @returns Picture\u7EC4\u4EF6\u53EF\u7528\u7684source\u5B57\u7B26\u4E32\n */\nconst convertResponsiveImageToString = (backgroundImage: ResponsiveBackgroundImage): string | undefined => {\n if (!backgroundImage) return undefined\n\n const { mobile, 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 // \u83B7\u53D6\u5404\u5C3A\u5BF8\u7684 URL\n const lgDesktopUrl = getUrl(lgDesktop)\n const desktopUrl = getUrl(desktop)\n const laptopUrl = getUrl(laptop)\n const mobileUrl = getUrl(mobile)\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n if (lgDesktopUrl) parts.push(lgDesktopUrl)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktopUrl) parts.push(`${desktopUrl} 1920`)\n if (laptopUrl) parts.push(`${laptopUrl} 1440`)\n if (mobileUrl) parts.push(`${mobileUrl} 1024`)\n\n return parts.length > 0 ? parts.join(', ') : undefined\n}\n\n/**\n * \u6839\u636E\u6FC0\u6D3B\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u80CC\u666F\u56FE\u7247\n * @param backgroundImage \u80CC\u666F\u56FE\u7247\u914D\u7F6E\n * @param isActive \u662F\u5426\u6FC0\u6D3B\u72B6\u6001\n * @returns Picture\u7EC4\u4EF6\u53EF\u7528\u7684source\u5B57\u7B26\u4E32\n */\nconst formatBackgroundImage = (\n backgroundImage: ResponsiveBackgroundImage | StateBackgroundImage | undefined,\n isActive: boolean\n): string | undefined => {\n if (!backgroundImage) return undefined\n\n // \u5982\u679C\u662F\u72B6\u6001\u5316\u80CC\u666F\u56FE\u7247\uFF0C\u6839\u636E\u6FC0\u6D3B\u72B6\u6001\u9009\u62E9\u5BF9\u5E94\u7684\u56FE\u7247\n if (isStateBackgroundImage(backgroundImage)) {\n const stateImage = isActive ? backgroundImage.active : backgroundImage.inactive\n return convertResponsiveImageToString(stateImage)\n }\n\n // \u5426\u5219\u76F4\u63A5\u8F6C\u6362\n return convertResponsiveImageToString(backgroundImage)\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n active,\n item,\n backgroundImage,\n className,\n}: {\n active: boolean\n item: EventScheduleItem\n backgroundImage: ResponsiveBackgroundImage | StateBackgroundImage | undefined\n className?: string\n}) => {\n const pictureSource = React.useMemo(() => {\n return formatBackgroundImage(backgroundImage, active)\n }, [backgroundImage, active])\n\n return (\n <div\n className={cn(\n 'rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden',\n className\n )}\n >\n <Picture source={pictureSource} alt=\"\" className=\"absolute inset-0 z-10\" imgClassName=\"h-full object-cover\" />\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-20 size-full p-4\">\n <Heading\n html={item.title}\n className={cn('desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]')}\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 <div className=\"desktop:size-6 size-5 shrink-0\">\n <Picture source={detail.icon.url} alt={detail.icon.alt} className=\"size-full\" />\n </div>\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn('desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]')}\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 itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\n const swiperBreakpoints = React.useMemo(() => {\n switch (itemsPerRow) {\n case 2:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2,\n },\n 1024: {\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: 2,\n },\n }\n case 3:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: itemsPerRow,\n },\n }\n case 4:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: 3.2,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n },\n }\n default:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 1,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n },\n }\n }\n }, [itemsPerRow])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\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)] flex w-full flex-col gap-4 overflow-hidden px-4',\n classNames?.root\n )}\n >\n <Swiper breakpoints={swiperBreakpoints} className=\"w-full !overflow-visible\">\n {data.scheduleList.map((item, index) => {\n const isActive = getItemActiveStatus(item)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n {/* \u65F6\u95F4\u8F74 */}\n {showTimeline && <TimelineNode className={classNames?.timeline} active={isActive} />}\n <EventScheduleCard\n active={isActive}\n className={cn(showTimeline ? 'mt-4' : '', classNames?.eventScheduleCard)}\n item={item}\n backgroundImage={data.backgroundImage}\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 { ResponsiveBackgroundImage, StateBackgroundImage, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
5
+ "mappings": "ukBAA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gB,kBAAoBH,CAStC,CAEJ,CAAC,EACH,EACF,CAEJ,CAAC,EAEDC,EAAc,YAAc,gBAC5B,IAAO1C,EAAQ0C",
6
+ "names": ["EventSchedule_exports", "__export", "EventSchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_react", "import_dayjs", "isInTimeRange", "startDate", "endDate", "now", "dayjs", "start", "end", "getItemActiveStatus", "item", "TimelineNode", "active", "className", "isStateBackgroundImage", "obj", "convertResponsiveImageToString", "backgroundImage", "mobile", "laptop", "desktop", "lgDesktop", "parts", "getUrl", "media", "lgDesktopUrl", "desktopUrl", "laptopUrl", "mobileUrl", "formatBackgroundImage", "isActive", "stateImage", "EventScheduleCard", "pictureSource", "detail", "index", "EventSchedule", "classNames", "data", "ref", "itemsPerRow", "swiperBreakpoints", "showTimeline"]
7
7
  }
@@ -1,18 +1,26 @@
1
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
+ }
2
10
  /**
3
11
  * 响应式背景图片配置
4
12
  */
5
13
  export interface ResponsiveBackgroundImage {
6
14
  /** 移动端图片 (<768px) */
7
- mobile?: string;
15
+ mobile?: Media;
8
16
  /** 平板图片 (768-1440px) */
9
- tablet?: string;
17
+ tablet?: Media;
10
18
  /** 笔记本图片 (1025-1440px) */
11
- laptop?: string;
19
+ laptop?: Media;
12
20
  /** 桌面图片 (1441-1920px) */
13
- desktop?: string;
21
+ desktop?: Media;
14
22
  /** 超大桌面图片 (≥1921px) */
15
- lgDesktop?: string;
23
+ lgDesktop?: Media;
16
24
  }
17
25
  /**
18
26
  * PromotionalBar 业务组件数据接口
@@ -26,17 +34,16 @@ export interface PromotionalBarData {
26
34
  buttonText?: string;
27
35
  /** 按钮链接 */
28
36
  buttonLink?: string;
29
- /** 背景图片 - 支持字符串或响应式图片对象 */
30
- backgroundImage?: string | ResponsiveBackgroundImage;
37
+ /** 背景图片 - 响应式图片对象 */
38
+ backgroundImage?: ResponsiveBackgroundImage;
31
39
  }
32
40
  export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {
33
41
  /** 业务数据 */
34
42
  data: PromotionalBarData;
43
+ classNames?: Partial<Record<keyof PromotionalBarSemanticName, string>>;
35
44
  }
36
- /**
37
- * PromotionalBar - 推广栏
38
- *
39
- * @description 推广栏
40
- */
41
- declare const PromotionalBar: React.ForwardRefExoticComponent<PromotionalBarProps & React.RefAttributes<HTMLDivElement>>;
42
- export default PromotionalBar;
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 | undefined;
47
+ data?: Record<string, any> | undefined;
48
+ }, "ref"> & React.RefAttributes<any>>;
49
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var d=Object.create;var l=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of x(t))!h.call(e,n)&&n!==o&&l(e,n,{get:()=>t[n],enumerable:!(s=g(t,n))||s.enumerable});return e};var k=(e,t,o)=>(o=e!=null?d(v(e)):{},c(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),B=e=>c(l({},"__esModule",{value:!0}),e);var D={};b(D,{default:()=>T});module.exports=B(D);var r=require("react/jsx-runtime"),u=k(require("react")),f=require("../../helpers/index.js"),a=require("../../components/index.js");const N=e=>{if(!e)return;if(typeof e=="string")return e;const{mobile:t,tablet:o,laptop:s,desktop:n,lgDesktop:p}=e,i=[];return p?i.push(p):n?i.push(n):s?i.push(s):o?i.push(o):t&&i.push(t),n&&p&&i.push(`${n} 1920`),s&&(n||p)&&i.push(`${s} 1440`),o&&(s||n||p)&&i.push(`${o} 1024`),t&&(o||s||n||p)&&i.push(`${t} 768`),i.length>0?i.join(", "):void 0},m=u.forwardRef(({className:e,data:t,...o},s)=>{const{backgroundImage:n}=t,p=u.useMemo(()=>N(n),[n]);return(0,r.jsx)("div",{ref:s,className:(0,f.cn)("w-full",e),...o,children:(0,r.jsx)(a.Container,{className:"laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",children:(0,r.jsxs)("div",{className:"promotional-bar-content rounded-box relative h-full overflow-hidden",children:[(0,r.jsxs)("div",{className:"laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 relative z-20 flex h-full flex-col p-4",children:[t.contentTitle&&(0,r.jsx)(a.Heading,{className:"text-[#F5F6F7]",size:3,children:t.contentTitle}),t.contentDesc&&(0,r.jsx)("p",{className:"laptop:text-[16px] laptop:line-clamp-2 lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#F5F6F7]",children:t.contentDesc}),(0,r.jsx)("div",{className:"laptop:mt-4 mt-1",children:t.buttonText&&(0,r.jsx)(a.Button,{as:"a",variant:"link",className:"!p-0 text-[#F5F6F7]",href:t.buttonLink,children:t.buttonText})})]}),(0,r.jsx)(a.Picture,{source:p,className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"})]})})})});m.displayName="PromotionalBar";var T=m;
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,F=Object.prototype.hasOwnProperty;var N=(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))!F.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={};N(I,{default:()=>w});module.exports=R(I);var i=require("react/jsx-runtime"),b=y(require("react")),c=require("../../helpers/index.js"),u=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=[],m=B=>B?.url,l=m(k),s=m(r),p=m(a),d=m(o),f=m(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},h=b.forwardRef(({classNames:t,data:e},o)=>{const{backgroundImage:a}=e,r=b.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-box 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 relative z-20 flex h-full flex-col p-4",t?.content),children:[e.contentTitle&&(0,i.jsx)(u.Heading,{className:(0,c.cn)("text-[#F5F6F7]",t?.title),html:e.contentTitle,size:3}),e.contentDesc&&(0,i.jsx)("p",{className:(0,c.cn)("laptop:text-[16px] laptop:line-clamp-2 lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#F5F6F7]",t?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),(0,i.jsx)("div",{className:"laptop:mt-4 mt-1",children:e.buttonText&&(0,i.jsx)(u.Button,{as:"a",variant:"link",className:(0,c.cn)("!p-0 text-[#F5F6F7]",t?.button),href:e.buttonLink,children:e.buttonText})})]}),(0,i.jsx)(u.Picture,{source:r,className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"})]})})});h.displayName="PromotionalBar";var w=(0,v.withLayout)(h);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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, Container } from '../../components/index.js'\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?: string\n /** \u5E73\u677F\u56FE\u7247 (768-1440px) */\n tablet?: string\n /** \u7B14\u8BB0\u672C\u56FE\u7247 (1025-1440px) */\n laptop?: string\n /** \u684C\u9762\u56FE\u7247 (1441-1920px) */\n desktop?: string\n /** \u8D85\u5927\u684C\u9762\u56FE\u7247 (\u22651921px) */\n lgDesktop?: string\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 - \u652F\u6301\u5B57\u7B26\u4E32\u6216\u54CD\u5E94\u5F0F\u56FE\u7247\u5BF9\u8C61 */\n backgroundImage?: string | ResponsiveBackgroundImage\n}\n\nexport interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: PromotionalBarData\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 = (\n backgroundImage: string | ResponsiveBackgroundImage | undefined\n): string | undefined => {\n if (!backgroundImage) return undefined\n if (typeof backgroundImage === 'string') return backgroundImage\n\n const { mobile, tablet, laptop, desktop, lgDesktop } = backgroundImage\n const parts: string[] = []\n\n // \u9ED8\u8BA4\u56FE\u7247\uFF08\u6700\u5927\u5C3A\u5BF8\uFF09\u653E\u5728\u6700\u524D\u9762\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\n if (lgDesktop) parts.push(lgDesktop)\n else if (desktop) parts.push(desktop)\n else if (laptop) parts.push(laptop)\n else if (tablet) parts.push(tablet)\n else if (mobile) parts.push(mobile)\n\n // \u6309\u65AD\u70B9\u4ECE\u5927\u5230\u5C0F\u6DFB\u52A0\n if (desktop && lgDesktop) parts.push(`${desktop} 1920`)\n if (laptop && (desktop || lgDesktop)) parts.push(`${laptop} 1440`)\n if (tablet && (laptop || desktop || lgDesktop)) parts.push(`${tablet} 1024`)\n if (mobile && (tablet || laptop || desktop || lgDesktop)) parts.push(`${mobile} 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>(({ className, data, ...props }, ref) => {\n const { backgroundImage } = data\n const pictureSource = React.useMemo(() => {\n return convertResponsiveImageToString(backgroundImage)\n }, [backgroundImage])\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {/* \u63A8\u5E7F\u680F\u5185\u5BB9\u533A\u57DF - \u6839\u636E\u5177\u4F53\u4E1A\u52A1\u9700\u6C42\u5B9A\u5236 */}\n <Container className=\"laptop:h-[192px] lg-desktop:h-[240px] h-[240px]\">\n <div className=\"promotional-bar-content rounded-box relative h-full overflow-hidden\">\n <div className=\"laptop:px-8 laptop:justify-center lg-desktop:max-w-[620px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 relative z-20 flex h-full flex-col p-4\">\n {data.contentTitle && (\n <Heading className=\"text-[#F5F6F7]\" size={3}>\n {data.contentTitle}\n </Heading>\n )}\n {data.contentDesc && (\n <p className=\"laptop:text-[16px] laptop:line-clamp-2 lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4] text-[#F5F6F7]\">\n {data.contentDesc}\n </p>\n )}\n <div className=\"laptop:mt-4 mt-1\">\n {data.buttonText && (\n <Button as=\"a\" variant=\"link\" className=\"!p-0 text-[#F5F6F7]\" href={data.buttonLink}>\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n <Picture source={pictureSource} className=\"absolute inset-0 z-10\" imgClassName=\"h-full object-cover\" />\n </div>\n </Container>\n </div>\n )\n})\n\nPromotionalBar.displayName = 'PromotionalBar'\nexport default PromotionalBar\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsFU,IAAAI,EAAA,6BApFVC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAoD,qCA0CpD,MAAMC,EACJC,GACuB,CACvB,GAAI,CAACA,EAAiB,OACtB,GAAI,OAAOA,GAAoB,SAAU,OAAOA,EAEhD,KAAM,CAAE,OAAAC,EAAQ,OAAAC,EAAQ,OAAAC,EAAQ,QAAAC,EAAS,UAAAC,CAAU,EAAIL,EACjDM,EAAkB,CAAC,EAGzB,OAAID,EAAWC,EAAM,KAAKD,CAAS,EAC1BD,EAASE,EAAM,KAAKF,CAAO,EAC3BD,EAAQG,EAAM,KAAKH,CAAM,EACzBD,EAAQI,EAAM,KAAKJ,CAAM,EACzBD,GAAQK,EAAM,KAAKL,CAAM,EAG9BG,GAAWC,GAAWC,EAAM,KAAK,GAAGF,CAAO,OAAO,EAClDD,IAAWC,GAAWC,IAAYC,EAAM,KAAK,GAAGH,CAAM,OAAO,EAC7DD,IAAWC,GAAUC,GAAWC,IAAYC,EAAM,KAAK,GAAGJ,CAAM,OAAO,EACvED,IAAWC,GAAUC,GAAUC,GAAWC,IAAYC,EAAM,KAAK,GAAGL,CAAM,MAAM,EAE7EK,EAAM,OAAS,EAAIA,EAAM,KAAK,IAAI,EAAI,MAC/C,EAOMC,EAAiBX,EAAM,WAAgD,CAAC,CAAE,UAAAY,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAAQ,CACnH,KAAM,CAAE,gBAAAX,CAAgB,EAAIS,EACtBG,EAAgBhB,EAAM,QAAQ,IAC3BG,EAA+BC,CAAe,EACpD,CAACA,CAAe,CAAC,EACpB,SACE,OAAC,OAAI,IAAKW,EAAK,aAAW,MAAG,SAAUH,CAAS,EAAI,GAAGE,EAErD,mBAAC,aAAU,UAAU,kDACnB,oBAAC,OAAI,UAAU,sEACb,qBAAC,OAAI,UAAU,2JACZ,UAAAD,EAAK,iBACJ,OAAC,WAAQ,UAAU,iBAAiB,KAAM,EACvC,SAAAA,EAAK,aACR,EAEDA,EAAK,gBACJ,OAAC,KAAE,UAAU,mHACV,SAAAA,EAAK,YACR,KAEF,OAAC,OAAI,UAAU,mBACZ,SAAAA,EAAK,eACJ,OAAC,UAAO,GAAG,IAAI,QAAQ,OAAO,UAAU,sBAAsB,KAAMA,EAAK,WACtE,SAAAA,EAAK,WACR,EAEJ,GACF,KACA,OAAC,WAAQ,OAAQG,EAAe,UAAU,wBAAwB,aAAa,sBAAsB,GACvG,EACF,EACF,CAEJ,CAAC,EAEDL,EAAe,YAAc,iBAC7B,IAAOd,EAAQc",
6
- "names": ["PromotionalBar_exports", "__export", "PromotionalBar_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "convertResponsiveImageToString", "backgroundImage", "mobile", "tablet", "laptop", "desktop", "lgDesktop", "parts", "PromotionalBar", "className", "data", "props", "ref", "pictureSource"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Heading, Button, Picture, Container } 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-box 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 relative z-20 flex h-full flex-col p-4',\n classNames?.content\n )}\n >\n {data.contentTitle && (\n <Heading className={cn('text-[#F5F6F7]', classNames?.title)} html={data.contentTitle} size={3} />\n )}\n {data.contentDesc && (\n <p\n className={cn(\n 'laptop:text-[16px] laptop:line-clamp-2 lg-desktop:text-[18px] 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-1\">\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 >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n <Picture source={pictureSource} className=\"absolute inset-0 z-10\" imgClassName=\"h-full object-cover\" />\n </div>\n </div>\n )\n})\n\nPromotionalBar.displayName = 'PromotionalBar'\nexport default withLayout(PromotionalBar)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwGQ,IAAAI,EAAA,6BAtGRC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAoD,qCACpDC,EAA2B,kCAoD3B,MAAMC,EAAkCC,GAA+E,CACrH,GAAI,CAACA,EAAiB,OAEtB,KAAM,CAAE,OAAAC,EAAQ,OAAAC,EAAQ,OAA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MACT,mHACAD,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,WAEV,SAAAA,EAAK,WACR,EAEJ,GACF,KACA,OAAC,WAAQ,OAAQE,EAAe,UAAU,wBAAwB,aAAa,sBAAsB,GACvG,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
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.create;var r=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var v=(t,o)=>{for(var i in o)r(t,i,{get:o[i],enumerable:!0})},d=(t,o,i,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of f(o))!k.call(t,l)&&l!==i&&r(t,l,{get:()=>o[l],enumerable:!(c=b(o,l))||c.enumerable});return t};var y=(t,o,i)=>(i=t!=null?u(g(t)):{},d(o||!t||!t.__esModule?r(i,"default",{value:t,enumerable:!0}):i,t)),D=t=>d(r({},"__esModule",{value:!0}),t);var E={};v(E,{AutoActiveStatus:()=>x,Default:()=>j,SingleEvent:()=>_,ThreeEvents:()=>S,ThreeEventsWithoutTimeline:()=>C,WithoutTimeline:()=>M,default:()=>L});module.exports=D(E);var e=require("react/jsx-runtime"),T=require("react"),m=y(require("../biz-components/EventSchedule/index.js"));const s=()=>(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)("path",{d:"M15.833 3.333h-11.666c-.92 0-1.667.746-1.667 1.667v11.667c0 .92.746 1.666 1.667 1.666h11.666c.92 0 1.667-.746 1.667-1.666V5c0-.921-.746-1.667-1.667-1.667z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M13.333 1.667V5M6.667 1.667V5M2.5 8.333h15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),a=()=>(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)("path",{d:"M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M10 5v5l3.333 1.667",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),n=()=>(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)("path",{d:"M16.667 10v6.667c0 .442-.176.866-.489 1.179-.313.312-.737.488-1.178.488H5c-.442 0-.866-.176-1.179-.488A1.667 1.667 0 013.333 16.667V10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M18.333 5.833v4.167H1.667V5.833c0-.442.175-.866.488-1.178.313-.313.737-.489 1.179-.489h13.333c.441 0 .865.176 1.178.489.313.312.489.736.489 1.178zM10 18.333V4.167",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M10 4.167H6.25A2.083 2.083 0 014.167 2.083c0-1.15.933-2.083 2.083-2.083C8.333 0 10 4.167 10 4.167zM10 4.167h3.75a2.083 2.083 0 002.083-2.084c0-1.15-.933-2.083-2.083-2.083C11.667 0 10 4.167 10 4.167z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),p={scheduleList:[{title:"\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229",startDate:"2024-12-01",endDate:"2024-12-15",items:[{icon:(0,e.jsx)(s,{}),label:"12\u67081\u65E5 - 12\u670815\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6"},{icon:(0,e.jsx)(n,{}),label:"\u8D2D\u4E70\u5373\u9001\u7CBE\u7F8E\u793C\u54C1"}]},{title:"\u5723\u8BDE\u7279\u60E0\u6D3B\u52A8",startDate:"2024-12-16",endDate:"2024-12-31",items:[{icon:(0,e.jsx)(s,{}),label:"12\u670816\u65E5 - 12\u670831\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u5168\u5929\u5019\u4F18\u60E0"},{icon:(0,e.jsx)(n,{}),label:"\u6EE1\u989D\u8D60\u9001\u5723\u8BDE\u793C\u76D2"}]}],backgroundImage:{active:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1.jpg?v=1766391000",laptop:"https://example.com/laptop.jpg",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_c4d0ec1e-5484-46be-af8c-273935f4ba28.jpg?v=1766398957",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_44d92293-1f4b-483a-8233-6277b0437e7c.jpg?v=1766391004"},inactive:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2.jpg?v=1766390999",laptop:"https://example.com/laptop.jpg",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_99fd4944-58ee-4c90-9b0d-b758926386fe.jpg?v=1766398957",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_844d5e75-a3d2-4f2b-b1a6-cad60c67c871.jpg?v=1766391005"}}},h={scheduleList:[{title:"\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8",startDate:"2024-12-01",endDate:"2024-12-10",items:[{icon:(0,e.jsx)(s,{}),label:"12\u67081\u65E5 - 12\u670810\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2"},{icon:(0,e.jsx)(n,{}),label:"\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269"}]},{title:"\u5723\u8BDE\u72C2\u6B22",startDate:"2024-12-11",endDate:"2024-12-25",items:[{icon:(0,e.jsx)(s,{}),label:"12\u670811\u65E5 - 12\u670825\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD"},{icon:(0,e.jsx)(n,{}),label:"\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500"}]},{title:"\u8DE8\u5E74\u7279\u60E0",startDate:"2024-12-26",endDate:"2025-01-01",items:[{icon:(0,e.jsx)(s,{}),label:"12\u670826\u65E5 - 1\u67081\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u5012\u8BA1\u65F6\u7279\u60E0"},{icon:(0,e.jsx)(n,{}),label:"\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D"}]}]},w={title:"Biz Components/EventSchedule",component:m.default,parameters:{layout:"fullscreen",docs:{description:{component:"\u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6 - \u5C55\u793A\u6D3B\u52A8\u65F6\u95F4\u8F74\u548C\u8BE6\u7EC6\u4FE1\u606F\u5361\u7247\uFF0C\u652F\u6301\u591A\u4E2A\u6D3B\u52A8\u540C\u65F6\u5C55\u793A\uFF0C\u5E26\u6709\u6FC0\u6D3B\u72B6\u6001\u6307\u793A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u65E5\u7A0B\u5217\u8868",control:{type:"object"}},"data.showTimeline":{description:"\u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true",control:{type:"boolean"},table:{defaultValue:{summary:"true"},type:{summary:"boolean"}}},className:{description:"\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D",control:{type:"text"}}}};var L=w;const j={args:{data:p}},S={args:{data:h}},_={args:{data:{scheduleList:[{title:"\u9650\u65F6\u79D2\u6740\u6D3B\u52A8",startDate:"2025-12-23",endDate:"2025-12-23",items:[{icon:(0,e.jsx)(s,{}),label:"12\u67081\u65E5\u5168\u5929"},{icon:(0,e.jsx)(a,{}),label:"\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2"},{icon:(0,e.jsx)(n,{}),label:"\u79D2\u6740\u4EF7\u4F4E\u81F33\u6298"}]}]}}},x={args:{data:{scheduleList:[{title:"\u5DF2\u7ED3\u675F\u7684\u6D3B\u52A8",startDate:"2024-01-01",endDate:"2024-01-31",items:[{icon:(0,e.jsx)(s,{}),label:"1\u67081\u65E5 - 1\u670831\u65E5"},{icon:(0,e.jsx)(a,{}),label:"\u5DF2\u7ED3\u675F"},{icon:(0,e.jsx)(n,{}),label:"\u611F\u8C22\u53C2\u4E0E"}]},{title:"\u8FDB\u884C\u4E2D\u7684\u6D3B\u52A8",startDate:"2025-01-01",endDate:"2025-12-31",items:[{icon:(0,e.jsx)(s,{}),label:"2025\u5E74\u5168\u5E74"},{icon:(0,e.jsx)(a,{}),label:"\u6B63\u5728\u8FDB\u884C\u4E2D"},{icon:(0,e.jsx)(n,{}),label:"\u9650\u65F6\u4F18\u60E0"}]},{title:"\u5373\u5C06\u5F00\u59CB\u7684\u6D3B\u52A8",startDate:"2026-01-01",endDate:"2026-12-31",items:[{icon:(0,e.jsx)(s,{}),label:"2026\u5E74\u5F00\u59CB"},{icon:(0,e.jsx)(a,{}),label:"\u656C\u8BF7\u671F\u5F85"},{icon:(0,e.jsx)(n,{}),label:"\u8D85\u503C\u798F\u5229"}]}]}}},M={args:{data:{...p,showTimeline:!1}}},C={args:{data:{...h,showTimeline:!1}}};
1
+ "use strict";var m=Object.create;var s=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var b=(e,a)=>{for(var o in a)s(e,o,{get:a[o],enumerable:!0})},p=(e,a,o,i)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of h(a))!g.call(e,l)&&l!==o&&s(e,l,{get:()=>a[l],enumerable:!(i=d(a,l))||i.enumerable});return e};var v=(e,a,o)=>(o=e!=null?m(u(e)):{},p(a||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e)),f=e=>p(s({},"__esModule",{value:!0}),e);var S={};b(S,{AutoActiveStatus:()=>x,Default:()=>j,SingleEvent:()=>L,ThreeEvents:()=>D,ThreeEventsWithoutTimeline:()=>E,WithoutTimeline:()=>w,default:()=>k});module.exports=f(S);var t=require("react/jsx-runtime"),_=require("react"),c=v(require("../biz-components/EventSchedule/index.js"));const C=()=>(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M15.833 3.333h-11.666c-.92 0-1.667.746-1.667 1.667v11.667c0 .92.746 1.666 1.667 1.666h11.666c.92 0 1.667-.746 1.667-1.666V5c0-.921-.746-1.667-1.667-1.667z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M13.333 1.667V5M6.667 1.667V5M2.5 8.333h15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),R=()=>(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M10 5v5l3.333 1.667",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),W=()=>(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M16.667 10v6.667c0 .442-.176.866-.489 1.179-.313.312-.737.488-1.178.488H5c-.442 0-.866-.176-1.179-.488A1.667 1.667 0 013.333 16.667V10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M18.333 5.833v4.167H1.667V5.833c0-.442.175-.866.488-1.178.313-.313.737-.489 1.179-.489h13.333c.441 0 .865.176 1.178.489.313.312.489.736.489 1.178zM10 18.333V4.167",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M10 4.167H6.25A2.083 2.083 0 014.167 2.083c0-1.15.933-2.083 2.083-2.083C8.333 0 10 4.167 10 4.167zM10 4.167h3.75a2.083 2.083 0 002.083-2.084c0-1.15-.933-2.083-2.083-2.083C11.667 0 10 4.167 10 4.167z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),n={scheduleList:[{title:"\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229",startDate:"2024-12-01",endDate:"2024-12-15",items:[{label:"12\u67081\u65E5 - 12\u670815\u65E5"},{label:"\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6"},{label:"\u8D2D\u4E70\u5373\u9001\u7CBE\u7F8E\u793C\u54C1"}]},{title:"\u5723\u8BDE\u7279\u60E0\u6D3B\u52A8",startDate:"2024-12-16",endDate:"2024-12-31",items:[{label:"12\u670816\u65E5 - 12\u670831\u65E5"},{label:"\u5168\u5929\u5019\u4F18\u60E0"},{label:"\u6EE1\u989D\u8D60\u9001\u5723\u8BDE\u793C\u76D2"}]}],backgroundImage:{active:{mobile:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1.jpg?v=1766391000",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},laptop:{url:"https://example.com/laptop.jpg",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},desktop:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_c4d0ec1e-5484-46be-af8c-273935f4ba28.jpg?v=1766398957",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},lgDesktop:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_44d92293-1f4b-483a-8233-6277b0437e7c.jpg?v=1766391004",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"}},inactive:{mobile:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2.jpg?v=1766390999",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},laptop:{url:"https://example.com/laptop.jpg",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},desktop:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_99fd4944-58ee-4c90-9b0d-b758926386fe.jpg?v=1766398957",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"},lgDesktop:{url:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_844d5e75-a3d2-4f2b-b1a6-cad60c67c871.jpg?v=1766391005",alt:"Event schedule image",thumbnailURL:"https://example.com/laptop.jpg",mimeType:"image/jpeg"}}}},r={scheduleList:[{title:"\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8",startDate:"2024-12-01",endDate:"2024-12-10",items:[{label:"12\u67081\u65E5 - 12\u670810\u65E5"},{label:"\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2"},{label:"\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269"}]},{title:"\u5723\u8BDE\u72C2\u6B22",startDate:"2024-12-11",endDate:"2024-12-25",items:[{label:"12\u670811\u65E5 - 12\u670825\u65E5"},{label:"\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD"},{label:"\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500"}]},{title:"\u8DE8\u5E74\u7279\u60E0",startDate:"2024-12-26",endDate:"2025-01-01",items:[{label:"12\u670826\u65E5 - 1\u67081\u65E5"},{label:"\u5012\u8BA1\u65F6\u7279\u60E0"},{label:"\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D"}]}]},y={title:"Biz Components/EventSchedule",component:c.default,parameters:{layout:"fullscreen",docs:{description:{component:"\u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6 - \u5C55\u793A\u6D3B\u52A8\u65F6\u95F4\u8F74\u548C\u8BE6\u7EC6\u4FE1\u606F\u5361\u7247\uFF0C\u652F\u6301\u591A\u4E2A\u6D3B\u52A8\u540C\u65F6\u5C55\u793A\uFF0C\u5E26\u6709\u6FC0\u6D3B\u72B6\u6001\u6307\u793A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u65E5\u7A0B\u5217\u8868",control:{type:"object"}},"data.showTimeline":{description:"\u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true",control:{type:"boolean"},table:{defaultValue:{summary:"true"},type:{summary:"boolean"}}},className:{description:"\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D",control:{type:"text"}}}};var k=y;const j={args:{data:n}},D={args:{data:r}},L={args:{data:{scheduleList:[{title:"\u9650\u65F6\u79D2\u6740\u6D3B\u52A8",startDate:"2025-12-23",endDate:"2025-12-23",items:[{label:"12\u67081\u65E5\u5168\u5929"},{label:"\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2"},{label:"\u79D2\u6740\u4EF7\u4F4E\u81F33\u6298"}]}]}}},x={args:{data:{scheduleList:[{title:"\u5DF2\u7ED3\u675F\u7684\u6D3B\u52A8",startDate:"2024-01-01",endDate:"2024-01-31",items:[{label:"1\u67081\u65E5 - 1\u670831\u65E5"},{label:"\u5DF2\u7ED3\u675F"},{label:"\u611F\u8C22\u53C2\u4E0E"}]},{title:"\u8FDB\u884C\u4E2D\u7684\u6D3B\u52A8",startDate:"2025-01-01",endDate:"2025-12-31",items:[{label:"2025\u5E74\u5168\u5E74"},{label:"\u6B63\u5728\u8FDB\u884C\u4E2D"},{label:"\u9650\u65F6\u4F18\u60E0"}]},{title:"\u5373\u5C06\u5F00\u59CB\u7684\u6D3B\u52A8",startDate:"2026-01-01",endDate:"2026-12-31",items:[{label:"2026\u5E74\u5F00\u59CB"},{label:"\u656C\u8BF7\u671F\u5F85"},{label:"\u8D85\u503C\u798F\u5229"}]}]}}},w={args:{data:{...n,showTimeline:!1}}},E={args:{data:{...r,showTimeline:!1}}};
2
2
  //# sourceMappingURL=eventSchedule.stories.js.map