@scbt-ecom/ui 0.161.0 → 0.163.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/shared/ui/accordion/Accordion.js +1 -1
- package/dist/lib/shared/ui/accordion/Accordion.js.map +1 -1
- package/dist/lib/shared/ui/accordion/ui/AccordionHeader.js +1 -1
- package/dist/lib/shared/ui/accordion/ui/AccordionHeader.js.map +1 -1
- package/dist/lib/shared/ui/phoneView/PhoneView.js +1 -1
- package/dist/lib/shared/ui/phoneView/PhoneView.js.map +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumb.js +1 -1
- package/dist/lib/widgets/breadcrumbs/Breadcrumb.js.map +1 -1
- package/dist/lib/widgets/footer/model/dataLayers.js +2 -0
- package/dist/lib/widgets/footer/model/dataLayers.js.map +1 -0
- package/dist/lib/widgets/footer/ui/NavLinks.js +1 -1
- package/dist/lib/widgets/footer/ui/NavLinks.js.map +1 -1
- package/dist/lib/widgets/footer/ui/SiteMap.js +1 -1
- package/dist/lib/widgets/footer/ui/SiteMap.js.map +1 -1
- package/dist/lib/widgets/footer/ui/SocialLinks.js +1 -1
- package/dist/lib/widgets/footer/ui/SocialLinks.js.map +1 -1
- package/dist/lib/widgets/model/helpers.js +2 -2
- package/dist/lib/widgets/model/helpers.js.map +1 -1
- package/dist/lib/widgets/seoHeader/model/dataLayers.js +2 -0
- package/dist/lib/widgets/seoHeader/model/dataLayers.js.map +1 -0
- package/dist/lib/widgets/seoHeader/model/index.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoriesDesktop.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoryTabs.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/CategoryTabs.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/rootTab/RootTab.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/Tab.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/Tab.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/CategoriesMobile.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/CategoriesMobile.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/Menu.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/Menu.js.map +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/MenuItem.js +1 -1
- package/dist/lib/widgets/seoHeader/ui/mobile/menu/MenuItem.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/UsefulInfo.js +1 -1
- package/dist/lib/widgets/usefulInfo/UsefulInfo.js.map +1 -1
- package/dist/lib/widgets/usefulInfo/ui/Tabs.js +1 -1
- package/dist/lib/widgets/usefulInfo/ui/Tabs.js.map +1 -1
- package/dist/stats.html +1 -1
- package/dist/types/lib/shared/ui/accordion/Accordion.d.ts +1 -0
- package/dist/types/lib/shared/ui/accordion/ui/AccordionHeader.d.ts +1 -0
- package/dist/types/lib/widgets/footer/model/dataLayers.d.ts +1 -0
- package/dist/types/lib/widgets/seoHeader/model/dataLayers.d.ts +1 -0
- package/dist/types/lib/widgets/seoHeader/model/index.d.ts +1 -0
- package/dist/types/lib/widgets/usefulInfo/ui/Tabs.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/Tab.tsx"],"sourcesContent":["import { forwardRef, memo } from 'react'\nimport { motion } from 'framer-motion'\nimport type
|
|
1
|
+
{"version":3,"file":"Tab.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/Tab.tsx"],"sourcesContent":["import { forwardRef, memo } from 'react'\nimport { motion } from 'framer-motion'\nimport { type Category, pushToDlLinkSeoHeader } from '../../../model'\nimport { TabContent } from './ui'\nimport { cn, TypeGuards } from '$/shared/utils'\n\ntype TabProps = {\n category: Category\n active: boolean\n onActiveTabChange: (active: string | null) => void\n}\n\nconst InnerComponent = forwardRef<HTMLDivElement, TabProps>(({ category, active, onActiveTabChange }, ref) => {\n const rootRef = ref && 'current' in ref ? ref : null\n const triggerClientRect = rootRef?.current?.getBoundingClientRect()\n\n const contentShouldRender = active && !TypeGuards.isArrayEmpty(category.children)\n\n const Button = !category.link ? 'span' : TypeGuards.isStringEmpty(category.link.href) ? 'span' : 'a'\n\n return (\n <motion.div\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center justify-center py-4 text-color-dark after:z-30',\n 'after:content=\"\" after:absolute after:bottom-0 after:left-1/2 after:h-[1px]',\n 'after:w-0 after:-translate-x-1/2 after:bg-color-primary-default after:duration-100',\n {\n 'text-color-primary-default': contentShouldRender,\n 'after:w-full': contentShouldRender\n }\n )}\n onMouseEnter={() => onActiveTabChange(category.title!)}\n onMouseLeave={() => onActiveTabChange(null)}\n onFocus={() => onActiveTabChange(category.title!)}\n >\n <Button\n onPointerDown={() => pushToDlLinkSeoHeader(category.title, category.link?.href)}\n href={Button === 'a' ? category.link?.href : undefined}\n className='desk-body-regular-m outline-none'\n >\n {category.title}\n </Button>\n {contentShouldRender && (\n <TabContent\n categories={category.children}\n style={{\n top: triggerClientRect ? triggerClientRect.top + triggerClientRect.height : 0\n }}\n />\n )}\n </motion.div>\n )\n})\n\nexport const Tab = memo(InnerComponent) as typeof InnerComponent\n"],"names":["InnerComponent","forwardRef","category","active","onActiveTabChange","ref","triggerClientRect","contentShouldRender","TypeGuards","Button","jsxs","motion","cn","jsx","pushToDlLinkSeoHeader","TabContent","Tab","memo"],"mappings":"iYAYA,MAAMA,EAAiBC,EAAqC,CAAC,CAAE,SAAAC,EAAU,OAAAC,EAAQ,kBAAAC,CAAA,EAAqBC,IAAQ,CAE5G,MAAMC,GADUD,GAAO,YAAaA,EAAMA,EAAM,OACb,SAAS,sBAAA,EAEtCE,EAAsBJ,GAAU,CAACK,EAAW,aAAaN,EAAS,QAAQ,EAE1EO,EAAUP,EAAS,KAAgBM,EAAW,cAAcN,EAAS,KAAK,IAAI,EAAI,OAAS,IAAjE,OAEhC,OACEQ,EAACC,EAAO,IAAP,CACC,IAAAN,EACA,UAAWO,EACT,2FACA,8EACA,qFACA,CACE,6BAA8BL,EAC9B,eAAgBA,CAAA,CAClB,EAEF,aAAc,IAAMH,EAAkBF,EAAS,KAAM,EACrD,aAAc,IAAME,EAAkB,IAAI,EAC1C,QAAS,IAAMA,EAAkBF,EAAS,KAAM,EAEhD,SAAA,CAAAW,EAACJ,EAAA,CACC,cAAe,IAAMK,EAAsBZ,EAAS,MAAOA,EAAS,MAAM,IAAI,EAC9E,KAAMO,IAAW,IAAMP,EAAS,MAAM,KAAO,OAC7C,UAAU,mCAET,SAAAA,EAAS,KAAA,CAAA,EAEXK,GACCM,EAACE,EAAA,CACC,WAAYb,EAAS,SACrB,MAAO,CACL,IAAKI,EAAoBA,EAAkB,IAAMA,EAAkB,OAAS,CAAA,CAC9E,CAAA,CACF,CAAA,CAAA,CAIR,CAAC,EAEYU,EAAMC,EAAKjB,CAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r,jsxs as l}from"react/jsx-runtime";import{createPortal as m}from"react-dom";import{motion as f}from"framer-motion";import{cn as s}from"../../../../../../../shared/utils/cn.js";import{pushToDlLinkSeoHeader as a}from"../../../../../model/dataLayers.js";import{Icon as p}from"../../../../../../../shared/ui/icon/Icon.js";const b=({categories:o,...i})=>m(r(f.div,{...i,layout:!0,initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:s("absolute z-20 w-full bg-color-white",'after:absolute after:left-1/2 after:top-[-1px] after:h-[1px] after:w-full after:max-w-[636px] after:-translate-x-1/2 after:bg-color-blue-grey-200 after:content-[""] after:desktop:max-w-[1140px]'),children:r("div",{className:"mx-auto flex w-full max-w-[1140px] gap-x-[56px] py-10",children:o.map(e=>{const n=e.link?"a":"p";return l("div",{className:"flex flex-col gap-y-6",children:[e.title&&l(n,{onPointerDown:()=>a(e.title,e.link?.href),href:e.link?.href??void 0,className:"flex items-center gap-x-1 text-16 uppercase text-color-primary-default",children:[e.title,r(p,{name:"arrows/arrowLink",className:"size-6"})]}),r("ul",{className:"w-[328px]",children:e.children.map(t=>r("li",{className:"w-full [&:not(:last-child)]:mb-4",children:r("a",{href:t.link?.href,onPointerDown:()=>a(t.title,t.link?.href),target:t.link?.target,className:"w-full text-16",children:t.title})},t.title))})]},e.title)})})}),document.body.querySelector("#modal-preview")?.contentDocument?.body??document.body);export{b as TabContent};
|
|
2
2
|
//# sourceMappingURL=TabContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabContent.js","sources":["../../../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.tsx"],"sourcesContent":["import { createPortal } from 'react-dom'\nimport { motion } from 'framer-motion'\nimport type
|
|
1
|
+
{"version":3,"file":"TabContent.js","sources":["../../../../../../../../../lib/widgets/seoHeader/ui/desktop/tab/ui/content/TabContent.tsx"],"sourcesContent":["import { createPortal } from 'react-dom'\nimport { motion } from 'framer-motion'\nimport { type Category, pushToDlLinkSeoHeader } from '../../../../../model'\nimport { Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype TabContentProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n}\n\nexport const TabContent = ({ categories, ...props }: TabContentProps) => {\n return createPortal(\n <motion.div\n {...props}\n layout\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n transition={{ duration: 0.2 }}\n className={cn(\n 'absolute z-20 w-full bg-color-white',\n 'after:absolute after:left-1/2 after:top-[-1px] after:h-[1px] after:w-full after:max-w-[636px] after:-translate-x-1/2 after:bg-color-blue-grey-200 after:content-[\"\"] after:desktop:max-w-[1140px]'\n )}\n >\n <div className='mx-auto flex w-full max-w-[1140px] gap-x-[56px] py-10'>\n {categories.map((category) => {\n const CategoryTitle = category.link ? 'a' : 'p'\n\n return (\n <div key={category.title} className='flex flex-col gap-y-6'>\n {category.title && (\n <CategoryTitle\n onPointerDown={() => pushToDlLinkSeoHeader(category.title, category.link?.href)}\n href={category.link?.href ?? undefined}\n className='flex items-center gap-x-1 text-16 uppercase text-color-primary-default'\n >\n {category.title}\n\n <Icon name='arrows/arrowLink' className='size-6' />\n </CategoryTitle>\n )}\n <ul className='w-[328px]'>\n {category.children.map((child) => (\n <li key={child.title} className='w-full [&:not(:last-child)]:mb-4'>\n <a\n href={child.link?.href}\n onPointerDown={() => pushToDlLinkSeoHeader(child.title, child.link?.href)}\n target={child.link?.target}\n className='w-full text-16'\n >\n {child.title}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )\n })}\n </div>\n </motion.div>,\n /**\n * Нужно для preview, чтобы категории рендерились в iframe\n */\n document.body.querySelector<HTMLIFrameElement>('#modal-preview')?.contentDocument?.body ?? document.body\n )\n}\n"],"names":["TabContent","categories","props","createPortal","jsx","motion","cn","category","CategoryTitle","jsxs","pushToDlLinkSeoHeader","Icon","child"],"mappings":"6UAUO,MAAMA,EAAa,CAAC,CAAE,WAAAC,EAAY,GAAGC,KACnCC,EACLC,EAACC,EAAO,IAAP,CACE,GAAGH,EACJ,OAAM,GACN,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EACpB,WAAY,CAAE,SAAU,EAAA,EACxB,UAAWI,EACT,sCACA,mMAAA,EAGF,WAAC,MAAA,CAAI,UAAU,wDACZ,SAAAL,EAAW,IAAKM,GAAa,CAC5B,MAAMC,EAAgBD,EAAS,KAAO,IAAM,IAE5C,OACEE,EAAC,MAAA,CAAyB,UAAU,wBACjC,SAAA,CAAAF,EAAS,OACRE,EAACD,EAAA,CACC,cAAe,IAAME,EAAsBH,EAAS,MAAOA,EAAS,MAAM,IAAI,EAC9E,KAAMA,EAAS,MAAM,MAAQ,OAC7B,UAAU,yEAET,SAAA,CAAAA,EAAS,MAEVH,EAACO,EAAA,CAAK,KAAK,mBAAmB,UAAU,QAAA,CAAS,CAAA,CAAA,CAAA,EAGrDP,EAAC,KAAA,CAAG,UAAU,YACX,SAAAG,EAAS,SAAS,IAAKK,GACtBR,EAAC,KAAA,CAAqB,UAAU,mCAC9B,SAAAA,EAAC,IAAA,CACC,KAAMQ,EAAM,MAAM,KAClB,cAAe,IAAMF,EAAsBE,EAAM,MAAOA,EAAM,MAAM,IAAI,EACxE,OAAQA,EAAM,MAAM,OACpB,UAAU,iBAET,SAAAA,EAAM,KAAA,CAAA,GAPFA,EAAM,KASf,CACD,CAAA,CACH,CAAA,CAAA,EAzBQL,EAAS,KA0BnB,CAEJ,CAAC,CAAA,CACH,CAAA,CAAA,EAKF,SAAS,KAAK,cAAiC,gBAAgB,GAAG,iBAAiB,MAAQ,SAAS,IAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useRef as u,useState as d,useEffect as p}from"react";import{createPortal as b}from"react-dom";import{Menu as f}from"./menu/Menu.js";import{pushToDL as y}from"../../../../shared/dataLayers/pushToDL.js";import{Icon as r}from"../../../../shared/ui/icon/Icon.js";const k=({categories:l,helpers:c,phone:
|
|
1
|
+
import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useRef as u,useState as d,useEffect as p}from"react";import{createPortal as b}from"react-dom";import{Menu as f}from"./menu/Menu.js";import{pushToDL as y}from"../../../../shared/dataLayers/pushToDL.js";import{Icon as r}from"../../../../shared/ui/icon/Icon.js";const k=({categories:l,helpers:c,phone:a})=>{const n=u(null),t=n.current?.getBoundingClientRect(),[e,i]=d(!1),s=()=>{i(!e),y({event:"buttonClick",name:"Бургер меню",eventCategory:"click_block",eventAction:e?"Открыл":"Закрыл",placement:"seo-header"})};return p(()=>(e&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow="visible"}),[e]),m("div",{ref:n,className:"relative flex w-full items-center justify-between border-b border-b-blue-grey-200 py-4 desktop:hidden",children:[o(r,{name:"brandLogos/logoMain",className:"w-[130px]"}),o("button",{"aria-label":"Open menu",type:"button",onClick:s,className:"h-max w-max",children:o(r,{name:e?"general/close":"general/menu",className:"size-6 text-color-primary-default"})}),e&&b(o(f,{categories:l,helpers:c,phone:a,style:{top:t?t.top+t.height:0}}),document.body.querySelector("#modal-preview")?.contentDocument?.body??document.body)]})};export{k as CategoriesMobile};
|
|
2
2
|
//# sourceMappingURL=CategoriesMobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoriesMobile.js","sources":["../../../../../../lib/widgets/seoHeader/ui/mobile/CategoriesMobile.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { pushToDL } from '../../../../shared/dataLayers'\nimport type { Category, SeoHeaderHelpers } from '../../model'\nimport { Menu } from './menu'\nimport { Icon } from '$/shared/ui'\n\ntype CategoriesMobileProps = {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nexport const CategoriesMobile = ({ categories, helpers, phone }: CategoriesMobileProps) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const containerClientRect = containerRef.current?.getBoundingClientRect()\n\n const [open, setOpen] = useState<boolean>(false)\n\n const onOpenToggle = () => {\n setOpen(!open)\n\n pushToDL({\n event: 'buttonClick',\n name: 'Бургер меню',\n eventCategory: 'click_block',\n eventAction: open ? 'Открыл' : 'Закрыл',\n placement: '
|
|
1
|
+
{"version":3,"file":"CategoriesMobile.js","sources":["../../../../../../lib/widgets/seoHeader/ui/mobile/CategoriesMobile.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { pushToDL } from '../../../../shared/dataLayers'\nimport type { Category, SeoHeaderHelpers } from '../../model'\nimport { Menu } from './menu'\nimport { Icon } from '$/shared/ui'\n\ntype CategoriesMobileProps = {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nexport const CategoriesMobile = ({ categories, helpers, phone }: CategoriesMobileProps) => {\n const containerRef = useRef<HTMLDivElement>(null)\n const containerClientRect = containerRef.current?.getBoundingClientRect()\n\n const [open, setOpen] = useState<boolean>(false)\n\n const onOpenToggle = () => {\n setOpen(!open)\n\n pushToDL({\n event: 'buttonClick',\n name: 'Бургер меню',\n eventCategory: 'click_block',\n eventAction: open ? 'Открыл' : 'Закрыл',\n placement: 'seo-header'\n })\n }\n\n useEffect(() => {\n if (open) {\n document.body.style.overflow = 'hidden'\n }\n return () => {\n document.body.style.overflow = 'visible'\n }\n }, [open])\n\n return (\n <div\n ref={containerRef}\n className='relative flex w-full items-center justify-between border-b border-b-blue-grey-200 py-4 desktop:hidden'\n >\n <Icon name='brandLogos/logoMain' className='w-[130px]' />\n <button aria-label='Open menu' type='button' onClick={onOpenToggle} className='h-max w-max'>\n <Icon name={open ? 'general/close' : 'general/menu'} className='size-6 text-color-primary-default' />\n </button>\n\n {open &&\n createPortal(\n <Menu\n categories={categories}\n helpers={helpers}\n phone={phone}\n style={{ top: containerClientRect ? containerClientRect.top + containerClientRect.height : 0 }}\n />,\n /**\n * Нужно для preview, чтобы категории рендерились в iframe\n */\n document.body.querySelector<HTMLIFrameElement>('#modal-preview')?.contentDocument?.body ?? document.body\n )}\n </div>\n )\n}\n"],"names":["CategoriesMobile","categories","helpers","phone","containerRef","useRef","containerClientRect","open","setOpen","useState","onOpenToggle","pushToDL","useEffect","jsxs","jsx","Icon","createPortal","Menu"],"mappings":"4TAaO,MAAMA,EAAmB,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAS,MAAAC,KAAmC,CACzF,MAAMC,EAAeC,EAAuB,IAAI,EAC1CC,EAAsBF,EAAa,SAAS,sBAAA,EAE5C,CAACG,EAAMC,CAAO,EAAIC,EAAkB,EAAK,EAEzCC,EAAe,IAAM,CACzBF,EAAQ,CAACD,CAAI,EAEbI,EAAS,CACP,MAAO,cACP,KAAM,cACN,cAAe,cACf,YAAaJ,EAAO,SAAW,SAC/B,UAAW,YAAA,CACZ,CACH,EAEA,OAAAK,EAAU,KACJL,IACF,SAAS,KAAK,MAAM,SAAW,UAE1B,IAAM,CACX,SAAS,KAAK,MAAM,SAAW,SACjC,GACC,CAACA,CAAI,CAAC,EAGPM,EAAC,MAAA,CACC,IAAKT,EACL,UAAU,wGAEV,SAAA,CAAAU,EAACC,EAAA,CAAK,KAAK,sBAAsB,UAAU,YAAY,IACtD,SAAA,CAAO,aAAW,YAAY,KAAK,SAAS,QAASL,EAAc,UAAU,cAC5E,SAAAI,EAACC,GAAK,KAAMR,EAAO,gBAAkB,eAAgB,UAAU,oCAAoC,EACrG,EAECA,GACCS,EACEF,EAACG,EAAA,CACC,WAAAhB,EACA,QAAAC,EACA,MAAAC,EACA,MAAO,CAAE,IAAKG,EAAsBA,EAAoB,IAAMA,EAAoB,OAAS,CAAA,CAAE,CAAA,EAK/F,SAAS,KAAK,cAAiC,gBAAgB,GAAG,iBAAiB,MAAQ,SAAS,IAAA,CACtG,CAAA,CAAA,CAGR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as a,jsx as l}from"react/jsx-runtime";import{useState as x,useMemo as h}from"react";import{motion as w}from"framer-motion";import{MenuItem as N}from"./MenuItem.js";import{cn as v}from"../../../../../shared/utils/cn.js";import{TypeGuards as c}from"../../../../../shared/utils/typeGuards.js";import{Combobox as y}from"../../../../../shared/ui/formElements/uncontrolled/combobox/combobox.js";import{pushToDlLinkSeoHeader as o}from"../../../model/dataLayers.js";import{Icon as m}from"../../../../../shared/ui/icon/Icon.js";const k=i=>i.map(t=>({value:t.title??"",label:t.title??""})),I=({categories:i,helpers:t,phone:n,...f})=>{const s=k(i),[r,d]=x(s[0]),u=e=>{c.isUndefined(e)||c.isArray(e)||d(e)},p=h(()=>r?i.find(e=>e.title===r.value)?.children??[]:[],[r,i]);return a(w.div,{...f,className:v("fixed z-10 h-full w-full max-w-[calc(636px-32px)]","absolute left-1/2 top-full bg-color-white p-4","-translate-x-1/2 overflow-x-hidden","flex flex-col items-center justify-start gap-y-4"),initial:{opacity:0},animate:{opacity:1},children:[l(y,{multiple:!1,label:"Категория",options:s,value:r,onChange:u}),l("div",{className:"flex w-full flex-col items-center justify-center gap-y-1",children:p.map(e=>c.isArrayEmpty(e.children)?l("div",{className:"w-full px-4 py-2.5",children:l("a",{onPointerDown:()=>o(e?.title,e.link?.href),href:e.link?.href,className:"desk-body-regular-m inline-block w-full",children:e.title})},e.title):l(N,{category:e},e.title))}),l("div",{className:"h-[1px] w-full bg-color-blue-grey-200"}),a("div",{className:"flex w-full flex-col items-center justify-center gap-y-1",children:[t.map(e=>l("div",{className:"w-full px-4 py-2.5",children:a("a",{onPointerDown:()=>o(e.title,e.link.href),href:e.link?.href,className:"flex w-full items-center gap-x-1",children:[e.link?.icon&&l(m,{name:e.link.icon,className:"size-4"}),e.title]})},e.title)),l("div",{className:"w-full px-4 py-2.5",children:a("a",{onPointerDown:()=>o(n,`tel:${n}`),href:`tel:${n}`,className:"flex w-full items-center gap-x-1",children:[l(m,{name:"communication/phone",className:"size-4"}),n]})})]})]})};export{I as Menu};
|
|
2
2
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/Menu.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { motion } from 'framer-motion'\nimport type
|
|
1
|
+
{"version":3,"file":"Menu.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/Menu.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport { motion } from 'framer-motion'\nimport { type Category, pushToDlLinkSeoHeader, type SeoHeaderHelpers } from '../../../model'\nimport { MenuItem } from './MenuItem'\nimport { Combobox, type ComboboxItemOption, type ComboboxValue, Icon } from '$/shared/ui'\nimport { cn, TypeGuards } from '$/shared/utils'\n\nexport type MenuProps = React.ComponentProps<typeof motion.div> & {\n categories: Category[]\n helpers: SeoHeaderHelpers[]\n phone: string\n}\n\nconst getSelectCategories = (categories: Category[]): ComboboxItemOption[] =>\n categories.map((category) => ({\n value: category.title ?? '',\n label: category.title ?? ''\n }))\n\nexport const Menu = ({ categories, helpers, phone, ...props }: MenuProps) => {\n const selectCategories = getSelectCategories(categories)\n\n const [selected, setSelected] = useState<ComboboxValue<false>>(selectCategories[0])\n\n const onCategoryChange = (option?: ComboboxValue<false>) => {\n if (TypeGuards.isUndefined(option) || TypeGuards.isArray(option)) return\n\n setSelected(option)\n }\n\n const selectedSubCategories = useMemo<Category[]>(() => {\n if (!selected) return []\n\n return categories.find((category) => category.title === selected.value)?.children ?? []\n }, [selected, categories])\n\n return (\n <motion.div\n {...props}\n className={cn(\n 'fixed z-10 h-full w-full max-w-[calc(636px-32px)]',\n 'absolute left-1/2 top-full bg-color-white p-4',\n '-translate-x-1/2 overflow-x-hidden',\n 'flex flex-col items-center justify-start gap-y-4'\n )}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n >\n <Combobox multiple={false} label='Категория' options={selectCategories} value={selected} onChange={onCategoryChange} />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {selectedSubCategories.map((subCategory) => {\n if (TypeGuards.isArrayEmpty(subCategory.children)) {\n return (\n <div key={subCategory.title} className='w-full px-4 py-2.5'>\n <a\n onPointerDown={() => pushToDlLinkSeoHeader(subCategory?.title, subCategory.link?.href)}\n href={subCategory.link?.href}\n className='desk-body-regular-m inline-block w-full'\n >\n {subCategory.title}\n </a>\n </div>\n )\n }\n\n return <MenuItem key={subCategory.title} category={subCategory} />\n })}\n </div>\n <div className='h-[1px] w-full bg-color-blue-grey-200' />\n <div className='flex w-full flex-col items-center justify-center gap-y-1'>\n {helpers.map((helper) => (\n <div key={helper.title} className='w-full px-4 py-2.5'>\n <a\n onPointerDown={() => pushToDlLinkSeoHeader(helper.title, helper.link.href)}\n href={helper.link?.href}\n className='flex w-full items-center gap-x-1'\n >\n {helper.link?.icon && <Icon name={helper.link.icon} className='size-4' />}\n {helper.title}\n </a>\n </div>\n ))}\n <div className='w-full px-4 py-2.5'>\n <a\n onPointerDown={() => pushToDlLinkSeoHeader(phone, `tel:${phone}`)}\n href={`tel:${phone}`}\n className='flex w-full items-center gap-x-1'\n >\n <Icon name='communication/phone' className='size-4' />\n {phone}\n </a>\n </div>\n </div>\n </motion.div>\n )\n}\n"],"names":["getSelectCategories","categories","category","Menu","helpers","phone","props","selectCategories","selected","setSelected","useState","onCategoryChange","option","TypeGuards","selectedSubCategories","useMemo","jsxs","motion","cn","jsx","Combobox","subCategory","pushToDlLinkSeoHeader","MenuItem","helper","Icon"],"mappings":"mhBAaA,MAAMA,EAAuBC,GAC3BA,EAAW,IAAKC,IAAc,CAC5B,MAAOA,EAAS,OAAS,GACzB,MAAOA,EAAS,OAAS,EAC3B,EAAE,EAESC,EAAO,CAAC,CAAE,WAAAF,EAAY,QAAAG,EAAS,MAAAC,EAAO,GAAGC,KAAuB,CAC3E,MAAMC,EAAmBP,EAAoBC,CAAU,EAEjD,CAACO,EAAUC,CAAW,EAAIC,EAA+BH,EAAiB,CAAC,CAAC,EAE5EI,EAAoBC,GAAkC,CACtDC,EAAW,YAAYD,CAAM,GAAKC,EAAW,QAAQD,CAAM,GAE/DH,EAAYG,CAAM,CACpB,EAEME,EAAwBC,EAAoB,IAC3CP,EAEEP,EAAW,KAAMC,GAAaA,EAAS,QAAUM,EAAS,KAAK,GAAG,UAAY,CAAA,EAF/D,CAAA,EAGrB,CAACA,EAAUP,CAAU,CAAC,EAEzB,OACEe,EAACC,EAAO,IAAP,CACE,GAAGX,EACJ,UAAWY,EACT,oDACA,gDACA,qCACA,kDAAA,EAEF,QAAS,CAAE,QAAS,CAAA,EACpB,QAAS,CAAE,QAAS,CAAA,EAEpB,SAAA,CAAAC,EAACC,EAAA,CAAS,SAAU,GAAO,MAAM,YAAY,QAASb,EAAkB,MAAOC,EAAU,SAAUG,CAAA,CAAkB,IACpH,MAAA,CAAI,UAAU,2DACZ,SAAAG,EAAsB,IAAKO,GACtBR,EAAW,aAAaQ,EAAY,QAAQ,EAE5CF,EAAC,MAAA,CAA4B,UAAU,qBACrC,SAAAA,EAAC,IAAA,CACC,cAAe,IAAMG,EAAsBD,GAAa,MAAOA,EAAY,MAAM,IAAI,EACrF,KAAMA,EAAY,MAAM,KACxB,UAAU,0CAET,SAAAA,EAAY,KAAA,CAAA,CACf,EAPQA,EAAY,KAQtB,EAIGF,EAACI,EAAA,CAAiC,SAAUF,CAAA,EAA7BA,EAAY,KAA8B,CACjE,CAAA,CACH,EACAF,EAAC,MAAA,CAAI,UAAU,uCAAA,CAAwC,EACvDH,EAAC,MAAA,CAAI,UAAU,2DACZ,SAAA,CAAAZ,EAAQ,IAAKoB,GACZL,EAAC,MAAA,CAAuB,UAAU,qBAChC,SAAAH,EAAC,IAAA,CACC,cAAe,IAAMM,EAAsBE,EAAO,MAAOA,EAAO,KAAK,IAAI,EACzE,KAAMA,EAAO,MAAM,KACnB,UAAU,mCAET,SAAA,CAAAA,EAAO,MAAM,MAAQL,EAACM,EAAA,CAAK,KAAMD,EAAO,KAAK,KAAM,UAAU,QAAA,CAAS,EACtEA,EAAO,KAAA,CAAA,CAAA,GAPFA,EAAO,KASjB,CACD,EACDL,EAAC,MAAA,CAAI,UAAU,qBACb,SAAAH,EAAC,IAAA,CACC,cAAe,IAAMM,EAAsBjB,EAAO,OAAOA,CAAK,EAAE,EAChE,KAAM,OAAOA,CAAK,GAClB,UAAU,mCAEV,SAAA,CAAAc,EAACM,EAAA,CAAK,KAAK,sBAAsB,UAAU,SAAS,EACnDpB,CAAA,CAAA,CAAA,CACH,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{cn as s}from"../../../../../shared/utils/cn.js";import{Accordion as f}from"../../../../../shared/ui/accordion/Accordion.js";import{pushToDlLinkSeoHeader as i}from"../../../model/dataLayers.js";import{Icon as n}from"../../../../../shared/ui/icon/Icon.js";const b=({category:r})=>e(f,{onPointerDown:()=>i(r.title,""),label:r.title??"",icon:e(n,{name:"arrows/arrowRight",className:"-rotate-90"}),classes:{root:"w-full",header:{trigger:"py-2 data-[open=false]:bg-color-white",label:"desk-body-regular-m"},content:s("relative",'after:content-"" after:absolute after:w-[calc(100%-32px)]',"after:bottom-0 after:left-1/2 after:-translate-x-1/2","after:h-[1px] after:bg-color-blue-grey-200")},children:e("div",{className:"flex flex-col items-start justify-center gap-y-4",children:r.children.map(t=>{const o=!!t.link;return a("ul",{className:"w-full list-none p-0",children:[a(o?"a":"p",{href:o?t.link?.href:void 0,className:"mb-3 flex items-center gap-x-1 text-16 text-color-primary-default",children:[t.title,e(n,{name:"arrows/arrowLink"})]}),t.children.map(l=>e("li",{className:"inline-block w-full [&:not(:last-child)]:mb-3",children:e("a",{onPointerDown:()=>i(l.title,l.link?.href),href:l.link?.href,className:"w-full",children:l.title})},l.title))]},t.title)})})},r.title);export{b as MenuItem};
|
|
2
2
|
//# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/MenuItem.tsx"],"sourcesContent":["import { type Category } from '../../../model'\nimport { Accordion, Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype MenuItemProps = {\n category: Category\n}\n\nexport const MenuItem = ({ category }: MenuItemProps) => (\n <Accordion\n key={category.title}\n label={category.title ?? ''}\n icon={<Icon name='arrows/arrowRight' className='-rotate-90' />}\n classes={{\n root: 'w-full',\n header: {\n trigger: 'py-2 data-[open=false]:bg-color-white',\n label: 'desk-body-regular-m'\n },\n content: cn(\n 'relative',\n 'after:content-\"\" after:absolute after:w-[calc(100%-32px)]',\n 'after:bottom-0 after:left-1/2 after:-translate-x-1/2',\n 'after:h-[1px] after:bg-color-blue-grey-200'\n )\n }}\n >\n <div className='flex flex-col items-start justify-center gap-y-4'>\n {category.children.map((child) => {\n const isLink = Boolean(child.link)\n const Title = isLink ? 'a' : 'p'\n\n return (\n <ul key={child.title} className='w-full list-none p-0'>\n <Title\n href={isLink ? child.link?.href : undefined}\n className='mb-3 flex items-center gap-x-1 text-16 text-color-primary-default'\n >\n {child.title}\n <Icon name='arrows/arrowLink' />\n </Title>\n {child.children.map((innerChild) => (\n <li key={innerChild.title} className='inline-block w-full [&:not(:last-child)]:mb-3'>\n <a href={innerChild.link?.href}
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../lib/widgets/seoHeader/ui/mobile/menu/MenuItem.tsx"],"sourcesContent":["import { type Category, pushToDlLinkSeoHeader } from '../../../model'\nimport { Accordion, Icon } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\ntype MenuItemProps = {\n category: Category\n}\n\nexport const MenuItem = ({ category }: MenuItemProps) => (\n <Accordion\n key={category.title}\n onPointerDown={() => pushToDlLinkSeoHeader(category.title, '')}\n label={category.title ?? ''}\n icon={<Icon name='arrows/arrowRight' className='-rotate-90' />}\n classes={{\n root: 'w-full',\n header: {\n trigger: 'py-2 data-[open=false]:bg-color-white',\n label: 'desk-body-regular-m'\n },\n content: cn(\n 'relative',\n 'after:content-\"\" after:absolute after:w-[calc(100%-32px)]',\n 'after:bottom-0 after:left-1/2 after:-translate-x-1/2',\n 'after:h-[1px] after:bg-color-blue-grey-200'\n )\n }}\n >\n <div className='flex flex-col items-start justify-center gap-y-4'>\n {category.children.map((child) => {\n const isLink = Boolean(child.link)\n const Title = isLink ? 'a' : 'p'\n\n return (\n <ul key={child.title} className='w-full list-none p-0'>\n <Title\n href={isLink ? child.link?.href : undefined}\n className='mb-3 flex items-center gap-x-1 text-16 text-color-primary-default'\n >\n {child.title}\n <Icon name='arrows/arrowLink' />\n </Title>\n {child.children.map((innerChild) => (\n <li key={innerChild.title} className='inline-block w-full [&:not(:last-child)]:mb-3'>\n <a\n onPointerDown={() => pushToDlLinkSeoHeader(innerChild.title, innerChild.link?.href)}\n href={innerChild.link?.href}\n className='w-full'\n >\n {innerChild.title}\n </a>\n </li>\n ))}\n </ul>\n )\n })}\n </div>\n </Accordion>\n)\n"],"names":["MenuItem","category","jsx","Accordion","pushToDlLinkSeoHeader","Icon","cn","child","isLink","jsxs","innerChild"],"mappings":"uTAQO,MAAMA,EAAW,CAAC,CAAE,SAAAC,CAAA,IACzBC,EAACC,EAAA,CAEC,cAAe,IAAMC,EAAsBH,EAAS,MAAO,EAAE,EAC7D,MAAOA,EAAS,OAAS,GACzB,KAAMC,EAACG,EAAA,CAAK,KAAK,oBAAoB,UAAU,aAAa,EAC5D,QAAS,CACP,KAAM,SACN,OAAQ,CACN,QAAS,wCACT,MAAO,qBAAA,EAET,QAASC,EACP,WACA,4DACA,uDACA,4CAAA,CACF,EAGF,SAAAJ,EAAC,OAAI,UAAU,mDACZ,WAAS,SAAS,IAAKK,GAAU,CAChC,MAAMC,EAAS,EAAQD,EAAM,KAG7B,OACEE,EAAC,KAAA,CAAqB,UAAU,uBAC9B,SAAA,CAAAA,EAJUD,EAAS,IAAM,IAIxB,CACC,KAAMA,EAASD,EAAM,MAAM,KAAO,OAClC,UAAU,oEAET,SAAA,CAAAA,EAAM,MACPL,EAACG,EAAA,CAAK,KAAK,kBAAA,CAAmB,CAAA,CAAA,CAAA,EAE/BE,EAAM,SAAS,IAAKG,GACnBR,EAAC,KAAA,CAA0B,UAAU,gDACnC,SAAAA,EAAC,IAAA,CACC,cAAe,IAAME,EAAsBM,EAAW,MAAOA,EAAW,MAAM,IAAI,EAClF,KAAMA,EAAW,MAAM,KACvB,UAAU,SAET,SAAAA,EAAW,KAAA,CAAA,CACd,EAPOA,EAAW,KAQpB,CACD,CAAA,CAAA,EAlBMH,EAAM,KAmBf,CAEJ,CAAC,CAAA,CACH,CAAA,EA9CKN,EAAS,KA+ChB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as p}from"react/jsx-runtime";import{useState as d,useMemo as u}from"react";import{cn as o}from"../../shared/utils/cn.js";import{Tabs as N}from"./ui/Tabs.js";import{RenderEntity as h}from"./ui/RenderEntity.js";import{ResponsiveContainer as x}from"../../shared/ui/responsiveContainer/ResponsiveContainer.js";import{Heading as v}from"../../shared/ui/heading/Heading.js";const C=({headline:m,tabs:t,classes:e,accordionsConfig:i})=>{const[n,s]=d(0),l=u(()=>t?.map(r=>({tabName:r.tabName,dataLayers:r.dataLayers}))??[],[t]);if(!t||t?.length===0)return null;const c=t?.[n].tabName;return a("section",{id:"usefulInfo","data-test-id":"usefulInfo",className:o(e?.root),children:p(x,{className:o(e?.container),children:[a(v,{className:o("text-color-dark",e?.headline),as:"h2",children:m}),a("div",{className:o("mt-6 flex flex-col gap-2 desktop:mt-12",e?.tabsWrapper),children:a(N,{headline:m,tabsShortInfo:l,activeTab:n,setActiveTab:s,classes:e?.tabs})}),a("div",{className:o("mt-6 flex flex-col gap-8",e?.contentWrapper),children:t?.[n]?.contents?.map((r,f)=>a(h,{tabName:c,accordionsConfig:i,...r,classes:e?.entityClasses},f))})]})})};export{C as UsefulInfo,C as default};
|
|
2
2
|
//# sourceMappingURL=UsefulInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsefulInfo.js","sources":["../../../../lib/widgets/usefulInfo/UsefulInfo.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EntitiesAccordionsConfig, UsefulInfoTab } from './model'\nimport { type EntityClasses, RenderEntity, Tabs, type TabsClasses } from './ui'\nimport { Heading, ResponsiveContainer } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\nexport type UsefulInfoClasses = {\n root?: string\n container?: string\n tabsWrapper?: string\n tabs?: TabsClasses\n headline?: string\n contentWrapper?: string\n entityClasses?: EntityClasses\n}\n\nexport type UsefulInfoProps = {\n headline: string\n tabs: UsefulInfoTab[]\n classes?: UsefulInfoClasses\n accordionsConfig?: EntitiesAccordionsConfig\n}\n\nexport const UsefulInfo = ({ headline, tabs, classes, accordionsConfig }: UsefulInfoProps) => {\n const [activeTab, setActiveTab] = useState(0)\n\n const tabsShortInfo = useMemo(\n () =>\n tabs?.map((tab) => ({\n tabName: tab.tabName,\n dataLayers: tab.dataLayers\n })) ?? [],\n [tabs]\n )\n\n if (!tabs || tabs?.length === 0) return null\n\n const tabName = tabs?.[activeTab].tabName\n\n return (\n <section id='usefulInfo' data-test-id='usefulInfo' className={cn(classes?.root)}>\n <ResponsiveContainer className={cn(classes?.container)}>\n <Heading className={cn('text-color-dark', classes?.headline)} as='h2'>\n {headline}\n </Heading>\n <div className={cn('mt-6 flex flex-col gap-2 desktop:mt-12', classes?.tabsWrapper)}>\n <Tabs
|
|
1
|
+
{"version":3,"file":"UsefulInfo.js","sources":["../../../../lib/widgets/usefulInfo/UsefulInfo.tsx"],"sourcesContent":["import { useMemo, useState } from 'react'\nimport type { EntitiesAccordionsConfig, UsefulInfoTab } from './model'\nimport { type EntityClasses, RenderEntity, Tabs, type TabsClasses } from './ui'\nimport { Heading, ResponsiveContainer } from '$/shared/ui'\nimport { cn } from '$/shared/utils'\n\nexport type UsefulInfoClasses = {\n root?: string\n container?: string\n tabsWrapper?: string\n tabs?: TabsClasses\n headline?: string\n contentWrapper?: string\n entityClasses?: EntityClasses\n}\n\nexport type UsefulInfoProps = {\n headline: string\n tabs: UsefulInfoTab[]\n classes?: UsefulInfoClasses\n accordionsConfig?: EntitiesAccordionsConfig\n}\n\nexport const UsefulInfo = ({ headline, tabs, classes, accordionsConfig }: UsefulInfoProps) => {\n const [activeTab, setActiveTab] = useState(0)\n\n const tabsShortInfo = useMemo(\n () =>\n tabs?.map((tab) => ({\n tabName: tab.tabName,\n dataLayers: tab.dataLayers\n })) ?? [],\n [tabs]\n )\n\n if (!tabs || tabs?.length === 0) return null\n\n const tabName = tabs?.[activeTab].tabName\n\n return (\n <section id='usefulInfo' data-test-id='usefulInfo' className={cn(classes?.root)}>\n <ResponsiveContainer className={cn(classes?.container)}>\n <Heading className={cn('text-color-dark', classes?.headline)} as='h2'>\n {headline}\n </Heading>\n <div className={cn('mt-6 flex flex-col gap-2 desktop:mt-12', classes?.tabsWrapper)}>\n <Tabs\n headline={headline}\n tabsShortInfo={tabsShortInfo}\n activeTab={activeTab}\n setActiveTab={setActiveTab}\n classes={classes?.tabs}\n />\n </div>\n <div className={cn('mt-6 flex flex-col gap-8', classes?.contentWrapper)}>\n {tabs?.[activeTab]?.contents?.map((entity, index) => (\n <RenderEntity\n tabName={tabName}\n accordionsConfig={accordionsConfig}\n key={index}\n {...entity}\n classes={classes?.entityClasses}\n />\n ))}\n </div>\n </ResponsiveContainer>\n </section>\n )\n}\n\nexport default UsefulInfo\n"],"names":["UsefulInfo","headline","tabs","classes","accordionsConfig","activeTab","setActiveTab","useState","tabsShortInfo","useMemo","tab","tabName","cn","jsxs","ResponsiveContainer","jsx","Heading","Tabs","entity","index","RenderEntity"],"mappings":"oYAuBO,MAAMA,EAAa,CAAC,CAAE,SAAAC,EAAU,KAAAC,EAAM,QAAAC,EAAS,iBAAAC,KAAwC,CAC5F,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAS,CAAC,EAEtCC,EAAgBC,EACpB,IACEP,GAAM,IAAKQ,IAAS,CAClB,QAASA,EAAI,QACb,WAAYA,EAAI,UAAA,EAChB,GAAK,CAAA,EACT,CAACR,CAAI,CAAA,EAGP,GAAI,CAACA,GAAQA,GAAM,SAAW,EAAG,OAAO,KAExC,MAAMS,EAAUT,IAAOG,CAAS,EAAE,QAElC,SACG,UAAA,CAAQ,GAAG,aAAa,eAAa,aAAa,UAAWO,EAAGT,GAAS,IAAI,EAC5E,SAAAU,EAACC,EAAA,CAAoB,UAAWF,EAAGT,GAAS,SAAS,EACnD,SAAA,CAAAY,EAACC,EAAA,CAAQ,UAAWJ,EAAG,kBAAmBT,GAAS,QAAQ,EAAG,GAAG,KAC9D,SAAAF,CAAA,CACH,IACC,MAAA,CAAI,UAAWW,EAAG,yCAA0CT,GAAS,WAAW,EAC/E,SAAAY,EAACE,EAAA,CACC,SAAAhB,EACA,cAAAO,EACA,UAAAH,EACA,aAAAC,EACA,QAASH,GAAS,IAAA,CAAA,EAEtB,EACAY,EAAC,MAAA,CAAI,UAAWH,EAAG,2BAA4BT,GAAS,cAAc,EACnE,SAAAD,IAAOG,CAAS,GAAG,UAAU,IAAI,CAACa,EAAQC,IACzCJ,EAACK,EAAA,CACC,QAAAT,EACA,iBAAAP,EAEC,GAAGc,EACJ,QAASf,GAAS,aAAA,EAFbgB,CAAA,CAIR,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{cn as l}from"../../../shared/utils/cn.js";const
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{cn as l}from"../../../shared/utils/cn.js";import{pushToDL as s}from"../../../shared/dataLayers/pushToDL.js";const b=({tabsShortInfo:t,activeTab:n,setActiveTab:c,classes:r,headline:i})=>{const m=(e,o)=>{c(o),s({event:"buttonClick",name:e,eventCategory:"click_block",eventAction:i,placement:"usefulInfo"})};return a("div",{className:l("hidden-scroll flex items-center gap-4 overflow-x-auto",r?.tabs),children:t&&t.map((e,o)=>a("button",{"aria-label":e.tabName,"data-layer-id":e?.dataLayers?.targetId,onClick:()=>m(e.tabName,o),className:l("mob-body-regular-m text-nowrap rounded-sm bg-color-blue-grey-100 px-3 py-1.5 text-color-secondary outline-1 outline-offset-4 outline-transparent desktop:desk-body-regular-l focus:outline-primary-focus desktop:px-4 desktop:py-3",{"bg-icon-primary-default text-color-white":n===o},r?.button),children:e.tabName},e.tabName))})};export{b as Tabs};
|
|
2
2
|
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sources":["../../../../../lib/widgets/usefulInfo/ui/Tabs.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from 'react'\nimport { type UsefulInfoTab } from '../model'\nimport { cn } from '$/shared/utils'\n\nexport type TabsClasses = {\n tabs?: string\n button?: string\n}\n\ntype TabsShortInfo = Pick<UsefulInfoTab, 'tabName' | 'dataLayers'> & {}\n\nexport interface TabsProps {\n tabsShortInfo?: TabsShortInfo[]\n activeTab?: number\n setActiveTab: Dispatch<SetStateAction<number>>\n classes?: TabsClasses\n}\n\nexport const Tabs = ({ tabsShortInfo, activeTab, setActiveTab, classes }: TabsProps) => {\n return (\n <div className={cn('hidden-scroll flex items-center gap-4 overflow-x-auto', classes?.tabs)}>\n {tabsShortInfo &&\n tabsShortInfo.map((tab, tabIndex) => (\n <button\n aria-label={tab.tabName}\n key={tab.tabName}\n data-layer-id={tab?.dataLayers?.targetId}\n onClick={() =>
|
|
1
|
+
{"version":3,"file":"Tabs.js","sources":["../../../../../lib/widgets/usefulInfo/ui/Tabs.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from 'react'\nimport { pushToDL } from '../../../shared/dataLayers'\nimport { type UsefulInfoTab } from '../model'\nimport { cn } from '$/shared/utils'\n\nexport type TabsClasses = {\n tabs?: string\n button?: string\n}\n\ntype TabsShortInfo = Pick<UsefulInfoTab, 'tabName' | 'dataLayers'> & {}\n\nexport interface TabsProps {\n tabsShortInfo?: TabsShortInfo[]\n activeTab?: number\n setActiveTab: Dispatch<SetStateAction<number>>\n classes?: TabsClasses\n headline: string\n}\n\nexport const Tabs = ({ tabsShortInfo, activeTab, setActiveTab, classes, headline }: TabsProps) => {\n const handleClick = (tabName: string, tabIndex: number) => {\n setActiveTab(tabIndex)\n\n pushToDL({\n event: 'buttonClick',\n name: tabName,\n eventCategory: 'click_block',\n eventAction: headline,\n placement: 'usefulInfo'\n })\n }\n\n return (\n <div className={cn('hidden-scroll flex items-center gap-4 overflow-x-auto', classes?.tabs)}>\n {tabsShortInfo &&\n tabsShortInfo.map((tab, tabIndex) => (\n <button\n aria-label={tab.tabName}\n key={tab.tabName}\n data-layer-id={tab?.dataLayers?.targetId}\n onClick={() => handleClick(tab.tabName, tabIndex)}\n className={cn(\n 'mob-body-regular-m text-nowrap rounded-sm bg-color-blue-grey-100 px-3 py-1.5 text-color-secondary outline-1 outline-offset-4 outline-transparent desktop:desk-body-regular-l focus:outline-primary-focus desktop:px-4 desktop:py-3',\n {\n 'bg-icon-primary-default text-color-white': activeTab === tabIndex\n },\n classes?.button\n )}\n >\n {tab.tabName}\n </button>\n ))}\n </div>\n )\n}\n"],"names":["Tabs","tabsShortInfo","activeTab","setActiveTab","classes","headline","handleClick","tabName","tabIndex","pushToDL","jsx","cn","tab"],"mappings":"2JAoBO,MAAMA,EAAO,CAAC,CAAE,cAAAC,EAAe,UAAAC,EAAW,aAAAC,EAAc,QAAAC,EAAS,SAAAC,KAA0B,CAChG,MAAMC,EAAc,CAACC,EAAiBC,IAAqB,CACzDL,EAAaK,CAAQ,EAErBC,EAAS,CACP,MAAO,cACP,KAAMF,EACN,cAAe,cACf,YAAaF,EACb,UAAW,YAAA,CACZ,CACH,EAEA,OACEK,EAAC,MAAA,CAAI,UAAWC,EAAG,wDAAyDP,GAAS,IAAI,EACtF,SAAAH,GACCA,EAAc,IAAI,CAACW,EAAKJ,IACtBE,EAAC,SAAA,CACC,aAAYE,EAAI,QAEhB,gBAAeA,GAAK,YAAY,SAChC,QAAS,IAAMN,EAAYM,EAAI,QAASJ,CAAQ,EAChD,UAAWG,EACT,qOACA,CACE,2CAA4CT,IAAcM,CAAA,EAE5DJ,GAAS,MAAA,EAGV,SAAAQ,EAAI,OAAA,EAXAA,EAAI,OAAA,CAaZ,EACL,CAEJ"}
|