@anker-in/headless-ui 1.1.75 → 1.1.76
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/AnchorNavigation/index.d.ts +20 -0
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/types.d.ts +7 -0
- package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +20 -0
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/FooterNavigation/types.d.ts +7 -0
- package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
- package/package.json +1 -1
|
@@ -12,6 +12,17 @@ declare const anchorNavigationVariants: (props?: ({
|
|
|
12
12
|
alignment?: "end" | "start" | "center" | null | undefined;
|
|
13
13
|
size?: "small" | "large" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 按钮颜色配置,允许按 theme 分别覆盖默认色、激活文字色、激活指示器色
|
|
17
|
+
*/
|
|
18
|
+
export interface AnchorButtonStyle {
|
|
19
|
+
/** 默认(未激活)文字色,Tailwind class,如 'text-info-secondary' */
|
|
20
|
+
defaultColor?: string;
|
|
21
|
+
/** 激活文字色,Tailwind class,如 'text-info-primary' */
|
|
22
|
+
activeColor?: string;
|
|
23
|
+
/** 激活指示器(下划线)背景色,Tailwind class,如 'after:bg-brand-0' */
|
|
24
|
+
activeIndicatorColor?: string;
|
|
25
|
+
}
|
|
15
26
|
/**
|
|
16
27
|
* 锚点项接口
|
|
17
28
|
*/
|
|
@@ -39,6 +50,15 @@ export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
39
50
|
classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>;
|
|
40
51
|
/** 自定义点击事件,传入时会替代默认的滚动行为 */
|
|
41
52
|
onItemClick?: (item: AnchorSectionItem, index: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 按钮颜色配置,覆盖 light/dark 主题下的默认颜色。
|
|
55
|
+
* 未传时按主题使用内置默认值。
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // 自定义颜色
|
|
59
|
+
* buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}
|
|
60
|
+
*/
|
|
61
|
+
buttonStyle?: AnchorButtonStyle;
|
|
42
62
|
}
|
|
43
63
|
/**
|
|
44
64
|
* AnchorNavigation - 锚点导航
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var k=Object.create;var u=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var P=(t,e)=>{for(var n in e)u(t,n,{get:e[n],enumerable:!0})},R=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of V(e))!M.call(t,l)&&l!==n&&u(t,l,{get:()=>e[l],enumerable:!(c=B(e,l))||c.enumerable});return t};var x=(t,e,n)=>(n=t!=null?k(z(t)):{},R(e||!t||!t.__esModule?u(n,"default",{value:t,enumerable:!0}):n,t)),q=t=>R(u({},"__esModule",{value:!0}),t);var K={};P(K,{default:()=>G});module.exports=q(K);var g=require("react/jsx-runtime"),i=x(require("react")),m=require("../../helpers/utils.js"),v=require("class-variance-authority"),S=x(require("./useAnchorPosition.js")),w=require("../../components/container.js");const F=(0,v.cva)("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),j=(0,v.cva)("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),U=(0,v.cva)("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),W={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},_={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},T=i.forwardRef(({classNames:t={},data:e,onItemClick:n,buttonStyle:c,className:l,...D},E)=>{const{alignment:L="start",theme:b="light",size:y="small"}=e,f=(0,S.default)(e.sectionIds?.map(o=>o.targetId)||[]),d=i.useRef(null),h=i.useRef(null),N=i.useRef([]);i.useImperativeHandle(E,()=>d.current);const p=b==="dark"?_:W,I={defaultColor:c?.defaultColor??p.defaultColor,activeColor:c?.activeColor??p.activeColor,activeIndicatorColor:c?.activeIndicatorColor??p.activeIndicatorColor},C=i.useCallback(o=>{const r=N.current[o];if(r&&h.current){const s=h.current,a=r,A=a.offsetLeft-s.offsetWidth/2+a.offsetWidth/2;typeof s.scrollTo=="function"&&s.scrollTo({left:A,behavior:"smooth"})}},[]);return i.useEffect(()=>{if(!f)return;const o=e.sectionIds?.findIndex(r=>r.targetId===f);o!==void 0&&o!==-1&&C(o)},[f,e.sectionIds,C]),(0,g.jsx)(w.Container,{ref:d,className:(0,m.cn)(U({theme:b}),t?.root),...D,children:(0,g.jsx)("div",{ref:h,className:(0,m.cn)(F({alignment:L,size:y}),"relative",t?.content),children:e.sectionIds?.map((o,r)=>{const s=f===o.targetId;return(0,g.jsx)("button",{ref:a=>{a&&(N.current[r]=a)},"aria-current":s?!0:void 0,onClick:()=>{if(C(r),n){n(o,r);return}const a=document.getElementById(o.targetId);if(a&&d.current){const A=d.current.offsetHeight,H=a.getBoundingClientRect().top+window.scrollY-A;window.scrollTo({top:H,behavior:"smooth"})}},className:(0,m.cn)(j({size:y}),s?[I.activeColor,I.activeIndicatorColor,"after:w-full after:opacity-100"]:I.defaultColor,t?.item),children:o.label},o.targetId)})})})});T.displayName="AnchorNavigation";var G=T;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "import_container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "AnchorNavigation", "classNames", "data", "onItemClick", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "useAnchorPosition", "item", "rootRef", "containerRef", "sectionRefs", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
|
|
5
|
+
"mappings": "ukBA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G,EAAgB,SAAS,eAAehB,EAAK,QAAQ,EAC3D,GAAIgB,GAAiBf,EAAQ,QAAS,CACpC,MAAMgB,EAAYhB,EAAQ,QAAQ,aAC5BiB,EAAiBF,EAAc,sBAAsB,EAAE,IAAM,OAAO,QAAUC,EAEpF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,aAAW,MACTnC,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BiB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBjB,GAAY,IACd,EAEC,SAAAY,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAb,EAAiB,YAAc,mBAC/B,IAAOb,EAAQa",
|
|
6
|
+
"names": ["AnchorNavigation_exports", "__export", "AnchorNavigation_default", "__toCommonJS", "import_jsx_runtime", "React", "import_utils", "import_class_variance_authority", "import_useAnchorPosition", "import_container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "useAnchorPosition", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var L=Object.create;var k=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var E=(t,s)=>{for(var l in s)k(t,l,{get:s[l],enumerable:!0})},N=(t,s,l,d)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of D(s))!z.call(t,a)&&a!==l&&k(t,a,{get:()=>s[a],enumerable:!(d=A(s,a))||d.enumerable});return t};var S=(t,s,l)=>(l=t!=null?L(F(t)):{},N(s||!t||!t.__esModule?k(l,"default",{value:t,enumerable:!0}):l,t)),$=t=>N(k({},"__esModule",{value:!0}),t);var q={};E(q,{default:()=>Q});module.exports=$(q);var e=require("react/jsx-runtime"),f=require("react"),i=require("../../components/index.js"),C=S(require("../Subscribe/index.js")),h=require("./types.js"),x=require("./icons/index.js"),v=require("react-responsive"),n=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),M=require("../../shared/Styles.js");const T=({data:{footer:t}={},currentCountry:s,event:l,subscribeLoading:d,classNames:a,className:r,...g})=>{const[p,c]=(0,f.useState)(!1),u=(0,v.useMediaQuery)({query:"(max-width: 1439px)"});(0,f.useEffect)(()=>{c(u)},[u]);const m=(0,f.useMemo)(()=>t?.blocks?.find(o=>o?.blockType===h.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...g,className:(0,n.cn)(a?.root,r),children:(0,e.jsxs)(i.Container,{className:(0,n.cn)(a?.child),childClassName:(0,n.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(i.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(o=>{if(o?.blockType===h.FooterNavigationBlockType.Signup)return(0,e.jsx)(P,{subscribeLoading:d,data:o,onSubmit:l?.signup},o.id);if(o?.blockType===h.FooterNavigationBlockType.Brand)return(0,e.jsx)(j,{data:o,isMobile:p,event:l,currentCountry:s},o?.id);if(o?.blockType===h.FooterNavigationBlockType.Main)return(0,e.jsx)(O,{data:{...o,country:m},event:l,isMobile:p,currentCountry:s},o.id)})]})})},P=({data:t,onSubmit:s,subscribeLoading:l})=>{const{locale:d="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(C.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:s,loading:l}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(i.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(a=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(i.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},a?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(i.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(a=>(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(a?.link,d)}?ref=footer`,asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(i.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},a?.id))})]})]})]})},O=({data:t,event:s,isMobile:l,currentCountry:d})=>{const{locale:a="us"}=(0,b.useAiuiContext)(),[r,g]=(0,f.useState)(!1),{services:p,mainNav:c,country:u}=t,m="contact-section";return(0,e.jsxs)("nav",{className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,n.cn)({"desktop:gap-16 flex":p?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,n.cn)("w-full",{"desktop:flex-[1260]":p?.download?.title}),children:[(0,e.jsx)(i.Text,{html:p?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,n.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":p?.download?.title}),children:p?.storeBenefits?.reasons?.map(o=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(o?.link,a)}?ref=footer`,asChild:!o?.link,className:"no-underline",children:(0,e.jsx)(i.Text,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},o?.id))})]}),(0,e.jsx)(w,{className:(0,n.cn)({"desktop:flex-[404] hidden desktop:block":p?.download?.title}),title:p?.download?.title,apps:p?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(y,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(y,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(y,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(i.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:m}),l&&(0,e.jsx)("button",{onClick:()=>g(!r),"aria-expanded":r,"aria-controls":m,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&l||!l)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":m,children:c?.contact?.contacts?.map(o=>(0,e.jsxs)(i.Link,{href:o?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(i.Text,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},o?.id))}),(0,e.jsx)(B,{country:d||u,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:l,onChangeCountry:s?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(w,{title:p?.download?.title,apps:p?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(o=>(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(o?.link,a)}?ref=footer`,className:"group",role:"listitem","aria-label":o?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},o?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(o=>(0,e.jsx)(i.Link,{href:(0,n.getLocalizedPath)(o?.link,a),asChild:!o?.link,role:"listitem","aria-label":o?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},o?.id))})]})]})]})},j=({data:t,isMobile:s,event:l,currentCountry:d})=>{const{locale:a="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(t?.brand?.link,a)}?ref=footer`,asChild:!t?.brand?.link,children:(0,e.jsx)(i.Text,{html:t?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),(0,e.jsx)("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),(0,e.jsx)("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:t?.brand?.brands?.map(r=>(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(r?.link,a)}?ref=footer`,children:(0,e.jsx)(i.Text,{html:r?.icon,className:"text-[#B6B6BA] hover:text-white"})},r?.id))})]}),(0,e.jsx)(B,{country:d||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:s,onChangeCountry:l?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(i.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(r?.link,a)}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:l?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},y=({title:t,lists:s,className:l})=>{const{locale:d="us"}=(0,b.useAiuiContext)(),[a,r]=(0,f.useState)(!1),[g,p]=(0,f.useState)(!1),c=(0,v.useMediaQuery)({query:"(max-width: 1439px)"});(0,f.useEffect)(()=>{p(c)},[c]);const u=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,n.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(i.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:u}),g&&(0,e.jsx)("button",{onClick:()=>r(!a),"aria-expanded":a,"aria-controls":u,"aria-label":a?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:a?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(a&&g||!g)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":u,children:s?.map(m=>(0,e.jsx)(i.Link,{href:`${(0,n.getLocalizedPath)(m?.link,d)}?ref=footer`,className:"no-underline",children:(0,e.jsx)(i.Text,{html:m?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},m?.id))})]})},w=({title:t,apps:s,className:l})=>{const{locale:d="us"}=(0,b.useAiuiContext)();return s?.length?(0,e.jsxs)("div",{className:l,children:[(0,e.jsx)(i.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:s?.map(a=>(0,e.jsxs)(i.Link,{href:(0,n.getLocalizedPath)(a?.link,d),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":a?.icon?.alt||a?.label||"Download app",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),a?.label&&(0,e.jsx)(i.Text,{html:a?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},a?.id))})]}):null},B=({country:t,isMobile:s,className:l,onChangeCountry:d})=>(0,e.jsx)("div",{className:(0,n.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:(0,e.jsxs)("button",{onClick:()=>d?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(i.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),s&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var Q=(0,M.withLayout)(T);
|
|
1
|
+
"use strict";var A=Object.create;var v=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var E=(t,s)=>{for(var l in s)v(t,l,{get:s[l],enumerable:!0})},w=(t,s,l,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of F(s))!z.call(t,i)&&i!==l&&v(t,i,{get:()=>s[i],enumerable:!(p=D(s,i))||p.enumerable});return t};var $=(t,s,l)=>(l=t!=null?A(S(t)):{},w(s||!t||!t.__esModule?v(l,"default",{value:t,enumerable:!0}):l,t)),T=t=>w(v({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=T(R);var e=require("react/jsx-runtime"),x=require("react"),o=require("../../components/index.js"),M=$(require("../Subscribe/index.js")),k=require("./types.js"),m=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),g=require("../AiuiProvider/index.js"),L=require("../../shared/Styles.js");const P=({data:{footer:t}={},currentCountry:s,event:l,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...b})=>{const[f,c]=(0,x.useState)(!1),u=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,x.useEffect)(()=>{c(u)},[u]);const h=(0,x.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...b,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:l?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:l,currentCountry:s,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:l,isMobile:f,currentCountry:s,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:s,subscribeLoading:l,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,g.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:s,loading:l}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(n?.link,i)}?ref=footer`,asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:s,isMobile:l,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,g.useAiuiContext)(),[r,b]=(0,x.useState)(!1),{services:f,mainNav:c,country:u}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(a?.link,n)}?ref=footer`,asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(y,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(y,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(y,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),l&&(0,e.jsx)("button",{onClick:()=>b(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(m.SubtractIcon,{width:20,height:20}):(0,e.jsx)(m.AddIcon,{width:20,height:20})})]}),(r&&l||!l)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||u,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:l,onChangeCountry:s?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(a?.link,n)}?ref=footer`,className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:s,event:l,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,g.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(t?.brand?.link,n)}?ref=footer`,asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),(0,e.jsx)("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),(0,e.jsx)("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:t?.brand?.brands?.map(r=>(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(r?.link,n)}?ref=footer`,children:(0,e.jsx)(o.Text,{html:r?.icon,className:"text-[#B6B6BA] hover:text-white"})},r?.id))})]}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:s,onChangeCountry:l?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(r?.link,n)}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:l?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},y=({title:t,lists:s,className:l})=>{const{locale:p="us"}=(0,g.useAiuiContext)(),[i,n]=(0,x.useState)(!1),[r,b]=(0,x.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,x.useEffect)(()=>{b(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(m.SubtractIcon,{width:20,height:20}):(0,e.jsx)(m.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:s?.map(u=>(0,e.jsx)(o.Link,{href:`${(0,d.getLocalizedPath)(u?.link,p)}?ref=footer`,className:"no-underline",children:(0,e.jsx)(o.Text,{html:u?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},u?.id))})]})},B=({title:t,apps:s,className:l})=>{const{locale:p="us"}=(0,g.useAiuiContext)();return s?.length?(0,e.jsxs)("div",{className:l,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:s?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:s,className:l,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(m.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),s&&(0,e.jsx)(m.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,L.withLayout)(P);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/FooterNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\">\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${getLocalizedPath(benefitItem?.link, locale)}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={`${getLocalizedPath(reasonItem?.link, locale)}?ref=footer`}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={`${getLocalizedPath(socialItem?.link, locale)}?ref=footer`}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={`${getLocalizedPath(data?.brand?.link, locale)}?ref=footer`} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${getLocalizedPath(brandItem?.link, locale)}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${getLocalizedPath(policyItem?.link, locale)}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={`${getLocalizedPath(item?.link, locale)}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["FooterNavigation_exports", "__export", "FooterNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Subscribe", "import_types", "import_icons", "import_react_responsive", "import_utils", "import_AiuiProvider", "import_Styles", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "className", "rest", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "locale", "Subscribe", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "contactSectionId", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "sectionId", "item", "apps", "appItem", "onChangeCountry"]
|
|
4
|
+
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n moduleIds,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n id={moduleIds?.marketingConversion}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n id={moduleIds?.footerBrand}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n id={moduleIds?.mainServices}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n id = 'footer-marketing-conversion',\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div\n id={id}\n className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\"\n >\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${getLocalizedPath(benefitItem?.link, locale)}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n id = 'footer-main-services',\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav id={id} className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={`${getLocalizedPath(reasonItem?.link, locale)}?ref=footer`}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={`${getLocalizedPath(socialItem?.link, locale)}?ref=footer`}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n id = 'footer-brand',\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div id={id} className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={`${getLocalizedPath(data?.brand?.link, locale)}?ref=footer`} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${getLocalizedPath(brandItem?.link, locale)}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${getLocalizedPath(policyItem?.link, locale)}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={`${getLocalizedPath(item?.link, locale)}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmCM,IAAAI,EAAA,6BAnCNC,EAA6C,iBAC7CC,EAAsC,qCACtCC,EAAsB,oCAEtBC,EAA0C,sBAC1CC,EAAm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EACV,cAAY,OACd,KACA,OAAC,QACC,GAAG,OACH,KAAMA,GAAS,aAAeA,GAAS,QACvC,UAAU,oIACZ,GACF,EACCH,MAAY,OAAC,kBAAe,MAAO,GAAI,OAAQ,GAAI,cAAY,OAAO,GACzE,EACF,EAIJ,IAAOrB,KAAQ,cAAWY,CAAgB",
|
|
6
|
+
"names": ["FooterNavigation_exports", "__export", "FooterNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Subscribe", "import_types", "import_icons", "import_react_responsive", "import_utils", "import_AiuiProvider", "import_Styles", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "className", "moduleIds", "rest", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "id", "locale", "Subscribe", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "contactSectionId", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "sectionId", "item", "apps", "appItem", "onChangeCountry"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
export type FooterNavigationSemanticName = 'root' | 'child';
|
|
3
|
+
export interface FooterNavigationModuleIds {
|
|
4
|
+
marketingConversion?: string;
|
|
5
|
+
mainServices?: string;
|
|
6
|
+
footerBrand?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
9
|
data: any;
|
|
5
10
|
currentCountry?: any;
|
|
@@ -11,6 +16,8 @@ export interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement>
|
|
|
11
16
|
cookiesSet?: () => void;
|
|
12
17
|
};
|
|
13
18
|
classNames?: Partial<Record<FooterNavigationSemanticName, string>>;
|
|
19
|
+
/** 各模块的 id,用于 URL #锚点定位 */
|
|
20
|
+
moduleIds?: FooterNavigationModuleIds;
|
|
14
21
|
}
|
|
15
22
|
export declare enum FooterNavigationBlockType {
|
|
16
23
|
Signup = "ipc-footer-signup",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var m=(t,e)=>{for(var i in e)n(t,i,{get:e[i],enumerable:!0})},p=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!c.call(t,r)&&r!==i&&n(t,r,{get:()=>e[r],enumerable:!(o=s(e,r))||o.enumerable});return t};var u=t=>p(n({},"__esModule",{value:!0}),t);var g={};m(g,{FooterNavigationBlockType:()=>a});module.exports=u(g);var a=(o=>(o.Signup="ipc-footer-signup",o.Main="ipc-footer-main",o.Brand="ipc-footer-brand",o))(a||{});
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/FooterNavigation/types.ts"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react'\n\nexport type FooterNavigationSemanticName = 'root' | 'child'\n\nexport interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n cookiesSet?: () => void\n }\n classNames?: Partial<Record<FooterNavigationSemanticName, string>>\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,
|
|
4
|
+
"sourcesContent": ["import type React from 'react'\n\nexport type FooterNavigationSemanticName = 'root' | 'child'\n\nexport interface FooterNavigationModuleIds {\n marketingConversion?: string\n mainServices?: string\n footerBrand?: string\n}\n\nexport interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n cookiesSet?: () => void\n }\n classNames?: Partial<Record<FooterNavigationSemanticName, string>>\n /** \u5404\u6A21\u5757\u7684 id\uFF0C\u7528\u4E8E URL #\u951A\u70B9\u5B9A\u4F4D */\n moduleIds?: FooterNavigationModuleIds\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAyBO,IAAKE,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
|
|
6
6
|
"names": ["types_exports", "__export", "FooterNavigationBlockType", "__toCommonJS"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var z=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var j=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},g=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!R.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=E(r,a))||u.enumerable});return o};var B=(o,r,s)=>(s=o!=null?z(P(o)):{},g(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),M=o=>g(f({},"__esModule",{value:!0}),o);var W={};j(W,{default:()=>V});module.exports=M(W);var e=require("react/jsx-runtime"),i=B(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),S=require("../AiuiProvider/index.js"),p=require("swiper/react"),h=require("swiper/modules"),q=require("swiper/css"),F=require("swiper/css/navigation"),G=require("swiper/css/pagination"),J=require("swiper/css/effect-coverflow");const H="carousel",U="three_d_carousel",I=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,w=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),[T,C]=i.default.useState(180),{locale:b="us"}=(0,S.useAiuiContext)();return(0,y.useExposure)(v,{componentType:H,componentName:U,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=x.current;if(!t)return;const d=()=>{const L=t.offsetWidth,_=Math.round(L*.
|
|
1
|
+
"use strict";"use client";var z=Object.create;var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var j=(o,r)=>{for(var s in r)f(o,s,{get:r[s],enumerable:!0})},g=(o,r,s,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of D(r))!R.call(o,a)&&a!==s&&f(o,a,{get:()=>r[a],enumerable:!(u=E(r,a))||u.enumerable});return o};var B=(o,r,s)=>(s=o!=null?z(P(o)):{},g(r||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),M=o=>g(f({},"__esModule",{value:!0}),o);var W={};j(W,{default:()=>V});module.exports=M(W);var e=require("react/jsx-runtime"),i=B(require("react")),l=require("../../components/index.js"),c=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),S=require("../AiuiProvider/index.js"),p=require("swiper/react"),h=require("swiper/modules"),q=require("swiper/css"),F=require("swiper/css/navigation"),G=require("swiper/css/pagination"),J=require("swiper/css/effect-coverflow");const H="carousel",U="three_d_carousel",I=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),O=()=>(0,e.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[(0,e.jsx)("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),(0,e.jsx)("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),k=i.default.forwardRef(({data:o,className:r},s)=>{const{title:u,items:a=[]}=o,w=a.length<4?[...a,...a]:a,n=(0,i.useRef)(null),v=(0,i.useRef)(null),x=(0,i.useRef)(null),[T,C]=i.default.useState(180),{locale:b="us"}=(0,S.useAiuiContext)();return(0,y.useExposure)(v,{componentType:H,componentName:U,componentTitle:u}),(0,i.useImperativeHandle)(s,()=>v.current),i.default.useEffect(()=>{const t=x.current;if(!t)return;const d=()=>{const L=t.offsetWidth,_=Math.round(L*.125);C(_),n.current?.params?.coverflowEffect&&(n.current.params.coverflowEffect.stretch=_,n.current.update())};d();const m=new ResizeObserver(d);return m.observe(t),()=>m.disconnect()},[]),(0,e.jsxs)("section",{ref:v,"data-ui-component-id":"ThreeDCarousel",className:(0,c.cn)("three-d-carousel laptop:overflow-hidden w-full overflow-visible",r),children:[(0,e.jsx)(l.Heading,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),(0,e.jsxs)("div",{ref:x,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[(0,e.jsx)(p.Swiper,{onSwiper:t=>n.current=t,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[h.EffectCoverflow,h.Navigation],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:T,depth:300,modifier:1,slideShadows:!0},children:w.map((t,d)=>(0,e.jsx)(p.SwiperSlide,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:m})=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Picture,{source:t.imageUrl?.url||"",alt:t.imageUrl?.alt||t.title,className:(0,c.cn)("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:m?"":"brightness(50%) contrast(120%)"}}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark","opacity-0":!m}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:t.buttonText})})]})]})},d))}),(0,e.jsxs)("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>n.current?.slidePrev(),"aria-label":"Previous slide",children:(0,e.jsx)(I,{})}),(0,e.jsx)("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>n.current?.slideNext(),"aria-label":"Next slide",children:(0,e.jsx)(O,{})})]})]}),(0,e.jsx)("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:(0,e.jsx)(p.Swiper,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:w.map((t,d)=>(0,e.jsxs)(p.SwiperSlide,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[(0,e.jsx)(l.Picture,{source:t.mobImageUrl?.url||t.imageUrl?.url||"",alt:t.mobImageUrl?.alt||t.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),(0,e.jsxs)("div",{className:(0,c.cn)("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":t.theme==="dark"}),children:[(0,e.jsx)(l.Heading,{as:"h2",size:2,html:t.title}),(0,e.jsx)(l.Text,{as:"p",size:4,html:t.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),t.buttonText&&(0,e.jsx)("a",{href:(0,c.getLocalizedPath)(t.buttonLink||"",b),className:"three-d-carousel__image-mobile-link ",children:(0,e.jsx)(l.Button,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:t.buttonText})})]})]},d))})})]})});k.displayName="ThreeDCarousel";var V=(0,N.withLayout)(k,{style:"overflow: hidden;"});
|
|
2
2
|
//# sourceMappingURL=ThreeDCarousel.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/ThreeDCarousel/ThreeDCarousel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u7EA6\u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 18%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.18)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full px-4\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBE,IAAAI,EAAA,6BApBFC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAqC,kCACrCC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA+B,oCAE/BL,EAAoC,wBACpCM,EAA4C,0BAG5CC,EAAO,sBACPC,EAAO,iCACPC,EAAO,iCACPC,EAAO,uCAEP,MAAMC,EAAgB,WAChBC,EAAgB,mBAEhBC,EAAc,OAClB,QAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAU,8FAEV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,KACrE,OAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,UAAU,cAAc,QAAQ,eAAe,QAAQ,GACjH,EAGIC,EAAe,OACnB,QAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAU,8FAEV,oBAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,KACrE,OAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,UAAU,cAAc,QAAQ,eAAe,QAAQ,GACjH,EAGIC,EAAiB,EAAAC,QAAM,WAAgD,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACzG,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAQ,CAAC,CAAE,EAAIJ,EACxBK,EAAaD,EAAM,OAAS,EAAI,CAAC,GAAGA,EAAO,GAAGA,CAAK,EAAIA,EACvDE,KAAY,UAA0B,IAAI,EAC1CC,KAAS,UAAuB,IAAI,EACpCC,KAAe,UAAuB,IAAI,EAC1C,CAACC,EAAcC,CAAe,EAAI,EAAAX,QAAM,SAAS,GAAG,EACpD,CAAE,OAAAY,EAAS,IAAK,KAAI,kBAAe,EAEzC,wBAAYJ,EAAQ,CAClB,cAAAb,EACA,cAAAC,EACA,eAAgBQ,CAClB,CAAC,KAED,uBAAoBD,EAAK,IAAMK,EAAO,OAAyB,EAG/D,EAAAR,QAAM,UAAU,IAAM,CACpB,MAAMa,EAAYJ,EAAa,QAC/B,GAAI,CAACI,EAAW,OAEhB,MAAMC,EAAgB,IAAM,CAC1B,MAAMC,EAAiBF,EAAU,YAE3BG,EAAa,KAAK,MAAMD,EAAiB,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqBE,IAAAI,EAAA,6BApBFC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAqC,kCACrCC,EAA2B,kCAC3BC,EAA4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,IAlCKC,CAmCP,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDrB,EAAe,YAAc,iBAE7B,IAAOlB,KAAQ,cAAWkB,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
|
|
6
6
|
"names": ["ThreeDCarousel_exports", "__export", "ThreeDCarousel_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_AiuiProvider", "import_modules", "import_css", "import_navigation", "import_pagination", "import_effect_coverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "React", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive"]
|
|
7
7
|
}
|
|
@@ -12,6 +12,17 @@ declare const anchorNavigationVariants: (props?: ({
|
|
|
12
12
|
alignment?: "end" | "start" | "center" | null | undefined;
|
|
13
13
|
size?: "small" | "large" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
|
+
/**
|
|
16
|
+
* 按钮颜色配置,允许按 theme 分别覆盖默认色、激活文字色、激活指示器色
|
|
17
|
+
*/
|
|
18
|
+
export interface AnchorButtonStyle {
|
|
19
|
+
/** 默认(未激活)文字色,Tailwind class,如 'text-info-secondary' */
|
|
20
|
+
defaultColor?: string;
|
|
21
|
+
/** 激活文字色,Tailwind class,如 'text-info-primary' */
|
|
22
|
+
activeColor?: string;
|
|
23
|
+
/** 激活指示器(下划线)背景色,Tailwind class,如 'after:bg-brand-0' */
|
|
24
|
+
activeIndicatorColor?: string;
|
|
25
|
+
}
|
|
15
26
|
/**
|
|
16
27
|
* 锚点项接口
|
|
17
28
|
*/
|
|
@@ -39,6 +50,15 @@ export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivEleme
|
|
|
39
50
|
classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>;
|
|
40
51
|
/** 自定义点击事件,传入时会替代默认的滚动行为 */
|
|
41
52
|
onItemClick?: (item: AnchorSectionItem, index: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* 按钮颜色配置,覆盖 light/dark 主题下的默认颜色。
|
|
55
|
+
* 未传时按主题使用内置默认值。
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // 自定义颜色
|
|
59
|
+
* buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}
|
|
60
|
+
*/
|
|
61
|
+
buttonStyle?: AnchorButtonStyle;
|
|
42
62
|
}
|
|
43
63
|
/**
|
|
44
64
|
* AnchorNavigation - 锚点导航
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import*as n from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import S from"./useAnchorPosition.js";import{Container as w}from"../../components/container.js";const D=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),E=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),L=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),H={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},k={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},y=n.forwardRef(({classNames:l={},data:a,onItemClick:I,buttonStyle:s,className:B,...N},R)=>{const{alignment:x="start",theme:C="light",size:A="small"}=a,i=S(a.sectionIds?.map(t=>t.targetId)||[]),c=n.useRef(null),f=n.useRef(null),b=n.useRef([]);n.useImperativeHandle(R,()=>c.current);const d=C==="dark"?k:H,u={defaultColor:s?.defaultColor??d.defaultColor,activeColor:s?.activeColor??d.activeColor,activeIndicatorColor:s?.activeIndicatorColor??d.activeIndicatorColor},m=n.useCallback(t=>{const e=b.current[t];if(e&&f.current){const r=f.current,o=e,v=o.offsetLeft-r.offsetWidth/2+o.offsetWidth/2;typeof r.scrollTo=="function"&&r.scrollTo({left:v,behavior:"smooth"})}},[]);return n.useEffect(()=>{if(!i)return;const t=a.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,a.sectionIds,m]),p(w,{ref:c,className:g(L({theme:C}),l?.root),...N,children:p("div",{ref:f,className:g(D({alignment:x,size:A}),"relative",l?.content),children:a.sectionIds?.map((t,e)=>{const r=i===t.targetId;return p("button",{ref:o=>{o&&(b.current[e]=o)},"aria-current":r?!0:void 0,onClick:()=>{if(m(e),I){I(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,T=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:T,behavior:"smooth"})}},className:g(E({size:A}),r?[u.activeColor,u.activeIndicatorColor,"after:w-full after:opacity-100"]:u.defaultColor,l?.item),children:t.label},t.targetId)})})})});y.displayName="AnchorNavigation";var q=y;export{q as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "AnchorNavigation", "classNames", "data", "onItemClick", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
|
|
5
|
+
"mappings": "aAwMc,cAAAA,MAAA,oBAtMd,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAuB,yBAC9B,OAAS,aAAAC,MAAiB,gCAW1B,MAAMC,EAA2BH,EAC/B,4FACA,CACE,SAAU,CACR,UAAW,CACT,MAAO,uBACP,OAAQ,wBACR,IAAK,oBACP,EACA,KAAM,CACJ,MAAO,QACP,MAAO,OACT,CACF,EACA,gBAAiB,CACf,UAAW,QACX,KAAM,OACR,CACF,CACF,EAKMI,EAAqBJ,EACzB,oLACA,CACE,SAAU,CACR,KAAM,CACJ,MAAO,OACP,MAAO,MACT,CACF,EACA,gBAAiB,CACf,KAAM,OACR,CACF,CACF,EAKMK,EAAoBL,EAAI,6BAA8B,CAC1D,SAAU,CACR,MAAO,CACL,MAAO,WACP,KAAM,cACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAwDKM,EAA8C,CAClD,aAAc,iBACd,YAAa,iBACb,qBAAsB,kBACxB,EAGMC,EAA6C,CACjD,aAAc,iBACd,YAAa,aACb,qBAAsB,kBACxB,EAOMC,EAAmBV,EAAM,WAC7B,CAAC,CAAE,WAAAW,EAAa,CAAC,EAAG,KAAAC,EAAM,YAAAC,EAAa,YAAAC,EAAa,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CAChF,KAAM,CAAE,UAAAC,EAAY,QAAS,MAAAC,EAAQ,QAAS,KAAAC,EAAO,OAAQ,EAAIR,EAC3DS,EAAWlB,EAAkBS,EAAK,YAAY,IAAIU,GAAQA,EAAK,QAAQ,GAAK,CAAC,CAAC,EAC9EC,EAAUvB,EAAM,OAAuB,IAAI,EAC3CwB,EAAexB,EAAM,OAA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AK,EAAIE,EAEjC,EACA,eAAcD,EAAW,GAAO,OAChC,QAAS,IAAM,CAKb,GAHAR,EAAuBO,CAAK,EAGxBtB,EAAa,CACfA,EAAYS,EAAMa,CAAK,EACvB,MACF,CAGA,MAAMG,EAAgB,SAAS,eAAehB,EAAK,QAAQ,EAC3D,GAAIgB,GAAiBf,EAAQ,QAAS,CACpC,MAAMgB,EAAYhB,EAAQ,QAAQ,aAC5BiB,EAAiBF,EAAc,sBAAsB,EAAE,IAAM,OAAO,QAAUC,EAEpF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,UAAWvC,EACTK,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BgB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBhB,GAAY,IACd,EAEC,SAAAW,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAZ,EAAiB,YAAc,mBAC/B,IAAO+B,EAAQ/B",
|
|
6
|
+
"names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{useEffect as N,useMemo as A,useState as k}from"react";import{Text as n,Container as D,Link as f}from"../../components/index.js";import F from"../Subscribe/index.js";import{FooterNavigationBlockType as y}from"./types.js";import{AddIcon as w,SubtractIcon as B,ArrowRightIcon as z,CountryIcon as E}from"./icons/index.js";import{useMediaQuery as C}from"react-responsive";import{cn as m,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as h}from"../AiuiProvider/index.js";import{withLayout as S}from"../../shared/Styles.js";const $=({data:{footer:a}={},currentCountry:d,event:l,subscribeLoading:p,classNames:o,className:s,...b})=>{const[c,r]=k(!1),g=C({query:"(max-width: 1439px)"});N(()=>{r(g)},[g]);const x=A(()=>a?.blocks?.find(t=>t?.blockType===y.Brand)?.country||{},[a]);return e("footer",{...b,className:m(o?.root,s),children:i(D,{className:m(o?.child),childClassName:m("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(n,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===y.Signup)return e(T,{subscribeLoading:p,data:t,onSubmit:l?.signup},t.id);if(t?.blockType===y.Brand)return e(O,{data:t,isMobile:c,event:l,currentCountry:d},t?.id);if(t?.blockType===y.Main)return e(P,{data:{...t,country:x},event:l,isMobile:c,currentCountry:d},t.id)})]})})},T=({data:a,onSubmit:d,subscribeLoading:l})=>{const{locale:p="us"}=h();return i("div",{className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(F,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:d,loading:l}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),i("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[i("div",{className:"flex-1",children:[e(n,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(o=>i("div",{className:"flex-start flex gap-2",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"size-5 shrink-0"}),e(n,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},o?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),i("div",{className:"flex-1",children:[e(n,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(o=>e(f,{href:`${u(o?.link,p)}?ref=footer`,asChild:!o?.link,className:"no-underline",children:e(n,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},o?.id))})]})]})]})},P=({data:a,event:d,isMobile:l,currentCountry:p})=>{const{locale:o="us"}=h(),[s,b]=k(!1),{services:c,mainNav:r,country:g}=a,x="contact-section";return i("nav",{className:"flex flex-col gap-8","aria-label":"Main navigation",children:[i("div",{className:m({"desktop:gap-16 flex":c?.download?.title}),children:[i("div",{className:m("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(n,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:m("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>i("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(f,{href:`${u(t?.link,o)}?ref=footer`,asChild:!t?.link,className:"no-underline",children:e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(M,{className:m({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),i("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(v,{title:r?.products?.title,lists:r?.products?.products}),e(v,{title:r?.explore?.title,lists:r?.explore?.explores}),e(v,{title:r?.support?.title,lists:r?.support?.supports}),i("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[i("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(n,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:x}),l&&e("button",{onClick:()=>b(!s),"aria-expanded":s,"aria-controls":x,"aria-label":s?"Collapse contact section":"Expand contact section",children:s?e(B,{width:20,height:20}):e(w,{width:20,height:20})})]}),(s&&l||!l)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":x,children:r?.contact?.contacts?.map(t=>i(f,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(n,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(L,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:l,onChangeCountry:d?.country}),e("div",{className:"desktop:hidden mt-8",children:e(M,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(f,{href:`${u(t?.link,o)}?ref=footer`,className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(f,{href:u(t?.link,o),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},O=({data:a,isMobile:d,event:l,currentCountry:p})=>{const{locale:o="us"}=h();return i("div",{className:"flex flex-col gap-4",children:[i("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[i("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[e(f,{href:`${u(a?.brand?.link,o)}?ref=footer`,asChild:!a?.brand?.link,children:e(n,{html:a?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),e("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:a?.brand?.brands?.map(s=>e(f,{href:`${u(s?.link,o)}?ref=footer`,children:e(n,{html:s?.icon,className:"text-[#B6B6BA] hover:text-white"})},s?.id))})]}),e(L,{country:p||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:d,onChangeCountry:l?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),i("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(n,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),i("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(s=>e(f,{href:`${u(s?.link,o)}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:s?.label},s?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:l?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},v=({title:a,lists:d,className:l})=>{const{locale:p="us"}=h(),[o,s]=k(!1),[b,c]=k(!1),r=C({query:"(max-width: 1439px)"});N(()=>{c(r)},[r]);const g=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return i("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:[i("div",{className:"flex items-center justify-between",children:[e(n,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:g}),b&&e("button",{onClick:()=>s(!o),"aria-expanded":o,"aria-controls":g,"aria-label":o?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:o?e(B,{width:20,height:20}):e(w,{width:20,height:20})})]}),(o&&b||!b)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":g,children:d?.map(x=>e(f,{href:`${u(x?.link,p)}?ref=footer`,className:"no-underline",children:e(n,{html:x?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},x?.id))})]})},M=({title:a,apps:d,className:l})=>{const{locale:p="us"}=h();return d?.length?i("div",{className:l,children:[e(n,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:d?.map(o=>i(f,{href:u(o?.link,p),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":o?.icon?.alt||o?.label||"Download app",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),o?.label&&e(n,{html:o?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},o?.id))})]}):null},L=({country:a,isMobile:d,className:l,onChangeCountry:p})=>e("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",l),children:i("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[i("div",{className:"group flex items-center gap-2",children:[e(E,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(n,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),d&&e(z,{width:20,height:20,"aria-hidden":"true"})]})});var U=S($);export{U as default};
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useEffect as w,useMemo as D,useState as v}from"react";import{Text as d,Container as F,Link as x}from"../../components/index.js";import S from"../Subscribe/index.js";import{FooterNavigationBlockType as y}from"./types.js";import{AddIcon as B,SubtractIcon as C,ArrowRightIcon as z,CountryIcon as E}from"./icons/index.js";import{useMediaQuery as M}from"react-responsive";import{cn as m,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as k}from"../AiuiProvider/index.js";import{withLayout as $}from"../../shared/Styles.js";const T=({data:{footer:a}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:l,moduleIds:s,...b})=>{const[c,r]=v(!1),g=M({query:"(max-width: 1439px)"});w(()=>{r(g)},[g]);const h=D(()=>a?.blocks?.find(t=>t?.blockType===y.Brand)?.country||{},[a]);return e("footer",{...b,className:m(i?.root,l),children:o(F,{className:m(i?.child),childClassName:m("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===y.Signup)return e(P,{subscribeLoading:f,data:t,onSubmit:n?.signup,id:s?.marketingConversion},t.id);if(t?.blockType===y.Brand)return e(j,{data:t,isMobile:c,event:n,currentCountry:p,id:s?.footerBrand},t?.id);if(t?.blockType===y.Main)return e(O,{data:{...t,country:h},event:n,isMobile:c,currentCountry:p,id:s?.mainServices},t.id)})]})})},P=({data:a,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=k();return o("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(S,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),o("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[o("div",{className:"flex-1",children:[e(d,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(l=>o("div",{className:"flex-start flex gap-2",children:[e("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},l?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),o("div",{className:"flex-1",children:[e(d,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(l=>e(x,{href:`${u(l?.link,i)}?ref=footer`,asChild:!l?.link,className:"no-underline",children:e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},l?.id))})]})]})]})},O=({data:a,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:l="us"}=k(),[s,b]=v(!1),{services:c,mainNav:r,country:g}=a,h="contact-section";return o("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[o("div",{className:m({"desktop:gap-16 flex":c?.download?.title}),children:[o("div",{className:m("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:m("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>o("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(x,{href:`${u(t?.link,l)}?ref=footer`,asChild:!t?.link,className:"no-underline",children:e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(L,{className:m({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),o("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(N,{title:r?.products?.title,lists:r?.products?.products}),e(N,{title:r?.explore?.title,lists:r?.explore?.explores}),e(N,{title:r?.support?.title,lists:r?.support?.supports}),o("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[o("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),n&&e("button",{onClick:()=>b(!s),"aria-expanded":s,"aria-controls":h,"aria-label":s?"Collapse contact section":"Expand contact section",children:s?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(s&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:r?.contact?.contacts?.map(t=>o(x,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(A,{country:f||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}),e("div",{className:"desktop:hidden mt-8",children:e(L,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(x,{href:`${u(t?.link,l)}?ref=footer`,className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(x,{href:u(t?.link,l),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},j=({data:a,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:l="us"}=k();return o("div",{id:i,className:"flex flex-col gap-4",children:[o("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[o("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[e(x,{href:`${u(a?.brand?.link,l)}?ref=footer`,asChild:!a?.brand?.link,children:e(d,{html:a?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),e("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:a?.brand?.brands?.map(s=>e(x,{href:`${u(s?.link,l)}?ref=footer`,children:e(d,{html:s?.icon,className:"text-[#B6B6BA] hover:text-white"})},s?.id))})]}),e(A,{country:f||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),o("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),o("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(s=>e(x,{href:`${u(s?.link,l)}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:s?.label},s?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},N=({title:a,lists:p,className:n})=>{const{locale:f="us"}=k(),[i,l]=v(!1),[s,b]=v(!1),c=M({query:"(max-width: 1439px)"});w(()=>{b(c)},[c]);const r=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return o("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[o("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:r}),s&&e("button",{onClick:()=>l(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(i&&s||!s)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(g=>e(x,{href:`${u(g?.link,f)}?ref=footer`,className:"no-underline",children:e(d,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},L=({title:a,apps:p,className:n})=>{const{locale:f="us"}=k();return p?.length?o("div",{className:n,children:[e(d,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>o(x,{href:u(i?.link,f),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},A=({country:a,isMobile:p,className:n,onChangeCountry:f})=>e("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:o("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[o("div",{className:"group flex items-center gap-2",children:[e(E,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(z,{width:20,height:20,"aria-hidden":"true"})]})});var V=$(T);export{V as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/FooterNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\">\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${getLocalizedPath(benefitItem?.link, locale)}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={`${getLocalizedPath(reasonItem?.link, locale)}?ref=footer`}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={`${getLocalizedPath(socialItem?.link, locale)}?ref=footer`}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={`${getLocalizedPath(data?.brand?.link, locale)}?ref=footer`} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${getLocalizedPath(brandItem?.link, locale)}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${getLocalizedPath(policyItem?.link, locale)}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={`${getLocalizedPath(item?.link, locale)}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "useEffect", "useMemo", "useState", "Text", "Container", "Link", "Subscribe", "FooterNavigationBlockType", "AddIcon", "SubtractIcon", "ArrowRightIcon", "CountryIcon", "useMediaQuery", "cn", "getLocalizedPath", "useAiuiContext", "withLayout", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "className", "rest", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "locale", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "contactSectionId", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "sectionId", "item", "apps", "appItem", "onChangeCountry", "FooterNavigation_default"]
|
|
4
|
+
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n moduleIds,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n id={moduleIds?.marketingConversion}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n id={moduleIds?.footerBrand}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n id={moduleIds?.mainServices}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n id = 'footer-marketing-conversion',\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div\n id={id}\n className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\"\n >\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${getLocalizedPath(benefitItem?.link, locale)}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n id = 'footer-main-services',\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav id={id} className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={`${getLocalizedPath(reasonItem?.link, locale)}?ref=footer`}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={`${getLocalizedPath(socialItem?.link, locale)}?ref=footer`}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n id = 'footer-brand',\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div id={id} className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={`${getLocalizedPath(data?.brand?.link, locale)}?ref=footer`} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${getLocalizedPath(brandItem?.link, locale)}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${getLocalizedPath(policyItem?.link, locale)}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={`${getLocalizedPath(item?.link, locale)}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
+
"mappings": "AAmCM,OAIE,OAAAA,EAJF,QAAA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NavigationBlockType", "AddIcon", "SubtractIcon", "ArrowRightIcon", "CountryIcon", "useMediaQuery", "cn", "getLocalizedPath", "useAiuiContext", "withLayout", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "className", "moduleIds", "rest", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "id", "locale", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "contactSectionId", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "sectionId", "item", "apps", "appItem", "onChangeCountry", "FooterNavigation_default"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
export type FooterNavigationSemanticName = 'root' | 'child';
|
|
3
|
+
export interface FooterNavigationModuleIds {
|
|
4
|
+
marketingConversion?: string;
|
|
5
|
+
mainServices?: string;
|
|
6
|
+
footerBrand?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
9
|
data: any;
|
|
5
10
|
currentCountry?: any;
|
|
@@ -11,6 +16,8 @@ export interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement>
|
|
|
11
16
|
cookiesSet?: () => void;
|
|
12
17
|
};
|
|
13
18
|
classNames?: Partial<Record<FooterNavigationSemanticName, string>>;
|
|
19
|
+
/** 各模块的 id,用于 URL #锚点定位 */
|
|
20
|
+
moduleIds?: FooterNavigationModuleIds;
|
|
14
21
|
}
|
|
15
22
|
export declare enum FooterNavigationBlockType {
|
|
16
23
|
Signup = "ipc-footer-signup",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/FooterNavigation/types.ts"],
|
|
4
|
-
"sourcesContent": ["import type React from 'react'\n\nexport type FooterNavigationSemanticName = 'root' | 'child'\n\nexport interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n cookiesSet?: () => void\n }\n classNames?: Partial<Record<FooterNavigationSemanticName, string>>\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type React from 'react'\n\nexport type FooterNavigationSemanticName = 'root' | 'child'\n\nexport interface FooterNavigationModuleIds {\n marketingConversion?: string\n mainServices?: string\n footerBrand?: string\n}\n\nexport interface FooterNavigationProps extends React.HTMLAttributes<HTMLElement> {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n cookiesSet?: () => void\n }\n classNames?: Partial<Record<FooterNavigationSemanticName, string>>\n /** \u5404\u6A21\u5757\u7684 id\uFF0C\u7528\u4E8E URL #\u951A\u70B9\u5B9A\u4F4D */\n moduleIds?: FooterNavigationModuleIds\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
|
|
5
|
+
"mappings": "AAyBO,IAAKA,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
|
|
6
6
|
"names": ["FooterNavigationBlockType"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as O,jsx as t,jsxs as o}from"react/jsx-runtime";import n,{useRef as d,useImperativeHandle as E}from"react";import{Button as w,Heading as p,Picture as x,Text as b}from"../../components/index.js";import{cn as i,getLocalizedPath as _}from"../../helpers/utils.js";import{withLayout as D}from"../../shared/Styles.js";import{useExposure as P}from"../../hooks/useExposure.js";import{useAiuiContext as R}from"../AiuiProvider/index.js";import{Swiper as g,SwiperSlide as k}from"swiper/react";import{Navigation as j,EffectCoverflow as B}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";import"swiper/css/effect-coverflow";const M="carousel",H="three_d_carousel",U=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),I=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),N=n.forwardRef(({data:y,className:S},T)=>{const{title:u,items:a=[]}=y,m=a.length<4?[...a,...a]:a,r=d(null),c=d(null),f=d(null),[C,L]=n.useState(180),{locale:h="us"}=R();return P(c,{componentType:M,componentName:H,componentTitle:u}),E(T,()=>c.current),n.useEffect(()=>{const e=f.current;if(!e)return;const l=()=>{const z=e.offsetWidth,v=Math.round(z*.
|
|
1
|
+
"use client";import{Fragment as O,jsx as t,jsxs as o}from"react/jsx-runtime";import n,{useRef as d,useImperativeHandle as E}from"react";import{Button as w,Heading as p,Picture as x,Text as b}from"../../components/index.js";import{cn as i,getLocalizedPath as _}from"../../helpers/utils.js";import{withLayout as D}from"../../shared/Styles.js";import{useExposure as P}from"../../hooks/useExposure.js";import{useAiuiContext as R}from"../AiuiProvider/index.js";import{Swiper as g,SwiperSlide as k}from"swiper/react";import{Navigation as j,EffectCoverflow as B}from"swiper/modules";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";import"swiper/css/effect-coverflow";const M="carousel",H="three_d_carousel",U=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M32 20L24 28L32 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),I=()=>o("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]",children:[t("circle",{cx:"28",cy:"28",r:"28",fill:"currentColor",fillOpacity:"0.2"}),t("path",{d:"M24 20L32 28L24 36",stroke:"white",strokeWidth:"2.66667",strokeLinecap:"round",strokeLinejoin:"round"})]}),N=n.forwardRef(({data:y,className:S},T)=>{const{title:u,items:a=[]}=y,m=a.length<4?[...a,...a]:a,r=d(null),c=d(null),f=d(null),[C,L]=n.useState(180),{locale:h="us"}=R();return P(c,{componentType:M,componentName:H,componentTitle:u}),E(T,()=>c.current),n.useEffect(()=>{const e=f.current;if(!e)return;const l=()=>{const z=e.offsetWidth,v=Math.round(z*.125);L(v),r.current?.params?.coverflowEffect&&(r.current.params.coverflowEffect.stretch=v,r.current.update())};l();const s=new ResizeObserver(l);return s.observe(e),()=>s.disconnect()},[]),o("section",{ref:c,"data-ui-component-id":"ThreeDCarousel",className:i("three-d-carousel laptop:overflow-hidden w-full overflow-visible",S),children:[t(p,{as:"h1",size:4,html:u,className:"three-d-carousel__title laptop:text-center text-left"}),o("div",{ref:f,className:"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full",children:[t(g,{onSwiper:e=>r.current=e,centeredSlides:!0,initialSlide:0,loop:!0,slidesPerView:"auto",spaceBetween:0,grabCursor:!0,modules:[B,j],slideToClickedSlide:!0,className:"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible",effect:"coverflow",coverflowEffect:{rotate:0,stretch:C,depth:300,modifier:1,slideShadows:!0},children:m.map((e,l)=>t(k,{className:"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100",children:({isActive:s})=>o(O,{children:[t(x,{source:e.imageUrl?.url||"",alt:e.imageUrl?.alt||e.title,className:i("three-d-carousel__image rounded-box mx-auto h-full overflow-hidden"),imgClassName:"h-full object-cover",style:{filter:s?"":"brightness(50%) contrast(120%)"}}),o("div",{className:i("three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark","opacity-0":!s}),children:[t(p,{as:"h2",size:2,html:e.title}),t(b,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-description text-[14px]"}),e.buttonText&&t("a",{href:_(e.buttonLink||"",h),className:"three-d-carousel__image-link ",children:t(w,{size:"base",variant:"secondary",className:"three-d-carousel__image-button desktop:mt-6 mt-4",children:e.buttonText})})]})]})},l))}),o("div",{className:"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between",children:[t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--prev",onClick:()=>r.current?.slidePrev(),"aria-label":"Previous slide",children:t(U,{})}),t("button",{className:"three-d-carousel__nav-button three-d-carousel__nav-button--next",onClick:()=>r.current?.slideNext(),"aria-label":"Next slide",children:t(I,{})})]})]}),t("div",{className:"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible",children:t(g,{loop:!0,loopAdditionalSlides:1,slidesPerView:"auto",spaceBetween:12,grabCursor:!0,className:"three-d-carousel__swiper-mobile relative w-full !overflow-visible",children:m.map((e,l)=>o(k,{className:"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden",children:[t(x,{source:e.mobImageUrl?.url||e.imageUrl?.url||"",alt:e.mobImageUrl?.alt||e.title,className:"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden",imgClassName:"h-full object-cover"}),o("div",{className:i("three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]",{"aiui-dark":e.theme==="dark"}),children:[t(p,{as:"h2",size:2,html:e.title}),t(b,{as:"p",size:4,html:e.description,className:"three-d-carousel__image-mobile-description text-[14px]"}),e.buttonText&&t("a",{href:_(e.buttonLink||"",h),className:"three-d-carousel__image-mobile-link ",children:t(w,{size:"base",variant:"secondary",className:"three-d-carousel__image-mobile-button mt-3",children:e.buttonText})})]})]},l))})})]})});N.displayName="ThreeDCarousel";var $=D(N,{style:"overflow: hidden;"});export{$ as default};
|
|
2
2
|
//# sourceMappingURL=ThreeDCarousel.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/ThreeDCarousel/ThreeDCarousel.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u7EA6\u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 18%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.18)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full px-4\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
-
"mappings": "aAqBE,OAgHc,YAAAA,EAxGZ,OAAAC,EARF,QAAAC,MAAA,oBApBF,OAAOC,GAAS,UAAAC,EAAQ,uBAAAC,MAA2B,QACnD,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,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A,eAAgBO,CAClB,CAAC,EAEDtB,EAAoBqB,EAAK,IAAMK,EAAO,OAAyB,EAG/D5B,EAAM,UAAU,IAAM,CACpB,MAAMiC,EAAYJ,EAAa,QAC/B,GAAI,CAACI,EAAW,OAEhB,MAAMC,EAAgB,IAAM,CAC1B,MAAMC,EAAiBF,EAAU,YAE3BG,EAAa,KAAK,MAAMD,EAAiB,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { ThreeDCarouselProps } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, EffectCoverflow } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\nimport 'swiper/css/effect-coverflow'\n\nconst componentType = 'carousel'\nconst componentName = 'three_d_carousel'\n\nconst ChevronLeft = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M32 20L24 28L32 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg\n width=\"56\"\n height=\"56\"\n viewBox=\"0 0 56 56\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"three-d-carousel__nav-icon lg-desktop:scale-100 scale-[70%] text-white hover:text-[#1f1f1f]\"\n >\n <circle cx=\"28\" cy=\"28\" r=\"28\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M24 20L32 28L24 36\" stroke=\"white\" strokeWidth=\"2.66667\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ThreeDCarousel = React.forwardRef<HTMLDivElement, ThreeDCarouselProps>(({ data, className }, ref) => {\n const { title, items = [] } = data\n const cloneItems = items.length < 4 ? [...items, ...items] : items\n const swiperRef = useRef<SwiperType | null>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const [stretchValue, setStretchValue] = React.useState(180)\n const { locale = 'us' } = useAiuiContext()\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u52A8\u6001\u8BA1\u7B97 stretch \u503C\uFF0C\u8BA9\u4E09\u4E2A slide \u521A\u597D\u5360\u6EE1\u5BB9\u5668\u5BBD\u5EA6\n React.useEffect(() => {\n const container = containerRef.current\n if (!container) return\n\n const updateStretch = () => {\n const containerWidth = container.offsetWidth\n // stretch \u4E3A\u5BB9\u5668\u5BBD\u5EA6\u7684 12.5%\uFF0C\u8BA9\u4E09\u4E2A slide (50% + 2*25%) \u521A\u597D\u5360\u6EE1\n const newStretch = Math.round(containerWidth * 0.125)\n setStretchValue(newStretch)\n\n // \u66F4\u65B0 Swiper \u914D\u7F6E\n if (swiperRef.current?.params?.coverflowEffect) {\n swiperRef.current.params.coverflowEffect.stretch = newStretch\n swiperRef.current.update()\n }\n }\n\n // \u521D\u59CB\u5316\u8BA1\u7B97\n updateStretch()\n\n // \u76D1\u542C\u5BB9\u5668\u5C3A\u5BF8\u53D8\u5316\n const resizeObserver = new ResizeObserver(updateStretch)\n resizeObserver.observe(container)\n\n return () => resizeObserver.disconnect()\n }, [])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ThreeDCarousel\"\n className={cn('three-d-carousel laptop:overflow-hidden w-full overflow-visible', className)}\n >\n <Heading as=\"h1\" size={4} html={title} className=\"three-d-carousel__title laptop:text-center text-left\" />\n\n {/* Desktop carousel with 3D effect */}\n <div\n ref={containerRef}\n className=\"three-d-carousel__desktop laptop:block relative mx-auto mt-[24px] hidden w-full\"\n >\n <Swiper\n onSwiper={swiper => (swiperRef.current = swiper)}\n centeredSlides={true}\n initialSlide={0}\n loop\n slidesPerView={'auto'}\n // loopAdditionalSlides={2}\n spaceBetween={0}\n grabCursor\n modules={[EffectCoverflow, Navigation]}\n slideToClickedSlide\n className=\"three-d-carousel__swiper rounded-box relative aspect-[1386/502] overflow-visible\"\n effect=\"coverflow\"\n coverflowEffect={{\n rotate: 0,\n stretch: stretchValue,\n depth: 300,\n modifier: 1,\n slideShadows: true,\n }}\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide relative !w-1/2 cursor-grab overflow-hidden opacity-0 [.swiper-slide-active&]:opacity-100 [.swiper-slide-next&]:opacity-100 [.swiper-slide-prev&]:opacity-100\"\n >\n {({ isActive }) => (\n <>\n <Picture\n source={item.imageUrl?.url || ''}\n alt={item.imageUrl?.alt || item.title}\n className={cn('three-d-carousel__image rounded-box mx-auto h-full overflow-hidden')}\n imgClassName=\"h-full object-cover\"\n style={{\n filter: isActive ? '' : 'brightness(50%) contrast(120%)',\n }}\n />\n <div\n className={cn(\n 'three-d-carousel__image-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n 'opacity-0': !isActive,\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-link \"\n >\n <Button\n size=\"base\"\n variant=\"secondary\"\n className=\"three-d-carousel__image-button desktop:mt-6 mt-4\"\n >\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n <div className=\"three-d-carousel__nav-controls laptop:px-[64px] desktop:px-[140px] lg-desktop:px-[200px] absolute left-1/2 top-1/2 z-20 flex w-full -translate-x-1/2 -translate-y-1/2 justify-between\">\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--prev\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous slide\"\n >\n <ChevronLeft />\n </button>\n <button\n className=\"three-d-carousel__nav-button three-d-carousel__nav-button--next\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next slide\"\n >\n <ChevronRight />\n </button>\n </div>\n </div>\n\n {/* Mobile carousel */}\n <div className=\"three-d-carousel__mobile laptop:hidden mt-[24px] block w-full overflow-visible\">\n <Swiper\n loop={true}\n loopAdditionalSlides={1}\n slidesPerView={'auto'}\n spaceBetween={12}\n grabCursor\n className=\"three-d-carousel__swiper-mobile relative w-full !overflow-visible\"\n >\n {cloneItems.map((item, index) => (\n <SwiperSlide\n key={index}\n className=\"three-d-carousel__slide-mobile relative !h-[360px] !w-[296px] cursor-grab overflow-hidden\"\n >\n <Picture\n source={item.mobImageUrl?.url || item.imageUrl?.url || ''}\n alt={item.mobImageUrl?.alt || item.title}\n className=\"three-d-carousel__image-mobile rounded-box mx-auto h-full overflow-hidden\"\n imgClassName=\"h-full object-cover\"\n />\n <div\n className={cn(\n 'three-d-carousel__image-mobile-content tablet:p-[24px] desktop:p-[32px] text-info-primary absolute left-0 top-0 flex size-full flex-col justify-end gap-1 p-[16px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Heading as=\"h2\" size={2} html={item.title} />\n <Text\n as=\"p\"\n size={4}\n html={item.description}\n className=\"three-d-carousel__image-mobile-description text-[14px]\"\n />\n {item.buttonText && (\n <a\n href={getLocalizedPath(item.buttonLink || '', locale)}\n className=\"three-d-carousel__image-mobile-link \"\n >\n <Button size=\"base\" variant=\"secondary\" className=\"three-d-carousel__image-mobile-button mt-3\">\n {item.buttonText}\n </Button>\n </a>\n )}\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </section>\n )\n})\n\nThreeDCarousel.displayName = 'ThreeDCarousel'\n\nexport default withLayout(ThreeDCarousel, { style: 'overflow: hidden;' })\n"],
|
|
5
|
+
"mappings": "aAqBE,OAgHc,YAAAA,EAxGZ,OAAAC,EARF,QAAAC,MAAA,oBApBF,OAAOC,GAAS,UAAAC,EAAQ,uBAAAC,MAA2B,QACnD,OAAS,UAAAC,EAAQ,WAAAC,EAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC/C,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,2BAE/B,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,mBAAAC,MAAuB,iBAG5C,MAAO,aACP,MAAO,wBACP,MAAO,wBACP,MAAO,8BAEP,MAAMC,EAAgB,WAChBC,EAAgB,mBAEhBC,EAAc,IAClBnB,EAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAU,8FAEV,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,EACrEA,EAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,UAAU,cAAc,QAAQ,eAAe,QAAQ,GACjH,EAGIqB,EAAe,IACnBpB,EAAC,OACC,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OACL,MAAM,6BACN,UAAU,8FAEV,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,EACrEA,EAA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,EAAY,EACf,EACApB,EAAC,UACC,UAAU,kEACV,QAAS,IAAM6B,EAAU,SAAS,UAAU,EAC5C,aAAW,aAEX,SAAA7B,EAACqB,EAAA,EAAa,EAChB,GACF,GACF,EAGArB,EAAC,OAAI,UAAU,iFACb,SAAAA,EAACc,EAAA,CACC,KAAM,GACN,qBAAsB,EACtB,cAAe,OACf,aAAc,GACd,WAAU,GACV,UAAU,oEAET,SAAAc,EAAW,IAAI,CAACa,EAAMC,IACrBzC,EAACc,EAAA,CAEC,UAAU,4FAEV,UAAAf,EAACO,EAAA,CACC,OAAQkC,EAAK,aAAa,KAAOA,EAAK,UAAU,KAAO,GACvD,IAAKA,EAAK,aAAa,KAAOA,EAAK,MACnC,UAAU,4EACV,aAAa,sBACf,EACAxC,EAAC,OACC,UAAWQ,EACT,qKACA,CACE,YAAagC,EAAK,QAAU,MAC9B,CACF,EAEA,UAAAzC,EAACM,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,KAAMmC,EAAK,MAAO,EAC5CzC,EAACQ,EAAA,CACC,GAAG,IACH,KAAM,EACN,KAAMiC,EAAK,YACX,UAAU,yDACZ,EACCA,EAAK,YACJzC,EAAC,KACC,KAAMU,EAAiB+B,EAAK,YAAc,GAAIP,CAAM,EACpD,UAAU,uCAEV,SAAAlC,EAACK,EAAA,CAAO,KAAK,OAAO,QAAQ,YAAY,UAAU,6CAC/C,SAAAoC,EAAK,WACR,EACF,GAEJ,IAlCKC,CAmCP,CACD,EACH,EACF,GACF,CAEJ,CAAC,EAEDpB,EAAe,YAAc,iBAE7B,IAAOsB,EAAQjC,EAAWW,EAAgB,CAAE,MAAO,mBAAoB,CAAC",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "useRef", "useImperativeHandle", "Button", "Heading", "Picture", "Text", "cn", "getLocalizedPath", "withLayout", "useExposure", "useAiuiContext", "Swiper", "SwiperSlide", "Navigation", "EffectCoverflow", "componentType", "componentName", "ChevronLeft", "ChevronRight", "ThreeDCarousel", "data", "className", "ref", "title", "items", "cloneItems", "swiperRef", "boxRef", "containerRef", "stretchValue", "setStretchValue", "locale", "container", "updateStretch", "containerWidth", "newStretch", "resizeObserver", "swiper", "item", "index", "isActive", "ThreeDCarousel_default"]
|
|
7
7
|
}
|