@consta/header 2.0.0 → 2.1.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/__internal__/src/components/MegaMenu/MegaMenu.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/MegaMenuBannerBar.js +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/MegaMenuBannerBar.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/types.d.ts +7 -6
- package/__internal__/src/components/MegaMenu/MegaMenuBannerBar/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuGlobal/types.d.ts +7 -6
- package/__internal__/src/components/MegaMenu/MegaMenuGlobal/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/MegaMenuNavBar/types.d.ts +7 -6
- package/__internal__/src/components/MegaMenu/MegaMenuNavBar/types.js.map +1 -1
- package/__internal__/src/components/MegaMenu/types.d.ts +5 -4
- package/__internal__/src/components/MegaMenu/types.js.map +1 -1
- package/__internal__/src/components/NavbarCanary/Navbar.d.ts +2 -0
- package/__internal__/src/components/NavbarCanary/Navbar.js +2 -0
- package/__internal__/src/components/NavbarCanary/Navbar.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/NavbarArrow.d.ts +5 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/NavbarArrow.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/NavbarArrow.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarArrow/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarDrawer.d.ts +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarDrawer.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarDrawer.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarItem.css +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarItem.d.ts +3 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarItem.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/NavbarItem.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarItem/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/NavbarMixDriverLeftAnimate.css +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/NavbarMixDriverLeftAnimate.d.ts +8 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/NavbarMixDriverLeftAnimate.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/NavbarMixDriverLeftAnimate.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverLeftAnimate/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/NavbarMixDriverRightAnimate.css +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/NavbarMixDriverRightAnimate.d.ts +8 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/NavbarMixDriverRightAnimate.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/NavbarMixDriverRightAnimate.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixDriverRightAnimate/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.css +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.d.ts +8 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/NavbarRail.d.ts +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/NavbarRail.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/NavbarRail.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarRail/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/NavbarRailItem.css +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/NavbarRailItem.d.ts +6 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/NavbarRailItem.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/NavbarRailItem.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/index.d.ts +1 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/NavbarRailItem/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/helpers.d.ts +70 -0
- package/__internal__/src/components/NavbarCanary/helpers.js +2 -0
- package/__internal__/src/components/NavbarCanary/helpers.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/index.d.ts +6 -0
- package/__internal__/src/components/NavbarCanary/index.js +2 -0
- package/__internal__/src/components/NavbarCanary/index.js.map +1 -0
- package/__internal__/src/components/NavbarCanary/types.d.ts +138 -0
- package/__internal__/src/components/NavbarCanary/types.js +2 -0
- package/__internal__/src/components/NavbarCanary/types.js.map +1 -0
- package/__internal__/src/components/PopoverButton/PopoverButton.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MegaMenu.js","names":["IconArrowRight","React","useCallback","useEffect","useMemo","useState","cn","getItemsDepth","separateItemsByDepth","withDefaultGetters","MegaMenuBannerBar","MegaMenuGlobal","MegaMenuNavBar","cnMegaMenu","MegaMenu","props","b","items","itemsProp","menuHideButtonText","menuMaxElements","menuShowButtonText","menuTitle","onItemClick","onItemClickProp","getItemAs","getItemKey","getItemAttributes","getItemSubMenu","getItemIconLeft","getItemLabel","getItemOnClick","banners","bannerPosition","onBannerClick","getBannerAs","getBannerAttributes","getBannerDescription","getBannerImage","getBannerLabel","getBannerOnClick","className","otherProps","_objectWithoutProperties","_excluded","activeItem","setActiveItem","getItemActive","item","depth","firstLevel","secondLevel","thirdLevel","navItems","groups","handleNavBarClick","e","handleNavBarMouseEnter","c","onMouseEnter","createElement","Object","assign","withGlobalMenu","withBannersBar","length","withNavBar","_objectSpread","getItemIconRight","title","getGroupKey","getGroupLabel","getItemGroupId","groupId","getGroupOnClick","onGroupClick","group","maxElements","showButtonText","hideButtonText","view","getItemDescription","getItemImage"],"sources":["../../../../../src/components/MegaMenu/MegaMenu.tsx"],"sourcesContent":["import './MegaMenu.css';\n\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport {\n getItemsDepth,\n separateItemsByDepth,\n withDefaultGetters,\n} from './helper';\nimport { MegaMenuBannerBar } from './MegaMenuBannerBar';\nimport { MegaMenuGlobal } from './MegaMenuGlobal';\nimport { MegaMenuNavBar } from './MegaMenuNavBar';\nimport { MegaMenuProps } from './types';\n\nconst cnMegaMenu = cn('MegaMenu');\n\nexport const MegaMenu = (props: MegaMenuProps) => {\n const {\n // GlobalMenu\n items: itemsProp,\n menuHideButtonText = 'Скрыть',\n menuMaxElements,\n menuShowButtonText = 'Ещё',\n menuTitle,\n onItemClick: onItemClickProp,\n getItemAs,\n getItemKey,\n getItemAttributes,\n getItemSubMenu,\n getItemIconLeft,\n getItemLabel,\n getItemOnClick,\n // BannerBar\n banners,\n bannerPosition = 'right',\n onBannerClick,\n getBannerAs,\n getBannerAttributes,\n getBannerDescription,\n getBannerImage,\n getBannerLabel,\n getBannerOnClick,\n // Others\n className,\n ...otherProps\n } = withDefaultGetters(props);\n type ITEM = (typeof itemsProp)[number];\n\n const [activeItem, setActiveItem] = useState<ITEM | undefined>();\n\n const getItemActive = useCallback(\n (item: ITEM) =>\n activeItem ? getItemKey(activeItem) === getItemKey(item) : false,\n [activeItem],\n );\n\n const depth = useMemo(\n () => getItemsDepth(itemsProp, getItemSubMenu),\n [itemsProp],\n );\n\n const [firstLevel, secondLevel, thirdLevel] = useMemo(\n () =>\n separateItemsByDepth({\n items: itemsProp,\n getItemKey,\n getItemSubMenu,\n getItemActive,\n depth,\n }),\n [itemsProp, activeItem],\n );\n\n const { navItems, items, groups } = useMemo(() => {\n return {\n navItems: depth < 2 || depth > 2 ? firstLevel : undefined,\n groups: depth < 3 ? firstLevel : secondLevel,\n items: depth < 3 ? secondLevel : thirdLevel,\n };\n }, [depth, firstLevel, secondLevel, thirdLevel]);\n\n const handleNavBarClick = (e: React.MouseEvent, item: ITEM) => {\n onItemClickProp?.({ e, item });\n if (getItemSubMenu(item)) {\n setActiveItem(item);\n }\n };\n\n const handleNavBarMouseEnter = (\n e: React.MouseEvent<HTMLDivElement>,\n item: ITEM,\n ) => {\n const onMouseEnter = getItemAttributes(item)\n ?.onMouseEnter as JSX.IntrinsicElements['div']['onMouseEnter'];\n onMouseEnter?.(e);\n if (getItemSubMenu(item)) {\n setActiveItem(item);\n }\n };\n\n useEffect(() => {\n if (depth > 2 && getItemSubMenu(itemsProp[0])) {\n setActiveItem(itemsProp[0]);\n }\n }, [depth]);\n\n return (\n <div\n className={cnMegaMenu(\n {\n withGlobalMenu: depth > 1,\n withBannersBar: (banners ?? []).length > 0,\n withNavBar: depth !== 2,\n bannerPosition,\n },\n [className],\n )}\n {...otherProps}\n >\n {navItems && (\n <MegaMenuNavBar\n items={navItems}\n className={cnMegaMenu('NavBar')}\n getItemActive={({ item }) => getItemActive(item)}\n getItemAs={({ item }) => getItemAs(item)}\n getItemAttributes={({ item }) =>\n ({\n ...getItemAttributes(item),\n onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) =>\n handleNavBarMouseEnter(e, item),\n } as JSX.IntrinsicElements['div'])\n }\n getItemIconLeft={({ item }) => getItemIconLeft(item)}\n getItemLabel={({ item }) => getItemLabel(item)}\n getItemOnClick={({ item }) => getItemOnClick(item)}\n onItemClick={({ e, item: { item } }) => handleNavBarClick(e, item)}\n getItemIconRight={({ item }) =>\n getItemSubMenu(item) ? IconArrowRight : undefined\n }\n />\n )}\n <div className={cnMegaMenu('Wrapper')}>\n {depth >= 2 && (\n <MegaMenuGlobal\n className={cnMegaMenu('GlobalMenu')}\n items={items}\n groups={groups}\n title={\n menuTitle ?? (activeItem ? getItemLabel(activeItem) : undefined)\n }\n getGroupKey={({ item }) => getItemKey(item)}\n getGroupLabel={({ item }) => getItemLabel(item)}\n getItemAs={({ item }) => getItemAs(item)}\n getItemAttributes={({ item }) => getItemAttributes(item)}\n getItemGroupId={({ groupId }) => groupId}\n getItemLabel={({ item }) => getItemLabel(item)}\n getItemOnClick={({ item }) => getItemOnClick(item)}\n getGroupOnClick={({ item }) => getItemOnClick(item)}\n onGroupClick={\n onItemClickProp\n ? ({ e, group: { item } }) => {\n onItemClickProp?.({ e, item });\n }\n : undefined\n }\n onItemClick={\n onItemClickProp\n ? ({ e, item: { item } }) => onItemClickProp?.({ e, item })\n : undefined\n }\n maxElements={menuMaxElements}\n showButtonText={menuShowButtonText}\n hideButtonText={menuHideButtonText}\n />\n )}\n {banners && (\n <MegaMenuBannerBar\n className={cnMegaMenu('BannerBar')}\n items={banners}\n view={bannerPosition === 'right' ? 'vertical' : 'horizontal'}\n onItemClick={onBannerClick}\n getItemAs={getBannerAs}\n getItemAttributes={getBannerAttributes}\n getItemDescription={getBannerDescription}\n getItemImage={getBannerImage}\n getItemLabel={getBannerLabel}\n getItemOnClick={getBannerOnClick}\n />\n )}\n </div>\n </div>\n );\n};\n\nexport * from './types';\n"],"mappings":"ioCAAA,uBAEA,OAASA,cAAc,KAAQ,8BAA8B,CAC7D,MAAO,CAAAC,KAAK,EAAIC,WAAW,CAAEC,SAAS,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,OAAO,CAExE,OAASC,EAAE,uBAEX,OACEC,aAAa,CACbC,oBAAoB,CACpBC,kBAAkB,gBAEpB,OAASC,iBAAiB,2BAC1B,OAASC,cAAc,wBACvB,OAASC,cAAc,wBAGvB,KAAM,CAAAC,UAAU,CAAGP,EAAE,CAAC,UAAU,CAAC,CAEjC,MAAO,MAAM,CAAAQ,QAAQ,CAAIC,CAAoB,EAAK,OAAAC,CAAA,CA6B5CP,kBAAkB,CAACM,CAAK,CAAC,CA5BvB,CAEJE,KAAK,CAAEC,CAAS,CAChBC,kBAAkB,CAAlBA,CAAkB,CAAG,sCAAQ,CAC7BC,eAAe,CAAfA,CAAe,CACfC,kBAAkB,CAAlBA,CAAkB,CAAG,oBAAK,CAC1BC,SAAS,CAATA,CAAS,CACTC,WAAW,CAAEC,CAAe,CAC5BC,SAAS,CAATA,CAAS,CACTC,UAAU,CAAVA,CAAU,CACVC,iBAAiB,CAAjBA,CAAiB,CACjBC,cAAc,CAAdA,CAAc,CACdC,eAAe,CAAfA,CAAe,CACfC,YAAY,CAAZA,CAAY,CACZC,cAAc,CAAdA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EN,CACDzB,WAAW,CACTC,CAAe,CACX,CAAC,CAAEgC,CAAC,CAADA,CAAC,CAAER,IAAI,CAAE,CAAEA,IAAI,CAAJA,CAAK,CAAE,CAAC,UAAKxB,CAAe,WAAfA,CAAe,QAAfA,CAAe,CAAG,CAAEgC,CAAC,CAADA,CAAC,CAAER,IAAI,CAAJA,CAAK,CAAC,CAAC,OAE9D,CACD6B,WAAW,CAAEzD,CAAgB,CAC7B0D,cAAc,CAAEzD,CAAmB,CACnC0D,cAAc,CAAE5D,CAAmB,CACpC,CACF,CACAa,CAAO,EACN/B,KAAA,CAAA2D,aAAA,CAAClD,iBAAiB,EAChB+B,SAAS,CAAE5B,UAAU,CAAC,WAAW,CAAE,CACnCI,KAAK,CAAEe,CAAQ,CACfgD,IAAI,CAAqB,OAAO,GAA1B/C,CAA0B,CAAG,UAAU,CAAG,YAAa,CAC7DV,WAAW,CAAEW,CAAc,CAC3BT,SAAS,CAAEU,CAAY,CACvBR,iBAAiB,CAAES,CAAoB,CACvC6C,kBAAkB,CAAE5C,CAAqB,CACzC6C,YAAY,CAAE5C,CAAe,CAC7BR,YAAY,CAAES,CAAe,CAC7BR,cAAc,CAAES,CAAiB,CAClC,CAEA,CACF,CAET,CAAC,CAED"}
|
|
1
|
+
{"version":3,"file":"MegaMenu.js","names":["IconArrowRight","React","useCallback","useEffect","useMemo","useState","cn","getItemsDepth","separateItemsByDepth","withDefaultGetters","MegaMenuBannerBar","MegaMenuGlobal","MegaMenuNavBar","cnMegaMenu","MegaMenu","props","b","items","itemsProp","menuHideButtonText","menuMaxElements","menuShowButtonText","menuTitle","onItemClick","onItemClickProp","getItemAs","getItemKey","getItemAttributes","getItemSubMenu","getItemIconLeft","getItemLabel","getItemOnClick","banners","bannerPosition","onBannerClick","getBannerAs","getBannerAttributes","getBannerDescription","getBannerImage","getBannerLabel","getBannerOnClick","className","otherProps","_objectWithoutProperties","_excluded","activeItem","setActiveItem","getItemActive","item","depth","firstLevel","secondLevel","thirdLevel","navItems","groups","handleNavBarClick","e","handleNavBarMouseEnter","c","onMouseEnter","createElement","Object","assign","withGlobalMenu","withBannersBar","length","withNavBar","_objectSpread","getItemIconRight","title","getGroupKey","getGroupLabel","getItemGroupId","groupId","getGroupOnClick","onGroupClick","group","maxElements","showButtonText","hideButtonText","view","getItemDescription","getItemImage"],"sources":["../../../../../src/components/MegaMenu/MegaMenu.tsx"],"sourcesContent":["import './MegaMenu.css';\n\nimport { IconArrowRight } from '@consta/icons/IconArrowRight';\nimport { AsTagAttribute } from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport {\n getItemsDepth,\n separateItemsByDepth,\n withDefaultGetters,\n} from './helper';\nimport { MegaMenuBannerBar } from './MegaMenuBannerBar';\nimport { MegaMenuGlobal } from './MegaMenuGlobal';\nimport { MegaMenuNavBar } from './MegaMenuNavBar';\nimport { MegaMenuProps } from './types';\n\nconst cnMegaMenu = cn('MegaMenu');\n\nexport const MegaMenu = (props: MegaMenuProps) => {\n const {\n // GlobalMenu\n items: itemsProp,\n menuHideButtonText = 'Скрыть',\n menuMaxElements,\n menuShowButtonText = 'Ещё',\n menuTitle,\n onItemClick: onItemClickProp,\n getItemAs,\n getItemKey,\n getItemAttributes,\n getItemSubMenu,\n getItemIconLeft,\n getItemLabel,\n getItemOnClick,\n // BannerBar\n banners,\n bannerPosition = 'right',\n onBannerClick,\n getBannerAs,\n getBannerAttributes,\n getBannerDescription,\n getBannerImage,\n getBannerLabel,\n getBannerOnClick,\n // Others\n className,\n ...otherProps\n } = withDefaultGetters(props);\n type ITEM = (typeof itemsProp)[number];\n\n const [activeItem, setActiveItem] = useState<ITEM | undefined>();\n\n const getItemActive = useCallback(\n (item: ITEM) =>\n activeItem ? getItemKey(activeItem) === getItemKey(item) : false,\n [activeItem],\n );\n\n const depth = useMemo(\n () => getItemsDepth(itemsProp, getItemSubMenu),\n [itemsProp],\n );\n\n const [firstLevel, secondLevel, thirdLevel] = useMemo(\n () =>\n separateItemsByDepth({\n items: itemsProp,\n getItemKey,\n getItemSubMenu,\n getItemActive,\n depth,\n }),\n [itemsProp, activeItem],\n );\n\n const { navItems, items, groups } = useMemo(() => {\n return {\n navItems: depth < 2 || depth > 2 ? firstLevel : undefined,\n groups: depth < 3 ? firstLevel : secondLevel,\n items: depth < 3 ? secondLevel : thirdLevel,\n };\n }, [depth, firstLevel, secondLevel, thirdLevel]);\n\n const handleNavBarClick = (e: React.MouseEvent, item: ITEM) => {\n onItemClickProp?.({ e, item });\n if (getItemSubMenu(item)) {\n setActiveItem(item);\n }\n };\n\n const handleNavBarMouseEnter = (\n e: React.MouseEvent<HTMLDivElement>,\n item: ITEM,\n ) => {\n const onMouseEnter = getItemAttributes(item)\n ?.onMouseEnter as AsTagAttribute<'div'>['onMouseEnter'];\n onMouseEnter?.(e);\n if (getItemSubMenu(item)) {\n setActiveItem(item);\n }\n };\n\n useEffect(() => {\n if (depth > 2 && getItemSubMenu(itemsProp[0])) {\n setActiveItem(itemsProp[0]);\n }\n }, [depth]);\n\n return (\n <div\n className={cnMegaMenu(\n {\n withGlobalMenu: depth > 1,\n withBannersBar: (banners ?? []).length > 0,\n withNavBar: depth !== 2,\n bannerPosition,\n },\n [className],\n )}\n {...otherProps}\n >\n {navItems && (\n <MegaMenuNavBar\n items={navItems}\n className={cnMegaMenu('NavBar')}\n getItemActive={({ item }) => getItemActive(item)}\n getItemAs={({ item }) => getItemAs(item)}\n getItemAttributes={({ item }) =>\n ({\n ...getItemAttributes(item),\n onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) =>\n handleNavBarMouseEnter(e, item),\n } as AsTagAttribute<'div'>)\n }\n getItemIconLeft={({ item }) => getItemIconLeft(item)}\n getItemLabel={({ item }) => getItemLabel(item)}\n getItemOnClick={({ item }) => getItemOnClick(item)}\n onItemClick={({ e, item: { item } }) => handleNavBarClick(e, item)}\n getItemIconRight={({ item }) =>\n getItemSubMenu(item) ? IconArrowRight : undefined\n }\n />\n )}\n <div className={cnMegaMenu('Wrapper')}>\n {depth >= 2 && (\n <MegaMenuGlobal\n className={cnMegaMenu('GlobalMenu')}\n items={items}\n groups={groups}\n title={\n menuTitle ?? (activeItem ? getItemLabel(activeItem) : undefined)\n }\n getGroupKey={({ item }) => getItemKey(item)}\n getGroupLabel={({ item }) => getItemLabel(item)}\n getItemAs={({ item }) => getItemAs(item)}\n getItemAttributes={({ item }) => getItemAttributes(item)}\n getItemGroupId={({ groupId }) => groupId}\n getItemLabel={({ item }) => getItemLabel(item)}\n getItemOnClick={({ item }) => getItemOnClick(item)}\n getGroupOnClick={({ item }) => getItemOnClick(item)}\n onGroupClick={\n onItemClickProp\n ? ({ e, group: { item } }) => {\n onItemClickProp?.({ e, item });\n }\n : undefined\n }\n onItemClick={\n onItemClickProp\n ? ({ e, item: { item } }) => onItemClickProp?.({ e, item })\n : undefined\n }\n maxElements={menuMaxElements}\n showButtonText={menuShowButtonText}\n hideButtonText={menuHideButtonText}\n />\n )}\n {banners && (\n <MegaMenuBannerBar\n className={cnMegaMenu('BannerBar')}\n items={banners}\n view={bannerPosition === 'right' ? 'vertical' : 'horizontal'}\n onItemClick={onBannerClick}\n getItemAs={getBannerAs}\n getItemAttributes={getBannerAttributes}\n getItemDescription={getBannerDescription}\n getItemImage={getBannerImage}\n getItemLabel={getBannerLabel}\n getItemOnClick={getBannerOnClick}\n />\n )}\n </div>\n </div>\n );\n};\n\nexport * from './types';\n"],"mappings":"ioCAAA,uBAEA,OAASA,cAAc,KAAQ,8BAA8B,CAE7D,MAAO,CAAAC,KAAK,EAAIC,WAAW,CAAEC,SAAS,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,OAAO,CAExE,OAASC,EAAE,uBAEX,OACEC,aAAa,CACbC,oBAAoB,CACpBC,kBAAkB,gBAEpB,OAASC,iBAAiB,2BAC1B,OAASC,cAAc,wBACvB,OAASC,cAAc,wBAGvB,KAAM,CAAAC,UAAU,CAAGP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AAc,CAAES,CAAiB,CAClC,CAEA,CACF,CAET,CAAC,CAED"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","getItemAs","getItemAttributes","getItemDescription","getItemImage","getItemLabel","getItemOnClick","onItemClick","className","view"];import"./MegaMenuBannerBar.css";import{cnMixSpace}from"@consta/uikit/MixSpace";import React,{forwardRef}from"react";import{getItemClick}from"../../../helpers/getItemClick";import{cn}from"../../../utils/bem";import{withDefaultGetters}from"./helpers";import{MegaMenuBannerBarItem}from"./MegaMenuBannerBarItem";const cnMegaMenuBannerBar=cn("MegaMenuBannerBar"),MegaMenuBannerBarRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,getItemAs:e,getItemAttributes:f,getItemDescription:g,getItemImage:h,getItemLabel:i,getItemOnClick:j,onItemClick:k,className:l,view:m="vertical"}=c,n=_objectWithoutProperties(c,_excluded);return React.createElement("div",Object.assign({className:cnMegaMenuBannerBar({view:m},[l,cnMixSpace({pV:"horizontal"===m?"xl":"2xl",pH:"horizontal"===m?"2xl":"xl"})])},n,{ref:b}),d.map((a,b)=>{var c;return React.createElement(MegaMenuBannerBarItem,Object.assign({key:cnMegaMenuBannerBar("Item",{index:b}),label:i(a),description:g(a),image:h(a),
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","getItemAs","getItemAttributes","getItemDescription","getItemImage","getItemLabel","getItemOnClick","onItemClick","className","view"];import"./MegaMenuBannerBar.css";import{cnMixSpace}from"@consta/uikit/MixSpace";import React,{forwardRef}from"react";import{getItemClick}from"../../../helpers/getItemClick";import{cn}from"../../../utils/bem";import{withDefaultGetters}from"./helpers";import{MegaMenuBannerBarItem}from"./MegaMenuBannerBarItem";const cnMegaMenuBannerBar=cn("MegaMenuBannerBar"),MegaMenuBannerBarRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,getItemAs:e,getItemAttributes:f,getItemDescription:g,getItemImage:h,getItemLabel:i,getItemOnClick:j,onItemClick:k,className:l,view:m="vertical"}=c,n=_objectWithoutProperties(c,_excluded);return React.createElement("div",Object.assign({className:cnMegaMenuBannerBar({view:m},[l,cnMixSpace({pV:"horizontal"===m?"xl":"2xl",pH:"horizontal"===m?"2xl":"xl"})])},n,{ref:b}),d.map((a,b)=>{var c;return React.createElement(MegaMenuBannerBarItem,Object.assign({},null!==(c=f(a))&&void 0!==c?c:{},{key:cnMegaMenuBannerBar("Item",{index:b}),label:i(a),description:g(a),image:h(a),onClick:getItemClick(a,j,k),view:m,as:e(a)}))}))};export const MegaMenuBannerBar=forwardRef(MegaMenuBannerBarRender);
|
|
2
2
|
//# sourceMappingURL=MegaMenuBannerBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MegaMenuBannerBar.js","names":["cnMixSpace","React","forwardRef","getItemClick","cn","withDefaultGetters","MegaMenuBannerBarItem","cnMegaMenuBannerBar","MegaMenuBannerBarRender","props","ref","c","items","getItemAs","getItemAttributes","getItemDescription","getItemImage","getItemLabel","getItemOnClick","onItemClick","className","view","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","pV","pH","map","item","index","key","label","description","image","
|
|
1
|
+
{"version":3,"file":"MegaMenuBannerBar.js","names":["cnMixSpace","React","forwardRef","getItemClick","cn","withDefaultGetters","MegaMenuBannerBarItem","cnMegaMenuBannerBar","MegaMenuBannerBarRender","props","ref","c","items","getItemAs","getItemAttributes","getItemDescription","getItemImage","getItemLabel","getItemOnClick","onItemClick","className","view","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","pV","pH","map","item","index","key","label","description","image","onClick","as","MegaMenuBannerBar"],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBannerBar/MegaMenuBannerBar.tsx"],"sourcesContent":["import './MegaMenuBannerBar.css';\n\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React, { forwardRef } from 'react';\n\nimport { getItemClick } from '##/helpers/getItemClick';\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from './helpers';\nimport { MegaMenuBannerBarItem } from './MegaMenuBannerBarItem';\nimport { MegaMenuBannerBarComponent, MegaMenuBannerBarProps } from './types';\n\nconst cnMegaMenuBannerBar = cn('MegaMenuBannerBar');\n\nconst MegaMenuBannerBarRender = (\n props: MegaMenuBannerBarProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n getItemAs,\n getItemAttributes,\n getItemDescription,\n getItemImage,\n getItemLabel,\n getItemOnClick,\n onItemClick,\n className,\n view = 'vertical',\n ...otherProps\n } = withDefaultGetters(props);\n\n return (\n <div\n className={cnMegaMenuBannerBar({ view }, [\n className,\n cnMixSpace({\n pV: view === 'horizontal' ? 'xl' : '2xl',\n pH: view === 'horizontal' ? '2xl' : 'xl',\n }),\n ])}\n {...otherProps}\n ref={ref}\n >\n {items.map((item, index) => (\n <MegaMenuBannerBarItem\n {...(getItemAttributes(item) ?? {})}\n key={cnMegaMenuBannerBar('Item', { index })}\n label={getItemLabel(item)}\n description={getItemDescription(item)}\n image={getItemImage(item)}\n onClick={getItemClick(item, getItemOnClick, onItemClick)}\n view={view}\n as={getItemAs(item)}\n />\n ))}\n </div>\n );\n};\n\nexport const MegaMenuBannerBar = forwardRef(\n MegaMenuBannerBarRender,\n) as MegaMenuBannerBarComponent;\n"],"mappings":"oPAAA,gCAEA,OAASA,UAAU,KAAQ,wBAAwB,CACnD,MAAO,CAAAC,KAAK,EAAIC,UAAU,KAAQ,OAAO,CAEzC,OAASC,YAAY,qCACrB,OAASC,EAAE,0BAEX,OAASC,kBAAkB,iBAC3B,OAASC,qBAAqB,+BAAkC,KAG1D,CAAAC,mBAAmB,CAAGH,EAAE,CAAC,mBAAmB,CAAC,CAE7CI,uBAAuB,CAAGA,CAC9BC,CAA6B,CAC7BC,CAA8B,GAC3B,CACH,MAAAC,CAAA,CAYIN,kBAAkB,CAACI,CAAK,CAAC,CAZvB,CACJG,KAAK,CAALA,C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zDE,IAAI,CAAEA,CAAK,CACXiB,EAAE,CAAEzB,CAAS,CAACkB,CAAI,CAAE,EACrB,CAAC,CACH,CACE,CAET,CAAC,CAED,MAAO,MAAM,CAAAQ,iBAAiB,CAAGrC,UAAU,CACzCM,uBACF,CAA+B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
1
2
|
import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
@@ -6,16 +7,16 @@ export type MegaMenuBannerBarDefaultItem = {
|
|
|
6
7
|
label: string;
|
|
7
8
|
description?: string;
|
|
8
9
|
image?: string;
|
|
9
|
-
as?:
|
|
10
|
-
attributes?:
|
|
10
|
+
as?: AsTags;
|
|
11
|
+
attributes?: AsAttributes;
|
|
11
12
|
};
|
|
12
13
|
export type MegaMenuBannerBarPropView = 'vertical' | 'horizontal';
|
|
13
14
|
export type MegaMenuBannerBarPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
14
15
|
export type MegaMenuBannerBarPropGetItemDescription<ITEM> = (item: ITEM) => string | undefined;
|
|
15
16
|
export type MegaMenuBannerBarPropGetItemImage<ITEM> = (item: ITEM) => string | undefined;
|
|
16
17
|
export type MegaMenuBannerBarPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
17
|
-
export type MegaMenuBannerBarPropGetItemAs<ITEM> = (item: ITEM) =>
|
|
18
|
-
export type MegaMenuBannerBarPropGetItemAttributes<ITEM> = (item: ITEM) =>
|
|
18
|
+
export type MegaMenuBannerBarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
19
|
+
export type MegaMenuBannerBarPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
19
20
|
export type MegaMenuBannerBarPropOnItemClick<ITEM> = (params: {
|
|
20
21
|
e: React.MouseEvent;
|
|
21
22
|
item: ITEM;
|
|
@@ -32,11 +33,11 @@ export type MegaMenuBannerBarProps<ITEM = MegaMenuBannerBarDefaultItem> = PropsW
|
|
|
32
33
|
view?: MegaMenuBannerBarPropView;
|
|
33
34
|
}, HTMLDivElement>;
|
|
34
35
|
export type MegaMenuBannerBarComponent = <ITEM = MegaMenuBannerBarDefaultItem>(props: MegaMenuBannerBarProps<ITEM>, ref: React.Ref<HTMLDivElement>) => React.ReactElement | null;
|
|
35
|
-
export type MegaMenuBannerBarItemProps<AS extends
|
|
36
|
+
export type MegaMenuBannerBarItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
|
|
36
37
|
label: string;
|
|
37
38
|
description?: string;
|
|
38
39
|
image?: string;
|
|
39
40
|
onClick?: React.MouseEventHandler;
|
|
40
41
|
view?: MegaMenuBannerBarPropView;
|
|
41
42
|
}, AS>;
|
|
42
|
-
export type MegaMenuBannerBarItemComponent = <AS extends
|
|
43
|
+
export type MegaMenuBannerBarItemComponent = <AS extends AsTags = 'div'>(props: MegaMenuBannerBarItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBannerBar/types.ts"],"sourcesContent":["import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuBannerBarDefaultItem = {\n onClick?: React.MouseEventHandler;\n label: string;\n description?: string;\n image?: string;\n as?:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuBannerBar/types.ts"],"sourcesContent":["import {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuBannerBarDefaultItem = {\n onClick?: React.MouseEventHandler;\n label: string;\n description?: string;\n image?: string;\n as?: AsTags;\n attributes?: AsAttributes;\n};\n\nexport type MegaMenuBannerBarPropView = 'vertical' | 'horizontal';\n\nexport type MegaMenuBannerBarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuBannerBarPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type MegaMenuBannerBarPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type MegaMenuBannerBarPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\nexport type MegaMenuBannerBarPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type MegaMenuBannerBarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type MegaMenuBannerBarPropOnItemClick<ITEM> = (params: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport type MegaMenuBannerBarProps<ITEM = MegaMenuBannerBarDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n getItemLabel?: MegaMenuBannerBarPropGetItemLabel<ITEM>;\n getItemDescription?: MegaMenuBannerBarPropGetItemDescription<ITEM>;\n getItemImage?: MegaMenuBannerBarPropGetItemImage<ITEM>;\n getItemOnClick?: MegaMenuBannerBarPropGetItemOnClick<ITEM>;\n getItemAs?: MegaMenuBannerBarPropGetItemAs<ITEM>;\n getItemAttributes?: MegaMenuBannerBarPropGetItemAttributes<ITEM>;\n onItemClick?: MegaMenuBannerBarPropOnItemClick<ITEM>;\n view?: MegaMenuBannerBarPropView;\n },\n HTMLDivElement\n >;\n\nexport type MegaMenuBannerBarComponent = <ITEM = MegaMenuBannerBarDefaultItem>(\n props: MegaMenuBannerBarProps<ITEM>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactElement | null;\n\nexport type MegaMenuBannerBarItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n label: string;\n description?: string;\n image?: string;\n onClick?: React.MouseEventHandler;\n view?: MegaMenuBannerBarPropView;\n },\n AS\n >;\n\nexport type MegaMenuBannerBarItemComponent = <AS extends AsTags = 'div'>(\n props: MegaMenuBannerBarItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
1
2
|
import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
4
5
|
export type MegaMenuGlobalDefaultItem = {
|
|
5
|
-
as?:
|
|
6
|
-
attributes?:
|
|
6
|
+
as?: AsTags;
|
|
7
|
+
attributes?: AsAttributes;
|
|
7
8
|
onClick?: React.MouseEventHandler;
|
|
8
9
|
label: string;
|
|
9
10
|
groupId?: string | number;
|
|
@@ -13,8 +14,8 @@ export type MegaMenuGlobalDefaultGroup = {
|
|
|
13
14
|
id?: string | number;
|
|
14
15
|
onClick?: React.MouseEventHandler;
|
|
15
16
|
};
|
|
16
|
-
export type MegaMenuGlobalPropGetItemAs<ITEM> = (item: ITEM) =>
|
|
17
|
-
export type MegaMenuGlobalPropGetItemAttributes<ITEM> = (item: ITEM) =>
|
|
17
|
+
export type MegaMenuGlobalPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
18
|
+
export type MegaMenuGlobalPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
18
19
|
export type MegaMenuGlobalPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
19
20
|
export type MegaMenuGlobalPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
20
21
|
export type MegaMenuGlobalPropGetItemGroupId<ITEM> = (item: ITEM) => string | number | undefined;
|
|
@@ -68,8 +69,8 @@ export type MegaMenuGlobalGroupProps<ITEM = MegaMenuGlobalDefaultItem> = PropsWi
|
|
|
68
69
|
hideButtonText?: string;
|
|
69
70
|
} & Required<MappersItem<ITEM>>, HTMLDivElement>;
|
|
70
71
|
export type MegaMenuGlobalGroupComponent = <ITEM = MegaMenuGlobalDefaultItem>(props: MegaMenuGlobalGroupProps<ITEM>, ref: React.Ref<HTMLDivElement>) => React.ReactElement | null;
|
|
71
|
-
export type MegaMenuGlobalItemProps<AS extends
|
|
72
|
+
export type MegaMenuGlobalItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
|
|
72
73
|
label: string;
|
|
73
74
|
onClick?: React.MouseEventHandler;
|
|
74
75
|
}, AS>;
|
|
75
|
-
export type MegaMenuGlobalItemComponent = <AS extends
|
|
76
|
+
export type MegaMenuGlobalItemComponent = <AS extends AsTags = 'div'>(props: MegaMenuGlobalItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuGlobal/types.ts"],"sourcesContent":["import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuGlobalDefaultItem = {\n as?:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuGlobal/types.ts"],"sourcesContent":["import {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuGlobalDefaultItem = {\n as?: AsTags;\n attributes?: AsAttributes;\n onClick?: React.MouseEventHandler;\n label: string;\n groupId?: string | number;\n};\n\nexport type MegaMenuGlobalDefaultGroup = {\n label: string;\n id?: string | number;\n onClick?: React.MouseEventHandler;\n};\n\nexport type MegaMenuGlobalPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type MegaMenuGlobalPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\nexport type MegaMenuGlobalPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\nexport type MegaMenuGlobalPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuGlobalPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type MegaMenuGlobalPropGetGroupId<ITEM> = (\n item: ITEM,\n) => number | string | undefined;\nexport type MegaMenuGlobalPropGetGroupLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuGlobalPropGetGroupOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\n\nexport type MegaMenuGlobalPropOnItemClick<ITEM> = (params: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport type MegaMenuGlobalPropOnGroupClick<GROUP> = (params: {\n e: React.MouseEvent;\n group: GROUP;\n}) => void;\n\nexport type MappersItem<ITEM = MegaMenuGlobalDefaultItem> = {\n getItemLabel?: MegaMenuGlobalPropGetItemLabel<ITEM>;\n getItemAs?: MegaMenuGlobalPropGetItemAs<ITEM>;\n getItemGroupId?: MegaMenuGlobalPropGetItemGroupId<ITEM>;\n getItemAttributes?: MegaMenuGlobalPropGetItemAttributes<ITEM>;\n getItemOnClick?: MegaMenuGlobalPropGetItemOnClick<ITEM>;\n};\n\nexport type MegaMenuGlobalProps<\n ITEM = MegaMenuGlobalDefaultItem,\n GROUP = MegaMenuGlobalDefaultGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n groups?: GROUP[];\n getGroupKey?: MegaMenuGlobalPropGetGroupId<GROUP>;\n getGroupLabel?: MegaMenuGlobalPropGetGroupLabel<GROUP>;\n getGroupOnClick?: MegaMenuGlobalPropGetGroupOnClick<GROUP>;\n maxElements?: number;\n onGroupClick?: MegaMenuGlobalPropOnGroupClick<GROUP>;\n onItemClick?: MegaMenuGlobalPropOnItemClick<ITEM>;\n columns?: number;\n title?: string;\n showButtonText?: string;\n hideButtonText?: string;\n } & MappersItem<ITEM> &\n (ITEM extends { label: string }\n ? {}\n : {\n getItemLabel: MegaMenuGlobalPropGetItemLabel<ITEM>;\n }) &\n (GROUP extends { label: string | unknown }\n ? {}\n : {\n getGroupLabel: MegaMenuGlobalPropGetGroupLabel<GROUP>;\n }),\n HTMLDivElement\n>;\n\nexport type MegaMenuGlobalComponent = <\n ITEM = MegaMenuGlobalDefaultItem,\n GROUP = MegaMenuGlobalDefaultGroup,\n>(\n props: MegaMenuGlobalProps<ITEM, GROUP>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactElement | null;\n\nexport type MegaMenuGlobalGroupProps<ITEM = MegaMenuGlobalDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n title?: string;\n maxElements?: number;\n onItemClick?: MegaMenuGlobalPropOnItemClick<ITEM>;\n showButtonText?: string;\n hideButtonText?: string;\n } & Required<MappersItem<ITEM>>,\n HTMLDivElement\n >;\n\nexport type MegaMenuGlobalGroupComponent = <ITEM = MegaMenuGlobalDefaultItem>(\n props: MegaMenuGlobalGroupProps<ITEM>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactElement | null;\n\nexport type MegaMenuGlobalItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n label: string;\n onClick?: React.MouseEventHandler;\n },\n AS\n >;\n\nexport type MegaMenuGlobalItemComponent = <AS extends AsTags = 'div'>(\n props: MegaMenuGlobalItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconComponent } from '@consta/icons/Icon';
|
|
2
|
+
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
2
3
|
import { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
|
|
@@ -7,8 +8,8 @@ export type MegaMenuNavBarDefaultItem = {
|
|
|
7
8
|
iconLeft?: IconComponent;
|
|
8
9
|
iconRight?: IconComponent;
|
|
9
10
|
active?: boolean;
|
|
10
|
-
as?:
|
|
11
|
-
attributes?:
|
|
11
|
+
as?: AsTags;
|
|
12
|
+
attributes?: AsAttributes;
|
|
12
13
|
onClick?: React.MouseEventHandler;
|
|
13
14
|
};
|
|
14
15
|
export type MegaMenuNavBarPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
@@ -16,8 +17,8 @@ export type MegaMenuNavBarPropGetItemIconLeft<ITEM> = (item: ITEM) => IconCompon
|
|
|
16
17
|
export type MegaMenuNavBarPropGetItemIconRight<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
17
18
|
export type MegaMenuNavBarPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;
|
|
18
19
|
export type MegaMenuNavBarPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
19
|
-
export type MegaMenuNavBarPropGetItemAs<ITEM> = (item: ITEM) =>
|
|
20
|
-
export type MegaMenuNavBarPropGetItemAttributes<ITEM> = (item: ITEM) =>
|
|
20
|
+
export type MegaMenuNavBarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
21
|
+
export type MegaMenuNavBarPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
21
22
|
export type MegaMenuNavBarPropOnItemClick<ITEM> = (params: {
|
|
22
23
|
e: React.MouseEvent;
|
|
23
24
|
item: ITEM;
|
|
@@ -38,11 +39,11 @@ export type MegaMenuNavBarProps<ITEM = MegaMenuNavBarDefaultItem> = PropsWithHTM
|
|
|
38
39
|
getItemLabel: MegaMenuNavBarPropGetItemLabel<ITEM>;
|
|
39
40
|
}), HTMLDivElement>;
|
|
40
41
|
export type MegaMenuNavBarComponent = <ITEM = MegaMenuNavBarDefaultItem>(props: MegaMenuNavBarProps<ITEM>, ref: React.Ref<HTMLDivElement>) => React.ReactElement | null;
|
|
41
|
-
export type MegaMenuNavBarItemProps<AS extends
|
|
42
|
+
export type MegaMenuNavBarItemProps<AS extends AsTags = 'div'> = PropsWithAsAttributes<{
|
|
42
43
|
label: string;
|
|
43
44
|
active?: boolean;
|
|
44
45
|
onClick?: React.MouseEventHandler;
|
|
45
46
|
iconLeft?: IconComponent;
|
|
46
47
|
iconRight?: IconComponent;
|
|
47
48
|
}, AS>;
|
|
48
|
-
export type MegaMenuNavBarItemComponent = <AS extends
|
|
49
|
+
export type MegaMenuNavBarItemComponent = <AS extends AsTags = 'div'>(props: MegaMenuNavBarItemProps<AS>, ref: React.Ref<HTMLElement>) => React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuNavBar/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuNavBarDefaultItem = {\n label: string;\n iconLeft?: IconComponent;\n iconRight?: IconComponent;\n active?: boolean;\n as?:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/components/MegaMenu/MegaMenuNavBar/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithAsAttributes } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport type MegaMenuNavBarDefaultItem = {\n label: string;\n iconLeft?: IconComponent;\n iconRight?: IconComponent;\n active?: boolean;\n as?: AsTags;\n attributes?: AsAttributes;\n onClick?: React.MouseEventHandler;\n};\n\nexport type MegaMenuNavBarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuNavBarPropGetItemIconLeft<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type MegaMenuNavBarPropGetItemIconRight<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type MegaMenuNavBarPropGetItemActive<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\nexport type MegaMenuNavBarPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\nexport type MegaMenuNavBarPropGetItemAs<ITEM> = (\n item: ITEM,\n) => AsTags | undefined;\nexport type MegaMenuNavBarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type MegaMenuNavBarPropOnItemClick<ITEM> = (params: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport type MegaMenuNavBarProps<ITEM = MegaMenuNavBarDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n getItemLabel?: MegaMenuNavBarPropGetItemLabel<ITEM>;\n getItemActive?: MegaMenuNavBarPropGetItemActive<ITEM>;\n getItemOnClick?: MegaMenuNavBarPropGetItemOnClick<ITEM>;\n getItemIconLeft?: MegaMenuNavBarPropGetItemIconLeft<ITEM>;\n getItemIconRight?: MegaMenuNavBarPropGetItemIconRight<ITEM>;\n getItemAs?: MegaMenuNavBarPropGetItemAs<ITEM>;\n getItemAttributes?: MegaMenuNavBarPropGetItemAttributes<ITEM>;\n onItemClick?: MegaMenuNavBarPropOnItemClick<ITEM>;\n } & (ITEM extends { label: string }\n ? {}\n : {\n getItemLabel: MegaMenuNavBarPropGetItemLabel<ITEM>;\n }),\n HTMLDivElement\n >;\n\nexport type MegaMenuNavBarComponent = <ITEM = MegaMenuNavBarDefaultItem>(\n props: MegaMenuNavBarProps<ITEM>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactElement | null;\n\nexport type MegaMenuNavBarItemProps<AS extends AsTags = 'div'> =\n PropsWithAsAttributes<\n {\n label: string;\n active?: boolean;\n onClick?: React.MouseEventHandler;\n iconLeft?: IconComponent;\n iconRight?: IconComponent;\n },\n AS\n >;\n\nexport type MegaMenuNavBarItemComponent = <AS extends AsTags = 'div'>(\n props: MegaMenuNavBarItemProps<AS>,\n ref: React.Ref<HTMLElement>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconComponent } from '@consta/icons/Icon';
|
|
2
|
+
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
|
|
4
5
|
import { MegaMenuBannerBarDefaultItem, MegaMenuBannerBarPropGetItemAs, MegaMenuBannerBarPropGetItemAttributes, MegaMenuBannerBarPropGetItemDescription, MegaMenuBannerBarPropGetItemImage, MegaMenuBannerBarPropGetItemLabel, MegaMenuBannerBarPropGetItemOnClick } from './MegaMenuBannerBar';
|
|
@@ -10,8 +11,8 @@ export type MegaMenuDefaultItem = {
|
|
|
10
11
|
key: string | number;
|
|
11
12
|
label: string;
|
|
12
13
|
iconLeft?: IconComponent;
|
|
13
|
-
as?:
|
|
14
|
-
attributes?:
|
|
14
|
+
as?: AsTags;
|
|
15
|
+
attributes?: AsAttributes;
|
|
15
16
|
subMenu?: MegaMenuDefaultItem[];
|
|
16
17
|
onClick?: React.MouseEventHandler;
|
|
17
18
|
};
|
|
@@ -19,8 +20,8 @@ export type MegaMenuPropGetItemKey<ITEM> = (item: ITEM) => string | number;
|
|
|
19
20
|
export type MegaMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
20
21
|
export type MegaMenuPropGetItemIconLeft<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
21
22
|
export type MegaMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler | undefined;
|
|
22
|
-
export type MegaMenuPropGetItemAs<ITEM> = (item: ITEM) =>
|
|
23
|
-
export type MegaMenuPropGetItemAttributes<ITEM> = (item: ITEM) =>
|
|
23
|
+
export type MegaMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
24
|
+
export type MegaMenuPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
24
25
|
export type MegaMenuPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
|
|
25
26
|
export type ItemMappers<ITEM = MegaMenuDefaultItem> = {
|
|
26
27
|
getItemKey?: MegaMenuPropGetItemKey<ITEM>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/MegaMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport {\n MegaMenuBannerBarDefaultItem,\n MegaMenuBannerBarPropGetItemAs,\n MegaMenuBannerBarPropGetItemAttributes,\n MegaMenuBannerBarPropGetItemDescription,\n MegaMenuBannerBarPropGetItemImage,\n MegaMenuBannerBarPropGetItemLabel,\n MegaMenuBannerBarPropGetItemOnClick,\n} from './MegaMenuBannerBar';\n\nexport type MegaMenuPropOnItemClick<ITEM> = (params: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport type MegaMenuDefaultItem = {\n key: string | number;\n label: string;\n iconLeft?: IconComponent;\n as?:
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/components/MegaMenu/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport React from 'react';\n\nimport { PropsWithHTMLAttributesAndRef } from '##/utils/types/PropsWithHTMLAttributes';\n\nimport {\n MegaMenuBannerBarDefaultItem,\n MegaMenuBannerBarPropGetItemAs,\n MegaMenuBannerBarPropGetItemAttributes,\n MegaMenuBannerBarPropGetItemDescription,\n MegaMenuBannerBarPropGetItemImage,\n MegaMenuBannerBarPropGetItemLabel,\n MegaMenuBannerBarPropGetItemOnClick,\n} from './MegaMenuBannerBar';\n\nexport type MegaMenuPropOnItemClick<ITEM> = (params: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport type MegaMenuDefaultItem = {\n key: string | number;\n label: string;\n iconLeft?: IconComponent;\n as?: AsTags;\n attributes?: AsAttributes;\n subMenu?: MegaMenuDefaultItem[];\n onClick?: React.MouseEventHandler;\n};\n\nexport type MegaMenuPropGetItemKey<ITEM> = (item: ITEM) => string | number;\nexport type MegaMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type MegaMenuPropGetItemIconLeft<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\nexport type MegaMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler | undefined;\nexport type MegaMenuPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\nexport type MegaMenuPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\nexport type MegaMenuPropGetItemSubMenu<ITEM> = (\n item: ITEM,\n) => ITEM[] | undefined;\n\nexport type ItemMappers<ITEM = MegaMenuDefaultItem> = {\n getItemKey?: MegaMenuPropGetItemKey<ITEM>;\n getItemLabel?: MegaMenuPropGetItemLabel<ITEM>;\n getItemIconLeft?: MegaMenuPropGetItemIconLeft<ITEM>;\n getItemOnClick?: MegaMenuPropGetItemOnClick<ITEM>;\n getItemAs?: MegaMenuPropGetItemAs<ITEM>;\n getItemAttributes?: MegaMenuPropGetItemAttributes<ITEM>;\n getItemSubMenu?: MegaMenuPropGetItemSubMenu<ITEM>;\n};\n\nexport type BannerMappers<ITEM = MegaMenuBannerBarDefaultItem> = {\n getBannerLabel?: MegaMenuBannerBarPropGetItemLabel<ITEM>;\n getBannerOnClick?: MegaMenuBannerBarPropGetItemOnClick<ITEM>;\n getBannerDescription?: MegaMenuBannerBarPropGetItemDescription<ITEM>;\n getBannerImage?: MegaMenuBannerBarPropGetItemImage<ITEM>;\n getBannerAs?: MegaMenuBannerBarPropGetItemAs<ITEM>;\n getBannerAttributes?: MegaMenuBannerBarPropGetItemAttributes<ITEM>;\n};\n\nexport type MegaMenuProps<\n ITEM = MegaMenuDefaultItem,\n BANNER = MegaMenuBannerBarDefaultItem,\n> = PropsWithHTMLAttributesAndRef<\n {\n banners?: BANNER[];\n items: ITEM[];\n menuTitle?: string;\n menuShowButtonText?: string;\n menuHideButtonText?: string;\n menuMaxElements?: number;\n bannerPosition?: 'right' | 'bottom';\n onItemClick?: MegaMenuPropOnItemClick<ITEM>;\n onBannerClick?: MegaMenuPropOnItemClick<BANNER>;\n } & BannerMappers<BANNER> &\n ItemMappers<ITEM> &\n (ITEM extends { key: MegaMenuDefaultItem['key'] }\n ? {}\n : { getItemKey: MegaMenuPropGetItemKey<ITEM> }) &\n (ITEM extends { label: MegaMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: MegaMenuPropGetItemLabel<ITEM> }) &\n (BANNER extends { label: MegaMenuBannerBarDefaultItem['label'] | unknown }\n ? {}\n : { getBannerLabel: MegaMenuBannerBarPropGetItemLabel<ITEM> }),\n HTMLDivElement\n>;\n\nexport type MegaMenuComponent = <\n ITEM = MegaMenuDefaultItem,\n BANNER = MegaMenuBannerBarDefaultItem,\n>(\n props: MegaMenuProps<ITEM, BANNER>,\n ref: React.Ref<HTMLDivElement>,\n) => React.ReactElement | null;\n"],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","onItemClick","groups","getItemLabel","getItemIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemActive","getItemRef","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","size","form","getItemSubMenu","getItemStatus","sortGroup","className"];import{getGroups}from"@consta/uikit/__internal__/src/utils/getGroups";import{renderHeader}from"@consta/uikit/ListCanary";import React,{forwardRef,useMemo}from"react";import{withDefaultGetters}from"./helpers";import{NavbarItem}from"./NavbarItem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"./types";const NavbarRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,onItemClick:e,groups:f,getItemLabel:g,getItemIcon:h,getItemRightSide:i,getItemAs:j,getItemAttributes:k,getItemGroupKey:l,getItemActive:m,getItemRef:n,getItemAdditionalClassName:o,getGroupKey:p,getGroupLabel:q,getGroupRightSide:r,getGroupAdditionalClassName:s,size:x=defaultNavbarPropSize,form:y=defaultNavbarPropForm,getItemSubMenu:t,getItemStatus:u,sortGroup:v,className:w}=c,z=_objectWithoutProperties(c,_excluded),A=useMemo(()=>getGroups(d,l,f,p,v),[f,d]);return React.createElement("div",Object.assign({},z,{ref:b,className:w}),A.map((a,b)=>React.createElement(React.Fragment,{key:a.key},renderHeader(a.group&&q(a.group),0===b,x,a.group&&r(a.group),{pV:"xs",mH:"m",mB:"2xs"},void 0,s&&a.group&&s(a.group)),a.items.map((b,c)=>React.createElement(React.Fragment,{key:`${a.key}-${c}`},React.createElement(NavbarItem,{size:x,item:b,level:0,onItemClick:e,getItemLabel:g,getItemActive:m,getItemAdditionalClassName:o,getItemAs:j,getItemAttributes:k,getItemIcon:h,getItemRef:n,getItemRightSide:i,getItemSubMenu:t,getItemStatus:u,form:y}))))))};export const Navbar=forwardRef(NavbarRender);
|
|
2
|
+
//# sourceMappingURL=Navbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Navbar.js","names":["getGroups","renderHeader","React","forwardRef","useMemo","withDefaultGetters","NavbarItem","defaultNavbarPropForm","defaultNavbarPropSize","NavbarRender","props","ref","c","items","onItemClick","groups","groupsProp","getItemLabel","getItemIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemActive","getItemRef","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","size","form","getItemSubMenu","getItemStatus","sortGroup","className","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","map","group","groupIndex","Fragment","key","pV","mH","mB","item","index","level","Navbar"],"sources":["../../../../../src/components/NavbarCanary/Navbar.tsx"],"sourcesContent":["import { getGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { renderHeader } from '@consta/uikit/ListCanary';\nimport React, { forwardRef, useMemo } from 'react';\n\nimport { withDefaultGetters } from './helpers';\nimport { NavbarItem } from './NavbarItem';\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarComponent,\n NavbarProps,\n} from './types';\n\nconst NavbarRender = (props: NavbarProps, ref: React.Ref<HTMLDivElement>) => {\n const {\n items,\n onItemClick,\n groups: groupsProp,\n getItemLabel,\n getItemIcon,\n getItemRightSide,\n getItemAs,\n getItemAttributes,\n getItemGroupKey,\n getItemActive,\n getItemRef,\n getItemAdditionalClassName,\n getGroupKey,\n getGroupLabel,\n getGroupRightSide,\n getGroupAdditionalClassName,\n size = defaultNavbarPropSize,\n form = defaultNavbarPropForm,\n getItemSubMenu,\n getItemStatus,\n sortGroup,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const groups = useMemo(\n () => getGroups(items, getItemGroupKey, groupsProp, getGroupKey, sortGroup),\n [groupsProp, items],\n );\n\n return (\n <div {...otherProps} ref={ref} className={className}>\n {groups.map((group, groupIndex) => {\n return (\n <React.Fragment key={group.key}>\n {renderHeader(\n group.group && getGroupLabel(group.group),\n groupIndex === 0,\n size,\n group.group && getGroupRightSide(group.group),\n { pV: 'xs', mH: 'm', mB: '2xs' },\n undefined,\n getGroupAdditionalClassName &&\n group.group &&\n getGroupAdditionalClassName(group.group),\n )}\n {group.items.map((item, index) => {\n return (\n <React.Fragment key={`${group.key}-${index}`}>\n <NavbarItem\n size={size}\n item={item}\n level={0}\n onItemClick={onItemClick}\n getItemLabel={getItemLabel}\n getItemActive={getItemActive}\n getItemAdditionalClassName={getItemAdditionalClassName}\n getItemAs={getItemAs}\n getItemAttributes={getItemAttributes}\n getItemIcon={getItemIcon}\n getItemRef={getItemRef}\n getItemRightSide={getItemRightSide}\n getItemSubMenu={getItemSubMenu}\n getItemStatus={getItemStatus}\n form={form}\n />\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </div>\n );\n};\n\nexport const Navbar = forwardRef(NavbarRender) as NavbarComponent;\n"],"mappings":"ybAAA,OAASA,SAAS,KAAQ,gDAAgD,CAC1E,OAASC,YAAY,KAAQ,0BAA0B,CACvD,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,OAAO,KAAQ,OAAO,CAElD,OAASC,kBAAkB,iBAC3B,OAASC,UAAU,oBACnB,OACEC,qBAAqB,CACrBC,qBAAqB,eAKvB,KAAM,CAAAC,YAAY,CAAGA,CAACC,CAAkB,CAAEC,CAA8B,GAAK,OAAAC,CAAA,CAyBvEP,kBAAkB,CAACK,CAAK,CAAC,CAxBvB,CACJG,KAAK,CAALA,CAAK,CACLC,WAAW,CAAXA,CAAW,CACXC,MAAM,CAAEC,CAAU,CAClBC,YAAY,CAAZA,CAAY,CACZC,WAAW,CAAXA,CAAW,CACXC,g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EAAE,CAAE,IAAI,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CAAC,QAEhCpB,CAA2B,EACzBc,CAAK,CAACA,KAAK,EACXd,CAA2B,CAACc,CAAK,CAACA,KAAK,CAC3C,CAAC,CACAA,CAAK,CAAC9B,KAAK,CAAC6B,GAAG,CAAC,CAACQ,CAAI,CAAEC,CAAK,GAEzBjD,KAAA,CAAAqC,aAAA,CAACrC,KAAK,CAAC2C,QAAQ,EAACC,GAAG,CAAG,GAAEH,CAAK,CAACG,GAAI,IAAGK,CAAM,EAAE,EAC3CjD,KAAA,CAAAqC,aAAA,CAACjC,UAAU,EACTwB,IAAI,CAAEA,CAAK,CACXoB,IAAI,CAAEA,CAAK,CACXE,KAAK,CAAE,CAAE,CACTtC,WAAW,CAAEA,CAAY,CACzBG,YAAY,CAAEA,CAAa,CAC3BM,aAAa,CAAEA,CAAc,CAC7BE,0BAA0B,CAAEA,CAA2B,CACvDL,SAAS,CAAEA,CAAU,CACrBC,iBAAiB,CAAEA,CAAkB,CACrCH,WAAW,CAAEA,CAAY,CACzBM,UAAU,CAAEA,CAAW,CACvBL,gBAAgB,CAAEA,CAAiB,CACnCa,cAAc,CAAEA,CAAe,CAC/BC,aAAa,CAAEA,CAAc,CAC7BF,IAAI,CAAEA,CAAK,CACZ,CACa,CAEnB,CACa,CAEnB,CACE,CAET,CAAC,CAED,MAAO,MAAM,CAAAsB,MAAM,CAAGlD,UAAU,CAACM,YAAY,CAAoB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{AnimateIconSwitcherProvider}from"@consta/icons/AnimateIconSwitcherProvider";import{IconArrowDown}from"@consta/icons/IconArrowDown";import{withAnimateSwitcherHOC}from"@consta/icons/withAnimateSwitcherHOC";import{Button}from"@consta/uikit/Button";import React from"react";const IconArrow=withAnimateSwitcherHOC({startIcon:IconArrowDown,startDirection:0,endDirection:180});export const NavbarArrow=({open:a,onClick:b})=>React.createElement(AnimateIconSwitcherProvider,{active:a},React.createElement(Button,{size:"xs",iconLeft:IconArrow,onClick:a=>{a.preventDefault(),a.stopPropagation(),b(a)},view:"clear",onlyIcon:!0,tabIndex:-1}));
|
|
2
|
+
//# sourceMappingURL=NavbarArrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarArrow.js","names":["AnimateIconSwitcherProvider","IconArrowDown","withAnimateSwitcherHOC","Button","React","IconArrow","startIcon","startDirection","endDirection","NavbarArrow","open","onClick","createElement","active","size","iconLeft","e","preventDefault","stopPropagation","view","onlyIcon","tabIndex"],"sources":["../../../../../../src/components/NavbarCanary/NavbarArrow/NavbarArrow.tsx"],"sourcesContent":["import { AnimateIconSwitcherProvider } from '@consta/icons/AnimateIconSwitcherProvider';\nimport { IconArrowDown } from '@consta/icons/IconArrowDown';\nimport { withAnimateSwitcherHOC } from '@consta/icons/withAnimateSwitcherHOC';\nimport { Button } from '@consta/uikit/Button';\nimport React from 'react';\n\nconst IconArrow = withAnimateSwitcherHOC({\n startIcon: IconArrowDown,\n startDirection: 0,\n endDirection: 180,\n});\n\nexport const NavbarArrow = ({\n open,\n onClick,\n}: {\n open: boolean;\n onClick: React.MouseEventHandler;\n}) => (\n <AnimateIconSwitcherProvider active={open}>\n <Button\n size=\"xs\"\n iconLeft={IconArrow}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n onClick(e);\n }}\n view=\"clear\"\n onlyIcon\n tabIndex={-1}\n />\n </AnimateIconSwitcherProvider>\n);\n"],"mappings":"AAAA,OAASA,2BAA2B,KAAQ,2CAA2C,CACvF,OAASC,aAAa,KAAQ,6BAA6B,CAC3D,OAASC,sBAAsB,KAAQ,sCAAsC,CAC7E,OAASC,MAAM,KAAQ,sBAAsB,CAC7C,MAAO,CAAAC,KAAK,KAAM,OAAO,CAEzB,KAAM,CAAAC,SAAS,CAAGH,sBAAsB,CAAC,CACvCI,SAAS,CAAEL,aAAa,CACxBM,cAAc,CAAE,CAAC,CACjBC,YAAY,CAAE,GAChB,CAAC,CAAC,CAEF,MAAO,MAAM,CAAAC,WAAW,CAAGA,CAAC,CAC1BC,IAAI,CAAJA,CAAI,CACJC,OAAO,CAAPA,CAIF,CAAC,GACCP,KAAA,CAAAQ,aAAA,CAACZ,2BAA2B,EAACa,MAAM,CAAEH,CAAK,EACxCN,KAAA,CAAAQ,aAAA,CAACT,MAAM,EACLW,IAAI,CAAC,IAAI,CACTC,QAAQ,CAAEV,SAAU,CACpBM,OAAO,CAAGK,CAAC,EAAK,CACdA,CAAC,CAACC,cAAc,CAAC,CAAC,CAClBD,CAAC,CAACE,eAAe,CAAC,CAAC,CACnBP,CAAO,CAACK,CAAC,CACX,CAAE,CACFG,IAAI,CAAC,OAAO,CACZC,QAAQ,IACRC,QAAQ,CAAE,CAAC,CAAE,CACd,CAC0B,CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarArrow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarArrow/index.ts"],"sourcesContent":["export * from './NavbarArrow';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","onItemClick","groups","getItemLabel","getItemIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemActive","getItemRef","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","size","form","getItemSubMenu","sortGroup","className","getItemStatus"];import{getGroups}from"@consta/uikit/__internal__/src/utils/getGroups";import{renderHeader}from"@consta/uikit/ListCanary";import React,{forwardRef,useMemo}from"react";import{withDefaultGetters}from"../helpers";import{NavbarItem}from"../NavbarItem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const NavbarRender=(a,b)=>{const c=withDefaultGetters(a),{items:d,onItemClick:e,groups:f,getItemLabel:g,getItemIcon:h,getItemRightSide:i,getItemAs:j,getItemAttributes:k,getItemGroupKey:l,getItemActive:m,getItemRef:n,getItemAdditionalClassName:o,getGroupKey:p,getGroupLabel:q,getGroupRightSide:r,getGroupAdditionalClassName:s,size:x=defaultNavbarPropSize,form:y=defaultNavbarPropForm,getItemSubMenu:t,sortGroup:u,className:v,getItemStatus:w}=c,z=_objectWithoutProperties(c,_excluded),A=useMemo(()=>getGroups(d,l,f,p,u),[f,d]);return React.createElement("div",Object.assign({},z,{ref:b,className:v}),A.map((a,b)=>React.createElement(React.Fragment,{key:a.key},renderHeader(a.group&&q(a.group),0===b,x,a.group&&r(a.group),{pV:"xs",mH:"m",mB:"2xs"},void 0,s&&a.group&&s(a.group)),a.items.map((b,c)=>React.createElement(React.Fragment,{key:`${a.key}-${c}`},React.createElement(NavbarItem,{size:x,item:b,level:0,onItemClick:e,getItemLabel:g,getItemActive:m,getItemAdditionalClassName:o,getItemAs:j,getItemAttributes:k,getItemIcon:h,getItemRef:n,getItemRightSide:i,getItemSubMenu:t,form:y,getItemStatus:w}))))))};export const Navbar=forwardRef(NavbarRender);
|
|
2
|
+
//# sourceMappingURL=NavbarDrawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarDrawer.js","names":["getGroups","renderHeader","React","forwardRef","useMemo","withDefaultGetters","NavbarItem","defaultNavbarPropForm","defaultNavbarPropSize","NavbarRender","props","ref","c","items","onItemClick","groups","groupsProp","getItemLabel","getItemIcon","getItemRightSide","getItemAs","getItemAttributes","getItemGroupKey","getItemActive","getItemRef","getItemAdditionalClassName","getGroupKey","getGroupLabel","getGroupRightSide","getGroupAdditionalClassName","size","form","getItemSubMenu","sortGroup","className","getItemStatus","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","map","group","groupIndex","Fragment","key","pV","mH","mB","item","index","level","Navbar"],"sources":["../../../../../../src/components/NavbarCanary/NavbarItem/NavbarDrawer.tsx"],"sourcesContent":["import { getGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { renderHeader } from '@consta/uikit/ListCanary';\nimport React, { forwardRef, useMemo } from 'react';\n\nimport { withDefaultGetters } from '../helpers';\nimport { NavbarItem } from '../NavbarItem';\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarComponent,\n NavbarProps,\n} from '../types';\n\nconst NavbarRender = (props: NavbarProps, ref: React.Ref<HTMLDivElement>) => {\n const {\n items,\n onItemClick,\n groups: groupsProp,\n getItemLabel,\n getItemIcon,\n getItemRightSide,\n getItemAs,\n getItemAttributes,\n getItemGroupKey,\n getItemActive,\n getItemRef,\n getItemAdditionalClassName,\n getGroupKey,\n getGroupLabel,\n getGroupRightSide,\n getGroupAdditionalClassName,\n size = defaultNavbarPropSize,\n form = defaultNavbarPropForm,\n getItemSubMenu,\n sortGroup,\n className,\n getItemStatus,\n ...otherProps\n } = withDefaultGetters(props);\n\n const groups = useMemo(\n () => getGroups(items, getItemGroupKey, groupsProp, getGroupKey, sortGroup),\n [groupsProp, items],\n );\n\n return (\n <div {...otherProps} ref={ref} className={className}>\n {groups.map((group, groupIndex) => {\n return (\n <React.Fragment key={group.key}>\n {renderHeader(\n group.group && getGroupLabel(group.group),\n groupIndex === 0,\n size,\n group.group && getGroupRightSide(group.group),\n { pV: 'xs', mH: 'm', mB: '2xs' },\n undefined,\n getGroupAdditionalClassName &&\n group.group &&\n getGroupAdditionalClassName(group.group),\n )}\n {group.items.map((item, index) => {\n return (\n <React.Fragment key={`${group.key}-${index}`}>\n <NavbarItem\n size={size}\n item={item}\n level={0}\n onItemClick={onItemClick}\n getItemLabel={getItemLabel}\n getItemActive={getItemActive}\n getItemAdditionalClassName={getItemAdditionalClassName}\n getItemAs={getItemAs}\n getItemAttributes={getItemAttributes}\n getItemIcon={getItemIcon}\n getItemRef={getItemRef}\n getItemRightSide={getItemRightSide}\n getItemSubMenu={getItemSubMenu}\n form={form}\n getItemStatus={getItemStatus}\n />\n </React.Fragment>\n );\n })}\n </React.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BM,UAAU,CAAEA,CAAW,CACvBL,gBAAgB,CAAEA,CAAiB,CACnCa,cAAc,CAAEA,CAAe,CAC/BD,IAAI,CAAEA,CAAK,CACXI,aAAa,CAAEA,CAAc,CAC9B,CACa,CAEnB,CACa,CAEnB,CACE,CAET,CAAC,CAED,MAAO,MAAM,CAAAkB,MAAM,CAAGlD,UAAU,CAACM,YAAY,CAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--NavbarItem{transition:background .15s}.che--NavbarItem.ListItem{color:var(--color-control-typo-clear)}.che--NavbarItem_active.ListItem{color:var(--color-control-typo-secondary)}.che--NavbarItem_active.ListItem:hover{color:var(--color-control-typo-secondary-hover)}.che--NavbarItem_form_brick{border-radius:0}.che--NavbarItem_form_round{border-radius:99rem}.che--NavbarItem_form_default{border-radius:var(--control-radius)}.che--NavbarItem.MixSpace{--space-padding-left:calc(var(--navbar-item-ph) + var(--navbar-item-level)*(var(--navbar-item-level-space) + var(--space-2xs)))}.che--NavbarItem.MixSpace:last-child{--space-margin-bottom:0}.che--NavbarItem .ListItemGrid-Slot_position_center{min-height:var(--control-height-xs)}.che--NavbarItem .ListItemGrid-Slot_position_left{padding-right:var(--space-2xs)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./NavbarItem.css";import{Badge}from"@consta/uikit/Badge";import{ListItem}from"@consta/uikit/ListCanary";import{useFlag}from"@consta/uikit/useFlag";import{useForkRef}from"@consta/uikit/useForkRef";import React,{forwardRef}from"react";import{cn}from"../../../utils/bem";import{NavbarArrow}from"../NavbarArrow";import{defaultNavbarPropSize}from"../types";const cnNavbarItem=cn("NavbarItem"),spaceMap={m:{pV:"s",pH:"m",mB:"2xs"},s:{pV:"xs",pH:"m",mB:"2xs"}},mapLevelSpace={m:"2xl",s:"xl"},bageSizeMap={s:"xs",m:"s"},NavbarItemRender=(a,b)=>{const{size:q=defaultNavbarPropSize,item:c,getItemLabel:d,getItemActive:e,getItemAdditionalClassName:f,getItemAs:g,getItemAttributes:h,getItemIcon:i,getItemRef:j,getItemRightSide:k,getItemSubMenu:l,onItemClick:m,className:n,getItemStatus:o,level:r=0,form:p}=a,[s,t]=useFlag(),u=null===l||void 0===l?void 0:l(c),v=null===k||void 0===k?void 0:k(c),w=null===e||void 0===e?void 0:e(c),x=null===o||void 0===o?void 0:o(c);return React.createElement(React.Fragment,null,React.createElement(ListItem,Object.assign({},(null===h||void 0===h?void 0:h(c))||{},{label:d(c),size:q,onClick:a=>{(null===u||void 0===u?void 0:u.length)&&t.toggle(),null===m||void 0===m?void 0:m(c,{e:a})},leftIcon:null===i||void 0===i?void 0:i(c),iconSize:q,rightSide:[...(Array.isArray(v)?v:[v]),x?React.createElement(Badge,{size:bageSizeMap[q],status:x,minified:!0}):void 0,null!==u&&void 0!==u&&u.length?React.createElement(NavbarArrow,{open:s,onClick:t.toggle}):void 0],as:null===g||void 0===g?void 0:g(c),active:w,ref:useForkRef([null===j||void 0===j?void 0:j(c),b]),className:cnNavbarItem({form:p,active:w},[n,null===f||void 0===f?void 0:f(c)]),space:spaceMap[q],style:{"--navbar-item-level":r,"--navbar-item-ph":`var(--space-${spaceMap[q].pH})`,"--navbar-item-level-space":`var(--space-${mapLevelSpace[q]})`}})),s&&(null===u||void 0===u?void 0:u.map((b,c)=>React.createElement(NavbarItem,Object.assign({},a,{key:c,level:r+1,item:b})))))};export const NavbarItem=forwardRef(NavbarItemRender);
|
|
2
|
+
//# sourceMappingURL=NavbarItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarItem.js","names":["Badge","ListItem","useFlag","useForkRef","React","forwardRef","cn","NavbarArrow","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","mapLevelSpace","bageSizeMap","NavbarItemRender","props","ref","size","item","getItemLabel","getItemActive","getItemAdditionalClassName","getItemAs","getItemAttributes","getItemIcon","getItemRef","getItemRightSide","getItemSubMenu","onItemClick","className","getItemStatus","level","form","open","setOpen","subItems","rightSide","active","status","createElement","Fragment","Object","assign","label","onClick","e","length","toggle","leftIcon","iconSize","Array","isArray","minified","as","space","style","\"--navbar-item-level\"","\"--navbar-item-ph\"","\"--navbar-item-level-space\"","map","index","NavbarItem","key"],"sources":["../../../../../../src/components/NavbarCanary/NavbarItem/NavbarItem.tsx"],"sourcesContent":["import './NavbarItem.css';\n\nimport { Badge } from '@consta/uikit/Badge';\nimport { ListItem } from '@consta/uikit/ListCanary';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport React, { forwardRef } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { NavbarArrow } from '../NavbarArrow';\nimport {\n defaultNavbarPropSize,\n NavbarItemComponent,\n NavbarItemProps,\n} from '../types';\n\nconst cnNavbarItem = cn('NavbarItem');\n\nconst spaceMap = {\n m: { pV: 's', pH: 'm', mB: '2xs' },\n s: { pV: 'xs', pH: 'm', mB: '2xs' },\n} as const;\n\nconst mapLevelSpace = {\n m: '2xl',\n s: 'xl',\n} as const;\n\nconst bageSizeMap = {\n s: 'xs',\n m: 's',\n} as const;\n\nconst NavbarItemRender = (\n props: NavbarItemProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n size = defaultNavbarPropSize,\n item,\n getItemLabel,\n getItemActive,\n getItemAdditionalClassName,\n getItemAs,\n getItemAttributes,\n getItemIcon,\n getItemRef,\n getItemRightSide,\n getItemSubMenu,\n onItemClick,\n className,\n getItemStatus,\n level = 0,\n form,\n } = props;\n\n const [open, setOpen] = useFlag();\n const subItems = getItemSubMenu?.(item);\n const rightSide = getItemRightSide?.(item);\n const active = getItemActive?.(item);\n const status = getItemStatus?.(item);\n\n return (\n <>\n <ListItem\n {...(getItemAttributes?.(item) || {})}\n label={getItemLabel(item)}\n size={size}\n onClick={(e: React.MouseEvent) => {\n subItems?.length && setOpen.toggle();\n onItemClick?.(item, { e });\n }}\n leftIcon={getItemIcon?.(item)}\n iconSize={size}\n rightSide={[\n ...(Array.isArray(rightSide) ? rightSide : [rightSide]),\n status ? (\n <Badge size={bageSizeMap[size]} status={status} minified />\n ) : undefined,\n subItems?.length ? (\n <NavbarArrow open={open} onClick={setOpen.toggle} />\n ) : undefined,\n ]}\n as={getItemAs?.(item)}\n active={active}\n ref={useForkRef([getItemRef?.(item), ref])}\n className={cnNavbarItem({ form, active }, [\n className,\n getItemAdditionalClassName?.(item),\n ])}\n space={spaceMap[size]}\n style={{\n ['--navbar-item-level' as string]: level,\n ['--navbar-item-ph' as string]: `var(--space-${spaceMap[size].pH})`,\n ['--navbar-item-level-space' as string]: `var(--space-${mapLevelSpace[size]})`,\n }}\n />\n {open &&\n subItems?.map((item, index) => (\n <NavbarItem {...props} key={index} level={level + 1} item={item} />\n ))}\n </>\n );\n};\n\nexport const NavbarItem = forwardRef(NavbarItemRender) as NavbarItemComponent;\n"],"mappings":"AAAA,yBAEA,OAASA,KAAK,KAAQ,qBAAqB,CAC3C,OAASC,QAAQ,KAAQ,0BAA0B,CACnD,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,OAASC,UAAU,KAAQ,0BAA0B,CACrD,MAAO,CAAAC,KAAK,EAAIC,UAAU,KAAQ,OAAO,CAEzC,OAASC,EAAE,0BAEX,OAASC,WAAW,sBACpB,OACEC,qBAAqB,gBAGL,KAEZ,CAAAC,YAAY,CAAGH,EAAE,CAAC,YAAY,CAAC,CAE/BI,QAAQ,CAAG,CACfC,CAAC,CAAE,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CAAC,CAClCC,CAAC,CAAE,CAAEH,EAAE,CAAE,IAAI,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CACpC,CAAU,CAEJE,aAAa,CAAG,CACpBL,CAAC,CAAE,KAAK,CACRI,CAAC,CAAE,IACL,CAAU,CAEJE,WAAW,CAAG,CAClBF,CAAC,CAAE,IAAI,CACPJ,CAAC,CAAE,G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CAAE,CACtBsC,KAAK,CAAE,CACLC,qBAAA,CAAmCzB,CAAK,CACxC0B,kBAAA,CAAiC,eAAcnD,QAAQ,CAACW,CAAI,CAAC,CAACR,EAAG,GAAE,CACnEiD,2BAAA,CAA0C,eAAc9C,aAAa,CAACK,CAAI,CAAE,GAC9E,CAAE,EACH,CAAC,CACDgB,CAAI,UACHE,CAAQ,WAARA,CAAQ,QAARA,CAAQ,CAAEwB,GAAG,CAAC,CAACzC,CAAI,CAAE0C,CAAK,GACxB5D,KAAA,CAAAuC,aAAA,CAACsB,UAAU,CAAApB,MAAA,CAAAC,MAAA,IAAK3B,CAAK,EAAE+C,GAAG,CAAEF,CAAM,CAAC7B,KAAK,CAAEA,CAAK,CAAG,CAAE,CAACb,IAAI,CAAEA,CAAK,EAAE,CACnE,CAAC,CACJ,CAEN,CAAC,CAED,MAAO,MAAM,CAAA2C,UAAU,CAAG5D,UAAU,CAACa,gBAAgB,CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarItem/index.ts"],"sourcesContent":["export * from './NavbarItem';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--NavbarMixDriverLeftAnimate{transition:opacity var(--navbar-animate-transition-timeout,.2s),transform var(--navbar-animate-transition-timeout,.2s)}.che--NavbarMixDriverLeftAnimate_menu_rail{--navbar-animate-transform-exited:translateX(calc(var(--navbar-animate-menu-rail-width)*-1));width:var(--navbar-animate-menu-rail-width)}.che--NavbarMixDriverLeftAnimate_menu_draver{--navbar-animate-transform-exited:translateX(calc(var(--navbar-animate-menu-draver-width)));width:var(--navbar-animate-menu-draver-width)}.che--NavbarMixDriverLeftAnimate_animate_entered,.che--NavbarMixDriverLeftAnimate_animate_entering{opacity:1;transform:translateX(0)}.che--NavbarMixDriverLeftAnimate_animate_exited,.che--NavbarMixDriverLeftAnimate_animate_exiting{opacity:0;position:absolute;transform:var(--navbar-animate-transform-exited)}.che--NavbarMixDriverLeftAnimate_animate_entering,.che--NavbarMixDriverLeftAnimate_animate_exiting{pointer-events:none}.che--NavbarMixDriverLeftAnimate_animate_entering{position:absolute}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './NavbarMixDriverLeftAnimate.css';
|
|
2
|
+
type Mods = {
|
|
3
|
+
animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';
|
|
4
|
+
menu: 'rail' | 'draver';
|
|
5
|
+
};
|
|
6
|
+
type Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;
|
|
7
|
+
export declare const cnNavbarMixDriverLeftAnimate: Cn;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarMixDriverLeftAnimate.js","names":["cn","cnNavbarMixDriverLeftAnimate"],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixDriverLeftAnimate/NavbarMixDriverLeftAnimate.ts"],"sourcesContent":["import './NavbarMixDriverLeftAnimate.css';\n\nimport { cn } from '##/utils/bem';\n\ntype Mods = {\n animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';\n menu: 'rail' | 'draver';\n};\n\ntype Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;\n\nexport const cnNavbarMixDriverLeftAnimate: Cn = cn(\n 'NavbarMixDriverLeftAnimate',\n);\n"],"mappings":"AAAA,yCAEA,OAASA,EAAE,0BASX,MAAO,MAAM,CAAAC,4BAAgC,CAAGD,EAAE,CAChD,4BACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarMixDriverLeftAnimate';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixDriverLeftAnimate/index.ts"],"sourcesContent":["export * from './NavbarMixDriverLeftAnimate';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--NavbarMixDriverRightAnimate{transition:opacity var(--navbar-animate-transition-timeout,.2s),transform var(--navbar-animate-transition-timeout,.2s)}.che--NavbarMixDriverRightAnimate_menu_rail{--navbar-animate-transform-exited:translateX(var(--navbar-animate-menu-draver-width));width:var(--navbar-animate-menu-rail-width)}.che--NavbarMixDriverRightAnimate_menu_draver{--navbar-animate-transform-exited:translateX(calc(var(--navbar-animate-menu-draver-width)*-1));width:var(--navbar-animate-menu-draver-width)}.che--NavbarMixDriverRightAnimate_animate_entered,.che--NavbarMixDriverRightAnimate_animate_entering{opacity:1;transform:translateX(0)}.che--NavbarMixDriverRightAnimate_animate_exited,.che--NavbarMixDriverRightAnimate_animate_exiting{opacity:0;position:absolute;transform:var(--navbar-animate-transform-exited)}.che--NavbarMixDriverRightAnimate_animate_entering,.che--NavbarMixDriverRightAnimate_animate_exiting{pointer-events:none}.che--NavbarMixDriverRightAnimate_animate_entering{position:absolute}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './NavbarMixDriverRightAnimate.css';
|
|
2
|
+
type Mods = {
|
|
3
|
+
animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';
|
|
4
|
+
menu: 'rail' | 'draver';
|
|
5
|
+
};
|
|
6
|
+
type Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;
|
|
7
|
+
export declare const cnNavbarMixDriverRightAnimate: Cn;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarMixDriverRightAnimate.js","names":["cn","cnNavbarMixDriverRightAnimate"],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixDriverRightAnimate/NavbarMixDriverRightAnimate.ts"],"sourcesContent":["import './NavbarMixDriverRightAnimate.css';\n\nimport { cn } from '##/utils/bem';\n\ntype Mods = {\n animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';\n menu: 'rail' | 'draver';\n};\n\ntype Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;\n\nexport const cnNavbarMixDriverRightAnimate: Cn = cn(\n 'NavbarMixDriverRightAnimate',\n);\n"],"mappings":"AAAA,0CAEA,OAASA,EAAE,0BASX,MAAO,MAAM,CAAAC,6BAAiC,CAAGD,EAAE,CACjD,6BACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarMixDriverRightAnimate';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixDriverRightAnimate/index.ts"],"sourcesContent":["export * from './NavbarMixDriverRightAnimate';\n"],"mappings":"AAAA"}
|
package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--NavbarMixFadeAnimate{transition:opacity var(--navbar-animate-transition-timeout,.2s) var(--navbar-animate-opacity-fn)}.che--NavbarMixFadeAnimate_menu_rail{width:var(--navbar-animate-menu-rail-width)}.che--NavbarMixFadeAnimate_menu_draver{width:var(--navbar-animate-menu-draver-width)}.che--NavbarMixFadeAnimate_animate_entered,.che--NavbarMixFadeAnimate_animate_entering{--navbar-animate-opacity-fn:cubic-bezier(0.13,0.26,0.58,1);opacity:1}.che--NavbarMixFadeAnimate_animate_exited,.che--NavbarMixFadeAnimate_animate_exiting{--navbar-animate-opacity-fn:cubic-bezier(0.4,0,1,1);opacity:0;position:absolute}.che--NavbarMixFadeAnimate_animate_entering,.che--NavbarMixFadeAnimate_animate_exiting{pointer-events:none}.che--NavbarMixFadeAnimate_animate_entering{position:absolute}
|
package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './NavbarMixFadeAnimate.css';
|
|
2
|
+
type Mods = {
|
|
3
|
+
animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';
|
|
4
|
+
menu: 'rail' | 'draver';
|
|
5
|
+
};
|
|
6
|
+
type Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;
|
|
7
|
+
export declare const cnNavbarMixFadeAnimate: Cn;
|
|
8
|
+
export {};
|
package/__internal__/src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarMixFadeAnimate.js","names":["cn","cnNavbarMixFadeAnimate"],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixFadeAnimate/NavbarMixFadeAnimate.ts"],"sourcesContent":["import './NavbarMixFadeAnimate.css';\n\nimport { cn } from '##/utils/bem';\n\ntype Mods = {\n animate?: 'entered' | 'entering' | 'exiting' | 'exited' | 'unmounted';\n menu: 'rail' | 'draver';\n};\n\ntype Cn = (mods?: Mods | null, mix?: Array<string | undefined>) => string;\n\nexport const cnNavbarMixFadeAnimate: Cn = cn('NavbarMixFadeAnimate');\n"],"mappings":"AAAA,mCAEA,OAASA,EAAE,0BASX,MAAO,MAAM,CAAAC,sBAA0B,CAAGD,EAAE,CAAC,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarMixFadeAnimate';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarMixFadeAnimate/index.ts"],"sourcesContent":["export * from './NavbarMixFadeAnimate';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import React,{forwardRef}from"react";import{withDefaultRailGetters}from"../helpers";import{NavbarRailItem}from"../NavbarRailItem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const NavbarRailRender=(a,b)=>{const c=withDefaultRailGetters(a),{items:d,onItemClick:f,getItemLabel:g,getItemIcon:h,getItemAs:i,getItemAttributes:j,getItemActive:k,getItemRef:l,getItemAdditionalClassName:m,size:r=defaultNavbarPropSize,form:s=defaultNavbarPropForm,className:n,getItemStatus:o,tooltipProps:p,getItemTooltip:q}=c,t=_objectWithoutProperties(c,_excluded);return React.createElement("div",Object.assign({},t,{ref:b,className:n}),d.map((a,b)=>React.createElement(NavbarRailItem,Object.assign({},(null===j||void 0===j?void 0:j(a))||{},{key:b,as:null===i||void 0===i?void 0:i(a),size:r,form:s,onClick:b=>null===f||void 0===f?void 0:f(a,{e:b}),icon:h(a),ref:null===l||void 0===l?void 0:l(a),label:g(a),tooltipProps:_objectSpread(_objectSpread({},p),{},{content:q(a)}),active:k(a),status:o(a)}))))};export const NavbarRail=forwardRef(NavbarRailRender);
|
|
2
|
+
//# sourceMappingURL=NavbarRail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarRail.js","names":["React","forwardRef","withDefaultRailGetters","NavbarRailItem","defaultNavbarPropForm","defaultNavbarPropSize","NavbarRailRender","props","ref","c","items","onItemClick","getItemLabel","getItemIcon","getItemAs","getItemAttributes","getItemActive","getItemRef","getItemAdditionalClassName","size","form","className","getItemStatus","tooltipProps","getItemTooltip","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","map","item","index","key","as","onClick","e","icon","label","_objectSpread","content","active","status","NavbarRail"],"sources":["../../../../../../src/components/NavbarCanary/NavbarRail/NavbarRail.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { withDefaultRailGetters } from '../helpers';\nimport { NavbarRailItem } from '../NavbarRailItem';\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarRailComponent,\n NavbarRailProps,\n} from '../types';\n\nconst NavbarRailRender = (\n props: NavbarRailProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n onItemClick,\n getItemLabel,\n getItemIcon,\n getItemAs,\n getItemAttributes,\n getItemActive,\n getItemRef,\n getItemAdditionalClassName,\n size = defaultNavbarPropSize,\n form = defaultNavbarPropForm,\n className,\n getItemStatus,\n tooltipProps,\n getItemTooltip,\n\n ...otherProps\n } = withDefaultRailGetters(props);\n\n return (\n <div {...otherProps} ref={ref} className={className}>\n {items.map((item, index) => {\n return (\n <NavbarRailItem\n {...((getItemAttributes?.(item) ||\n {}) as JSX.IntrinsicElements['div'])}\n key={index}\n as={getItemAs?.(item)}\n size={size}\n form={form}\n onClick={(e) => onItemClick?.(item, { e })}\n icon={getItemIcon(item)}\n ref={getItemRef?.(item) as React.RefObject<HTMLDivElement>}\n label={getItemLabel(item)}\n tooltipProps={{ ...tooltipProps, content: getItemTooltip(item) }}\n active={getItemActive(item)}\n status={getItemStatus(item)}\n />\n );\n })}\n </div>\n );\n};\n\nexport const NavbarRail = forwardRef(NavbarRailRender) as NavbarRailComponent;\n"],"mappings":"m+BAAA,MAAO,CAAAA,KAAK,EAAIC,UAAU,KAAQ,OAAO,CAEzC,OAASC,sBAAsB,kBAC/B,OAASC,cAAc,yBACvB,OACEC,qBAAqB,CACrBC,qBAAqB,gBAKvB,KAAM,CA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AC,CAAE,CAC3CC,IAAI,CAAEzB,CAAW,CAACmB,CAAI,CAAE,CACxBxB,GAAG,QAAES,CAAU,WAAVA,CAAU,QAAVA,CAAU,CAAGe,CAAI,CAAqC,CAC3DO,KAAK,CAAE3B,CAAY,CAACoB,CAAI,CAAE,CAC1BT,YAAY,CAAAiB,aAAA,CAAAA,aAAA,IAAOjB,CAAY,MAAEkB,OAAO,CAAEjB,CAAc,CAACQ,CAAI,CAAC,EAAG,CACjEU,MAAM,CAAE1B,CAAa,CAACgB,CAAI,CAAE,CAC5BW,MAAM,CAAErB,CAAa,CAACU,CAAI,CAAE,EAC7B,CAEJ,CACE,CAET,CAAC,CAED,MAAO,MAAM,CAAAY,UAAU,CAAG3C,UAAU,CAACK,gBAAgB,CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarRail';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarRail/index.ts"],"sourcesContent":["export * from './NavbarRail';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.che--NavbarRailItem{align-items:center;color:var(--color-control-typo-clear);cursor:pointer;display:flex;flex-direction:column;transition:background .15s}.che--NavbarRailItem:hover{background:var(--color-control-bg-clear-hover)}.che--NavbarRailItem_active{background:var(--color-bg-stripe);color:var(--color-control-typo-secondary)}.che--NavbarRailItem_active:hover{color:var(--color-control-typo-secondary-hover)}.che--NavbarRailItem-IconWrapper{line-height:0;position:relative}.che--NavbarRailItem_size_s{--navbar-item-badge-offset:-5px}.che--NavbarRailItem_size_m{--navbar-item-badge-offset:-6px}.che--NavbarRailItem_form_brick{border-radius:0}.che--NavbarRailItem_form_round{border-radius:99rem}.che--NavbarRailItem_form_default{border-radius:var(--control-radius)}.che--NavbarRailItem-Label.Text{color:currentColor}.che--NavbarRailItem-Badge{position:absolute;right:var(--navbar-item-badge-offset);top:var(--navbar-item-badge-offset)}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import './NavbarRailItem.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NavbarRailItemProps } from '../types';
|
|
4
|
+
export declare const NavbarRailItem: import("@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes").ComponentWithAs<NavbarRailItemProps, "div"> | React.ComponentType<{
|
|
5
|
+
tooltipProps?: import("@consta/uikit/withTooltip").TooltipProps | undefined;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";const _excluded=["size","icon","status","form","active","label","as","className"];import"./NavbarRailItem.css";import{forwardRefWithAs}from"@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes";import{Badge}from"@consta/uikit/Badge";import{cnMixSpace}from"@consta/uikit/MixSpace";import{Text}from"@consta/uikit/Text";import{withTooltip}from"@consta/uikit/withTooltip";import React from"react";import{cn}from"../../../utils/bem";import{defaultNavbarPropForm,defaultNavbarPropSize}from"../types";const cnNavbarItem=cn("NavbarRailItem"),spaceMap={m:{pV:"s",pH:"m",mB:"2xs"},s:{pV:"xs",pH:"m",mB:"2xs"}},bageSizeMap={s:"xs",m:"s"},textSpaceMap={m:{mT:"xs"},s:{mT:"2xs"}},Item=forwardRefWithAs((a,b)=>{const{size:h=defaultNavbarPropSize,icon:c,status:d,form:i=defaultNavbarPropForm,active:e,label:f,as:j="div",className:g}=a,k=_objectWithoutProperties(a,_excluded);return React.createElement(j,Object.assign({},k,{ref:b,className:cnNavbarItem({size:h,form:i,active:e},[cnMixSpace(spaceMap[h]),g])}),React.createElement("div",{className:cnNavbarItem("IconWrapper")},c&&React.createElement(c,{size:h}),d&&React.createElement(Badge,{className:cnNavbarItem("Badge"),size:bageSizeMap[h],status:d,minified:!0})),f&&React.createElement(Text,{className:cnNavbarItem("Label",[cnMixSpace(textSpaceMap[h])]),align:"center",size:h},f))});export const NavbarRailItem=withTooltip({direction:"rightCenter",mode:"mouseover",possibleDirections:["rightCenter","rightDown","rightUp","rightStartDown","rightStartUp"],spareDirection:"rightCenter"})(Item);
|
|
2
|
+
//# sourceMappingURL=NavbarRailItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavbarRailItem.js","names":["forwardRefWithAs","Badge","cnMixSpace","Text","withTooltip","React","cn","defaultNavbarPropForm","defaultNavbarPropSize","cnNavbarItem","spaceMap","m","pV","pH","mB","s","bageSizeMap","textSpaceMap","mT","Item","props","ref","size","icon","Icon","status","form","active","label","as","className","otherProps","_objectWithoutProperties","_excluded","createElement","Object","assign","c","minified","align","NavbarRailItem","direction","mode","possibleDirections","spareDirection"],"sources":["../../../../../../src/components/NavbarCanary/NavbarRailItem/NavbarRailItem.tsx"],"sourcesContent":["import './NavbarRailItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { Badge } from '@consta/uikit/Badge';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport { withTooltip } from '@consta/uikit/withTooltip';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport {\n defaultNavbarPropForm,\n defaultNavbarPropSize,\n NavbarRailItemProps,\n} from '../types';\n\nconst cnNavbarItem = cn('NavbarRailItem');\n\nconst spaceMap = {\n m: { pV: 's', pH: 'm', mB: '2xs' },\n s: { pV: 'xs', pH: 'm', mB: '2xs' },\n} as const;\n\nconst bageSizeMap = {\n s: 'xs',\n m: 's',\n} as const;\n\nconst textSpaceMap = {\n m: { mT: 'xs' },\n s: { mT: '2xs' },\n} as const;\n\nconst Item = forwardRefWithAs<NavbarRailItemProps, 'div'>((props, ref) => {\n const {\n size = defaultNavbarPropSize,\n icon: Icon,\n status,\n form = defaultNavbarPropForm,\n active,\n label,\n as = 'div',\n className,\n ...otherProps\n } = props;\n\n const Tag = as as string;\n\n return (\n <Tag\n {...otherProps}\n ref={ref}\n className={cnNavbarItem({ size, form, active }, [\n cnMixSpace(spaceMap[size]),\n className,\n ])}\n >\n <div className={cnNavbarItem('IconWrapper')}>\n {Icon && <Icon size={size} />}\n {status && (\n <Badge\n className={cnNavbarItem('Badge')}\n size={bageSizeMap[size]}\n status={status}\n minified\n />\n )}\n </div>\n {label && (\n <Text\n className={cnNavbarItem('Label', [cnMixSpace(textSpaceMap[size])])}\n align=\"center\"\n size={size}\n >\n {label}\n </Text>\n )}\n </Tag>\n );\n});\n\nexport const NavbarRailItem = withTooltip({\n direction: 'rightCenter',\n mode: 'mouseover',\n possibleDirections: [\n 'rightCenter',\n 'rightDown',\n 'rightUp',\n 'rightStartDown',\n 'rightStartUp',\n ],\n spareDirection: 'rightCenter',\n})(Item);\n"],"mappings":"uKAAA,6BAEA,OAASA,gBAAgB,KAAQ,kEAAkE,CACnG,OAASC,KAAK,KAAQ,qBAAqB,CAC3C,OAASC,UAAU,KAAQ,wBAAwB,CACnD,OAASC,IAAI,KAAQ,oBAAoB,CACzC,OAASC,WAAW,KAAQ,2BAA2B,CACvD,MAAO,CAAAC,KAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,0BAEX,OACEC,qBAAqB,CACrBC,qBAAqB,gBAEL,KAEZ,CAAAC,YAAY,CAAGH,EAAE,CAAC,gBAAgB,CAAC,CAEnCI,QAAQ,CAAG,CACfC,CAAC,CAAE,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CAAC,CAClCC,CAAC,CAAE,CAAEH,EAAE,CAAE,IAAI,CAAEC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,KAAM,CACpC,CAAU,CAEJE,WAAW,CAAG,CAClBD,CAAC,CAAE,IAAI,CACPJ,CAAC,CAAE,GACL,CAAU,CAEJM,YAAY,CAAG,CACnBN,CAAC,CAAE,CAAEO,EAAE,CAAE,IAAK,CAAC,CACfH,CAAC,CAAE,CAAEG,EAAE,CAAE,KA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CAAC,CAAC,CAAC,CAAE,CACnEiB,KAAK,CAAC,QAAQ,CACdjB,IAAI,CAAEA,CAAK,EAEVM,CACG,CAEL,CAET,CAAC,CAAC,CAEF,MAAO,MAAM,CAAAY,cAAc,CAAGpC,WAAW,CAAC,CACxCqC,SAAS,CAAE,aAAa,CACxBC,IAAI,CAAE,WAAW,CACjBC,kBAAkB,CAAE,CAClB,aAAa,CACb,WAAW,CACX,SAAS,CACT,gBAAgB,CAChB,cAAc,CACf,CACDC,cAAc,CAAE,aAClB,CAAC,CAAC,CAACzB,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NavbarRailItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/NavbarCanary/NavbarRailItem/index.ts"],"sourcesContent":["export * from './NavbarRailItem';\n"],"mappings":"AAAA"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DefaultNavbarGroup, DefaultNavbarItem, DefaultNavbarRailItem, NavbarPropGetGroupKey, NavbarPropGetGroupLabel, NavbarPropGetGroupRightSide, NavbarPropGetItemActive, NavbarPropGetItemGroupId, NavbarPropGetItemIcon, NavbarPropGetItemLabel, NavbarPropGetItemRightSide, NavbarPropGetItemStatus, NavbarPropGetItemSubMenu, NavbarProps, NavbarRailPropGetItemTooltip, NavbarRailProps } from './types';
|
|
3
|
+
export declare function withDefaultGetters<ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup>(props: NavbarProps<ITEM, GROUP>): {
|
|
4
|
+
items: ITEM[];
|
|
5
|
+
size?: "m" | "s" | undefined;
|
|
6
|
+
form?: "default" | "brick" | "round" | undefined;
|
|
7
|
+
onItemClick?: import("./types").NavbarPropOnItemClick<ITEM> | undefined;
|
|
8
|
+
getItemLabel?: NavbarPropGetItemLabel<ITEM> | undefined;
|
|
9
|
+
getItemIcon?: NavbarPropGetItemIcon<ITEM> | undefined;
|
|
10
|
+
getItemActive?: NavbarPropGetItemActive<ITEM> | undefined;
|
|
11
|
+
getItemRightSide?: NavbarPropGetItemRightSide<ITEM> | undefined;
|
|
12
|
+
getItemStatus?: NavbarPropGetItemStatus<ITEM> | undefined;
|
|
13
|
+
getItemGroupKey?: NavbarPropGetItemGroupId<ITEM> | undefined;
|
|
14
|
+
getItemAs?: import("./types").NavbarPropGetItemAs<ITEM> | undefined;
|
|
15
|
+
getItemAttributes?: import("./types").NavbarPropGetItemAttributes<ITEM> | undefined;
|
|
16
|
+
getItemRef?: import("./types").NavbarPropGetItemRef<ITEM> | undefined;
|
|
17
|
+
getItemSubMenu?: NavbarPropGetItemSubMenu<ITEM> | undefined;
|
|
18
|
+
getItemAdditionalClassName?: import("./types").NavbarPropGetItemAdditionalClassName<ITEM> | undefined;
|
|
19
|
+
groups?: GROUP[] | undefined;
|
|
20
|
+
getGroupKey?: NavbarPropGetGroupKey<GROUP> | undefined;
|
|
21
|
+
getGroupLabel?: NavbarPropGetGroupLabel<GROUP> | undefined;
|
|
22
|
+
getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP> | undefined;
|
|
23
|
+
sortGroup?: import("./types").NavbarPropSortGroup<ITEM, GROUP> | undefined;
|
|
24
|
+
getGroupAdditionalClassName?: import("./types").NavbarPropGetGroupAdditionalClassName<GROUP> | undefined;
|
|
25
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "onItemClick" | "getItemLabel" | "getItemIcon" | "form" | "size" | "getItemAs" | "getItemAttributes" | "groups" | "getItemSubMenu" | "getItemActive" | "getGroupKey" | "getGroupLabel" | "getItemRightSide" | "getItemGroupKey" | "getItemStatus" | "getItemRef" | "getItemAdditionalClassName" | "getGroupRightSide" | "sortGroup" | "getGroupAdditionalClassName"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
26
|
+
label: string;
|
|
27
|
+
} ? {} : {
|
|
28
|
+
getItemLabel: NavbarPropGetItemLabel<ITEM>;
|
|
29
|
+
}) & (GROUP extends {
|
|
30
|
+
id: string | number;
|
|
31
|
+
} ? {} : {
|
|
32
|
+
getGroupKey: NavbarPropGetGroupKey<GROUP>;
|
|
33
|
+
}) & {
|
|
34
|
+
getItemLabel: NavbarPropGetItemLabel<DefaultNavbarItem> | NavbarPropGetItemLabel<ITEM>;
|
|
35
|
+
getItemGroupKey: NavbarPropGetItemGroupId<DefaultNavbarItem> | NavbarPropGetItemGroupId<ITEM>;
|
|
36
|
+
getItemActive: NavbarPropGetItemActive<DefaultNavbarItem> | NavbarPropGetItemActive<ITEM>;
|
|
37
|
+
getItemIcon: NavbarPropGetItemIcon<DefaultNavbarItem> | NavbarPropGetItemIcon<ITEM>;
|
|
38
|
+
getItemRightSide: NavbarPropGetItemRightSide<DefaultNavbarItem> | NavbarPropGetItemRightSide<ITEM>;
|
|
39
|
+
getGroupLabel: NavbarPropGetGroupLabel<DefaultNavbarGroup> | NavbarPropGetGroupLabel<GROUP>;
|
|
40
|
+
getGroupKey: NavbarPropGetGroupKey<DefaultNavbarGroup> | NavbarPropGetGroupKey<GROUP>;
|
|
41
|
+
getGroupRightSide: NavbarPropGetGroupRightSide<DefaultNavbarGroup> | NavbarPropGetGroupRightSide<GROUP>;
|
|
42
|
+
getItemSubMenu: NavbarPropGetItemSubMenu<DefaultNavbarItem> | NavbarPropGetItemSubMenu<ITEM>;
|
|
43
|
+
getItemStatus: NavbarPropGetItemStatus<DefaultNavbarItem> | NavbarPropGetItemStatus<ITEM>;
|
|
44
|
+
};
|
|
45
|
+
export declare function withDefaultRailGetters<ITEM = NavbarRailProps>(props: NavbarRailProps<ITEM>): {
|
|
46
|
+
items: ITEM[];
|
|
47
|
+
size?: "m" | "s" | undefined;
|
|
48
|
+
form?: "default" | "brick" | "round" | undefined;
|
|
49
|
+
onItemClick?: import("./types").NavbarPropOnItemClick<ITEM> | undefined;
|
|
50
|
+
getItemLabel?: import("./types").NavbarRailPropGetItemLabel<ITEM> | undefined;
|
|
51
|
+
getItemIcon?: import("./types").NavbarRailPropGetItemIcon<ITEM> | undefined;
|
|
52
|
+
getItemActive?: NavbarPropGetItemActive<ITEM> | undefined;
|
|
53
|
+
getItemStatus?: NavbarPropGetItemStatus<ITEM> | undefined;
|
|
54
|
+
getItemAs?: import("./types").NavbarPropGetItemAs<ITEM> | undefined;
|
|
55
|
+
getItemAttributes?: import("./types").NavbarPropGetItemAttributes<ITEM> | undefined;
|
|
56
|
+
getItemRef?: import("./types").NavbarPropGetItemRef<ITEM> | undefined;
|
|
57
|
+
getItemAdditionalClassName?: import("./types").NavbarPropGetItemAdditionalClassName<ITEM> | undefined;
|
|
58
|
+
getItemTooltip?: NavbarRailPropGetItemTooltip<ITEM> | undefined;
|
|
59
|
+
tooltipProps?: Omit<import("@consta/uikit/Tooltip").TooltipProps, "children" | "position" | "anchorRef" | "equalAnchorWidth"> | undefined;
|
|
60
|
+
} & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "onItemClick" | "getItemLabel" | "getItemIcon" | "form" | "size" | "getItemAs" | "getItemAttributes" | "getItemActive" | "getItemStatus" | "getItemRef" | "getItemAdditionalClassName" | "getItemTooltip" | "tooltipProps"> & import("react").RefAttributes<HTMLDivElement> & (ITEM extends {
|
|
61
|
+
icon: import("@consta/icons/Icon").IconComponent<"span">;
|
|
62
|
+
} ? {} : {
|
|
63
|
+
getItemIcon: import("./types").NavbarRailPropGetItemIcon<ITEM>;
|
|
64
|
+
}) & {
|
|
65
|
+
getItemLabel: NavbarPropGetItemLabel<DefaultNavbarItem> | import("./types").NavbarRailPropGetItemLabel<ITEM>;
|
|
66
|
+
getItemActive: NavbarPropGetItemActive<DefaultNavbarItem> | NavbarPropGetItemActive<ITEM>;
|
|
67
|
+
getItemIcon: NavbarPropGetItemIcon<DefaultNavbarItem> | import("./types").NavbarRailPropGetItemIcon<ITEM>;
|
|
68
|
+
getItemStatus: NavbarPropGetItemStatus<DefaultNavbarItem> | NavbarPropGetItemStatus<ITEM>;
|
|
69
|
+
getItemTooltip: NavbarRailPropGetItemTooltip<DefaultNavbarRailItem> | NavbarRailPropGetItemTooltip<ITEM>;
|
|
70
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}const defaultGetItemLabel=a=>a.label,defaultGetItemActive=a=>a.active,defaultGetItemGroupKey=a=>a.groupId,defaultGetItemIcon=a=>a.icon,defaultGetItemRightSide=a=>a.rightSide,defaultGetGroupKey=a=>a.id,defaultGetItemSubMenu=a=>a.subMenu,defaultGetGroupLabel=a=>a.label,defaultGetGroupRightSide=a=>a.rightSide,defaultGetItemStatus=a=>a.status,defaultGetItemTooltip=a=>a.tooltip;export function withDefaultGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemGroupKey:a.getItemGroupKey||defaultGetItemGroupKey,getItemActive:a.getItemActive||defaultGetItemActive,getItemIcon:a.getItemIcon||defaultGetItemIcon,getItemRightSide:a.getItemRightSide||defaultGetItemRightSide,getGroupLabel:a.getGroupLabel||defaultGetGroupLabel,getGroupKey:a.getGroupKey||defaultGetGroupKey,getGroupRightSide:a.getGroupRightSide||defaultGetGroupRightSide,getItemSubMenu:a.getItemSubMenu||defaultGetItemSubMenu,getItemStatus:a.getItemStatus||defaultGetItemStatus})}export function withDefaultRailGetters(a){return _objectSpread(_objectSpread({},a),{},{getItemLabel:a.getItemLabel||defaultGetItemLabel,getItemActive:a.getItemActive||defaultGetItemActive,getItemIcon:a.getItemIcon||defaultGetItemIcon,getItemStatus:a.getItemStatus||defaultGetItemStatus,getItemTooltip:a.getItemTooltip||defaultGetItemTooltip})}
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","names":["defaultGetItemLabel","item","label","defaultGetItemActive","active","defaultGetItemGroupKey","groupId","defaultGetItemIcon","icon","defaultGetItemRightSide","rightSide","defaultGetGroupKey","group","id","defaultGetItemSubMenu","subMenu","defaultGetGroupLabel","defaultGetGroupRightSide","defaultGetItemStatus","status","defaultGetItemTooltip","tooltip","withDefaultGetters","props","_objectSpread","getItemLabel","getItemGroupKey","getItemActive","getItemIcon","getItemRightSide","getGroupLabel","getGroupKey","getGroupRightSide","getItemSubMenu","getItemStatus","withDefaultRailGetters","getItemTooltip"],"sources":["../../../../../src/components/NavbarCanary/helpers.ts"],"sourcesContent":["import {\n DefaultNavbarGroup,\n DefaultNavbarItem,\n DefaultNavbarRailItem,\n NavbarPropGetGroupKey,\n NavbarPropGetGroupLabel,\n NavbarPropGetGroupRightSide,\n NavbarPropGetItemActive,\n NavbarPropGetItemGroupId,\n NavbarPropGetItemIcon,\n NavbarPropGetItemLabel,\n NavbarPropGetItemRightSide,\n NavbarPropGetItemStatus,\n NavbarPropGetItemSubMenu,\n NavbarProps,\n NavbarRailPropGetItemTooltip,\n NavbarRailProps,\n} from './types';\n\nconst defaultGetItemLabel: NavbarPropGetItemLabel<DefaultNavbarItem> = (item) =>\n item.label;\n\nconst defaultGetItemActive: NavbarPropGetItemActive<DefaultNavbarItem> = (\n item,\n) => item.active;\n\nconst defaultGetItemGroupKey: NavbarPropGetItemGroupId<DefaultNavbarItem> = (\n item,\n) => item.groupId;\n\nconst defaultGetItemIcon: NavbarPropGetItemIcon<DefaultNavbarItem> = (item) =>\n item.icon;\nconst defaultGetItemRightSide: NavbarPropGetItemRightSide<DefaultNavbarItem> = (\n item,\n) => item.rightSide;\n\nconst defaultGetGroupKey: NavbarPropGetGroupKey<DefaultNavbarGroup> = (group) =>\n group.id;\n\nconst defaultGetItemSubMenu: NavbarPropGetItemSubMenu<DefaultNavbarItem> = (\n item,\n) => item.subMenu;\nconst defaultGetGroupLabel: NavbarPropGetGroupLabel<DefaultNavbarGroup> = (\n group,\n) => group.label;\nconst defaultGetGroupRightSide: NavbarPropGetGroupRightSide<\n DefaultNavbarGroup\n> = (group) => group.rightSide;\n\nconst defaultGetItemStatus: NavbarPropGetItemStatus<DefaultNavbarItem> = (\n item,\n) => item.status;\n\nconst defaultGetItemTooltip: NavbarRailPropGetItemTooltip<\n DefaultNavbarRailItem\n> = (item) => item.tooltip;\n\nexport function withDefaultGetters<\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n>(props: NavbarProps<ITEM, GROUP>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemGroupKey: props.getItemGroupKey || defaultGetItemGroupKey,\n getItemActive: props.getItemActive || defaultGetItemActive,\n getItemIcon: props.getItemIcon || defaultGetItemIcon,\n getItemRightSide: props.getItemRightSide || defaultGetItemRightSide,\n getGroupLabel: props.getGroupLabel || defaultGetGroupLabel,\n getGroupKey: props.getGroupKey || defaultGetGroupKey,\n getGroupRightSide: props.getGroupRightSide || defaultGetGroupRightSide,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n };\n}\n\nexport function withDefaultRailGetters<ITEM = NavbarRailProps>(\n props: NavbarRailProps<ITEM>,\n) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemActive: props.getItemActive || defaultGetItemActive,\n getItemIcon: props.getItemIcon || defaultGetItemIcon,\n getItemStatus: props.getItemStatus || defaultGetItemStatus,\n getItemTooltip: props.getItem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,cAAc,EAAInB,qBAAqB,CAC7DoB,aAAa,CAAEX,CAAK,CAACW,aAAa,EAAIhB,oBAAoB,EAE9D,CAEA,MAAO,SAAS,CAAAiB,sBAAsBA,CACpCZ,CAA4B,CAC5B,CACA,OAAAC,aAAA,CAAAA,aAAA,IACKD,CAAK,MACRE,YAAY,CAAEF,CAAK,CAACE,YAAY,EAAIzB,mBAAmB,CACvD2B,aAAa,CAAEJ,CAAK,CAACI,aAAa,EAAIxB,oBAAoB,CAC1DyB,WAAW,CAAEL,CAAK,CAACK,WAAW,EAAIrB,kBAAkB,CACpD2B,aAAa,CAAEX,CAAK,CAACW,aAAa,EAAIhB,oBAAoB,CAC1DkB,cAAc,CAAEb,CAAK,CAACa,cAAc,EAAIhB,qBAAqB,EAEjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/NavbarCanary/index.ts"],"sourcesContent":["export * from './Navbar';\nexport * from './NavbarRail';\nexport * from './types';\nexport * from './NavbarMixFadeAnimate';\nexport * from './NavbarMixDriverRightAnimate';\nexport * from './NavbarMixDriverLeftAnimate';\n"],"mappings":"AAAA,sBACA,0BACA,qBACA,oCACA,2CACA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { IconComponent } from '@consta/icons/Icon';
|
|
2
|
+
import { Group } from '@consta/uikit/__internal__/src/utils/getGroups';
|
|
3
|
+
import { AsAttributes, AsTags } from '@consta/uikit/__internal__/src/utils/types/AsTags';
|
|
4
|
+
import { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';
|
|
5
|
+
import { BadgePropStatus } from '@consta/uikit/Badge';
|
|
6
|
+
import { TooltipProps } from '@consta/uikit/Tooltip';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
export declare const navbarPropSize: readonly ["s", "m"];
|
|
9
|
+
export type NavbarPropSize = (typeof navbarPropSize)[number];
|
|
10
|
+
export declare const defaultNavbarPropSize: NavbarPropSize;
|
|
11
|
+
export declare const navbarPropForm: readonly ["default", "brick", "round"];
|
|
12
|
+
export type NavbarPropForm = (typeof navbarPropForm)[number];
|
|
13
|
+
export declare const defaultNavbarPropForm: "default";
|
|
14
|
+
export type DefaultNavbarGroup = {
|
|
15
|
+
id: string | number;
|
|
16
|
+
label?: string;
|
|
17
|
+
rightSide?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export type DefaultNavbarItem = {
|
|
20
|
+
label: string;
|
|
21
|
+
status?: BadgePropStatus;
|
|
22
|
+
groupId?: string | number;
|
|
23
|
+
icon?: IconComponent;
|
|
24
|
+
rightSide?: React.ReactNode;
|
|
25
|
+
active?: boolean;
|
|
26
|
+
subMenu?: DefaultNavbarItem[];
|
|
27
|
+
};
|
|
28
|
+
export type DefaultNavbarRailItem = {
|
|
29
|
+
label: string;
|
|
30
|
+
icon: IconComponent;
|
|
31
|
+
status?: BadgePropStatus;
|
|
32
|
+
active?: boolean;
|
|
33
|
+
tooltip?: React.ReactNode;
|
|
34
|
+
};
|
|
35
|
+
export type NavbarPropOnItemClick<ITEM> = (item: ITEM, params: {
|
|
36
|
+
e: React.MouseEvent;
|
|
37
|
+
}) => void;
|
|
38
|
+
export type NavbarPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
39
|
+
export type NavbarRailPropGetItemLabel<ITEM> = (item: ITEM) => string | undefined;
|
|
40
|
+
export type NavbarPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;
|
|
41
|
+
export type NavbarPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
|
|
42
|
+
export type NavbarPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;
|
|
43
|
+
export type NavbarPropGetItemGroupId<ITEM> = (item: ITEM) => string | number | undefined;
|
|
44
|
+
export type NavbarPropGetItemLeftSide<ITEM> = (item: ITEM) => React.ReactNode | undefined;
|
|
45
|
+
export type NavbarPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
46
|
+
export type NavbarRailPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent;
|
|
47
|
+
export type NavbarPropGetItemRightSide<ITEM> = (item: ITEM) => React.ReactNode | undefined;
|
|
48
|
+
export type NavbarPropGetItemRightIcon<ITEM> = (item: ITEM) => IconComponent | undefined;
|
|
49
|
+
export type NavbarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;
|
|
50
|
+
export type NavbarPropGetItemAttributes<ITEM> = (item: ITEM) => AsAttributes | undefined;
|
|
51
|
+
export type NavbarPropSortGroup<ITEM, GROUP> = (a: Group<ITEM, GROUP>, b: Group<ITEM, GROUP>) => number;
|
|
52
|
+
export type NavbarPropGetGroupKey<GROUP> = (item: GROUP) => string | number | undefined;
|
|
53
|
+
export type NavbarPropGetGroupAdditionalClassName<GROUP> = (item: GROUP) => string;
|
|
54
|
+
export type NavbarPropGetGroupLabel<GROUP> = (item: GROUP) => string | undefined;
|
|
55
|
+
export type NavbarPropGetGroupRightSide<GROUP> = (item: GROUP) => React.ReactNode | undefined;
|
|
56
|
+
export type NavbarPropGetItemRef<ITEM> = (item: ITEM) => React.RefObject<HTMLElement> | undefined;
|
|
57
|
+
export type NavbarPropGetItemStatus<ITEM> = (item: ITEM) => BadgePropStatus | undefined;
|
|
58
|
+
export type NavbarPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
|
|
59
|
+
export type NavbarRailPropGetItemTooltip<ITEM> = (item: ITEM) => React.ReactNode | undefined;
|
|
60
|
+
export type NavbarProps<ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup> = PropsWithHTMLAttributesAndRef<{
|
|
61
|
+
items: ITEM[];
|
|
62
|
+
size?: NavbarPropSize;
|
|
63
|
+
form?: NavbarPropForm;
|
|
64
|
+
onItemClick?: NavbarPropOnItemClick<ITEM>;
|
|
65
|
+
getItemLabel?: NavbarPropGetItemLabel<ITEM>;
|
|
66
|
+
getItemIcon?: NavbarPropGetItemIcon<ITEM>;
|
|
67
|
+
getItemActive?: NavbarPropGetItemActive<ITEM>;
|
|
68
|
+
getItemRightSide?: NavbarPropGetItemRightSide<ITEM>;
|
|
69
|
+
getItemStatus?: NavbarPropGetItemStatus<ITEM>;
|
|
70
|
+
getItemGroupKey?: NavbarPropGetItemGroupId<ITEM>;
|
|
71
|
+
getItemAs?: NavbarPropGetItemAs<ITEM>;
|
|
72
|
+
getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;
|
|
73
|
+
getItemRef?: NavbarPropGetItemRef<ITEM>;
|
|
74
|
+
getItemSubMenu?: NavbarPropGetItemSubMenu<ITEM>;
|
|
75
|
+
getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;
|
|
76
|
+
groups?: GROUP[];
|
|
77
|
+
getGroupKey?: NavbarPropGetGroupKey<GROUP>;
|
|
78
|
+
getGroupLabel?: NavbarPropGetGroupLabel<GROUP>;
|
|
79
|
+
getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP>;
|
|
80
|
+
sortGroup?: NavbarPropSortGroup<ITEM, GROUP>;
|
|
81
|
+
getGroupAdditionalClassName?: NavbarPropGetGroupAdditionalClassName<GROUP>;
|
|
82
|
+
}, HTMLDivElement> & (ITEM extends {
|
|
83
|
+
label: DefaultNavbarItem['label'];
|
|
84
|
+
} ? {} : {
|
|
85
|
+
getItemLabel: NavbarPropGetItemLabel<ITEM>;
|
|
86
|
+
}) & (GROUP extends {
|
|
87
|
+
id: DefaultNavbarGroup['id'];
|
|
88
|
+
} ? {} : {
|
|
89
|
+
getGroupKey: NavbarPropGetGroupKey<GROUP>;
|
|
90
|
+
});
|
|
91
|
+
export type NavbarComponent = <ITEM = DefaultNavbarItem, GROUP = DefaultNavbarGroup>(props: NavbarProps<ITEM, GROUP>) => React.ReactElement | null;
|
|
92
|
+
export type NavbarRailProps<ITEM = DefaultNavbarRailItem> = PropsWithHTMLAttributesAndRef<{
|
|
93
|
+
items: ITEM[];
|
|
94
|
+
size?: NavbarPropSize;
|
|
95
|
+
form?: NavbarPropForm;
|
|
96
|
+
onItemClick?: NavbarPropOnItemClick<ITEM>;
|
|
97
|
+
getItemLabel?: NavbarRailPropGetItemLabel<ITEM>;
|
|
98
|
+
getItemIcon?: NavbarRailPropGetItemIcon<ITEM>;
|
|
99
|
+
getItemActive?: NavbarPropGetItemActive<ITEM>;
|
|
100
|
+
getItemStatus?: NavbarPropGetItemStatus<ITEM>;
|
|
101
|
+
getItemAs?: NavbarPropGetItemAs<ITEM>;
|
|
102
|
+
getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;
|
|
103
|
+
getItemRef?: NavbarPropGetItemRef<ITEM>;
|
|
104
|
+
getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;
|
|
105
|
+
getItemTooltip?: NavbarRailPropGetItemTooltip<ITEM>;
|
|
106
|
+
tooltipProps?: Omit<TooltipProps, 'children' | 'position' | 'equalAnchorWidth' | 'anchorRef'>;
|
|
107
|
+
}, HTMLDivElement> & (ITEM extends {
|
|
108
|
+
icon: DefaultNavbarRailItem['icon'];
|
|
109
|
+
} ? {} : {
|
|
110
|
+
getItemIcon: NavbarRailPropGetItemIcon<ITEM>;
|
|
111
|
+
});
|
|
112
|
+
export type NavbarRailComponent = <ITEM = DefaultNavbarRailItem>(props: NavbarRailProps<ITEM>) => React.ReactElement | null;
|
|
113
|
+
export type NavbarItemProps<ITEM = DefaultNavbarItem> = PropsWithHTMLAttributesAndRef<{
|
|
114
|
+
size: NavbarPropSize;
|
|
115
|
+
item: ITEM;
|
|
116
|
+
form: NavbarPropForm;
|
|
117
|
+
onItemClick: NavbarPropOnItemClick<ITEM> | undefined;
|
|
118
|
+
getItemLabel: NavbarPropGetItemLabel<ITEM>;
|
|
119
|
+
getItemIcon: NavbarPropGetItemIcon<ITEM>;
|
|
120
|
+
getItemActive: NavbarPropGetItemActive<ITEM>;
|
|
121
|
+
getItemRightSide: NavbarPropGetItemRightSide<ITEM>;
|
|
122
|
+
getItemStatus: NavbarPropGetItemStatus<ITEM> | undefined;
|
|
123
|
+
getItemAs: NavbarPropGetItemAs<ITEM> | undefined;
|
|
124
|
+
getItemAttributes: NavbarPropGetItemAttributes<ITEM> | undefined;
|
|
125
|
+
getItemRef: NavbarPropGetItemRef<ITEM> | undefined;
|
|
126
|
+
getItemSubMenu: NavbarPropGetItemSubMenu<ITEM> | undefined;
|
|
127
|
+
getItemAdditionalClassName: NavbarPropGetItemAdditionalClassName<ITEM> | undefined;
|
|
128
|
+
level: number;
|
|
129
|
+
}, HTMLDivElement>;
|
|
130
|
+
export type NavbarItemComponent = <ITEM = DefaultNavbarItem>(props: NavbarItemProps<ITEM>) => React.ReactElement | null;
|
|
131
|
+
export type NavbarRailItemProps = PropsWithHTMLAttributesAndRef<{
|
|
132
|
+
size?: NavbarPropSize;
|
|
133
|
+
form?: NavbarPropForm;
|
|
134
|
+
icon?: IconComponent;
|
|
135
|
+
active?: boolean;
|
|
136
|
+
status?: BadgePropStatus;
|
|
137
|
+
label?: string;
|
|
138
|
+
}, HTMLDivElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["navbarPropSize","defaultNavbarPropSize","navbarPropForm","defaultNavbarPropForm"],"sources":["../../../../../src/components/NavbarCanary/types.ts"],"sourcesContent":["import { IconComponent } from '@consta/icons/Icon';\nimport { Group } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport {\n AsAttributes,\n AsTags,\n} from '@consta/uikit/__internal__/src/utils/types/AsTags';\nimport { PropsWithHTMLAttributesAndRef } from '@consta/uikit/__internal__/src/utils/types/PropsWithHTMLAttributes';\nimport { BadgePropStatus } from '@consta/uikit/Badge';\nimport { TooltipProps } from '@consta/uikit/Tooltip';\nimport React from 'react';\n\nexport const navbarPropSize = ['s', 'm'] as const;\nexport type NavbarPropSize = (typeof navbarPropSize)[number];\nexport const defaultNavbarPropSize: NavbarPropSize = 'm';\n\nexport const navbarPropForm = ['default', 'brick', 'round'] as const;\nexport type NavbarPropForm = (typeof navbarPropForm)[number];\nexport const defaultNavbarPropForm = navbarPropForm[0];\n\nexport type DefaultNavbarGroup = {\n id: string | number;\n label?: string;\n rightSide?: React.ReactNode;\n};\n\nexport type DefaultNavbarItem = {\n label: string;\n status?: BadgePropStatus;\n groupId?: string | number;\n icon?: IconComponent;\n rightSide?: React.ReactNode;\n active?: boolean;\n subMenu?: DefaultNavbarItem[];\n};\n\nexport type DefaultNavbarRailItem = {\n label: string;\n icon: IconComponent;\n status?: BadgePropStatus;\n active?: boolean;\n tooltip?: React.ReactNode;\n};\n\nexport type NavbarPropOnItemClick<ITEM> = (\n item: ITEM,\n params: {\n e: React.MouseEvent;\n },\n) => void;\n\n// ITEMS\n\nexport type NavbarPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type NavbarRailPropGetItemLabel<ITEM> = (\n item: ITEM,\n) => string | undefined;\n\nexport type NavbarPropGetItemAdditionalClassName<ITEM> = (item: ITEM) => string;\n\nexport type NavbarPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type NavbarPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;\n\nexport type NavbarPropGetItemGroupId<ITEM> = (\n item: ITEM,\n) => string | number | undefined;\n\nexport type NavbarPropGetItemLeftSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarRailPropGetItemIcon<ITEM> = (item: ITEM) => IconComponent;\n\nexport type NavbarPropGetItemRightSide<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRightIcon<ITEM> = (\n item: ITEM,\n) => IconComponent | undefined;\n\nexport type NavbarPropGetItemAs<ITEM> = (item: ITEM) => AsTags | undefined;\n\nexport type NavbarPropGetItemAttributes<ITEM> = (\n item: ITEM,\n) => AsAttributes | undefined;\n\nexport type NavbarPropSortGroup<ITEM, GROUP> = (\n a: Group<ITEM, GROUP>,\n b: Group<ITEM, GROUP>,\n) => number;\n\n// GROUPS\nexport type NavbarPropGetGroupKey<GROUP> = (\n item: GROUP,\n) => string | number | undefined;\n\nexport type NavbarPropGetGroupAdditionalClassName<GROUP> = (\n item: GROUP,\n) => string;\n\nexport type NavbarPropGetGroupLabel<GROUP> = (\n item: GROUP,\n) => string | undefined;\nexport type NavbarPropGetGroupRightSide<GROUP> = (\n item: GROUP,\n) => React.ReactNode | undefined;\n\nexport type NavbarPropGetItemRef<ITEM> = (\n item: ITEM,\n) => React.RefObject<HTMLElement> | undefined;\n\nexport type NavbarPropGetItemStatus<ITEM> = (\n item: ITEM,\n) => BadgePropStatus | undefined;\n\nexport type NavbarPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;\nexport type NavbarRailPropGetItemTooltip<ITEM> = (\n item: ITEM,\n) => React.ReactNode | undefined;\n\nexport type NavbarProps<\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n> = PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n onItemClick?: NavbarPropOnItemClick<ITEM>;\n getItemLabel?: NavbarPropGetItemLabel<ITEM>;\n getItemIcon?: NavbarPropGetItemIcon<ITEM>;\n getItemActive?: NavbarPropGetItemActive<ITEM>;\n getItemRightSide?: NavbarPropGetItemRightSide<ITEM>;\n getItemStatus?: NavbarPropGetItemStatus<ITEM>;\n getItemGroupKey?: NavbarPropGetItemGroupId<ITEM>;\n getItemAs?: NavbarPropGetItemAs<ITEM>;\n getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;\n getItemRef?: NavbarPropGetItemRef<ITEM>;\n getItemSubMenu?: NavbarPropGetItemSubMenu<ITEM>;\n getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;\n groups?: GROUP[];\n getGroupKey?: NavbarPropGetGroupKey<GROUP>;\n getGroupLabel?: NavbarPropGetGroupLabel<GROUP>;\n getGroupRightSide?: NavbarPropGetGroupRightSide<GROUP>;\n sortGroup?: NavbarPropSortGroup<ITEM, GROUP>;\n getGroupAdditionalClassName?: NavbarPropGetGroupAdditionalClassName<GROUP>;\n },\n HTMLDivElement\n> &\n (ITEM extends { label: DefaultNavbarItem['label'] }\n ? {}\n : { getItemLabel: NavbarPropGetItemLabel<ITEM> }) &\n (GROUP extends { id: DefaultNavbarGroup['id'] }\n ? {}\n : { getGroupKey: NavbarPropGetGroupKey<GROUP> });\n\nexport type NavbarComponent = <\n ITEM = DefaultNavbarItem,\n GROUP = DefaultNavbarGroup,\n>(\n props: NavbarProps<ITEM, GROUP>,\n) => React.ReactElement | null;\n\nexport type NavbarRailProps<ITEM = DefaultNavbarRailItem> =\n PropsWithHTMLAttributesAndRef<\n {\n items: ITEM[];\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n onItemClick?: NavbarPropOnItemClick<ITEM>;\n getItemLabel?: NavbarRailPropGetItemLabel<ITEM>;\n getItemIcon?: NavbarRailPropGetItemIcon<ITEM>;\n getItemActive?: NavbarPropGetItemActive<ITEM>;\n getItemStatus?: NavbarPropGetItemStatus<ITEM>;\n getItemAs?: NavbarPropGetItemAs<ITEM>;\n getItemAttributes?: NavbarPropGetItemAttributes<ITEM>;\n getItemRef?: NavbarPropGetItemRef<ITEM>;\n getItemAdditionalClassName?: NavbarPropGetItemAdditionalClassName<ITEM>;\n getItemTooltip?: NavbarRailPropGetItemTooltip<ITEM>;\n tooltipProps?: Omit<\n TooltipProps,\n 'children' | 'position' | 'equalAnchorWidth' | 'anchorRef'\n >;\n },\n HTMLDivElement\n > &\n (ITEM extends { icon: DefaultNavbarRailItem['icon'] }\n ? {}\n : { getItemIcon: NavbarRailPropGetItemIcon<ITEM> });\n\nexport type NavbarRailComponent = <ITEM = DefaultNavbarRailItem>(\n props: NavbarRailProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type NavbarItemProps<ITEM = DefaultNavbarItem> =\n PropsWithHTMLAttributesAndRef<\n {\n size: NavbarPropSize;\n item: ITEM;\n form: NavbarPropForm;\n onItemClick: NavbarPropOnItemClick<ITEM> | undefined;\n getItemLabel: NavbarPropGetItemLabel<ITEM>;\n getItemIcon: NavbarPropGetItemIcon<ITEM>;\n getItemActive: NavbarPropGetItemActive<ITEM>;\n getItemRightSide: NavbarPropGetItemRightSide<ITEM>;\n getItemStatus: NavbarPropGetItemStatus<ITEM> | undefined;\n getItemAs: NavbarPropGetItemAs<ITEM> | undefined;\n getItemAttributes: NavbarPropGetItemAttributes<ITEM> | undefined;\n getItemRef: NavbarPropGetItemRef<ITEM> | undefined;\n getItemSubMenu: NavbarPropGetItemSubMenu<ITEM> | undefined;\n getItemAdditionalClassName:\n | NavbarPropGetItemAdditionalClassName<ITEM>\n | undefined;\n level: number;\n },\n HTMLDivElement\n >;\n\nexport type NavbarItemComponent = <ITEM = DefaultNavbarItem>(\n props: NavbarItemProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type NavbarRailItemProps = PropsWithHTMLAttributesAndRef<\n {\n size?: NavbarPropSize;\n form?: NavbarPropForm;\n icon?: IconComponent;\n active?: boolean;\n status?: BadgePropStatus;\n label?: string;\n },\n HTMLDivElement\n>;\n"],"mappings":"AAWA,MAAO,MAAM,CAAAA,cAAc,CAAG,CAAC,GAAG,CAAE,GAAG,CAAU,CAEjD,MAAO,MAAM,CAAAC,qBAAqC,CAAG,GAAG,CAExD,MAAO,MAAM,CAAAC,cAAc,CAAG,CAAC,SAAS,CAAE,OAAO,CAAE,OAAO,CAAU,CAEpE,MAAO,MAAM,CAAAC,qBAAqB,CAAGD,cAAc,CAAC,CAAC,CAAC"}
|
|
@@ -7,5 +7,5 @@ type PopoverButtonProps = Omit<React.ComponentProps<typeof Button>, 'children'>
|
|
|
7
7
|
popoverClassName?: string;
|
|
8
8
|
withCloseButton?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const PopoverButton: React.ForwardRefExoticComponent<Pick<PopoverButtonProps, "className" | "id" | "lang" | "style" | "tabIndex" | "title" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "size" | "view" | "onlyIcon" | "label" | "key" | "width" | "disabled" | "loading" | "iconLeft" | "iconRight" | "iconSize" | "as" | "isMobile" | "popoverClassName" | "withCloseButton"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const PopoverButton: React.ForwardRefExoticComponent<Pick<PopoverButtonProps, "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "form" | "size" | "view" | "onlyIcon" | "label" | "key" | "width" | "disabled" | "loading" | "iconLeft" | "iconRight" | "iconSize" | "type" | "as" | "isMobile" | "popoverClassName" | "withCloseButton"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consta/header",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"*",
|
|
6
6
|
"!**/__mocks__",
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@consta/icons": "^0.9.0",
|
|
22
|
-
"@consta/uikit": "^4.
|
|
22
|
+
"@consta/uikit": "^4.31.1"
|
|
23
23
|
}
|
|
24
24
|
}
|