@anker-in/headless-ui 1.1.17-alpha.1766385794881 → 1.1.17-alpha.1766488449220

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 (43) hide show
  1. package/dist/cjs/biz-components/EventSchedule/index.d.ts +73 -6
  2. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  3. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  4. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +17 -7
  5. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  6. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  7. package/dist/cjs/biz-components/Title/Countdown.d.ts +11 -0
  8. package/dist/cjs/biz-components/Title/Countdown.js +2 -0
  9. package/dist/cjs/biz-components/Title/Countdown.js.map +7 -0
  10. package/dist/cjs/biz-components/Title/index.js +1 -1
  11. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  12. package/dist/cjs/biz-components/Title/types.d.ts +50 -0
  13. package/dist/cjs/biz-components/Title/types.js +1 -1
  14. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  15. package/dist/cjs/stories/anchorNavigation.stories.js +1 -1
  16. package/dist/cjs/stories/anchorNavigation.stories.js.map +2 -2
  17. package/dist/cjs/stories/eventSchedule.stories.js +1 -1
  18. package/dist/cjs/stories/eventSchedule.stories.js.map +3 -3
  19. package/dist/cjs/stories/promotionalBar.stories.js +1 -1
  20. package/dist/cjs/stories/promotionalBar.stories.js.map +3 -3
  21. package/dist/cjs/stories/title.stories.js +2 -0
  22. package/dist/cjs/stories/title.stories.js.map +7 -0
  23. package/dist/esm/biz-components/EventSchedule/index.d.ts +73 -6
  24. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  25. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  26. package/dist/esm/biz-components/PromotionalBar/index.d.ts +17 -7
  27. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  28. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  29. package/dist/esm/biz-components/Title/Countdown.d.ts +11 -0
  30. package/dist/esm/biz-components/Title/Countdown.js +2 -0
  31. package/dist/esm/biz-components/Title/Countdown.js.map +7 -0
  32. package/dist/esm/biz-components/Title/index.js +1 -1
  33. package/dist/esm/biz-components/Title/index.js.map +3 -3
  34. package/dist/esm/biz-components/Title/types.d.ts +50 -0
  35. package/dist/esm/stories/anchorNavigation.stories.js +1 -1
  36. package/dist/esm/stories/anchorNavigation.stories.js.map +2 -2
  37. package/dist/esm/stories/eventSchedule.stories.js +1 -1
  38. package/dist/esm/stories/eventSchedule.stories.js.map +3 -3
  39. package/dist/esm/stories/promotionalBar.stories.js +1 -1
  40. package/dist/esm/stories/promotionalBar.stories.js.map +3 -3
  41. package/dist/esm/stories/title.stories.js +2 -0
  42. package/dist/esm/stories/title.stories.js.map +7 -0
  43. package/package.json +1 -1
@@ -1,16 +1,37 @@
1
1
  import * as React from 'react';
2
+ export type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard';
3
+ /**
4
+ * 响应式背景图片配置
5
+ */
6
+ export interface ResponsiveBackgroundImage {
7
+ /** 移动端图片 (<1024px) */
8
+ mobile?: string;
9
+ /** 笔记本图片 (1025-1440px) */
10
+ laptop?: string;
11
+ /** 桌面图片 (1441-1920px) */
12
+ desktop?: string;
13
+ /** 超大桌面图片 (≥1921px) */
14
+ lgDesktop?: string;
15
+ }
16
+ /**
17
+ * 状态化背景图片配置
18
+ */
19
+ export interface StateBackgroundImage {
20
+ /** 激活状态的背景图片 */
21
+ active: string | ResponsiveBackgroundImage;
22
+ /** 非激活状态的背景图片 */
23
+ inactive: string | ResponsiveBackgroundImage;
24
+ }
2
25
  /**
3
26
  * 活动日程项数据接口
4
27
  */
5
28
  export interface EventScheduleItem {
6
29
  /** 标题 */
7
30
  title: string;
8
- /** 日期 */
9
- date: string;
10
- /** 是否激活状态 */
11
- active: boolean;
12
- /** 背景图片 URL */
13
- backgroundImage?: string;
31
+ /** 开始日期(ISO 8601 格式或任何 dayjs 支持的格式,如 '2024-12-01') */
32
+ startDate: string;
33
+ /** 结束日期(ISO 8601 格式或任何 dayjs 支持的格式,如 '2024-12-31') */
34
+ endDate: string;
14
35
  /** 详细信息列表 */
15
36
  items: {
16
37
  /** 图标 (SVG 字符串或 URL) */
@@ -25,10 +46,56 @@ export interface EventScheduleItem {
25
46
  export interface EventScheduleData {
26
47
  /** 日程列表 */
27
48
  scheduleList: EventScheduleItem[];
49
+ /**
50
+ * 背景图片配置,支持响应式图片和状态化图片
51
+ * 可以传入:
52
+ * 1. 字符串(单一图片URL)
53
+ * 2. ResponsiveBackgroundImage(多尺寸图片)
54
+ * 3. StateBackgroundImage(激活/非激活状态图片)
55
+ *
56
+ * @example
57
+ * // 单一图片
58
+ * backgroundImage: "https://example.com/image.jpg"
59
+ *
60
+ * @example
61
+ * // 响应式图片
62
+ * 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"
74
+ * }
75
+ *
76
+ * @example
77
+ * // 状态化 + 响应式图片
78
+ * backgroundImage: {
79
+ * 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"
84
+ * },
85
+ * 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"
90
+ * }
91
+ * }
92
+ */
93
+ backgroundImage?: string | ResponsiveBackgroundImage | StateBackgroundImage;
28
94
  }
29
95
  export interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {
30
96
  /** 业务数据 */
31
97
  data: EventScheduleData;
98
+ classNames?: Partial<Record<EventScheduleSemanticName, string>>;
32
99
  }
33
100
  /**
34
101
  * EventSchedule - 活动日程组件
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var v=Object.create;var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var E=(e,l)=>{for(var a in l)n(e,a,{get:l[a],enumerable:!0})},o=(e,l,a,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of u(l))!x.call(e,s)&&s!==a&&n(e,s,{get:()=>l[s],enumerable:!(r=p(l,s))||r.enumerable});return e};var h=(e,l,a)=>(a=e!=null?v(f(e)):{},o(l||!e||!e.__esModule?n(a,"default",{value:e,enumerable:!0}):a,e)),b=e=>o(n({},"__esModule",{value:!0}),e);var k={};E(k,{default:()=>S});module.exports=b(k);var t=require("react/jsx-runtime"),g=h(require("react")),i=require("../../helpers/index.js"),d=require("../../components/index.js"),c=require("swiper/react");const N=({active:e})=>(0,t.jsxs)("div",{className:"relative flex h-2 flex-1 items-center justify-center",children:[(0,t.jsx)("div",{className:(0,i.cn)("h-2 w-full",{"bg-[#F6CD4E]":e,"bg-[#EAEAEC]":!e})}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:(0,i.cn)("size-4 rounded-full border-2 transition-colors",{"border-[#F6CD4E] bg-[#F6CD4E]":e,"border-[#EAEAEC] bg-[#EAEAEC]":!e})})})]}),C=({scheduleList:e})=>(0,t.jsx)("div",{className:"relative flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:"flex h-2 w-full items-center gap-4 bg-[#EAEAEC]",children:e.map(l=>(0,t.jsx)(N,{active:l.active},l.date))})}),w=({item:e})=>(0,t.jsxs)("div",{className:(0,i.cn)("rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden bg-[#F4E8BC] p-4"),children:[e.backgroundImage&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:(0,t.jsx)(d.Picture,{source:e.backgroundImage,alt:"",className:"absolute right-0 top-[9.69%] h-[91.29%] w-auto max-w-none"})}),(0,t.jsx)("div",{className:"relative z-10",children:(0,t.jsx)("h2",{className:(0,i.cn)("desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]"),children:e.title})}),(0,t.jsx)("div",{className:"relative z-10 flex flex-col gap-0.5",children:e.items.map((l,a)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[l.icon&&(0,t.jsx)("div",{className:"desktop:size-6 size-5 shrink-0",children:(0,t.jsx)(d.Picture,{source:l.icon,alt:"",className:"size-full"})}),(0,t.jsx)(d.Text,{html:l.label,className:(0,i.cn)("desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]")})]},a))})]}),m=g.forwardRef(({className:e,data:l,...a},r)=>(0,t.jsx)("div",{ref:r,className:(0,i.cn)("desktop:px-16 laptop:px-16 tablet:px-8 w-full px-4",e),...a,children:(0,t.jsx)("div",{className:"flex w-full flex-col gap-4",children:(0,t.jsx)(c.Swiper,{spaceBetween:12,slidesPerView:1,className:"w-full",children:l.scheduleList.map(s=>(0,t.jsx)(c.SwiperSlide,{children:(0,t.jsx)(w,{item:s})},s.date))})})}));m.displayName="EventSchedule";var S=m;
1
+ "use strict";"use client";var S=Object.create;var c=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var s in t)c(e,s,{get:t[s],enumerable:!0})},f=(e,t,s,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of E(t))!k.call(e,n)&&n!==s&&c(e,n,{get:()=>t[n],enumerable:!(a=B(t,n))||a.enumerable});return e};var v=(e,t,s)=>(s=e!=null?S(N(e)):{},f(t||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),I=e=>f(c({},"__esModule",{value:!0}),e);var L={};b(L,{default:()=>C});module.exports=I(L);var i=require("react/jsx-runtime"),d=v(require("react")),l=require("../../helpers/index.js"),p=require("../../components/index.js"),m=require("swiper/react"),u=v(require("dayjs"));const P=(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)},R=e=>P(e.startDate,e.endDate),V=({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})})})]}),y=e=>typeof e=="object"&&("active"in e||"inactive"in e),w=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},D=(e,t)=>{if(e){if(y(e)){const s=t?e.active:e.inactive;return w(s)}return w(e)}},A=({active:e,item:t,backgroundImage:s,className:a})=>{const n=d.useMemo(()=>D(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]);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((o,h)=>{const g=R(o);return(0,i.jsxs)(m.SwiperSlide,{children:[(0,i.jsx)(V,{active:g}),(0,i.jsx)(A,{active:g,className:"mt-4",item:o,backgroundImage:t.backgroundImage})]},"SwiperSlideItem"+h)})})})})});x.displayName="EventSchedule";var C=x;
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'\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleItem {\n /** \u6807\u9898 */\n title: string\n /** \u65E5\u671F */\n date: string\n /** \u662F\u5426\u6FC0\u6D3B\u72B6\u6001 */\n active: boolean\n /** \u80CC\u666F\u56FE\u7247 URL */\n backgroundImage?: 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\nexport interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: EventScheduleData\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ active }: { active: boolean }) => {\n return (\n <div className=\"relative flex h-2 flex-1 items-center justify-center\">\n {/* \u8FDB\u5EA6\u6761 */}\n <div\n className={cn('h-2 w-full', {\n 'bg-[#F6CD4E]': 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 * \u65F6\u95F4\u8F74\u7EC4\u4EF6\n */\nconst Timeline = ({ scheduleList }: { scheduleList: EventScheduleItem[] }) => {\n return (\n <div className=\"relative flex h-4 w-full items-center\">\n <div className=\"flex h-2 w-full items-center gap-4 bg-[#EAEAEC]\">\n {scheduleList.map(item => (\n <TimelineNode key={item.date} active={item.active} />\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({ item }: { item: EventScheduleItem }) => {\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 bg-[#F4E8BC] p-4'\n )}\n >\n {/* \u80CC\u666F\u88C5\u9970\u56FE */}\n {item.backgroundImage && (\n <div className=\"pointer-events-none absolute inset-0 overflow-hidden\">\n <Picture\n source={item.backgroundImage}\n alt=\"\"\n className=\"absolute right-0 top-[9.69%] h-[91.29%] w-auto max-w-none\"\n />\n </div>\n )}\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-10\">\n <h2 className={cn('desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]')}>{item.title}</h2>\n </div>\n\n {/* \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */}\n <div className=\"relative z-10 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 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 )\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>(({ className, data, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('desktop:px-16 laptop:px-16 tablet:px-8 w-full px-4', className)} {...props}>\n <div className=\"flex w-full flex-col gap-4\">\n {/* \u65F6\u95F4\u8F74 */}\n {/* <Timeline scheduleList={data.scheduleList} /> */}\n <Swiper spaceBetween={12} slidesPerView={1} className=\"w-full\">\n {data.scheduleList.map(item => (\n <SwiperSlide key={item.date}>\n <EventScheduleCard item={item} />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </div>\n )\n})\n\nEventSchedule.displayName = 'EventSchedule'\nexport default EventSchedule\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8CI,IAAAI,EAAA,6BA5CJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAAoC,wBAuCpC,MAAMC,EAAe,CAAC,CAAE,OAAAC,CAAO,OAE3B,QAAC,OAAI,UAAU,uDAEb,oBAAC,OACC,aAAW,MAAG,aAAc,CAC1B,eAAgBA,EAChB,eAAgB,CAACA,CACnB,CAAC,EACH,KAEA,OAAC,OAAI,UAAU,oDACb,mBAAC,OACC,aAAW,MAAG,iDAAkD,CAC9D,gCAAiCA,EACjC,gCAAiC,CAACA,CACpC,CAAC,EACH,EACF,GACF,EAOEC,EAAW,CAAC,CAAE,aAAAC,CAAa,OAE7B,OAAC,OAAI,UAAU,wCACb,mBAAC,OAAI,UAAU,kDACZ,SAAAA,EAAa,IAAIC,MAChB,OAACJ,EAAA,CAA6B,OAAQI,EAAK,QAAxBA,EAAK,IAA2B,CACpD,EACH,EACF,EAOEC,EAAoB,CAAC,CAAE,KAAAD,CAAK,OAE9B,QAAC,OACC,aAAW,MACT,qIACF,EAGC,UAAAA,EAAK,oBACJ,OAAC,OAAI,UAAU,uDACb,mBAAC,WACC,OAAQA,EAAK,gBACb,IAAI,GACJ,UAAU,4DACZ,EACF,KAIF,OAAC,OAAI,UAAU,gBACb,mBAAC,MAAG,aAAW,MAAG,wEAAwE,EAAI,SAAAA,EAAK,MAAM,EAC3G,KAGA,OAAC,OAAI,UAAU,sCACZ,SAAAA,EAAK,MAAM,IAAI,CAACE,EAAQC,OACvB,QAAC,OAAgB,UAAU,0BAExB,UAAAD,EAAO,SACN,OAAC,OAAI,UAAU,iCACb,mBAAC,WAAQ,OAAQA,EAAO,KAAgB,IAAI,GAAG,UAAU,YAAY,EACvE,KAGF,OAAC,QACC,KAAMA,EAAO,MACb,aAAW,MAAG,+EAA+E,EAC/F,IAXQC,CAYV,CACD,EACH,GACF,EASEC,EAAgBZ,EAAM,WAA+C,CAAC,CAAE,UAAAa,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,OAEvG,OAAC,OAAI,IAAKA,EAAK,aAAW,MAAG,qDAAsDH,CAAS,EAAI,GAAGE,EACjG,mBAAC,OAAI,UAAU,6BAGb,mBAAC,UAAO,aAAc,GAAI,cAAe,EAAG,UAAU,SACnD,SAAAD,EAAK,aAAa,IAAIN,MACrB,OAAC,eACC,mBAACC,EAAA,CAAkB,KAAMD,EAAM,GADfA,EAAK,IAEvB,CACD,EACH,EACF,EACF,CAEH,EAEDI,EAAc,YAAc,gBAC5B,IAAOf,EAAQe",
6
- "names": ["EventSchedule_exports", "__export", "EventSchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_react", "TimelineNode", "active", "Timeline", "scheduleList", "item", "EventScheduleCard", "detail", "index", "EventSchedule", "className", "data", "props", "ref"]
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}\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 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 <TimelineNode active={isActive} />\n <EventScheduleCard\n active={isActive}\n className=\"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,GA4II,IAAAI,EAAA,6BA1IJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAAoC,wBACpCC,EAAkB,oBAgHlB,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,EAAI,SAAS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ACA,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,EAEhB,SACE,OAAC,OACC,IAAKD,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,eAEC,oBAACC,EAAA,CAAa,OAAQa,EAAU,KAChC,OAACE,EAAA,CACC,OAAQF,EACR,UAAU,OACV,KAAMd,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"]
7
7
  }
@@ -1,5 +1,19 @@
1
1
  import * as React from 'react';
2
- import type { Media } from '../../types/props.js';
2
+ /**
3
+ * 响应式背景图片配置
4
+ */
5
+ export interface ResponsiveBackgroundImage {
6
+ /** 移动端图片 (<768px) */
7
+ mobile?: string;
8
+ /** 平板图片 (768-1440px) */
9
+ tablet?: string;
10
+ /** 笔记本图片 (1025-1440px) */
11
+ laptop?: string;
12
+ /** 桌面图片 (1441-1920px) */
13
+ desktop?: string;
14
+ /** 超大桌面图片 (≥1921px) */
15
+ lgDesktop?: string;
16
+ }
3
17
  /**
4
18
  * PromotionalBar 业务组件数据接口
5
19
  */
@@ -15,12 +29,8 @@ export interface PromotionalBarData {
15
29
  buttonText?: string;
16
30
  /** 按钮链接 */
17
31
  buttonLink?: string;
18
- /** 背景图片 */
19
- bgImage1919?: Media;
20
- bgImage1439?: Media;
21
- bgImage1023?: Media;
22
- bgImage767?: Media;
23
- bgImage390?: Media;
32
+ /** 背景图片 - 支持字符串或响应式图片对象 */
33
+ backgroundImage?: string | ResponsiveBackgroundImage;
24
34
  }
25
35
  export interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {
26
36
  /** 业务数据 */
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var f=Object.create;var i=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},u=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of N(t))!M.call(e,l)&&l!==a&&i(e,l,{get:()=>t[l],enumerable:!(n=v(t,l))||n.enumerable});return e};var P=(e,t,a)=>(a=e!=null?f(I(e)):{},u(t||!e||!e.__esModule?i(a,"default",{value:e,enumerable:!0}):a,e)),T=e=>u(i({},"__esModule",{value:!0}),e);var B={};F(B,{default:()=>h});module.exports=T(B);var o=require("react/jsx-runtime"),g=P(require("react")),d=require("../../helpers/index.js"),r=require("../../components/index.js");const x=g.forwardRef(({className:e,data:t,...a},n)=>{const{bgImage1919:l,bgImage1439:s,bgImage1023:p,bgImage767:m,bgImage390:c}=t,b=g.useMemo(()=>`${l?.url}, ${s?.url} 1919, ${p?.url} 1439, ${m?.url} 1023, ${c?.url} 767`,[l?.url,s?.url,p?.url,m?.url,c?.url]);return(0,o.jsx)("div",{ref:n,className:(0,d.cn)("w-full",e),...a,children:(0,o.jsx)(r.Container,{className:"laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",children:(0,o.jsxs)("div",{className:"promotional-bar-content rounded-box relative h-full overflow-hidden",children:[(0,o.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,o.jsx)(r.Heading,{className:"text-[#F5F6F7]",size:3,children:t.contentTitle}),t.contentDesc&&(0,o.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,o.jsx)("div",{className:"laptop:mt-4 mt-1",children:t.buttonText&&(0,o.jsx)(r.Button,{as:"a",variant:"link",className:"!p-0 text-[#F5F6F7]",href:t.buttonLink,children:t.buttonText})})]}),(0,o.jsx)(r.Picture,{source:b,className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"})]})})})});x.displayName="PromotionalBar";var h=x;
1
+ "use strict";"use client";var g=Object.create;var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)a(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&&a(e,n,{get:()=>t[n],enumerable:!(s=d(t,n))||s.enumerable});return e};var k=(e,t,o)=>(o=e!=null?g(v(e)):{},c(t||!e||!e.__esModule?a(o,"default",{value:e,enumerable:!0}):o,e)),B=e=>c(a({},"__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"),p=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:l}=e,i=[];return l?i.push(l):n?i.push(n):s?i.push(s):o?i.push(o):t&&i.push(t),n&&l&&i.push(`${n} 1920`),s&&(n||l)&&i.push(`${s} 1440`),o&&(s||n||l)&&i.push(`${o} 1024`),t&&(o||s||n||l)&&i.push(`${t} 768`),i.length>0?i.join(", "):void 0},m=u.forwardRef(({className:e,data:t,...o},s)=>{const{backgroundImage:n}=t,l=u.useMemo(()=>N(n),[n]);return(0,r.jsx)("div",{ref:s,className:(0,f.cn)("w-full",e),...o,children:(0,r.jsx)(p.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)(p.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)(p.Button,{as:"a",variant:"link",className:"!p-0 text-[#F5F6F7]",href:t.buttonLink,children:t.buttonText})})]}),(0,r.jsx)(p.Picture,{source:l,className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"})]})})})});m.displayName="PromotionalBar";var T=m;
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'\nimport type { Media } from '../../types/props.js'\n\n/**\n * PromotionalBar \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface PromotionalBarData {\n title?: string\n /** \u7EC4\u4EF6\u6807\u9898 */\n subtitle?: string\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 */\n bgImage1919?: Media\n bgImage1439?: Media\n bgImage1023?: Media\n bgImage767?: Media\n bgImage390?: Media\n}\n\nexport interface PromotionalBarProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: PromotionalBarData\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 { bgImage1919, bgImage1439, bgImage1023, bgImage767, bgImage390 } = data\n const pictureSource = React.useMemo(() => {\n return `${bgImage1919?.url}, ${bgImage1439?.url} 1919, ${bgImage1023?.url} 1439, ${bgImage767?.url} 1023, ${bgImage390?.url} 767`\n }, [bgImage1919?.url, bgImage1439?.url, bgImage1023?.url, bgImage767?.url, bgImage390?.url])\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,GAkDU,IAAAI,EAAA,6BAhDVC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAoD,qCAoCpD,MAAMC,EAAiBH,EAAM,WAAgD,CAAC,CAAE,UAAAI,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAAQ,CACnH,KAAM,CAAE,YAAAC,EAAa,YAAAC,EAAa,YAAAC,EAAa,WAAAC,EAAY,WAAAC,CAAW,EAAIP,EACpEQ,EAAgBb,EAAM,QAAQ,IAC3B,GAAGQ,GAAa,GAAG,KAAKC,GAAa,GAAG,UAAUC,GAAa,GAAG,UAAUC,GAAY,GAAG,UAAUC,GAAY,GAAG,OAC1H,CAACJ,GAAa,IAAKC,GAAa,IAAKC,GAAa,IAAKC,GAAY,IAAKC,GAAY,GAAG,CAAC,EAC3F,SACE,OAAC,OAAI,IAAKL,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,OAAQQ,EAAe,UAAU,wBAAwB,aAAa,sBAAsB,GACvG,EACF,EACF,CAEJ,CAAC,EAEDV,EAAe,YAAc,iBAC7B,IAAON,EAAQM",
6
- "names": ["PromotionalBar_exports", "__export", "PromotionalBar_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "PromotionalBar", "className", "data", "props", "ref", "bgImage1919", "bgImage1439", "bgImage1023", "bgImage767", "bgImage390", "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'\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 title?: string\n /** \u7EC4\u4EF6\u6807\u9898 */\n subtitle?: string\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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,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"]
7
7
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { CountdownConfig } from './types.js';
3
+ interface CountdownProps {
4
+ config: CountdownConfig;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Countdown - 倒计时组件
9
+ */
10
+ declare const Countdown: React.ForwardRefExoticComponent<CountdownProps & React.RefAttributes<HTMLDivElement>>;
11
+ export default Countdown;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var L=Object.create;var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},h=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of M(t))!T.call(e,a)&&a!==n&&f(e,a,{get:()=>t[a],enumerable:!(s=N(t,a))||s.enumerable});return e};var b=(e,t,n)=>(n=e!=null?L(S(e)):{},h(t||!e||!e.__esModule?f(n,"default",{value:e,enumerable:!0}):n,e)),H=e=>h(f({},"__esModule",{value:!0}),e);var E={};D(E,{default:()=>z});module.exports=H(E);var o=require("react/jsx-runtime"),r=b(require("react")),x=b(require("dayjs")),v=require("../../helpers/utils.js");const y=e=>{const t=(0,x.default)(),s=(0,x.default)(e).diff(t,"second");if(s<=0)return{days:0,hours:0,minutes:0,seconds:0};const a=Math.floor(s/(24*60*60)),m=Math.floor(s%(24*60*60)/(60*60)),p=Math.floor(s%(60*60)/60),g=s%60;return{days:a,hours:m,minutes:p,seconds:g}},R=({value:e,label:t})=>(0,o.jsxs)("div",{className:"lg-desktop:size-12 bg-info-primary lg-desktop:px-1 flex size-10 flex-col items-center justify-center px-[2px] text-center text-white",children:[(0,o.jsx)("p",{className:"lg-desktop:text-2xl text-[20px] font-bold leading-[1.2] tracking-[-0.96px]",children:String(e).padStart(2,"0")}),(0,o.jsx)("p",{className:"text-[12px] font-bold leading-[1.4] tracking-[-0.24px]",children:t})]}),j=()=>(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:":"}),w=r.default.forwardRef(({config:e,className:t},n)=>{const{targetDate:s,showDays:a=!0,showHours:m=!0,showMinutes:p=!0,showSeconds:g=!0,labels:u={}}=e,[c,C]=(0,r.useState)(()=>y(s));(0,r.useEffect)(()=>{const i=setInterval(()=>{C(y(s))},1e3);return()=>clearInterval(i)},[s]);const d={days:u.days||"Day",hours:u.hours||"Hours",minutes:u.minutes||"Mins",seconds:u.seconds||"Secs"},l=[];return a&&l.push({value:c.days,label:d.days}),m&&l.push({value:c.hours,label:d.hours}),p&&l.push({value:c.minutes,label:d.minutes}),g&&l.push({value:c.seconds,label:d.seconds}),(0,o.jsx)("div",{ref:n,className:(0,v.cn)("flex items-center gap-1",t),children:l.map((i,k)=>(0,o.jsxs)(r.default.Fragment,{children:[(0,o.jsx)(R,{value:i.value,label:i.label}),k<l.length-1&&(0,o.jsx)(j,{})]},i.label))})});w.displayName="Countdown";var z=w;
2
+ //# sourceMappingURL=Countdown.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/Title/Countdown.tsx"],
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect } from 'react'\nimport dayjs from 'dayjs'\nimport { cn } from '../../helpers/utils.js'\nimport type { CountdownConfig } from './types.js'\n\ninterface CountdownProps {\n config: CountdownConfig\n className?: string\n}\n\ninterface TimeLeft {\n days: number\n hours: number\n minutes: number\n seconds: number\n}\n\n/**\n * \u8BA1\u7B97\u5269\u4F59\u65F6\u95F4\n */\nconst calculateTimeLeft = (targetDate: string): TimeLeft => {\n const now = dayjs()\n const target = dayjs(targetDate)\n const diff = target.diff(now, 'second')\n\n if (diff <= 0) {\n return { days: 0, hours: 0, minutes: 0, seconds: 0 }\n }\n\n const days = Math.floor(diff / (24 * 60 * 60))\n const hours = Math.floor((diff % (24 * 60 * 60)) / (60 * 60))\n const minutes = Math.floor((diff % (60 * 60)) / 60)\n const seconds = diff % 60\n\n return { days, hours, minutes, seconds }\n}\n\n/**\n * \u5012\u8BA1\u65F6\u6570\u5B57\u5757\u7EC4\u4EF6\n */\nconst CountdownUnit = ({ value, label }: { value: number; label: string }) => {\n return (\n <div className=\"lg-desktop:size-12 bg-info-primary lg-desktop:px-1 flex size-10 flex-col items-center justify-center px-[2px] text-center text-white\">\n <p className=\"lg-desktop:text-2xl text-[20px] font-bold leading-[1.2] tracking-[-0.96px]\">\n {String(value).padStart(2, '0')}\n </p>\n <p className=\"text-[12px] font-bold leading-[1.4] tracking-[-0.24px]\">{label}</p>\n </div>\n )\n}\n\n/**\n * \u5012\u8BA1\u65F6\u5206\u9694\u7B26\n */\nconst CountdownSeparator = () => {\n return (\n <p className=\"lg-desktop:text-2xl text-info-primary text-center text-xl font-bold leading-[1.2] tracking-[-0.96px]\">\n :\n </p>\n )\n}\n\n/**\n * Countdown - \u5012\u8BA1\u65F6\u7EC4\u4EF6\n */\nconst Countdown = React.forwardRef<HTMLDivElement, CountdownProps>(({ config, className }, ref) => {\n const { targetDate, showDays = true, showHours = true, showMinutes = true, showSeconds = true, labels = {} } = config\n\n const [timeLeft, setTimeLeft] = useState<TimeLeft>(() => calculateTimeLeft(targetDate))\n\n useEffect(() => {\n const timer = setInterval(() => {\n setTimeLeft(calculateTimeLeft(targetDate))\n }, 1000)\n\n return () => clearInterval(timer)\n }, [targetDate])\n\n const defaultLabels = {\n days: labels.days || 'Day',\n hours: labels.hours || 'Hours',\n minutes: labels.minutes || 'Mins',\n seconds: labels.seconds || 'Secs',\n }\n\n const units = []\n if (showDays) units.push({ value: timeLeft.days, label: defaultLabels.days })\n if (showHours) units.push({ value: timeLeft.hours, label: defaultLabels.hours })\n if (showMinutes) units.push({ value: timeLeft.minutes, label: defaultLabels.minutes })\n if (showSeconds) units.push({ value: timeLeft.seconds, label: defaultLabels.seconds })\n\n return (\n <div ref={ref} className={cn('flex items-center gap-1', className)}>\n {units.map((unit, index) => (\n <React.Fragment key={unit.label}>\n <CountdownUnit value={unit.value} label={unit.label} />\n {index < units.length - 1 && <CountdownSeparator />}\n </React.Fragment>\n ))}\n </div>\n )\n})\n\nCountdown.displayName = 'Countdown'\n\nexport default Countdown\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2CI,IAAAI,EAAA,6BA1CJC,EAA2C,oBAC3CC,EAAkB,oBAClBC,EAAmB,kCAkBnB,MAAMC,EAAqBC,GAAiC,CAC1D,MAAMC,KAAM,EAAAC,SAAM,EAEZC,KADS,EAAAD,SAAMF,CAAU,EACX,KAAKC,EAAK,QAAQ,EAEtC,GAAIE,GAAQ,EACV,MAAO,CAAE,KAAM,EAAG,MAAO,EAAG,QAAS,EAAG,QAAS,CAAE,EAGrD,MAAMC,EAAO,KAAK,MAAMD,GAAQ,GAAK,GAAK,GAAG,EACvCE,EAAQ,KAAK,MAAOF,GAAQ,GAAK,GAAK,KAAQ,GAAK,GAAG,EACtDG,EAAU,KAAK,MAAOH,GAAQ,G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,OAAQ,CAAC,EACjFL,GAAaM,EAAM,KAAK,CAAE,MAAOJ,EAAS,QAAS,MAAOG,EAAc,OAAQ,CAAC,KAGnF,OAAC,OAAI,IAAKT,EAAK,aAAW,MAAG,0BAA2BD,CAAS,EAC9D,SAAAW,EAAM,IAAI,CAACC,EAAMC,OAChB,QAAC,EAAAf,QAAM,SAAN,CACC,oBAACL,EAAA,CAAc,MAAOmB,EAAK,MAAO,MAAOA,EAAK,MAAO,EACpDC,EAAQF,EAAM,OAAS,MAAK,OAACf,EAAA,EAAmB,IAF9BgB,EAAK,KAG1B,CACD,EACH,CAEJ,CAAC,EAEDf,EAAU,YAAc,YAExB,IAAOnB,EAAQmB",
6
+ "names": ["Countdown_exports", "__export", "Countdown_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_dayjs", "import_utils", "calculateTimeLeft", "targetDate", "now", "dayjs", "diff", "days", "hours", "minutes", "seconds", "CountdownUnit", "value", "label", "CountdownSeparator", "Countdown", "React", "config", "className", "ref", "showDays", "showHours", "showMinutes", "showSeconds", "labels", "timeLeft", "setTimeLeft", "timer", "defaultLabels", "units", "unit", "index"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var J=Object.create;var d=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Z=(t,e)=>{for(var n in e)d(t,n,{get:e[n],enumerable:!0})},M=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Q(e))!Y.call(t,s)&&s!==n&&d(t,s,{get:()=>e[s],enumerable:!(c=K(e,s))||c.enumerable});return t};var tt=(t,e,n)=>(n=t!=null?J(X(t)):{},M(e||!t||!t.__esModule?d(n,"default",{value:t,enumerable:!0}):n,t)),et=t=>M(d({},"__esModule",{value:!0}),t);var nt={};Z(nt,{default:()=>rt});module.exports=et(nt);var i=require("react/jsx-runtime"),r=tt(require("react")),f=require("gsap"),b=require("gsap/dist/SplitText"),T=require("gsap/dist/ScrollTrigger"),p=require("../../helpers/utils.js"),z=require("../../components/index.js"),P=require("../../shared/Styles.js"),S=require("../../shared/trackUrlRef.js"),I=require("react-intersection-observer");const E="link",$="title",D=r.default.forwardRef(({data:t,className:e,as:n="h2",weight:c="bold",mobFlexCol:s=!1},V)=>{const{title:u,caption:g,theme:k,extensions:m,align:h="left"}=t,y=(0,r.useRef)(null),l=(0,r.useRef)(null),o=(0,r.useRef)(null),a=(0,r.useRef)(null),{ref:B,inView:L}=(0,I.useInView)();return(0,r.useImperativeHandle)(V,()=>y.current),(0,r.useEffect)(()=>{f.gsap.registerPlugin(b.SplitText,T.ScrollTrigger);function U(){if(!l.current)return;const j=l.current?.clientHeight||80;o.current&&o.current.revert(),a.current&&a.current.kill(),o.current=new b.SplitText(l.current,{type:"words",wordsClass:"word"});const v=o.current.words;f.gsap.set(v,{opacity:0}),a.current=T.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${j*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:C=>{const F=C.progress,R=v.length||1,O=.5,w=1/R,N=w*(1-O),H=(R-1)*N+w,W=Math.min(1,H>0?F/H:0);v.forEach((_,q)=>{const A=q*N,G=w;let x=(W-A)/G;x=Math.max(0,Math.min(1,x)),f.gsap.set(_,{opacity:x})})}})}return L&&U(),()=>{o.current&&o.current.revert(),a.current&&a.current.kill()}},[L]),(u||g)&&(0,i.jsxs)("div",{ref:y,id:m?.id,className:(0,p.cn)("titleBottom title-box mb-6 flex items-end justify-between gap-2",{"md-tablet:flex-col md-tablet:items-start":s}),children:[(0,i.jsx)("div",{ref:B,className:(0,p.cn)("flex-1 space-y-4",e,{"aiui-dark":k==="dark","text-center":h==="center","text-right":h==="right","text-left":h==="left"}),children:(0,i.jsx)(z.Heading,{ref:l,as:n,size:4,html:g||u,weight:c})}),m?.textLink&&(0,i.jsxs)("a",{className:(0,p.cn)({"aiui-dark":k==="dark"},"flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:(0,S.trackUrlRef)(m?.link,`${E}_${$}`),"data-headless-type-name":`${E}#${$}`,"data-headless-title-desc-button":`${u}#${g}`,children:[(0,i.jsx)("div",{className:"flex-1 truncate whitespace-nowrap",children:m?.textLink}),(0,i.jsx)("div",{className:"size-6",children:(0,i.jsx)("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]})]})});D.displayName="Title";var rt=(0,P.withLayout)(D);
1
+ "use strict";"use client";var Z=Object.create;var f=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var rt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var it=(t,e)=>{for(var n in e)f(t,n,{get:e[n],enumerable:!0})},$=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of et(e))!nt.call(t,s)&&s!==n&&f(t,s,{get:()=>e[s],enumerable:!(o=tt(e,s))||o.enumerable});return t};var P=(t,e,n)=>(n=t!=null?Z(rt(t)):{},$(e||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),st=t=>$(f({},"__esModule",{value:!0}),t);var at={};it(at,{default:()=>ot});module.exports=st(at);var r=require("react/jsx-runtime"),i=P(require("react")),u=require("gsap"),b=require("gsap/dist/SplitText"),k=require("gsap/dist/ScrollTrigger"),a=require("../../helpers/utils.js"),g=require("../../components/index.js"),D=require("../../shared/Styles.js"),I=require("../../shared/trackUrlRef.js"),V=require("react-intersection-observer"),A=P(require("./Countdown.js"));const j="link",z="title",S=({data:t,className:e})=>{const{theme:n,extensions:o,title:s,caption:h,align:m}=t;return o?.textLink?(0,r.jsxs)("a",{className:(0,a.cn)({"aiui-dark":n==="dark"},"flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#080A0F]",{"justify-center":m==="center"},e),href:(0,I.trackUrlRef)(o?.link,`${j}_${z}`),"data-headless-type-name":`${j}#${z}`,"data-headless-title-desc-button":`${s}#${h}`,children:[(0,r.jsx)("div",{className:(0,a.cn)("flex-1 truncate whitespace-nowrap",{"flex-none":m==="center"}),children:o?.textLink}),(0,r.jsx)("div",{className:"size-6",children:(0,r.jsx)("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null},B=i.default.forwardRef(({data:t,className:e,as:n="h2",weight:o="bold",mobFlexCol:s=!1},h)=>{const{title:m,caption:T,theme:C,extensions:F,align:l="left",subtitle:y,countdown:N}=t,L=(0,i.useRef)(null),d=(0,i.useRef)(null),c=(0,i.useRef)(null),p=(0,i.useRef)(null),{ref:U,inView:R}=(0,V.useInView)();return(0,i.useImperativeHandle)(h,()=>L.current),(0,i.useEffect)(()=>{u.gsap.registerPlugin(b.SplitText,k.ScrollTrigger);function O(){if(!d.current)return;const W=d.current?.clientHeight||80;c.current&&c.current.revert(),p.current&&p.current.kill(),c.current=new b.SplitText(d.current,{type:"words",wordsClass:"word"});const x=c.current.words;u.gsap.set(x,{opacity:0}),p.current=k.ScrollTrigger.create({trigger:d.current,start:"bottom bottom-=4%",end:`bottom+=${W*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:_=>{const q=_.progress,H=x.length||1,G=.5,w=1/H,M=w*(1-G),E=(H-1)*M+w,J=Math.min(1,E>0?q/E:0);x.forEach((K,Q)=>{const X=Q*M,Y=w;let v=(J-X)/Y;v=Math.max(0,Math.min(1,v)),u.gsap.set(K,{opacity:v})})}})}return R&&O(),()=>{c.current&&c.current.revert(),p.current&&p.current.kill()}},[R]),(m||T)&&(0,r.jsxs)("div",{ref:L,id:F?.id,className:(0,a.cn)("titleBottom title-box mb-6 flex items-end justify-between gap-2",{"md-tablet:flex-col md-tablet:items-start":s}),children:[(0,r.jsxs)("div",{ref:U,className:(0,a.cn)("flex-1 space-y-4",e,{"aiui-dark":C==="dark","text-center":l==="center","text-right":l==="right","text-left":l==="left"}),children:[(0,r.jsx)(g.Heading,{ref:d,as:n,size:4,html:T||m,weight:o}),y&&(0,r.jsx)(g.Text,{html:y,className:"desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px] text-[#080A0F]"}),(0,r.jsx)(S,{data:t,className:(0,a.cn)({hidden:l==="left"})}),N&&(0,r.jsx)(A.default,{className:(0,a.cn)("laptop:!mt-2 !mt-4 justify-start",{"justify-center":l==="center"}),config:N})]}),(0,r.jsx)(S,{data:t,className:(0,a.cn)({hidden:l==="center"})})]})});B.displayName="Title";var ot=(0,D.withLayout)(B);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, as = 'h2', weight = 'bold', mobFlexCol = false }, ref) => {\n const { title, caption, theme, extensions, align = 'left' } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div\n ref={innerRef}\n id={extensions?.id}\n className={cn('titleBottom title-box mb-6 flex items-end justify-between gap-2', {\n 'md-tablet:flex-col md-tablet:items-start': mobFlexCol,\n })}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1 space-y-4', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-right': align === 'right',\n 'text-left': align === 'left',\n })}\n >\n <Heading ref={titleRef} as={as} size={4} html={caption || title} weight={weight} />\n </div>\n {extensions?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div className=\"flex-1 truncate whitespace-nowrap\">{extensions?.textLink}</div>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </a>\n )}\n </div>\n )\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
- "mappings": "ykBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAkGY,IAAAI,EAAA,6BAjGZC,EAA8D,qBAC9DC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQ,EAAAC,QAAM,WAClB,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAW,GAAAC,EAAK,KAAM,OAAAC,EAAS,OAAQ,WAAAC,EAAa,EAAM,EAAGC,IAAQ,CAC5E,KAAM,CAA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K,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CAEA,OAAIhB,GACFC,EAAW,EAGN,IAAM,CACXJ,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAE9DC,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,CAC5D,CACF,EAAG,CAACE,CAAM,CAAC,GAGRV,GAASC,OACR,QAAC,OACC,IAAKI,EACL,GAAIF,GAAY,GAChB,aAAW,MAAG,kEAAmE,CAC/E,2CAA4CL,CAC9C,CAAC,EAED,oBAAC,OACC,IAAKW,EACL,aAAW,MAAG,mBAAoBd,EAAW,CAC3C,YAAaO,IAAU,OACvB,cAAeE,IAAU,SACzB,aAAcA,IAAU,QACxB,YAAaA,IAAU,MACzB,CAAC,EAED,mBAAC,WAAQ,IAAKE,EAAU,GAAIV,EAAI,KAAM,EAAG,KAAMK,GAAWD,EAAO,OAAQH,EAAQ,EACnF,EACCM,GAAY,aACX,QAAC,KACC,aAAW,MACT,CAAE,YAAaD,IAAU,MAAO,EAChC,sIACF,EACA,QAAM,eAAYC,GAAY,KAAM,GAAGb,CAAa,IAAIC,CAAa,EAAE,EACvE,0BAAyB,GAAGD,CAAa,IAAIC,CAAa,GAC1D,kCAAiC,GAAGS,CAAK,IAAIC,CAAO,GAEpD,oBAAC,OAAI,UAAU,oCAAqC,SAAAE,GAAY,SAAS,KACzE,OAAC,OAAI,UAAU,SACb,mBAAC,OACC,MAAM,KACN,OAAO,KACP,UAAU,WACV,MAAM,6BACN,QAAQ,YACR,KAAK,OAEL,mBAAC,QACC,UAAU,iCACV,EAAE,0BACF,OAAO,OACP,YAAY,MACZ,cAAc,QACf,EACH,EACF,GACF,GAEJ,CAGN,CACF,EAEAX,EAAM,YAAc,QAEpB,IAAOd,MAAQ,cAAWc,CAAK",
6
- "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "Title", "React", "data", "className", "as", "weight", "mobFlexCol", "ref", "title", "caption", "theme", "extensions", "align", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\nimport Countdown from './Countdown.js'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst TitleButton = ({ data, className }: { data: TitleProps['data']; className?: string }) => {\n const { theme, extensions, title, caption, align } = data\n if (!extensions?.textLink) return null\n return (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'flex items-center overflow-hidden text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#080A0F]',\n { 'justify-center': align === 'center' },\n className\n )}\n href={trackUrlRef(extensions?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${caption}`}\n >\n <div\n className={cn('flex-1 truncate whitespace-nowrap', {\n 'flex-none': align === 'center',\n })}\n >\n {extensions?.textLink}\n </div>\n <div className=\"size-6\">\n <svg\n width=\"24\"\n height=\"24\"\n className=\"mb-[3px]\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n className=\"transition-all duration-[0.4s]\"\n d=\"M10.5 8L14.5 12L10.5 16\"\n stroke=\"#777\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n ></path>\n </svg>\n </div>\n </a>\n )\n}\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(\n ({ data, className, as = 'h2', weight = 'bold', mobFlexCol = false }, ref) => {\n const { title, caption, theme, extensions, align = 'left', subtitle, countdown } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n if (splitTextInstance.current) {\n splitTextInstance.current.revert()\n }\n if (scrollTriggerRef.current) {\n scrollTriggerRef.current.kill()\n }\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length || 1\n const overlap = 0.5\n const interval = 1 / total\n const step = interval * (1 - overlap)\n const lastEnd = (total - 1) * step + interval\n const normalizedProgress = Math.min(1, lastEnd > 0 ? progress / lastEnd : 0)\n words.forEach((word: any, i: number) => {\n const start = i * step\n const width = interval\n let opacity = (normalizedProgress - start) / width\n opacity = Math.max(0, Math.min(1, opacity))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n (title || caption) && (\n <div\n ref={innerRef}\n id={extensions?.id}\n className={cn('titleBottom title-box mb-6 flex items-end justify-between gap-2', {\n 'md-tablet:flex-col md-tablet:items-start': mobFlexCol,\n })}\n >\n <div\n ref={inViewRef}\n className={cn('flex-1 space-y-4', className, {\n 'aiui-dark': theme === 'dark',\n 'text-center': align === 'center',\n 'text-right': align === 'right',\n 'text-left': align === 'left',\n })}\n >\n <Heading ref={titleRef} as={as} size={4} html={caption || title} weight={weight} />\n {subtitle && (\n <Text\n html={subtitle}\n className=\"desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px] text-[#080A0F]\"\n />\n )}\n <TitleButton data={data} className={cn({ hidden: align === 'left' })} />\n {countdown && (\n <Countdown\n className={cn('laptop:!mt-2 !mt-4 justify-start', {\n 'justify-center': align === 'center',\n })}\n config={countdown}\n />\n )}\n </div>\n <TitleButton data={data} className={cn({ hidden: align === 'center' })} />\n </div>\n )\n )\n }\n)\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "ilBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAoBI,IAAAI,EAAA,6BAnBJC,EAA8D,oBAC9DC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAA2B,kCAE3BC,EAA4B,uCAC5BC,EAA0B,uCAC1BC,EAAsB,6BAEtB,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAc,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAwD,CAC7F,KAAM,CAAE,MAAAC,EAAO,WAAAC,EAAY,MAAAC,EAAO,QAAAC,EAAS,MAAAC,CAAM,EAAIN,EACrD,OAAKG,GAAY,YAEf,QAAC,KACC,aAAW,MACT,CAAE,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,IAAKU,EAAU,GAAIP,EAAI,KAAM,EAAG,KAAMJ,GAAWD,EAAO,OAAQM,EAAQ,EAChFG,MACC,OAAC,QACC,KAAMA,EACN,UAAU,mIACZ,KAEF,OAACd,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,CAAE,OAAQM,IAAU,MAAO,CAAC,EAAG,EACrEQ,MACC,OAAC,EAAAuB,QAAA,CACC,aAAW,MAAG,mCAAoC,CAChD,iBAAkB/B,IAAU,QAC9B,CAAC,EACD,OAAQQ,EACV,GAEJ,KACA,OAACf,EAAA,CAAY,KAAMC,EAAM,aAAW,MAAG,CAAE,OAAQM,IAAU,QAAS,CAAC,EAAG,GAC1E,CAGN,CACF,EAEAC,EAAM,YAAc,QAEpB,IAAOvB,MAAQ,cAAWuB,CAAK",
6
+ "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_trackUrlRef", "import_react_intersection_observer", "import_Countdown", "componentType", "componentName", "TitleButton", "data", "className", "theme", "extensions", "title", "caption", "align", "Title", "React", "as", "weight", "mobFlexCol", "ref", "subtitle", "countdown", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "overlap", "interval", "step", "lastEnd", "normalizedProgress", "word", "i", "start", "width", "opacity", "Countdown"]
7
7
  }
@@ -5,6 +5,44 @@ export interface Feature {
5
5
  */
6
6
  title: string;
7
7
  }
8
+ /**
9
+ * 倒计时配置
10
+ */
11
+ export interface CountdownConfig {
12
+ /**
13
+ * 倒计时目标时间(ISO 8601 格式或任何 dayjs 支持的格式)
14
+ */
15
+ targetDate: string;
16
+ /**
17
+ * 是否显示天数
18
+ * @default true
19
+ */
20
+ showDays?: boolean;
21
+ /**
22
+ * 是否显示小时
23
+ * @default true
24
+ */
25
+ showHours?: boolean;
26
+ /**
27
+ * 是否显示分钟
28
+ * @default true
29
+ */
30
+ showMinutes?: boolean;
31
+ /**
32
+ * 是否显示秒数
33
+ * @default true
34
+ */
35
+ showSeconds?: boolean;
36
+ /**
37
+ * 自定义标签文本
38
+ */
39
+ labels?: {
40
+ days?: string;
41
+ hours?: string;
42
+ minutes?: string;
43
+ seconds?: string;
44
+ };
45
+ }
8
46
  export interface TitleProps {
9
47
  mobFlexCol?: boolean;
10
48
  data: {
@@ -13,6 +51,14 @@ export interface TitleProps {
13
51
  */
14
52
  title?: string;
15
53
  caption?: string;
54
+ /**
55
+ * 副标题
56
+ */
57
+ subtitle?: string;
58
+ /**
59
+ * 倒计时配置
60
+ */
61
+ countdown?: CountdownConfig;
16
62
  /**
17
63
  * 特性列表,最多支持3个
18
64
  */
@@ -25,6 +71,10 @@ export interface TitleProps {
25
71
  * 扩展数据
26
72
  */
27
73
  extensions?: any;
74
+ /**
75
+ * 对齐方式
76
+ * @default 'left'
77
+ */
28
78
  align?: 'left' | 'center' | 'right';
29
79
  };
30
80
  weight?: 'medium' | 'semibold' | 'bold' | 'extraBold' | 'black';
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var h=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!n.call(t,r)&&r!==o&&a(t,r,{get:()=>e[r],enumerable:!(i=s(e,r))||i.enumerable});return t};var m=t=>h(a({},"__esModule",{value:!0}),t);var p={};module.exports=m(p);
1
+ "use strict";var s=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of a(e))!l.call(t,o)&&o!==i&&s(t,o,{get:()=>e[o],enumerable:!(n=r(e,o))||n.enumerable});return t};var h=t=>g(s({},"__esModule",{value:!0}),t);var u={};module.exports=h(u);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/types.ts"],
4
- "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\nexport interface TitleProps {\n mobFlexCol?: boolean // \u662F\u5426\u5728\u79FB\u52A8\u7AEF\u663E\u793A\u4E3A flex-col\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title?: string\n caption?: string\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extensions?: any\n align?: 'left' | 'center' | 'right'\n }\n weight?: 'medium' | 'semibold' | 'bold' | 'extraBold' | 'black'\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n"],
4
+ "sourcesContent": ["import type { Theme } from '../../types/props.js'\n\nexport interface Feature {\n /**\n * \u7279\u6027\u6807\u9898\n */\n title: string\n}\n\n/**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\nexport interface CountdownConfig {\n /**\n * \u5012\u8BA1\u65F6\u76EE\u6807\u65F6\u95F4\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF09\n */\n targetDate: string\n /**\n * \u662F\u5426\u663E\u793A\u5929\u6570\n * @default true\n */\n showDays?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5C0F\u65F6\n * @default true\n */\n showHours?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u5206\u949F\n * @default true\n */\n showMinutes?: boolean\n /**\n * \u662F\u5426\u663E\u793A\u79D2\u6570\n * @default true\n */\n showSeconds?: boolean\n /**\n * \u81EA\u5B9A\u4E49\u6807\u7B7E\u6587\u672C\n */\n labels?: {\n days?: string\n hours?: string\n minutes?: string\n seconds?: string\n }\n}\n\nexport interface TitleProps {\n mobFlexCol?: boolean // \u662F\u5426\u5728\u79FB\u52A8\u7AEF\u663E\u793A\u4E3A flex-col\n data: {\n /**\n * \u4E3B\u6807\u9898\n */\n title?: string\n caption?: string\n /**\n * \u526F\u6807\u9898\n */\n subtitle?: string\n /**\n * \u5012\u8BA1\u65F6\u914D\u7F6E\n */\n countdown?: CountdownConfig\n /**\n * \u7279\u6027\u5217\u8868\uFF0C\u6700\u591A\u652F\u63013\u4E2A\n */\n features?: Feature[]\n /**\n * \u4E3B\u9898\u8272\n */\n theme?: Theme\n /**\n * \u6269\u5C55\u6570\u636E\n */\n extensions?: any\n /**\n * \u5BF9\u9F50\u65B9\u5F0F\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right'\n }\n weight?: 'medium' | 'semibold' | 'bold' | 'extraBold' | 'black'\n /**\n * \u81EA\u5B9A\u4E49\u7C7B\u540D\n */\n className?: string\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.create;var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var f=(t,o)=>{for(var a in o)i(t,a,{get:o[a],enumerable:!0})},c=(t,o,a,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of y(o))!l.call(t,e)&&e!==a&&i(t,e,{get:()=>o[e],enumerable:!(r=m(o,e))||r.enumerable});return t};var h=(t,o,a)=>(a=t!=null?d(g(t)):{},c(o||!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),v=t=>c(i({},"__esModule",{value:!0}),t);var b={};f(b,{Default:()=>S,default:()=>N});module.exports=v(b);var p=require("react/jsx-runtime"),u=require("react"),n=h(require("../biz-components/AnchorNavigation/index.js"));const s={sectionIds:[{id:"section1",label:"Section 1"},{id:"section2",label:"Section 2"},{id:"section3",label:"Section 3"}]},A={title:"Biz Components/AnchorNavigation",component:n.default,parameters:{layout:"centered",docs:{description:{component:"\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E"}},args:{data:s}};var N=A;const S={args:{data:s},render:t=>(0,p.jsx)(n.default,{...t})};
1
+ "use strict";var d=Object.create;var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var f=(a,t)=>{for(var o in t)i(a,o,{get:t[o],enumerable:!0})},s=(a,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!y.call(a,e)&&e!==o&&i(a,e,{get:()=>t[e],enumerable:!(r=l(t,e))||r.enumerable});return a};var v=(a,t,o)=>(o=a!=null?d(m(a)):{},s(t||!a||!a.__esModule?i(o,"default",{value:a,enumerable:!0}):o,a)),b=a=>s(i({},"__esModule",{value:!0}),a);var D={};f(D,{Default:()=>N,default:()=>A});module.exports=b(D);var p=require("react/jsx-runtime"),S=require("react"),n=v(require("../biz-components/AnchorNavigation/index.js"));const c={sectionIds:[{id:"overview",label:"Overview"},{id:"cleaning-power",label:"Cleaning power"},{id:"smart-cleaning",label:"Smart cleaning"},{id:"ease-of-use",label:"Ease of use"}]},h={title:"Biz Components/AnchorNavigation",component:n.default,parameters:{layout:"centered",docs:{description:{component:"\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E"}},args:{data:c}};var A=h;const N={args:{data:c},render:a=>(0,p.jsx)(n.default,{...a})};
2
2
  //# sourceMappingURL=anchorNavigation.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/anchorNavigation.stories.tsx"],
4
- "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport React from 'react'\n\nimport AnchorNavigation, { type AnchorNavigationData } from '../biz-components/AnchorNavigation/index.js'\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: AnchorNavigationData = {\n sectionIds: [\n {\n id: 'section1',\n label: 'Section 1',\n },\n {\n id: 'section2',\n label: 'Section 2',\n },\n {\n id: 'section3',\n label: 'Section 3',\n },\n ],\n} satisfies AnchorNavigationData\n\nconst meta = {\n title: 'Biz Components/AnchorNavigation',\n component: AnchorNavigation,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E',\n },\n },\n args: {\n data: mockData,\n },\n} satisfies Meta<typeof AnchorNavigation>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n data: mockData,\n },\n render: (args: { data: AnchorNavigationData }) => <AnchorNavigation {...args} />,\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAqDoD,IAAAK,EAAA,6BAnDpDC,EAAkB,iBAElBC,EAA4D,0DAG5D,MAAMC,EAAiC,CACrC,WAAY,CACV,CACE,GAAI,WACJ,MAAO,WACT,EACA,CACE,GAAI,WACJ,MAAO,WACT,EACA,CACE,GAAI,WACJ,MAAO,WACT,CACF,CACF,EAEMC,EAAO,CACX,MAAO,kCACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,qDACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,YAAa,0BACf,CACF,EACA,KAAM,CACJ,KAAMF,CACR,CACF,EAEA,IAAOL,EAAQM,EAGR,MAAMP,EAAiB,CAC5B,KAAM,CACJ,KAAMM,CACR,EACA,OAASG,MAAyC,OAAC,EAAAD,QAAA,CAAkB,GAAGC,EAAM,CAChF",
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport React from 'react'\n\nimport AnchorNavigation, { type AnchorNavigationData } from '../biz-components/AnchorNavigation/index.js'\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: AnchorNavigationData = {\n sectionIds: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'cleaning-power',\n label: 'Cleaning power',\n },\n {\n id: 'smart-cleaning',\n label: 'Smart cleaning',\n },\n {\n id: 'ease-of-use',\n label: 'Ease of use',\n },\n ],\n} satisfies AnchorNavigationData\n\nconst meta = {\n title: 'Biz Components/AnchorNavigation',\n component: AnchorNavigation,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u951A\u70B9\u5BFC\u822A - \u951A\u70B9\u5BFC\u822A',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E',\n },\n },\n args: {\n data: mockData,\n },\n} satisfies Meta<typeof AnchorNavigation>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n data: mockData,\n },\n render: (args: { data: AnchorNavigationData }) => <AnchorNavigation {...args} />,\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,EAAAJ,GAyDoD,IAAAK,EAAA,6BAvDpDC,EAAkB,iBAElBC,EAA4D,0DAG5D,MAAMC,EAAiC,CACrC,WAAY,CACV,CACE,GAAI,WACJ,MAAO,UACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,cACJ,MAAO,aACT,CACF,CACF,EAEMC,EAAO,CACX,MAAO,kCACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,qDACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,YAAa,0BACf,CACF,EACA,KAAM,CACJ,KAAMF,CACR,CACF,EAEA,IAAOL,EAAQM,EAGR,MAAMP,EAAiB,CAC5B,KAAM,CACJ,KAAMM,CACR,EACA,OAASG,MAAyC,OAAC,EAAAD,QAAA,CAAkB,GAAGC,EAAM,CAChF",
6
6
  "names": ["anchorNavigation_stories_exports", "__export", "Default", "anchorNavigation_stories_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_AnchorNavigation", "mockData", "meta", "AnchorNavigation", "args"]
7
7
  }