@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.
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +73 -6
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +17 -7
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/cjs/biz-components/Title/Countdown.d.ts +11 -0
- package/dist/cjs/biz-components/Title/Countdown.js +2 -0
- package/dist/cjs/biz-components/Title/Countdown.js.map +7 -0
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +3 -3
- package/dist/cjs/biz-components/Title/types.d.ts +50 -0
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/stories/anchorNavigation.stories.js +1 -1
- package/dist/cjs/stories/anchorNavigation.stories.js.map +2 -2
- package/dist/cjs/stories/eventSchedule.stories.js +1 -1
- package/dist/cjs/stories/eventSchedule.stories.js.map +3 -3
- package/dist/cjs/stories/promotionalBar.stories.js +1 -1
- package/dist/cjs/stories/promotionalBar.stories.js.map +3 -3
- package/dist/cjs/stories/title.stories.js +2 -0
- package/dist/cjs/stories/title.stories.js.map +7 -0
- package/dist/esm/biz-components/EventSchedule/index.d.ts +73 -6
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +17 -7
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/esm/biz-components/Title/Countdown.d.ts +11 -0
- package/dist/esm/biz-components/Title/Countdown.js +2 -0
- package/dist/esm/biz-components/Title/Countdown.js.map +7 -0
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +3 -3
- package/dist/esm/biz-components/Title/types.d.ts +50 -0
- package/dist/esm/stories/anchorNavigation.stories.js +1 -1
- package/dist/esm/stories/anchorNavigation.stories.js.map +2 -2
- package/dist/esm/stories/eventSchedule.stories.js +1 -1
- package/dist/esm/stories/eventSchedule.stories.js.map +3 -3
- package/dist/esm/stories/promotionalBar.stories.js +1 -1
- package/dist/esm/stories/promotionalBar.stories.js.map +3 -3
- package/dist/esm/stories/title.stories.js +2 -0
- package/dist/esm/stories/title.stories.js.map +7 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var h=Object.create;var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var k=(e,o)=>{for(var i in o)c(e,i,{get:o[i],enumerable:!0})},d=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of m(o))!f.call(e,l)&&l!==i&&c(e,l,{get:()=>o[l],enumerable:!(r=b(o,l))||r.enumerable});return e};var g=(e,o,i)=>(i=e!=null?h(u(e)):{},d(o||!e||!e.__esModule?c(i,"default",{value:e,enumerable:!0}):i,e)),v=e=>d(c({},"__esModule",{value:!0}),e);var M={};k(M,{AutoActiveStatus:()=>x,Default:()=>j,SingleEvent:()=>S,ThreeEvents:()=>_,default:()=>L});module.exports=v(M);var t=require("react/jsx-runtime"),E=require("react"),p=g(require("../biz-components/EventSchedule/index.js"));const s=()=>(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"})]}),n=()=>(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"})]}),a=()=>(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"})]}),D={scheduleList:[{title:"\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229",startDate:"2024-12-01",endDate:"2024-12-15",items:[{icon:(0,t.jsx)(s,{}),label:"12\u67081\u65E5 - 12\u670815\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6"},{icon:(0,t.jsx)(a,{}),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,t.jsx)(s,{}),label:"12\u670816\u65E5 - 12\u670831\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u5168\u5929\u5019\u4F18\u60E0"},{icon:(0,t.jsx)(a,{}),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"}}},y={scheduleList:[{title:"\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8",startDate:"2024-12-01",endDate:"2024-12-10",items:[{icon:(0,t.jsx)(s,{}),label:"12\u67081\u65E5 - 12\u670810\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2"},{icon:(0,t.jsx)(a,{}),label:"\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269"}]},{title:"\u5723\u8BDE\u72C2\u6B22",startDate:"2024-12-11",endDate:"2024-12-25",items:[{icon:(0,t.jsx)(s,{}),label:"12\u670811\u65E5 - 12\u670825\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD"},{icon:(0,t.jsx)(a,{}),label:"\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500"}]},{title:"\u8DE8\u5E74\u7279\u60E0",startDate:"2024-12-26",endDate:"2025-01-01",items:[{icon:(0,t.jsx)(s,{}),label:"12\u670826\u65E5 - 1\u67081\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u5012\u8BA1\u65F6\u7279\u60E0"},{icon:(0,t.jsx)(a,{}),label:"\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D"}]}]},w={title:"Biz Components/EventSchedule",component:p.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"}},className:{description:"\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D",control:{type:"text"}}}};var L=w;const j={args:{data:D}},_={args:{data:y}},S={args:{data:{scheduleList:[{title:"\u9650\u65F6\u79D2\u6740\u6D3B\u52A8",startDate:"2025-12-23",endDate:"2025-12-23",items:[{icon:(0,t.jsx)(s,{}),label:"12\u67081\u65E5\u5168\u5929"},{icon:(0,t.jsx)(n,{}),label:"\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2"},{icon:(0,t.jsx)(a,{}),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,t.jsx)(s,{}),label:"1\u67081\u65E5 - 1\u670831\u65E5"},{icon:(0,t.jsx)(n,{}),label:"\u5DF2\u7ED3\u675F"},{icon:(0,t.jsx)(a,{}),label:"\u611F\u8C22\u53C2\u4E0E"}]},{title:"\u8FDB\u884C\u4E2D\u7684\u6D3B\u52A8",startDate:"2025-01-01",endDate:"2025-12-31",items:[{icon:(0,t.jsx)(s,{}),label:"2025\u5E74\u5168\u5E74"},{icon:(0,t.jsx)(n,{}),label:"\u6B63\u5728\u8FDB\u884C\u4E2D"},{icon:(0,t.jsx)(a,{}),label:"\u9650\u65F6\u4F18\u60E0"}]},{title:"\u5373\u5C06\u5F00\u59CB\u7684\u6D3B\u52A8",startDate:"2026-01-01",endDate:"2026-12-31",items:[{icon:(0,t.jsx)(s,{}),label:"2026\u5E74\u5F00\u59CB"},{icon:(0,t.jsx)(n,{}),label:"\u656C\u8BF7\u671F\u5F85"},{icon:(0,t.jsx)(a,{}),label:"\u8D85\u503C\u798F\u5229"}]}]}}};
|
|
2
2
|
//# sourceMappingURL=eventSchedule.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/eventSchedule.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\n\nimport EventSchedule, { type EventScheduleData } from '../biz-components/EventSchedule/index.js'\n\n// \u6A21\u62DF\u56FE\u6807\u7EC4\u4EF6\nconst CalendarIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M13.333 1.667V5M6.667 1.667V5M2.5 8.333h15\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\nconst ClockIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M10 5v5l3.333 1.667\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\nconst GiftIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: EventScheduleData = {\n scheduleList: [\n {\n title: '\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229',\n date: '2024-12-01',\n active: true,\n backgroundImage: 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5 - 12\u670815\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6',\n },\n {\n icon: <GiftIcon />,\n label: '\u8D2D\u4E70\u5373\u9001\u7CBE\u7F8E\u793C\u54C1',\n },\n ],\n },\n {\n title: '\u5723\u8BDE\u7279\u60E0\u6D3B\u52A8',\n date: '2024-12-16',\n active: false,\n backgroundImage: 'https://images.unsplash.com/photo-1512909006721-3d6018887383?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670816\u65E5 - 12\u670831\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5168\u5929\u5019\u4F18\u60E0',\n },\n {\n icon: <GiftIcon />,\n label: '\u6EE1\u989D\u8D60\u9001\u5723\u8BDE\u793C\u76D2',\n },\n ],\n },\n ],\n}\n\n// \u4E09\u4E2A\u6D3B\u52A8\u7684\u6570\u636E\nconst threeEventsData: EventScheduleData = {\n scheduleList: [\n {\n title: '\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8',\n date: '2024-12-01',\n active: true,\n backgroundImage: 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5 - 12\u670810\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2',\n },\n {\n icon: <GiftIcon />,\n label: '\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269',\n },\n ],\n },\n {\n title: '\u5723\u8BDE\u72C2\u6B22',\n date: '2024-12-11',\n active: false,\n backgroundImage: 'https://images.unsplash.com/photo-1512909006721-3d6018887383?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670811\u65E5 - 12\u670825\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD',\n },\n {\n icon: <GiftIcon />,\n label: '\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500',\n },\n ],\n },\n {\n title: '\u8DE8\u5E74\u7279\u60E0',\n date: '2024-12-26',\n active: false,\n backgroundImage: 'https://images.unsplash.com/photo-1467810563316-b5476525c0f9?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670826\u65E5 - 1\u67081\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5012\u8BA1\u65F6\u7279\u60E0',\n },\n {\n icon: <GiftIcon />,\n label: '\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D',\n },\n ],\n },\n ],\n}\n\nconst meta = {\n title: 'Biz Components/EventSchedule',\n component: EventSchedule,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n 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',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u65E5\u7A0B\u5217\u8868',\n control: { type: 'object' },\n },\n className: {\n description: '\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D',\n control: { type: 'text' },\n },\n },\n} satisfies Meta<typeof EventSchedule>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\n/**\n * \u9ED8\u8BA4\u5C55\u793A - \u4E24\u4E2A\u6D3B\u52A8\n */\nexport const Default: Story = {\n args: {\n data: mockData,\n },\n}\n\n/**\n * \u4E09\u4E2A\u6D3B\u52A8\u5C55\u793A\n */\nexport const ThreeEvents: Story = {\n args: {\n data: threeEventsData,\n },\n}\n\n/**\n * \u5355\u4E2A\u6D3B\u52A8\n */\nexport const SingleEvent: Story = {\n args: {\n data: {\n scheduleList: [\n {\n title: '\u9650\u65F6\u79D2\u6740\u6D3B\u52A8',\n date: '2024-12-01',\n active: true,\n backgroundImage: 'https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=200&h=150&fit=crop',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5\u5168\u5929',\n },\n {\n icon: <ClockIcon />,\n label: '\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2',\n },\n {\n icon: <GiftIcon />,\n label: '\u79D2\u6740\u4EF7\u4F4E\u81F33\u6298',\n },\n ],\n },\n ],\n },\n },\n}\n\n/**\n * \u65E0\u80CC\u666F\u56FE\u7247\n */\nexport const WithoutBackgroundImage: Story = {\n args: {\n data: {\n scheduleList: [\n {\n title: '\u590F\u5B63\u6E05\u4ED3\u7279\u5356',\n date: '2024-06-01',\n active: true,\n items: [\n {\n icon: <CalendarIcon />,\n label: '6\u67081\u65E5 - 6\u670830\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5168\u5929\u5019\u4F18\u60E0',\n },\n {\n icon: <GiftIcon />,\n label: '\u4E70\u4E00\u9001\u4E00',\n },\n ],\n },\n {\n title: '\u65B0\u54C1\u4E0A\u5E02',\n date: '2024-07-01',\n active: false,\n items: [\n {\n icon: <CalendarIcon />,\n label: '7\u67081\u65E5\u8D77',\n },\n {\n icon: <ClockIcon />,\n label: '\u6301\u7EED\u4E00\u4E2A\u6708',\n },\n {\n icon: <GiftIcon />,\n label: '\u65B0\u54C1\u5C1D\u9C9C\u4EF7',\n },\n ],\n },\n ],\n },\n },\n}\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,
|
|
6
|
-
"names": ["eventSchedule_stories_exports", "__export", "
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\n\nimport EventSchedule, { type EventScheduleData } from '../biz-components/EventSchedule/index.js'\n\n// \u6A21\u62DF\u56FE\u6807\u7EC4\u4EF6\nconst CalendarIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M13.333 1.667V5M6.667 1.667V5M2.5 8.333h15\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\nconst ClockIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M10 18.333a8.333 8.333 0 100-16.666 8.333 8.333 0 000 16.666z\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M10 5v5l3.333 1.667\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\nconst GiftIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n 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\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n)\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: EventScheduleData = {\n scheduleList: [\n {\n title: '\u65E9\u9E1F\u4E13\u5C5E\u798F\u5229',\n startDate: '2024-12-01',\n endDate: '2024-12-15',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5 - 12\u670815\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u9650\u65F6\u4F18\u60E0 48 \u5C0F\u65F6',\n },\n {\n icon: <GiftIcon />,\n label: '\u8D2D\u4E70\u5373\u9001\u7CBE\u7F8E\u793C\u54C1',\n },\n ],\n },\n {\n title: '\u5723\u8BDE\u7279\u60E0\u6D3B\u52A8',\n startDate: '2024-12-16',\n endDate: '2024-12-31',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670816\u65E5 - 12\u670831\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5168\u5929\u5019\u4F18\u60E0',\n },\n {\n icon: <GiftIcon />,\n label: '\u6EE1\u989D\u8D60\u9001\u5723\u8BDE\u793C\u76D2',\n },\n ],\n },\n ],\n backgroundImage: {\n active: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1.jpg?v=1766391000',\n laptop: 'https://example.com/laptop.jpg',\n desktop:\n 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_c4d0ec1e-5484-46be-af8c-273935f4ba28.jpg?v=1766398957',\n lgDesktop:\n 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_1_44d92293-1f4b-483a-8233-6277b0437e7c.jpg?v=1766391004',\n },\n inactive: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2.jpg?v=1766390999',\n laptop: 'https://example.com/laptop.jpg',\n desktop:\n 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_99fd4944-58ee-4c90-9b0d-b758926386fe.jpg?v=1766398957',\n lgDesktop:\n 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/1_2_2_844d5e75-a3d2-4f2b-b1a6-cad60c67c871.jpg?v=1766391005',\n },\n },\n}\n\n// \u4E09\u4E2A\u6D3B\u52A8\u7684\u6570\u636E\nconst threeEventsData: EventScheduleData = {\n scheduleList: [\n {\n title: '\u65B0\u5E74\u9884\u70ED\u6D3B\u52A8',\n startDate: '2024-12-01',\n endDate: '2024-12-10',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5 - 12\u670810\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u6BCF\u65E5\u4E0A\u534810\u70B9\u5F00\u62A2',\n },\n {\n icon: <GiftIcon />,\n label: '\u524D100\u540D\u9001\u795E\u79D8\u793C\u7269',\n },\n ],\n },\n {\n title: '\u5723\u8BDE\u72C2\u6B22',\n startDate: '2024-12-11',\n endDate: '2024-12-25',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670811\u65E5 - 12\u670825\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5168\u5929\u4F18\u60E0\u4E0D\u95F4\u65AD',\n },\n {\n icon: <GiftIcon />,\n label: '\u6EE1\u51CF\u6D3B\u52A8\u6700\u9AD8\u7701500',\n },\n ],\n },\n {\n title: '\u8DE8\u5E74\u7279\u60E0',\n startDate: '2024-12-26',\n endDate: '2025-01-01',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u670826\u65E5 - 1\u67081\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5012\u8BA1\u65F6\u7279\u60E0',\n },\n {\n icon: <GiftIcon />,\n label: '\u65B0\u5E74\u793C\u5305\u9650\u91CF\u62A2\u8D2D',\n },\n ],\n },\n ],\n}\n\nconst meta = {\n title: 'Biz Components/EventSchedule',\n component: EventSchedule,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n 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',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u65E5\u7A0B\u5217\u8868',\n control: { type: 'object' },\n },\n className: {\n description: '\u81EA\u5B9A\u4E49\u6837\u5F0F\u7C7B\u540D',\n control: { type: 'text' },\n },\n },\n} satisfies Meta<typeof EventSchedule>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\n/**\n * \u9ED8\u8BA4\u5C55\u793A - \u4E24\u4E2A\u6D3B\u52A8\n */\nexport const Default: Story = {\n args: {\n data: mockData,\n },\n}\n\n/**\n * \u4E09\u4E2A\u6D3B\u52A8\u5C55\u793A\n */\nexport const ThreeEvents: Story = {\n args: {\n data: threeEventsData,\n },\n}\n\n/**\n * \u5355\u4E2A\u6D3B\u52A8\n */\nexport const SingleEvent: Story = {\n args: {\n data: {\n scheduleList: [\n {\n title: '\u9650\u65F6\u79D2\u6740\u6D3B\u52A8',\n startDate: '2025-12-23',\n endDate: '2025-12-23',\n items: [\n {\n icon: <CalendarIcon />,\n label: '12\u67081\u65E5\u5168\u5929',\n },\n {\n icon: <ClockIcon />,\n label: '\u6BCF\u5C0F\u65F6\u6574\u70B9\u5F00\u62A2',\n },\n {\n icon: <GiftIcon />,\n label: '\u79D2\u6740\u4EF7\u4F4E\u81F33\u6298',\n },\n ],\n },\n ],\n },\n },\n}\n\n/**\n * \u81EA\u52A8\u5224\u65AD\u6FC0\u6D3B\u72B6\u6001 - \u6839\u636E\u5F53\u524D\u65F6\u95F4\u81EA\u52A8\u5224\u65AD\u54EA\u4E2A\u6D3B\u52A8\u662F\u6FC0\u6D3B\u72B6\u6001\n * \u8FD9\u4E2A\u793A\u4F8B\u5C55\u793A\u4E86\u7EC4\u4EF6\u5982\u4F55\u6839\u636E startDate \u548C endDate \u81EA\u52A8\u5224\u65AD\u6D3B\u52A8\u662F\u5426\u6FC0\u6D3B\n */\nexport const AutoActiveStatus: Story = {\n args: {\n data: {\n scheduleList: [\n {\n title: '\u5DF2\u7ED3\u675F\u7684\u6D3B\u52A8', \n startDate: '2024-01-01',\n endDate: '2024-01-31',\n items: [\n {\n icon: <CalendarIcon />,\n label: '1\u67081\u65E5 - 1\u670831\u65E5',\n },\n {\n icon: <ClockIcon />,\n label: '\u5DF2\u7ED3\u675F',\n },\n {\n icon: <GiftIcon />,\n label: '\u611F\u8C22\u53C2\u4E0E',\n },\n ],\n },\n {\n title: '\u8FDB\u884C\u4E2D\u7684\u6D3B\u52A8',\n startDate: '2025-01-01',\n endDate: '2025-12-31',\n items: [\n {\n icon: <CalendarIcon />,\n label: '2025\u5E74\u5168\u5E74',\n },\n {\n icon: <ClockIcon />,\n label: '\u6B63\u5728\u8FDB\u884C\u4E2D',\n },\n {\n icon: <GiftIcon />,\n label: '\u9650\u65F6\u4F18\u60E0',\n },\n ],\n },\n {\n title: '\u5373\u5C06\u5F00\u59CB\u7684\u6D3B\u52A8',\n startDate: '2026-01-01',\n endDate: '2026-12-31',\n items: [\n {\n icon: <CalendarIcon />,\n label: '2026\u5E74\u5F00\u59CB',\n },\n {\n icon: <ClockIcon />,\n label: '\u656C\u8BF7\u671F\u5F85',\n },\n {\n icon: <GiftIcon />,\n label: '\u8D85\u503C\u798F\u5229',\n },\n ],\n },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,YAAAC,EAAA,gBAAAC,EAAA,gBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAP,GAOE,IAAAQ,EAAA,6BANFC,EAAkB,iBAElBC,EAAsD,uDAGtD,MAAMC,EAAe,OACnB,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,oBAAC,QACC,EAAE,6JACF,OAAO,eACP,YAAY,MACZ,cAAc,QACd,eAAe,QACjB,KACA,OAAC,QACC,EAAE,6CACF,OAAO,eACP,YAAY,MACZ,cAAc,QACd,eAAe,QACjB,GACF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A,CACE,QAAM,OAACC,EAAA,EAAS,EAChB,MAAO,uCACT,CACF,CACF,CACF,CACF,CACF,CACF,EAMaX,EAA0B,CACrC,KAAM,CACJ,KAAM,CACJ,aAAc,CACZ,CACE,MAAO,uCACP,UAAW,aACX,QAAS,aACT,MAAO,CACL,CACE,QAAM,OAACS,EAAA,EAAa,EACpB,MAAO,kCACT,EACA,CACE,QAAM,OAACC,EAAA,EAAU,EACjB,MAAO,oBACT,EACA,CACE,QAAM,OAACC,EAAA,EAAS,EAChB,MAAO,0BACT,CACF,CACF,EACA,CACE,MAAO,uCACP,UAAW,aACX,QAAS,aACT,MAAO,CACL,CACE,QAAM,OAACF,EAAA,EAAa,EACpB,MAAO,wBACT,EACA,CACE,QAAM,OAACC,EAAA,EAAU,EACjB,MAAO,gCACT,EACA,CACE,QAAM,OAACC,EAAA,EAAS,EAChB,MAAO,0BACT,CACF,CACF,EACA,CACE,MAAO,6CACP,UAAW,aACX,QAAS,aACT,MAAO,CACL,CACE,QAAM,OAACF,EAAA,EAAa,EACpB,MAAO,wBACT,EACA,CACE,QAAM,OAACC,EAAA,EAAU,EACjB,MAAO,0BACT,EACA,CACE,QAAM,OAACC,EAAA,EAAS,EAChB,MAAO,0BACT,CACF,CACF,CACF,CACF,CACF,CACF",
|
|
6
|
+
"names": ["eventSchedule_stories_exports", "__export", "AutoActiveStatus", "Default", "SingleEvent", "ThreeEvents", "eventSchedule_stories_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_EventSchedule", "CalendarIcon", "ClockIcon", "GiftIcon", "mockData", "threeEventsData", "meta", "EventSchedule"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var a=Object.create;var p=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var u=(t,o)=>{for(var s in o)p(t,s,{get:o[s],enumerable:!0})},l=(t,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!m.call(t,e)&&e!==s&&p(t,e,{get:()=>o[e],enumerable:!(i=r(o,e))||i.enumerable});return t};var d=(t,o,s)=>(s=t!=null?a(f(t)):{},l(o||!t||!t.__esModule?p(s,"default",{value:t,enumerable:!0}):s,t)),h=t=>l(p({},"__esModule",{value:!0}),t);var S={};u(S,{Default:()=>j,FullFeatures:()=>D,ResponsiveBackground:()=>G,WithoutButton:()=>k,default:()=>b});module.exports=h(S);var n=d(require("../biz-components/PromotionalBar/index.js"));const g={title:"\u63A8\u5E7F\u680F",contentTitle:"Special Promotion",contentDesc:"Get amazing deals on our best-selling products this season",buttonText:"Shop Now",buttonLink:"#",backgroundImage:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188",tablet:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189",laptop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189"}},y={contentTitle:"Exclusive Offer",contentDesc:"Limited time deals with free shipping on orders over $50",buttonText:"Learn More",buttonLink:"#",backgroundImage:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188",tablet:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189",laptop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189"}},v={title:"Biz Components/PromotionalBar",component:n.default,parameters:{layout:"fullscreen",docs:{description:{component:"\u63A8\u5E7F\u680F\u7EC4\u4EF6 - \u652F\u6301\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u3001\u6807\u9898\u3001\u63CF\u8FF0\u548C\u884C\u52A8\u6309\u94AE"}}},tags:["autodocs"],argTypes:{data:{description:"\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u6807\u9898\u3001\u63CF\u8FF0\u3001\u6309\u94AE\u548C\u80CC\u666F\u56FE\u7247"}},args:{data:g}};var b=v;const j={args:{}},G={args:{data:y}},k={args:{data:{contentTitle:"New Arrivals",contentDesc:"Check out our latest collection of premium products",backgroundImage:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188",tablet:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189",laptop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189"}}}},D={args:{data:{title:"Holiday Sale",subtitle:"2024 Special Event",contentTitle:"Up to 50% Off",contentDesc:"Enjoy massive discounts on thousands of items. Limited time offer!",buttonText:"Shop Now",buttonLink:"/sale",backgroundImage:{mobile:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188",tablet:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189",laptop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189",desktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189",lgDesktop:"https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189"}}}};
|
|
2
2
|
//# sourceMappingURL=promotionalBar.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/promotionalBar.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport PromotionalBar, { type PromotionalBarData } from '../biz-components/PromotionalBar/index.js'\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E\nconst mockData: PromotionalBarData = {\n title: '\u63A8\u5E7F\u680F',\n
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["promotionalBar_stories_exports", "__export", "Default", "promotionalBar_stories_default", "__toCommonJS", "import_PromotionalBar", "mockData", "meta", "PromotionalBar"]
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport PromotionalBar, { type PromotionalBarData } from '../biz-components/PromotionalBar/index.js'\n\n// \u6A21\u62DF\u4E1A\u52A1\u6570\u636E - \u4F7F\u7528\u5355\u4E00\u80CC\u666F\u56FE\u7247\nconst mockData: PromotionalBarData = {\n title: '\u63A8\u5E7F\u680F',\n contentTitle: 'Special Promotion',\n contentDesc: 'Get amazing deals on our best-selling products this season',\n buttonText: 'Shop Now',\n buttonLink: '#',\n backgroundImage: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188',\n tablet: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189',\n laptop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189',\n desktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189',\n lgDesktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189',\n },\n}\n\n// \u4F7F\u7528\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\nconst responsiveData: PromotionalBarData = {\n contentTitle: 'Exclusive Offer',\n contentDesc: 'Limited time deals with free shipping on orders over $50',\n buttonText: 'Learn More',\n buttonLink: '#',\n backgroundImage: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188',\n tablet: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189',\n laptop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189',\n desktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189',\n lgDesktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189',\n },\n}\n\nconst meta = {\n title: 'Biz Components/PromotionalBar',\n component: PromotionalBar,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component: '\u63A8\u5E7F\u680F\u7EC4\u4EF6 - \u652F\u6301\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u3001\u6807\u9898\u3001\u63CF\u8FF0\u548C\u884C\u52A8\u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n data: {\n description: '\u4E1A\u52A1\u6570\u636E\uFF0C\u5305\u542B\u6807\u9898\u3001\u63CF\u8FF0\u3001\u6309\u94AE\u548C\u80CC\u666F\u56FE\u7247',\n },\n },\n args: {\n data: mockData,\n },\n} satisfies Meta<typeof PromotionalBar>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\n/**\n * \u9ED8\u8BA4\u5C55\u793A - \u4F7F\u7528\u5355\u4E00\u80CC\u666F\u56FE\u7247 URL\n */\nexport const Default: Story = {\n args: {},\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247 - \u4E0D\u540C\u5C4F\u5E55\u5C3A\u5BF8\u663E\u793A\u4E0D\u540C\u56FE\u7247\n */\nexport const ResponsiveBackground: Story = {\n args: {\n data: responsiveData,\n },\n}\n\n/**\n * \u65E0\u6309\u94AE - \u4EC5\u663E\u793A\u6807\u9898\u548C\u63CF\u8FF0\n */\nexport const WithoutButton: Story = {\n args: {\n data: {\n contentTitle: 'New Arrivals',\n contentDesc: 'Check out our latest collection of premium products',\n backgroundImage: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188',\n tablet: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189',\n laptop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189',\n desktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189',\n lgDesktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189',\n },\n },\n },\n}\n\n/**\n * \u5B8C\u6574\u529F\u80FD\u5C55\u793A\n */\nexport const FullFeatures: Story = {\n args: {\n data: {\n title: 'Holiday Sale',\n subtitle: '2024 Special Event',\n contentTitle: 'Up to 50% Off',\n contentDesc: 'Enjoy massive discounts on thousands of items. Limited time offer!',\n buttonText: 'Shop Now',\n buttonLink: '/sale',\n backgroundImage: {\n mobile: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group.jpg?v=1765273188',\n tablet: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-1.jpg?v=1765273189',\n laptop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-2.jpg?v=1765273189',\n desktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-3.jpg?v=1765273189',\n lgDesktop: 'https://cdn.shopify.com/s/files/1/0501/7678/6607/files/Group-4.jpg?v=1765273189',\n },\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,iBAAAC,EAAA,yBAAAC,EAAA,kBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAP,GAEA,IAAAQ,EAAwD,wDAGxD,MAAMC,EAA+B,CACnC,MAAO,qBACP,aAAc,oBACd,YAAa,6DACb,WAAY,WACZ,WAAY,IACZ,gBAAiB,CACf,OAAQ,gFACR,OAAQ,kFACR,OAAQ,kFACR,QAAS,kFACT,UAAW,iFACb,CACF,EAGMC,EAAqC,CACzC,aAAc,kBACd,YAAa,2DACb,WAAY,aACZ,WAAY,IACZ,gBAAiB,CACf,OAAQ,gFACR,OAAQ,kFACR,OAAQ,kFACR,QAAS,kFACT,UAAW,iFACb,CACF,EAEMC,EAAO,CACX,MAAO,gCACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UAAW,2JACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,YAAa,0HACf,CACF,EACA,KAAM,CACJ,KAAMH,CACR,CACF,EAEA,IAAOH,EAAQK,EAMR,MAAMT,EAAiB,CAC5B,KAAM,CAAC,CACT,EAKaE,EAA8B,CACzC,KAAM,CACJ,KAAMM,CACR,CACF,EAKaL,EAAuB,CAClC,KAAM,CACJ,KAAM,CACJ,aAAc,eACd,YAAa,sDACb,gBAAiB,CACf,OAAQ,gFACR,OAAQ,kFACR,OAAQ,kFACR,QAAS,kFACT,UAAW,iFACb,CACF,CACF,CACF,EAKaF,EAAsB,CACjC,KAAM,CACJ,KAAM,CACJ,MAAO,eACP,SAAU,qBACV,aAAc,gBACd,YAAa,qEACb,WAAY,WACZ,WAAY,QACZ,gBAAiB,CACf,OAAQ,gFACR,OAAQ,kFACR,OAAQ,kFACR,QAAS,kFACT,UAAW,iFACb,CACF,CACF,CACF",
|
|
6
|
+
"names": ["promotionalBar_stories_exports", "__export", "Default", "FullFeatures", "ResponsiveBackground", "WithoutButton", "promotionalBar_stories_default", "__toCommonJS", "import_PromotionalBar", "mockData", "responsiveData", "meta", "PromotionalBar"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var l=Object.create;var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var o in e)a(t,o,{get:e[o],enumerable:!0})},n=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of u(e))!h.call(t,s)&&s!==o&&a(t,s,{get:()=>e[s],enumerable:!(r=d(e,s))||r.enumerable});return t};var f=(t,e,o)=>(o=t!=null?l(c(t)):{},n(e||!t||!t.__esModule?a(o,"default",{value:t,enumerable:!0}):o,t)),g=t=>n(a({},"__esModule",{value:!0}),t);var M={};p(M,{CenterAligned:()=>x,CountdownOnly:()=>D,DarkTheme:()=>k,Default:()=>S,FullFeatures:()=>T,WithCountdown:()=>b,WithSubtitle:()=>w,default:()=>m});module.exports=g(M);var i=f(require("../biz-components/Title/index.js"));const y={title:"Biz Components/Title",component:i.default,parameters:{layout:"padded",docs:{description:{component:"Title \u7EC4\u4EF6 - \u652F\u6301\u6807\u9898\u3001\u526F\u6807\u9898\u3001\u5012\u8BA1\u65F6\u548C\u94FE\u63A5\u6309\u94AE"}}},tags:["autodocs"],argTypes:{as:{control:"select",options:["h1","h2","h3","h4","h5","h6"],description:"\u6807\u9898\u6807\u7B7E"},weight:{control:"select",options:["medium","semibold","bold","extraBold","black"],description:"\u5B57\u91CD"}}};var m=y;const S={args:{data:{title:"Welcome to Our Store",align:"left"}}},w={args:{data:{title:"Exclusive Holiday Benefits",subtitle:"Join us for amazing deals and special offers this season",align:"left"}}},b={args:{data:{title:"Flash Sale Ends Soon",subtitle:"Don't miss out on these limited-time offers",countdown:{targetDate:"2025-12-31T23:59:59",labels:{days:"Day",hours:"Hours",minutes:"Mins",seconds:"Secs"}},align:"left"}}},T={args:{data:{title:"Special Event Starting Soon",subtitle:"Get ready for the biggest sale of the year with exclusive deals",countdown:{targetDate:"2025-12-25T00:00:00",showDays:!0,showHours:!0,showMinutes:!0,showSeconds:!0,labels:{days:"Day",hours:"Hours",minutes:"Mins",seconds:"Secs"}},align:"left",extensions:{textLink:"Learn More",link:"#"}}}},x={args:{data:{title:"Centered Title with Countdown",subtitle:"This layout is perfect for hero sections",countdown:{targetDate:"2026-01-01T00:00:00"},align:"center"}}},k={args:{data:{title:"Dark Theme Title",subtitle:"Perfect for dark backgrounds",countdown:{targetDate:"2025-12-31T23:59:59"},theme:"dark",align:"left",extensions:{textLink:"Shop Now",link:"#"}}},parameters:{backgrounds:{default:"dark"}}},D={args:{data:{title:"Limited Time Offer",countdown:{targetDate:"2025-12-31T23:59:59",showDays:!0,showHours:!0,showMinutes:!0,showSeconds:!1},align:"left"}}};
|
|
2
|
+
//# sourceMappingURL=title.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/title.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport Title from '../biz-components/Title/index.js'\n\nconst meta = {\n title: 'Biz Components/Title',\n component: Title,\n parameters: {\n layout: 'padded',\n docs: {\n description: {\n component: 'Title \u7EC4\u4EF6 - \u652F\u6301\u6807\u9898\u3001\u526F\u6807\u9898\u3001\u5012\u8BA1\u65F6\u548C\u94FE\u63A5\u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n as: {\n control: 'select',\n options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n description: '\u6807\u9898\u6807\u7B7E',\n },\n weight: {\n control: 'select',\n options: ['medium', 'semibold', 'bold', 'extraBold', 'black'],\n description: '\u5B57\u91CD',\n },\n },\n} satisfies Meta<typeof Title>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\n/**\n * \u57FA\u7840\u6807\u9898\n */\nexport const Default: Story = {\n args: {\n data: {\n title: 'Welcome to Our Store',\n align: 'left',\n },\n },\n}\n\n/**\n * \u5E26\u526F\u6807\u9898\u7684\u6807\u9898\n */\nexport const WithSubtitle: Story = {\n args: {\n data: {\n title: 'Exclusive Holiday Benefits',\n subtitle: 'Join us for amazing deals and special offers this season',\n align: 'left',\n },\n },\n}\n\n/**\n * \u5E26\u5012\u8BA1\u65F6\u7684\u6807\u9898\n */\nexport const WithCountdown: Story = {\n args: {\n data: {\n title: 'Flash Sale Ends Soon',\n subtitle: \"Don't miss out on these limited-time offers\",\n countdown: {\n targetDate: '2025-12-31T23:59:59',\n labels: {\n days: 'Day',\n hours: 'Hours',\n minutes: 'Mins',\n seconds: 'Secs',\n },\n },\n align: 'left',\n },\n },\n}\n\n/**\n * \u5B8C\u6574\u529F\u80FD\u5C55\u793A - \u6807\u9898 + \u526F\u6807\u9898 + \u5012\u8BA1\u65F6 + \u6309\u94AE\n */\nexport const FullFeatures: Story = {\n args: {\n data: {\n title: 'Special Event Starting Soon',\n subtitle: 'Get ready for the biggest sale of the year with exclusive deals',\n countdown: {\n targetDate: '2025-12-25T00:00:00',\n showDays: true,\n showHours: true,\n showMinutes: true,\n showSeconds: true,\n labels: {\n days: 'Day',\n hours: 'Hours',\n minutes: 'Mins',\n seconds: 'Secs',\n },\n },\n align: 'left',\n extensions: {\n textLink: 'Learn More',\n link: '#',\n },\n },\n },\n}\n\n/**\n * \u5C45\u4E2D\u5BF9\u9F50\n */\nexport const CenterAligned: Story = {\n args: {\n data: {\n title: 'Centered Title with Countdown',\n subtitle: 'This layout is perfect for hero sections',\n countdown: {\n targetDate: '2026-01-01T00:00:00',\n },\n align: 'center',\n },\n },\n}\n\n/**\n * \u6697\u8272\u4E3B\u9898\n */\nexport const DarkTheme: Story = {\n args: {\n data: {\n title: 'Dark Theme Title',\n subtitle: 'Perfect for dark backgrounds',\n countdown: {\n targetDate: '2025-12-31T23:59:59',\n },\n theme: 'dark',\n align: 'left',\n extensions: {\n textLink: 'Shop Now',\n link: '#',\n },\n },\n },\n parameters: {\n backgrounds: { default: 'dark' },\n },\n}\n\n/**\n * \u4EC5\u5012\u8BA1\u65F6\uFF08\u65E0\u526F\u6807\u9898\uFF09\n */\nexport const CountdownOnly: Story = {\n args: {\n data: {\n title: 'Limited Time Offer',\n countdown: {\n targetDate: '2025-12-31T23:59:59',\n showDays: true,\n showHours: true,\n showMinutes: true,\n showSeconds: false, // \u4E0D\u663E\u793A\u79D2\u6570\n },\n align: 'left',\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,EAAA,kBAAAC,EAAA,cAAAC,EAAA,YAAAC,EAAA,iBAAAC,EAAA,kBAAAC,EAAA,iBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAV,GACA,IAAAW,EAAkB,+CAElB,MAAMC,EAAO,CACX,MAAO,uBACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,SACR,KAAM,CACJ,YAAa,CACX,UAAW,6HACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,GAAI,CACF,QAAS,SACT,QAAS,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,EAC5C,YAAa,0BACf,EACA,OAAQ,CACN,QAAS,SACT,QAAS,CAAC,SAAU,WAAY,OAAQ,YAAa,OAAO,EAC5D,YAAa,cACf,CACF,CACF,EAEA,IAAOJ,EAAQG,EAMR,MAAMP,EAAiB,CAC5B,KAAM,CACJ,KAAM,CACJ,MAAO,uBACP,MAAO,MACT,CACF,CACF,EAKaG,EAAsB,CACjC,KAAM,CACJ,KAAM,CACJ,MAAO,6BACP,SAAU,2DACV,MAAO,MACT,CACF,CACF,EAKaD,EAAuB,CAClC,KAAM,CACJ,KAAM,CACJ,MAAO,uBACP,SAAU,8CACV,UAAW,CACT,WAAY,sBACZ,OAAQ,CACN,KAAM,MACN,MAAO,QACP,QAAS,OACT,QAAS,MACX,CACF,EACA,MAAO,MACT,CACF,CACF,EAKaD,EAAsB,CACjC,KAAM,CACJ,KAAM,CACJ,MAAO,8BACP,SAAU,kEACV,UAAW,CACT,WAAY,sBACZ,SAAU,GACV,UAAW,GACX,YAAa,GACb,YAAa,GACb,OAAQ,CACN,KAAM,MACN,MAAO,QACP,QAAS,OACT,QAAS,MACX,CACF,EACA,MAAO,OACP,WAAY,CACV,SAAU,aACV,KAAM,GACR,CACF,CACF,CACF,EAKaJ,EAAuB,CAClC,KAAM,CACJ,KAAM,CACJ,MAAO,gCACP,SAAU,2CACV,UAAW,CACT,WAAY,qBACd,EACA,MAAO,QACT,CACF,CACF,EAKaE,EAAmB,CAC9B,KAAM,CACJ,KAAM,CACJ,MAAO,mBACP,SAAU,+BACV,UAAW,CACT,WAAY,qBACd,EACA,MAAO,OACP,MAAO,OACP,WAAY,CACV,SAAU,WACV,KAAM,GACR,CACF,CACF,EACA,WAAY,CACV,YAAa,CAAE,QAAS,MAAO,CACjC,CACF,EAKaD,EAAuB,CAClC,KAAM,CACJ,KAAM,CACJ,MAAO,qBACP,UAAW,CACT,WAAY,sBACZ,SAAU,GACV,UAAW,GACX,YAAa,GACb,YAAa,EACf,EACA,MAAO,MACT,CACF,CACF",
|
|
6
|
+
"names": ["title_stories_exports", "__export", "CenterAligned", "CountdownOnly", "DarkTheme", "Default", "FullFeatures", "WithCountdown", "WithSubtitle", "title_stories_default", "__toCommonJS", "import_Title", "meta", "Title"]
|
|
7
|
+
}
|
|
@@ -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
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
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 client";import{jsx as
|
|
1
|
+
"use client";import{jsx as i,jsxs as o}from"react/jsx-runtime";import*as d from"react";import{cn as l}from"../../helpers/index.js";import{Text as v,Picture as w}from"../../components/index.js";import{Swiper as x,SwiperSlide as h}from"swiper/react";import u from"dayjs";const S=(e,t)=>{const n=u(),a=u(e).startOf("day"),s=u(t).endOf("day");return n.isAfter(a)&&n.isBefore(s)},B=e=>S(e.startDate,e.endDate),E=({active:e,className:t})=>o("div",{className:l("relative my-1 flex h-2 flex-1 items-center justify-center",t),children:[i("div",{className:l("h-2 w-full ",{"bg-[#F6CD4E] rounded-full":e,"bg-[#EAEAEC]":!e})}),i("div",{className:"absolute inset-0 flex items-center justify-center",children:i("div",{className:l("size-4 rounded-full border-2 transition-colors",{"border-[#F6CD4E] bg-[#F6CD4E]":e,"border-[#EAEAEC] bg-[#EAEAEC]":!e})})})]}),N=e=>typeof e=="object"&&("active"in e||"inactive"in e),m=e=>{if(!e)return;if(typeof e=="string")return e;const{mobile:t,laptop:n,desktop:a,lgDesktop:s}=e,r=[];return s&&r.push(s),a&&r.push(`${a} 1920`),n&&r.push(`${n} 1440`),t&&r.push(`${t} 1024`),r.length>0?r.join(", "):void 0},k=(e,t)=>{if(e){if(N(e)){const n=t?e.active:e.inactive;return m(n)}return m(e)}},b=({active:e,item:t,backgroundImage:n,className:a})=>{const s=d.useMemo(()=>k(n,e),[n,e]);return o("div",{className:l("rounded-box laptop:h-[160px] relative flex h-[120px] min-w-0 flex-1 flex-col justify-between gap-2 overflow-hidden",a),children:[i(w,{source:s,alt:"",className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"}),o("div",{className:"relative z-20 size-full p-4",children:[i("h2",{className:l("desktop:text-[24px] text-[20px] font-bold leading-[1.2] text-[#080A0F]"),dangerouslySetInnerHTML:{__html:t.title}}),i("div",{className:"flex flex-col gap-0.5",children:t.items.map((r,c)=>o("div",{className:"flex items-center gap-2",children:[r.icon&&i("div",{className:"desktop:size-6 size-5 shrink-0",children:i("img",{src:r.icon,alt:"",className:"size-full"})}),i(v,{html:r.label,className:l("desktop:text-[18px] flex-1 text-[14px] font-bold leading-[1.4] text-[#080A0F]")})]},c))})]})]})},g=d.forwardRef(({classNames:e={},data:t,...n},a)=>{const s=d.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),r=d.useMemo(()=>{switch(s){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:s,spaceBetween:16},1440:{spaceBetween:16,slidesPerView:s}};case 4:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:3.2,spaceBetween:16},1440:{slidesPerView:s}};default:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:1},1024:{slidesPerView:s,spaceBetween:16},1440:{slidesPerView:s}}}},[s]);return i("div",{ref:a,className:l("desktop:px-16 laptop:px-16 tablet:px-8 w-full overflow-hidden px-4",e?.root),...n,children:i("div",{className:"flex w-full flex-col gap-4",children:i(x,{breakpoints:r,className:"w-full !overflow-visible",children:t.scheduleList.map((c,f)=>{const p=B(c);return o(h,{children:[i(E,{active:p}),i(b,{active:p,className:"mt-4",item:c,backgroundImage:t.backgroundImage})]},"SwiperSlideItem"+f)})})})})});g.displayName="EventSchedule";var y=g;export{y as default};
|
|
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": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cn", "Text", "Picture", "Swiper", "SwiperSlide", "TimelineNode", "active", "
|
|
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": "aA4II,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBA1IJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,QAAAC,EAAM,WAAAC,M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,cAAe,KACf,aAAc,EAChB,EACA,IAAK,CACH,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,EAChB,EACA,KAAM,CACJ,aAAc,GACd,cAAe,CACjB,CACF,EACF,IAAK,GACH,MAAO,CACL,EAAG,CACD,cAAe,KACf,aAAc,EAChB,EACA,IAAK,CACH,cAAe,GACjB,EACA,KAAM,CACJ,cAAeA,EACf,aAAc,EAChB,EACA,KAAM,CACJ,aAAc,GACd,cAAeA,CACjB,CACF,EACF,IAAK,GACH,MAAO,CACL,EAAG,CACD,cAAe,KACf,aAAc,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,EAEhB,OACEzC,EAAC,OACC,IAAKwC,EACL,UAAWrC,EAAG,qEAAsEkC,GAAY,IAAI,EACnG,GAAGE,EAEJ,SAAAvC,EAAC,OAAI,UAAU,6BACb,SAAAA,EAACM,EAAA,CAAO,YAAaoC,EAAmB,UAAU,2BAC/C,SAAAJ,EAAK,aAAa,IAAI,CAACtB,EAAMmB,IAAU,CACtC,MAAML,EAAWf,EAAoBC,CAAI,EACzC,OACEf,EAACM,EAAA,CAEC,UAAAP,EAACiB,EAAA,CAAa,OAAQa,EAAU,EAChC9B,EAACgC,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,IAAOO,EAAQP",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cn", "Text", "Picture", "Swiper", "SwiperSlide", "dayjs", "isInTimeRange", "startDate", "endDate", "now", "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", "EventSchedule_default"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
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
|
-
|
|
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 client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as c}from"react/jsx-runtime";import*as p from"react";import{cn as u}from"../../helpers/index.js";import{Heading as m,Button as f,Picture as g,Container as d}from"../../components/index.js";const x=l=>{if(!l)return;if(typeof l=="string")return l;const{mobile:t,tablet:i,laptop:n,desktop:o,lgDesktop:s}=l,e=[];return s?e.push(s):o?e.push(o):n?e.push(n):i?e.push(i):t&&e.push(t),o&&s&&e.push(`${o} 1920`),n&&(o||s)&&e.push(`${n} 1440`),i&&(n||o||s)&&e.push(`${i} 1024`),t&&(i||n||o||s)&&e.push(`${t} 768`),e.length>0?e.join(", "):void 0},a=p.forwardRef(({className:l,data:t,...i},n)=>{const{backgroundImage:o}=t,s=p.useMemo(()=>x(o),[o]);return r("div",{ref:n,className:u("w-full",l),...i,children:r(d,{className:"laptop:h-[192px] lg-desktop:h-[240px] h-[240px]",children:c("div",{className:"promotional-bar-content rounded-box relative h-full overflow-hidden",children:[c("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&&r(m,{className:"text-[#F5F6F7]",size:3,children:t.contentTitle}),t.contentDesc&&r("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}),r("div",{className:"laptop:mt-4 mt-1",children:t.buttonText&&r(f,{as:"a",variant:"link",className:"!p-0 text-[#F5F6F7]",href:t.buttonLink,children:t.buttonText})})]}),r(g,{source:s,className:"absolute inset-0 z-10",imgClassName:"h-full object-cover"})]})})})});a.displayName="PromotionalBar";var b=a;export{b as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/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'\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cn", "Heading", "Button", "Picture", "Container", "
|
|
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": "aAyFU,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAvFV,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,WAAAC,EAAS,UAAAC,EAAQ,WAAAC,EAAS,aAAAC,MAAiB,4BA6CpD,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,G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", "Heading", "Button", "Picture", "Container", "convertResponsiveImageToString", "backgroundImage", "mobile", "tablet", "laptop", "desktop", "lgDesktop", "parts", "PromotionalBar", "className", "data", "props", "ref", "pictureSource", "PromotionalBar_default"]
|
|
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 client";import{jsx as s,jsxs as b}from"react/jsx-runtime";import p,{useState as v,useEffect as C}from"react";import g from"dayjs";import{cn as k}from"../../helpers/utils.js";const x=n=>{const o=g(),e=g(n).diff(o,"second");if(e<=0)return{days:0,hours:0,minutes:0,seconds:0};const u=Math.floor(e/(24*60*60)),c=Math.floor(e%(24*60*60)/(60*60)),d=Math.floor(e%(60*60)/60),f=e%60;return{days:u,hours:c,minutes:d,seconds:f}},L=({value:n,label:o})=>b("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:[s("p",{className:"lg-desktop:text-2xl text-[20px] font-bold leading-[1.2] tracking-[-0.96px]",children:String(n).padStart(2,"0")}),s("p",{className:"text-[12px] font-bold leading-[1.4] tracking-[-0.24px]",children:o})]}),N=()=>s("p",{className:"lg-desktop:text-2xl text-info-primary text-center text-xl font-bold leading-[1.2] tracking-[-0.96px]",children:":"}),h=p.forwardRef(({config:n,className:o},m)=>{const{targetDate:e,showDays:u=!0,showHours:c=!0,showMinutes:d=!0,showSeconds:f=!0,labels:r={}}=n,[l,y]=v(()=>x(e));C(()=>{const a=setInterval(()=>{y(x(e))},1e3);return()=>clearInterval(a)},[e]);const i={days:r.days||"Day",hours:r.hours||"Hours",minutes:r.minutes||"Mins",seconds:r.seconds||"Secs"},t=[];return u&&t.push({value:l.days,label:i.days}),c&&t.push({value:l.hours,label:i.hours}),d&&t.push({value:l.minutes,label:i.minutes}),f&&t.push({value:l.seconds,label:i.seconds}),s("div",{ref:m,className:k("flex items-center gap-1",o),children:t.map((a,w)=>b(p.Fragment,{children:[s(L,{value:a.value,label:a.label}),w<t.length-1&&s(N,{})]},a.label))})});h.displayName="Countdown";var D=h;export{D as default};
|
|
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": "aA2CI,OACE,OAAAA,EADF,QAAAC,MAAA,oBA1CJ,O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C,EAAG,GAAI,EAEP,MAAO,IAAM,cAAcsB,CAAK,CAClC,EAAG,CAACtB,CAAU,CAAC,EAEf,MAAMuB,EAAgB,CACpB,KAAMJ,EAAO,MAAQ,MACrB,MAAOA,EAAO,OAAS,QACvB,QAASA,EAAO,SAAW,OAC3B,QAASA,EAAO,SAAW,MAC7B,EAEMK,EAAQ,CAAC,EACf,OAAIT,GAAUS,EAAM,KAAK,CAAE,MAAOJ,EAAS,KAAM,MAAOG,EAAc,IAAK,CAAC,EACxEP,GAAWQ,EAAM,KAAK,CAAE,MAAOJ,EAAS,MAAO,MAAOG,EAAc,KAAM,CAAC,EAC3EN,GAAaO,EAAM,KAAK,CAAE,MAAOJ,EAAS,QAAS,MAAOG,EAAc,OAAQ,CAAC,EACjFL,GAAaM,EAAM,KAAK,CAAE,MAAOJ,EAAS,QAAS,MAAOG,EAAc,OAAQ,CAAC,EAGnF/B,EAAC,OAAI,IAAKsB,EAAK,UAAWhB,EAAG,0BAA2Be,CAAS,EAC9D,SAAAW,EAAM,IAAI,CAACC,EAAMC,IAChBjC,EAACC,EAAM,SAAN,CACC,UAAAF,EAACe,EAAA,CAAc,MAAOkB,EAAK,MAAO,MAAOA,EAAK,MAAO,EACpDC,EAAQF,EAAM,OAAS,GAAKhC,EAACkB,EAAA,EAAmB,IAF9Be,EAAK,KAG1B,CACD,EACH,CAEJ,CAAC,EAEDd,EAAU,YAAc,YAExB,IAAOgB,EAAQhB",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useState", "useEffect", "dayjs", "cn", "calculateTimeLeft", "targetDate", "now", "diff", "days", "hours", "minutes", "seconds", "CountdownUnit", "value", "label", "CountdownSeparator", "Countdown", "config", "className", "ref", "showDays", "showHours", "showMinutes", "showSeconds", "labels", "timeLeft", "setTimeLeft", "timer", "defaultLabels", "units", "unit", "index", "Countdown_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as w}from"react/jsx-runtime";import q,{useEffect as G,useRef as c,useImperativeHandle as J}from"react";import{gsap as x}from"gsap";import{SplitText as H}from"gsap/dist/SplitText";import{ScrollTrigger as M}from"gsap/dist/ScrollTrigger";import{cn as e}from"../../helpers/utils.js";import{Heading as K,Text as Q}from"../../components/index.js";import{withLayout as X}from"../../shared/Styles.js";import{trackUrlRef as Y}from"../../shared/trackUrlRef.js";import{useInView as Z}from"react-intersection-observer";import tt from"./Countdown.js";const E="link",$="title",P=({data:i,className:m})=>{const{theme:d,extensions:s,title:p,caption:f,align:o}=i;return s?.textLink?w("a",{className:e({"aiui-dark":d==="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":o==="center"},m),href:Y(s?.link,`${E}_${$}`),"data-headless-type-name":`${E}#${$}`,"data-headless-title-desc-button":`${p}#${f}`,children:[t("div",{className:e("flex-1 truncate whitespace-nowrap",{"flex-none":o==="center"}),children:s?.textLink}),t("div",{className:"size-6",children:t("svg",{width:"24",height:"24",className:"mb-[3px]",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",children:t("path",{className:"transition-all duration-[0.4s]",d:"M10.5 8L14.5 12L10.5 16",stroke:"#777",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null},j=q.forwardRef(({data:i,className:m,as:d="h2",weight:s="bold",mobFlexCol:p=!1},f)=>{const{title:o,caption:v,theme:z,extensions:S,align:r="left",subtitle:b,countdown:k}=i,T=c(null),a=c(null),n=c(null),l=c(null),{ref:B,inView:y}=Z();return J(f,()=>T.current),G(()=>{x.registerPlugin(H,M);function D(){if(!a.current)return;const I=a.current?.clientHeight||80;n.current&&n.current.revert(),l.current&&l.current.kill(),n.current=new H(a.current,{type:"words",wordsClass:"word"});const u=n.current.words;x.set(u,{opacity:0}),l.current=M.create({trigger:a.current,start:"bottom bottom-=4%",end:`bottom+=${I*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:V=>{const A=V.progress,N=u.length||1,C=.5,g=1/N,L=g*(1-C),R=(N-1)*L+g,F=Math.min(1,R>0?A/R:0);u.forEach((U,O)=>{const W=O*L,_=g;let h=(F-W)/_;h=Math.max(0,Math.min(1,h)),x.set(U,{opacity:h})})}})}return y&&D(),()=>{n.current&&n.current.revert(),l.current&&l.current.kill()}},[y]),(o||v)&&w("div",{ref:T,id:S?.id,className:e("titleBottom title-box mb-6 flex items-end justify-between gap-2",{"md-tablet:flex-col md-tablet:items-start":p}),children:[w("div",{ref:B,className:e("flex-1 space-y-4",m,{"aiui-dark":z==="dark","text-center":r==="center","text-right":r==="right","text-left":r==="left"}),children:[t(K,{ref:a,as:d,size:4,html:v||o,weight:s}),b&&t(Q,{html:b,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]"}),t(P,{data:i,className:e({hidden:r==="left"})}),k&&t(tt,{className:e("laptop:!mt-2 !mt-4 justify-start",{"justify-center":r==="center"}),config:k})]}),t(P,{data:i,className:e({hidden:r==="center"})})]})});j.displayName="Title";var dt=X(j);export{dt as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|