@consta/header 1.0.0 → 1.2.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.
Files changed (165) hide show
  1. package/BannerBar/index.d.ts +1 -0
  2. package/BannerBar/index.js +1 -0
  3. package/GlobalMenu/index.d.ts +1 -0
  4. package/GlobalMenu/index.js +1 -0
  5. package/MegaMenu/index.d.ts +1 -0
  6. package/MegaMenu/index.js +1 -0
  7. package/NavBar/index.d.ts +1 -0
  8. package/NavBar/index.js +1 -0
  9. package/README.md +50 -38
  10. package/__internal__/src/components/Badges/Badges.js.map +1 -1
  11. package/__internal__/src/components/Badges/helpers.js.map +1 -1
  12. package/__internal__/src/components/Badges/types.d.ts +6 -6
  13. package/__internal__/src/components/BannerBar/BannerBar.css +1 -0
  14. package/__internal__/src/components/BannerBar/BannerBar.d.ts +3 -0
  15. package/__internal__/src/components/BannerBar/BannerBar.js +2 -0
  16. package/__internal__/src/components/BannerBar/BannerBar.js.map +1 -0
  17. package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.css +1 -0
  18. package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.d.ts +3 -0
  19. package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.js +2 -0
  20. package/__internal__/src/components/BannerBar/BannerBarItem/BannerBarItem.js.map +1 -0
  21. package/__internal__/src/components/BannerBar/BannerBarItem/index.d.ts +1 -0
  22. package/__internal__/src/components/BannerBar/BannerBarItem/index.js +2 -0
  23. package/__internal__/src/components/BannerBar/BannerBarItem/index.js.map +1 -0
  24. package/__internal__/src/components/BannerBar/helpers.d.ts +274 -0
  25. package/__internal__/src/components/BannerBar/helpers.js +2 -0
  26. package/__internal__/src/components/BannerBar/helpers.js.map +1 -0
  27. package/__internal__/src/components/BannerBar/index.d.ts +3 -0
  28. package/__internal__/src/components/BannerBar/index.js +2 -0
  29. package/__internal__/src/components/BannerBar/index.js.map +1 -0
  30. package/__internal__/src/components/BannerBar/types.d.ts +42 -0
  31. package/__internal__/src/components/BannerBar/types.js +2 -0
  32. package/__internal__/src/components/BannerBar/types.js.map +1 -0
  33. package/__internal__/src/components/ButtonMenu/ButtonMenu.js.map +1 -1
  34. package/__internal__/src/components/ButtonMenu/helpers.d.ts +2 -2
  35. package/__internal__/src/components/ButtonMenu/helpers.js.map +1 -1
  36. package/__internal__/src/components/ButtonMenu/types.d.ts +9 -9
  37. package/__internal__/src/components/GlobalMenu/GlobalMenu.css +1 -0
  38. package/__internal__/src/components/GlobalMenu/GlobalMenu.d.ts +3 -0
  39. package/__internal__/src/components/GlobalMenu/GlobalMenu.js +2 -0
  40. package/__internal__/src/components/GlobalMenu/GlobalMenu.js.map +1 -0
  41. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.css +1 -0
  42. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.d.ts +3 -0
  43. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.js +2 -0
  44. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/GlobalMenuGroup.js.map +1 -0
  45. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.d.ts +1 -0
  46. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.js +2 -0
  47. package/__internal__/src/components/GlobalMenu/GlobalMenuGroup/index.js.map +1 -0
  48. package/__internal__/src/components/GlobalMenu/helper.d.ts +281 -0
  49. package/__internal__/src/components/GlobalMenu/helper.js +2 -0
  50. package/__internal__/src/components/GlobalMenu/helper.js.map +1 -0
  51. package/__internal__/src/components/GlobalMenu/index.d.ts +2 -0
  52. package/__internal__/src/components/GlobalMenu/index.js +2 -0
  53. package/__internal__/src/components/GlobalMenu/index.js.map +1 -0
  54. package/__internal__/src/components/GlobalMenu/types.d.ts +75 -0
  55. package/__internal__/src/components/GlobalMenu/types.js +2 -0
  56. package/__internal__/src/components/GlobalMenu/types.js.map +1 -0
  57. package/__internal__/src/components/Header/Header.js.map +1 -1
  58. package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.d.ts +2 -2
  59. package/__internal__/src/components/Header/HeaderLogin/HeaderLogin.js.map +1 -1
  60. package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.d.ts +2 -2
  61. package/__internal__/src/components/Header/HeaderLogo/HeaderLogo.js.map +1 -1
  62. package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.d.ts +1 -1
  63. package/__internal__/src/components/Header/HeaderSearch/HeaderSearch.js.map +1 -1
  64. package/__internal__/src/components/Header/helpers.d.ts +1 -1
  65. package/__internal__/src/components/Header/helpers.js.map +1 -1
  66. package/__internal__/src/components/Header/types.d.ts +12 -12
  67. package/__internal__/src/components/Languages/Languages.js.map +1 -1
  68. package/__internal__/src/components/Languages/helpers.d.ts +1 -1
  69. package/__internal__/src/components/Languages/helpers.js.map +1 -1
  70. package/__internal__/src/components/Languages/types.d.ts +3 -3
  71. package/__internal__/src/components/Layout/Layout.d.ts +1 -1
  72. package/__internal__/src/components/Layout/Layout.js.map +1 -1
  73. package/__internal__/src/components/Layout/LayoutRow/LayoutRow.css +1 -1
  74. package/__internal__/src/components/Layout/LayoutRow/LayoutRow.d.ts +1 -1
  75. package/__internal__/src/components/Layout/LayoutRow/LayoutRow.js.map +1 -1
  76. package/__internal__/src/components/Layout/helpers.js.map +1 -1
  77. package/__internal__/src/components/Layout/types.d.ts +3 -3
  78. package/__internal__/src/components/MegaMenu/MegaMenu.css +1 -0
  79. package/__internal__/src/components/MegaMenu/MegaMenu.d.ts +4 -0
  80. package/__internal__/src/components/MegaMenu/MegaMenu.js +2 -0
  81. package/__internal__/src/components/MegaMenu/MegaMenu.js.map +1 -0
  82. package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.css +1 -0
  83. package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.d.ts +3 -0
  84. package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.js +2 -0
  85. package/__internal__/src/components/MegaMenu/MegaMenuBox/MegaMenuBox.js.map +1 -0
  86. package/__internal__/src/components/MegaMenu/MegaMenuBox/index.d.ts +2 -0
  87. package/__internal__/src/components/MegaMenu/MegaMenuBox/index.js +2 -0
  88. package/__internal__/src/components/MegaMenu/MegaMenuBox/index.js.map +1 -0
  89. package/__internal__/src/components/MegaMenu/MegaMenuBox/types.d.ts +10 -0
  90. package/__internal__/src/components/MegaMenu/MegaMenuBox/types.js +2 -0
  91. package/__internal__/src/components/MegaMenu/MegaMenuBox/types.js.map +1 -0
  92. package/__internal__/src/components/MegaMenu/helper.d.ts +301 -0
  93. package/__internal__/src/components/MegaMenu/helper.js +2 -0
  94. package/__internal__/src/components/MegaMenu/helper.js.map +1 -0
  95. package/__internal__/src/components/MegaMenu/index.d.ts +3 -0
  96. package/__internal__/src/components/MegaMenu/index.js +2 -0
  97. package/__internal__/src/components/MegaMenu/index.js.map +1 -0
  98. package/__internal__/src/components/MegaMenu/types.d.ts +65 -0
  99. package/__internal__/src/components/MegaMenu/types.js +2 -0
  100. package/__internal__/src/components/MegaMenu/types.js.map +1 -0
  101. package/__internal__/src/components/Menu/Menu.css +1 -1
  102. package/__internal__/src/components/Menu/Menu.js +1 -1
  103. package/__internal__/src/components/Menu/Menu.js.map +1 -1
  104. package/__internal__/src/components/Menu/helpers.d.ts +2 -1
  105. package/__internal__/src/components/Menu/helpers.js.map +1 -1
  106. package/__internal__/src/components/Menu/types.d.ts +11 -10
  107. package/__internal__/src/components/Menu/types.js.map +1 -1
  108. package/__internal__/src/components/MobileMenu/MobileMenu.js.map +1 -1
  109. package/__internal__/src/components/MobileMenu/types.d.ts +2 -2
  110. package/__internal__/src/components/NavBar/NavBar.css +1 -0
  111. package/__internal__/src/components/NavBar/NavBar.d.ts +3 -0
  112. package/__internal__/src/components/NavBar/NavBar.js +2 -0
  113. package/__internal__/src/components/NavBar/NavBar.js.map +1 -0
  114. package/__internal__/src/components/NavBar/helper.d.ts +31 -0
  115. package/__internal__/src/components/NavBar/helper.js +2 -0
  116. package/__internal__/src/components/NavBar/helper.js.map +1 -0
  117. package/__internal__/src/components/NavBar/index.d.ts +1 -0
  118. package/__internal__/src/components/NavBar/index.js +2 -0
  119. package/__internal__/src/components/NavBar/index.js.map +1 -0
  120. package/__internal__/src/components/NavBar/types.d.ts +48 -0
  121. package/__internal__/src/components/NavBar/types.js +2 -0
  122. package/__internal__/src/components/NavBar/types.js.map +1 -0
  123. package/__internal__/src/components/NotificationCard/NotificationCard.d.ts +1 -1
  124. package/__internal__/src/components/NotificationCard/NotificationCard.js.map +1 -1
  125. package/__internal__/src/components/NotificationCard/helpers.js.map +1 -1
  126. package/__internal__/src/components/NotificationCard/types.d.ts +3 -3
  127. package/__internal__/src/components/Notifications/Notifications.js.map +1 -1
  128. package/__internal__/src/components/Notifications/types.d.ts +2 -2
  129. package/__internal__/src/components/NotificationsActions/NotificationsActions.js.map +1 -1
  130. package/__internal__/src/components/NotificationsActions/helpers.js.map +1 -1
  131. package/__internal__/src/components/NotificationsActions/types.d.ts +7 -7
  132. package/__internal__/src/components/NotificationsList/NotificationsList.js.map +1 -1
  133. package/__internal__/src/components/NotificationsList/helpers.d.ts +2 -2
  134. package/__internal__/src/components/NotificationsList/helpers.js.map +1 -1
  135. package/__internal__/src/components/NotificationsList/types.d.ts +23 -23
  136. package/__internal__/src/components/SelectMenu/SelectMenu.js.map +1 -1
  137. package/__internal__/src/components/SelectMenu/helpers.d.ts +1 -1
  138. package/__internal__/src/components/SelectMenu/helpers.js.map +1 -1
  139. package/__internal__/src/components/SelectMenu/types.d.ts +9 -9
  140. package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -1
  141. package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
  142. package/__internal__/src/components/TileMenu/TileMenu.js.map +1 -1
  143. package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.d.ts +2 -2
  144. package/__internal__/src/components/TileMenu/TileMenuItem/TileMenuItem.js.map +1 -1
  145. package/__internal__/src/components/TileMenu/TileMenuList/TileMenuList.js.map +1 -1
  146. package/__internal__/src/components/TileMenu/TileMenuList/types.d.ts +8 -8
  147. package/__internal__/src/components/TileMenu/helpers.d.ts +3 -0
  148. package/__internal__/src/components/TileMenu/helpers.js.map +1 -1
  149. package/__internal__/src/components/TileMenu/types.d.ts +14 -14
  150. package/__internal__/src/components/TileMenu/types.js.map +1 -1
  151. package/__internal__/src/components/VerticalMenu/VerticalMenu.js.map +1 -1
  152. package/__internal__/src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.js.map +1 -1
  153. package/__internal__/src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.js.map +1 -1
  154. package/__internal__/src/components/VerticalMenu/helpers.d.ts +1 -1
  155. package/__internal__/src/components/VerticalMenu/helpers.js.map +1 -1
  156. package/__internal__/src/components/VerticalMenu/types.d.ts +16 -16
  157. package/__internal__/src/docs/start/start.stand.d.ts +2 -0
  158. package/__internal__/src/docs/start/start.stand.js +2 -0
  159. package/__internal__/src/docs/start/start.stand.js.map +1 -0
  160. package/__internal__/src/helpers/getItemClick.d.ts +2 -2
  161. package/__internal__/src/helpers/getItemClick.js.map +1 -1
  162. package/__internal__/src/stand/standConfig.d.ts +1 -0
  163. package/__internal__/src/utils/bem.js.map +1 -1
  164. package/__internal__/src/utils/types/PropsWithHTMLAttributes.d.ts +2 -2
  165. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"TileMenu.js","names":["Button","IconBento","animateTimeout","cnMixPopoverAnimate","cnMixPopoverArrow","Popover","useFlag","useForkRef","React","forwardRef","useRef","useState","Transition","Sidebar","cn","TileMenuList","tileMenuPropViewDefault","cnTileMenu","ARROW_SIZE","ARROW_OFFSET","TileMenuRender","props","ref","view","items","isMobile","className","children","listClassName","getItemDescription","getItemHref","getItemImage","getItemOnClick","getItemLabel","title","onItemClick","otherProps","buttonRef","direction","setDirection","visibleMenu","toogle","off","listProps","elementZIndex","style","zIndex","animate","TileMenu"],"sources":["../../../../../src/components/TileMenu/TileMenu.tsx"],"sourcesContent":["import './TileMenu.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconBento } from '@consta/uikit/IconBento';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '@consta/uikit/MixPopoverAnimate';\nimport { cnMixPopoverArrow } from '@consta/uikit/MixPopoverArrow';\nimport { Direction, Popover } from '@consta/uikit/Popover';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport React, { forwardRef, useRef, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Sidebar } from '##/components/Sidebar';\nimport { cn } from '##/utils/bem';\n\nimport { TileMenuList } from './TileMenuList/TileMenuList';\nimport {\n TileMenuComponent,\n TileMenuProps,\n tileMenuPropViewDefault,\n} from './types';\n\nexport const cnTileMenu = cn('TileMenu');\n\nconst ARROW_SIZE = 6;\nconst ARROW_OFFSET = 10;\n\nfunction TileMenuRender(\n props: TileMenuProps,\n ref: React.Ref<HTMLButtonElement>,\n) {\n const {\n view = tileMenuPropViewDefault,\n items,\n isMobile,\n className,\n children,\n listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n title,\n onItemClick,\n ...otherProps\n } = props;\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const [direction, setDirection] = useState<Direction | undefined>(undefined);\n\n const [visibleMenu, { toogle, off }] = useFlag();\n\n const listProps = {\n className: listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n items,\n view,\n onItemClick,\n };\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <>\n <Button\n {...otherProps}\n size=\"s\"\n view=\"clear\"\n className={cnTileMenu(null, [className])}\n iconLeft={IconBento}\n ref={useForkRef([ref, buttonRef])}\n onClick={toogle}\n />\n {isMobile ? (\n <Sidebar\n isOpen={visibleMenu}\n onClickOutside={off}\n onClose={off}\n title={title}\n style={{ zIndex: elementZIndex }}\n >\n <TileMenuList {...listProps} />\n </Sidebar>\n ) : (\n <Transition timeout={animateTimeout} unmountOnExit in={visibleMenu}>\n {(animate) => (\n <Popover\n className={cnTileMenu('Popover', { view }, [\n cnMixPopoverAnimate({ animate, direction }),\n ])}\n anchorRef={buttonRef}\n arrowOffset={ARROW_OFFSET + ARROW_SIZE}\n offset={ARROW_SIZE + 4}\n onSetDirection={setDirection}\n style={{\n ['--popover-arrow-size' as string]: `${ARROW_SIZE}px`,\n ['--popover-arrow-offset' as string]: `${ARROW_OFFSET}px`,\n zIndex: elementZIndex,\n }}\n onClickOutside={off}\n >\n <div className={cnMixPopoverArrow({ direction })} />\n <div className={cnTileMenu('ListWrapper')}>\n <TileMenuList {...listProps} />\n </div>\n </Popover>\n )}\n </Transition>\n )}\n </>\n );\n}\n\nexport const TileMenu = forwardRef(TileMenuRender) as TileMenuComponent;\n\nexport * from './types';\n"],"mappings":"gRAAA,uBAEA,OAASA,MAAT,KAAuB,sBAAvB,CACA,OAASC,SAAT,KAA0B,yBAA1B,CACA,OACEC,cADF,CAEEC,mBAFF,KAGO,iCAHP,CAIA,OAASC,iBAAT,KAAkC,+BAAlC,CACA,OAAoBC,OAApB,KAAmC,uBAAnC,CACA,OAASC,OAAT,KAAwB,uBAAxB,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,CAAoCC,QAApC,KAAoD,OAApD,CACA,OAASC,UAAT,KAA2B,wBAA3B,CAEA,OAASC,OAAT,kBACA,OAASC,EAAT,uBAEA,OAASC,YAAT,mCACA,OAGEC,uBAHF,eAMA,MAAO,MAAMC,WAAU,CAAGH,EAAE,CAAC,UAAD,CAArB,C,KAEDI,WAAU,CAAG,C,CACbC,YAAY,CAAG,E,CAErB,QAASC,eAAT,CACEC,CADF,CAEEC,CAFF,CAGE,YACM,CACJC,IAAI,CAAJA,CAAI,CAAGP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,CAAD,CAAMe,CAAN,CAAD,CANjB,CAOE,OAAO,CAAEI,CAPX,GADF,CAUGhB,CAAQ,CACP,oBAAC,OAAD,EACE,MAAM,CAAEe,CADV,CAEE,cAAc,CAAEE,CAFlB,CAGE,OAAO,CAAEA,CAHX,CAIE,KAAK,CAAER,CAJT,CAKE,KAAK,CAAE,CAAEY,MAAM,CAAEF,CAAV,CALT,EAOE,oBAAC,YAAD,CAAkBD,CAAlB,CAPF,CADO,CAWP,oBAAC,UAAD,EAAY,OAAO,CAAEzC,cAArB,CAAqC,aAAa,GAAlD,CAAmD,EAAE,CAAEsC,CAAvD,EACIO,CAAD,EACC,oBAAC,OAAD,EACE,SAAS,CAAE9B,UAAU,CAAC,SAAD,CAAY,CAAEM,IAAI,CAAJA,CAAF,CAAZ,CAAsB,CACzCpB,mBAAmB,CAAC,CAAE4C,OAAO,CAAPA,CAAF,CAAWT,SAAS,CAATA,CAAX,CAAD,CADsB,CAAtB,CADvB,CAIE,SAAS,CAAED,CAJb,CAKE,WAAW,CAAElB,YAAY,CAAGD,UAL9B,CAME,MAAM,GANR,CAOE,cAAc,CAAEqB,CAPlB,CAQE,KAAK,CAAE,CACL,uBAAqC,GAAErB,UAAW,IAD7C,CAEL,yBAAuC,GAAEC,YAAa,IAFjD,CAGL2B,MAAM,CAAEF,CAHH,CART,CAaE,cAAc,CAAEF,CAblB,EAeE,2BAAK,SAAS,CAAEtC,iBAAiB,CAAC,CAAEkC,SAAS,CAATA,CAAF,CAAD,CAAjC,EAfF,CAgBE,2BAAK,SAAS,CAAErB,UAAU,CAAC,aAAD,CAA1B,EACE,oBAAC,YAAD,CAAkB0B,CAAlB,CADF,CAhBF,CAFJ,CArBJ,CAgDH,CAED,MAAO,MAAMK,SAAQ,CAAGvC,UAAU,CAACW,cAAD,CAA3B,CAEP"}
1
+ {"version":3,"file":"TileMenu.js","names":["Button","IconBento","animateTimeout","cnMixPopoverAnimate","cnMixPopoverArrow","Popover","useFlag","useForkRef","React","forwardRef","useRef","useState","Transition","Sidebar","cn","TileMenuList","tileMenuPropViewDefault","cnTileMenu","ARROW_SIZE","ARROW_OFFSET","TileMenuRender","props","ref","view","items","isMobile","className","children","listClassName","getItemDescription","getItemHref","getItemImage","getItemOnClick","getItemLabel","title","onItemClick","otherProps","buttonRef","direction","setDirection","visibleMenu","toogle","off","listProps","elementZIndex","style","zIndex","animate","TileMenu"],"sources":["../../../../../src/components/TileMenu/TileMenu.tsx"],"sourcesContent":["import './TileMenu.css';\n\nimport { Button } from '@consta/uikit/Button';\nimport { IconBento } from '@consta/uikit/IconBento';\nimport {\n animateTimeout,\n cnMixPopoverAnimate,\n} from '@consta/uikit/MixPopoverAnimate';\nimport { cnMixPopoverArrow } from '@consta/uikit/MixPopoverArrow';\nimport { Direction, Popover } from '@consta/uikit/Popover';\nimport { useFlag } from '@consta/uikit/useFlag';\nimport { useForkRef } from '@consta/uikit/useForkRef';\nimport React, { forwardRef, useRef, useState } from 'react';\nimport { Transition } from 'react-transition-group';\n\nimport { Sidebar } from '##/components/Sidebar';\nimport { cn } from '##/utils/bem';\n\nimport { TileMenuList } from './TileMenuList/TileMenuList';\nimport {\n TileMenuComponent,\n TileMenuProps,\n tileMenuPropViewDefault,\n} from './types';\n\nexport const cnTileMenu = cn('TileMenu');\n\nconst ARROW_SIZE = 6;\nconst ARROW_OFFSET = 10;\n\nfunction TileMenuRender(\n props: TileMenuProps,\n ref: React.Ref<HTMLButtonElement>,\n) {\n const {\n view = tileMenuPropViewDefault,\n items,\n isMobile,\n className,\n children,\n listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n title,\n onItemClick,\n ...otherProps\n } = props;\n\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n const [direction, setDirection] = useState<Direction | undefined>(undefined);\n\n const [visibleMenu, { toogle, off }] = useFlag();\n\n const listProps = {\n className: listClassName,\n getItemDescription,\n getItemHref,\n getItemImage,\n getItemOnClick,\n getItemLabel,\n items,\n view,\n onItemClick,\n };\n\n const elementZIndex =\n typeof props.style?.zIndex === 'number'\n ? props.style.zIndex + 1\n : undefined;\n\n return (\n <>\n <Button\n {...otherProps}\n size=\"s\"\n view=\"clear\"\n className={cnTileMenu(null, [className])}\n iconLeft={IconBento}\n ref={useForkRef([ref, buttonRef])}\n onClick={toogle}\n />\n {isMobile ? (\n <Sidebar\n isOpen={visibleMenu}\n onClickOutside={off}\n onClose={off}\n title={title}\n style={{ zIndex: elementZIndex }}\n >\n <TileMenuList {...listProps} />\n </Sidebar>\n ) : (\n <Transition timeout={animateTimeout} unmountOnExit in={visibleMenu}>\n {(animate) => (\n <Popover\n className={cnTileMenu('Popover', { view }, [\n cnMixPopoverAnimate({ animate, direction }),\n ])}\n anchorRef={buttonRef}\n arrowOffset={ARROW_OFFSET + ARROW_SIZE}\n offset={ARROW_SIZE + 4}\n onSetDirection={setDirection}\n style={{\n ['--popover-arrow-size' as string]: `${ARROW_SIZE}px`,\n ['--popover-arrow-offset' as string]: `${ARROW_OFFSET}px`,\n zIndex: elementZIndex,\n }}\n onClickOutside={off}\n >\n <div className={cnMixPopoverArrow({ direction })} />\n <div className={cnTileMenu('ListWrapper')}>\n <TileMenuList {...listProps} />\n </div>\n </Popover>\n )}\n </Transition>\n )}\n </>\n );\n}\n\nexport const TileMenu = forwardRef(TileMenuRender) as TileMenuComponent;\n\nexport * from './types';\n"],"mappings":"gRAAA,uBAEA,OAASA,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,SAAS,KAAQ,yBAAyB,CACnD,OACEC,cAAc,CACdC,mBAAmB,KACd,iCAAiC,CACxC,OAASC,iBAAiB,KAAQ,+BAA+B,CACjE,OAAoBC,OAAO,KAAQ,uBAAuB,CAC1D,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,OAASC,UAAU,KAAQ,0BAA0B,CACrD,MAAOC,MAAK,EAAIC,UAAU,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CAC3D,OAASC,UAAU,KAAQ,wBA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CAAC,aAAa,CAAE,EACxC,oBAAC,YAAY,CAAK0B,CAAS,CAAI,CAC3B,CAET,CAEJ,CAGP,CAEA,MAAO,MAAMK,SAAQ,CAAGvC,UAAU,CAACW,cAAc,CAAsB,CAEvE"}
@@ -1,8 +1,8 @@
1
1
  import './TileMenuItem.css';
2
2
  import React from 'react';
3
3
  export declare const tileMenuItemPropView: readonly ["card", "line"];
4
- export declare type TileMenuItemPropView = typeof tileMenuItemPropView[number];
5
- declare type TileMenuItemProps = {
4
+ export type TileMenuItemPropView = typeof tileMenuItemPropView[number];
5
+ type TileMenuItemProps = {
6
6
  image?: string | React.FC;
7
7
  title: string;
8
8
  description?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TileMenuItem.js","names":["forwardRefWithAs","cnMixSpace","Text","React","cn","tileMenuItemPropView","cnTileMenuItem","renderImage","image","title","TileMenuItem","props","ref","className","description","view","as","otherProps","viewIsCard","viewIsLine","p","pT","pV","pB"],"sources":["../../../../../../src/components/TileMenu/TileMenuItem/TileMenuItem.tsx"],"sourcesContent":["import './TileMenuItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nexport const tileMenuItemPropView = ['card', 'line'] as const;\nexport type TileMenuItemPropView = typeof tileMenuItemPropView[number];\n\ntype TileMenuItemProps = {\n image?: string | React.FC;\n title: string;\n description?: string;\n view?: TileMenuItemPropView;\n};\n\nconst cnTileMenuItem = cn('TileMenuItem');\n\nconst renderImage = (image: string | React.FC, title: string) => {\n if (typeof image === 'string') {\n return <img src={image} alt={title} />;\n }\n const ImageComponent = image;\n return <ImageComponent />;\n};\n\nexport const TileMenuItem = forwardRefWithAs<TileMenuItemProps>(\n (props, ref) => {\n const {\n image,\n className,\n title,\n description,\n view = 'line',\n as = 'div',\n ...otherProps\n } = props;\n\n const Tag = as as string;\n const viewIsCard = view === 'card';\n const viewIsLine = view === 'line';\n\n return (\n <Tag\n {...otherProps}\n ref={ref}\n className={cnTileMenuItem({ view }, [\n viewIsCard\n ? cnMixSpace({ p: 's', pT: 'm' })\n : cnMixSpace({ pV: 's' }),\n className,\n ])}\n >\n {image && (\n <div className={cnTileMenuItem('ImageWrapper')}>\n {renderImage(image, title)}\n </div>\n )}\n <div className={cnTileMenuItem('ContentWrapper')}>\n <Text\n weight={viewIsLine ? 'bold' : undefined}\n align={viewIsCard ? 'center' : undefined}\n className={cnTileMenuItem('Title', [\n viewIsLine ? cnMixSpace({ pB: '2xs' }) : undefined,\n ])}\n >\n {title}\n </Text>\n {description && viewIsLine && (\n <Text view=\"secondary\" className={cnTileMenuItem('Description')}>\n {description}\n </Text>\n )}\n </div>\n </Tag>\n );\n },\n);\n"],"mappings":"6JAAA,2BAEA,OAASA,gBAAT,KAAiC,kEAAjC,CACA,OAASC,UAAT,KAA2B,wBAA3B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAEA,MAAO,MAAMC,qBAAoB,CAAG,CAAC,MAAD,CAAS,MAAT,CAA7B,C,KAUDC,eAAc,CAAGF,EAAE,CAAC,cAAD,C,CAEnBG,WAAW,CAAG,CAACC,CAAD,CAA2BC,CAA3B,GAA6C,CAC/D,GAAqB,QAAjB,QAAOD,EAAX,CACE,MAAO,4BAAK,GAAG,CAAEA,CAAV,CAAiB,GAAG,CAAEC,CAAtB,EAAP,CAGF,MAAO,qBADgBD,CAChB,MACR,C,CAED,MAAO,MAAME,aAAY,CAAGV,gBAAgB,CAC1C,CAACW,CAAD,CAAQC,CAAR,GAAgB,MACR,CACJJ,KAAK,CAALA,CADI,CAEJK,SAAS,CAATA,CAFI,CAGJJ,KAAK,CAALA,CAHI,CAIJK,WAAW,CAAXA,CAJI,CAKJC,IAAI,CAAJA,CAAI,CAAG,MALH,CAMJC,EAAE,CAAFA,CAAE,CAAG,KAND,EAQFL,CATU,CAQTM,CARS,0BASVN,CATU,YAYRO,CAAU,CAAY,MAAT,GAAAH,CAZL,CAaRI,CAAU,CAAY,MAAT,GAAAJ,CAbL,CAed,MACE,qBALUC,CAKV,kBACMC,CADN,EAEE,GAAG,CAAEL,CAFP,CAGE,SAAS,CAAEN,cAAc,CAAC,CAAES,IAAI,CAAJA,CAAF,CAAD,CAAW,CAClCG,CAAU,CACNjB,UAAU,CAAC,CAAEmB,CAAC,CAAE,GAAL,CAAUC,EAAE,CAAE,GAAd,CAAD,CADJ,CAENpB,UAAU,CAAC,CAAEqB,EAAE,CAAE,GAAN,CAAD,CAHoB,CAIlCT,CAJkC,CAAX,CAH3B,GAUGL,CAAK,EACJ,2BAAK,SAAS,CAAEF,cAAc,CAAC,cAAD,CAA9B,EACGC,WAAW,CAACC,CAAD,CAAQC,CAAR,CADd,CAXJ,CAeE,2BAAK,SAAS,CAAEH,cAAc,CAAC,gBAAD,CAA9B,EACE,oBAAC,IAAD,EACE,MAAM,CAAEa,CAAU,CAAG,MAAH,OADpB,CAEE,KAAK,CAAED,CAAU,CAAG,QAAH,OAFnB,CAGE,SAAS,CAAEZ,cAAc,CAAC,OAAD,CAAU,CACjCa,CAAU,CAAGlB,UAAU,CAAC,CAAEsB,EAAE,CAAE,KAAN,CAAD,CAAb,OADuB,CAAV,CAH3B,EAOGd,CAPH,CADF,CAUGK,CAAW,EAAIK,CAAf,EACC,oBAAC,IAAD,EAAM,IAAI,CAAC,WAAX,CAAuB,SAAS,CAAEb,cAAc,CAAC,aAAD,CAAhD,EACGQ,CADH,CAXJ,CAfF,CAiCH,CAlDyC,CAArC"}
1
+ {"version":3,"file":"TileMenuItem.js","names":["forwardRefWithAs","cnMixSpace","Text","React","cn","tileMenuItemPropView","cnTileMenuItem","renderImage","image","title","TileMenuItem","props","ref","className","description","view","as","otherProps","viewIsCard","viewIsLine","p","pT","pV","pB"],"sources":["../../../../../../src/components/TileMenu/TileMenuItem/TileMenuItem.tsx"],"sourcesContent":["import './TileMenuItem.css';\n\nimport { forwardRefWithAs } from '@consta/uikit/__internal__/src/utils/types/PropsWithAsAttributes';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nexport const tileMenuItemPropView = ['card', 'line'] as const;\nexport type TileMenuItemPropView = typeof tileMenuItemPropView[number];\n\ntype TileMenuItemProps = {\n image?: string | React.FC;\n title: string;\n description?: string;\n view?: TileMenuItemPropView;\n};\n\nconst cnTileMenuItem = cn('TileMenuItem');\n\nconst renderImage = (image: string | React.FC, title: string) => {\n if (typeof image === 'string') {\n return <img src={image} alt={title} />;\n }\n const ImageComponent = image;\n return <ImageComponent />;\n};\n\nexport const TileMenuItem = forwardRefWithAs<TileMenuItemProps>(\n (props, ref) => {\n const {\n image,\n className,\n title,\n description,\n view = 'line',\n as = 'div',\n ...otherProps\n } = props;\n\n const Tag = as as string;\n const viewIsCard = view === 'card';\n const viewIsLine = view === 'line';\n\n return (\n <Tag\n {...otherProps}\n ref={ref}\n className={cnTileMenuItem({ view }, [\n viewIsCard\n ? cnMixSpace({ p: 's', pT: 'm' })\n : cnMixSpace({ pV: 's' }),\n className,\n ])}\n >\n {image && (\n <div className={cnTileMenuItem('ImageWrapper')}>\n {renderImage(image, title)}\n </div>\n )}\n <div className={cnTileMenuItem('ContentWrapper')}>\n <Text\n weight={viewIsLine ? 'bold' : undefined}\n align={viewIsCard ? 'center' : undefined}\n className={cnTileMenuItem('Title', [\n viewIsLine ? cnMixSpace({ pB: '2xs' }) : undefined,\n ])}\n >\n {title}\n </Text>\n {description && viewIsLine && (\n <Text view=\"secondary\" className={cnTileMenuItem('Description')}>\n {description}\n </Text>\n )}\n </div>\n </Tag>\n );\n },\n);\n"],"mappings":"6JAAA,2BAEA,OAASA,gBAAgB,KAAQ,kEAAkE,CACnG,OAASC,UAAU,KAAQ,wBAAwB,CACnD,OA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H,cAAc,CAAC,gBAAgB,CAAE,EAC/C,oBAAC,IAAI,EACH,MAAM,CAAEa,CAAU,CAAG,MAAM,OAAa,CACxC,KAAK,CAAED,CAAU,CAAG,QAAQ,OAAa,CACzC,SAAS,CAAEZ,cAAc,CAAC,OAAO,CAAE,CACjCa,CAAU,CAAGlB,UAAU,CAAC,CAAEsB,EAAE,CAAE,KAAM,CAAC,CAAC,OAAY,CACnD,CAAE,EAEFd,CAAK,CACD,CACNK,CAAW,EAAIK,CAAU,EACxB,oBAAC,IAAI,EAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAEb,cAAc,CAAC,aAAa,CAAE,EAC7DQ,CAAW,CAEf,CACG,CAGZ,CAAC,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"TileMenuList.js","names":["getByMap","cnMixSpace","React","cn","withDefaultGetters","TileMenuItem","cnTileMenuList","itemViewMap","lines","twoLines","cards","TileMenuList","props","items","view","className","children","getItemDescription","getItemImage","getItemLabel","getItemHref","getItemOnClick","onItemClick","otherProps","p","map","item","index","e"],"sources":["../../../../../../src/components/TileMenu/TileMenuList/TileMenuList.tsx"],"sourcesContent":["import './TileMenuList.css';\n\nimport { getByMap } from '@consta/uikit/__internal__/src/utils/getByMap';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from '../helpers';\nimport { TileMenuItem } from '../TileMenuItem/TileMenuItem';\nimport { TileMenuListComponent, TileMenuListProps } from '../types';\n\nexport const cnTileMenuList = cn('TileMenuList');\n\nconst itemViewMap = {\n lines: 'line',\n twoLines: 'line',\n cards: 'card',\n} as const;\n\nexport const TileMenuList = ((props: TileMenuListProps) => {\n const {\n items,\n view = 'lines',\n className,\n children,\n getItemDescription,\n getItemImage,\n getItemLabel,\n getItemHref,\n getItemOnClick,\n onItemClick,\n ...otherProps\n } = withDefaultGetters(props);\n\n return (\n <div\n {...otherProps}\n className={cnTileMenuList({ view }, [cnMixSpace({ p: 'xl' }), className])}\n >\n {items.map((item, index) => {\n return (\n <TileMenuItem\n className={cnTileMenuList('Item')}\n key={cnTileMenuList('Item', { index })}\n view={getByMap(itemViewMap, view)}\n image={getItemImage(item)}\n title={getItemLabel(item)}\n description={getItemDescription(item)}\n href={getItemHref(item)}\n onClick={(e) => {\n onItemClick?.({ item, e });\n getItemOnClick(item)?.(e);\n }}\n as=\"a\"\n />\n );\n })}\n </div>\n );\n}) as TileMenuListComponent;\n"],"mappings":"6OAAA,2BAEA,OAASA,QAAT,KAAyB,+CAAzB,CACA,OAASC,UAAT,KAA2B,wBAA3B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAEA,OAASC,kBAAT,kBACA,OAASC,YAAT,oCAGA,MAAO,MAAMC,eAAc,CAAGH,EAAE,CAAC,cAAD,CAAzB,CAEP,KAAMI,YAAW,CAAG,CAClBC,KAAK,CAAE,MADW,CAElBC,QAAQ,CAAE,MAFQ,CAGlBC,KAAK,CAAE,MAHW,CAApB,CAMA,MAAO,MAAMC,aAAY,CAAKC,CAAD,EAA8B,CACzD,QAYIR,kBAAkB,CAACQ,CAAD,CAZtB,CAAM,CACJC,KAAK,CAALA,CADI,CAEJC,IAAI,CAAJA,CAAI,CAAG,OAFH,CAGJC,SAAS,CAATA,CAHI,CAIJC,QAAQ,CAARA,CAJI,CAKJC,kBAAkB,CAAlBA,CALI,CAMJC,YAAY,CAAZA,CANI,CAOJC,YAAY,CAAZA,CAPI,CAQJC,WAAW,CAAXA,CARI,CASJC,cAAc,CAAdA,CATI,CAUJC,WAAW,CAAXA,CAVI,CAAN,GAWKC,CAXL,uCAcA,MACE,4CACMA,CADN,EAEE,SAAS,CAAEjB,cAAc,CAAC,CAAEQ,IAAI,CAAJA,CAAF,CAAD,CAAW,CAACb,UAAU,CAAC,CAAEuB,CAAC,CAAE,IAAL,CAAD,CAAX,CAA0BT,CAA1B,CAAX,CAF3B,GAIGF,CAAK,CAACY,GAAN,CAAU,CAACC,CAAD,CAAOC,CAAP,GAEP,oBAAC,YAAD,EACE,SAAS,CAAErB,cAAc,CAAC,MAAD,CAD3B,CAEE,GAAG,CAAEA,cAAc,CAAC,MAAD,CAAS,CAAEqB,KAAK,CAALA,CAAF,CAAT,CAFrB,CAGE,IAAI,CAAE3B,QAAQ,CAACO,WAAD,CAAcO,CAAd,CAHhB,CAIE,KAAK,CAAEI,CAAY,CAACQ,CAAD,CAJrB,CAKE,KAAK,CAAEP,CAAY,CAACO,CAAD,CALrB,CAME,WAAW,CAAET,CAAkB,CAACS,CAAD,CANjC,CAOE,IAAI,CAAEN,CAAW,CAACM,CAAD,CAPnB,CAQE,OAAO,CAAGE,CAAD,EAAO,cACdN,CADc,WACdA,CADc,QACdA,CAAW,CAAG,CAAEI,IAAI,CAAJA,CAAF,CAAQE,CAAC,CAADA,CAAR,CAAH,CADG,WAEdP,CAAc,CAACK,CAAD,CAFA,qBAEd,EAAuBE,CAAvB,CACD,CAXH,CAYE,EAAE,CAAC,GAZL,EAFH,CAJH,CAwBH,CAxCM"}
1
+ {"version":3,"file":"TileMenuList.js","names":["getByMap","cnMixSpace","React","cn","withDefaultGetters","TileMenuItem","cnTileMenuList","itemViewMap","lines","twoLines","cards","TileMenuList","props","items","view","className","children","getItemDescription","getItemImage","getItemLabel","getItemHref","getItemOnClick","onItemClick","otherProps","p","map","item","index","e"],"sources":["../../../../../../src/components/TileMenu/TileMenuList/TileMenuList.tsx"],"sourcesContent":["import './TileMenuList.css';\n\nimport { getByMap } from '@consta/uikit/__internal__/src/utils/getByMap';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from '../helpers';\nimport { TileMenuItem } from '../TileMenuItem/TileMenuItem';\nimport { TileMenuListComponent, TileMenuListProps } from '../types';\n\nexport const cnTileMenuList = cn('TileMenuList');\n\nconst itemViewMap = {\n lines: 'line',\n twoLines: 'line',\n cards: 'card',\n} as const;\n\nexport const TileMenuList = ((props: TileMenuListProps) => {\n const {\n items,\n view = 'lines',\n className,\n children,\n getItemDescription,\n getItemImage,\n getItemLabel,\n getItemHref,\n getItemOnClick,\n onItemClick,\n ...otherProps\n } = withDefaultGetters(props);\n\n return (\n <div\n {...otherProps}\n className={cnTileMenuList({ view }, [cnMixSpace({ p: 'xl' }), className])}\n >\n {items.map((item, index) => {\n return (\n <TileMenuItem\n className={cnTileMenuList('Item')}\n key={cnTileMenuList('Item', { index })}\n view={getByMap(itemViewMap, view)}\n image={getItemImage(item)}\n title={getItemLabel(item)}\n description={getItemDescription(item)}\n href={getItemHref(item)}\n onClick={(e) => {\n onItemClick?.({ item, e });\n getItemOnClick(item)?.(e);\n }}\n as=\"a\"\n />\n );\n })}\n </div>\n );\n}) as TileMenuListComponent;\n"],"mappings":"6OAAA,2BAEA,OAASA,QAAQ,KAAQ,+CAA+C,CACxE,OAASC,UAAU,KAAQ,wBAAwB,CACnD,MAAOC,MAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,0BAEX,OAASC,kBAAkB,kBAC3B,OAASC,YAAY,oCAGrB,MAAO,MAAMC,eAAc,CAAGH,EAAE,CAAC,cAAc,CAAC,CAEhD,KAAMI,YAAW,CAAG,CAClBC,KAAK,CAAE,MAAM,CACbC,QAAQ,CAAE,MAAM,CAChBC,KAAK,CAAE,MACT,CAAU,CAEV,MAAO,MAAMC,aAAY,CAAKC,CAAwB,EAAK,CACzD,QAYIR,kBAAkB,CAACQ,CAAK,CAAC,CAZvB,CACJC,KAAK,CAALA,CAAK,CACLC,IAAI,CAAJA,CAAI,CAAG,OAAO,CACdC,SAAS,CAATA,CAAS,CACTC,QAAQ,CAARA,CAAQ,CACRC,kBAAkB,CAAlBA,CAAkB,CAClBC,YAAY,CAAZA,CAAY,CACZC,YAAY,CAAZA,CAAY,CACZC,WAAW,CAAXA,CAAW,CACXC,cAAc,CAAdA,CAAc,CACdC,WAAW,CAAXA,CAEF,CAAC,GADIC,CAAU,uCAGf,MACE,4CACMA,CAAU,EACd,SAAS,CAAEjB,cAAc,CAAC,CAAEQ,IAAI,CAAJA,CAAK,CAAC,CAAE,CAACb,UAAU,CAAC,CAAEuB,CAAC,CAAE,IAAK,CAAC,CAAC,CAAET,CAAS,CAAC,CAAE,GAEzEF,CAAK,CAACY,GAAG,CAAC,CAACC,CAAI,CAAEC,CAAK,GAEnB,oBAAC,YAAY,EACX,SAAS,CAAErB,cAAc,CAAC,MAAM,CAAE,CAClC,GAAG,CAAEA,cAAc,CAAC,MAAM,CAAE,CAAEqB,KAAK,CAALA,CAAM,CAAC,CAAE,CACvC,IAAI,CAAE3B,QAAQ,CAACO,WAAW,CAAEO,CAAI,CAAE,CAClC,KAAK,CAAEI,CAAY,CAACQ,CAAI,CAAE,CAC1B,KAAK,CAAEP,CAAY,CAACO,CAAI,CAAE,CAC1B,WAAW,CAAET,CAAkB,CAACS,CAAI,CAAE,CACtC,IAAI,CAAEN,CAAW,CAACM,CAAI,CAAE,CACxB,OAAO,CAAGE,CAAC,EAAK,cACdN,CAAW,WAAXA,CAAW,QAAXA,CAAW,CAAG,CAAEI,IAAI,CAAJA,CAAI,CAAEE,CAAC,CAADA,CAAE,CAAC,CAAC,WAC1BP,CAAc,CAACK,CAAI,CAAC,qBAApB,EAAuBE,CAAC,CAC1B,CAAE,CACF,EAAE,CAAC,GAAG,EAGX,CAAC,CAGR,CAA2B"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { PropsWithHTMLAttributesAndRef } from "../../../utils/types/PropsWithHTMLAttributes";
3
- export declare type TileMenuPropView = 'lines' | 'twoLines' | 'cards';
4
- export declare type TileMenuPropItem = {
3
+ export type TileMenuPropView = 'lines' | 'twoLines' | 'cards';
4
+ export type TileMenuPropItem = {
5
5
  title: string;
6
6
  description?: string;
7
7
  image?: string;
@@ -12,15 +12,15 @@ export declare type TileMenuPropItem = {
12
12
  href: undefined;
13
13
  onClick?: React.MouseEventHandler<HTMLDivElement>;
14
14
  });
15
- export declare type DefaultItem = {
15
+ export type DefaultItem = {
16
16
  image?: string | React.FC;
17
17
  title: string;
18
18
  description?: string;
19
19
  };
20
- declare type GetItemImage<ITEM> = (item: ITEM) => string | React.FC | undefined;
21
- declare type GetItemTitle<ITEM> = (item: ITEM) => string;
22
- declare type GetItemDescription<ITEM> = (item: ITEM) => string;
23
- export declare type TileMenuListProps<ITEM> = PropsWithHTMLAttributesAndRef<{
20
+ type GetItemImage<ITEM> = (item: ITEM) => string | React.FC | undefined;
21
+ type GetItemTitle<ITEM> = (item: ITEM) => string;
22
+ type GetItemDescription<ITEM> = (item: ITEM) => string;
23
+ export type TileMenuListProps<ITEM> = PropsWithHTMLAttributesAndRef<{
24
24
  view?: TileMenuPropView;
25
25
  items: ITEM[];
26
26
  isMobile?: boolean;
@@ -28,5 +28,5 @@ export declare type TileMenuListProps<ITEM> = PropsWithHTMLAttributesAndRef<{
28
28
  getItemTitle: GetItemTitle<ITEM>;
29
29
  getItemDescription: GetItemDescription<ITEM>;
30
30
  }, HTMLDivElement>;
31
- export declare type TileMenuListComponent = <ITEM = DefaultItem>(props: TileMenuListProps<ITEM>) => React.ReactElement | null;
31
+ export type TileMenuListComponent = <ITEM = DefaultItem>(props: TileMenuListProps<ITEM>) => React.ReactElement | null;
32
32
  export {};
@@ -28,6 +28,7 @@ export declare function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>)
28
28
  hidden?: boolean | undefined;
29
29
  id?: string | undefined;
30
30
  lang?: string | undefined;
31
+ nonce?: string | undefined;
31
32
  placeholder?: string | undefined;
32
33
  slot?: string | undefined;
33
34
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -179,6 +180,8 @@ export declare function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>)
179
180
  onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
180
181
  onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
181
182
  onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
183
+ onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
184
+ onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
182
185
  onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
183
186
  onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
184
187
  onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["defaultGetItemImage","item","image","defaultGetItemLabel","label","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemDescription","description","withDefaultGetters","props","getItemDescription","getItemLabel","getItemImage","getItemHref","getItemOnClick"],"sources":["../../../../../src/components/TileMenu/helpers.ts"],"sourcesContent":["import {\n TileMenuDefaultItem,\n TileMenuListProps,\n TileMenuPropGetItemDescription,\n TileMenuPropGetItemHref,\n TileMenuPropGetItemImage,\n TileMenuPropGetItemLabel,\n TileMenuPropGetItemOnClick,\n} from './types';\n\nexport const defaultGetItemImage: TileMenuPropGetItemImage<\n TileMenuDefaultItem\n> = (item) => item.image;\nexport const defaultGetItemLabel: TileMenuPropGetItemLabel<\n TileMenuDefaultItem\n> = (item) => item.label;\nexport const defaultGetItemHref: TileMenuPropGetItemHref<\n TileMenuDefaultItem\n> = (item) => item.href;\nexport const defaultGetItemOnClick: TileMenuPropGetItemOnClick<\n TileMenuDefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemDescription: TileMenuPropGetItemDescription<\n TileMenuDefaultItem\n> = (item) => item.description;\n\nexport function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>) {\n return {\n ...props,\n getItemDescription: props.getItemDescription || defaultGetItemDescription,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemImage: props.getItemImage || defaultGetItemImage,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n"],"mappings":"qqBAUA,MAAO,MAAMA,oBAEZ,CAAIC,CAAD,EAAUA,CAAI,CAACC,KAFZ,CAGP,MAAO,MAAMC,oBAEZ,CAAIF,CAAD,EAAUA,CAAI,CAACG,KAFZ,CAGP,MAAO,MAAMC,mBAEZ,CAAIJ,CAAD,EAAUA,CAAI,CAACK,IAFZ,CAGP,MAAO,MAAMC,sBAEZ,CAAIN,CAAD,EAAUA,CAAI,CAACO,OAFZ,CAGP,MAAO,MAAMC,0BAEZ,CAAIR,CAAD,EAAUA,CAAI,CAACS,WAFZ,CAIP,MAAO,SAASC,mBAAT,CAAkCC,CAAlC,CAAkE,CACvE,sCACKA,CADL,MAEEC,kBAAkB,CAAED,CAAK,CAACC,kBAAN,EAA4BJ,yBAFlD,CAGEK,YAAY,CAAEF,CAAK,CAACE,YAAN,EAAsBX,mBAHtC,CAIEY,YAAY,CAAEH,CAAK,CAACG,YAAN,EAAsBf,mBAJtC,CAKEgB,WAAW,CAAEJ,CAAK,CAACI,WAAN,EAAqBX,kBALpC,CAMEY,cAAc,CAAEL,CAAK,CAACK,cAAN,EAAwBV,qBAN1C,EAQD"}
1
+ {"version":3,"file":"helpers.js","names":["defaultGetItemImage","item","image","defaultGetItemLabel","label","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemDescription","description","withDefaultGetters","props","getItemDescription","getItemLabel","getItemImage","getItemHref","getItemOnClick"],"sources":["../../../../../src/components/TileMenu/helpers.ts"],"sourcesContent":["import {\n TileMenuDefaultItem,\n TileMenuListProps,\n TileMenuPropGetItemDescription,\n TileMenuPropGetItemHref,\n TileMenuPropGetItemImage,\n TileMenuPropGetItemLabel,\n TileMenuPropGetItemOnClick,\n} from './types';\n\nexport const defaultGetItemImage: TileMenuPropGetItemImage<\n TileMenuDefaultItem\n> = (item) => item.image;\nexport const defaultGetItemLabel: TileMenuPropGetItemLabel<\n TileMenuDefaultItem\n> = (item) => item.label;\nexport const defaultGetItemHref: TileMenuPropGetItemHref<\n TileMenuDefaultItem\n> = (item) => item.href;\nexport const defaultGetItemOnClick: TileMenuPropGetItemOnClick<\n TileMenuDefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemDescription: TileMenuPropGetItemDescription<\n TileMenuDefaultItem\n> = (item) => item.description;\n\nexport function withDefaultGetters<ITEM>(props: TileMenuListProps<ITEM>) {\n return {\n ...props,\n getItemDescription: props.getItemDescription || defaultGetItemDescription,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemImage: props.getItemImage || defaultGetItemImage,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n };\n}\n"],"mappings":"qqBAUA,MAAO,MAAMA,oBAEZ,CAAIC,CAAI,EAAKA,CAAI,CAACC,KAAK,CACxB,MAAO,MAAMC,oBAEZ,CAAIF,CAAI,EAAKA,CAAI,CAACG,KAAK,CACxB,MAAO,MAAMC,mBAEZ,CAAIJ,CAAI,EAAKA,CAAI,CAACK,IAAI,CACvB,MAAO,MAAMC,sBAEZ,CAAIN,CAAI,EAAKA,CAAI,CAACO,OAAO,CAC1B,MAAO,MAAMC,0BAEZ,CAAIR,CAAI,EAAKA,CAAI,CAACS,WAAW,CAE9B,MAAO,SAASC,mBAAkB,CAAOC,CAA8B,CAAE,CACvE,sCACKA,CAAK,MACRC,kBAAkB,CAAED,CAAK,CAACC,kBAAkB,EAAIJ,yBAAyB,CACzEK,YAAY,CAAEF,CAAK,CAACE,YAAY,EAAIX,mBAAmB,CACvDY,YAAY,CAAEH,CAAK,CAACG,YAAY,EAAIf,mBAAmB,CACvDgB,WAAW,CAAEJ,CAAK,CAACI,WAAW,EAAIX,kBAAkB,CACpDY,cAAc,CAAEL,CAAK,CAACK,cAAc,EAAIV,qBAAqB,EAEjE"}
@@ -1,29 +1,29 @@
1
1
  /// <reference types="react" />
2
2
  import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
3
3
  export declare const tileMenuPropView: readonly ["lines", "twoLines", "cards"];
4
- export declare type TileMenuPropView = typeof tileMenuPropView[number];
4
+ export type TileMenuPropView = typeof tileMenuPropView[number];
5
5
  export declare const tileMenuPropViewDefault: "lines";
6
- export declare type TileMenuDefaultItem = {
6
+ export type TileMenuDefaultItem = {
7
7
  label: string;
8
8
  image?: string;
9
9
  description?: string;
10
10
  href?: string;
11
11
  onClick?: React.MouseEventHandler<HTMLAnchorElement>;
12
12
  };
13
- export declare type TileMenuPropGetItemImage<ITEM> = (item: ITEM) => string | React.FC | undefined;
14
- export declare type TileMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
15
- export declare type TileMenuPropGetItemDescription<ITEM> = (item: ITEM) => string | undefined;
16
- export declare type TileMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
17
- export declare type TileMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler<HTMLAnchorElement> | undefined;
18
- export declare type TileMenuPropOnItemClick<ITEM> = (props: {
13
+ export type TileMenuPropGetItemImage<ITEM> = (item: ITEM) => string | React.FC | undefined;
14
+ export type TileMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
15
+ export type TileMenuPropGetItemDescription<ITEM> = (item: ITEM) => string | undefined;
16
+ export type TileMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
17
+ export type TileMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.MouseEventHandler<HTMLAnchorElement> | undefined;
18
+ export type TileMenuPropOnItemClick<ITEM> = (props: {
19
19
  e: React.MouseEvent<HTMLAnchorElement>;
20
20
  item: ITEM;
21
21
  }) => void;
22
- export declare type TileMenuOnItemClick<ITEM> = (props: {
22
+ export type TileMenuOnItemClick<ITEM> = (props: {
23
23
  e: React.MouseEvent<HTMLAnchorElement>;
24
24
  item: ITEM;
25
25
  }) => void;
26
- declare type CommonProps<ITEM> = {
26
+ type CommonProps<ITEM> = {
27
27
  view?: TileMenuPropView;
28
28
  items: ITEM[];
29
29
  isMobile?: boolean;
@@ -34,7 +34,7 @@ declare type CommonProps<ITEM> = {
34
34
  getItemHref?: TileMenuPropGetItemHref<ITEM>;
35
35
  getItemOnClick?: TileMenuPropGetItemOnClick<ITEM>;
36
36
  };
37
- export declare type TileMenuProps<ITEM = TileMenuDefaultItem> = PropsWithHTMLAttributesAndRef<CommonProps<ITEM> & {
37
+ export type TileMenuProps<ITEM = TileMenuDefaultItem> = PropsWithHTMLAttributesAndRef<CommonProps<ITEM> & {
38
38
  listClassName?: string;
39
39
  title?: string;
40
40
  }, HTMLButtonElement> & (ITEM extends {
@@ -42,7 +42,7 @@ export declare type TileMenuProps<ITEM = TileMenuDefaultItem> = PropsWithHTMLAtt
42
42
  } ? {} : {
43
43
  getItemLabel: TileMenuPropGetItemLabel<ITEM>;
44
44
  });
45
- export declare type TileMenuListProps<ITEM = TileMenuDefaultItem> = PropsWithHTMLAttributes<CommonProps<ITEM>, HTMLDivElement>;
46
- export declare type TileMenuListComponent = <ITEM = TileMenuDefaultItem>(props: TileMenuListProps<ITEM>) => React.ReactElement | null;
47
- export declare type TileMenuComponent = <ITEM = TileMenuDefaultItem>(props: TileMenuProps<ITEM>) => React.ReactElement | null;
45
+ export type TileMenuListProps<ITEM = TileMenuDefaultItem> = PropsWithHTMLAttributes<CommonProps<ITEM>, HTMLDivElement>;
46
+ export type TileMenuListComponent = <ITEM = TileMenuDefaultItem>(props: TileMenuListProps<ITEM>) => React.ReactElement | null;
47
+ export type TileMenuComponent = <ITEM = TileMenuDefaultItem>(props: TileMenuProps<ITEM>) => React.ReactElement | null;
48
48
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["tileMenuPropView","tileMenuPropViewDefault"],"sources":["../../../../../src/components/TileMenu/types.ts"],"sourcesContent":["import {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const tileMenuPropView = ['lines', 'twoLines', 'cards'] as const;\nexport type TileMenuPropView = typeof tileMenuPropView[number];\nexport const tileMenuPropViewDefault = tileMenuPropView[0];\n\nexport type TileMenuDefaultItem = {\n label: string;\n image?: string;\n description?: string;\n href?: string;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\nexport type TileMenuPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | React.FC | undefined;\nexport type TileMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type TileMenuPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type TileMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;\nexport type TileMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler<HTMLAnchorElement> | undefined;\nexport type TileMenuPropOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\nexport type TileMenuOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\n\ntype CommonProps<ITEM> = {\n view?: TileMenuPropView;\n items: ITEM[];\n isMobile?: boolean;\n onItemClick?: TileMenuOnItemClick<ITEM>;\n getItemImage?: TileMenuPropGetItemImage<ITEM>;\n getItemLabel?: TileMenuPropGetItemLabel<ITEM>;\n getItemDescription?: TileMenuPropGetItemDescription<ITEM>;\n getItemHref?: TileMenuPropGetItemHref<ITEM>;\n getItemOnClick?: TileMenuPropGetItemOnClick<ITEM>;\n};\n\nexport type TileMenuProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n CommonProps<ITEM> & { listClassName?: string; title?: string },\n HTMLButtonElement\n > &\n (ITEM extends { label: TileMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: TileMenuPropGetItemLabel<ITEM> });\n\nexport type TileMenuListProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributes<CommonProps<ITEM>, HTMLDivElement>;\n\nexport type TileMenuListComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuListProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type TileMenuComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAKA,MAAO,MAAMA,iBAAgB,CAAG,CAAC,OAAD,CAAU,UAAV,CAAsB,OAAtB,CAAzB,CAEP,MAAO,MAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD"}
1
+ {"version":3,"file":"types.js","names":["tileMenuPropView","tileMenuPropViewDefault"],"sources":["../../../../../src/components/TileMenu/types.ts"],"sourcesContent":["import {\n PropsWithHTMLAttributes,\n PropsWithHTMLAttributesAndRef,\n} from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const tileMenuPropView = ['lines', 'twoLines', 'cards'] as const;\nexport type TileMenuPropView = typeof tileMenuPropView[number];\nexport const tileMenuPropViewDefault = tileMenuPropView[0];\n\nexport type TileMenuDefaultItem = {\n label: string;\n image?: string;\n description?: string;\n href?: string;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n};\n\nexport type TileMenuPropGetItemImage<ITEM> = (\n item: ITEM,\n) => string | React.FC | undefined;\nexport type TileMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type TileMenuPropGetItemDescription<ITEM> = (\n item: ITEM,\n) => string | undefined;\nexport type TileMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;\nexport type TileMenuPropGetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.MouseEventHandler<HTMLAnchorElement> | undefined;\nexport type TileMenuPropOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\nexport type TileMenuOnItemClick<ITEM> = (props: {\n e: React.MouseEvent<HTMLAnchorElement>;\n item: ITEM;\n}) => void;\n\ntype CommonProps<ITEM> = {\n view?: TileMenuPropView;\n items: ITEM[];\n isMobile?: boolean;\n onItemClick?: TileMenuOnItemClick<ITEM>;\n getItemImage?: TileMenuPropGetItemImage<ITEM>;\n getItemLabel?: TileMenuPropGetItemLabel<ITEM>;\n getItemDescription?: TileMenuPropGetItemDescription<ITEM>;\n getItemHref?: TileMenuPropGetItemHref<ITEM>;\n getItemOnClick?: TileMenuPropGetItemOnClick<ITEM>;\n};\n\nexport type TileMenuProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n CommonProps<ITEM> & { listClassName?: string; title?: string },\n HTMLButtonElement\n > &\n (ITEM extends { label: TileMenuDefaultItem['label'] }\n ? {}\n : { getItemLabel: TileMenuPropGetItemLabel<ITEM> });\n\nexport type TileMenuListProps<ITEM = TileMenuDefaultItem> =\n PropsWithHTMLAttributes<CommonProps<ITEM>, HTMLDivElement>;\n\nexport type TileMenuListComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuListProps<ITEM>,\n) => React.ReactElement | null;\n\nexport type TileMenuComponent = <ITEM = TileMenuDefaultItem>(\n props: TileMenuProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAKA,MAAO,MAAMA,iBAAgB,CAAG,CAAC,OAAO,CAAE,UAAU,CAAE,OAAO,CAAU,CAEvE,MAAO,MAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerticalMenu.js","names":["cnForCssTransition","useDebounce","useMutableRef","useRefs","React","forwardRef","useCallback","useEffect","useState","CSSTransition","TransitionGroup","getItemClick","cn","withDefaultGetters","VerticalMenuLevel","cnVerticalMenu","transitionCn","VerticalMenuRender","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","header","onItemClick","getItemGroup","footer","otherProps","levels","setLevels","id","animationBack","setAnimationBack","levelRefs","length","disableAnimationBack","addLevel","level","l","newLevels","Array","from","push","removeLevel","pop","getItemSubMenuRef","getItemLabelRef","keys","split","slice","forEach","index","item","levelItems","current","levelLabel","label","map","levelNum","menuItem","VerticalMenu"],"sources":["../../../../../src/components/VerticalMenu/VerticalMenu.tsx"],"sourcesContent":["import './VerticalMenu.css';\n\nimport { cnForCssTransition } from '@consta/uikit/__internal__/src/utils/cnForCssTransition';\nimport { useDebounce } from '@consta/uikit/useDebounce';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport { useRefs } from '@consta/uikit/useRefs';\nimport React, { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\n\nimport { getItemClick } from '##/helpers/getItemClick';\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n DefaultItem,\n Level,\n VerticalMenuComponent,\n VerticalMenuProps,\n} from './types';\nimport { VerticalMenuLevel } from './VerticalMenuLevel/VerticalMenuLevel';\n\nexport const cnVerticalMenu = cn('VerticalMenu');\n\nconst transitionCn = cnForCssTransition(cnVerticalMenu, 'Level');\n\nconst VerticalMenuRender = (\n props: VerticalMenuProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n header,\n onItemClick,\n getItemGroup,\n footer,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [levels, setLevels] = useState<Array<Level<DefaultItem>>>([\n { items, id: '0' },\n ]);\n const [animationBack, setAnimationBack] = useState<boolean>(false);\n\n const levelRefs = useRefs<HTMLDivElement>(levels.length);\n\n const disableAnimationBack = useDebounce(() => setAnimationBack(false), 250);\n\n const addLevel = useCallback(\n (level: Level<typeof items[number]>) =>\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.push(level);\n return newLevels;\n }),\n [],\n );\n\n const removeLevel = useCallback(() => {\n setAnimationBack(true);\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.pop();\n return newLevels;\n });\n disableAnimationBack();\n }, []);\n\n const getItemSubMenuRef = useMutableRef(getItemSubMenu);\n const getItemLabelRef = useMutableRef(getItemLabel);\n\n useEffect(() => {\n // обновляем уровни при смене items\n const keys = levels[levels.length - 1].id.split('-').slice(1);\n\n let id = '0';\n\n const newLevels: Array<Level<DefaultItem>> = [{ items, id }];\n\n keys.forEach((index) => {\n const item = newLevels[newLevels.length - 1].items[Number(index)];\n\n if (!item) {\n return;\n }\n\n const levelItems = getItemSubMenuRef.current(item);\n const levelLabel = getItemLabelRef.current(item);\n id = `${id}-${index}`;\n\n if (!levelItems) {\n return;\n }\n\n newLevels.push({ items: levelItems, label: levelLabel, id });\n });\n\n setLevels(newLevels);\n }, [items]);\n\n return (\n <div\n {...otherProps}\n className={cnVerticalMenu({ animationBack }, [className])}\n ref={ref}\n >\n <TransitionGroup enter exit className={cnVerticalMenu('Levels')}>\n {levels.map((level, index) => {\n const levelNum = index + 1;\n if (levelNum >= levels.length) {\n return (\n <CSSTransition\n classNames={transitionCn}\n key={levelNum}\n timeout={250}\n nodeRef={levelRefs[index]}\n >\n <VerticalMenuLevel\n ref={levelRefs[index]}\n id={level.id}\n items={level.items}\n label={level.label}\n addLevel={addLevel}\n removeLevel={removeLevel}\n className={cnVerticalMenu('Level', {\n current: levelNum === levels.length,\n })}\n key={levelNum}\n header={index === 0 && header}\n footer={index === 0 && footer}\n getItemActive={getItemActive}\n getItemHref={getItemHref}\n getItemLabel={getItemLabel}\n getItemOnClick={(menuItem) =>\n getItemClick(menuItem, getItemOnClick, onItemClick)\n }\n getItemTarget={getItemTarget}\n getItemSubMenu={getItemSubMenu}\n getItemGroup={getItemGroup}\n />\n </CSSTransition>\n );\n }\n })}\n </TransitionGroup>\n </div>\n );\n};\n\nexport const VerticalMenu = forwardRef(\n VerticalMenuRender,\n) as VerticalMenuComponent;\n\nexport * from './types';\n"],"mappings":"yQAAA,2BAEA,OAASA,kBAAT,KAAmC,yDAAnC,CACA,OAASC,WAAT,KAA4B,2BAA5B,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,OAASC,OAAT,KAAwB,uBAAxB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,WAA5B,CAAyCC,SAAzC,CAAoDC,QAApD,K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AD,EACdrD,YAAY,CAACqD,CAAD,CAAWvC,CAAX,CAA2BI,CAA3B,CAjBhB,CAmBE,aAAa,CAAEH,CAnBjB,CAoBE,cAAc,CAAEC,CApBlB,CAqBE,YAAY,CAAEG,CArBhB,EANF,CAgCL,CApCA,CADH,CALF,CA8CH,C,CAED,MAAO,MAAMmC,aAAY,CAAG5D,UAAU,CACpCY,kBADoC,CAA/B,CAIP"}
1
+ {"version":3,"file":"VerticalMenu.js","names":["cnForCssTransition","useDebounce","useMutableRef","useRefs","React","forwardRef","useCallback","useEffect","useState","CSSTransition","TransitionGroup","getItemClick","cn","withDefaultGetters","VerticalMenuLevel","cnVerticalMenu","transitionCn","VerticalMenuRender","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","header","onItemClick","getItemGroup","footer","otherProps","levels","setLevels","id","animationBack","setAnimationBack","levelRefs","length","disableAnimationBack","addLevel","level","l","newLevels","Array","from","push","removeLevel","pop","getItemSubMenuRef","getItemLabelRef","keys","split","slice","forEach","index","item","levelItems","current","levelLabel","label","map","levelNum","menuItem","VerticalMenu"],"sources":["../../../../../src/components/VerticalMenu/VerticalMenu.tsx"],"sourcesContent":["import './VerticalMenu.css';\n\nimport { cnForCssTransition } from '@consta/uikit/__internal__/src/utils/cnForCssTransition';\nimport { useDebounce } from '@consta/uikit/useDebounce';\nimport { useMutableRef } from '@consta/uikit/useMutableRef';\nimport { useRefs } from '@consta/uikit/useRefs';\nimport React, { forwardRef, useCallback, useEffect, useState } from 'react';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\n\nimport { getItemClick } from '##/helpers/getItemClick';\nimport { cn } from '##/utils/bem';\n\nimport { withDefaultGetters } from './helpers';\nimport {\n DefaultItem,\n Level,\n VerticalMenuComponent,\n VerticalMenuProps,\n} from './types';\nimport { VerticalMenuLevel } from './VerticalMenuLevel/VerticalMenuLevel';\n\nexport const cnVerticalMenu = cn('VerticalMenu');\n\nconst transitionCn = cnForCssTransition(cnVerticalMenu, 'Level');\n\nconst VerticalMenuRender = (\n props: VerticalMenuProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n header,\n onItemClick,\n getItemGroup,\n footer,\n ...otherProps\n } = withDefaultGetters(props);\n\n const [levels, setLevels] = useState<Array<Level<DefaultItem>>>([\n { items, id: '0' },\n ]);\n const [animationBack, setAnimationBack] = useState<boolean>(false);\n\n const levelRefs = useRefs<HTMLDivElement>(levels.length);\n\n const disableAnimationBack = useDebounce(() => setAnimationBack(false), 250);\n\n const addLevel = useCallback(\n (level: Level<typeof items[number]>) =>\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.push(level);\n return newLevels;\n }),\n [],\n );\n\n const removeLevel = useCallback(() => {\n setAnimationBack(true);\n setLevels((l) => {\n const newLevels = Array.from(l);\n newLevels.pop();\n return newLevels;\n });\n disableAnimationBack();\n }, []);\n\n const getItemSubMenuRef = useMutableRef(getItemSubMenu);\n const getItemLabelRef = useMutableRef(getItemLabel);\n\n useEffect(() => {\n // обновляем уровни при смене items\n const keys = levels[levels.length - 1].id.split('-').slice(1);\n\n let id = '0';\n\n const newLevels: Array<Level<DefaultItem>> = [{ items, id }];\n\n keys.forEach((index) => {\n const item = newLevels[newLevels.length - 1].items[Number(index)];\n\n if (!item) {\n return;\n }\n\n const levelItems = getItemSubMenuRef.current(item);\n const levelLabel = getItemLabelRef.current(item);\n id = `${id}-${index}`;\n\n if (!levelItems) {\n return;\n }\n\n newLevels.push({ items: levelItems, label: levelLabel, id });\n });\n\n setLevels(newLevels);\n }, [items]);\n\n return (\n <div\n {...otherProps}\n className={cnVerticalMenu({ animationBack }, [className])}\n ref={ref}\n >\n <TransitionGroup enter exit className={cnVerticalMenu('Levels')}>\n {levels.map((level, index) => {\n const levelNum = index + 1;\n if (levelNum >= levels.length) {\n return (\n <CSSTransition\n classNames={transitionCn}\n key={levelNum}\n timeout={250}\n nodeRef={levelRefs[index]}\n >\n <VerticalMenuLevel\n ref={levelRefs[index]}\n id={level.id}\n items={level.items}\n label={level.label}\n addLevel={addLevel}\n removeLevel={removeLevel}\n className={cnVerticalMenu('Level', {\n current: levelNum === levels.length,\n })}\n key={levelNum}\n header={index === 0 && header}\n footer={index === 0 && footer}\n getItemActive={getItemActive}\n getItemHref={getItemHref}\n getItemLabel={getItemLabel}\n getItemOnClick={(menuItem) =>\n getItemClick(menuItem, getItemOnClick, onItemClick)\n }\n getItemTarget={getItemTarget}\n getItemSubMenu={getItemSubMenu}\n getItemGroup={getItemGroup}\n />\n </CSSTransition>\n );\n }\n })}\n </TransitionGroup>\n </div>\n );\n};\n\nexport const VerticalMenu = forwardRef(\n VerticalMenuRender,\n) as VerticalMenuComponent;\n\nexport * from './types';\n"],"mappings":"yQAAA,2BAEA,OAASA,kBAAkB,KAAQ,yDAAyD,CAC5F,OAASC,WAAW,KAAQ,2BAA2B,CACvD,OAASC,aAAa,KAAQ,6BAA6B,CAC3D,OAASC,OAAO,KAAQ,uBAAuB,CAC/C,MAAOC,MAAK,EAAIC,UAAU,CAAEC,WAAW,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC3E,OAASC,aAAa,CAAEC,eAAe,KAAQ,wBAAwB,CAEvE,OAASC,YAAY,kCACrB,OAASC,EAAE,uBAEX,OAASC,kBAAkB,iBAO3B,OAASC,iBAAiB,6CAE1B,MAAO,MAAMC,eAAc,CAAGH,EAAE,CAAC,cAAc,CAAC,CAAC,KAE3CI,aAAY,CAAGhB,kBAAkB,CAACe,cAAc,CAAE,OAAO,CAAC,CAE1DE,kBAAkB,CAAG,CACzBC,CAAwB,CACxBC,CAA8B,GAC3B,SAeCN,kBAAkB,CAACK,CAAK,CAAC,CAdvB,CACJE,KAAK,CAALA,CAAK,CACLC,SAAS,CAATA,CAAS,CACTC,aAAa,CAAbA,CAAa,CACbC,WAAW,CAAXA,CAAW,CACXC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EvB,YAAa,CACzB,GAAG,CAAE+C,CAAS,CACd,OAAO,CAAE,GAAI,CACb,OAAO,CAAEzB,CAAS,CAACkB,CAAK,CAAE,EAE1B,oBAAC,iBAAiB,EAChB,GAAG,CAAElB,CAAS,CAACkB,CAAK,CAAE,CACtB,EAAE,CAAEd,CAAK,CAACP,EAAG,CACb,KAAK,CAAEO,CAAK,CAACtB,KAAM,CACnB,KAAK,CAAEsB,CAAK,CAACmB,KAAM,CACnB,QAAQ,CAAEpB,CAAS,CACnB,WAAW,CAAEO,CAAY,CACzB,SAAS,CAAEjC,cAAc,CAAC,OAAO,CAAE,CACjC4C,OAAO,CAAEI,CAAQ,GAAK9B,CAAM,CAACM,MAC/B,CAAC,CAAE,CACH,GAAG,CAAEwB,CAAS,CACd,MAAM,CAAY,CAAC,GAAXP,CAAW,EAAI5B,CAAO,CAC9B,MAAM,CAAY,CAAC,GAAX4B,CAAW,EAAIzB,CAAO,CAC9B,aAAa,CAAET,CAAc,CAC7B,WAAW,CAAEC,CAAY,CACzB,YAAY,CAAEC,CAAa,CAC3B,cAAc,CAAGwC,CAAQ,EACvBrD,YAAY,CAACqD,CAAQ,CAAEvC,CAAc,CAAEI,CAAW,CACnD,CACD,aAAa,CAAEH,CAAc,CAC7B,cAAc,CAAEC,CAAe,CAC/B,YAAY,CAAEG,CAAa,EAC3B,CAIV,CAAC,CAAC,CACc,CAGxB,CAAC,CAED,MAAO,MAAMmC,aAAY,CAAG5D,UAAU,CACpCY,kBAAkB,CACM,CAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerticalMenuItem.js","names":["IconArrowRight","Text","React","cn","cnVerticalMenuItem","VerticalMenuItem","props","className","label","href","target","active","onClick","withSubMenu","otherProps","propsLink","as"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.tsx"],"sourcesContent":["import './VerticalMenuItem.css';\n\nimport { IconArrowRight } from '@consta/uikit/IconArrowRight';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuItemComponent } from '../types';\n\nexport const cnVerticalMenuItem = cn('VerticalMenuItem');\n\nexport const VerticalMenuItem: VerticalMenuItemComponent = (props) => {\n const {\n className,\n label,\n href,\n target,\n active,\n onClick,\n withSubMenu,\n ...otherProps\n } = props;\n\n const propsLink = href\n ? ({\n as: 'a',\n href,\n target,\n } as const)\n : ({\n as: 'span',\n } as const);\n\n return (\n <Text\n {...otherProps}\n {...propsLink}\n className={cnVerticalMenuItem({ active }, [className])}\n onClick={onClick}\n >\n {label}\n {withSubMenu && (\n <IconArrowRight className={cnVerticalMenuItem('Icon')} size=\"xs\" />\n )}\n </Text>\n );\n};\n"],"mappings":"4KAAA,+BAEA,OAASA,cAAT,KAA+B,8BAA/B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BAIA,MAAO,MAAMC,mBAAkB,CAAGD,EAAE,CAAC,kBAAD,CAA7B,CAEP,MAAO,MAAME,iBAA2C,CAAIC,CAAD,EAAW,MAC9D,CACJC,SAAS,CAATA,CADI,CAEJC,KAAK,CAALA,CAFI,CAGJC,IAAI,CAAJA,CAHI,CAIJC,MAAM,CAANA,CAJI,CAKJC,MAAM,CAANA,CALI,CAMJC,OAAO,CAAPA,CANI,CAOJC,WAAW,CAAXA,CAPI,EASFP,CAVgE,CAS/DQ,CAT+D,0BAUhER,CAVgE,YAY9DS,CAAS,CAAGN,CAAI,CACjB,CACCO,EAAE,CAAE,GADL,CAECP,IAAI,CAAJA,CAFD,CAGCC,MAAM,CAANA,CAHD,CADiB,CAMjB,CACCM,EAAE,CAAE,MADL,CAlB+D,CAsBpE,MACE,qBAAC,IAAD,kBACMF,CADN,CAEMC,CAFN,EAGE,SAAS,CAAEX,kBAAkB,CAAC,CAAEO,MAAM,CAANA,CAAF,CAAD,CAAa,CAACJ,CAAD,CAAb,CAH/B,CAIE,OAAO,CAAEK,CAJX,GAMGJ,CANH,CAOGK,CAAW,EACV,oBAAC,cAAD,EAAgB,SAAS,CAAET,kBAAkB,CAAC,MAAD,CAA7C,CAAuD,IAAI,CAAC,IAA5D,EARJ,CAYH,CAnCM"}
1
+ {"version":3,"file":"VerticalMenuItem.js","names":["IconArrowRight","Text","React","cn","cnVerticalMenuItem","VerticalMenuItem","props","className","label","href","target","active","onClick","withSubMenu","otherProps","propsLink","as"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuItem/VerticalMenuItem.tsx"],"sourcesContent":["import './VerticalMenuItem.css';\n\nimport { IconArrowRight } from '@consta/uikit/IconArrowRight';\nimport { Text } from '@consta/uikit/Text';\nimport React from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuItemComponent } from '../types';\n\nexport const cnVerticalMenuItem = cn('VerticalMenuItem');\n\nexport const VerticalMenuItem: VerticalMenuItemComponent = (props) => {\n const {\n className,\n label,\n href,\n target,\n active,\n onClick,\n withSubMenu,\n ...otherProps\n } = props;\n\n const propsLink = href\n ? ({\n as: 'a',\n href,\n target,\n } as const)\n : ({\n as: 'span',\n } as const);\n\n return (\n <Text\n {...otherProps}\n {...propsLink}\n className={cnVerticalMenuItem({ active }, [className])}\n onClick={onClick}\n >\n {label}\n {withSubMenu && (\n <IconArrowRight className={cnVerticalMenuItem('Icon')} size=\"xs\" />\n )}\n </Text>\n );\n};\n"],"mappings":"4KAAA,+BAEA,OAASA,cAAc,KAAQ,8BAA8B,CAC7D,OAASC,IAAI,KAAQ,oBAAoB,CACzC,MAAOC,MAAK,KAAM,OAAO,CAEzB,OAASC,EAAE,0BAIX,MAAO,MAAMC,mBAAkB,CAAGD,EAAE,CAAC,kBAAkB,CAAC,CAExD,MAAO,MAAME,iBAA2C,CAAIC,CAAK,EAAK,MAC9D,CACJC,SAAS,CAATA,CAAS,CACTC,KAAK,CAALA,CAAK,CACLC,IAAI,CAAJA,CAAI,CACJC,MAAM,CAANA,CAAM,CACNC,MAAM,CAANA,CAAM,CACNC,OAAO,CAAPA,CAAO,CACPC,WAAW,CAAXA,CAEF,CAAC,CAAGP,CAAK,CADJQ,CAAU,0BACXR,CAAK,YAEHS,CAAS,CAAGN,CAAI,CACjB,CACCO,EAAE,CAAE,GAAG,CACPP,IAAI,CAAJA,CAAI,CACJC,MAAM,CAANA,CACF,CAAC,CACA,CACCM,EAAE,CAAE,MACN,CAAW,CAEf,MACE,qBAAC,IAAI,kBACCF,CAAU,CACVC,CAAS,EACb,SAAS,CAAEX,kBAAkB,CAAC,CAAEO,MAAM,CAANA,CAAO,CAAC,CAAE,CAACJ,CAAS,CAAC,CAAE,CACvD,OAAO,CAAEK,CAAQ,GAEhBJ,CAAK,CACLK,CAAW,EACV,oBAAC,cAAc,EAAC,SAAS,CAAET,kBAAkB,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,IAAI,EACjE,CAGP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerticalMenuLevel.js","names":["fabricIndex","getGroups","Button","IconArrowLeft","cnMixSpace","Text","React","forwardRef","cn","VerticalMenuItem","cnVerticalMenuLevel","VerticalMenuLevel","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","addLevel","removeLevel","label","levelLabel","header","getItemGroup","id","footer","otherProps","groups","getIndex","pV","pH","mL","map","group","groupIndex","mV","mH","item","index","levelId","subMenu","withSubMenu","length","itemClick","onClick","e"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.tsx"],"sourcesContent":["import './VerticalMenuLevel.css';\n\nimport { fabricIndex } from '@consta/uikit/__internal__/src/utils/fabricIndex';\nimport { getGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { Button } from '@consta/uikit/Button';\nimport { IconArrowLeft } from '@consta/uikit/IconArrowLeft';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React, { forwardRef } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuLevelComponent } from '../types';\nimport { VerticalMenuItem } from '../VerticalMenuItem/VerticalMenuItem';\n\nexport const cnVerticalMenuLevel = cn('VerticalMenuLevel');\n\nexport const VerticalMenuLevel: VerticalMenuLevelComponent = forwardRef(\n (props, ref) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n addLevel,\n removeLevel,\n label: levelLabel,\n header,\n getItemGroup,\n id,\n footer,\n ...otherProps\n } = props;\n\n const groups = getGroups(\n items,\n getItemGroup,\n undefined,\n undefined,\n undefined,\n );\n const getIndex = fabricIndex(-1);\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnVerticalMenuLevel(null, [className])}\n >\n {levelLabel && (\n <div\n className={cnVerticalMenuLevel('Label', [\n cnMixSpace({ pV: 's', pH: 'xl' }),\n ])}\n >\n <Button\n iconLeft={IconArrowLeft}\n view=\"clear\"\n size=\"s\"\n onClick={removeLevel}\n />\n <Text className={cnMixSpace({ mL: 's' })} truncate>\n {levelLabel}\n </Text>\n </div>\n )}\n {header && (\n <div className={cnVerticalMenuLevel('Header')}>{header}</div>\n )}\n <nav className={cnVerticalMenuLevel('Nav')}>\n {groups.map((group, groupIndex) => {\n return (\n <>\n {groupIndex ? (\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n ) : undefined}\n {group.items.map((item, index) => {\n const levelId = getIndex();\n const subMenu = getItemSubMenu(item);\n const withSubMenu = (subMenu && subMenu.length > 0) || false;\n const itemClick = getItemOnClick(item);\n const label = getItemLabel(item);\n const onClick = withSubMenu\n ? (e: React.MouseEvent<Element, MouseEvent>) => {\n itemClick?.(e);\n subMenu &&\n addLevel({\n items: subMenu,\n label,\n id: `${id}-${levelId}`,\n });\n }\n : itemClick;\n return (\n <VerticalMenuItem\n key={cnVerticalMenuLevel('Item', { groupIndex, index })}\n label={label}\n href={getItemHref(item)}\n active={getItemActive(item)}\n onClick={onClick}\n target={getItemTarget(item)}\n withSubMenu={withSubMenu}\n className={cnMixSpace({ pV: 's', pH: 'xl' })}\n />\n );\n })}\n </>\n );\n })}\n </nav>\n {footer && (\n <div className={cnVerticalMenuLevel('Footer')}>\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n {footer}\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"iSAAA,gCAEA,OAASA,WAAT,KAA4B,kDAA5B,CACA,OAASC,SAAT,KAA0B,gDAA1B,CACA,OAASC,MAAT,KAAuB,sBAAvB,CACA,OAASC,aAAT,KAA8B,6BAA9B,CACA,OAASC,UAAT,KAA2B,wBAA3B,CACA,OAASC,IAAT,KAAqB,oBAArB,CACA,MAAOC,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,EAAT,0BAGA,OAASC,gBAAT,4CAEA,MAAO,MAAMC,oBAAmB,CAAGF,EAAE,CAAC,mBAAD,CAA9B,CAEP,MAAO,MAAMG,kBAA6C,CAAGJ,UAAU,CACrE,CAACK,CAAD,CAAQC,CAAR,GAAgB,MACR,CACJC,KAAK,CAALA,CADI,CAEJC,SAAS,CAATA,CAFI,CAGJC,aAAa,CAAbA,CAHI,CAIJC,WAAW,CAAXA,CAJI,CAKJC,YAAY,CAAZA,CALI,CAMJC,cAAc,CAAdA,CANI,CAOJC,aAAa,CAAbA,CAPI,CAQJC,cAAc,CAAdA,CARI,CASJC,QAAQ,CAARA,CATI,CAUJC,WAAW,CAAXA,CAVI,CAWJC,KAAK,CAAEC,CAXH,CAYJC,MAAM,CAANA,CAZI,CAaJC,YAAY,CAAZA,CAbI,CAcJC,EAAE,CAAFA,CAdI,CAeJC,MAAM,CAANA,CAfI,EAiBFjB,CAlBU,CAiBTkB,CAjBS,0BAkBVlB,CAlBU,YAoBRmB,CAAM,CAAG9B,SAAS,CACtBa,CADsB,CAEtBa,CAFs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CAI1BC,CAAS,CAAG5B,CAAc,CAACsB,CAAD,CAJA,CAK1BjB,CAAK,CAAGN,CAAY,CAACuB,CAAD,CALM,CAM1BO,CAAO,CAAGH,CAAW,CACtBI,CAAD,EAA8C,QAC5CF,CAD4C,WAC5CA,CAD4C,QAC5CA,CAAS,CAAGE,CAAH,CADmC,CAE5CL,CAAO,EACLtB,CAAQ,CAAC,CACPR,KAAK,CAAE8B,CADA,CAEPpB,KAAK,CAALA,CAFO,CAGPI,EAAE,CAAG,GAAEA,CAAG,IAAGe,CAAQ,EAHd,CAAD,CAKX,CATsB,CAUvBI,CAhB4B,CAiBhC,MACE,qBAAC,gBAAD,EACE,GAAG,CAAErC,mBAAmB,CAAC,MAAD,CAAS,CAAE4B,UAAU,CAAVA,CAAF,CAAcI,KAAK,CAALA,CAAd,CAAT,CAD1B,CAEE,KAAK,CAAElB,CAFT,CAGE,IAAI,CAAEP,CAAW,CAACwB,CAAD,CAHnB,CAIE,MAAM,CAAEzB,CAAa,CAACyB,CAAD,CAJvB,CAKE,OAAO,CAAEO,CALX,CAME,MAAM,CAAE5B,CAAa,CAACqB,CAAD,CANvB,CAOE,WAAW,CAAEI,CAPf,CAQE,SAAS,CAAEzC,UAAU,CAAC,CAAE6B,EAAE,CAAE,GAAN,CAAWC,EAAE,CAAE,IAAf,CAAD,CARvB,EAWH,CA7BA,CARH,CAFH,CADH,CAzBF,CAsEGL,CAAM,EACL,2BAAK,SAAS,CAAEnB,mBAAmB,CAAC,QAAD,CAAnC,EACE,2BACE,SAAS,CAAEA,mBAAmB,CAAC,SAAD,CAAY,CACxCN,UAAU,CAAC,CAAEmC,EAAE,CAAE,GAAN,CAAWC,EAAE,CAAE,IAAf,CAAD,CAD8B,CAAZ,CADhC,EADF,CAMGX,CANH,CAvEJ,CAkFH,CAjHoE,CAAhE"}
1
+ {"version":3,"file":"VerticalMenuLevel.js","names":["fabricIndex","getGroups","Button","IconArrowLeft","cnMixSpace","Text","React","forwardRef","cn","VerticalMenuItem","cnVerticalMenuLevel","VerticalMenuLevel","props","ref","items","className","getItemActive","getItemHref","getItemLabel","getItemOnClick","getItemTarget","getItemSubMenu","addLevel","removeLevel","label","levelLabel","header","getItemGroup","id","footer","otherProps","groups","getIndex","pV","pH","mL","map","group","groupIndex","mV","mH","item","index","levelId","subMenu","withSubMenu","length","itemClick","onClick","e"],"sources":["../../../../../../src/components/VerticalMenu/VerticalMenuLevel/VerticalMenuLevel.tsx"],"sourcesContent":["import './VerticalMenuLevel.css';\n\nimport { fabricIndex } from '@consta/uikit/__internal__/src/utils/fabricIndex';\nimport { getGroups } from '@consta/uikit/__internal__/src/utils/getGroups';\nimport { Button } from '@consta/uikit/Button';\nimport { IconArrowLeft } from '@consta/uikit/IconArrowLeft';\nimport { cnMixSpace } from '@consta/uikit/MixSpace';\nimport { Text } from '@consta/uikit/Text';\nimport React, { forwardRef } from 'react';\n\nimport { cn } from '##/utils/bem';\n\nimport { VerticalMenuLevelComponent } from '../types';\nimport { VerticalMenuItem } from '../VerticalMenuItem/VerticalMenuItem';\n\nexport const cnVerticalMenuLevel = cn('VerticalMenuLevel');\n\nexport const VerticalMenuLevel: VerticalMenuLevelComponent = forwardRef(\n (props, ref) => {\n const {\n items,\n className,\n getItemActive,\n getItemHref,\n getItemLabel,\n getItemOnClick,\n getItemTarget,\n getItemSubMenu,\n addLevel,\n removeLevel,\n label: levelLabel,\n header,\n getItemGroup,\n id,\n footer,\n ...otherProps\n } = props;\n\n const groups = getGroups(\n items,\n getItemGroup,\n undefined,\n undefined,\n undefined,\n );\n const getIndex = fabricIndex(-1);\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnVerticalMenuLevel(null, [className])}\n >\n {levelLabel && (\n <div\n className={cnVerticalMenuLevel('Label', [\n cnMixSpace({ pV: 's', pH: 'xl' }),\n ])}\n >\n <Button\n iconLeft={IconArrowLeft}\n view=\"clear\"\n size=\"s\"\n onClick={removeLevel}\n />\n <Text className={cnMixSpace({ mL: 's' })} truncate>\n {levelLabel}\n </Text>\n </div>\n )}\n {header && (\n <div className={cnVerticalMenuLevel('Header')}>{header}</div>\n )}\n <nav className={cnVerticalMenuLevel('Nav')}>\n {groups.map((group, groupIndex) => {\n return (\n <>\n {groupIndex ? (\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n ) : undefined}\n {group.items.map((item, index) => {\n const levelId = getIndex();\n const subMenu = getItemSubMenu(item);\n const withSubMenu = (subMenu && subMenu.length > 0) || false;\n const itemClick = getItemOnClick(item);\n const label = getItemLabel(item);\n const onClick = withSubMenu\n ? (e: React.MouseEvent<Element, MouseEvent>) => {\n itemClick?.(e);\n subMenu &&\n addLevel({\n items: subMenu,\n label,\n id: `${id}-${levelId}`,\n });\n }\n : itemClick;\n return (\n <VerticalMenuItem\n key={cnVerticalMenuLevel('Item', { groupIndex, index })}\n label={label}\n href={getItemHref(item)}\n active={getItemActive(item)}\n onClick={onClick}\n target={getItemTarget(item)}\n withSubMenu={withSubMenu}\n className={cnMixSpace({ pV: 's', pH: 'xl' })}\n />\n );\n })}\n </>\n );\n })}\n </nav>\n {footer && (\n <div className={cnVerticalMenuLevel('Footer')}>\n <div\n className={cnVerticalMenuLevel('Divider', [\n cnMixSpace({ mV: 's', mH: 'xl' }),\n ])}\n />\n {footer}\n </div>\n )}\n </div>\n );\n },\n);\n"],"mappings":"iSAAA,gCAEA,OAASA,WAAW,KAAQ,kDAAkD,CAC9E,OAASC,SAAS,KAAQ,gDAAgD,CAC1E,OAASC,MAAM,KAAQ,sBAAsB,CAC7C,OAASC,aAAa,KAAQ,6BAA6B,CAC3D,OAASC,UAAU,KAAQ,wBAAwB,CACnD,OAASC,IAAI,KAAQ,oBAAoB,CACzC,MAAOC,MAAK,EAAIC,UAAU,KAAQ,OAAO,CAEzC,OAASC,EAAE,0BAGX,OAASC,gBAAgB,4CAEzB,MAAO,MAAMC,oBAAmB,CAAGF,EAAE,CAAC,mBAAmB,CAAC,C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I,CAAY,CACzB,SAAS,CAAEzC,UAAU,CAAC,CAAE6B,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,IAAK,CAAC,CAAE,EAGnD,CAAC,CAAC,CAGP,CAAC,CACE,CACLL,CAAM,EACL,2BAAK,SAAS,CAAEnB,mBAAmB,CAAC,QAAQ,CAAE,EAC5C,2BACE,SAAS,CAAEA,mBAAmB,CAAC,SAAS,CAAE,CACxCN,UAAU,CAAC,CAAEmC,EAAE,CAAE,GAAG,CAAEC,EAAE,CAAE,IAAK,CAAC,CAAC,CAClC,CAAE,EACH,CACDX,CAAM,CAEV,CAGP,CAAC,CACF"}
@@ -19,7 +19,7 @@ export declare function withDefaultGetters<ITEM>(props: VerticalMenuProps<ITEM>)
19
19
  getItemGroup?: VerticalMenuPropGetItemGroup<ITEM> | undefined;
20
20
  header?: import("react").ReactNode;
21
21
  footer?: import("react").ReactNode;
22
- } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "getItemLabel" | "footer" | "header" | "onItemClick" | "getItemHref" | "getItemTarget" | "getItemOnClick" | "getItemSubMenu" | "getItemActive" | "getItemGroup"> & (ITEM extends {
22
+ } & Omit<import("react").HTMLAttributes<HTMLDivElement>, "css" | "items" | "getItemLabel" | "footer" | "header" | "getItemOnClick" | "onItemClick" | "getItemHref" | "getItemTarget" | "getItemActive" | "getItemSubMenu" | "getItemGroup"> & (ITEM extends {
23
23
  label: string;
24
24
  } ? {} : {
25
25
  getItemLabel: VerticalMenuPropGetItemLabel<ITEM>;
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","names":["defaultGetItemLabel","item","label","defaultGetItemActive","active","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemTarget","target","defaultGetItemSubMenu","subMenu","defaultGetItemGroup","groupId","withDefaultGetters","props","getItemLabel","getItemActive","getItemHref","getItemOnClick","getItemTarget","getItemSubMenu","getItemGroup"],"sources":["../../../../../src/components/VerticalMenu/helpers.ts"],"sourcesContent":["import {\n DefaultItem,\n VerticalMenuPropGetItemActive,\n VerticalMenuPropGetItemGroup,\n VerticalMenuPropGetItemHref,\n VerticalMenuPropGetItemLabel,\n VerticalMenuPropGetItemOnClick,\n VerticalMenuPropGetItemSubMenu,\n VerticalMenuPropGetItemTarget,\n VerticalMenuProps,\n} from './types';\n\nexport const defaultGetItemLabel: VerticalMenuPropGetItemLabel<DefaultItem> = (\n item,\n) => item.label;\nexport const defaultGetItemActive: VerticalMenuPropGetItemActive<\n DefaultItem\n> = (item) => item.active;\nexport const defaultGetItemHref: VerticalMenuPropGetItemHref<DefaultItem> = (\n item,\n) => item.href;\nexport const defaultGetItemOnClick: VerticalMenuPropGetItemOnClick<\n DefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemTarget: VerticalMenuPropGetItemTarget<\n DefaultItem\n> = (item) => item.target;\nexport const defaultGetItemSubMenu: VerticalMenuPropGetItemSubMenu<\n DefaultItem\n> = (item) => item.subMenu;\nexport const defaultGetItemGroup: VerticalMenuPropGetItemGroup<DefaultItem> = (\n item,\n) => item.groupId;\n\nexport function withDefaultGetters<ITEM>(props: VerticalMenuProps<ITEM>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemActive: props.getItemActive || defaultGetItemActive,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n getItemTarget: props.getItemTarget || defaultGetItemTarget,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n getItemGroup: props.getItemGroup || defaultGetItemGroup,\n };\n}\n"],"mappings":"qqBAYA,MAAO,MAAMA,oBAA8D,CACzEC,CAD4E,EAEzEA,CAAI,CAACC,KAFH,CAGP,MAAO,MAAMC,qBAEZ,CAAIF,CAAD,EAAUA,CAAI,CAACG,MAFZ,CAGP,MAAO,MAAMC,mBAA4D,CACvEJ,CAD0E,EAEvEA,CAAI,CAACK,IAFH,CAGP,MAAO,MAAMC,sBAEZ,CAAIN,CAAD,EAAUA,CAAI,CAACO,OAFZ,CAGP,MAAO,MAAMC,qBAEZ,CAAIR,CAAD,EAAUA,CAAI,CAACS,MAFZ,CAGP,MAAO,MAAMC,sBAEZ,CAAIV,CAAD,EAAUA,CAAI,CAACW,OAFZ,CAGP,MAAO,MAAMC,oBAA8D,CACzEZ,CAD4E,EAEzEA,CAAI,CAACa,OAFH,CAIP,MAAO,SAASC,mBAAT,CAAkCC,CAAlC,CAAkE,CACvE,sCACKA,CADL,MAEEC,YAAY,CAAED,CAAK,CAACC,YAAN,EAAsBjB,mBAFtC,CAGEkB,aAAa,CAAEF,CAAK,CAACE,aAAN,EAAuBf,oBAHxC,CAIEgB,WAAW,CAAEH,CAAK,CAACG,WAAN,EAAqBd,kBAJpC,CAKEe,cAAc,CAAEJ,CAAK,CAACI,cAAN,EAAwBb,qBAL1C,CAMEc,aAAa,CAAEL,CAAK,CAACK,aAAN,EAAuBZ,oBANxC,CAOEa,cAAc,CAAEN,CAAK,CAACM,cAAN,EAAwBX,qBAP1C,CAQEY,YAAY,CAAEP,CAAK,CAACO,YAAN,EAAsBV,mBARtC,EAUD"}
1
+ {"version":3,"file":"helpers.js","names":["defaultGetItemLabel","item","label","defaultGetItemActive","active","defaultGetItemHref","href","defaultGetItemOnClick","onClick","defaultGetItemTarget","target","defaultGetItemSubMenu","subMenu","defaultGetItemGroup","groupId","withDefaultGetters","props","getItemLabel","getItemActive","getItemHref","getItemOnClick","getItemTarget","getItemSubMenu","getItemGroup"],"sources":["../../../../../src/components/VerticalMenu/helpers.ts"],"sourcesContent":["import {\n DefaultItem,\n VerticalMenuPropGetItemActive,\n VerticalMenuPropGetItemGroup,\n VerticalMenuPropGetItemHref,\n VerticalMenuPropGetItemLabel,\n VerticalMenuPropGetItemOnClick,\n VerticalMenuPropGetItemSubMenu,\n VerticalMenuPropGetItemTarget,\n VerticalMenuProps,\n} from './types';\n\nexport const defaultGetItemLabel: VerticalMenuPropGetItemLabel<DefaultItem> = (\n item,\n) => item.label;\nexport const defaultGetItemActive: VerticalMenuPropGetItemActive<\n DefaultItem\n> = (item) => item.active;\nexport const defaultGetItemHref: VerticalMenuPropGetItemHref<DefaultItem> = (\n item,\n) => item.href;\nexport const defaultGetItemOnClick: VerticalMenuPropGetItemOnClick<\n DefaultItem\n> = (item) => item.onClick;\nexport const defaultGetItemTarget: VerticalMenuPropGetItemTarget<\n DefaultItem\n> = (item) => item.target;\nexport const defaultGetItemSubMenu: VerticalMenuPropGetItemSubMenu<\n DefaultItem\n> = (item) => item.subMenu;\nexport const defaultGetItemGroup: VerticalMenuPropGetItemGroup<DefaultItem> = (\n item,\n) => item.groupId;\n\nexport function withDefaultGetters<ITEM>(props: VerticalMenuProps<ITEM>) {\n return {\n ...props,\n getItemLabel: props.getItemLabel || defaultGetItemLabel,\n getItemActive: props.getItemActive || defaultGetItemActive,\n getItemHref: props.getItemHref || defaultGetItemHref,\n getItemOnClick: props.getItemOnClick || defaultGetItemOnClick,\n getItemTarget: props.getItemTarget || defaultGetItemTarget,\n getItemSubMenu: props.getItemSubMenu || defaultGetItemSubMenu,\n getItemGroup: props.getItemGroup || defaultGetItemGroup,\n };\n}\n"],"mappings":"qqBAYA,MAAO,MAAMA,oBAA8D,CACzEC,CAAI,EACDA,CAAI,CAACC,KAAK,CACf,MAAO,MAAMC,qBAEZ,CAAIF,CAAI,EAAKA,CAAI,CAACG,MAAM,CACzB,MAAO,MAAMC,mBAA4D,CACvEJ,CAAI,EACDA,CAAI,CAACK,IAAI,CACd,MAAO,MAAMC,sBAEZ,CAAIN,CAAI,EAAKA,CAAI,CAACO,OAAO,CAC1B,MAAO,MAAMC,qBAEZ,CAAIR,CAAI,EAAKA,CAAI,CAACS,MAAM,CACzB,MAAO,MAAMC,sBAEZ,CAAIV,CAAI,EAAKA,CAAI,CAACW,OAAO,CAC1B,MAAO,MAAMC,oBAA8D,CACzEZ,CAAI,EACDA,CAAI,CAACa,OAAO,CAEjB,MAAO,SAASC,mBAAkB,CAAOC,CAA8B,CAAE,CACvE,sCACKA,CAAK,MACRC,YAAY,CAAED,CAAK,CAACC,YAAY,EAAIjB,mBAAmB,CACvDkB,aAAa,CAAEF,CAAK,CAACE,aAAa,EAAIf,oBAAoB,CAC1DgB,WAAW,CAAEH,CAAK,CAACG,WAAW,EAAId,kBAAkB,CACpDe,cAAc,CAAEJ,CAAK,CAACI,cAAc,EAAIb,qBAAqB,CAC7Dc,aAAa,CAAEL,CAAK,CAACK,aAAa,EAAIZ,oBAAoB,CAC1Da,cAAc,CAAEN,CAAK,CAACM,cAAc,EAAIX,qBAAqB,CAC7DY,YAAY,CAAEP,CAAK,CAACO,YAAY,EAAIV,mBAAmB,EAE3D"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PropsWithHTMLAttributes, PropsWithHTMLAttributesAndRef } from "../../utils/types/PropsWithHTMLAttributes";
3
- export declare type DefaultItem = {
3
+ export type DefaultItem = {
4
4
  label: string;
5
5
  href?: string;
6
6
  target?: string;
@@ -9,18 +9,18 @@ export declare type DefaultItem = {
9
9
  subMenu?: DefaultItem[];
10
10
  groupId?: string;
11
11
  };
12
- export declare type VerticalMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
13
- export declare type VerticalMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
14
- export declare type VerticalMenuPropGetItemTarget<ITEM> = (item: ITEM) => string | undefined;
15
- export declare type VerticalMenuPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;
16
- export declare type VerticalMenuPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
17
- export declare type VerticalMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
18
- export declare type VerticalMenuPropOnItemClick<ITEM> = (props: {
12
+ export type VerticalMenuPropGetItemLabel<ITEM> = (item: ITEM) => string;
13
+ export type VerticalMenuPropGetItemHref<ITEM> = (item: ITEM) => string | undefined;
14
+ export type VerticalMenuPropGetItemTarget<ITEM> = (item: ITEM) => string | undefined;
15
+ export type VerticalMenuPropGetItemActive<ITEM> = (item: ITEM) => boolean | undefined;
16
+ export type VerticalMenuPropGetItemSubMenu<ITEM> = (item: ITEM) => ITEM[] | undefined;
17
+ export type VerticalMenuPropGetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
18
+ export type VerticalMenuPropOnItemClick<ITEM> = (props: {
19
19
  e: React.MouseEvent;
20
20
  item: ITEM;
21
21
  }) => void;
22
- export declare type VerticalMenuPropGetItemGroup<ITEM> = (item: ITEM) => string | number | undefined;
23
- export declare type VerticalMenuProps<ITEM = DefaultItem> = PropsWithHTMLAttributes<{
22
+ export type VerticalMenuPropGetItemGroup<ITEM> = (item: ITEM) => string | number | undefined;
23
+ export type VerticalMenuProps<ITEM = DefaultItem> = PropsWithHTMLAttributes<{
24
24
  items: ITEM[];
25
25
  getItemHref?: VerticalMenuPropGetItemHref<ITEM>;
26
26
  getItemLabel?: VerticalMenuPropGetItemLabel<ITEM>;
@@ -37,13 +37,13 @@ export declare type VerticalMenuProps<ITEM = DefaultItem> = PropsWithHTMLAttribu
37
37
  } ? {} : {
38
38
  getItemLabel: VerticalMenuPropGetItemLabel<ITEM>;
39
39
  });
40
- export declare type VerticalMenuComponent = <ITEM = DefaultItem>(props: VerticalMenuProps<ITEM>) => React.ReactElement | null;
41
- export declare type Level<ITEM> = {
40
+ export type VerticalMenuComponent = <ITEM = DefaultItem>(props: VerticalMenuProps<ITEM>) => React.ReactElement | null;
41
+ export type Level<ITEM> = {
42
42
  items: ITEM[];
43
43
  id: string;
44
44
  label?: string;
45
45
  };
46
- export declare type VerticalMenuLevelProps<ITEM = DefaultItem> = PropsWithHTMLAttributesAndRef<{
46
+ export type VerticalMenuLevelProps<ITEM = DefaultItem> = PropsWithHTMLAttributesAndRef<{
47
47
  id: string;
48
48
  items: ITEM[];
49
49
  getItemHref: VerticalMenuPropGetItemHref<ITEM>;
@@ -59,8 +59,8 @@ export declare type VerticalMenuLevelProps<ITEM = DefaultItem> = PropsWithHTMLAt
59
59
  header?: React.ReactNode;
60
60
  footer?: React.ReactNode;
61
61
  }, HTMLDivElement>;
62
- export declare type VerticalMenuLevelComponent = <ITEM = DefaultItem>(props: VerticalMenuLevelProps<ITEM>) => React.ReactElement | null;
63
- export declare type VerticalMenuItemProps = PropsWithHTMLAttributes<{
62
+ export type VerticalMenuLevelComponent = <ITEM = DefaultItem>(props: VerticalMenuLevelProps<ITEM>) => React.ReactElement | null;
63
+ export type VerticalMenuItemProps = PropsWithHTMLAttributes<{
64
64
  label: string;
65
65
  href?: string;
66
66
  target?: string;
@@ -68,4 +68,4 @@ export declare type VerticalMenuItemProps = PropsWithHTMLAttributes<{
68
68
  onClick?: React.EventHandler<React.MouseEvent>;
69
69
  withSubMenu?: boolean;
70
70
  }, HTMLSpanElement>;
71
- export declare type VerticalMenuItemComponent = (props: VerticalMenuItemProps) => React.ReactElement | null;
71
+ export type VerticalMenuItemComponent = (props: VerticalMenuItemProps) => React.ReactElement | null;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@consta/stand").CreatedStand;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import{createStand}from"../../stand/standConfig";export default createStand({title:"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u0441\u0442\u0430\u0440\u0442",id:"start",group:"docs",order:10});
2
+ //# sourceMappingURL=start.stand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.stand.js","names":["createStand","title","id","group","order"],"sources":["../../../../../src/docs/start/start.stand.tsx"],"sourcesContent":["import { createStand } from '##/stand/standConfig';\n\nexport default createStand({\n title: 'Быстрый старт',\n id: 'start',\n group: 'docs',\n order: 10,\n});\n"],"mappings":"AAAA,OAASA,WAAW,+BAEpB,cAAeA,YAAW,CAAC,CACzBC,KAAK,CAAE,2EAAe,CACtBC,EAAE,CAAE,OAAO,CACXC,KAAK,CAAE,MAAM,CACbC,KAAK,CAAE,EACT,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare type GetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
3
- export declare type OnItemClick<ITEM> = (props: {
2
+ export type GetItemOnClick<ITEM> = (item: ITEM) => React.EventHandler<React.MouseEvent> | undefined;
3
+ export type OnItemClick<ITEM> = (props: {
4
4
  e: React.MouseEvent;
5
5
  item: ITEM;
6
6
  }) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"getItemClick.js","names":["getItemClick","item","getItemOnClick","onItemClick","e"],"sources":["../../../../src/helpers/getItemClick.ts"],"sourcesContent":["export type GetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type OnItemClick<ITEM> = (props: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport const getItemClick =\n <ITEM>(\n item: ITEM,\n getItemOnClick: GetItemOnClick<ITEM>,\n onItemClick?: OnItemClick<ITEM>,\n ): React.MouseEventHandler =>\n (e) => {\n onItemClick?.({ e, item });\n getItemOnClick(item)?.(e);\n };\n"],"mappings":"AAQA,MAAO,MAAMA,aAAY,CACvB,CACEC,CADF,CAEEC,CAFF,CAGEC,CAHF,GAKCC,CAAD,EAAO,cACLD,CADK,WACLA,CADK,QACLA,CAAW,CAAG,CAAEC,CAAC,CAADA,CAAF,CAAKH,IAAI,CAAJA,CAAL,CAAH,CADN,WAELC,CAAc,CAACD,CAAD,CAFT,qBAEL,EAAuBG,CAAvB,CACD,CATI"}
1
+ {"version":3,"file":"getItemClick.js","names":["getItemClick","item","getItemOnClick","onItemClick","e"],"sources":["../../../../src/helpers/getItemClick.ts"],"sourcesContent":["export type GetItemOnClick<ITEM> = (\n item: ITEM,\n) => React.EventHandler<React.MouseEvent> | undefined;\nexport type OnItemClick<ITEM> = (props: {\n e: React.MouseEvent;\n item: ITEM;\n}) => void;\n\nexport const getItemClick =\n <ITEM>(\n item: ITEM,\n getItemOnClick: GetItemOnClick<ITEM>,\n onItemClick?: OnItemClick<ITEM>,\n ): React.MouseEventHandler =>\n (e) => {\n onItemClick?.({ e, item });\n getItemOnClick(item)?.(e);\n };\n"],"mappings":"AAQA,MAAO,MAAMA,aAAY,CACvB,CACEC,CAAU,CACVC,CAAoC,CACpCC,CAA+B,GAEhCC,CAAC,EAAK,cACLD,CAAW,WAAXA,CAAW,QAAXA,CAAW,CAAG,CAAEC,CAAC,CAADA,CAAC,CAAEH,IAAI,CAAJA,CAAK,CAAC,CAAC,WAC1BC,CAAc,CAACD,CAAI,CAAC,qBAApB,EAAuBG,CAAC,CAC1B,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const createStand: (standProps: import("@consta/stand").Stand<string>) => import("@consta/stand").CreatedStand;
@@ -1 +1 @@
1
- {"version":3,"file":"bem.js","names":["withNaming","cn","n","e","m"],"sources":["../../../../src/utils/bem.ts"],"sourcesContent":["import { withNaming } from '@bem-react/classname';\n\nexport const cn = withNaming({ n: 'che--', e: '-', m: '_' });\n"],"mappings":"AAAA,OAASA,UAAT,KAA2B,sBAA3B,CAEA,MAAO,MAAMC,GAAE,CAAGD,UAAU,CAAC,CAAEE,CAAC,CAAE,OAAL,CAAcC,CAAC,CAAE,GAAjB,CAAsBC,CAAC,CAAE,GAAzB,CAAD,CAArB"}
1
+ {"version":3,"file":"bem.js","names":["withNaming","cn","n","e","m"],"sources":["../../../../src/utils/bem.ts"],"sourcesContent":["import { withNaming } from '@bem-react/classname';\n\nexport const cn = withNaming({ n: 'che--', e: '-', m: '_' });\n"],"mappings":"AAAA,OAASA,UAAU,KAAQ,sBAAsB,CAEjD,MAAO,MAAMC,GAAE,CAAGD,UAAU,CAAC,CAAEE,CAAC,CAAE,OAAO,CAAEC,CAAC,CAAE,GAAG,CAAEC,CAAC,CAAE,GAAI,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- export declare type PropsWithHTMLAttributes<Props, HTMLElement> = Props & Omit<React.HTMLAttributes<HTMLElement>, keyof Props | 'css'>;
3
- export declare type PropsWithHTMLAttributesAndRef<Props, HTMLElement> = PropsWithHTMLAttributes<Props, HTMLElement> & React.RefAttributes<HTMLElement>;
2
+ export type PropsWithHTMLAttributes<Props, HTMLElement> = Props & Omit<React.HTMLAttributes<HTMLElement>, keyof Props | 'css'>;
3
+ export type PropsWithHTMLAttributesAndRef<Props, HTMLElement> = PropsWithHTMLAttributes<Props, HTMLElement> & React.RefAttributes<HTMLElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/header",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "files": [
5
5
  "*",
6
6
  "!**/__mocks__",
@@ -18,6 +18,6 @@
18
18
  "access": "public"
19
19
  },
20
20
  "peerDependencies": {
21
- "@consta/uikit": "^4.0.1"
21
+ "@consta/uikit": "^4.7.1"
22
22
  }
23
23
  }