@anker-in/headless-ui 1.1.39 → 1.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var P=Object.create;var m=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var D=(o,a)=>{for(var r in a)m(o,r,{get:a[r],enumerable:!0})},k=(o,a,r,x)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!M.call(o,s)&&s!==r&&m(o,s,{get:()=>a[s],enumerable:!(x=C(a,s))||x.enumerable});return o};var R=(o,a,r)=>(r=o!=null?P(H(o)):{},k(a||!o||!o.__esModule?m(r,"default",{value:o,enumerable:!0}):r,o)),z=o=>k(m({},"__esModule",{value:!0}),o);var I={};D(I,{default:()=>G});module.exports=z(I);var e=require("react/jsx-runtime"),n=require("react"),u=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),d=require("../../components/index.js"),b=require("../../hooks/useExposure.js"),f=R(require("@radix-ui/react-popover"));const B="navigation",j="product_nav",V=o=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),g=(0,n.forwardRef)(({className:o="",data:a,id:r},x)=>{const{tabLinks:s=[],anchorList:y=[],textLink:l,buyBtn:c,theme:N="light"}=a||{},[E,T]=(0,n.useState)(""),v=(0,n.useRef)(null);(0,n.useImperativeHandle)(x,()=>v.current),(0,b.useExposure)(v,{componentType:B,componentName:j}),(0,n.useEffect)(()=>{const t=()=>{T(window.location.hash)};return t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)}},[]),(0,n.useEffect)(()=>{const t=document.querySelectorAll(".header"),p=[];return t.forEach(h=>{const i=h;p.push({element:i,originalPosition:i.style.position||getComputedStyle(i).position}),i.style.position="relative"}),()=>{p.forEach(({element:h,originalPosition:i})=>{h.style.position=i==="static"?"":i})}},[]);const L=t=>{t.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})};return(0,e.jsxs)("div",{id:r,ref:v,className:(0,u.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":N==="dark"},o),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[s.map((t,p)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:t.link,className:(0,u.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":p!==0,"hidden desktop:block":p===1}),children:(0,e.jsx)("span",{children:t.label})}),p!==s.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},t.link||p)),s.length>1&&(0,e.jsxs)(f.Root,{children:[(0,e.jsx)(f.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,e.jsx)(V,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(f.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:s.slice(1).map(t=>(0,e.jsx)("a",{href:t.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:t.label})},t.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[l?.link&&(0,e.jsx)("a",{href:l.link,target:l.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(d.Text,{size:2,className:"text-nowrap",children:l.text})}),c?.link&&(0,e.jsx)(d.Button,{as:"a",href:c.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:c.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]",children:y.map(t=>(0,e.jsxs)("a",{href:`#${t.id}`,className:"product-nav-anchor-link",onClick:p=>{L(p)},children:[(0,e.jsx)(d.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:t.label}),(0,e.jsx)("div",{className:(0,u.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"bg-brand-color":E===`#${t.id}`})})]},t.id))})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[l?.link&&(0,e.jsx)("a",{href:l.link,target:l.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,e.jsx)(d.Text,{size:2,className:"text-nowrap",children:l.text})}),c?.link&&(0,e.jsx)(d.Button,{as:"a",href:c.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:c.text})]})]})});g.displayName="ProductNav";var G=(0,w.withLayout)(g);
1
+ "use strict";"use client";var D=Object.create;var f=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var z=(o,a)=>{for(var s in a)f(o,s,{get:a[s],enumerable:!0})},k=(o,a,s,u)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of M(a))!B.call(o,d)&&d!==s&&f(o,d,{get:()=>a[d],enumerable:!(u=H(a,d))||u.enumerable});return o};var $=(o,a,s)=>(s=o!=null?D(R(o)):{},k(a||!o||!o.__esModule?f(s,"default",{value:o,enumerable:!0}):s,o)),j=o=>k(f({},"__esModule",{value:!0}),o);var O={};z(O,{default:()=>F});module.exports=j(O);var e=require("react/jsx-runtime"),r=require("react"),h=require("../../helpers/utils.js"),y=require("../../shared/Styles.js"),c=require("../../components/index.js"),N=require("../../hooks/useExposure.js"),g=$(require("@radix-ui/react-popover"));const G="navigation",V="product_nav",_=o=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),b=(0,r.forwardRef)(({className:o="",data:a,id:s,onAnchorClick:u,scrollOffsetExtra:d=0},E)=>{const{tabLinks:x=[],anchorList:T=[],textLink:i,buyBtn:m,theme:P="light"}=a||{},[L,w]=(0,r.useState)(""),v=(0,r.useRef)(null);(0,r.useImperativeHandle)(E,()=>v.current),(0,N.useExposure)(v,{componentType:G,componentName:V}),(0,r.useEffect)(()=>{const t=()=>{w(window.location.hash)};return t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)}},[]),(0,r.useEffect)(()=>{const t=document.querySelectorAll(".header"),n=[];return t.forEach(p=>{const l=p;n.push({element:l,originalPosition:l.style.position||getComputedStyle(l).position}),l.style.position="relative"}),()=>{n.forEach(({element:p,originalPosition:l})=>{p.style.position=l==="static"?"":l})}},[]);const S=(t,n)=>{t.preventDefault();const p=document.getElementById(n);if(!p){console.warn(`Target element with id "${n}" not found`);return}const l=v.current?.offsetHeight||0,C=p.getBoundingClientRect().top+window.scrollY-l-d;window.scrollTo({top:C,behavior:"smooth"}),window.history.pushState(null,"",`#${n}`),w(`#${n}`)};return(0,e.jsxs)("div",{id:s,ref:v,className:(0,h.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":P==="dark"},o),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[x.map((t,n)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:t.link,className:(0,h.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":n!==0,"hidden desktop:block":n===1}),children:(0,e.jsx)("span",{children:t.label})}),n!==x.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},t.link||n)),x.length>1&&(0,e.jsxs)(g.Root,{children:[(0,e.jsx)(g.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,e.jsx)(_,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(g.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:x.slice(1).map(t=>(0,e.jsx)("a",{href:t.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:t.label})},t.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[i?.link&&(0,e.jsx)("a",{href:i.link,target:i.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(c.Text,{size:2,className:"text-nowrap",children:i.text})}),m?.link&&(0,e.jsx)(c.Button,{as:"a",href:m.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:m.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:T.map((t,n)=>(0,e.jsxs)("a",{href:`#${t.id}`,className:"product-nav-anchor-link",onClick:p=>{u?(p.preventDefault(),u(t,n)):S(p,t.id)},children:[(0,e.jsx)(c.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:t.label}),(0,e.jsx)("div",{className:(0,h.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":L===`#${t.id}`})})]},t.id))})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[i?.link&&(0,e.jsx)("a",{href:i.link,target:i.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:(0,e.jsx)(c.Text,{size:2,className:"text-nowrap",children:i.text})}),m?.link&&(0,e.jsx)(c.Button,{as:"a",href:m.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:m.text})]})]})});b.displayName="ProductNav";var F=(0,y.withLayout)(b);
2
2
  //# sourceMappingURL=ProductNav.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/ProductNav.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(({ className = '', data, id }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent) => {\n const target = e.target as HTMLElement\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n })\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]\">\n {anchorList.map(anchor => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n handleAnchorClick(e)\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n 'bg-brand-color': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n})\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAdNC,EAA6E,iBAC7EC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA6B,qCAC7BC,EAA4B,sCAE5BC,EAAyB,sCAEzB,MAAMC,EAAgB,aAChBC,EAAgB,cAEhBC,EAAmBC,MAErB,OAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,mBAAC,QACC,EAAE,wBACF,OAAO,eACP,YAAY,UACZ,cAAc,QACd,eAAe,QACjB,EACF,EAIEC,KAAa,cAA4C,CAAC,CAAE,UAAAC,EAAY,GAAI,KAAAC,EAAM,GAAAC,CAAG,EAAGC,IAAQ,CACpG,KAAM,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oBAAC,QAAK,KAAM,EAAG,UAAU,sCACtB,SAAAG,EAAO,MACV,KACA,OAAC,OACC,aAAW,MACT,sHACA,CACE,iBAAkBb,IAAS,IAAIa,EAAO,EAAE,EAC1C,CACF,EACF,IAjBKA,EAAO,EAkBd,CACD,EACH,GACF,KAGA,QAAC,OAAI,UAAU,8GAUZ,UAAAhB,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,yEAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CAAC,EAEDR,EAAW,YAAc,aAEzB,IAAOb,KAAQ,cAAWa,CAAU",
6
- "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "headerElements", "originalStyles", "element", "htmlElement", "originalPosition", "handleAnchorClick", "e", "tabLink", "index", "anchor"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(\n ({ className = '', data, id, onAnchorClick, scrollOffsetExtra = 0 }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent, anchorId: string) => {\n e.preventDefault()\n\n // \u83B7\u53D6\u76EE\u6807\u5143\u7D20\n const targetElement = document.getElementById(anchorId)\n if (!targetElement) {\n console.warn(`Target element with id \"${anchorId}\" not found`)\n return\n }\n\n // \u83B7\u53D6\u5BFC\u822A\u680F\u9AD8\u5EA6\n const navHeight = innerRef.current?.offsetHeight || 0\n\n // \u8BA1\u7B97\u76EE\u6807\u4F4D\u7F6E\uFF08\u76EE\u6807\u5143\u7D20\u7684\u4F4D\u7F6E - \u5BFC\u822A\u680F\u9AD8\u5EA6 - \u989D\u5916\u504F\u79FB\uFF09\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight - scrollOffsetExtra\n\n // \u5E73\u6ED1\u6EDA\u52A8\u5230\u76EE\u6807\u4F4D\u7F6E\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n\n // \u66F4\u65B0 URL hash\uFF08\u4E0D\u89E6\u53D1\u9875\u9762\u8DF3\u8F6C\uFF09\n window.history.pushState(null, '', `#${anchorId}`)\n\n // \u624B\u52A8\u66F4\u65B0\u7EC4\u4EF6\u5185\u90E8\u7684 hash \u72B6\u6001\n setHash(`#${anchorId}`)\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {anchorList.map((anchor, index) => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n // \u5982\u679C\u63D0\u4F9B\u4E86\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6,\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\u5E76\u963B\u6B62\u9ED8\u8BA4\u884C\u4E3A\n if (onAnchorClick) {\n e.preventDefault()\n onAnchorClick(anchor, index)\n } else {\n // \u4F7F\u7528\u9ED8\u8BA4\u7684\u951A\u70B9\u6EDA\u52A8\u884C\u4E3A\uFF0C\u5E26\u504F\u79FB\u91CF\n handleAnchorClick(e, anchor.id)\n }\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n '!bg-brand-0': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button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EACF,IAxBKA,EAAO,EAyBd,CACD,EACH,GACF,KAGA,QAAC,OAAI,UAAU,8GAUZ,UAAApB,GAAU,SACT,OAAC,KACC,KAAMA,EAAS,KACf,OAAQA,EAAS,QAAU,QAC3B,UAAU,yEAEV,mBAAC,QAAK,KAAM,EAAG,UAAU,cACtB,SAAAA,EAAS,KACZ,EACF,EAEDC,GAAQ,SACP,OAAC,UAAO,GAAG,IAAI,KAAMA,EAAO,KAAM,KAAK,KAAK,UAAU,qCACnD,SAAAA,EAAO,KACV,GAEJ,GACF,CAEJ,CACF,EAEAV,EAAW,YAAc,aAEzB,IAAOb,KAAQ,cAAWa,CAAU",
6
+ "names": ["ProductNav_exports", "__export", "ProductNav_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "import_components", "import_useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "onAnchorClick", "scrollOffsetExtra", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "headerElements", "originalStyles", "element", "htmlElement", "originalPosition", "handleAnchorClick", "e", "anchorId", "targetElement", "navHeight", "targetPosition", "tabLink", "index", "anchor"]
7
7
  }
@@ -32,4 +32,8 @@ export interface ProductNavProps extends ComponentCommonProps {
32
32
  /** 主题,默认 light */
33
33
  theme?: Theme;
34
34
  };
35
+ /** 锚点点击事件,传入时将忽略默认的锚点跳转行为 */
36
+ onAnchorClick?: (item: AnchorItem, index: number) => void;
37
+ /** 锚点滚动额外偏移量(像素),会在导航栏高度基础上额外偏移,默认为 0 */
38
+ scrollOffsetExtra?: number;
35
39
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var m=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!p.call(e,n)&&n!==o&&i(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable});return e};var x=e=>m(i({},"__esModule",{value:!0}),e);var k={};module.exports=x(k);
1
+ "use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of a(t))!m.call(e,n)&&n!==i&&o(e,n,{get:()=>t[n],enumerable:!(r=s(t,n))||r.enumerable});return e};var c=e=>p(o({},"__esModule",{value:!0}),e);var x={};module.exports=c(x);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/types.ts"],
4
- "sourcesContent": ["import type { ComponentCommonProps, Theme } from '../../types/props.js'\n\nexport interface TabLink {\n link: string\n label: string\n}\n\nexport interface AnchorItem {\n id: string\n label: string\n}\n\nexport interface BuyButton {\n link: string\n text: string\n}\n\nexport interface TextLink {\n /** \u94FE\u63A5\u5730\u5740 */\n link: string\n /** \u94FE\u63A5\u6587\u5B57 */\n text: string\n /** \u6253\u5F00\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u7A97\u53E3 */\n target?: '_self' | '_blank'\n}\n\nexport interface ProductNavProps extends ComponentCommonProps {\n data: {\n /** \u4EA7\u54C1\u9875\u7B7E\u94FE\u63A5 */\n tabLinks?: TabLink[]\n /** \u951A\u70B9\u5BFC\u822A\u5217\u8868 */\n anchorList?: AnchorItem[]\n /** \u6587\u5B57\u94FE\u63A5\uFF0C\u663E\u793A\u5728\u8D2D\u4E70\u6309\u94AE\u5DE6\u8FB9 */\n textLink?: TextLink\n /** \u8D2D\u4E70\u6309\u94AE */\n buyBtn?: BuyButton\n /** \u4E3B\u9898\uFF0C\u9ED8\u8BA4 light */\n theme?: Theme\n }\n}\n"],
4
+ "sourcesContent": ["import type { ComponentCommonProps, Theme } from '../../types/props.js'\n\nexport interface TabLink {\n link: string\n label: string\n}\n\nexport interface AnchorItem {\n id: string\n label: string\n}\n\nexport interface BuyButton {\n link: string\n text: string\n}\n\nexport interface TextLink {\n /** \u94FE\u63A5\u5730\u5740 */\n link: string\n /** \u94FE\u63A5\u6587\u5B57 */\n text: string\n /** \u6253\u5F00\u65B9\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u7A97\u53E3 */\n target?: '_self' | '_blank'\n}\n\nexport interface ProductNavProps extends ComponentCommonProps {\n data: {\n /** \u4EA7\u54C1\u9875\u7B7E\u94FE\u63A5 */\n tabLinks?: TabLink[]\n /** \u951A\u70B9\u5BFC\u822A\u5217\u8868 */\n anchorList?: AnchorItem[]\n /** \u6587\u5B57\u94FE\u63A5\uFF0C\u663E\u793A\u5728\u8D2D\u4E70\u6309\u94AE\u5DE6\u8FB9 */\n textLink?: TextLink\n /** \u8D2D\u4E70\u6309\u94AE */\n buyBtn?: BuyButton\n /** \u4E3B\u9898\uFF0C\u9ED8\u8BA4 light */\n theme?: Theme\n }\n /** \u951A\u70B9\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u5C06\u5FFD\u7565\u9ED8\u8BA4\u7684\u951A\u70B9\u8DF3\u8F6C\u884C\u4E3A */\n onAnchorClick?: (item: AnchorItem, index: number) => void\n /** \u951A\u70B9\u6EDA\u52A8\u989D\u5916\u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09\uFF0C\u4F1A\u5728\u5BFC\u822A\u680F\u9AD8\u5EA6\u57FA\u7840\u4E0A\u989D\u5916\u504F\u79FB\uFF0C\u9ED8\u8BA4\u4E3A 0 */\n scrollOffsetExtra?: number\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -35,6 +35,8 @@ declare const meta: {
35
35
  wrapperClassName?: string | undefined;
36
36
  event?: any;
37
37
  condition?: any;
38
+ onAnchorClick?: ((item: import("../biz-components/index.js").AnchorItem, index: number) => void) | undefined;
39
+ scrollOffsetExtra?: number | undefined;
38
40
  ref?: React.LegacyRef<any> | undefined;
39
41
  }>) => import("react/jsx-runtime").JSX.Element)[];
40
42
  tags: string[];
@@ -53,3 +55,5 @@ export declare const WithTextLink: Story;
53
55
  export declare const TextLinkNewWindow: Story;
54
56
  export declare const OnlyTextLink: Story;
55
57
  export declare const WithoutTextLink: Story;
58
+ export declare const WithScrollOffset: Story;
59
+ export declare const WithCustomAnchorClick: Story;
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.create;var s=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})},u=(t,e,i,d)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of b(e))!m.call(t,c)&&c!==i&&s(t,c,{get:()=>e[c],enumerable:!(d=p(e,c))||d.enumerable});return t};var k=(t,e,i)=>(i=t!=null?l(y(t)):{},u(e||!t||!t.__esModule?s(i,"default",{value:t,enumerable:!0}):i,t)),g=t=>u(s({},"__esModule",{value:!0}),t);var V={};v(V,{CustomBuyButton:()=>I,DarkTheme:()=>O,Default:()=>S,FewAnchors:()=>w,ManyTabs:()=>h,MinimalNav:()=>B,OnlyTextLink:()=>N,SingleTab:()=>W,TextLinkNewWindow:()=>E,WithTextLink:()=>T,WithoutBuyButton:()=>L,WithoutTextLink:()=>R,default:()=>f});module.exports=g(V);var a=require("react/jsx-runtime"),M=require("react"),r=k(require("../biz-components/ProductNav/index.js"));const x={title:"Biz-Components/ProductNav",component:r.default,parameters:{layout:"fullscreen",docs:{description:{component:"Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons"}}},decorators:[t=>(0,a.jsx)("div",{style:{paddingTop:"2em",background:"#f5f5f5",minHeight:"50vh"},children:(0,a.jsx)(t,{})})],tags:["autodocs"]};var f=x;const o={textLink:{link:"/learn-more",text:"Learn More",target:"_self"},buyBtn:{link:"/products/t2353111",text:"Buy Now"},tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"}],anchorList:[{id:"overview",label:"Overview"},{id:"cleaning-power",label:"Cleaning Power"},{id:"smart-cleaning",label:"Smart Cleaning"},{id:"ease-of-use",label:"Ease of Use"},{id:"brand-equity",label:"Brand Equity"}],currentSku:"T2353111,T2352111"},n=({children:t,...e})=>(0,a.jsx)("div",{children:t({...e})}),S={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:o}},L={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,buyBtn:void 0}}},W={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"}]}}},h={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"},{link:"/robot-vacuum-e30",label:"Robot Vacuum Omni E30"},{link:"/robot-vacuum-x20",label:"Robot Vacuum X20 Pro"}]}}},w={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,anchorList:[{id:"overview",label:"Overview"},{id:"features",label:"Features"}]}}},I={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,buyBtn:{link:"/cart/add/t2353111",text:"Add to Cart"}}}},B={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{tabLinks:[{link:"/product",label:"Product Name"}],anchorList:[{id:"overview",label:"Overview"}],buyBtn:{link:"/buy",text:"Buy"}}}},O={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,theme:"dark"}},decorators:[t=>(0,a.jsx)("div",{style:{paddingTop:"2em",background:"#000",minHeight:"50vh"},children:(0,a.jsx)(t,{})})]},T={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,textLink:{link:"/specifications",text:"View Specs",target:"_self"}}}},E={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,textLink:{link:"https://support.example.com/guides",text:"User Guide",target:"_blank"}}}},N={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,textLink:{link:"/more-info",text:"More Info",target:"_self"},buyBtn:void 0}}},R={render:t=>(0,a.jsx)(n,{...t,children:e=>(0,a.jsx)(r.default,{...e})}),args:{data:{...o,textLink:void 0}}};
1
+ "use strict";var p=Object.create;var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var g=(t,a)=>{for(var i in a)c(t,i,{get:a[i],enumerable:!0})},l=(t,a,i,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of v(a))!y.call(t,d)&&d!==i&&c(t,d,{get:()=>a[d],enumerable:!(s=u(a,d))||s.enumerable});return t};var m=(t,a,i)=>(i=t!=null?p(b(t)):{},l(a||!t||!t.__esModule?c(i,"default",{value:t,enumerable:!0}):i,t)),h=t=>l(c({},"__esModule",{value:!0}),t);var V={};g(V,{CustomBuyButton:()=>I,DarkTheme:()=>B,Default:()=>x,FewAnchors:()=>L,ManyTabs:()=>W,MinimalNav:()=>O,OnlyTextLink:()=>E,SingleTab:()=>w,TextLinkNewWindow:()=>T,WithCustomAnchorClick:()=>R,WithScrollOffset:()=>P,WithTextLink:()=>C,WithoutBuyButton:()=>S,WithoutTextLink:()=>N,default:()=>k});module.exports=h(V);var e=require("react/jsx-runtime"),M=require("react"),r=m(require("../biz-components/ProductNav/index.js"));const f={title:"Biz-Components/ProductNav",component:r.default,parameters:{layout:"fullscreen",docs:{description:{component:"Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons"}}},decorators:[t=>(0,e.jsx)("div",{style:{paddingTop:"2em",background:"#f5f5f5",minHeight:"50vh"},children:(0,e.jsx)(t,{})})],tags:["autodocs"]};var k=f;const o={textLink:{link:"/learn-more",text:"Learn More",target:"_self"},buyBtn:{link:"/products/t2353111",text:"Buy Now"},tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"}],anchorList:[{id:"overview",label:"Overview"},{id:"cleaning-power",label:"Cleaning Power"},{id:"smart-cleaning",label:"Smart Cleaning"},{id:"ease-of-use",label:"Ease of Use"},{id:"brand-equity",label:"Brand Equity"}],currentSku:"T2353111,T2352111"},n=({children:t,...a})=>(0,e.jsx)("div",{children:t({...a})}),x={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:o}},S={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,buyBtn:void 0}}},w={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"}]}}},W={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"},{link:"/robot-vacuum-e30",label:"Robot Vacuum Omni E30"},{link:"/robot-vacuum-x20",label:"Robot Vacuum X20 Pro"}]}}},L={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,anchorList:[{id:"overview",label:"Overview"},{id:"features",label:"Features"}]}}},I={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,buyBtn:{link:"/cart/add/t2353111",text:"Add to Cart"}}}},O={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{tabLinks:[{link:"/product",label:"Product Name"}],anchorList:[{id:"overview",label:"Overview"}],buyBtn:{link:"/buy",text:"Buy"}}}},B={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,theme:"dark"}},decorators:[t=>(0,e.jsx)("div",{style:{paddingTop:"2em",background:"#000",minHeight:"50vh"},children:(0,e.jsx)(t,{})})]},C={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,textLink:{link:"/specifications",text:"View Specs",target:"_self"}}}},T={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,textLink:{link:"https://support.example.com/guides",text:"User Guide",target:"_blank"}}}},E={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,textLink:{link:"/more-info",text:"More Info",target:"_self"},buyBtn:void 0}}},N={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),args:{data:{...o,textLink:void 0}}},P={render:t=>(0,e.jsxs)("div",{children:[(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a})}),(0,e.jsxs)("div",{id:"overview",style:{height:"100vh",padding:"2em",background:"#f0f0f0"},children:[(0,e.jsx)("h2",{children:"Overview Section"}),(0,e.jsx)("p",{children:"This section demonstrates scroll offset functionality."}),(0,e.jsx)("p",{children:"Click the anchor links in the navigation to see smooth scrolling with offset."})]}),(0,e.jsxs)("div",{id:"cleaning-power",style:{height:"100vh",padding:"2em",background:"#e0e0e0"},children:[(0,e.jsx)("h2",{children:"Cleaning Power Section"}),(0,e.jsx)("p",{children:"Content appears below the fixed navigation bar with proper offset."})]}),(0,e.jsxs)("div",{id:"smart-cleaning",style:{height:"100vh",padding:"2em",background:"#d0d0d0"},children:[(0,e.jsx)("h2",{children:"Smart Cleaning Section"}),(0,e.jsx)("p",{children:"Extra offset ensures content is not hidden behind the navigation."})]}),(0,e.jsxs)("div",{id:"ease-of-use",style:{height:"100vh",padding:"2em",background:"#c0c0c0"},children:[(0,e.jsx)("h2",{children:"Ease of Use Section"}),(0,e.jsx)("p",{children:"The navigation bar height is automatically calculated."})]}),(0,e.jsxs)("div",{id:"brand-equity",style:{height:"100vh",padding:"2em",background:"#b0b0b0"},children:[(0,e.jsx)("h2",{children:"Brand Equity Section"}),(0,e.jsx)("p",{children:"Additional offset of 20px provides extra spacing."})]})]}),args:{data:o,scrollOffsetExtra:20}},R={render:t=>(0,e.jsx)(n,{...t,children:a=>(0,e.jsx)(r.default,{...a,onAnchorClick:(i,s)=>{alert(`Clicked: ${i.label} (index: ${s})`)}})}),args:{data:o}};
2
2
  //# sourceMappingURL=ProductNav.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/ProductNav.stories.tsx"],
4
- "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport ProductNav from '../biz-components/ProductNav/index.js'\n\nconst meta = {\n title: 'Biz-Components/ProductNav',\n component: ProductNav,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component:\n 'Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons',\n },\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#f5f5f5', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n tags: ['autodocs'],\n} satisfies Meta<typeof ProductNav>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mockData = {\n textLink: {\n link: '/learn-more',\n text: 'Learn More',\n target: '_self' as const,\n },\n buyBtn: {\n link: '/products/t2353111',\n text: 'Buy Now',\n },\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'cleaning-power',\n label: 'Cleaning Power',\n },\n {\n id: 'smart-cleaning',\n label: 'Smart Cleaning',\n },\n {\n id: 'ease-of-use',\n label: 'Ease of Use',\n },\n {\n id: 'brand-equity',\n label: 'Brand Equity',\n },\n ],\n currentSku: 'T2353111,T2352111',\n}\n\n// Interactive wrapper component for stories\nconst InteractiveWrapper = ({ children, ...props }: any) => {\n return <div>{children({ ...props })}</div>\n}\n\nexport const Default: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: mockData,\n },\n}\n\nexport const WithoutBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: undefined,\n },\n },\n}\n\nexport const SingleTab: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n ],\n },\n },\n}\n\nexport const ManyTabs: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n {\n link: '/robot-vacuum-e30',\n label: 'Robot Vacuum Omni E30',\n },\n {\n link: '/robot-vacuum-x20',\n label: 'Robot Vacuum X20 Pro',\n },\n ],\n },\n },\n}\n\nexport const FewAnchors: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'features',\n label: 'Features',\n },\n ],\n },\n },\n}\n\nexport const CustomBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: {\n link: '/cart/add/t2353111',\n text: 'Add to Cart',\n },\n },\n },\n}\n\nexport const MinimalNav: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n tabLinks: [\n {\n link: '/product',\n label: 'Product Name',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n ],\n buyBtn: {\n link: '/buy',\n text: 'Buy',\n },\n },\n },\n}\n\nexport const DarkTheme: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n theme: 'dark',\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#000', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n}\n\nexport const WithTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/specifications',\n text: 'View Specs',\n target: '_self' as const,\n },\n },\n },\n}\n\nexport const TextLinkNewWindow: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: 'https://support.example.com/guides',\n text: 'User Guide',\n target: '_blank' as const,\n },\n },\n },\n}\n\nexport const OnlyTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/more-info',\n text: 'More Info',\n target: '_self' as const,\n },\n buyBtn: undefined,\n },\n },\n}\n\nexport const WithoutTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: undefined,\n },\n },\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,cAAAC,EAAA,YAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,eAAAC,EAAA,iBAAAC,EAAA,cAAAC,EAAA,sBAAAC,EAAA,iBAAAC,EAAA,qBAAAC,EAAA,oBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAf,GAmBQ,IAAAgB,EAAA,6BAlBRC,EAAkB,iBAClBC,EAAuB,oDAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UACE,+HACJ,CACF,CACF,EACA,WAAY,CACVC,MACE,OAAC,OAAI,MAAO,CAAE,WAAY,MAAO,WAAY,UAAW,UAAW,MAAO,EACxE,mBAACA,EAAA,EAAM,EACT,CAEJ,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOP,EAAQK,EAGf,MAAMG,EAAW,CACf,SAAU,CACR,KAAM,cACN,KAAM,aACN,OAAQ,OACV,EACA,OAAQ,CACN,KAAM,qBACN,KAAM,SACR,EACA,SAAU,CACR,CACE,KAAM,oBACN,MAAO,uBACT,EACA,CACE,KAAM,oBACN,MAAO,uBACT,CACF,EACA,WAAY,CACV,CACE,GAAI,WACJ,MAAO,UACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,cACJ,MAAO,aACT,EACA,CACE,GAAI,eACJ,MAAO,cACT,C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K,EAAO,EAAG,EACzF,KAAM,CACJ,KAAM,CACJ,GAAGH,EACH,SAAU,CACR,KAAM,qCACN,KAAM,aACN,OAAQ,QACV,CACF,CACF,CACF,EAEad,EAAsB,CACjC,OAAQkB,MAAQ,OAACH,EAAA,CAAoB,GAAGG,EAAO,SAACD,MAAe,OAAC,EAAAL,QAAA,CAAY,GAAGK,EAAO,EAAG,EACzF,KAAM,CACJ,KAAM,CACJ,GAAGH,EACH,SAAU,CACR,KAAM,aACN,KAAM,YACN,OAAQ,OACV,EACA,OAAQ,MACV,CACF,CACF,EAEaT,EAAyB,CACpC,OAAQa,MAAQ,OAACH,EAAA,CAAoB,GAAGG,EAAO,SAACD,MAAe,OAAC,EAAAL,QAAA,CAAY,GAAGK,EAAO,EAAG,EACzF,KAAM,CACJ,KAAM,CACJ,GAAGH,EACH,SAAU,MACZ,CACF,CACF",
6
- "names": ["ProductNav_stories_exports", "__export", "CustomBuyButton", "DarkTheme", "Default", "FewAnchors", "ManyTabs", "MinimalNav", "OnlyTextLink", "SingleTab", "TextLinkNewWindow", "WithTextLink", "WithoutBuyButton", "WithoutTextLink", "ProductNav_stories_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_ProductNav", "meta", "ProductNav", "Story", "mockData", "InteractiveWrapper", "children", "props", "args"]
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport ProductNav from '../biz-components/ProductNav/index.js'\n\nconst meta = {\n title: 'Biz-Components/ProductNav',\n component: ProductNav,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component:\n 'Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons',\n },\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#f5f5f5', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n tags: ['autodocs'],\n} satisfies Meta<typeof ProductNav>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mockData = {\n textLink: {\n link: '/learn-more',\n text: 'Learn More',\n target: '_self' as const,\n },\n buyBtn: {\n link: '/products/t2353111',\n text: 'Buy Now',\n },\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'cleaning-power',\n label: 'Cleaning Power',\n },\n {\n id: 'smart-cleaning',\n label: 'Smart Cleaning',\n },\n {\n id: 'ease-of-use',\n label: 'Ease of Use',\n },\n {\n id: 'brand-equity',\n label: 'Brand Equity',\n },\n ],\n currentSku: 'T2353111,T2352111',\n}\n\n// Interactive wrapper component for stories\nconst InteractiveWrapper = ({ children, ...props }: any) => {\n return <div>{children({ ...props })}</div>\n}\n\nexport const Default: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: mockData,\n },\n}\n\nexport const WithoutBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: undefined,\n },\n },\n}\n\nexport const SingleTab: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n ],\n },\n },\n}\n\nexport const ManyTabs: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n {\n link: '/robot-vacuum-e30',\n label: 'Robot Vacuum Omni E30',\n },\n {\n link: '/robot-vacuum-x20',\n label: 'Robot Vacuum X20 Pro',\n },\n ],\n },\n },\n}\n\nexport const FewAnchors: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'features',\n label: 'Features',\n },\n ],\n },\n },\n}\n\nexport const CustomBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: {\n link: '/cart/add/t2353111',\n text: 'Add to Cart',\n },\n },\n },\n}\n\nexport const MinimalNav: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n tabLinks: [\n {\n link: '/product',\n label: 'Product Name',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n ],\n buyBtn: {\n link: '/buy',\n text: 'Buy',\n },\n },\n },\n}\n\nexport const DarkTheme: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n theme: 'dark',\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#000', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n}\n\nexport const WithTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/specifications',\n text: 'View Specs',\n target: '_self' as const,\n },\n },\n },\n}\n\nexport const TextLinkNewWindow: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: 'https://support.example.com/guides',\n text: 'User Guide',\n target: '_blank' as const,\n },\n },\n },\n}\n\nexport const OnlyTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/more-info',\n text: 'More Info',\n target: '_self' as const,\n },\n buyBtn: undefined,\n },\n },\n}\n\nexport const WithoutTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: undefined,\n },\n },\n}\n\nexport const WithScrollOffset: Story = {\n render: args => (\n <div>\n <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>\n {/* Mock anchor target sections */}\n <div id=\"overview\" style={{ height: '100vh', padding: '2em', background: '#f0f0f0' }}>\n <h2>Overview Section</h2>\n <p>This section demonstrates scroll offset functionality.</p>\n <p>Click the anchor links in the navigation to see smooth scrolling with offset.</p>\n </div>\n <div id=\"cleaning-power\" style={{ height: '100vh', padding: '2em', background: '#e0e0e0' }}>\n <h2>Cleaning Power Section</h2>\n <p>Content appears below the fixed navigation bar with proper offset.</p>\n </div>\n <div id=\"smart-cleaning\" style={{ height: '100vh', padding: '2em', background: '#d0d0d0' }}>\n <h2>Smart Cleaning Section</h2>\n <p>Extra offset ensures content is not hidden behind the navigation.</p>\n </div>\n <div id=\"ease-of-use\" style={{ height: '100vh', padding: '2em', background: '#c0c0c0' }}>\n <h2>Ease of Use Section</h2>\n <p>The navigation bar height is automatically calculated.</p>\n </div>\n <div id=\"brand-equity\" style={{ height: '100vh', padding: '2em', background: '#b0b0b0' }}>\n <h2>Brand Equity Section</h2>\n <p>Additional offset of 20px provides extra spacing.</p>\n </div>\n </div>\n ),\n args: {\n data: mockData,\n scrollOffsetExtra: 20, // \u989D\u5916\u504F\u79FB 20px\n },\n}\n\nexport const WithCustomAnchorClick: Story = {\n render: args => (\n <InteractiveWrapper {...args}>\n {(props: any) => (\n <ProductNav\n {...props}\n onAnchorClick={(item, index) => {\n alert(`Clicked: ${item.label} (index: ${index})`)\n // \u5728\u5B9E\u9645\u5E94\u7528\u4E2D\uFF0C\u8FD9\u91CC\u53EF\u4EE5\u6267\u884C\u57CB\u70B9\u3001\u81EA\u5B9A\u4E49\u8DEF\u7531\u8DF3\u8F6C\u7B49\u903B\u8F91\n }}\n />\n )}\n </InteractiveWrapper>\n ),\n args: {\n data: mockData,\n },\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,cAAAC,EAAA,YAAAC,EAAA,eAAAC,EAAA,aAAAC,EAAA,eAAAC,EAAA,iBAAAC,EAAA,cAAAC,EAAA,sBAAAC,EAAA,0BAAAC,EAAA,qBAAAC,EAAA,iBAAAC,EAAA,qBAAAC,EAAA,oBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAjB,GAmBQ,IAAAkB,EAAA,6BAlBRC,EAAkB,iBAClBC,EAAuB,oDAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAW,EAAAC,QACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UACE,+HACJ,CACF,CACF,EACA,WAAY,CACVC,MACE,OAAC,OAAI,MAAO,CAAE,WAAY,MAAO,WAAY,UAAW,UAAW,MAAO,EACxE,mBAACA,EAAA,EAAM,EACT,CAEJ,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOP,EAAQK,EAGf,MAAMG,EAAW,CACf,SAAU,CACR,KAAM,cACN,KAAM,aACN,OAAQ,OACV,EACA,OAAQ,CACN,KAAM,qBACN,KAAM,SACR,EACA,SAAU,CACR,CACE,KAAM,oBACN,MAAO,uBACT,EACA,CACE,KAAM,oBACN,MAAO,uBACT,CACF,EACA,WAAY,CACV,CACE,GAAI,WACJ,MAAO,UACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,cACJ,MAAO,aACT,EACA,CACE,GAAI,eACJ,MAAO,cACT,CACF,EACA,WAAY,mBACd,EAGMC,EA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,GAC3D,KACA,QAAC,OAAI,GAAG,eAAe,MAAO,CAAE,OAAQ,QAAS,QAAS,MAAO,WAAY,SAAU,EACrF,oBAAC,MAAG,gCAAoB,KACxB,OAAC,KAAE,6DAAiD,GACtD,GACF,EAEF,KAAM,CACJ,KAAMH,EACN,kBAAmB,EACrB,CACF,EAEab,EAA+B,CAC1C,OAAQiB,MACN,OAACH,EAAA,CAAoB,GAAGG,EACrB,SAACD,MACA,OAAC,EAAAL,QAAA,CACE,GAAGK,EACJ,cAAe,CAACE,EAAMC,IAAU,CAC9B,MAAM,YAAYD,EAAK,KAAK,YAAYC,CAAK,GAAG,CAElD,EACF,EAEJ,EAEF,KAAM,CACJ,KAAMN,CACR,CACF",
6
+ "names": ["ProductNav_stories_exports", "__export", "CustomBuyButton", "DarkTheme", "Default", "FewAnchors", "ManyTabs", "MinimalNav", "OnlyTextLink", "SingleTab", "TextLinkNewWindow", "WithCustomAnchorClick", "WithScrollOffset", "WithTextLink", "WithoutBuyButton", "WithoutTextLink", "ProductNav_stories_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_ProductNav", "meta", "ProductNav", "Story", "mockData", "InteractiveWrapper", "children", "props", "args", "item", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as T,useEffect as u,forwardRef as L,useImperativeHandle as P,useRef as C}from"react";import{cn as c}from"../../helpers/utils.js";import{withLayout as S}from"../../shared/Styles.js";import{Button as v,Text as x}from"../../components/index.js";import{useExposure as H}from"../../hooks/useExposure.js";import*as m from"@radix-ui/react-popover";const M="navigation",D="product_nav",R=l=>t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:t("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),h=L(({className:l="",data:f,id:k},g)=>{const{tabLinks:p=[],anchorList:w=[],textLink:n,buyBtn:s,theme:b="light"}=f||{},[y,N]=T(""),i=C(null);P(g,()=>i.current),H(i,{componentType:M,componentName:D}),u(()=>{const e=()=>{N(window.location.hash)};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]),u(()=>{const e=document.querySelectorAll(".header"),o=[];return e.forEach(d=>{const r=d;o.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{o.forEach(({element:d,originalPosition:r})=>{d.style.position=r==="static"?"":r})}},[]);const E=e=>{e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})};return a("div",{id:k,ref:i,className:c("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":b==="dark"},l),children:[a("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[a("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[a("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[p.map((e,o)=>a("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[t("a",{href:e.link,className:c("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:t("span",{children:e.label})}),o!==p.length-1&&t("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||o)),p.length>1&&a(m.Root,{children:[t(m.Trigger,{asChild:!0,children:t("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:t(R,{className:"text-[#1D1D1F]"})})}),t(m.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:p.slice(1).map(e=>t("a",{href:e.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:t("span",{children:e.label})},e.link))})]})]}),a("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[n?.link&&t("a",{href:n.link,target:n.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:t(x,{size:2,className:"text-nowrap",children:n.text})}),s?.link&&t(v,{as:"a",href:s.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]}),t("div",{className:"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]",children:w.map(e=>a("a",{href:`#${e.id}`,className:"product-nav-anchor-link",onClick:o=>{E(o)},children:[t(x,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),t("div",{className:c("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"bg-brand-color":y===`#${e.id}`})})]},e.id))})]}),a("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[n?.link&&t("a",{href:n.link,target:n.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:t(x,{size:2,className:"text-nowrap",children:n.text})}),s?.link&&t(v,{as:"a",href:s.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:s.text})]})]})});h.displayName="ProductNav";var I=S(h);export{I as default};
1
+ "use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{useState as S,useEffect as f,forwardRef as C,useImperativeHandle as D,useRef as H}from"react";import{cn as c}from"../../helpers/utils.js";import{withLayout as M}from"../../shared/Styles.js";import{Button as h,Text as m}from"../../components/index.js";import{useExposure as R}from"../../hooks/useExposure.js";import*as u from"@radix-ui/react-popover";const B="navigation",z="product_nav",$=d=>t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d,children:t("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),g=C(({className:d="",data:w,id:k,onAnchorClick:x,scrollOffsetExtra:b=0},y)=>{const{tabLinks:l=[],anchorList:N=[],textLink:s,buyBtn:p,theme:E="light"}=w||{},[T,v]=S(""),i=H(null);D(y,()=>i.current),R(i,{componentType:B,componentName:z}),f(()=>{const e=()=>{v(window.location.hash)};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]),f(()=>{const e=document.querySelectorAll(".header"),o=[];return e.forEach(n=>{const a=n;o.push({element:a,originalPosition:a.style.position||getComputedStyle(a).position}),a.style.position="relative"}),()=>{o.forEach(({element:n,originalPosition:a})=>{n.style.position=a==="static"?"":a})}},[]);const P=(e,o)=>{e.preventDefault();const n=document.getElementById(o);if(!n){console.warn(`Target element with id "${o}" not found`);return}const a=i.current?.offsetHeight||0,L=n.getBoundingClientRect().top+window.scrollY-a-b;window.scrollTo({top:L,behavior:"smooth"}),window.history.pushState(null,"",`#${o}`),v(`#${o}`)};return r("div",{id:k,ref:i,className:c("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":E==="dark"},d),children:[r("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[r("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[r("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[l.map((e,o)=>r("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[t("a",{href:e.link,className:c("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:t("span",{children:e.label})}),o!==l.length-1&&t("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||o)),l.length>1&&r(u.Root,{children:[t(u.Trigger,{asChild:!0,children:t("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:t($,{className:"text-[#1D1D1F]"})})}),t(u.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:l.slice(1).map(e=>t("a",{href:e.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:t("span",{children:e.label})},e.link))})]})]}),r("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[s?.link&&t("a",{href:s.link,target:s.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:t(m,{size:2,className:"text-nowrap",children:s.text})}),p?.link&&t(h,{as:"a",href:p.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:p.text})]})]}),t("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:N.map((e,o)=>r("a",{href:`#${e.id}`,className:"product-nav-anchor-link",onClick:n=>{x?(n.preventDefault(),x(e,o)):P(n,e.id)},children:[t(m,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),t("div",{className:c("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":T===`#${e.id}`})})]},e.id))})]}),r("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[s?.link&&t("a",{href:s.link,target:s.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer text-black",children:t(m,{size:2,className:"text-nowrap",children:s.text})}),p?.link&&t(h,{as:"a",href:p.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:p.text})]})]})});g.displayName="ProductNav";var O=M(g);export{O as default};
2
2
  //# sourceMappingURL=ProductNav.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductNav/ProductNav.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(({ className = '', data, id }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent) => {\n const target = e.target as HTMLElement\n target.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n })\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors hide-scrollbar laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px]\">\n {anchorList.map(anchor => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n handleAnchorClick(e)\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n 'bg-brand-color': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n})\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
- "mappings": "aAeM,cAAAA,EAuFU,QAAAC,MAvFV,oBAdN,OAAS,YAAAC,EAAU,aAAAC,EAAW,cAAAC,EAAY,uBAAAC,EAAqB,UAAAC,MAAc,QAC7E,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,y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out", "Button", "Text", "useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "headerElements", "originalStyles", "element", "htmlElement", "originalPosition", "handleAnchorClick", "tabLink", "index", "anchor", "e", "ProductNav_default"]
4
+ "sourcesContent": ["'use client'\nimport { useState, useEffect, forwardRef, useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Button, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductNavProps } from './types.js'\nimport * as Popover from '@radix-ui/react-popover'\n\nconst componentType = 'navigation'\nconst componentName = 'product_nav'\n\nconst ChevronDownIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path\n d=\"M5 7.5L10 12.5L15 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nconst ProductNav = forwardRef<HTMLDivElement, ProductNavProps>(\n ({ className = '', data, id, onAnchorClick, scrollOffsetExtra = 0 }, ref) => {\n const { tabLinks = [], anchorList = [], textLink, buyBtn, theme = 'light' } = data || {}\n const [hash, setHash] = useState('')\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n })\n\n // \u76D1\u542Chash\u53D8\u5316\n useEffect(() => {\n const handleHashChange = () => {\n setHash(window.location.hash)\n }\n handleHashChange()\n window.addEventListener('hashchange', handleHashChange)\n return () => {\n window.removeEventListener('hashchange', handleHashChange)\n }\n }, [])\n\n // \u8BBE\u7F6E\u9875\u9762\u4E2Dheader\u5143\u7D20\u7684position\u4E3Arelative\n useEffect(() => {\n const headerElements = document.querySelectorAll('.header')\n const originalStyles: { element: HTMLElement; originalPosition: string }[] = []\n\n headerElements.forEach(element => {\n const htmlElement = element as HTMLElement\n // \u4FDD\u5B58\u539F\u59CB\u6837\u5F0F\n originalStyles.push({\n element: htmlElement,\n originalPosition: htmlElement.style.position || getComputedStyle(htmlElement).position,\n })\n // \u8BBE\u7F6E\u4E3Arelative\n htmlElement.style.position = 'relative'\n })\n\n // \u6E05\u7406\u51FD\u6570\uFF1A\u6062\u590D\u539F\u59CB\u6837\u5F0F\n return () => {\n originalStyles.forEach(({ element, originalPosition }) => {\n element.style.position = originalPosition === 'static' ? '' : originalPosition\n })\n }\n }, [])\n\n // \u5904\u7406\u951A\u70B9\u70B9\u51FB\u6EDA\u52A8\n const handleAnchorClick = (e: React.MouseEvent, anchorId: string) => {\n e.preventDefault()\n\n // \u83B7\u53D6\u76EE\u6807\u5143\u7D20\n const targetElement = document.getElementById(anchorId)\n if (!targetElement) {\n console.warn(`Target element with id \"${anchorId}\" not found`)\n return\n }\n\n // \u83B7\u53D6\u5BFC\u822A\u680F\u9AD8\u5EA6\n const navHeight = innerRef.current?.offsetHeight || 0\n\n // \u8BA1\u7B97\u76EE\u6807\u4F4D\u7F6E\uFF08\u76EE\u6807\u5143\u7D20\u7684\u4F4D\u7F6E - \u5BFC\u822A\u680F\u9AD8\u5EA6 - \u989D\u5916\u504F\u79FB\uFF09\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight - scrollOffsetExtra\n\n // \u5E73\u6ED1\u6EDA\u52A8\u5230\u76EE\u6807\u4F4D\u7F6E\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n\n // \u66F4\u65B0 URL hash\uFF08\u4E0D\u89E6\u53D1\u9875\u9762\u8DF3\u8F6C\uFF09\n window.history.pushState(null, '', `#${anchorId}`)\n\n // \u624B\u52A8\u66F4\u65B0\u7EC4\u4EF6\u5185\u90E8\u7684 hash \u72B6\u6001\n setHash(`#${anchorId}`)\n }\n\n return (\n <div\n id={id}\n ref={innerRef}\n className={cn(\n 'product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className\n )}\n >\n <div className=\"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start\">\n {/* Tab Links Section */}\n <div className=\"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]\">\n <div className=\"product-nav-tabs flex flex-row items-center gap-[8px]\">\n {tabLinks.map((tabLink, index) => {\n return (\n <div key={tabLink.link || index} className=\"product-nav-tab-item flex items-center gap-[8px]\">\n <a\n href={tabLink.link}\n className={cn(\n 'product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]',\n {\n 'text-[#6D6D6F]': index !== 0,\n 'hidden desktop:block': index === 1,\n }\n )}\n // onClick={() => onShowSpecs?.(false)}\n >\n <span>{tabLink.label}</span>\n </a>\n {index !== tabLinks.length - 1 && (\n <div className=\"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]\" />\n )}\n </div>\n )\n })}\n\n {/* Mobile Dropdown */}\n {tabLinks.length > 1 && (\n <Popover.Root>\n <Popover.Trigger asChild>\n <button\n className=\"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block\"\n aria-label=\"More products\"\n >\n <ChevronDownIcon className=\"text-[#1D1D1F]\" />\n </button>\n </Popover.Trigger>\n <Popover.Content\n className=\"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]\"\n style={{\n boxShadow: '0px 4px 8px 0px rgba(0,0,0,0.12)',\n }}\n side=\"bottom\"\n align=\"end\"\n alignOffset={10}\n sideOffset={10}\n >\n {tabLinks.slice(1).map(tabLink => (\n <a\n key={tabLink.link}\n href={tabLink.link}\n className=\"product-nav-dropdown-link hover:text-brand-color text-nowrap\"\n >\n <span>{tabLink.label}</span>\n </a>\n ))}\n </Popover.Content>\n </Popover.Root>\n )}\n </div>\n\n {/* Mobile Actions */}\n <div className=\"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n\n {/* Anchor Navigation */}\n <div className=\"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {anchorList.map((anchor, index) => (\n <a\n key={anchor.id}\n href={`#${anchor.id}`}\n className=\"product-nav-anchor-link\"\n onClick={e => {\n // \u5982\u679C\u63D0\u4F9B\u4E86\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6,\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\u5E76\u963B\u6B62\u9ED8\u8BA4\u884C\u4E3A\n if (onAnchorClick) {\n e.preventDefault()\n onAnchorClick(anchor, index)\n } else {\n // \u4F7F\u7528\u9ED8\u8BA4\u7684\u951A\u70B9\u6EDA\u52A8\u884C\u4E3A\uFF0C\u5E26\u504F\u79FB\u91CF\n handleAnchorClick(e, anchor.id)\n }\n }}\n >\n <Text size={2} className=\"product-nav-anchor-text text-nowrap\">\n {anchor.label}\n </Text>\n <div\n className={cn(\n 'product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent',\n {\n '!bg-brand-0': hash === `#${anchor.id}`,\n }\n )}\n />\n </a>\n ))}\n </div>\n </div>\n\n {/* Desktop Actions */}\n <div className=\"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]\">\n {/* {specs?.text && (\n <Text\n size={2}\n onClick={handleSpecsClick}\n className=\"product-nav-specs-button cursor-pointer text-black hover:text-brand-color\"\n >\n {specs.text}\n </Text>\n )} */}\n {textLink?.link && (\n <a\n href={textLink.link}\n target={textLink.target || '_self'}\n className=\"product-nav-text-link hover:text-brand-color cursor-pointer text-black\"\n >\n <Text size={2} className=\"text-nowrap\">\n {textLink.text}\n </Text>\n </a>\n )}\n {buyBtn?.link && (\n <Button as=\"a\" href={buyBtn.link} size=\"sm\" className=\"product-nav-buy-button text-nowrap\">\n {buyBtn.text}\n </Button>\n )}\n </div>\n </div>\n )\n }\n)\n\nProductNav.displayName = 'ProductNav'\n\nexport default withLayout(ProductNav)\n"],
5
+ "mappings": "aAeM,cAAAA,EA4GY,QAAAC,MA5GZ,oBAdN,OAAS,YAAAC,EAAU,aAAAC,EAAW,cAAAC,EAAY,uBAAAC,EAAqB,UAAAC,MAAc,QAC7E,OAAS,MAAAC,MAAU,yBACnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,UAAAC,EAAQ,QAAAC,MAAY,4BAC7B,OAAS,eAAAC,MAAmB,6BAE5B,UAAYC,MAAa,0BAEzB,MAAMC,EAAgB,aAChBC,EAAgB,cAEhBC,EAAmBC,GAErBhB,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGgB,EACjG,SAAAhB,EAAC,QACC,EAAE,wBACF,OAAO,eACP,YAAY,UACZ,cAAc,QACd,eAAe,QACjB,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AEJ,CACF,EAEAV,EAAW,YAAc,aAEzB,IAAO8B,EAAQvC,EAAWS,CAAU",
6
+ "names": ["jsx", "jsxs", "useState", "useEffect", "forwardRef", "useImperativeHandle", "useRef", "cn", "withLayout", "Button", "Text", "useExposure", "Popover", "componentType", "componentName", "ChevronDownIcon", "props", "ProductNav", "className", "data", "id", "onAnchorClick", "scrollOffsetExtra", "ref", "tabLinks", "anchorList", "textLink", "buyBtn", "theme", "hash", "setHash", "innerRef", "handleHashChange", "headerElements", "originalStyles", "element", "htmlElement", "originalPosition", "handleAnchorClick", "anchorId", "targetElement", "navHeight", "targetPosition", "tabLink", "index", "anchor", "e", "ProductNav_default"]
7
7
  }
@@ -32,4 +32,8 @@ export interface ProductNavProps extends ComponentCommonProps {
32
32
  /** 主题,默认 light */
33
33
  theme?: Theme;
34
34
  };
35
+ /** 锚点点击事件,传入时将忽略默认的锚点跳转行为 */
36
+ onAnchorClick?: (item: AnchorItem, index: number) => void;
37
+ /** 锚点滚动额外偏移量(像素),会在导航栏高度基础上额外偏移,默认为 0 */
38
+ scrollOffsetExtra?: number;
35
39
  }
@@ -35,6 +35,8 @@ declare const meta: {
35
35
  wrapperClassName?: string | undefined;
36
36
  event?: any;
37
37
  condition?: any;
38
+ onAnchorClick?: ((item: import("../biz-components/index.js").AnchorItem, index: number) => void) | undefined;
39
+ scrollOffsetExtra?: number | undefined;
38
40
  ref?: React.LegacyRef<any> | undefined;
39
41
  }>) => import("react/jsx-runtime").JSX.Element)[];
40
42
  tags: string[];
@@ -53,3 +55,5 @@ export declare const WithTextLink: Story;
53
55
  export declare const TextLinkNewWindow: Story;
54
56
  export declare const OnlyTextLink: Story;
55
57
  export declare const WithoutTextLink: Story;
58
+ export declare const WithScrollOffset: Story;
59
+ export declare const WithCustomAnchorClick: Story;
@@ -1,2 +1,2 @@
1
- import{jsx as e}from"react/jsx-runtime";import"react";import r from"../biz-components/ProductNav/index.js";const i={title:"Biz-Components/ProductNav",component:r,parameters:{layout:"fullscreen",docs:{description:{component:"Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons"}}},decorators:[t=>e("div",{style:{paddingTop:"2em",background:"#f5f5f5",minHeight:"50vh"},children:e(t,{})})],tags:["autodocs"]};var u=i;const o={textLink:{link:"/learn-more",text:"Learn More",target:"_self"},buyBtn:{link:"/products/t2353111",text:"Buy Now"},tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"}],anchorList:[{id:"overview",label:"Overview"},{id:"cleaning-power",label:"Cleaning Power"},{id:"smart-cleaning",label:"Smart Cleaning"},{id:"ease-of-use",label:"Ease of Use"},{id:"brand-equity",label:"Brand Equity"}],currentSku:"T2353111,T2352111"},n=({children:t,...a})=>e("div",{children:t({...a})}),l={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:o}},p={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,buyBtn:void 0}}},b={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"}]}}},y={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"},{link:"/robot-vacuum-e30",label:"Robot Vacuum Omni E30"},{link:"/robot-vacuum-x20",label:"Robot Vacuum X20 Pro"}]}}},m={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,anchorList:[{id:"overview",label:"Overview"},{id:"features",label:"Features"}]}}},v={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,buyBtn:{link:"/cart/add/t2353111",text:"Add to Cart"}}}},k={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{tabLinks:[{link:"/product",label:"Product Name"}],anchorList:[{id:"overview",label:"Overview"}],buyBtn:{link:"/buy",text:"Buy"}}}},g={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,theme:"dark"}},decorators:[t=>e("div",{style:{paddingTop:"2em",background:"#000",minHeight:"50vh"},children:e(t,{})})]},x={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"/specifications",text:"View Specs",target:"_self"}}}},f={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"https://support.example.com/guides",text:"User Guide",target:"_blank"}}}},S={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"/more-info",text:"More Info",target:"_self"},buyBtn:void 0}}},L={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:void 0}}};export{v as CustomBuyButton,g as DarkTheme,l as Default,m as FewAnchors,y as ManyTabs,k as MinimalNav,S as OnlyTextLink,b as SingleTab,f as TextLinkNewWindow,x as WithTextLink,p as WithoutBuyButton,L as WithoutTextLink,u as default};
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import"react";import r from"../biz-components/ProductNav/index.js";const c={title:"Biz-Components/ProductNav",component:r,parameters:{layout:"fullscreen",docs:{description:{component:"Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons"}}},decorators:[t=>e("div",{style:{paddingTop:"2em",background:"#f5f5f5",minHeight:"50vh"},children:e(t,{})})],tags:["autodocs"]};var v=c;const o={textLink:{link:"/learn-more",text:"Learn More",target:"_self"},buyBtn:{link:"/products/t2353111",text:"Buy Now"},tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"}],anchorList:[{id:"overview",label:"Overview"},{id:"cleaning-power",label:"Cleaning Power"},{id:"smart-cleaning",label:"Smart Cleaning"},{id:"ease-of-use",label:"Ease of Use"},{id:"brand-equity",label:"Brand Equity"}],currentSku:"T2353111,T2352111"},n=({children:t,...a})=>e("div",{children:t({...a})}),b={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:o}},y={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,buyBtn:void 0}}},g={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"}]}}},m={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,tabLinks:[{link:"/robot-vacuum-e25",label:"Robot Vacuum Omni E25"},{link:"/robot-vacuum-e28",label:"Robot Vacuum Omni E28"},{link:"/robot-vacuum-e30",label:"Robot Vacuum Omni E30"},{link:"/robot-vacuum-x20",label:"Robot Vacuum X20 Pro"}]}}},h={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,anchorList:[{id:"overview",label:"Overview"},{id:"features",label:"Features"}]}}},f={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,buyBtn:{link:"/cart/add/t2353111",text:"Add to Cart"}}}},k={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{tabLinks:[{link:"/product",label:"Product Name"}],anchorList:[{id:"overview",label:"Overview"}],buyBtn:{link:"/buy",text:"Buy"}}}},x={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,theme:"dark"}},decorators:[t=>e("div",{style:{paddingTop:"2em",background:"#000",minHeight:"50vh"},children:e(t,{})})]},S={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"/specifications",text:"View Specs",target:"_self"}}}},w={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"https://support.example.com/guides",text:"User Guide",target:"_blank"}}}},W={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:{link:"/more-info",text:"More Info",target:"_self"},buyBtn:void 0}}},L={render:t=>e(n,{...t,children:a=>e(r,{...a})}),args:{data:{...o,textLink:void 0}}},I={render:t=>i("div",{children:[e(n,{...t,children:a=>e(r,{...a})}),i("div",{id:"overview",style:{height:"100vh",padding:"2em",background:"#f0f0f0"},children:[e("h2",{children:"Overview Section"}),e("p",{children:"This section demonstrates scroll offset functionality."}),e("p",{children:"Click the anchor links in the navigation to see smooth scrolling with offset."})]}),i("div",{id:"cleaning-power",style:{height:"100vh",padding:"2em",background:"#e0e0e0"},children:[e("h2",{children:"Cleaning Power Section"}),e("p",{children:"Content appears below the fixed navigation bar with proper offset."})]}),i("div",{id:"smart-cleaning",style:{height:"100vh",padding:"2em",background:"#d0d0d0"},children:[e("h2",{children:"Smart Cleaning Section"}),e("p",{children:"Extra offset ensures content is not hidden behind the navigation."})]}),i("div",{id:"ease-of-use",style:{height:"100vh",padding:"2em",background:"#c0c0c0"},children:[e("h2",{children:"Ease of Use Section"}),e("p",{children:"The navigation bar height is automatically calculated."})]}),i("div",{id:"brand-equity",style:{height:"100vh",padding:"2em",background:"#b0b0b0"},children:[e("h2",{children:"Brand Equity Section"}),e("p",{children:"Additional offset of 20px provides extra spacing."})]})]}),args:{data:o,scrollOffsetExtra:20}},O={render:t=>e(n,{...t,children:a=>e(r,{...a,onAnchorClick:(d,s)=>{alert(`Clicked: ${d.label} (index: ${s})`)}})}),args:{data:o}};export{f as CustomBuyButton,x as DarkTheme,b as Default,h as FewAnchors,m as ManyTabs,k as MinimalNav,W as OnlyTextLink,g as SingleTab,w as TextLinkNewWindow,O as WithCustomAnchorClick,I as WithScrollOffset,S as WithTextLink,y as WithoutBuyButton,L as WithoutTextLink,v as default};
2
2
  //# sourceMappingURL=ProductNav.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/ProductNav.stories.tsx"],
4
- "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport ProductNav from '../biz-components/ProductNav/index.js'\n\nconst meta = {\n title: 'Biz-Components/ProductNav',\n component: ProductNav,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component:\n 'Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons',\n },\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#f5f5f5', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n tags: ['autodocs'],\n} satisfies Meta<typeof ProductNav>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mockData = {\n textLink: {\n link: '/learn-more',\n text: 'Learn More',\n target: '_self' as const,\n },\n buyBtn: {\n link: '/products/t2353111',\n text: 'Buy Now',\n },\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'cleaning-power',\n label: 'Cleaning Power',\n },\n {\n id: 'smart-cleaning',\n label: 'Smart Cleaning',\n },\n {\n id: 'ease-of-use',\n label: 'Ease of Use',\n },\n {\n id: 'brand-equity',\n label: 'Brand Equity',\n },\n ],\n currentSku: 'T2353111,T2352111',\n}\n\n// Interactive wrapper component for stories\nconst InteractiveWrapper = ({ children, ...props }: any) => {\n return <div>{children({ ...props })}</div>\n}\n\nexport const Default: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: mockData,\n },\n}\n\nexport const WithoutBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: undefined,\n },\n },\n}\n\nexport const SingleTab: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n ],\n },\n },\n}\n\nexport const ManyTabs: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n {\n link: '/robot-vacuum-e30',\n label: 'Robot Vacuum Omni E30',\n },\n {\n link: '/robot-vacuum-x20',\n label: 'Robot Vacuum X20 Pro',\n },\n ],\n },\n },\n}\n\nexport const FewAnchors: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'features',\n label: 'Features',\n },\n ],\n },\n },\n}\n\nexport const CustomBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: {\n link: '/cart/add/t2353111',\n text: 'Add to Cart',\n },\n },\n },\n}\n\nexport const MinimalNav: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n tabLinks: [\n {\n link: '/product',\n label: 'Product Name',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n ],\n buyBtn: {\n link: '/buy',\n text: 'Buy',\n },\n },\n },\n}\n\nexport const DarkTheme: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n theme: 'dark',\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#000', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n}\n\nexport const WithTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/specifications',\n text: 'View Specs',\n target: '_self' as const,\n },\n },\n },\n}\n\nexport const TextLinkNewWindow: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: 'https://support.example.com/guides',\n text: 'User Guide',\n target: '_blank' as const,\n },\n },\n },\n}\n\nexport const OnlyTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/more-info',\n text: 'More Info',\n target: '_self' as const,\n },\n buyBtn: undefined,\n },\n },\n}\n\nexport const WithoutTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: undefined,\n },\n },\n}\n"],
5
- "mappings": "AAmBQ,cAAAA,MAAA,oBAlBR,MAAkB,QAClB,OAAOC,MAAgB,wCAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAWD,EACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UACE,+HACJ,CACF,CACF,EACA,WAAY,CACVE,GACEH,EAAC,OAAI,MAAO,CAAE,WAAY,MAAO,WAAY,UAAW,UAAW,MAAO,EACxE,SAAAA,EAACG,EAAA,EAAM,EACT,CAEJ,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOC,EAAQF,EAGf,MAAMG,EAAW,CACf,SAAU,CACR,KAAM,cACN,KAAM,aACN,OAAQ,OACV,EACA,OAAQ,CACN,KAAM,qBACN,KAAM,SACR,EACA,SAAU,CACR,CACE,KAAM,oBACN,MAAO,uBACT,EACA,CACE,KAAM,oBACN,MAAO,uBACT,CACF,EACA,WAAY,CACV,CACE,GAAI,WACJ,MAAO,UACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,cACJ,MAAO,aACT,EACA,CACE,GAAI,eACJ,MA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ACH,SAAU,CACR,KAAM,qCACN,KAAM,aACN,OAAQ,QACV,CACF,CACF,CACF,EAEae,EAAsB,CACjC,OAAQV,GAAQV,EAACM,EAAA,CAAoB,GAAGI,EAAO,SAACF,GAAeR,EAACC,EAAA,CAAY,GAAGO,EAAO,EAAG,EACzF,KAAM,CACJ,KAAM,CACJ,GAAGH,EACH,SAAU,CACR,KAAM,aACN,KAAM,YACN,OAAQ,OACV,EACA,OAAQ,MACV,CACF,CACF,EAEagB,EAAyB,CACpC,OAAQX,GAAQV,EAACM,EAAA,CAAoB,GAAGI,EAAO,SAACF,GAAeR,EAACC,EAAA,CAAY,GAAGO,EAAO,EAAG,EACzF,KAAM,CACJ,KAAM,CACJ,GAAGH,EACH,SAAU,MACZ,CACF,CACF",
6
- "names": ["jsx", "ProductNav", "meta", "Story", "ProductNav_stories_default", "mockData", "InteractiveWrapper", "children", "props", "Default", "args", "WithoutBuyButton", "SingleTab", "ManyTabs", "FewAnchors", "CustomBuyButton", "MinimalNav", "DarkTheme", "WithTextLink", "TextLinkNewWindow", "OnlyTextLink", "WithoutTextLink"]
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport React from 'react'\nimport ProductNav from '../biz-components/ProductNav/index.js'\n\nconst meta = {\n title: 'Biz-Components/ProductNav',\n component: ProductNav,\n parameters: {\n layout: 'fullscreen',\n docs: {\n description: {\n component:\n 'Product Navigation component - A versatile navigation component for product pages with tab links, anchors, and action buttons',\n },\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#f5f5f5', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n tags: ['autodocs'],\n} satisfies Meta<typeof ProductNav>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nconst mockData = {\n textLink: {\n link: '/learn-more',\n text: 'Learn More',\n target: '_self' as const,\n },\n buyBtn: {\n link: '/products/t2353111',\n text: 'Buy Now',\n },\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'cleaning-power',\n label: 'Cleaning Power',\n },\n {\n id: 'smart-cleaning',\n label: 'Smart Cleaning',\n },\n {\n id: 'ease-of-use',\n label: 'Ease of Use',\n },\n {\n id: 'brand-equity',\n label: 'Brand Equity',\n },\n ],\n currentSku: 'T2353111,T2352111',\n}\n\n// Interactive wrapper component for stories\nconst InteractiveWrapper = ({ children, ...props }: any) => {\n return <div>{children({ ...props })}</div>\n}\n\nexport const Default: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: mockData,\n },\n}\n\nexport const WithoutBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: undefined,\n },\n },\n}\n\nexport const SingleTab: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n ],\n },\n },\n}\n\nexport const ManyTabs: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n tabLinks: [\n {\n link: '/robot-vacuum-e25',\n label: 'Robot Vacuum Omni E25',\n },\n {\n link: '/robot-vacuum-e28',\n label: 'Robot Vacuum Omni E28',\n },\n {\n link: '/robot-vacuum-e30',\n label: 'Robot Vacuum Omni E30',\n },\n {\n link: '/robot-vacuum-x20',\n label: 'Robot Vacuum X20 Pro',\n },\n ],\n },\n },\n}\n\nexport const FewAnchors: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n {\n id: 'features',\n label: 'Features',\n },\n ],\n },\n },\n}\n\nexport const CustomBuyButton: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n buyBtn: {\n link: '/cart/add/t2353111',\n text: 'Add to Cart',\n },\n },\n },\n}\n\nexport const MinimalNav: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n tabLinks: [\n {\n link: '/product',\n label: 'Product Name',\n },\n ],\n anchorList: [\n {\n id: 'overview',\n label: 'Overview',\n },\n ],\n buyBtn: {\n link: '/buy',\n text: 'Buy',\n },\n },\n },\n}\n\nexport const DarkTheme: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n theme: 'dark',\n },\n },\n decorators: [\n Story => (\n <div style={{ paddingTop: '2em', background: '#000', minHeight: '50vh' }}>\n <Story />\n </div>\n ),\n ],\n}\n\nexport const WithTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/specifications',\n text: 'View Specs',\n target: '_self' as const,\n },\n },\n },\n}\n\nexport const TextLinkNewWindow: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: 'https://support.example.com/guides',\n text: 'User Guide',\n target: '_blank' as const,\n },\n },\n },\n}\n\nexport const OnlyTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: {\n link: '/more-info',\n text: 'More Info',\n target: '_self' as const,\n },\n buyBtn: undefined,\n },\n },\n}\n\nexport const WithoutTextLink: Story = {\n render: args => <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>,\n args: {\n data: {\n ...mockData,\n textLink: undefined,\n },\n },\n}\n\nexport const WithScrollOffset: Story = {\n render: args => (\n <div>\n <InteractiveWrapper {...args}>{(props: any) => <ProductNav {...props} />}</InteractiveWrapper>\n {/* Mock anchor target sections */}\n <div id=\"overview\" style={{ height: '100vh', padding: '2em', background: '#f0f0f0' }}>\n <h2>Overview Section</h2>\n <p>This section demonstrates scroll offset functionality.</p>\n <p>Click the anchor links in the navigation to see smooth scrolling with offset.</p>\n </div>\n <div id=\"cleaning-power\" style={{ height: '100vh', padding: '2em', background: '#e0e0e0' }}>\n <h2>Cleaning Power Section</h2>\n <p>Content appears below the fixed navigation bar with proper offset.</p>\n </div>\n <div id=\"smart-cleaning\" style={{ height: '100vh', padding: '2em', background: '#d0d0d0' }}>\n <h2>Smart Cleaning Section</h2>\n <p>Extra offset ensures content is not hidden behind the navigation.</p>\n </div>\n <div id=\"ease-of-use\" style={{ height: '100vh', padding: '2em', background: '#c0c0c0' }}>\n <h2>Ease of Use Section</h2>\n <p>The navigation bar height is automatically calculated.</p>\n </div>\n <div id=\"brand-equity\" style={{ height: '100vh', padding: '2em', background: '#b0b0b0' }}>\n <h2>Brand Equity Section</h2>\n <p>Additional offset of 20px provides extra spacing.</p>\n </div>\n </div>\n ),\n args: {\n data: mockData,\n scrollOffsetExtra: 20, // \u989D\u5916\u504F\u79FB 20px\n },\n}\n\nexport const WithCustomAnchorClick: Story = {\n render: args => (\n <InteractiveWrapper {...args}>\n {(props: any) => (\n <ProductNav\n {...props}\n onAnchorClick={(item, index) => {\n alert(`Clicked: ${item.label} (index: ${index})`)\n // \u5728\u5B9E\u9645\u5E94\u7528\u4E2D\uFF0C\u8FD9\u91CC\u53EF\u4EE5\u6267\u884C\u57CB\u70B9\u3001\u81EA\u5B9A\u4E49\u8DEF\u7531\u8DF3\u8F6C\u7B49\u903B\u8F91\n }}\n />\n )}\n </InteractiveWrapper>\n ),\n args: {\n data: mockData,\n },\n}\n"],
5
+ "mappings": "AAmBQ,cAAAA,EA0PF,QAAAC,MA1PE,oBAlBR,MAAkB,QAClB,OAAOC,MAAgB,wCAEvB,MAAMC,EAAO,CACX,MAAO,4BACP,UAAWD,EACX,WAAY,CACV,OAAQ,aACR,KAAM,CACJ,YAAa,CACX,UACE,+HACJ,CACF,CACF,EACA,WAAY,CACVE,GACEJ,EAAC,OAAI,MAAO,CAAE,WAAY,MAAO,WAAY,UAAW,UAAW,MAAO,EACxE,SAAAA,EAACI,EAAA,EAAM,EACT,CAEJ,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOC,EAAQF,EAGf,MAAMG,EAAW,CACf,SAAU,CACR,KAAM,cACN,KAAM,aACN,OAAQ,OACV,EACA,OAAQ,CACN,KAAM,qBACN,KAAM,SACR,EACA,SAAU,CACR,CACE,KAAM,oBACN,MAAO,uBACT,EACA,CACE,KAAM,oBACN,MAAO,uBACT,CACF,EACA,WAAY,CACV,CACE,GAAI,WACJ,MAAO,UACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,iBACJ,MAAO,gBACT,EACA,CACE,GAAI,cACJ,MAAO,aACT,EACA,CACE,GAAI,eACJ,MAAO,cACT,CACF,EACA,WAAY,mBACd,EAGMC,EAAqB,CAAC,CAAE,SAAAC,EAAU,GAAGC,CAAM,IACxCT,EAAC,OAAK,SAAAQ,EAAS,CAAE,GAAGC,CAAM,CAAC,EAAE,EAGzBC,EAAiB,CAC5B,OAAQC,GAAQX,EAACO,EAAA,CAAoB,GAAGI,EAAO,SAACF,GAAeT,EAACE,EAAA,CAAY,GAAGO,EAAO,EAAG,EACzF,KAAM,CACJ,KAAMH,CACR,CACF,EAEaM,EAA0B,CACrC,OAAQD,GAAQX,EAACO,EAAA,CAAoB,GAAGI,EAAO,SAACF,GAAeT,EAACE,EAAA,CAAY,GAAG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EAEJ,EAEF,KAAM,CACJ,KAAMpB,CACR,CACF",
6
+ "names": ["jsx", "jsxs", "ProductNav", "meta", "Story", "ProductNav_stories_default", "mockData", "InteractiveWrapper", "children", "props", "Default", "args", "WithoutBuyButton", "SingleTab", "ManyTabs", "FewAnchors", "CustomBuyButton", "MinimalNav", "DarkTheme", "WithTextLink", "TextLinkNewWindow", "OnlyTextLink", "WithoutTextLink", "WithScrollOffset", "WithCustomAnchorClick", "item", "index"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",