@anker-in/headless-ui 1.1.31 → 1.1.33

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/badge.stories.tsx"],
4
- "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Badge } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Badge',\n component: Badge,\n parameters: {\n layout: 'centered',\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'lg'],\n description: 'Badge \u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'lg' },\n },\n },\n },\n args: {\n size: 'lg',\n },\n} satisfies Meta<typeof Badge>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n children: 'New',\n },\n}\n\nexport const Examples: Story = {\n render() {\n return (\n <div className=\"flex flex-col space-y-4\">\n <Badge>New</Badge>\n </div>\n )\n },\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,aAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GA2CQ,IAAAM,EAAA,6BAzCRC,EAAsB,kCACtBC,EAAkB,iBAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAW,QACX,WAAY,CACV,OAAQ,UACV,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,IAAI,EACpB,YAAa,qBACb,MAAO,CACL,aAAc,CAAE,QAAS,IAAK,CAChC,CACF,CACF,EACA,KAAM,CACJ,KAAM,IACR,CACF,EAEA,IAAOL,EAAQK,EAIR,MAAMP,EAAiB,CAC5B,KAAM,CACJ,SAAU,KACZ,CACF,EAEaC,EAAkB,CAC7B,QAAS,CACP,SACE,OAAC,OAAI,UAAU,0BACb,mBAAC,SAAM,eAAG,EACZ,CAEJ,CACF",
6
- "names": ["badge_stories_exports", "__export", "Default", "Examples", "badge_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "meta"]
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Badge } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Badge',\n component: Badge,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n '\u5FBD\u7AE0\u7EC4\u4EF6\u7528\u4E8E\u663E\u793A\u72B6\u6001\u3001\u6807\u7B7E\u6216\u8BA1\u6570\u4FE1\u606F\u3002\u652F\u6301\u591A\u79CD\u5C3A\u5BF8\u548C\u6837\u5F0F\u53D8\u4F53\uFF0C\u5305\u62EC\u57FA\u7840\u8F6E\u5ED3\u6837\u5F0F\u3001\u586B\u5145\u6837\u5F0F\u4EE5\u53CA\u591A\u79CD\u4FC3\u9500\u5FBD\u7AE0\u7C7B\u578B\u3002\u4FC3\u9500\u5FBD\u7AE0\u652F\u6301\u56DB\u79CD\u7C7B\u578B\uFF1APlus\u4F1A\u5458\uFF08\u6DF1\u8272\u6E10\u53D8\uFF09\u4F7F\u7528\u7279\u6B8A\u6837\u5F0F\uFF0C\u5176\u4ED6\u7C7B\u578B\uFF08\u666E\u901A\u4F1A\u5458\u3001\u666E\u901A\u6298\u6263\u3001\u9650\u65F6\u6298\u6263\uFF09\u4F7F\u7528\u54C1\u724C\u8272\u586B\u5145\u6837\u5F0F\uFF0C\u6BCF\u79CD\u7C7B\u578B\u90FD\u914D\u6709\u4E13\u5C5E\u56FE\u6807\u3002',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'lg'],\n description: '\u5FBD\u7AE0\u5C3A\u5BF8\uFF1Asm (24px\u9AD8\u5EA6) \u6216 lg (24px\u9AD8\u5EA6\uFF0C\u5927\u5C4F\u5E5528px\u9AD8\u5EA6)',\n table: {\n defaultValue: { summary: 'lg' },\n },\n },\n variant: {\n control: {\n type: 'select',\n },\n options: ['outline', 'fill', 'promotional'],\n description: '\u5FBD\u7AE0\u53D8\u4F53\u6837\u5F0F\uFF1Aoutline (\u8F6E\u5ED3\u6837\u5F0F)\u3001fill (\u586B\u5145\u6837\u5F0F)\u3001promotional (\u4FC3\u9500\u6837\u5F0F\uFF0C\u652F\u6301\u4E0D\u540C\u4FC3\u9500\u7C7B\u578B)',\n table: {\n defaultValue: { summary: 'outline' },\n type: { summary: \"'outline' | 'fill' | 'promotional'\" },\n },\n },\n promotionalType: {\n control: {\n type: 'select',\n },\n options: ['plus-member', 'regular-member', 'regular-discount', 'time-limited-discount'],\n description:\n '\u4FC3\u9500\u7C7B\u578B\uFF1Aplus-member (Plus\u4F1A\u5458\uFF0C\u6DF1\u8272\u6E10\u53D8) \u4F7F\u7528\u7279\u6B8A\u6837\u5F0F\uFF0C\u5176\u4ED6\u7C7B\u578B\u4F7F\u7528\u54C1\u724C\u8272\u586B\u5145\u6837\u5F0F\uFF0C\u6BCF\u79CD\u7C7B\u578B\u914D\u6709\u4E13\u5C5E\u56FE\u6807',\n table: {\n defaultValue: { summary: 'undefined' },\n type: { summary: \"'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\" },\n },\n if: { arg: 'variant', eq: 'promotional' },\n },\n children: {\n control: 'text',\n description: '\u5FBD\u7AE0\u663E\u793A\u7684\u6587\u672C\u5185\u5BB9',\n table: {\n type: { summary: 'ReactNode' },\n },\n },\n className: {\n control: 'text',\n description: '\u989D\u5916\u7684CSS\u7C7B\u540D',\n table: {\n type: { summary: 'string' },\n },\n },\n },\n args: {\n size: 'lg',\n variant: 'outline',\n children: 'New',\n },\n} satisfies Meta<typeof Badge>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n children: 'New',\n },\n}\n\nexport const PlaygroundDemo: Story = {\n name: 'Playground Demo',\n render() {\n return (\n <div className=\"space-y-8 p-6\">\n {/* \u57FA\u7840\u793A\u4F8B */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u57FA\u7840\u5FBD\u7AE0</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"outline\">New</Badge>\n <Badge variant=\"outline\">20% OFF</Badge>\n <Badge variant=\"outline\">Limited</Badge>\n <Badge variant=\"outline\">Hot</Badge>\n </div>\n </div>\n\n {/* \u586B\u5145\u6837\u5F0F */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u586B\u5145\u5FBD\u7AE0</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"fill\">Sale</Badge>\n <Badge variant=\"fill\">15% OFF</Badge>\n <Badge variant=\"fill\">Bestseller</Badge>\n <Badge variant=\"fill\">Free Shipping</Badge>\n </div>\n </div>\n\n {/* \u4FC3\u9500\u5FBD\u7AE0 */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u4FC3\u9500\u5FBD\u7AE0</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n VIP Member\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n Premium\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u4F1A\u5458\u4E13\u4EAB\n </Badge>\n </div>\n </div>\n\n {/* \u5C3A\u5BF8\u5BF9\u6BD4 */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u5C3A\u5BF8\u5BF9\u6BD4</h3>\n <div className=\"space-y-3\">\n <div className=\"flex gap-4 items-center\">\n <span className=\"text-sm text-gray-600 w-16\">Small:</span>\n <Badge size=\"sm\" variant=\"outline\">\n New\n </Badge>\n <Badge size=\"sm\" variant=\"fill\">\n Sale\n </Badge>\n <Badge size=\"sm\" variant=\"promotional\" promotionalType=\"plus-member\">\n Plus\n </Badge>\n <Badge size=\"sm\" variant=\"promotional\" promotionalType=\"regular-member\">\n regular\n </Badge>\n <Badge size=\"sm\" variant=\"promotional\" promotionalType=\"regular-discount\">\n discount\n </Badge>\n <Badge size=\"sm\" variant=\"promotional\" promotionalType=\"time-limited-discount\">\n limited\n </Badge>\n </div>\n <div className=\"flex gap-4 items-center\">\n <span className=\"text-sm text-gray-600 w-16\">Large:</span>\n <Badge size=\"lg\" variant=\"outline\">\n New\n </Badge>\n <Badge size=\"lg\" variant=\"fill\">\n Sale\n </Badge>\n <Badge size=\"lg\" variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member\n </Badge>\n <Badge size=\"lg\" variant=\"promotional\" promotionalType=\"regular-member\">\n regular Member\n </Badge>\n <Badge size=\"lg\" variant=\"promotional\" promotionalType=\"regular-discount\">\n discount\n </Badge>\n <Badge size=\"lg\" variant=\"promotional\" promotionalType=\"time-limited-discount\">\n limited\n </Badge>\n </div>\n </div>\n </div>\n </div>\n )\n },\n}\n\nexport const Variants: Story = {\n name: 'All Variants',\n render() {\n return (\n <div className=\"flex gap-4 items-center\">\n <Badge variant=\"outline\">OUTLINE</Badge>\n <Badge variant=\"fill\">FILL</Badge>\n <Badge variant=\"promotional\">PROMOTIONAL</Badge>\n </div>\n )\n },\n}\n\nexport const Sizes: Story = {\n name: 'Size Variations',\n render() {\n return (\n <div className=\"space-y-4\">\n <div className=\"flex gap-4 items-center\">\n <span className=\"text-sm text-gray-600 w-16\">Small:</span>\n <Badge size=\"sm\" variant=\"outline\">\n New\n </Badge>\n <Badge size=\"sm\" variant=\"fill\">\n Sale\n </Badge>\n <Badge size=\"sm\" variant=\"promotional\" promotionalType=\"plus-member\">\n Plus\n </Badge>\n </div>\n <div className=\"flex gap-4 items-center\">\n <span className=\"text-sm text-gray-600 w-16\">Large:</span>\n <Badge size=\"lg\" variant=\"outline\">\n New\n </Badge>\n <Badge size=\"lg\" variant=\"fill\">\n Sale\n </Badge>\n <Badge size=\"lg\" variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member\n </Badge>\n </div>\n </div>\n )\n },\n}\n\nexport const Promotional: Story = {\n name: 'Promotional Badge',\n args: {\n variant: 'promotional',\n promotionalType: 'plus-member',\n children: 'Plus Member',\n },\n}\n\nexport const PromotionalExamples: Story = {\n name: 'Promotional Scenarios',\n render() {\n return (\n <div className=\"space-y-6 p-6\">\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u4F1A\u5458\u7B49\u7EA7\u6807\u8BC6</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n VIP Member\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Premium User\n </Badge>\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u7279\u6B8A\u6743\u76CA\u6807\u7B7E</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n \u4F1A\u5458\u4E13\u4EAB\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u4E13\u5C5E\u4F18\u60E0\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u65E9\u9E1F\u7279\u60E0\n </Badge>\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u4EA7\u54C1\u6807\u8BC6</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u9650\u91CF\u7248\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n \u8054\u540D\u6B3E\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u72EC\u5BB6\n </Badge>\n </div>\n </div>\n\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u5E26\u88C5\u9970\u56FE\u6807\u6548\u679C</h3>\n <div className=\"bg-gray-50 p-4 rounded-lg\">\n <p className=\"text-sm text-gray-600 mb-4\">\n \u4FC3\u9500\u5FBD\u7AE0\u81EA\u52A8\u5305\u542B\u5DE6\u4FA7\u88C5\u9970\u56FE\u6807\uFF0C\u91C7\u7528\u6E10\u53D8\u80CC\u666F\u8BBE\u8BA1\uFF0C\u6839\u636EpromotionalType\u663E\u793A\u4E0D\u540C\u7684\u989C\u8272\u548C\u56FE\u6807\n </p>\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member\n </Badge>\n </div>\n </div>\n </div>\n )\n },\n}\n\nexport const PromotionalTypes: Story = {\n name: 'Promotional Types',\n render() {\n return (\n <div className=\"space-y-8 p-6\">\n {/* \u6240\u6709\u4FC3\u9500\u7C7B\u578B\u5C55\u793A */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u6240\u6709\u4FC3\u9500\u7C7B\u578B</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus\u4E13\u4EAB\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n \u4F1A\u5458\u4EF7\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u9650\u65F6\u4F18\u60E0\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u95EA\u8D2D\u4E2D\n </Badge>\n </div>\n </div>\n\n {/* Plus\u4F1A\u5458\u7C7B\u578B */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">Plus\u4F1A\u5458\u4E13\u4EAB\uFF08\u6DF1\u8272\u6E10\u53D8\uFF09</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus\u4E13\u4EAB\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n VIP\u7279\u6743\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n \u4E13\u5C5E\u6743\u76CA\n </Badge>\n </div>\n </div>\n\n {/* \u666E\u901A\u4F1A\u5458\u7C7B\u578B */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u666E\u901A\u4F1A\u5458\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n \u4F1A\u5458\u4EF7\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n \u4F1A\u5458\u4E13\u5C5E\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n Member Only\n </Badge>\n </div>\n </div>\n\n {/* \u666E\u901A\u6298\u6263\u7C7B\u578B */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u666E\u901A\u6298\u6263\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u9650\u65F6\u4F18\u60E0\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u7279\u4EF7\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"regular-discount\">\n \u4FC3\u9500\u4E2D\n </Badge>\n </div>\n </div>\n\n {/* \u9650\u65F6\u6298\u6263\u7C7B\u578B */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u9650\u65F6\u6298\u6263\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u95EA\u8D2D\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u62A2\u8D2D\u4E2D\n </Badge>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u9650\u65F6\u79D2\u6740\n </Badge>\n </div>\n </div>\n\n {/* \u5411\u540E\u517C\u5BB9\u6027\u5C55\u793A */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u5411\u540E\u517C\u5BB9\uFF08\u9ED8\u8BA4\u6837\u5F0F\uFF09</h3>\n <div className=\"flex flex-wrap gap-4 items-center\">\n <Badge variant=\"promotional\">\u4FC3\u9500\u6807\u7B7E</Badge>\n <span className=\"text-sm text-gray-500\">\u2190 \u4E0D\u6307\u5B9ApromotionalType\u65F6\u4F7F\u7528\u9ED8\u8BA4\u7684regular-discount\u6837\u5F0F</span>\n </div>\n </div>\n </div>\n )\n },\n}\n\nexport const UsageExamples: Story = {\n name: 'Usage Examples',\n render() {\n return (\n <div className=\"space-y-6 p-6\">\n {/* \u4EA7\u54C1\u5361\u7247\u4E2D\u7684\u5E94\u7528 */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u4EA7\u54C1\u5361\u7247\u4E2D\u7684\u5E94\u7528</h3>\n <div className=\"border border-gray-200 rounded-lg p-4 max-w-sm\">\n <div className=\"flex gap-2 mb-3\">\n <Badge size=\"sm\" variant=\"fill\">\n 20% OFF\n </Badge>\n <Badge size=\"sm\" variant=\"outline\">\n New\n </Badge>\n </div>\n <h4 className=\"font-medium text-gray-900 mb-2\">AeroFit 2 Earbuds</h4>\n <div className=\"mb-3\">\n <Badge variant=\"promotional\" promotionalType=\"plus-member\">\n Plus Member Price\n </Badge>\n </div>\n <p className=\"text-lg font-semibold text-gray-900\">$79.99</p>\n </div>\n </div>\n\n {/* \u4E0D\u540C\u573A\u666F\u7684\u6DF7\u5408\u4F7F\u7528 */}\n <div className=\"space-y-4\">\n <h3 className=\"text-lg font-semibold text-gray-900\">\u6DF7\u5408\u4F7F\u7528\u573A\u666F</h3>\n <div className=\"space-y-3\">\n <div className=\"flex gap-2 items-center\">\n <span className=\"text-sm text-gray-600 w-20\">\u6298\u6263\u6807\u7B7E:</span>\n <Badge variant=\"fill\">25% OFF</Badge>\n <Badge variant=\"outline\">Limited Time</Badge>\n </div>\n <div className=\"flex gap-2 items-center\">\n <span className=\"text-sm text-gray-600 w-20\">\u4F1A\u5458\u6807\u8BC6:</span>\n <Badge variant=\"promotional\" promotionalType=\"regular-member\">\n \u4F1A\u5458\u4E13\u4EAB\n </Badge>\n </div>\n <div className=\"flex gap-2 items-center\">\n <span className=\"text-sm text-gray-600 w-20\">\u9650\u65F6\u4FC3\u9500:</span>\n <Badge variant=\"promotional\" promotionalType=\"time-limited-discount\">\n \u95EA\u8D2D\u4E2D\n </Badge>\n </div>\n <div className=\"flex gap-2 items-center\">\n <span className=\"text-sm text-gray-600 w-20\">\u72B6\u6001\u6807\u7B7E:</span>\n <Badge variant=\"outline\">Hot</Badge>\n <Badge variant=\"outline\">Bestseller</Badge>\n </div>\n </div>\n </div>\n </div>\n )\n },\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,mBAAAC,EAAA,gBAAAC,EAAA,wBAAAC,EAAA,qBAAAC,EAAA,UAAAC,EAAA,kBAAAC,EAAA,aAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAX,GA4FU,IAAAY,EAAA,6BA1FVC,EAAsB,kCACtBC,EAAkB,iBAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAW,QACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UACE,wuBACJ,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,IAAI,EACpB,YAAa,2HACb,MAAO,CACL,aAAc,CAAE,QAAS,IAAK,CAChC,CACF,EACA,QAAS,C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S,CACP,SACE,QAAC,OAAI,UAAU,gBAEb,qBAAC,OAAI,UAAU,YACb,oBAAC,MAAG,UAAU,sCAAsC,4DAAQ,KAC5D,QAAC,OAAI,UAAU,iDACb,qBAAC,OAAI,UAAU,kBACb,oBAAC,SAAM,KAAK,KAAK,QAAQ,OAAO,mBAEhC,KACA,OAAC,SAAM,KAAK,KAAK,QAAQ,UAAU,eAEnC,GACF,KACA,OAAC,MAAG,UAAU,iCAAiC,6BAAiB,KAChE,OAAC,OAAI,UAAU,OACb,mBAAC,SAAM,QAAQ,cAAc,gBAAgB,cAAc,6BAE3D,EACF,KACA,OAAC,KAAE,UAAU,sCAAsC,kBAAM,GAC3D,GACF,KAGA,QAAC,OAAI,UAAU,YACb,oBAAC,MAAG,UAAU,sCAAsC,gDAAM,KAC1D,QAAC,OAAI,UAAU,YACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,UAAU,6BAA6B,qCAAK,KAClD,OAAC,SAAM,QAAQ,OAAO,mBAAO,KAC7B,OAAC,SAAM,QAAQ,UAAU,wBAAY,GACvC,KACA,QAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,UAAU,6BAA6B,qCAAK,KAClD,OAAC,SAAM,QAAQ,cAAc,gBAAgB,iBAAiB,oCAE9D,GACF,KACA,QAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,UAAU,6BAA6B,qCAAK,KAClD,OAAC,SAAM,QAAQ,cAAc,gBAAgB,wBAAwB,8BAErE,GACF,KACA,QAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,UAAU,6BAA6B,qCAAK,KAClD,OAAC,SAAM,QAAQ,UAAU,eAAG,KAC5B,OAAC,SAAM,QAAQ,UAAU,sBAAU,GACrC,GACF,GACF,GACF,CAEJ,CACF",
6
+ "names": ["badge_stories_exports", "__export", "Default", "PlaygroundDemo", "Promotional", "PromotionalExamples", "PromotionalTypes", "Sizes", "UsageExamples", "Variants", "badge_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "meta"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import x,{useImperativeHandle as w,useRef as v}from"react";import h from"../Title/index.js";import{cn as l}from"../../helpers/utils.js";import b from"../../components/picture.js";import g from"../SwiperBox/index.js";import{withLayout as k}from"../../shared/Styles.js";import{Avatar as N,AvatarImage as y,AvatarFallback as C}from"../../components/avatar.js";import{Container as L}from"../../components/container.js";import{Text as E}from"../../components/text.js";import{useExposure as T}from"../../hooks/useExposure.js";import{trackUrlRef as M}from"../../shared/trackUrlRef.js";const m="copy",d="product_review",P=({data:e,configuration:s})=>{const o=v(null),a=n=>{const i=Number(n),p=Number.isFinite(i)?Math.max(0,Math.floor(i)):0;return Array.from({length:p})||[]};return T(o,{componentType:m,componentName:d,componentTitle:e?.title,componentDescription:e?.description,position:s?.index+1}),t("div",{ref:o,className:l("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",s?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:r("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[r("div",{className:l("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[r("div",{className:"flex-1",children:[e?.title?t("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,t("div",{className:"mt-1 flex items-center",children:a(e?.rating)?.map?.((n,i)=>t("div",{className:"mr-1",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:t("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},i))})]}),t("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?r(N,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[t(y,{src:e?.avatar?.url}),t(C,{children:e?.title})]}):null})]}),t("div",{className:"flex-1",title:e?.description||"",children:t(E,{className:l("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""})}),t("a",{href:M(e?.link,`${m}_${d}`),onClick:()=>{s?.event?.primaryButton(e,s?.index+1)},"data-headless-type-name":`${m}#${d}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-postion":`''#${s?.index+1}`,children:r("div",{className:l("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",s?.shape==="round"?"rounded-lg":"rounded-none"),children:[t("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:t(b,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),t("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},u=x.forwardRef(({className:e="",data:s,key:o},a)=>{const{products:n,title:i,theme:p,...f}=s,c=v(null);return w(a,()=>c.current),t("div",{className:e,ref:c,children:t("div",{className:"evaluate-box relative z-10",children:t(L,{...s?.containerProps||{},className:"overflow-hidden",children:r("div",{ref:a,className:l("w-full",e,{"aiui-dark":p==="dark"}),children:[i&&t(h,{data:{title:i}}),t(g,{className:"!overflow-visible",id:"Evaluate"+o,data:{list:n,configuration:{...f,title:i}},Slide:P,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});u.displayName="Evaluate";var j=k(u);export{j as default};
1
+ "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import w,{useImperativeHandle as h,useRef as f,useState as g}from"react";import{createPortal as y}from"react-dom";import k from"../Title/index.js";import{cn as a}from"../../helpers/utils.js";import N from"../../components/picture.js";import M from"../SwiperBox/index.js";import{withLayout as L}from"../../shared/Styles.js";import{Avatar as C,AvatarImage as E,AvatarFallback as T}from"../../components/avatar.js";import{Container as P}from"../../components/container.js";import{Text as B}from"../../components/text.js";import{useExposure as $}from"../../hooks/useExposure.js";import{trackUrlRef as z}from"../../shared/trackUrlRef.js";const v="copy",u="product_review",I=({data:e,configuration:s})=>{const n=f(null),[o,p]=g({visible:!1,x:0,y:0,text:""}),l=i=>{const d=Number(i),b=Number.isFinite(d)?Math.max(0,Math.floor(d)):0;return Array.from({length:b})||[]},m=i=>{e?.description&&p({visible:!0,x:i.clientX,y:i.clientY,text:e.description})},c=()=>{p(i=>({...i,visible:!1}))};return $(n,{componentType:v,componentName:u,componentTitle:e?.title,componentDescription:e?.description,position:s?.index+1}),t("div",{ref:n,className:a("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300",s?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px]"),children:r("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4",children:[r("div",{className:a("lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between"),children:[r("div",{className:"flex-1",children:[e?.title?t("h4",{className:"laptop:text-lg text-sm font-bold",children:e?.title}):null,t("div",{className:"mt-1 flex items-center",children:l(e?.rating)?.map?.((i,d)=>t("div",{className:"mr-1",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:t("path",{d:"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z",fill:"#F77234"})})},d))})]}),t("div",{className:"desktop:size-12 size-10 overflow-hidden",children:e?.avatar?.url?r(C,{className:"size-full",isAdaptation:!e?.avatar?.url,children:[t(E,{src:e?.avatar?.url}),t(T,{children:e?.title})]}):null})]}),r("div",{className:"flex-1",onMouseMove:m,onMouseLeave:c,children:[t(B,{className:a("lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]"),children:e?.description||""}),typeof window<"u"&&o.visible&&y(t("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${o.x+16}px`,top:`${o.y+16}px`},children:o.text}),document.body)]}),t("a",{href:z(e?.link,`${v}_${u}`),onClick:()=>{s?.event?.primaryButton(e,s?.index+1)},"data-headless-type-name":`${v}#${u}`,"data-headless-title-desc-button":`${e?.title}#${e?.description||e?.subTitle}`,"data-headless-nav-postion":`''#${s?.index+1}`,children:r("div",{className:a("mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3",s?.shape==="round"?"rounded-lg":"rounded-none"),children:[t("div",{className:"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center",children:t(N,{className:"w-full object-cover",source:e?.img?.url,alt:e?.img?.alt||""})}),t("p",{className:"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]",children:e?.subTitle||""})]})})]})})},x=w.forwardRef(({className:e="",data:s,key:n},o)=>{const{products:p,title:l,theme:m,...c}=s,i=f(null);return h(o,()=>i.current),t("div",{className:e,ref:i,children:t("div",{className:"evaluate-box relative z-10",children:t(P,{...s?.containerProps||{},className:"overflow-hidden",children:r("div",{ref:o,className:a("w-full",e,{"aiui-dark":m==="dark"}),children:[l&&t(k,{data:{title:l}}),t(M,{className:"!overflow-visible",id:"Evaluate"+n,data:{list:p,configuration:{...c,title:l}},Slide:I,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})]})})})})});x.displayName="Evaluate";var Y=L(x);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/Evaluate/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" title={data?.description || ''}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
- "mappings": "aA8EU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBA7EV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,MAAc,QACnD,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,UAAAC,EAAQ,eAAAC,EAAa,kBAAAC,MAAsB,6BACpD,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,QAAAC,MAAY,2BAErB,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAG5B,MAAMC,EAAgB,OAChBC,EAAgB,iBAiChBC,EAAe,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAmD,CAC7F,MAAMC,EAAMlB,EAAuB,IAAI,EACjCmB,EAAgBC,GAAgB,CACpC,MAAMC,EAAM,OAAOD,CAAG,EAChBE,EAAQ,OAAO,SAASD,CAAG,EAAI,KAAK,IAAI,EAAG,KAAK,MAAMA,CAAG,CAAC,EAAI,EACpE,OAAO,MAAM,KAAK,CAAE,OAAQC,CAAM,CAAC,GAAK,CAAC,CAC3C,EAEA,OAAAX,EAAYO,EAAK,CACf,cAAAL,EACA,cAAAC,EACA,eAAgBE,GAAM,MACtB,qBAAsBA,GAAM,YAC5B,SAAUC,GAAe,MAAQ,CACnC,CAAC,EAGCrB,EAAC,OACC,IAAKsB,EACL,UAAWhB,EACT,qGACAe,GAAe,QAAU,QAAU,cAAgB,eACnD,oGACA,qFACA,qBACF,EAEA,SAAApB,EAAC,OAAI,UAAU,4EACb,UAAAA,EAAC,OAAI,UAAWK,EAAG,iEAAiE,EAClF,UAAAL,EAAC,OA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React", "useImperativeHandle", "useRef", "Title", "cn", "Picture", "SwiperBox", "withLayout", "Avatar", "AvatarImage", "AvatarFallback", "Container", "Text", "useExposure", "trackUrlRef", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "handleRating", "num", "raw", "count", "_", "index", "Evaluate", "className", "key", "products", "title", "theme", "ohter", "innerRef", "Evaluate_default"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Avatar, AvatarImage, AvatarFallback } from '../../components/avatar.js'\nimport { Container } from '../../components/container.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'copy'\nconst componentName = 'product_review'\n\nexport interface EvaluateItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n img: Img\n title: string\n subTitle: string\n description: string\n avatar?: {\n url: string\n }\n rating: number\n link?: string\n}\n\nexport interface EvaluateProps {\n className?: string\n data: {\n title?: string\n products: EvaluateItem[]\n /** \u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u4E3B\u9898\u8272*/\n theme?: Theme\n containerProps?: ContainerProps\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst EvaluateItem = ({ data, configuration }: { data: EvaluateItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleRating = (num: number) => {\n const raw = Number(num)\n const count = Number.isFinite(raw) ? Math.max(0, Math.floor(raw)) : 0\n return Array.from({ length: count }) || []\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px]'\n )}\n >\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col overflow-hidden p-4\">\n <div className={cn('lg-desktop:mb-16 desktop:mb-10 mb-8 flex w-full justify-between')}>\n <div className=\"flex-1\">\n {data?.title ? <h4 className=\"laptop:text-lg text-sm font-bold\">{data?.title}</h4> : null}\n <div className=\"mt-1 flex items-center\">\n {handleRating(data?.rating)?.map?.((_, index) => {\n return (\n <div key={index} className=\"mr-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <path\n d=\"M7.32745 1.36274C7.60256 0.805304 8.39744 0.805305 8.67255 1.36274L10.1766 4.41035C10.2859 4.63171 10.4971 4.78514 10.7413 4.82063L14.1046 5.30934C14.7197 5.39873 14.9654 6.15471 14.5202 6.58861L12.0866 8.96084C11.9098 9.13315 11.8292 9.3814 11.8709 9.62469L12.4454 12.9743C12.5505 13.587 11.9074 14.0542 11.3572 13.765L8.349 12.1835C8.13051 12.0686 7.86949 12.0686 7.65099 12.1835L4.64282 13.765C4.0926 14.0542 3.44953 13.587 3.55461 12.9743L4.12912 9.62469C4.17085 9.3814 4.09019 9.13315 3.91342 8.96084L1.47976 6.58861C1.03462 6.15471 1.28025 5.39873 1.89542 5.30934L5.25866 4.82063C5.50294 4.78514 5.71412 4.63171 5.82336 4.41035L7.32745 1.36274Z\"\n fill=\"#F77234\"\n />\n </svg>\n </div>\n )\n })}\n </div>\n </div>\n <div className=\"desktop:size-12 size-10 overflow-hidden\">\n {data?.avatar?.url ? (\n <Avatar className=\"size-full\" isAdaptation={!data?.avatar?.url}>\n <AvatarImage src={data?.avatar?.url} />\n <AvatarFallback>{data?.title}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n </div>\n <div className=\"flex-1\" onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n <Text\n className={cn(\n 'lg-desktop:text-2xl text-info-primary evaluate-description line-clamp-5 break-words text-xl font-bold leading-[1.2]'\n )}\n >\n {data?.description || ''}\n </Text>\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n onClick={() => {\n configuration?.event?.primaryButton(data, configuration?.index + 1)\n }}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description || data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <div\n className={cn(\n 'mt-3 flex cursor-pointer items-center overflow-hidden bg-[#F7F8F9] p-3',\n configuration?.shape === 'round' ? 'rounded-lg' : 'rounded-none'\n )}\n >\n <div className=\"laptop:size-16 desktop:size-20 mr-3 flex size-12 items-center\">\n <Picture className=\"w-full object-cover\" source={data?.img?.url} alt={data?.img?.alt || ''} />\n </div>\n <p className=\"lg-desktop:text-[18px] desktop-[16px] line-clamp-2 flex-1 text-[14px] font-bold tracking-[-0.04em]\">\n {data?.subTitle || ''}\n </p>\n </div>\n </a>\n </div>\n </div>\n )\n}\n\nconst Evaluate = React.forwardRef<HTMLDivElement, EvaluateProps>(({ className = '', data, key }, ref) => {\n const { products, title, theme, ...ohter } = data\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div className={className} ref={innerRef}>\n <div className=\"evaluate-box relative z-10\">\n <Container {...(data?.containerProps || {})} className=\"overflow-hidden\">\n <div ref={ref} className={cn('w-full', className, { 'aiui-dark': theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n <SwiperBox\n className=\"!overflow-visible\"\n id={'Evaluate' + key}\n data={{ list: products, configuration: { ...ohter, title: title } }}\n Slide={EvaluateItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </Container>\n </div>\n </div>\n )\n})\n\nEvaluate.displayName = 'Evaluate'\n\nexport default withLayout(Evaluate)\n"],
5
+ "mappings": "aAqGU,OACiB,OAAAA,EADjB,QAAAC,MAAA,oBApGV,OAAOC,GAAS,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QAC7D,OAAS,gBAAAC,MAAoB,YAC7B,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBA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AU,GACV,cAAe,CACjB,CACF,EACF,GACF,EACF,EACF,EACF,CAEJ,CAAC,EAEDgB,EAAS,YAAc,WAEvB,IAAOQ,EAAQlC,EAAW0B,CAAQ",
6
+ "names": ["jsx", "jsxs", "React", "useImperativeHandle", "useRef", "useState", "createPortal", "Title", "cn", "Picture", "SwiperBox", "withLayout", "Avatar", "AvatarImage", "AvatarFallback", "Container", "Text", "useExposure", "trackUrlRef", "componentType", "componentName", "EvaluateItem", "data", "configuration", "ref", "tooltip", "setTooltip", "handleRating", "num", "raw", "count", "handleMouseMove", "e", "handleMouseLeave", "prev", "_", "index", "Evaluate", "className", "key", "products", "title", "theme", "ohter", "innerRef", "Evaluate_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import{useMediaQuery as B}from"react-responsive";import H,{useEffect as L,useImperativeHandle as D,useRef as w,useState as r}from"react";import{cn as m}from"../../helpers/utils.js";import{withLayout as E}from"../../shared/Styles.js";import U from"../SwiperBox/index.js";import{Button as z,Heading as j,Picture as f,Text as R}from"../../components/index.js";import _ from"../Title/index.js";import{VideoModal as q}from"../VideoModal/index.js";import{TextModal as Y}from"../TextModal/index.js";import{useExposure as y}from"../../hooks/useExposure.js";import{trackUrlRef as T}from"../../shared/trackUrlRef.js";const n="image",p="graphic",k="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",A=({data:e,configuration:i})=>{const h=w(null),u=()=>{switch(i.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};return y(h,{componentType:n,componentName:p,componentTitle:e?.title,componentDescription:e?.description,position:i?.index+1}),t("div",{ref:h,className:m(u(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":i?.itemShape==="round"}),children:c("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?t("a",{"aria-label":e?.title??e?.description,href:T(e?.href||"",`${n}_${p}`),className:"block size-full overflow-hidden","data-headless-nav-postion":`''#${i?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}):t("div",{className:"block size-full overflow-hidden",children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),c("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[c("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[c("div",{className:"flex-1 overflow-hidden",children:[t(R,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(e?.title?t(j,{html:e?.description,style:{color:e?.textColor},as:"h3",title:e?.description||"",className:`${k} graphic-description`}):t("h3",{style:{color:e?.textColor},title:e?.description||"",dangerouslySetInnerHTML:{__html:e?.description||""},className:`${k} graphic-description-item`}))]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),i?.onVideoPlayBtnClick?.(i?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),i?.onIconClick?.(e,i)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(f,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(z,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:T(e?.href,`${n}_${p}`),"data-headless-nav-postion":`''#${i?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},N=H.forwardRef(({data:e,className:i},h)=>{const u=B({query:"(max-width: 768px)"}),l=w(null),[I,b]=r(!1),[g,M]=r(""),[C,V]=r(""),[$,P]=r(""),[G,x]=r(null),[S,v]=r(!1),d=o=>{const s=e?.items?.length>3,a=e?.items?.length>2;switch(o){case 1440:return s?4:e?.items?.length;case 1024:return s?3:e?.items?.length;case 768:return e?.items?.length===1?1:s||a?2.3:2;default:return e?.items?.length===1?1:1.2}};return D(h,()=>l.current),y(l,{componentType:n,componentName:p,componentTitle:e?.title}),L(()=>{const o=l.current?.querySelectorAll(".graphic-description");if(o&&o.length>0){let s=0;o.forEach(a=>{s=Math.max(s,a.offsetHeight)}),o.forEach(a=>{a.style.height=`${s}px`})}},[]),c("div",{className:m("graphicBlock",i),ref:l,children:[c("div",{className:"graphic-box",children:[e?.title&&t(_,{data:{title:e?.title}}),t(U,{id:"Graphic",className:m("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(o,s)=>{b(!0),s?.isYouTube?V?.(s?.youtubeId||""):(M?.(s?.video?.url||""),P?.(s?.mobileVideo?.url||""))},onIconClick:o=>{v(!0),x(o)},title:e?.title}},Slide:A,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:d()},768:{spaceBetween:16,freeMode:!1,slidesPerView:d(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:d(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:d(1440)}}})]}),t(q,{visible:I,youTubeId:C,onCloseModal:()=>b(!1),videoUrl:u&&$||g}),t(Y,{textVisible:S,extension:G?.extension,onCloseModal:()=>{v(!1),x(null)}})]})});N.displayName="Graphic";var ie=E(N);export{ie as default};
1
+ "use client";import{jsx as t,jsxs as p}from"react/jsx-runtime";import{useMediaQuery as L}from"react-responsive";import B,{useEffect as E,useImperativeHandle as H,useRef as T,useState as n}from"react";import{createPortal as D}from"react-dom";import{cn as h}from"../../helpers/utils.js";import{withLayout as U}from"../../shared/Styles.js";import z from"../SwiperBox/index.js";import{Button as R,Heading as j,Picture as v,Text as _}from"../../components/index.js";import Y from"../Title/index.js";import{VideoModal as q}from"../VideoModal/index.js";import{TextModal as A}from"../TextModal/index.js";import{useExposure as k}from"../../hooks/useExposure.js";import{trackUrlRef as M}from"../../shared/trackUrlRef.js";const a="image",m="graphic",N="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",Q=({data:e,configuration:o})=>{const u=T(null),[c,r]=n({visible:!1,x:0,y:0,text:""}),g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},f=s=>{e?.description&&r({visible:!0,x:s.clientX,y:s.clientY,text:e.description})},b=()=>{r(s=>({...s,visible:!1}))};return k(u,{componentType:a,componentName:m,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1}),t("div",{ref:u,className:h(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:h("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":o?.itemShape==="round"}),children:p("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?t("a",{"aria-label":e?.title??e?.description,href:M(e?.href||"",`${a}_${m}`),className:"block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:t(v,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}):t("div",{className:"block size-full overflow-hidden",children:t(v,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),p("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[p("div",{className:h("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[p("div",{className:"flex-1 overflow-hidden",children:[t(_,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&p("div",{onMouseMove:f,onMouseLeave:b,children:[e?.title?t(j,{html:e?.description,style:{color:e?.textColor},as:"h3",className:`${N} graphic-description`}):t("h3",{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${N} graphic-description-item`}),typeof window<"u"&&c.visible&&D(t("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${c.x+16}px`,top:`${c.y+16}px`},children:c.text}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:s=>{s.preventDefault(),s.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:s=>{s.preventDefault(),s.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:t(v,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(R,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:M(e?.href,`${a}_${m}`),"data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${a}#${m}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},I=B.forwardRef(({data:e,className:o},u)=>{const c=L({query:"(max-width: 768px)"}),r=T(null),[g,f]=n(!1),[b,s]=n(""),[C,V]=n(""),[$,P]=n(""),[G,w]=n(null),[S,y]=n(!1),x=l=>{const i=e?.items?.length>3,d=e?.items?.length>2;switch(l){case 1440:return i?4:e?.items?.length;case 1024:return i?3:e?.items?.length;case 768:return e?.items?.length===1?1:i||d?2.3:2;default:return e?.items?.length===1?1:1.2}};return H(u,()=>r.current),k(r,{componentType:a,componentName:m,componentTitle:e?.title}),E(()=>{const l=r.current?.querySelectorAll(".graphic-description");if(l&&l.length>0){let i=0;l.forEach(d=>{i=Math.max(i,d.offsetHeight)}),l.forEach(d=>{d.style.height=`${i}px`})}},[]),p("div",{className:h("graphicBlock",o),ref:r,children:[p("div",{className:"graphic-box",children:[e?.title&&t(Y,{data:{title:e?.title}}),t(z,{id:"Graphic",className:h("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(l,i)=>{f(!0),i?.isYouTube?V?.(i?.youtubeId||""):(s?.(i?.video?.url||""),P?.(i?.mobileVideo?.url||""))},onIconClick:l=>{y(!0),w(l)},title:e?.title}},Slide:Q,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:x()},768:{spaceBetween:16,freeMode:!1,slidesPerView:x(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:x(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:x(1440)}}})]}),t(q,{visible:g,youTubeId:C,onCloseModal:()=>f(!1),videoUrl:c&&$||b}),t(A,{textVisible:S,extension:G?.extension,onCloseModal:()=>{y(!1),w(null)}})]})});I.displayName="Graphic";var le=U(I);export{le as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Graphic/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description &&\n (data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n title={data?.description || ''}\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n title={data?.description || ''}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n ))}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
- "mappings": "aAwGc,cAAAA,EAmBA,QAAAC,MAnBA,oBAvGd,OAAS,iBAAAC,MAAqB,mBAC9B,OAAOC,GAAS,aAAAC,EAAW,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QACxE,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAe,wBACtB,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAOC,MAAW,oBAClB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAyBhBC,EACJ,8IAWIC,EAAO,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAkD,CACpF,MAAMC,EAAMpB,EAAuB,IAAI,EACjCqB,EAAe,IAAM,CACzB,OAAQF,EAAc,IAAK,CACzB,IAAK,GACH,MAAO,8LACT,IAAK,GACH,MAAO,4LACT,IAAK,GACH,MAAO,4LACT,QACE,MAAO,2LACX,CACF,EAEA,OAAAP,EAAYQ,EAAK,CACf,cAAAN,EACA,cAAAC,EACA,eAAgBG,GAAM,MACtB,qBAAsBA,GAAM,YAC5B,SAAUC,GAAe,MAAQ,CACnC,CAAC,EAGCzB,EAAC,OACC,IAAK0B,EACL,UAAWlB,EACTmB,EAAa,EACb,cACA,uFACA,CACE,YAAaH,EAAK,QAAU,MAC9B,CACF,EAEA,SAAAxB,EAAC,OACC,UAAWQ,EAAG,mBAAoB,CAC/B,gDAAkDiB,GAAe,YAAc,OAClF,CAAC,EAED,SAAAxB,EAAC,OACC,UAAW,6DAA6DuB,GAAM,KAAO,iBAAmB,EAAE,GAEzG,UAAAA,G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AAU,EAC5B,oBAAqB,CAAC2B,EAAW3B,IAAsB,CACrDU,EAAW,EAAI,EACXV,GAAM,UACRc,IAAed,GAAM,WAAa,EAAE,GAEpCY,IAAcZ,GAAM,OAAO,KAAO,EAAE,EACpCgB,IAAoBhB,GAAM,aAAa,KAAO,EAAE,EAEpD,EACA,YAAcA,GAAsB,CAClCoB,EAAe,EAAI,EACnBF,EAAelB,CAAI,CACrB,EACA,MAAOA,GAAM,KACf,CACF,EACA,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAesB,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,EACA7C,EAACgB,EAAA,CACC,QAASiB,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,EACAnC,EAACiB,EAAA,CACC,YAAa0B,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDb,EAAQ,YAAc,UAEtB,IAAOuB,GAAQ3C,EAAWoB,CAAO",
6
- "names": ["jsx", "jsxs", "useMediaQuery", "React", "useEffect", "useImperativeHandle", "useRef", "useState", "cn", "withLayout", "SwiperBox", "Button", "Heading", "Picture", "Text", "Title", "VideoModal", "TextModal", "useExposure", "trackUrlRef", "componentType", "componentName", "descriptionClass", "Item", "data", "configuration", "ref", "handleAspect", "e", "Graphic", "className", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "handleSwiperShow", "width", "isShow", "descriptions", "maxHeight", "el", "_", "Graphic_default"]
4
+ "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <div onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n {data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n )}\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n )}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
+ "mappings": "aA+Hc,cAAAA,EA0BI,QAAAC,MA1BJ,oBA9Hd,OAAS,iBAAAC,MAAqB,mBAC9B,OAAOC,GAAS,aAAAC,EAAW,uBAAAC,EAAqB,UAAAC,EAAQ,YAAAC,MAAgB,QACxE,OAAS,gBAAAC,MAAoB,YAC7B,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAe,wBACtB,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAOC,MAAW,oBAClB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,MAAMC,EAAgB,QAChBC,EAAgB,UAyBhBC,EACJ,8IAWIC,EAAO,CAAC,CAAE,KAAAC,EAAM,cAAAC,CAAc,IAAkD,CACpF,MAAMC,EAAMrB,EAAuB,IAAI,EACjC,CAACsB,EAASC,CAAU,EAAItB,EAAmE,CAC/F,QAAS,GACT,EAAG,EACH,EAAG,EACH,KAAM,EACR,CAAC,EAEKuB,EAAe,IAAM,CACzB,OAAQJ,EAA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ACA,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe2B,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,EACAnD,EAACiB,EAAA,CACC,QAASsB,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,EACAzC,EAACkB,EAAA,CACC,YAAa+B,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDb,EAAQ,YAAc,UAEtB,IAAOuB,GAAQhD,EAAWyB,CAAO",
6
+ "names": ["jsx", "jsxs", "useMediaQuery", "React", "useEffect", "useImperativeHandle", "useRef", "useState", "createPortal", "cn", "withLayout", "SwiperBox", "Button", "Heading", "Picture", "Text", "Title", "VideoModal", "TextModal", "useExposure", "trackUrlRef", "componentType", "componentName", "descriptionClass", "Item", "data", "configuration", "ref", "tooltip", "setTooltip", "handleAspect", "handleMouseMove", "e", "handleMouseLeave", "prev", "Graphic", "className", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "handleSwiperShow", "width", "isShow", "descriptions", "maxHeight", "el", "_", "Graphic_default"]
7
7
  }
@@ -2,13 +2,16 @@ import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const badgeVariants: (props?: ({
4
4
  size?: "lg" | "sm" | null | undefined;
5
+ variant?: "fill" | "outline" | "promotional" | null | undefined;
6
+ promotionalType?: "plus-member" | "regular-member" | "regular-discount" | "time-limited-discount" | null | undefined;
5
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
8
  export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
9
+ promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount';
7
10
  }
8
11
  /**
9
12
  * Badge - 徽章
10
13
  *
11
- * @description 用于显示状态、标签或计数的小型标识组件,支持不同尺寸
14
+ * @description 用于显示状态、标签或计数的小型标识组件,支持不同尺寸和促销类型
12
15
  */
13
- declare function Badge({ className, size, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
16
+ declare function Badge({ className, size, variant, promotionalType, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
14
17
  export default Badge;
@@ -1,2 +1,2 @@
1
- import{jsx as i}from"react/jsx-runtime";import"react";import{cva as o}from"class-variance-authority";import{cn as n}from"../helpers/index.js";const a=o("text-brand-0 outline-brand-0 inline-flex items-center justify-center rounded-[16px] border-none text-xs font-bold outline outline-[1.6px] outline-offset-[-1.6px] backdrop-blur-sm transition-colors focus:outline-none",{variants:{size:{sm:"h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight",lg:"lg-desktop:px-[8px] lg-desktop:pb-[4px] lg-desktop:pt-[5px] lg-desktop:text-[16px] lg-desktop:h-[28px] h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight"}},defaultVariants:{size:"lg"}});function r({className:t,size:e,...p}){return i("div",{className:n(a({size:e}),t),...p})}var l=r;export{l as default};
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import"react";import{cva as p}from"class-variance-authority";import{cn as C}from"../helpers/index.js";const d=p("text-brand-0 outline-brand-0 inline-flex items-center justify-center whitespace-nowrap rounded-[16px] border-none text-xs font-bold outline outline-[1.6px] outline-offset-[-1.6px] transition-colors focus:outline-none",{variants:{size:{sm:"h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight",lg:"lg-desktop:px-[8px] lg-desktop:pb-[4px] lg-desktop:pt-[5px] lg-desktop:text-[16px] lg-desktop:h-[28px] h-[24px] p-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight"},variant:{outline:"bg-transparent",fill:"bg-brand-0 bg-gradient-brand text-white",promotional:"bg-gradient-brand relative border-none text-white outline-none"},promotionalType:{"plus-member":"bg-gradient-to-r from-[#6E6754] via-[#4A453A] to-[#070708] ","regular-member":"bg-brand-0 bg-gradient-brand ","regular-discount":"bg-brand-0 bg-gradient-brand ","time-limited-discount":"bg-brand-0 bg-gradient-brand "}},compoundVariants:[{variant:"promotional",size:"sm",class:"!pl-[24px]"},{variant:"promotional",size:"lg",class:"lg-desktop:!pl-[28px] !pl-[24px]"}],defaultVariants:{size:"lg",variant:"outline"}}),g=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 28",fill:"none",className:"h-full w-auto",children:[t("path",{d:"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z",fill:"url(#paint0_linear_22508_6946)"}),t("path",{d:"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z",fill:"url(#paint1_linear_22508_6946)"}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_22508_6946",x1:"2.1318",y1:"0.390243",x2:"33.6892",y2:"7.35765",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.0865385",stopColor:"#FFF5E0"}),t("stop",{offset:"1",stopColor:"#E8C08A"})]}),e("linearGradient",{id:"paint1_linear_22508_6946",x1:"7.79513",y1:"9.80078",x2:"25.937",y2:"13.8215",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.9999",stopColor:"#6E6754"}),t("stop",{offset:"1",stopColor:"#050608"})]})]})]}),c=()=>e("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[t("path",{d:"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z",fill:"#B5E5F9"}),t("path",{d:"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z",fill:"white"})]}),u=()=>e("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[e("g",{clipPath:"url(#clip0_20420_244316)",children:[t("path",{opacity:"0.4",d:"M3.90567 7.45107C4.19697 6.0806 5.21359 4.9787 6.55622 4.57818L13.8699 2.39643C15.1173 2.02431 16.4683 2.31148 17.4565 3.15879L23.2505 8.12665C24.3141 9.03864 24.7946 10.4588 24.5033 11.8292L21.3938 26.4587C20.9541 28.527 18.921 29.8474 16.8527 29.4077L3.74508 26.6216C1.67675 26.182 0.356442 24.1489 0.796078 22.0805L3.90567 7.45107Z",fill:"#B5E5F9"}),t("path",{d:"M5 7.9615C5 6.50843 5.78799 5.16965 7.05839 4.46433L14.0584 0.57797C15.266 -0.0924777 16.734 -0.0924768 17.9416 0.577971L24.9416 4.46434C26.212 5.16966 27 6.50844 27 7.9615V24C27 26.2091 25.2091 28 23 28H9C6.79086 28 5 26.2091 5 24V7.9615Z",fill:"#B5E5F9"}),t("path",{d:"M20.3094 17.6141C21.0396 17.6143 21.7533 17.8311 22.3603 18.2371C22.9672 18.6431 23.4402 19.22 23.7194 19.8949C23.9986 20.5698 24.0715 21.3124 23.9288 22.0287C23.7861 22.745 23.4343 23.4029 22.9178 23.9192C22.4013 24.4355 21.7434 24.787 21.0272 24.9293C20.311 25.0715 19.5687 24.9982 18.8942 24.7184C18.2197 24.4387 17.6433 23.9652 17.2378 23.3577C16.8324 22.7503 16.6161 22.0362 16.6163 21.3058C16.6163 19.2667 18.2697 17.6141 20.3094 17.6141ZM10.8221 20.5232L19.527 11.8217C19.7491 11.6041 20.0454 11.4786 20.3562 11.4704C20.667 11.4622 20.9695 11.5719 21.2028 11.7776C21.4361 11.9832 21.583 12.2695 21.6139 12.579C21.6449 12.8885 21.5577 13.1983 21.3698 13.4461L21.2677 13.5618L12.5628 22.2632C12.3407 22.4808 12.0444 22.6064 11.7336 22.6145C11.4228 22.6227 11.1203 22.513 10.887 22.3074C10.6537 22.1017 10.5068 21.8154 10.4759 21.5059C10.4449 21.1964 10.5321 20.8867 10.72 20.6388L10.8221 20.5232ZM20.3094 20.0752C19.9831 20.0752 19.6702 20.2049 19.4395 20.4356C19.2088 20.6664 19.0792 20.9794 19.0792 21.3058C19.0792 21.6322 19.2088 21.9452 19.4395 22.176C19.6702 22.4067 19.9831 22.5364 20.3094 22.5364C20.6357 22.5364 20.9486 22.4067 21.1793 22.176C21.41 21.9452 21.5396 21.6322 21.5396 21.3058C21.5396 20.9794 21.41 20.6664 21.1793 20.4356C20.9486 20.2049 20.6357 20.0752 20.3094 20.0752ZM11.6931 9C12.4232 9.00024 13.1369 9.21707 13.7439 9.62306C14.3509 10.0291 14.8239 10.606 15.1031 11.2809C15.3823 11.9558 15.4552 12.6983 15.3125 13.4146C15.1698 14.131 14.818 14.7889 14.3015 15.3052C13.785 15.8215 13.1271 16.173 12.4109 16.3152C11.6947 16.4575 10.9524 16.3841 10.2779 16.1044C9.60339 15.8246 9.02696 15.3511 8.6215 14.7437C8.21604 14.1362 7.99976 13.4221 8 12.6917C8 10.6527 9.65339 9 11.6931 9ZM11.6931 11.4612C11.5315 11.4611 11.3715 11.4928 11.2222 11.5546C11.073 11.6164 10.9373 11.7069 10.823 11.8212C10.5922 12.0518 10.4624 12.3648 10.4622 12.6911C10.4621 13.0175 10.5915 13.3306 10.8221 13.5615C11.0527 13.7923 11.3656 13.9222 11.6918 13.9223C12.0181 13.9223 12.331 13.7927 12.5617 13.5619C12.7924 13.3311 12.922 13.0181 12.922 12.6917C12.922 12.3654 12.7924 12.0524 12.5617 11.8216C12.331 11.5908 12.0181 11.4612 11.6918 11.4612H11.6931Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_20420_244316",children:t("rect",{width:"32",height:"28",fill:"white"})})})]}),m=()=>e("svg",{width:"24",height:"28",viewBox:"0 0 24 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-auto",children:[t("path",{d:"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z",fill:"#B5E5F9"}),t("path",{d:"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z",fill:"#B5E5F9"})]}),f={"plus-member":()=>t(g,{}),"regular-member":()=>t(c,{}),"regular-discount":()=>t(u,{}),"time-limited-discount":()=>t(m,{})};function x({className:r,size:s,variant:n="outline",promotionalType:o,...a}){const i=n==="promotional",l=i?f[o||"regular-discount"]:null;return e("div",{className:C(d({size:s,variant:n,promotionalType:i?o:void 0}),r),...a,children:[i&&l&&t("div",{className:"absolute inset-y-0 left-0 flex -translate-x-1/3 items-center",children:t(l,{})}),t("span",{className:i?"relative z-10":"",children:a.children})]})}var w=x;export{w as default};
2
2
  //# sourceMappingURL=badge.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/badge.tsx"],
4
- "sourcesContent": ["import * as React from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '../helpers/index.js'\n\nconst badgeVariants = cva(\n 'text-brand-0 outline-brand-0 inline-flex items-center justify-center rounded-[16px] border-none text-xs font-bold outline outline-[1.6px] outline-offset-[-1.6px] backdrop-blur-sm transition-colors focus:outline-none',\n {\n variants: {\n size: {\n sm: 'h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight',\n lg: 'lg-desktop:px-[8px] lg-desktop:pb-[4px] lg-desktop:pt-[5px] lg-desktop:text-[16px] lg-desktop:h-[28px] h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight',\n },\n },\n defaultVariants: {\n size: 'lg',\n },\n }\n)\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}\n\n/**\n * Badge - \u5FBD\u7AE0\n *\n * @description \u7528\u4E8E\u663E\u793A\u72B6\u6001\u3001\u6807\u7B7E\u6216\u8BA1\u6570\u7684\u5C0F\u578B\u6807\u8BC6\u7EC4\u4EF6\uFF0C\u652F\u6301\u4E0D\u540C\u5C3A\u5BF8\n */\nfunction Badge({ className, size, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ size }), className)} {...props} />\n}\n\nexport default Badge\n"],
5
- "mappings": "AA4BS,cAAAA,MAAA,oBA5BT,MAAuB,QACvB,OAA4B,OAAAC,MAAW,2BAEvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAgBF,EACpB,0NACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,gEACJ,GAAI,sKACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EASA,SAASG,EAAM,CAAE,UAAAC,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAe,CACxD,OAAOP,EAAC,OAAI,UAAWE,EAAGC,EAAc,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAAO,CAC5E,CAEA,IAAOC,EAAQJ",
6
- "names": ["jsx", "cva", "cn", "badgeVariants", "Badge", "className", "size", "props", "badge_default"]
4
+ "sourcesContent": ["import * as React from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '../helpers/index.js'\n\nconst badgeVariants = cva(\n 'text-brand-0 outline-brand-0 inline-flex items-center justify-center whitespace-nowrap rounded-[16px] border-none text-xs font-bold outline outline-[1.6px] outline-offset-[-1.6px] transition-colors focus:outline-none',\n {\n variants: {\n size: {\n sm: 'h-[24px] px-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight',\n lg: 'lg-desktop:px-[8px] lg-desktop:pb-[4px] lg-desktop:pt-[5px] lg-desktop:text-[16px] lg-desktop:h-[28px] h-[24px] p-[6px] pb-[3px] pt-[4px] text-[14px] leading-tight',\n },\n variant: {\n outline: 'bg-transparent',\n fill: 'bg-brand-0 bg-gradient-brand text-white',\n promotional: 'bg-gradient-brand relative border-none text-white outline-none',\n },\n promotionalType: {\n 'plus-member': 'bg-gradient-to-r from-[#6E6754] via-[#4A453A] to-[#070708] ',\n 'regular-member': 'bg-brand-0 bg-gradient-brand ',\n 'regular-discount': 'bg-brand-0 bg-gradient-brand ',\n 'time-limited-discount': 'bg-brand-0 bg-gradient-brand ',\n },\n },\n compoundVariants: [\n {\n variant: 'promotional',\n size: 'sm',\n class: '!pl-[24px]',\n },\n {\n variant: 'promotional',\n size: 'lg',\n class: 'lg-desktop:!pl-[28px] !pl-[24px]',\n },\n ],\n defaultVariants: {\n size: 'lg',\n variant: 'outline',\n },\n }\n)\n\n// \u4F1A\u5458\u6807\u8BC6\u56FE\u6807\nconst PlusPromotionalIcon = () => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 28\" fill=\"none\" className=\"h-full w-auto\">\n <path\n d=\"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z\"\n fill=\"url(#paint0_linear_22508_6946)\"\n />\n <path\n d=\"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z\"\n fill=\"url(#paint1_linear_22508_6946)\"\n />\n <defs>\n <linearGradient\n id=\"paint0_linear_22508_6946\"\n x1=\"2.1318\"\n y1=\"0.390243\"\n x2=\"33.6892\"\n y2=\"7.35765\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0.0865385\" stopColor={'#FFF5E0'} />\n <stop offset=\"1\" stopColor={'#E8C08A'} />\n </linearGradient>\n <linearGradient\n id=\"paint1_linear_22508_6946\"\n x1=\"7.79513\"\n y1=\"9.80078\"\n x2=\"25.937\"\n y2=\"13.8215\"\n gradientUnits=\"userSpaceOnUse\"\n >\n <stop offset=\"0.9999\" stopColor={'#6E6754'} />\n <stop offset=\"1\" stopColor={'#050608'} />\n </linearGradient>\n </defs>\n </svg>\n )\n}\n\nconst RegularMemberIcon = () => (\n <svg\n width=\"32\"\n height=\"28\"\n viewBox=\"0 0 32 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-full w-auto\"\n >\n <path\n d=\"M23.2222 0C24.2096 0 25.1341 0.501396 25.6903 1.34106L31.4814 10.0846C32.283 11.2948 32.1429 12.9193 31.1474 13.9659L19.0336 26.6998C17.3854 28.4319 14.6772 28.4335 13.0264 26.7039L0.855644 13.9536C-0.130438 12.9204 -0.281462 11.3186 0.492455 10.1091L6.07548 1.38199C6.6279 0.518743 7.56576 0 8.57008 0H23.2222Z\"\n fill=\"#B5E5F9\"\n />\n <path\n d=\"M22.4084 10.2119C22.9545 9.66492 23.8409 9.66346 24.3881 10.2092C24.9351 10.7553 24.9366 11.6416 24.3908 12.1889L17.451 19.1397C16.8776 19.714 15.9474 19.7155 15.3729 19.1424L8.41114 12.1916C7.86414 11.6455 7.86268 10.7592 8.40841 10.2119C8.95451 9.66492 9.84087 9.66346 10.3881 10.2092L16.4092 16.2193L22.4084 10.2119Z\"\n fill=\"white\"\n />\n </svg>\n)\n\nconst NormalDiscountIcon = () => (\n <svg\n width=\"32\"\n height=\"28\"\n viewBox=\"0 0 32 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-full w-auto\"\n >\n <g clipPath=\"url(#clip0_20420_244316)\">\n <path\n opacity=\"0.4\"\n d=\"M3.90567 7.45107C4.19697 6.0806 5.21359 4.9787 6.55622 4.57818L13.8699 2.39643C15.1173 2.02431 16.4683 2.31148 17.4565 3.15879L23.2505 8.12665C24.3141 9.03864 24.7946 10.4588 24.5033 11.8292L21.3938 26.4587C20.9541 28.527 18.921 29.8474 16.8527 29.4077L3.74508 26.6216C1.67675 26.182 0.356442 24.1489 0.796078 22.0805L3.90567 7.45107Z\"\n fill=\"#B5E5F9\"\n />\n <path\n d=\"M5 7.9615C5 6.50843 5.78799 5.16965 7.05839 4.46433L14.0584 0.57797C15.266 -0.0924777 16.734 -0.0924768 17.9416 0.577971L24.9416 4.46434C26.212 5.16966 27 6.50844 27 7.9615V24C27 26.2091 25.2091 28 23 28H9C6.79086 28 5 26.2091 5 24V7.9615Z\"\n fill=\"#B5E5F9\"\n />\n <path\n d=\"M20.3094 17.6141C21.0396 17.6143 21.7533 17.8311 22.3603 18.2371C22.9672 18.6431 23.4402 19.22 23.7194 19.8949C23.9986 20.5698 24.0715 21.3124 23.9288 22.0287C23.7861 22.745 23.4343 23.4029 22.9178 23.9192C22.4013 24.4355 21.7434 24.787 21.0272 24.9293C20.311 25.0715 19.5687 24.9982 18.8942 24.7184C18.2197 24.4387 17.6433 23.9652 17.2378 23.3577C16.8324 22.7503 16.6161 22.0362 16.6163 21.3058C16.6163 19.2667 18.2697 17.6141 20.3094 17.6141ZM10.8221 20.5232L19.527 11.8217C19.7491 11.6041 20.0454 11.4786 20.3562 11.4704C20.667 11.4622 20.9695 11.5719 21.2028 11.7776C21.4361 11.9832 21.583 12.2695 21.6139 12.579C21.6449 12.8885 21.5577 13.1983 21.3698 13.4461L21.2677 13.5618L12.5628 22.2632C12.3407 22.4808 12.0444 22.6064 11.7336 22.6145C11.4228 22.6227 11.1203 22.513 10.887 22.3074C10.6537 22.1017 10.5068 21.8154 10.4759 21.5059C10.4449 21.1964 10.5321 20.8867 10.72 20.6388L10.8221 20.5232ZM20.3094 20.0752C19.9831 20.0752 19.6702 20.2049 19.4395 20.4356C19.2088 20.6664 19.0792 20.9794 19.0792 21.3058C19.0792 21.6322 19.2088 21.9452 19.4395 22.176C19.6702 22.4067 19.9831 22.5364 20.3094 22.5364C20.6357 22.5364 20.9486 22.4067 21.1793 22.176C21.41 21.9452 21.5396 21.6322 21.5396 21.3058C21.5396 20.9794 21.41 20.6664 21.1793 20.4356C20.9486 20.2049 20.6357 20.0752 20.3094 20.0752ZM11.6931 9C12.4232 9.00024 13.1369 9.21707 13.7439 9.62306C14.3509 10.0291 14.8239 10.606 15.1031 11.2809C15.3823 11.9558 15.4552 12.6983 15.3125 13.4146C15.1698 14.131 14.818 14.7889 14.3015 15.3052C13.785 15.8215 13.1271 16.173 12.4109 16.3152C11.6947 16.4575 10.9524 16.3841 10.2779 16.1044C9.60339 15.8246 9.02696 15.3511 8.6215 14.7437C8.21604 14.1362 7.99976 13.4221 8 12.6917C8 10.6527 9.65339 9 11.6931 9ZM11.6931 11.4612C11.5315 11.4611 11.3715 11.4928 11.2222 11.5546C11.073 11.6164 10.9373 11.7069 10.823 11.8212C10.5922 12.0518 10.4624 12.3648 10.4622 12.6911C10.4621 13.0175 10.5915 13.3306 10.8221 13.5615C11.0527 13.7923 11.3656 13.9222 11.6918 13.9223C12.0181 13.9223 12.331 13.7927 12.5617 13.5619C12.7924 13.3311 12.922 13.0181 12.922 12.6917C12.922 12.3654 12.7924 12.0524 12.5617 11.8216C12.331 11.5908 12.0181 11.4612 11.6918 11.4612H11.6931Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_20420_244316\">\n <rect width=\"32\" height=\"28\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n)\n\nconst FlashDiscountIcon = () => (\n <svg\n width=\"24\"\n height=\"28\"\n viewBox=\"0 0 24 28\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-full w-auto\"\n >\n <path\n d=\"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z\"\n fill=\"#B5E5F9\"\n />\n <path\n d=\"M0.112855 14.5991L6.23786 0.599179C6.3971 0.235193 6.75672 0 7.15401 0H19.4534C20.1791 0 20.6631 0.74862 20.3653 1.41036L16.5 10H22.5443C23.36 10 23.8326 10.9242 23.3549 11.5855L11.5 28.0001L9.6547 16L1.029 15.9999C0.307853 15.9999 -0.176196 15.2598 0.112855 14.5991Z\"\n fill=\"#B5E5F9\"\n />\n </svg>\n)\n\n// \u4FC3\u9500\u7C7B\u578B\u56FE\u6807\u6620\u5C04\nconst PromotionalIcons = {\n 'plus-member': () => <PlusPromotionalIcon />,\n 'regular-member': () => <RegularMemberIcon />,\n 'regular-discount': () => <NormalDiscountIcon />,\n 'time-limited-discount': () => <FlashDiscountIcon />,\n} as const\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {\n promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\n}\n\n/**\n * Badge - \u5FBD\u7AE0\n *\n * @description \u7528\u4E8E\u663E\u793A\u72B6\u6001\u3001\u6807\u7B7E\u6216\u8BA1\u6570\u7684\u5C0F\u578B\u6807\u8BC6\u7EC4\u4EF6\uFF0C\u652F\u6301\u4E0D\u540C\u5C3A\u5BF8\u548C\u4FC3\u9500\u7C7B\u578B\n */\nfunction Badge({ className, size, variant = 'outline', promotionalType, ...props }: BadgeProps) {\n const isPromotional = variant === 'promotional'\n\n // \u6839\u636E promotionalType \u9009\u62E9\u56FE\u6807\uFF0C\u5982\u679C\u6CA1\u6709\u6307\u5B9A\u5219\u4F7F\u7528\u9ED8\u8BA4\u7684 regular-discount\n const IconComponent = isPromotional ? PromotionalIcons[promotionalType || 'regular-discount'] : null\n\n return (\n <div\n className={cn(\n badgeVariants({\n size,\n variant,\n promotionalType: isPromotional ? promotionalType : undefined,\n }),\n className\n )}\n {...props}\n >\n {isPromotional && IconComponent && (\n <div className=\"absolute inset-y-0 left-0 flex -translate-x-1/3 items-center\">\n <IconComponent />\n </div>\n )}\n <span className={isPromotional ? 'relative z-10' : ''}>{props.children}</span>\n </div>\n )\n}\n\nexport default Badge\n"],
5
+ "mappings": "AAgDM,cAAAA,EASE,QAAAC,MATF,oBAhDN,MAAuB,QACvB,OAA4B,OAAAC,MAAW,2BAEvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAgBF,EACpB,2NACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,gEACJ,GAAI,sKACN,EACA,QAAS,CACP,QAAS,iBACT,KAAM,0CACN,YAAa,gEACf,EACA,gBAAiB,CACf,cAAe,8DACf,iBAAkB,gCAClB,mBAAoB,gCACpB,wBAAyB,+BAC3B,CACF,EACA,iBAAkB,CAChB,CACE,QAAS,cACT,KAAM,KACN,MAAO,YACT,EACA,CACE,QAAS,cACT,KAAM,KACN,MAAO,kCACT,CACF,EACA,gBAAiB,CACf,KAAM,KACN,QAAS,SACX,CACF,CACF,EAGMG,EAAsB,IAExBJ,EAAC,OAAI,MAAM,6BAA6B,QAAQ,YAAY,KAAK,OAAO,UAAU,gBAChF,UAAAD,EAAC,QACC,EAAE,0TACF,KAAK,iCACP,EACAA,EAAC,QACC,EAAE,kUACF,KAAK,iCACP,EACAC,EAAC,QACC,UAAAA,EAAC,kBACC,GAAG,2BACH,GAAG,SACH,GAAG,WACH,GAAG,UACH,GAAG,UACH,cAAc,iBAEd,UAAAD,EAAC,QAAK,OAAO,YAAY,UAAW,UAAW,EAC/CA,EAAC,QAAK,OAAO,IAAI,UAAW,UAAW,GACzC,EACAC,EAAC,kBACC,GAAG,2BACH,GAAG,UACH,GAAG,UACH,GAAG,SACH,GAAG,UACH,cAAc,iBAEd,UAAAD,EAAC,QAAK,OAAO,SAAS,UAAW,UAAW,EAC5CA,EAAC,QAAK,OAAO,IAAI,UAAW,UAAW,GACzC,GACF,GACF,EAIEM,EAAoB,IACxBL,EAAC,OACC,MAAM,KACN,OAAO,KAC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UAAAC,GAAiBC,GAChBjB,EAAC,OAAI,UAAU,+DACb,SAAAA,EAACiB,EAAA,EAAc,EACjB,EAEFjB,EAAC,QAAK,UAAWgB,EAAgB,gBAAkB,GAAK,SAAAD,EAAM,SAAS,GACzE,CAEJ,CAEA,IAAOG,EAAQR",
6
+ "names": ["jsx", "jsxs", "cva", "cn", "badgeVariants", "PlusPromotionalIcon", "RegularMemberIcon", "NormalDiscountIcon", "FlashDiscountIcon", "PromotionalIcons", "Badge", "className", "size", "variant", "promotionalType", "props", "isPromotional", "IconComponent", "badge_default"]
7
7
  }
@@ -5,6 +5,11 @@ declare const meta: {
5
5
  component: typeof Badge;
6
6
  parameters: {
7
7
  layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
8
13
  };
9
14
  tags: string[];
10
15
  argTypes: {
@@ -20,12 +25,72 @@ declare const meta: {
20
25
  };
21
26
  };
22
27
  };
28
+ variant: {
29
+ control: {
30
+ type: "select";
31
+ };
32
+ options: string[];
33
+ description: string;
34
+ table: {
35
+ defaultValue: {
36
+ summary: string;
37
+ };
38
+ type: {
39
+ summary: string;
40
+ };
41
+ };
42
+ };
43
+ promotionalType: {
44
+ control: {
45
+ type: "select";
46
+ };
47
+ options: string[];
48
+ description: string;
49
+ table: {
50
+ defaultValue: {
51
+ summary: string;
52
+ };
53
+ type: {
54
+ summary: string;
55
+ };
56
+ };
57
+ if: {
58
+ arg: string;
59
+ eq: string;
60
+ };
61
+ };
62
+ children: {
63
+ control: "text";
64
+ description: string;
65
+ table: {
66
+ type: {
67
+ summary: string;
68
+ };
69
+ };
70
+ };
71
+ className: {
72
+ control: "text";
73
+ description: string;
74
+ table: {
75
+ type: {
76
+ summary: string;
77
+ };
78
+ };
79
+ };
23
80
  };
24
81
  args: {
25
82
  size: "lg";
83
+ variant: "outline";
84
+ children: string;
26
85
  };
27
86
  };
28
87
  export default meta;
29
88
  type Story = StoryObj<typeof meta>;
30
89
  export declare const Default: Story;
31
- export declare const Examples: Story;
90
+ export declare const PlaygroundDemo: Story;
91
+ export declare const Variants: Story;
92
+ export declare const Sizes: Story;
93
+ export declare const Promotional: Story;
94
+ export declare const PromotionalExamples: Story;
95
+ export declare const PromotionalTypes: Story;
96
+ export declare const UsageExamples: Story;
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Badge as e}from"../components/index.js";import"react";const o={title:"Components/Badge",component:e,parameters:{layout:"centered"},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","lg"],description:"Badge \u5C3A\u5BF8",table:{defaultValue:{summary:"lg"}}}},args:{size:"lg"}};var p=o;const l={args:{children:"New"}},m={render(){return t("div",{className:"flex flex-col space-y-4",children:t(e,{children:"New"})})}};export{l as Default,m as Examples,p as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Badge as a}from"../components/index.js";import"react";const i={title:"Components/Badge",component:a,parameters:{layout:"centered",docs:{description:{component:"\u5FBD\u7AE0\u7EC4\u4EF6\u7528\u4E8E\u663E\u793A\u72B6\u6001\u3001\u6807\u7B7E\u6216\u8BA1\u6570\u4FE1\u606F\u3002\u652F\u6301\u591A\u79CD\u5C3A\u5BF8\u548C\u6837\u5F0F\u53D8\u4F53\uFF0C\u5305\u62EC\u57FA\u7840\u8F6E\u5ED3\u6837\u5F0F\u3001\u586B\u5145\u6837\u5F0F\u4EE5\u53CA\u591A\u79CD\u4FC3\u9500\u5FBD\u7AE0\u7C7B\u578B\u3002\u4FC3\u9500\u5FBD\u7AE0\u652F\u6301\u56DB\u79CD\u7C7B\u578B\uFF1APlus\u4F1A\u5458\uFF08\u6DF1\u8272\u6E10\u53D8\uFF09\u4F7F\u7528\u7279\u6B8A\u6837\u5F0F\uFF0C\u5176\u4ED6\u7C7B\u578B\uFF08\u666E\u901A\u4F1A\u5458\u3001\u666E\u901A\u6298\u6263\u3001\u9650\u65F6\u6298\u6263\uFF09\u4F7F\u7528\u54C1\u724C\u8272\u586B\u5145\u6837\u5F0F\uFF0C\u6BCF\u79CD\u7C7B\u578B\u90FD\u914D\u6709\u4E13\u5C5E\u56FE\u6807\u3002"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","lg"],description:"\u5FBD\u7AE0\u5C3A\u5BF8\uFF1Asm (24px\u9AD8\u5EA6) \u6216 lg (24px\u9AD8\u5EA6\uFF0C\u5927\u5C4F\u5E5528px\u9AD8\u5EA6)",table:{defaultValue:{summary:"lg"}}},variant:{control:{type:"select"},options:["outline","fill","promotional"],description:"\u5FBD\u7AE0\u53D8\u4F53\u6837\u5F0F\uFF1Aoutline (\u8F6E\u5ED3\u6837\u5F0F)\u3001fill (\u586B\u5145\u6837\u5F0F)\u3001promotional (\u4FC3\u9500\u6837\u5F0F\uFF0C\u652F\u6301\u4E0D\u540C\u4FC3\u9500\u7C7B\u578B)",table:{defaultValue:{summary:"outline"},type:{summary:"'outline' | 'fill' | 'promotional'"}}},promotionalType:{control:{type:"select"},options:["plus-member","regular-member","regular-discount","time-limited-discount"],description:"\u4FC3\u9500\u7C7B\u578B\uFF1Aplus-member (Plus\u4F1A\u5458\uFF0C\u6DF1\u8272\u6E10\u53D8) \u4F7F\u7528\u7279\u6B8A\u6837\u5F0F\uFF0C\u5176\u4ED6\u7C7B\u578B\u4F7F\u7528\u54C1\u724C\u8272\u586B\u5145\u6837\u5F0F\uFF0C\u6BCF\u79CD\u7C7B\u578B\u914D\u6709\u4E13\u5C5E\u56FE\u6807",table:{defaultValue:{summary:"undefined"},type:{summary:"'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'"}},if:{arg:"variant",eq:"promotional"}},children:{control:"text",description:"\u5FBD\u7AE0\u663E\u793A\u7684\u6587\u672C\u5185\u5BB9",table:{type:{summary:"ReactNode"}}},className:{control:"text",description:"\u989D\u5916\u7684CSS\u7C7B\u540D",table:{type:{summary:"string"}}}},args:{size:"lg",variant:"outline",children:"New"}};var s=i;const m={args:{children:"New"}},n={name:"Playground Demo",render(){return t("div",{className:"space-y-8 p-6",children:[t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u57FA\u7840\u5FBD\u7AE0"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"outline",children:"New"}),e(a,{variant:"outline",children:"20% OFF"}),e(a,{variant:"outline",children:"Limited"}),e(a,{variant:"outline",children:"Hot"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u586B\u5145\u5FBD\u7AE0"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"fill",children:"Sale"}),e(a,{variant:"fill",children:"15% OFF"}),e(a,{variant:"fill",children:"Bestseller"}),e(a,{variant:"fill",children:"Free Shipping"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u4FC3\u9500\u5FBD\u7AE0"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus Member"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"VIP Member"}),e(a,{variant:"promotional",promotionalType:"regular-discount",children:"Premium"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u4F1A\u5458\u4E13\u4EAB"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u5C3A\u5BF8\u5BF9\u6BD4"}),t("div",{className:"space-y-3",children:[t("div",{className:"flex gap-4 items-center",children:[e("span",{className:"text-sm text-gray-600 w-16",children:"Small:"}),e(a,{size:"sm",variant:"outline",children:"New"}),e(a,{size:"sm",variant:"fill",children:"Sale"}),e(a,{size:"sm",variant:"promotional",promotionalType:"plus-member",children:"Plus"}),e(a,{size:"sm",variant:"promotional",promotionalType:"regular-member",children:"regular"}),e(a,{size:"sm",variant:"promotional",promotionalType:"regular-discount",children:"discount"}),e(a,{size:"sm",variant:"promotional",promotionalType:"time-limited-discount",children:"limited"})]}),t("div",{className:"flex gap-4 items-center",children:[e("span",{className:"text-sm text-gray-600 w-16",children:"Large:"}),e(a,{size:"lg",variant:"outline",children:"New"}),e(a,{size:"lg",variant:"fill",children:"Sale"}),e(a,{size:"lg",variant:"promotional",promotionalType:"plus-member",children:"Plus Member"}),e(a,{size:"lg",variant:"promotional",promotionalType:"regular-member",children:"regular Member"}),e(a,{size:"lg",variant:"promotional",promotionalType:"regular-discount",children:"discount"}),e(a,{size:"lg",variant:"promotional",promotionalType:"time-limited-discount",children:"limited"})]})]})]})]})}},p={name:"All Variants",render(){return t("div",{className:"flex gap-4 items-center",children:[e(a,{variant:"outline",children:"OUTLINE"}),e(a,{variant:"fill",children:"FILL"}),e(a,{variant:"promotional",children:"PROMOTIONAL"})]})}},d={name:"Size Variations",render(){return t("div",{className:"space-y-4",children:[t("div",{className:"flex gap-4 items-center",children:[e("span",{className:"text-sm text-gray-600 w-16",children:"Small:"}),e(a,{size:"sm",variant:"outline",children:"New"}),e(a,{size:"sm",variant:"fill",children:"Sale"}),e(a,{size:"sm",variant:"promotional",promotionalType:"plus-member",children:"Plus"})]}),t("div",{className:"flex gap-4 items-center",children:[e("span",{className:"text-sm text-gray-600 w-16",children:"Large:"}),e(a,{size:"lg",variant:"outline",children:"New"}),e(a,{size:"lg",variant:"fill",children:"Sale"}),e(a,{size:"lg",variant:"promotional",promotionalType:"plus-member",children:"Plus Member"})]})]})}},g={name:"Promotional Badge",args:{variant:"promotional",promotionalType:"plus-member",children:"Plus Member"}},c={name:"Promotional Scenarios",render(){return t("div",{className:"space-y-6 p-6",children:[t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u4F1A\u5458\u7B49\u7EA7\u6807\u8BC6"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus Member"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"VIP Member"}),e(a,{variant:"promotional",promotionalType:"plus-member",children:"Premium User"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u7279\u6B8A\u6743\u76CA\u6807\u7B7E"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"regular-member",children:"\u4F1A\u5458\u4E13\u4EAB"}),e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u4E13\u5C5E\u4F18\u60E0"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u65E9\u9E1F\u7279\u60E0"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u4EA7\u54C1\u6807\u8BC6"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u9650\u91CF\u7248"}),e(a,{variant:"promotional",promotionalType:"plus-member",children:"\u8054\u540D\u6B3E"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u72EC\u5BB6"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u5E26\u88C5\u9970\u56FE\u6807\u6548\u679C"}),t("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e("p",{className:"text-sm text-gray-600 mb-4",children:"\u4FC3\u9500\u5FBD\u7AE0\u81EA\u52A8\u5305\u542B\u5DE6\u4FA7\u88C5\u9970\u56FE\u6807\uFF0C\u91C7\u7528\u6E10\u53D8\u80CC\u666F\u8BBE\u8BA1\uFF0C\u6839\u636EpromotionalType\u663E\u793A\u4E0D\u540C\u7684\u989C\u8272\u548C\u56FE\u6807"}),e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus Member"})]})]})]})}},v={name:"Promotional Types",render(){return t("div",{className:"space-y-8 p-6",children:[t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u6240\u6709\u4FC3\u9500\u7C7B\u578B"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus\u4E13\u4EAB"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"\u4F1A\u5458\u4EF7"}),e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u9650\u65F6\u4F18\u60E0"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u95EA\u8D2D\u4E2D"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"Plus\u4F1A\u5458\u4E13\u4EAB\uFF08\u6DF1\u8272\u6E10\u53D8\uFF09"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus\u4E13\u4EAB"}),e(a,{variant:"promotional",promotionalType:"plus-member",children:"VIP\u7279\u6743"}),e(a,{variant:"promotional",promotionalType:"plus-member",children:"\u4E13\u5C5E\u6743\u76CA"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u666E\u901A\u4F1A\u5458\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"regular-member",children:"\u4F1A\u5458\u4EF7"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"\u4F1A\u5458\u4E13\u5C5E"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"Member Only"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u666E\u901A\u6298\u6263\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u9650\u65F6\u4F18\u60E0"}),e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u7279\u4EF7"}),e(a,{variant:"promotional",promotionalType:"regular-discount",children:"\u4FC3\u9500\u4E2D"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u9650\u65F6\u6298\u6263\uFF08\u54C1\u724C\u8272\u586B\u5145\uFF09"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u95EA\u8D2D"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u62A2\u8D2D\u4E2D"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u9650\u65F6\u79D2\u6740"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u5411\u540E\u517C\u5BB9\uFF08\u9ED8\u8BA4\u6837\u5F0F\uFF09"}),t("div",{className:"flex flex-wrap gap-4 items-center",children:[e(a,{variant:"promotional",children:"\u4FC3\u9500\u6807\u7B7E"}),e("span",{className:"text-sm text-gray-500",children:"\u2190 \u4E0D\u6307\u5B9ApromotionalType\u65F6\u4F7F\u7528\u9ED8\u8BA4\u7684regular-discount\u6837\u5F0F"})]})]})]})}},y={name:"Usage Examples",render(){return t("div",{className:"space-y-6 p-6",children:[t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u4EA7\u54C1\u5361\u7247\u4E2D\u7684\u5E94\u7528"}),t("div",{className:"border border-gray-200 rounded-lg p-4 max-w-sm",children:[t("div",{className:"flex gap-2 mb-3",children:[e(a,{size:"sm",variant:"fill",children:"20% OFF"}),e(a,{size:"sm",variant:"outline",children:"New"})]}),e("h4",{className:"font-medium text-gray-900 mb-2",children:"AeroFit 2 Earbuds"}),e("div",{className:"mb-3",children:e(a,{variant:"promotional",promotionalType:"plus-member",children:"Plus Member Price"})}),e("p",{className:"text-lg font-semibold text-gray-900",children:"$79.99"})]})]}),t("div",{className:"space-y-4",children:[e("h3",{className:"text-lg font-semibold text-gray-900",children:"\u6DF7\u5408\u4F7F\u7528\u573A\u666F"}),t("div",{className:"space-y-3",children:[t("div",{className:"flex gap-2 items-center",children:[e("span",{className:"text-sm text-gray-600 w-20",children:"\u6298\u6263\u6807\u7B7E:"}),e(a,{variant:"fill",children:"25% OFF"}),e(a,{variant:"outline",children:"Limited Time"})]}),t("div",{className:"flex gap-2 items-center",children:[e("span",{className:"text-sm text-gray-600 w-20",children:"\u4F1A\u5458\u6807\u8BC6:"}),e(a,{variant:"promotional",promotionalType:"regular-member",children:"\u4F1A\u5458\u4E13\u4EAB"})]}),t("div",{className:"flex gap-2 items-center",children:[e("span",{className:"text-sm text-gray-600 w-20",children:"\u9650\u65F6\u4FC3\u9500:"}),e(a,{variant:"promotional",promotionalType:"time-limited-discount",children:"\u95EA\u8D2D\u4E2D"})]}),t("div",{className:"flex gap-2 items-center",children:[e("span",{className:"text-sm text-gray-600 w-20",children:"\u72B6\u6001\u6807\u7B7E:"}),e(a,{variant:"outline",children:"Hot"}),e(a,{variant:"outline",children:"Bestseller"})]})]})]})]})}};export{m as Default,n as PlaygroundDemo,g as Promotional,c as PromotionalExamples,v as PromotionalTypes,d as Sizes,y as UsageExamples,p as Variants,s as default};
2
2
  //# sourceMappingURL=badge.stories.js.map