@anker-in/headless-ui 1.1.55 → 1.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +2 -2
- package/dist/cjs/biz-components/Category/SwiperCategory.d.ts +2 -0
- package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +3 -3
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.d.ts +41 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductsList.d.ts +20 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductsList.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/ProductsList.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/Root.d.ts +43 -0
- package/dist/cjs/biz-components/CreditsShelf/Root.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/Root.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/context.d.ts +40 -0
- package/dist/cjs/biz-components/CreditsShelf/context.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/context.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/index.d.ts +15 -0
- package/dist/cjs/biz-components/CreditsShelf/index.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/CreditsShelf/types.d.ts +73 -0
- package/dist/cjs/biz-components/CreditsShelf/types.js +2 -0
- package/dist/cjs/biz-components/CreditsShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.d.ts +1 -0
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/types.js.map +1 -1
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/cjs/biz-components/MiniCart/CircleProgress.d.ts +38 -0
- package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -0
- package/dist/cjs/biz-components/MiniCart/CircleProgress.js.map +7 -0
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js.map +1 -1
- package/dist/cjs/biz-components/MiniCart/index.d.ts +31 -1
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.js.map +3 -3
- package/dist/cjs/biz-components/SceneShelf/Footer.d.ts +21 -0
- package/dist/cjs/biz-components/SceneShelf/Footer.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/Footer.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/ProductCard.d.ts +23 -0
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.d.ts +26 -0
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/Root.d.ts +20 -0
- package/dist/cjs/biz-components/SceneShelf/Root.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/Root.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/Scene.d.ts +38 -0
- package/dist/cjs/biz-components/SceneShelf/Scene.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/Scene.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/SceneImage.d.ts +14 -0
- package/dist/cjs/biz-components/SceneShelf/SceneImage.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/SceneImage.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/context.d.ts +40 -0
- package/dist/cjs/biz-components/SceneShelf/context.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/context.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/index.d.ts +21 -0
- package/dist/cjs/biz-components/SceneShelf/index.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelf/types.d.ts +51 -0
- package/dist/cjs/biz-components/SceneShelf/types.js +2 -0
- package/dist/cjs/biz-components/SceneShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +25 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/cjs/biz-components/index.d.ts +8 -1
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/Countdown.js +1 -1
- package/dist/cjs/components/Countdown.js.map +2 -2
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +2 -2
- package/dist/cjs/stories/decorators/dataPropsDecorator.d.ts +16 -0
- package/dist/cjs/stories/decorators/dataPropsDecorator.js +2 -0
- package/dist/cjs/stories/decorators/dataPropsDecorator.js.map +7 -0
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +2 -2
- package/dist/esm/biz-components/Category/SwiperCategory.d.ts +2 -0
- package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +3 -3
- package/dist/esm/biz-components/CreditsShelf/ProductCard.d.ts +41 -0
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/ProductsList.d.ts +20 -0
- package/dist/esm/biz-components/CreditsShelf/ProductsList.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/ProductsList.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/Root.d.ts +43 -0
- package/dist/esm/biz-components/CreditsShelf/Root.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/Root.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/context.d.ts +40 -0
- package/dist/esm/biz-components/CreditsShelf/context.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/context.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/index.d.ts +15 -0
- package/dist/esm/biz-components/CreditsShelf/index.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/index.js.map +7 -0
- package/dist/esm/biz-components/CreditsShelf/types.d.ts +73 -0
- package/dist/esm/biz-components/CreditsShelf/types.js +2 -0
- package/dist/esm/biz-components/CreditsShelf/types.js.map +7 -0
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
- package/dist/esm/biz-components/MediaSceneSwitcher/types.d.ts +1 -0
- package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/MediaShelf/ProductCard.js.map +2 -2
- package/dist/esm/biz-components/MiniCart/CircleProgress.d.ts +38 -0
- package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -0
- package/dist/esm/biz-components/MiniCart/CircleProgress.js.map +7 -0
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.js.map +1 -1
- package/dist/esm/biz-components/MiniCart/index.d.ts +31 -1
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.js.map +3 -3
- package/dist/esm/biz-components/SceneShelf/Footer.d.ts +21 -0
- package/dist/esm/biz-components/SceneShelf/Footer.js +2 -0
- package/dist/esm/biz-components/SceneShelf/Footer.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/ProductCard.d.ts +23 -0
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/SceneShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.d.ts +26 -0
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +2 -0
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/Root.d.ts +20 -0
- package/dist/esm/biz-components/SceneShelf/Root.js +2 -0
- package/dist/esm/biz-components/SceneShelf/Root.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/Scene.d.ts +38 -0
- package/dist/esm/biz-components/SceneShelf/Scene.js +2 -0
- package/dist/esm/biz-components/SceneShelf/Scene.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/SceneImage.d.ts +14 -0
- package/dist/esm/biz-components/SceneShelf/SceneImage.js +2 -0
- package/dist/esm/biz-components/SceneShelf/SceneImage.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/context.d.ts +40 -0
- package/dist/esm/biz-components/SceneShelf/context.js +2 -0
- package/dist/esm/biz-components/SceneShelf/context.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/index.d.ts +21 -0
- package/dist/esm/biz-components/SceneShelf/index.js +2 -0
- package/dist/esm/biz-components/SceneShelf/index.js.map +7 -0
- package/dist/esm/biz-components/SceneShelf/types.d.ts +51 -0
- package/dist/esm/biz-components/SceneShelf/types.js +2 -0
- package/dist/esm/biz-components/SceneShelf/types.js.map +7 -0
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +25 -0
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/esm/biz-components/index.d.ts +8 -1
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/Countdown.js +1 -1
- package/dist/esm/components/Countdown.js.map +2 -2
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +2 -2
- package/dist/esm/stories/decorators/dataPropsDecorator.d.ts +16 -0
- package/dist/esm/stories/decorators/dataPropsDecorator.js +2 -0
- package/dist/esm/stories/decorators/dataPropsDecorator.js.map +7 -0
- package/dist/tokens/anker.css +1 -0
- package/dist/tokens/base.css +1 -0
- package/dist/tokens/eufy.css +1 -0
- package/dist/tokens/eufyMake.css +1 -0
- package/dist/tokens/solix.css +1 -0
- package/dist/tokens/soundcore.css +1 -0
- package/package.json +6 -2
- package/style.css +20 -3
- package/tailwind.config.js +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SceneShelfRoot } from './Root.js';
|
|
2
|
+
import { SceneShelfScene } from './Scene.js';
|
|
3
|
+
import { SceneShelfSceneImage } from './SceneImage.js';
|
|
4
|
+
import { SceneShelfProductsPanel } from './ProductsPanel.js';
|
|
5
|
+
import { SceneProductCard } from './ProductCard.js';
|
|
6
|
+
export type { SceneShelfSemanticName, SceneProductCardSemanticName, ProductTag, PriceData, SceneProductCardData, } from './types.js';
|
|
7
|
+
export type { SceneShelfRootProps } from './Root.js';
|
|
8
|
+
export type { SceneShelfSceneProps } from './Scene.js';
|
|
9
|
+
export type { SceneShelfSceneImageProps } from './SceneImage.js';
|
|
10
|
+
export type { SceneShelfProductsPanelProps } from './ProductsPanel.js';
|
|
11
|
+
export type { SceneProductCardProps } from './ProductCard.js';
|
|
12
|
+
export type { SceneShelfContextValue } from './context.js';
|
|
13
|
+
export { SceneShelfRoot, SceneShelfScene, SceneShelfSceneImage, SceneShelfProductsPanel, SceneProductCard };
|
|
14
|
+
declare const SceneShelf: {
|
|
15
|
+
Root: import("react").ForwardRefExoticComponent<import("./Root.js").SceneShelfRootProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Scene: import("react").ForwardRefExoticComponent<import("./Scene.js").SceneShelfSceneProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
SceneImage: import("react").ForwardRefExoticComponent<import("./SceneImage.js").SceneShelfSceneImageProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
ProductsPanel: import("react").ForwardRefExoticComponent<import("./ProductsPanel.js").SceneShelfProductsPanelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
ProductCard: import("react").ForwardRefExoticComponent<import("./ProductCard.js").SceneProductCardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
};
|
|
21
|
+
export default SceneShelf;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{SceneShelfRoot as e}from"./Root.js";import{SceneShelfScene as o}from"./Scene.js";import{SceneShelfSceneImage as r}from"./SceneImage.js";import{SceneShelfProductsPanel as t}from"./ProductsPanel.js";import{SceneProductCard as c}from"./ProductCard.js";const S={Root:e,Scene:o,SceneImage:r,ProductsPanel:t,ProductCard:c};var P=S;export{c as SceneProductCard,t as SceneShelfProductsPanel,e as SceneShelfRoot,o as SceneShelfScene,r as SceneShelfSceneImage,P as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/SceneShelf/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport { SceneShelfRoot } from './Root.js'\nimport { SceneShelfScene } from './Scene.js'\nimport { SceneShelfSceneImage } from './SceneImage.js'\nimport { SceneShelfProductsPanel } from './ProductsPanel.js'\nimport { SceneProductCard } from './ProductCard.js'\n\n// \u5BFC\u51FA\u7C7B\u578B\nexport type {\n SceneShelfSemanticName,\n SceneProductCardSemanticName,\n ProductTag,\n PriceData,\n SceneProductCardData,\n} from './types.js'\n\nexport type { SceneShelfRootProps } from './Root.js'\nexport type { SceneShelfSceneProps } from './Scene.js'\nexport type { SceneShelfSceneImageProps } from './SceneImage.js'\nexport type { SceneShelfProductsPanelProps } from './ProductsPanel.js'\nexport type { SceneProductCardProps } from './ProductCard.js'\nexport type { SceneShelfContextValue } from './context.js'\n\n// \u5BFC\u51FA\u5B50\u7EC4\u4EF6\nexport { SceneShelfRoot, SceneShelfScene, SceneShelfSceneImage, SceneShelfProductsPanel, SceneProductCard }\n\n// \u7EC4\u5408\u5F0F\u7EC4\u4EF6\nconst SceneShelf = {\n Root: SceneShelfRoot,\n Scene: SceneShelfScene,\n SceneImage: SceneShelfSceneImage,\n ProductsPanel: SceneShelfProductsPanel,\n ProductCard: SceneProductCard,\n}\n\nexport default SceneShelf\n"],
|
|
5
|
+
"mappings": "aAEA,OAAS,kBAAAA,MAAsB,YAC/B,OAAS,mBAAAC,MAAuB,aAChC,OAAS,wBAAAC,MAA4B,kBACrC,OAAS,2BAAAC,MAA+B,qBACxC,OAAS,oBAAAC,MAAwB,mBAsBjC,MAAMC,EAAa,CACjB,KAAML,EACN,MAAOC,EACP,WAAYC,EACZ,cAAeC,EACf,YAAaC,CACf,EAEA,IAAOE,EAAQD",
|
|
6
|
+
"names": ["SceneShelfRoot", "SceneShelfScene", "SceneShelfSceneImage", "SceneShelfProductsPanel", "SceneProductCard", "SceneShelf", "SceneShelf_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 产品卡片语义化名称
|
|
3
|
+
*/
|
|
4
|
+
export type SceneProductCardSemanticName = 'card' | 'cardSelected' | 'tags' | 'checkbox' | 'image' | 'title' | 'priceWrapper' | 'currentPrice' | 'originalPrice';
|
|
5
|
+
/**
|
|
6
|
+
* SceneShelf 语义化类名
|
|
7
|
+
*/
|
|
8
|
+
export type SceneShelfSemanticName = 'root' | 'header' | 'title' | 'subtitle' | 'sceneList' | 'scene' | 'sceneImage' | 'content' | 'productList' | 'footer' | 'totalPrice' | 'currentTotalPrice' | 'originalTotalPrice' | 'buttonGroup' | SceneProductCardSemanticName;
|
|
9
|
+
/**
|
|
10
|
+
* 产品标签数据
|
|
11
|
+
*/
|
|
12
|
+
export interface ProductTag {
|
|
13
|
+
/** 标签文本 */
|
|
14
|
+
label: string;
|
|
15
|
+
/** 标签样式变体 */
|
|
16
|
+
variant?: 'outline' | 'fill';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 价格数据接口
|
|
20
|
+
*/
|
|
21
|
+
export interface PriceData {
|
|
22
|
+
/** 价格数值 */
|
|
23
|
+
value: number;
|
|
24
|
+
/** 格式化后的价格字符串 */
|
|
25
|
+
formatted: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 产品卡片数据接口
|
|
29
|
+
*/
|
|
30
|
+
export interface SceneProductCardData {
|
|
31
|
+
/** 产品唯一标识 */
|
|
32
|
+
id: string;
|
|
33
|
+
/** 产品名称 */
|
|
34
|
+
title: string;
|
|
35
|
+
/** 产品图片 URL */
|
|
36
|
+
imageUrl: string;
|
|
37
|
+
/** 产品图片 Alt */
|
|
38
|
+
imageAlt?: string;
|
|
39
|
+
/** 当前价格 */
|
|
40
|
+
currentPrice: PriceData;
|
|
41
|
+
/** 原价(可选,用于显示删除线价格) */
|
|
42
|
+
originalPrice?: PriceData;
|
|
43
|
+
/** 产品标签列表 */
|
|
44
|
+
tags?: ProductTag[];
|
|
45
|
+
/** 是否默认选中 */
|
|
46
|
+
defaultSelected?: boolean;
|
|
47
|
+
/** 产品链接 */
|
|
48
|
+
href?: string;
|
|
49
|
+
/** 是否售罄 */
|
|
50
|
+
soldOut?: boolean;
|
|
51
|
+
}
|
|
@@ -2,12 +2,32 @@ import * as React from 'react';
|
|
|
2
2
|
import type { Media as MediaType, Theme } from '../../types/props.js';
|
|
3
3
|
import type { ButtonProps } from '../../components/button.js';
|
|
4
4
|
export type SecondaryBannerSemanticName = 'root' | 'title' | 'superTitle' | 'subtitle' | 'content' | 'buttonGroup' | 'primaryButton' | 'secondaryButton';
|
|
5
|
+
/**
|
|
6
|
+
* jump.js 配置选项
|
|
7
|
+
*/
|
|
8
|
+
export interface JumpOptions {
|
|
9
|
+
/** 动画持续时间(毫秒) @default 500 */
|
|
10
|
+
duration?: number;
|
|
11
|
+
/** 偏移量(像素) @default 0 */
|
|
12
|
+
offset?: number;
|
|
13
|
+
/** 动画完成回调 */
|
|
14
|
+
callback?: () => void;
|
|
15
|
+
/** 缓动函数 */
|
|
16
|
+
easing?: (t: number, b: number, c: number, d: number) => number;
|
|
17
|
+
/** 是否考虑 a11y @default false */
|
|
18
|
+
a11y?: boolean;
|
|
19
|
+
}
|
|
5
20
|
/**
|
|
6
21
|
* SecondaryBanner 业务组件数据接口
|
|
7
22
|
*/
|
|
8
23
|
export interface SecondaryBannerData {
|
|
9
24
|
/** 主标题*/
|
|
10
25
|
title?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 主标题标签
|
|
28
|
+
* @default 'h1'
|
|
29
|
+
*/
|
|
30
|
+
titleTag?: 'h1' | 'h2';
|
|
11
31
|
/**
|
|
12
32
|
* 上标题/引导标题
|
|
13
33
|
* 通常用于分类、引导性文字
|
|
@@ -61,6 +81,11 @@ export interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement>
|
|
|
61
81
|
/** 业务数据 */
|
|
62
82
|
data: SecondaryBannerData;
|
|
63
83
|
classNames?: Partial<Record<SecondaryBannerSemanticName, string>>;
|
|
84
|
+
/**
|
|
85
|
+
* 锚点跳转配置(用于 # 开头的链接)
|
|
86
|
+
* @default { duration: 500, offset: 0 }
|
|
87
|
+
*/
|
|
88
|
+
jumpOptions?: JumpOptions;
|
|
64
89
|
}
|
|
65
90
|
/**
|
|
66
91
|
* SecondaryBanner - 次级横幅banner
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as p}from"react/jsx-runtime";import*as y from"react";import{cva as w}from"class-variance-authority";import x from"jump.js";import{cn as a}from"../../helpers/index.js";import{Text as k,Button as v,Heading as A,Picture as E,Countdown as J}from"../../components/index.js";import R from"../Media/index.js";const V=w("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible"}},defaultVariants:{size:"base"}}),B=y.forwardRef(({className:h,classNames:n={},data:t,jumpOptions:T={},...I},M)=>{const{pcImage:N,padImage:z,mobileImage:S,isVideoLoop:C=!1,endDate:u,endDate_tz:D,dateFormat:O,size:c="base",iconArray:d,theme:j="light",primaryButton:o,secondaryButton:s,title:L,titleTag:P="h1"}=t,b={...{duration:500,offset:0},...T},m=y.useId(),l=L?`${m}-title`:void 0,g=t.subtitle?`${m}-subtitle`:void 0,f=t.superTitle?`${m}-super-title`:void 0,H=[f,g].filter(Boolean).join(" ")||void 0;return p("section",{ref:M,role:"banner","aria-labelledby":l,"aria-describedby":H,className:a({"aiui-dark":j==="dark"},V({size:c}),h,n?.root),...I,children:[e(R,{pcImage:N,padImage:z,mobileImage:S,className:a("absolute inset-0 size-full object-cover",{"h-fit":c==="xlg"}),imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:C,playsInline:!0,autoPlay:!0}),p("div",{className:a("banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left",n?.content),children:[p("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[t.superTitle&&e(k,{as:"p",size:2,id:f,className:a("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",n?.superTitle),html:t.superTitle}),t.title&&e(A,{as:P,size:["xlg","lg"].includes(c)?5:4,id:l,className:a("banner-title ",n?.title),html:t.title}),t.subtitle&&e(k,{as:"p",size:3,id:g,className:a("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",n?.subtitle),html:t.subtitle})]}),u&&e("div",{className:"banner-countdown",children:e(J,{endDate:u,endDate_tz:D,dateFormat:O,variant:"spacious",className:"lg-desktop:mt-8 mt-6"})}),p("div",{className:a("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",n?.buttonGroup),children:[s?.text&&e(v,{variant:"secondary",onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const i=document.querySelector(s.link);i&&x(i,b)}s.onClick?.()},className:a("",n?.secondaryButton),"aria-describedby":l,...s.link&&!s.link.startsWith("#")?{as:"a",href:s.link}:{},children:s.text}),o?.text&&e(v,{onClick:r=>{if(o.link?.startsWith("#")){r.preventDefault();const i=document.querySelector(o.link);i&&x(i,b)}o.onClick?.()},className:a("",n?.primaryButton),"aria-describedby":l,...o.link&&!o.link.startsWith("#")?{as:"a",href:o.link}:{},children:o.text})]}),Array.isArray(d)&&d.length>0&&e("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:d.map((r,i)=>r.pcImage?e(E,{source:r.pcImage.url,alt:r.pcImage.alt||`icon ${i+1}`,role:"img",className:"laptop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},i):null)})]})]})});B.displayName="SecondaryBanner";var K=B;export{K as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SecondaryBanner/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport { cn } from '../../helpers/index.js'\nimport type { Media as MediaType, Theme } from '../../types/props.js'\nimport { Text, Button, Heading, Picture, Countdown } from '../../components/index.js'\nimport Media from '../Media/index.js'\nimport type { ButtonProps } from '../../components/button.js'\n\nexport type SecondaryBannerSemanticName =\n | 'root'\n | 'title'\n | 'superTitle'\n | 'subtitle'\n | 'content'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n\nconst secondaryBannerVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\n 'text-info-primary relative w-full',\n {\n variants: {\n size: {\n sm: 'tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]',\n base: 'tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]',\n lg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]',\n xlg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\n/**\n * SecondaryBanner \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface SecondaryBannerData {\n /** \u4E3B\u6807\u9898*/\n title?: string\n /**\n * \u4E0A\u6807\u9898/\u5F15\u5BFC\u6807\u9898\n * \u901A\u5E38\u7528\u4E8E\u5206\u7C7B\u3001\u5F15\u5BFC\u6027\u6587\u5B57\n */\n superTitle?: string\n /**\n * \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u5B57\n * \u901A\u5E38\u7528\u4E8E\u8865\u5145\u8BF4\u660E\u3001\u8BE6\u7EC6\u63CF\u8FF0\n */\n subtitle?: string\n /**\n * \u5C3A\u5BF8:\n * sm: \u5C0F\u5C3A\u5BF8\u7528\u4E8E\u7B5B\u9009\u9875\u9762\n * base: \u57FA\u7840\u5C3A\u5BF8\u7528\u4E8E\n * lg: \u5927\u5C3A\u5BF8\u7528\u4E8E\u4E13\u9898\u9875\n * xlg: \u6D3B\u52A8\u9875\uFF08\u901A\u680F\uFF09\n */\n size?: 'sm' | 'base' | 'lg' | 'xlg'\n pcImage?: MediaType\n padImage?: MediaType\n mobileImage?: MediaType\n /** \u89C6\u9891\u662F\u5426\u5FAA\u73AF\u64AD\u653E */\n isVideoLoop?: boolean\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n /**\n * \u65F6\u95F4\u683C\u5F0F\u5316\u914D\u7F6E\uFF08JSON \u5B57\u7B26\u4E32\uFF09\n * {\"day\":\"\u65E5\",\"hour\":\"\u65F6\",\"minute\":\"\u5206\",\"second\":\"\u79D2\"}\n */\n dateFormat?: string\n\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u7EA7\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n\n iconArray?: Array<{ pcImage: MediaType }>\n theme?: Theme\n}\n\nexport interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: SecondaryBannerData\n classNames?: Partial<Record<SecondaryBannerSemanticName, string>>\n}\n\n/**\n * SecondaryBanner - \u6B21\u7EA7\u6A2A\u5E45banner\n *\n * @description \u662F\u6307\u7528\u6237\u8FDB\u5165\u4E8C\u7EA7\u9875\u9762\u540E\uFF0C\u65E0\u9700\u6EDA\u52A8\u9875\u9762\u5C31\u80FD\u5728\u7B2C\u4E00\u5C4F\uFF08\u5373\"\u9996\u5C4F\"\uFF09\u770B\u5230\u7684\u3001\u901A\u5E38\u6A2A\u8DE8\u6574\u4E2A\u6D4F\u89C8\u5668\u7A97\u53E3\u5BBD\u5EA6\u7684\u6838\u5FC3\u89C6\u89C9\u533A\u57DF\u3002\n */\nconst SecondaryBanner = React.forwardRef<HTMLElement, SecondaryBannerProps>(\n ({ className, classNames = {}, data, ...props }, ref) => {\n const {\n pcImage,\n padImage,\n mobileImage,\n isVideoLoop = false,\n endDate,\n endDate_tz,\n dateFormat,\n size = 'base',\n iconArray: icons,\n theme = 'light',\n primaryButton,\n secondaryButton,\n } = data\n\n // \u751F\u6210\u552F\u4E00ID\u7528\u4E8E\u53EF\u8BBF\u95EE\u6027\n const bannerId = React.useId()\n const titleId = data.title ? `${bannerId}-title` : undefined\n const subtitleId = data.subtitle ? `${bannerId}-subtitle` : undefined\n const superTitleId = data.superTitle ? `${bannerId}-super-title` : undefined\n\n // \u6784\u5EFAaria-describedby\n const describedBy = [superTitleId, subtitleId].filter(Boolean).join(' ') || undefined\n\n return (\n <section\n ref={ref}\n role=\"banner\"\n aria-labelledby={titleId}\n aria-describedby={describedBy}\n className={cn(\n {\n 'aiui-dark': theme === 'dark',\n },\n secondaryBannerVariants({ size: size }),\n className,\n classNames?.root\n )}\n {...props}\n >\n <Media\n pcImage={pcImage}\n padImage={padImage}\n mobileImage={mobileImage}\n className={cn('absolute inset-0 size-full object-cover', {\n 'h-fit': size === 'xlg',\n })}\n imgClassName=\"object-cover\"\n videoClassName=\"object-cover\"\n muted={true}\n loop={isVideoLoop}\n playsInline={true}\n autoPlay={true}\n />\n <div\n className={cn(\n 'banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left',\n classNames?.content\n )}\n >\n <div className=\"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1\">\n {data.superTitle && (\n <Text\n as=\"p\"\n size={2}\n id={superTitleId}\n className={cn('banner-super-title desktop:text-[16px] lg-desktop:text-[18px]', classNames?.superTitle)}\n html={data.superTitle}\n />\n )}\n\n {data.title && (\n <Heading\n as=\"h1\"\n size={['xlg', 'lg'].includes(size) ? 5 : 4}\n id={titleId}\n className={cn('banner-title ', classNames?.title)}\n html={data.title}\n />\n )}\n\n {data.subtitle && (\n <Text\n as=\"p\"\n size={3}\n id={subtitleId}\n className={cn('banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]', classNames?.subtitle)}\n html={data.subtitle}\n />\n )}\n </div>\n\n {endDate && (\n <div className=\"banner-countdown\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n className=\"mt-3\"\n />\n </div>\n )}\n\n <div\n className={cn(\n 'banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2',\n classNames?.buttonGroup\n )}\n >\n {secondaryButton?.text && (\n <Button\n variant=\"secondary\"\n onClick={secondaryButton.onClick}\n className={cn('', classNames?.secondaryButton)}\n aria-describedby={titleId}\n {...(secondaryButton.link ? { as: 'a', href: secondaryButton.link } : {})}\n >\n {secondaryButton.text}\n </Button>\n )}\n {primaryButton?.text && (\n <Button\n onClick={primaryButton.onClick}\n className={cn('', classNames?.primaryButton)}\n aria-describedby={titleId}\n {...(primaryButton.link ? { as: 'a', href: primaryButton.link } : {})}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n\n {Array.isArray(icons) && icons.length > 0 && (\n <div\n className=\"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2\"\n role=\"group\"\n aria-label=\"brand icons\"\n >\n {icons.map((icon, index) =>\n icon.pcImage ? (\n <Picture\n key={index}\n source={icon.pcImage.url}\n alt={icon.pcImage.alt || `icon ${index + 1}`}\n role=\"img\"\n className=\"h-auto max-w-none\"\n />\n ) : null\n )}\n </div>\n )}\n </div>\n </section>\n )\n }\n)\n\nSecondaryBanner.displayName = 'SecondaryBanner'\nexport default SecondaryBanner\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cva", "cn", "Text", "Button", "Heading", "Picture", "Countdown", "Media", "secondaryBannerVariants", "SecondaryBanner", "className", "classNames", "data", "props", "ref", "pcImage", "padImage", "mobileImage", "isVideoLoop", "endDate", "endDate_tz", "dateFormat", "size", "icons", "theme", "primaryButton", "secondaryButton", "bannerId", "titleId", "subtitleId", "superTitleId", "describedBy", "icon", "index", "SecondaryBanner_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport jump from 'jump.js'\nimport { cn } from '../../helpers/index.js'\nimport type { Media as MediaType, Theme } from '../../types/props.js'\nimport { Text, Button, Heading, Picture, Countdown } from '../../components/index.js'\nimport Media from '../Media/index.js'\nimport type { ButtonProps } from '../../components/button.js'\n\nexport type SecondaryBannerSemanticName =\n | 'root'\n | 'title'\n | 'superTitle'\n | 'subtitle'\n | 'content'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n\n/**\n * jump.js \u914D\u7F6E\u9009\u9879\n */\nexport interface JumpOptions {\n /** \u52A8\u753B\u6301\u7EED\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 @default 500 */\n duration?: number\n /** \u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09 @default 0 */\n offset?: number\n /** \u52A8\u753B\u5B8C\u6210\u56DE\u8C03 */\n callback?: () => void\n /** \u7F13\u52A8\u51FD\u6570 */\n easing?: (t: number, b: number, c: number, d: number) => number\n /** \u662F\u5426\u8003\u8651 a11y @default false */\n a11y?: boolean\n}\n\nconst secondaryBannerVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\n 'text-info-primary relative w-full',\n {\n variants: {\n size: {\n sm: 'tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]',\n base: 'tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]',\n lg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]',\n xlg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\n/**\n * SecondaryBanner \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface SecondaryBannerData {\n /** \u4E3B\u6807\u9898*/\n title?: string\n /**\n * \u4E3B\u6807\u9898\u6807\u7B7E\n * @default 'h1'\n */\n titleTag?: 'h1' | 'h2'\n /**\n * \u4E0A\u6807\u9898/\u5F15\u5BFC\u6807\u9898\n * \u901A\u5E38\u7528\u4E8E\u5206\u7C7B\u3001\u5F15\u5BFC\u6027\u6587\u5B57\n */\n superTitle?: string\n /**\n * \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u5B57\n * \u901A\u5E38\u7528\u4E8E\u8865\u5145\u8BF4\u660E\u3001\u8BE6\u7EC6\u63CF\u8FF0\n */\n subtitle?: string\n /**\n * \u5C3A\u5BF8:\n * sm: \u5C0F\u5C3A\u5BF8\u7528\u4E8E\u7B5B\u9009\u9875\u9762\n * base: \u57FA\u7840\u5C3A\u5BF8\u7528\u4E8E\n * lg: \u5927\u5C3A\u5BF8\u7528\u4E8E\u4E13\u9898\u9875\n * xlg: \u6D3B\u52A8\u9875\uFF08\u901A\u680F\uFF09\n */\n size?: 'sm' | 'base' | 'lg' | 'xlg'\n pcImage?: MediaType\n padImage?: MediaType\n mobileImage?: MediaType\n /** \u89C6\u9891\u662F\u5426\u5FAA\u73AF\u64AD\u653E */\n isVideoLoop?: boolean\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n /**\n * \u65F6\u95F4\u683C\u5F0F\u5316\u914D\u7F6E\uFF08JSON \u5B57\u7B26\u4E32\uFF09\n * {\"day\":\"\u65E5\",\"hour\":\"\u65F6\",\"minute\":\"\u5206\",\"second\":\"\u79D2\"}\n */\n dateFormat?: string\n\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u7EA7\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n\n iconArray?: Array<{ pcImage: MediaType }>\n theme?: Theme\n}\n\nexport interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: SecondaryBannerData\n classNames?: Partial<Record<SecondaryBannerSemanticName, string>>\n /**\n * \u951A\u70B9\u8DF3\u8F6C\u914D\u7F6E\uFF08\u7528\u4E8E # \u5F00\u5934\u7684\u94FE\u63A5\uFF09\n * @default { duration: 500, offset: 0 }\n */\n jumpOptions?: JumpOptions\n}\n\n/**\n * SecondaryBanner - \u6B21\u7EA7\u6A2A\u5E45banner\n *\n * @description \u662F\u6307\u7528\u6237\u8FDB\u5165\u4E8C\u7EA7\u9875\u9762\u540E\uFF0C\u65E0\u9700\u6EDA\u52A8\u9875\u9762\u5C31\u80FD\u5728\u7B2C\u4E00\u5C4F\uFF08\u5373\"\u9996\u5C4F\"\uFF09\u770B\u5230\u7684\u3001\u901A\u5E38\u6A2A\u8DE8\u6574\u4E2A\u6D4F\u89C8\u5668\u7A97\u53E3\u5BBD\u5EA6\u7684\u6838\u5FC3\u89C6\u89C9\u533A\u57DF\u3002\n */\nconst SecondaryBanner = React.forwardRef<HTMLElement, SecondaryBannerProps>(\n ({ className, classNames = {}, data, jumpOptions = {}, ...props }, ref) => {\n const {\n pcImage,\n padImage,\n mobileImage,\n isVideoLoop = false,\n endDate,\n endDate_tz,\n dateFormat,\n size = 'base',\n iconArray: icons,\n theme = 'light',\n primaryButton,\n secondaryButton,\n title,\n titleTag = 'h1',\n } = data\n\n // \u9ED8\u8BA4 jump \u914D\u7F6E\n const defaultJumpOptions: JumpOptions = { duration: 500, offset: 0 }\n const mergedJumpOptions = { ...defaultJumpOptions, ...jumpOptions }\n\n // \u751F\u6210\u552F\u4E00ID\u7528\u4E8E\u53EF\u8BBF\u95EE\u6027\n const bannerId = React.useId()\n const titleId = title ? `${bannerId}-title` : undefined\n const subtitleId = data.subtitle ? `${bannerId}-subtitle` : undefined\n const superTitleId = data.superTitle ? `${bannerId}-super-title` : undefined\n\n // \u6784\u5EFAaria-describedby\n const describedBy = [superTitleId, subtitleId].filter(Boolean).join(' ') || undefined\n\n return (\n <section\n ref={ref}\n role=\"banner\"\n aria-labelledby={titleId}\n aria-describedby={describedBy}\n className={cn(\n {\n 'aiui-dark': theme === 'dark',\n },\n secondaryBannerVariants({ size: size }),\n className,\n classNames?.root\n )}\n {...props}\n >\n <Media\n pcImage={pcImage}\n padImage={padImage}\n mobileImage={mobileImage}\n className={cn('absolute inset-0 size-full object-cover', {\n 'h-fit': size === 'xlg',\n })}\n imgClassName=\"object-cover\"\n videoClassName=\"object-cover\"\n muted={true}\n loop={isVideoLoop}\n playsInline={true}\n autoPlay={true}\n />\n <div\n className={cn(\n 'banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left',\n classNames?.content\n )}\n >\n <div className=\"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1\">\n {data.superTitle && (\n <Text\n as=\"p\"\n size={2}\n id={superTitleId}\n className={cn('banner-super-title desktop:text-[16px] lg-desktop:text-[18px]', classNames?.superTitle)}\n html={data.superTitle}\n />\n )}\n\n {data.title && (\n <Heading\n as={titleTag}\n size={['xlg', 'lg'].includes(size) ? 5 : 4}\n id={titleId}\n className={cn('banner-title ', classNames?.title)}\n html={data.title}\n />\n )}\n\n {data.subtitle && (\n <Text\n as=\"p\"\n size={3}\n id={subtitleId}\n className={cn('banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]', classNames?.subtitle)}\n html={data.subtitle}\n />\n )}\n </div>\n\n {endDate && (\n <div className=\"banner-countdown\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n className=\"lg-desktop:mt-8 mt-6\"\n />\n </div>\n )}\n\n <div\n className={cn(\n 'banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2',\n classNames?.buttonGroup\n )}\n >\n {secondaryButton?.text && (\n <Button\n variant=\"secondary\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n if (secondaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(secondaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n secondaryButton.onClick?.()\n }}\n className={cn('', classNames?.secondaryButton)}\n aria-describedby={titleId}\n {...(secondaryButton.link && !secondaryButton.link.startsWith('#')\n ? { as: 'a', href: secondaryButton.link }\n : {})}\n >\n {secondaryButton.text}\n </Button>\n )}\n {primaryButton?.text && (\n <Button\n onClick={e => {\n if (primaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(primaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n primaryButton.onClick?.()\n }}\n className={cn('', classNames?.primaryButton)}\n aria-describedby={titleId}\n {...(primaryButton.link && !primaryButton.link.startsWith('#')\n ? { as: 'a', href: primaryButton.link }\n : {})}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n\n {Array.isArray(icons) && icons.length > 0 && (\n <div\n className=\"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2\"\n role=\"group\"\n aria-label=\"brand icons\"\n >\n {icons.map((icon, index) =>\n icon.pcImage ? (\n <Picture\n key={index}\n source={icon.pcImage.url}\n alt={icon.pcImage.alt || `icon ${index + 1}`}\n role=\"img\"\n className=\"laptop:h-auto h-[48px] max-w-none\"\n imgClassName=\"h-full\"\n />\n ) : null\n )}\n </div>\n )}\n </div>\n </section>\n )\n }\n)\n\nSecondaryBanner.displayName = 'SecondaryBanner'\nexport default SecondaryBanner\n"],
|
|
5
|
+
"mappings": "aAoLQ,cAAAA,EAoBE,QAAAC,MApBF,oBAlLR,UAAYC,MAA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jB,GAAIL,EAAgB,MAAQ,CAACA,EAAgB,KAAK,WAAW,GAAG,EAC7D,CAAE,GAAI,IAAK,KAAMA,EAAgB,IAAK,EACtC,CAAC,EAEJ,SAAAA,EAAgB,KACnB,EAEDD,GAAe,MACd9B,EAACO,EAAA,CACC,QAASiC,GAAK,CACZ,GAAIV,EAAc,MAAM,WAAW,GAAG,EAAG,CACvCU,EAAE,eAAe,EACjB,MAAMC,EAAU,SAAS,cAAcX,EAAc,IAAI,EACrDW,GACFrC,EAAKqC,EAAwBP,CAAiB,CAElD,CACAJ,EAAc,UAAU,CAC1B,EACA,UAAWzB,EAAG,GAAIU,GAAY,aAAa,EAC3C,mBAAkBqB,EACjB,GAAIN,EAAc,MAAQ,CAACA,EAAc,KAAK,WAAW,GAAG,EACzD,CAAE,GAAI,IAAK,KAAMA,EAAc,IAAK,EACpC,CAAC,EAEJ,SAAAA,EAAc,KACjB,GAEJ,EAEC,MAAM,QAAQF,CAAK,GAAKA,EAAM,OAAS,GACtC5B,EAAC,OACC,UAAU,yEACV,KAAK,QACL,aAAW,cAEV,SAAA4B,EAAM,IAAI,CAACc,EAAMC,IAChBD,EAAK,QACH1C,EAACS,EAAA,CAEC,OAAQiC,EAAK,QAAQ,IACrB,IAAKA,EAAK,QAAQ,KAAO,QAAQC,EAAQ,CAAC,GAC1C,KAAK,MACL,UAAU,oCACV,aAAa,UALRA,CAMP,EACE,IACN,EACF,GAEJ,GACF,CAEJ,CACF,EAEA9B,EAAgB,YAAc,kBAC9B,IAAO+B,EAAQ/B",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cva", "jump", "cn", "Text", "Button", "Heading", "Picture", "Countdown", "Media", "secondaryBannerVariants", "SecondaryBanner", "className", "classNames", "data", "jumpOptions", "props", "ref", "pcImage", "padImage", "mobileImage", "isVideoLoop", "endDate", "endDate_tz", "dateFormat", "size", "icons", "theme", "primaryButton", "secondaryButton", "title", "titleTag", "mergedJumpOptions", "bannerId", "titleId", "subtitleId", "superTitleId", "describedBy", "e", "element", "icon", "index", "SecondaryBanner_default"]
|
|
7
7
|
}
|
|
@@ -59,6 +59,7 @@ export { default as SelectStore } from './SelectStore/index.js';
|
|
|
59
59
|
export { default as DownLoad } from './DownLoad/index.js';
|
|
60
60
|
export { default as FootCharger } from './FootCharger/index.js';
|
|
61
61
|
export { default as BrandCardLink } from './BrandCardLink/index.js';
|
|
62
|
+
export type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js';
|
|
62
63
|
export * as IPRedirect from './IPRedirect/index.js';
|
|
63
64
|
export { default as ProductCompare } from './ProductCompare/index.js';
|
|
64
65
|
export type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js';
|
|
@@ -95,11 +96,17 @@ export { default as SecondaryBanner } from './SecondaryBanner/index.js';
|
|
|
95
96
|
export { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js';
|
|
96
97
|
export { default as ActiveShelf } from './ActiveShelf/index.js';
|
|
97
98
|
export { default as MediaShelf } from './MediaShelf/index.js';
|
|
99
|
+
export { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js';
|
|
100
|
+
export type { CreditsShelfSemanticName, CreditsProductCardData, CopyConfig as CreditsShelfCopyConfig, ButtonFunctionType as CreditsShelfButtonFunctionType, } from './CreditsShelf/index.js';
|
|
101
|
+
export { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js';
|
|
102
|
+
export type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js';
|
|
98
103
|
export type { CopyConfig as MediaShelfCopyConfig, ButtonFunctionType as MediaShelfButtonFunctionType, } from './MediaShelf/types.js';
|
|
99
104
|
export type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js';
|
|
100
105
|
export { default as ImageOverlayShelf, type ButtonFunctionType as ImageOverlayShelfButtonFunctionType, } from './ImageOverlayShelf/index.js';
|
|
101
106
|
export { default as MiniCart } from './MiniCart/index.js';
|
|
102
|
-
export type { Cart, CartLineItem, MiniCartData, MiniCartProps } from './MiniCart/index.js';
|
|
107
|
+
export type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js';
|
|
108
|
+
export { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js';
|
|
109
|
+
export type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js';
|
|
103
110
|
export { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js';
|
|
104
111
|
export type { MiniCartDialogProps, MiniCartDialogCopy, MiniCartDialogSemanticName, CartData, } from './MiniCart/MiniCartDialog.js';
|
|
105
112
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as a}from"./BrandEquity/index.js";import{default as p}from"./MemberEquity/index.js";import{default as s}from"./Slogan/index.js";import{default as d}from"./Title/index.js";import{default as u}from"./Spacer/index.js";import{default as m}from"./ShelfDisplay/index.js";import{default as x}from"./Evaluate/index.js";import{default as h}from"./Category/index.js";import{default as P}from"./HeroBanner/index.js";import{default as g}from"./AccordionCards/index.js";import{default as B}from"./Graphic/index.js";import{default as v}from"./MediaPlayerBase/index.js";import{default as b}from"./MediaPlayerSticky/index.js";import{default as j}from"./MediaPlayerMulti/index.js";import{default as A}from"./Marquee/index.js";import{default as k}from"./MarqueeReview/index.js";import{default as w}from"./WhyChoose/index.js";import{default as N}from"./Faq/index.js";import{MarqueeItem as W,MarqueeImageContent as E,MarqueeTextContent as H}from"./Marquee/index.js";import{default as K}from"./MultiLayoutGraphicBlock/index.js";import{default as V}from"./GraphicAttractionBlock/index.js";import{default as Y}from"./HeaderNavigation/index.js";import{default as Q}from"./FooterNavigation/index.js";import{default as X}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as $,SearchPageTabType as ee}from"./SearchPage/types.js";import{withLayout as te}from"../shared/Styles.js";import{default as oe}from"./AiuiProvider/index.js";import{default as ie}from"./Tabs/index.js";import{default as fe}from"./CreativeModule/index.js";import{default as ce}from"./GraphicOverlay/index.js";import{default as le}from"./Specs/index.js";import{default as ne}from"./TabsGroup/index.js";import{default as ye}from"./Listing/BizProductProvider.js";import{default as Ce}from"./Listing/components/PurchaseBar/index.js";import{default as Se}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as Me}from"./Listing/components/ProductCard/index.js";import{default as Te}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ie}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Fe}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as De}from"./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js";import{default as Ge}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as qe}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as Le}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as Oe}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as Ee}from"./Listing/components/ProductCard/ProductDetail/index.js";import{default as Re}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as _e}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as ze}from"./Listing/components/PaidShipping/index.js";import{default as Je}from"./GraphicMore/index.js";import{default as Ue}from"./Features/index.js";import{default as Ze}from"./AplusDesc/index.js";import{default as er}from"./GiftBox/index.js";import{default as tr}from"./SelectStore/index.js";import{default as or}from"./DownLoad/index.js";import{default as ir}from"./FootCharger/index.js";import{default as fr}from"./BrandCardLink/index.js";import*as dr from"./IPRedirect/index.js";import{default as ur}from"./ProductCompare/index.js";import{default as mr}from"./Ksp/index.js";import{default as xr}from"./ImageTextFeature/index.js";import{default as hr}from"./FeatureCards/index.js";import{default as Pr}from"./ImageWithText/index.js";import{default as gr}from"./VideoFeature/index.js";import{default as Br}from"./TabsWithMedia/index.js";import{default as vr}from"./TabWithImage/index.js";import{default as br}from"./FeatureShowcase/index.js";import{default as jr}from"./ProductHero/index.js";import{default as Ar}from"./SpecsComparison/index.js";import{default as kr}from"./MediaSceneSwitcher/index.js";import{default as wr}from"./ThreeDCarousel/index.js";import{default as Nr}from"./ProductNav/index.js";import{default as Wr}from"./AnchorNavigation/index.js";import{default as Hr}from"./PromotionalBar/index.js";import{default as Kr}from"./EventSchedule/index.js";import{default as Vr}from"./SecondaryBanner/index.js";import{default as Yr}from"./BuyOneGetOneShelf/index.js";import{default as Qr}from"./ActiveShelf/index.js";import{default as Xr}from"./MediaShelf/index.js";import{default as $r,CreditsProductCard as et}from"./CreditsShelf/index.js";import{default as tt,SceneProductCard as at}from"./SceneShelf/index.js";import{default as pt}from"./ImageOverlayShelf/index.js";import{default as st}from"./MiniCart/index.js";import{default as dt}from"./MiniCart/CircleProgress.js";import{default as ut,MiniCartDialog as lt}from"./MiniCart/MiniCartDialog.js";const e={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-active-shelf":"ActiveShelf","ipc-media-shelf":"MediaShelf","ipc-bogo-shelf":"BuyOneGetOneShelf"};export{g as AccordionCards,Qr as ActiveShelf,oe as AiuiProvider,Wr as AnchorNavigation,Ze as AplusDesc,_e as BenefitsTab,ye as BizProductProvider,fr as BrandCardLink,a as BrandEquity,Yr as BuyOneGetOneShelf,h as Category,fe as CreativeModule,et as CreditsProductCard,$r as CreditsShelf,or as DownLoad,x as Evaluate,Kr as EventSchedule,N as Faq,hr as FeatureCards,br as FeatureShowcase,Ue as Features,ir as FootCharger,Q as FooterNavigation,er as GiftBox,B as Graphic,V as GraphicAttractionBlock,Je as GraphicMore,ce as GraphicOverlay,Y as HeaderNavigation,P as HeroBanner,$ as IPC_SEARCH_PAGE,dr as IPRedirect,pt as ImageOverlayShelf,xr as ImageTextFeature,Pr as ImageWithText,mr as Ksp,A as Marquee,E as MarqueeImageContent,W as MarqueeItem,k as MarqueeReview,H as MarqueeTextContent,v as MediaPlayerBase,j as MediaPlayerMulti,b as MediaPlayerSticky,kr as MediaSceneSwitcher,Xr as MediaShelf,p as MemberEquity,st as MiniCart,dt as MiniCartCircleProgress,ut as MiniCartDialog,lt as MiniCartDialogComponent,K as MultiLayoutGraphicBlock,e as PAYLOAD_COMPONENT_MAP,ze as PaidShipping,Se as ProductActions,Te as ProductBenefitsTabs,qe as ProductBundle,Me as ProductCard,ur as ProductCompare,Ee as ProductDetail,De as ProductExchangePurchase,Fe as ProductFreeGift,Oe as ProductGallery,Le as ProductGridBox,jr as ProductHero,Ie as ProductHighlight,Nr as ProductNav,Ge as ProductOptions,Re as ProductSummary,Hr as PromotionalBar,Ce as PurchaseBar,at as SceneProductCard,tt as SceneShelf,X as SearchPage,ee as SearchPageTabType,Vr as SecondaryBanner,tr as SelectStore,m as ShelfDisplay,s as Slogan,u as Spacer,le as Specs,Ar as SpecsComparison,ne as TabGroup,vr as TabWithImage,ie as Tabs,Br as TabsWithMedia,wr as ThreeDCarousel,d as Title,gr as VideoFeature,w as WhyChoose,te as withLayout};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/biz-components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps } from './MiniCart/index.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'Tabs',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAAyB,oBAClC,OAAoB,WAAXA,MAAwB,mBACjC,OAAoB,WAAXA,MAAyB,oBAClC,OAAo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XA,OAAiC,2DAC1C,OAAoB,WAAXA,OAA8B,gEACvC,OAAoB,WAAXA,OAA+B,6CAExC,OAAoB,WAAXA,OAA8B,yBACvC,OAAoB,WAAXA,OAA2B,sBACpC,OAAoB,WAAXA,OAA4B,uBACrC,OAAoB,WAAXA,OAA0B,qBACnC,OAAoB,WAAXA,OAA8B,yBACvC,OAAoB,WAAXA,OAA2B,sBACpC,OAAoB,WAAXA,OAA8B,yBACvC,OAAoB,WAAXA,OAAgC,
|
|
6
|
-
"names": ["default", "MarqueeItem", "MarqueeImageContent", "MarqueeTextContent", "IPC_SEARCH_PAGE", "SearchPageTabType", "withLayout", "IPRedirect", "MiniCartDialog", "PAYLOAD_COMPONENT_MAP"]
|
|
4
|
+
"sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js'\n\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\nexport { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js'\nexport type {\n CreditsShelfSemanticName,\n CreditsProductCardData,\n CopyConfig as CreditsShelfCopyConfig,\n ButtonFunctionType as CreditsShelfButtonFunctionType,\n} from './CreditsShelf/index.js'\nexport { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js'\nexport type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js'\nexport { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'\nexport type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'Tabs',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAAyB,oBAClC,OAAoB,WAAXA,MAAwB,mBACjC,OAAoB,WAAXA,MAAyB,oBAClC,OAAoB,WAAXA,MAA+B,0BACxC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA2B,sBACpC,OAAoB,WAAXA,MAA6B,wBACtC,OAAoB,WAAXA,MAAiC,4BAC1C,OAAoB,WAAXA,MAA0B,qBACnC,OAAoB,WAAXA,MAAkC,6BAC3C,OAAoB,WAAXA,MAAoC,+BAC7C,OAAoB,WAAXA,MAAmC,8BAC5C,OAAoB,WAAXA,MAA0B,qBACnC,OAAoB,WAAXA,MAAgC,2BAEzC,OAAoB,WAAXA,MAA4B,uBACrC,OAAoB,WAAXA,MAAsB,iBAC/B,OAAS,eAAAC,EAAa,uBAAAC,EAAqB,sBAAAC,MAA0B,qBACrE,OAAoB,WAAXH,MAA0C,qCAEnD,OAAoB,WAAXA,MAAyC,oCAElD,OAAoB,WAAXA,MAAmC,8BAC5C,OAAoB,WAAXA,MAAmC,8BAC5C,OAAoB,WAAXA,MAA6B,wBAEtC,OAAS,mBAAAI,EAAiB,qBAAAC,OAAyB,wBAE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", "SearchPageTabType", "withLayout", "IPRedirect", "CreditsProductCard", "SceneProductCard", "MiniCartDialog", "PAYLOAD_COMPONENT_MAP"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as o}from"react/jsx-runtime";import _,{useEffect as E,useRef as A,useState as L,useMemo as B}from"react";import{cva as l}from"class-variance-authority";import{cn as
|
|
1
|
+
"use client";import{jsx as n,jsxs as o}from"react/jsx-runtime";import _,{useEffect as E,useRef as A,useState as L,useMemo as B}from"react";import{cva as l}from"class-variance-authority";import{cn as i}from"../helpers/index.js";const J=l("countdown-container flex w-full items-center",{variants:{variant:{outline:"gap-1",spacious:"gap-1"}},defaultVariants:{variant:"outline"}}),u=l("time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs",{variants:{variant:{outline:"border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]",spacious:"bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]"}},defaultVariants:{variant:"outline"}}),m=l("time-number lg-desktop:text-[24px] desktop:leading-[120%] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none"),w=l("separator desktop:text-2xl text-xl font-bold",{variants:{variant:{outline:"text-info-primary",spacious:"text-info-primary"}},defaultVariants:{variant:"outline"}}),p=(a,t=2)=>String(Math.abs(a)).padStart(t,"0"),x=()=>({day:"Day",hour:"Hours",minute:"Mins",second:"Secs"}),$=a=>{try{let t=a?.trim?.();return!t?.startsWith?.("{")||!t?.endsWith?.("}")?x():(t=t?.replace?.(/(\w+)\s*:/g,'"$1":'),{...x(),...JSON.parse(t)})}catch{return x()}},S=_.forwardRef(({className:a,endDate:t,endDate_tz:q,locale:G,timeLabels:f,dateFormat:v,onExpire:h,separator:b=":",hideWhenExpired:R=!0,variant:s,...z},C)=>{const c=B(()=>f||(v?$(v):x()),[f,v]),r=A(Date.parse(t)),[H,y]=L(()=>{const e=r.current;return isNaN(e)?0:Math.max(0,e-Date.now())}),[N,M]=L(()=>{const e=r.current;return!isNaN(e)&&e<=Date.now()});E(()=>{r.current=Date.parse(t);const e=r.current,d=isNaN(e)?0:Math.max(0,e-Date.now()),g=!isNaN(e)&&e<=Date.now();y(d),M(g)},[t]),E(()=>{if(N||isNaN(r.current))return;let e=!1;const d=()=>{const j=Date.now(),V=Math.max(0,r.current-j);y(V),V<=0&&!e&&(e=!0,M(!0),h?.())};d();const g=window.setInterval(d,1e3);return()=>clearInterval(g)},[h,N,t]);const D=Math.floor(H/1e3),I=D%60,k=Math.floor(D/60),P=k%60,T=Math.floor(k/60),O=T%24,W=Math.floor(T/24);return N&&R?null:o("div",{ref:C,className:i(J({variant:s}),a),role:"timer","aria-live":"polite","aria-label":"countdown timer",...z,children:[o("div",{className:i(u({variant:s}),"time-days-box"),children:[n("div",{className:m(),children:p(W,2)}),n("div",{className:"truncate text-center text-[12px] font-bold",children:c.day})]}),n("div",{className:w({variant:s}),children:b}),o("div",{className:i(u({variant:s}),"time-hours-box"),children:[n("div",{className:m(),children:p(O,2)}),n("div",{className:"truncate text-center text-[12px] font-bold",children:c.hour})]}),n("div",{className:w({variant:s}),children:b}),o("div",{className:i(u({variant:s}),"time-minutes-box"),children:[n("div",{className:m(),children:p(P,2)}),n("div",{className:"truncate text-center text-[12px] font-bold",children:c.minute})]}),n("div",{className:w({variant:s}),children:b}),o("div",{className:i(u({variant:s}),"time-seconds-box"),children:[n("div",{className:m(),children:p(I,2)}),n("div",{className:"truncate text-center text-[12px] font-bold",children:c.second})]})]})});S.displayName="Countdown";var X=S;export{X as default};
|
|
2
2
|
//# sourceMappingURL=Countdown.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Countdown.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport React, { useEffect, useRef, useState, useMemo } from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\n// \u5B9A\u4E49\u6837\u5F0F\u53D8\u4F53\nconst countdownVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5012\u8BA1\u65F6\u5BB9\u5668\n 'countdown-container flex w-full items-center',\n {\n variants: {\n variant: {\n outline: 'gap-1',\n spacious: 'gap-1',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\nconst timeBlockVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u65F6\u95F4\u5757\n 'time-block border-box flex flex-col items-center justify-center overflow-hidden text-center text-xs',\n {\n variants: {\n variant: {\n outline:\n 'border-info-primary text-info-primary desktop:size-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport React, { useEffect, useRef, useState, useMemo } from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\n// \u5B9A\u4E49\u6837\u5F0F\u53D8\u4F53\nconst countdownVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5012\u8BA1\u65F6\u5BB9\u5668\n 'countdown-container flex w-full items-center',\n {\n variants: {\n variant: {\n outline: 'gap-1',\n spacious: 'gap-1',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\nconst timeBlockVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u65F6\u95F4\u5757\n 'time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs',\n {\n variants: {\n variant: {\n outline:\n 'border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]',\n spacious: 'bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\nconst timeNumberVariants = cva(\n 'time-number lg-desktop:text-[24px] desktop:leading-[120%] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none'\n)\n\nconst separatorVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5206\u9694\u7B26\n 'separator desktop:text-2xl text-xl font-bold',\n {\n variants: {\n variant: {\n outline: 'text-info-primary',\n spacious: 'text-info-primary',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\u63A5\u53E3\n */\nexport interface TimeLabels {\n /** \u5929\u7684\u6807\u7B7E */\n day: string\n /** \u5C0F\u65F6\u7684\u6807\u7B7E */\n hour: string\n /** \u5206\u949F\u7684\u6807\u7B7E */\n minute: string\n /** \u79D2\u7684\u6807\u7B7E */\n second: string\n}\n\n/**\n * \u5012\u8BA1\u65F6\u7EC4\u4EF6Props\u63A5\u53E3\n */\nexport interface CountdownProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onExpire'>, VariantProps<typeof countdownVariants> {\n /** \u7ED3\u675F\u65F6\u95F4 - ISO\u683C\u5F0F\u5B57\u7B26\u4E32 */\n endDate: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF0C\u5982: America/Los_Angeles */\n endDate_tz?: string\n /** \u683C\u5F0F\u5316\u7528\u7684locale\uFF0C\u9ED8\u8BA4\u4F7F\u7528navigator.language */\n locale?: string\n /** \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\uFF0C\u7528\u4E8E\u56FD\u9645\u5316 */\n timeLabels?: TimeLabels\n /** JSON\u5B57\u7B26\u4E32\u683C\u5F0F\u7684\u65F6\u95F4\u6807\u7B7E\uFF08\u5411\u540E\u517C\u5BB9\uFF09 */\n dateFormat?: string\n /** \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03 */\n onExpire?: () => void\n /** \u5206\u9694\u7B26\u5B57\u7B26\uFF0C\u9ED8\u8BA4\u4E3A ':' */\n separator?: string\n /** \u9690\u85CF\u5DF2\u8FC7\u671F\u7684\u5012\u8BA1\u65F6\uFF0C\u9ED8\u8BA4\u4E3A true */\n hideWhenExpired?: boolean\n}\n\n/**\n * \u6570\u5B57\u8865\u96F6\u51FD\u6570\n */\nconst pad = (n: number, len = 2) => String(Math.abs(n)).padStart(len, '0')\n\n/**\n * \u9ED8\u8BA4\u65F6\u95F4\u6807\u7B7E\n */\nconst getDefaultTimeLabels = (): TimeLabels => ({\n day: 'Day',\n hour: 'Hours',\n minute: 'Mins',\n second: 'Secs',\n})\n\n/**\n * \u89E3\u6790dateFormat JSON\u5B57\u7B26\u4E32\uFF08\u5411\u540E\u517C\u5BB9\uFF09\n */\nconst safeStringToObject = (str: string): TimeLabels => {\n try {\n let jsonStr = str?.trim?.()\n if (!jsonStr?.startsWith?.('{') || !jsonStr?.endsWith?.('}')) {\n return getDefaultTimeLabels()\n }\n jsonStr = jsonStr?.replace?.(/(\\w+)\\s*:/g, '\"$1\":')\n return { ...getDefaultTimeLabels(), ...JSON.parse(jsonStr) }\n } catch (err) {\n return getDefaultTimeLabels()\n }\n}\n\n/**\n * Countdown - \u5012\u8BA1\u65F6\u539F\u5B50\u7EC4\u4EF6\n *\n * @description \u7528\u4E8E\u663E\u793A\u5012\u8BA1\u65F6\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u5929\u3001\u65F6\u3001\u5206\u3001\u79D2\u663E\u793A\uFF0C\u652F\u6301\u591A\u79CD\u6837\u5F0F\u53D8\u4F53\u548C\u5C3A\u5BF8\n */\nconst Countdown = React.forwardRef<HTMLDivElement, CountdownProps>(\n (\n {\n className,\n endDate,\n endDate_tz,\n locale,\n timeLabels,\n dateFormat,\n onExpire,\n separator = ':',\n hideWhenExpired = true,\n variant,\n ...props\n },\n ref\n ) => {\n // \u786E\u5B9A\u6700\u7EC8\u4F7F\u7528\u7684\u65F6\u95F4\u6807\u7B7E\n const finalTimeLabels = useMemo(() => {\n if (timeLabels) return timeLabels\n if (dateFormat) return safeStringToObject(dateFormat)\n return getDefaultTimeLabels()\n }, [timeLabels, dateFormat])\n\n // \u89E3\u6790\u76EE\u6807\u65F6\u95F4\n const targetMsRef = useRef<number>(Date.parse(endDate))\n const [remainingMs, setRemainingMs] = useState<number>(() => {\n const t = targetMsRef.current\n return isNaN(t) ? 0 : Math.max(0, t - Date.now())\n })\n\n // \u5224\u65AD\u662F\u5426\u5DF2\u8FC7\u671F\n const [isExpired, setIsExpired] = useState<boolean>(() => {\n const t = targetMsRef.current\n return !isNaN(t) && t <= Date.now()\n })\n\n // \u5F53endDate\u6539\u53D8\u65F6\u66F4\u65B0\u76EE\u6807\u65F6\u95F4\n useEffect(() => {\n targetMsRef.current = Date.parse(endDate)\n const t = targetMsRef.current\n const newRemaining = isNaN(t) ? 0 : Math.max(0, t - Date.now())\n const newIsExpired = !isNaN(t) && t <= Date.now()\n\n setRemainingMs(newRemaining)\n setIsExpired(newIsExpired)\n }, [endDate])\n\n // \u542F\u52A8\u5012\u8BA1\u65F6\u5B9A\u65F6\u5668\n useEffect(() => {\n if (isExpired) return // \u5DF2\u8FC7\u671F\u5219\u4E0D\u542F\u52A8\n if (isNaN(targetMsRef.current)) return // \u65E0\u6548\u65E5\u671F\u4E0D\u542F\u52A8\n\n let expiredCalled = false\n const tick = () => {\n const now = Date.now()\n const remaining = Math.max(0, targetMsRef.current - now)\n setRemainingMs(remaining)\n\n if (remaining <= 0 && !expiredCalled) {\n expiredCalled = true\n setIsExpired(true)\n onExpire?.()\n }\n }\n\n tick() // \u7ACB\u5373\u6267\u884C\u4E00\u6B21\n const intervalId = window.setInterval(tick, 1000)\n\n return () => clearInterval(intervalId)\n }, [onExpire, isExpired, endDate])\n\n // \u8BA1\u7B97\u65F6\u95F4\u5355\u4F4D\n const totalSeconds = Math.floor(remainingMs / 1000)\n const seconds = totalSeconds % 60\n const totalMinutes = Math.floor(totalSeconds / 60)\n const minutes = totalMinutes % 60\n const totalHours = Math.floor(totalMinutes / 60)\n const hours = totalHours % 24\n const days = Math.floor(totalHours / 24)\n\n // \u5982\u679C\u5DF2\u8FC7\u671F\u4E14\u9700\u8981\u9690\u85CF\uFF0C\u5219\u8FD4\u56DEnull\n if (isExpired && hideWhenExpired) {\n return null\n }\n\n return (\n <div\n ref={ref}\n className={cn(countdownVariants({ variant }), className)}\n role=\"timer\"\n aria-live=\"polite\"\n aria-label=\"countdown timer\"\n {...props}\n >\n {/* \u5929 */}\n <div className={cn(timeBlockVariants({ variant }), 'time-days-box')}>\n <div className={timeNumberVariants()}>{pad(days, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{finalTimeLabels.day}</div>\n </div>\n\n <div className={separatorVariants({ variant })}>{separator}</div>\n\n {/* \u65F6 */}\n <div className={cn(timeBlockVariants({ variant }), 'time-hours-box')}>\n <div className={timeNumberVariants()}>{pad(hours, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{finalTimeLabels.hour}</div>\n </div>\n\n <div className={separatorVariants({ variant })}>{separator}</div>\n\n {/* \u5206 */}\n <div className={cn(timeBlockVariants({ variant }), 'time-minutes-box')}>\n <div className={timeNumberVariants()}>{pad(minutes, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{finalTimeLabels.minute}</div>\n </div>\n\n <div className={separatorVariants({ variant })}>{separator}</div>\n\n {/* \u79D2 */}\n <div className={cn(timeBlockVariants({ variant }), 'time-seconds-box')}>\n <div className={timeNumberVariants()}>{pad(seconds, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{finalTimeLabels.second}</div>\n </div>\n </div>\n )\n }\n)\n\nCountdown.displayName = 'Countdown'\n\nexport default Countdown\n"],
|
|
5
|
+
"mappings": "aAqOQ,OACE,OAAAA,EADF,QAAAC,MAAA,oBAnOR,OAAOC,GAAS,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,EAAU,WAAAC,MAAe,QAC5D,OAAS,OAAAC,MAA8B,2BACvC,OAAS,MAAAC,MAAU,sBAGnB,MAAMC,EAAoBF,EAExB,+CACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,QACT,SAAU,OACZ,CACF,EACA,gBAAiB,CACf,QAAS,S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8C,SAAAiC,EAAgB,OAAO,GACtF,GACF,CAEJ,CACF,EAEAb,EAAU,YAAc,YAExB,IAAOkC,EAAQlC",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "useEffect", "useRef", "useState", "useMemo", "cva", "cn", "countdownVariants", "timeBlockVariants", "timeNumberVariants", "separatorVariants", "pad", "n", "len", "getDefaultTimeLabels", "safeStringToObject", "str", "jsonStr", "Countdown", "className", "endDate", "endDate_tz", "locale", "timeLabels", "dateFormat", "onExpire", "separator", "hideWhenExpired", "variant", "props", "ref", "finalTimeLabels", "targetMsRef", "remainingMs", "setRemainingMs", "t", "isExpired", "setIsExpired", "newRemaining", "newIsExpired", "expiredCalled", "tick", "now", "remaining", "intervalId", "totalSeconds", "seconds", "totalMinutes", "minutes", "totalHours", "hours", "days", "Countdown_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as f,jsx as e,jsxs as c}from"react/jsx-runtime";import*as h from"react";import{VisuallyHidden as x}from"@radix-ui/react-visually-hidden";import{cva as l}from"class-variance-authority";import k from"../icons/spinner.js";import{cn as w}from"../helpers/index.js";const B={sm:{width:"16",height:"16"},base:{width:"18",height:"18"},lg:{width:"20",height:"20"}},V=({size:s="base",...r})=>{const{width:a,height:t}=B[s];return e("svg",{width:a,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:e("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},L=l("rounded-btn inline-flex cursor-pointer items-center justify-center text-sm font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{primary:"bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active hover:text-btn-primary-active-foreground hover:bg-gradient-brand border-none ",secondary:"bg-btn-secondary outline-btn-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary-active-foreground border-solid outline outline-[1.6px] outline-offset-[-1.6px]",link:"text-info-primary hover:text-btn-primary-active border-none",ghost:"text-info-primary hover:bg-btn-primary hover:text-btn-primary-foreground"},size:{sm:"px-3 py-2 text-[12px] leading-tight",base:"px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",lg:"lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",icon:"size-10 rounded-full leading-tight"},hoverEffect:{none:"",slide:""},state:{default:"",disabled:"",loading:""}},compoundVariants:[{variant:"primary",hoverEffect:"slide",class:'before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"secondary",hoverEffect:"slide",class:'before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"primary",state:"loading",class:"bg-btn-primary-active disabled:border-btn-primary-disabled-border"},{variant:"secondary",state:"loading",class:"bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-primary-disabled"},{variant:"primary",state:"disabled",class:"disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground disabled:border-btn-primary-disabled"},{variant:"secondary",state:"disabled",class:"disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border"},{variant:"link",state:"disabled",class:"disabled:text-info-quaternary"}],defaultVariants:{variant:"primary",size:"lg",hoverEffect:"none",state:"default"}}),N=l("",{variants:{variant:{primary:"stroke-btn-primary-foreground",secondary:"stroke-btn-secondary-foreground",link:"stroke-primary",ghost:"stroke-primary"}},defaultVariants:{variant:"primary"}}),p=h.forwardRef(({asChild:s=!1,as:r="button",href:a,size:t="lg",children:o,variant:n,hoverEffect:u="none",className:g,disabled:d=!1,loading:i=!1,spinner:b,iconClassName:y,...m},v)=>e(r,{disabled:d||i,className:w(L({variant:n,size:t,hoverEffect:u,state:i?"loading":d?"disabled":"default"}),g),ref:v,...r==="a"?{href:a}:{},...m,children:i?c(f,{children:[e("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0,children:o}),e("span",{className:"absolute",children:b||e(k,{className:N({variant:n})})}),e(x,{children:o})]}):c(f,{children:[o,n==="link"&&t&&t!=="icon"&&e(V,{className:y,size:t})]})}));p.displayName="Button";var I=p;export{I as default,B as sizeMap};
|
|
1
|
+
"use client";import{Fragment as f,jsx as e,jsxs as c}from"react/jsx-runtime";import*as h from"react";import{VisuallyHidden as x}from"@radix-ui/react-visually-hidden";import{cva as l}from"class-variance-authority";import k from"../icons/spinner.js";import{cn as w}from"../helpers/index.js";const B={sm:{width:"16",height:"16"},base:{width:"18",height:"18"},lg:{width:"20",height:"20"}},V=({size:s="base",...r})=>{const{width:a,height:t}=B[s];return e("svg",{width:a,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:e("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},L=l("rounded-btn inline-flex cursor-pointer items-center justify-center text-sm font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{primary:"bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active hover:text-btn-primary-active-foreground hover:bg-gradient-brand border-none ",secondary:"bg-btn-secondary outline-btn-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary-active-foreground border-solid outline outline-[1.6px] outline-offset-[-1.6px]",link:"text-info-primary hover:text-btn-primary-active border-none",ghost:"text-info-primary hover:bg-btn-primary hover:text-btn-primary-foreground"},size:{sm:"px-3 py-2 text-[12px] leading-tight",base:"px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",lg:"lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",icon:"size-10 rounded-full leading-tight"},hoverEffect:{none:"",slide:""},state:{default:"",disabled:"",loading:""}},compoundVariants:[{variant:"primary",hoverEffect:"slide",class:'before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"secondary",hoverEffect:"slide",class:'before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[""] hover:before:translate-x-0'},{variant:"primary",state:"loading",class:"bg-btn-primary-active disabled:border-btn-primary-disabled-border"},{variant:"secondary",state:"loading",class:"bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-primary-disabled"},{variant:"primary",state:"disabled",class:"disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground disabled:border-btn-primary-disabled"},{variant:"secondary",state:"disabled",class:"disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border disabled:outline-btn-secondary-disabled-border"},{variant:"link",state:"disabled",class:"disabled:text-info-quaternary"}],defaultVariants:{variant:"primary",size:"lg",hoverEffect:"none",state:"default"}}),N=l("",{variants:{variant:{primary:"stroke-btn-primary-foreground",secondary:"stroke-btn-secondary-foreground",link:"stroke-primary",ghost:"stroke-primary"}},defaultVariants:{variant:"primary"}}),p=h.forwardRef(({asChild:s=!1,as:r="button",href:a,size:t="lg",children:o,variant:n,hoverEffect:u="none",className:g,disabled:d=!1,loading:i=!1,spinner:b,iconClassName:y,...m},v)=>e(r,{disabled:d||i,className:w(L({variant:n,size:t,hoverEffect:u,state:i?"loading":d?"disabled":"default"}),g),ref:v,...r==="a"?{href:a}:{},...m,children:i?c(f,{children:[e("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0,children:o}),e("span",{className:"absolute",children:b||e(k,{className:N({variant:n})})}),e(x,{children:o})]}):c(f,{children:[o,n==="link"&&t&&t!=="icon"&&e(V,{className:y,size:t})]})}));p.displayName="Button";var I=p;export{I as default,B as sizeMap};
|
|
2
2
|
//# sourceMappingURL=button.js.map
|