@vkontakte/vkui 7.9.2 → 7.10.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/dist/components/Footer/Footer.d.ts.map +1 -1
  2. package/dist/components/Footer/Footer.js +2 -1
  3. package/dist/components/Footer/Footer.js.map +1 -1
  4. package/dist/components/SubnavigationBar/SubnavigationBar.d.ts +6 -2
  5. package/dist/components/SubnavigationBar/SubnavigationBar.d.ts.map +1 -1
  6. package/dist/components/SubnavigationBar/SubnavigationBar.js +6 -3
  7. package/dist/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
  8. package/dist/components/Typography/Typography.d.ts +5 -1
  9. package/dist/components/Typography/Typography.d.ts.map +1 -1
  10. package/dist/components/Typography/Typography.js +9 -3
  11. package/dist/components/Typography/Typography.js.map +1 -1
  12. package/dist/components.css +1 -1
  13. package/dist/components.css.map +1 -1
  14. package/dist/cssm/components/ActionSheet/ActionSheet.module.css +4 -4
  15. package/dist/cssm/components/Alert/Alert.module.css +4 -4
  16. package/dist/cssm/components/CellButton/CellButton.module.css +4 -2
  17. package/dist/cssm/components/CustomSelectOption/CustomSelectOption.module.css +2 -2
  18. package/dist/cssm/components/DateInput/DateInput.module.css +3 -2
  19. package/dist/cssm/components/Epic/Epic.module.css +2 -1
  20. package/dist/cssm/components/FixedLayout/FixedLayout.module.css +6 -3
  21. package/dist/cssm/components/Flex/Flex.module.css +12 -4
  22. package/dist/cssm/components/Footer/Footer.js +1 -0
  23. package/dist/cssm/components/Footer/Footer.js.map +1 -1
  24. package/dist/cssm/components/Footer/Footer.module.css +0 -1
  25. package/dist/cssm/components/FormField/FormField.module.css +10 -6
  26. package/dist/cssm/components/FormItem/FormItem.module.css +24 -12
  27. package/dist/cssm/components/GridAvatar/GridAvatar.module.css +1 -1
  28. package/dist/cssm/components/Group/Group.module.css +5 -2
  29. package/dist/cssm/components/HorizontalCell/HorizontalCell.module.css +4 -2
  30. package/dist/cssm/components/HorizontalScroll/HorizontalScroll.module.css +2 -1
  31. package/dist/cssm/components/IconButton/IconButton.module.css +6 -2
  32. package/dist/cssm/components/MiniInfoCell/MiniInfoCell.module.css +4 -2
  33. package/dist/cssm/components/ModalCard/ModalCard.module.css +2 -1
  34. package/dist/cssm/components/ModalCardBase/ModalCardBase.module.css +14 -10
  35. package/dist/cssm/components/ModalPage/ModalPage.module.css +2 -1
  36. package/dist/cssm/components/ModalPageHeader/ModalPageHeader.module.css +5 -3
  37. package/dist/cssm/components/Panel/Panel.module.css +4 -2
  38. package/dist/cssm/components/PanelHeader/PanelHeader.module.css +1 -1
  39. package/dist/cssm/components/PanelHeaderButton/PanelHeaderButton.module.css +2 -2
  40. package/dist/cssm/components/PopoutWrapper/PopoutWrapper.module.css +2 -2
  41. package/dist/cssm/components/Removable/Removable.module.css +9 -4
  42. package/dist/cssm/components/Root/Root.module.css +8 -8
  43. package/dist/cssm/components/Search/Search.module.css +2 -3
  44. package/dist/cssm/components/Snackbar/Snackbar.module.css +4 -2
  45. package/dist/cssm/components/Snackbar/subcomponents/Basic/Basic.module.css +15 -15
  46. package/dist/cssm/components/SplitLayout/SplitLayout.module.css +8 -4
  47. package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js +4 -3
  48. package/dist/cssm/components/SubnavigationBar/SubnavigationBar.js.map +1 -1
  49. package/dist/cssm/components/SubnavigationBar/SubnavigationBar.module.css +9 -0
  50. package/dist/cssm/components/Switch/Switch.module.css +32 -20
  51. package/dist/cssm/components/Typography/Typography.js +7 -2
  52. package/dist/cssm/components/Typography/Typography.js.map +1 -1
  53. package/dist/cssm/components/Typography/Typography.module.css +12 -0
  54. package/dist/cssm/hooks/useAdaptivityHasPointer.js.map +1 -1
  55. package/dist/cssm/hooks/useDraggableWithDomApi/useDraggableWithDomApi.js +1 -1
  56. package/dist/cssm/hooks/useDraggableWithDomApi/useDraggableWithDomApi.js.map +1 -1
  57. package/dist/cssm/hooks/useKeyboardInputTracker.js +4 -4
  58. package/dist/cssm/hooks/useKeyboardInputTracker.js.map +1 -1
  59. package/dist/cssm/index.js +1 -0
  60. package/dist/cssm/index.js.map +1 -1
  61. package/dist/cssm/lib/adaptivity/functions.js.map +1 -1
  62. package/dist/cssm/lib/animation/useReducedMotion.js +7 -2
  63. package/dist/cssm/lib/animation/useReducedMotion.js.map +1 -1
  64. package/dist/cssm/lib/dom.js +2 -2
  65. package/dist/cssm/lib/dom.js.map +1 -1
  66. package/dist/cssm/lib/sheet/controllers/BottomSheetController.js +1 -1
  67. package/dist/cssm/lib/sheet/controllers/BottomSheetController.js.map +1 -1
  68. package/dist/cssm/styles/constants.css +2 -1
  69. package/dist/cssm/styles/customMedias.generated.css +21 -21
  70. package/dist/hooks/useAdaptivityHasPointer.js.map +1 -1
  71. package/dist/hooks/useDraggableWithDomApi/useDraggableWithDomApi.d.ts.map +1 -1
  72. package/dist/hooks/useDraggableWithDomApi/useDraggableWithDomApi.js +1 -1
  73. package/dist/hooks/useDraggableWithDomApi/useDraggableWithDomApi.js.map +1 -1
  74. package/dist/hooks/useKeyboardInputTracker.d.ts.map +1 -1
  75. package/dist/hooks/useKeyboardInputTracker.js +4 -4
  76. package/dist/hooks/useKeyboardInputTracker.js.map +1 -1
  77. package/dist/index.d.ts +1 -0
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +1 -0
  80. package/dist/index.js.map +1 -1
  81. package/dist/lib/adaptivity/functions.d.ts.map +1 -1
  82. package/dist/lib/adaptivity/functions.js.map +1 -1
  83. package/dist/lib/animation/useReducedMotion.d.ts +6 -0
  84. package/dist/lib/animation/useReducedMotion.d.ts.map +1 -1
  85. package/dist/lib/animation/useReducedMotion.js +7 -2
  86. package/dist/lib/animation/useReducedMotion.js.map +1 -1
  87. package/dist/lib/dom.d.ts.map +1 -1
  88. package/dist/lib/dom.js +2 -2
  89. package/dist/lib/dom.js.map +1 -1
  90. package/dist/lib/sheet/controllers/BottomSheetController.js +1 -1
  91. package/dist/lib/sheet/controllers/BottomSheetController.js.map +1 -1
  92. package/dist/vkui.css +1 -1
  93. package/dist/vkui.css.map +1 -1
  94. package/package.json +2 -1
  95. package/src/components/ActionSheet/ActionSheet.module.css +4 -4
  96. package/src/components/Alert/Alert.module.css +4 -4
  97. package/src/components/CellButton/CellButton.module.css +2 -1
  98. package/src/components/CellButton/CellButton.module.css.d.ts.map +1 -1
  99. package/src/components/CustomSelectOption/CustomSelectOption.module.css +1 -1
  100. package/src/components/DateInput/DateInput.module.css +3 -2
  101. package/src/components/DateInput/DateInput.module.css.d.ts.map +1 -1
  102. package/src/components/Epic/Epic.module.css +2 -1
  103. package/src/components/FixedLayout/FixedLayout.module.css +4 -2
  104. package/src/components/FixedLayout/FixedLayout.module.css.d.ts.map +1 -1
  105. package/src/components/Flex/Flex.module.css +6 -2
  106. package/src/components/Flex/Flex.module.css.d.ts.map +1 -1
  107. package/src/components/Footer/Footer.module.css +0 -1
  108. package/src/components/Footer/Footer.tsx +1 -0
  109. package/src/components/FormField/FormField.module.css +10 -6
  110. package/src/components/FormField/FormField.module.css.d.ts.map +1 -1
  111. package/src/components/FormItem/FormItem.module.css +12 -6
  112. package/src/components/FormItem/FormItem.module.css.d.ts.map +1 -1
  113. package/src/components/GridAvatar/GridAvatar.module.css +1 -1
  114. package/src/components/GridAvatar/GridAvatar.module.css.d.ts.map +1 -1
  115. package/src/components/Group/Group.module.css +5 -2
  116. package/src/components/Group/Group.module.css.d.ts.map +1 -1
  117. package/src/components/HorizontalCell/HorizontalCell.module.css +4 -2
  118. package/src/components/HorizontalCell/HorizontalCell.module.css.d.ts.map +1 -1
  119. package/src/components/HorizontalScroll/HorizontalScroll.module.css +2 -1
  120. package/src/components/HorizontalScroll/HorizontalScroll.module.css.d.ts.map +1 -1
  121. package/src/components/IconButton/IconButton.module.css +6 -2
  122. package/src/components/IconButton/IconButton.module.css.d.ts.map +1 -1
  123. package/src/components/MiniInfoCell/MiniInfoCell.module.css +4 -2
  124. package/src/components/MiniInfoCell/MiniInfoCell.module.css.d.ts.map +1 -1
  125. package/src/components/ModalCard/ModalCard.module.css +2 -1
  126. package/src/components/ModalCard/ModalCard.module.css.d.ts.map +1 -1
  127. package/src/components/ModalCardBase/ModalCardBase.module.css +7 -5
  128. package/src/components/ModalCardBase/ModalCardBase.module.css.d.ts.map +1 -1
  129. package/src/components/ModalPage/ModalPage.module.css +2 -1
  130. package/src/components/ModalPage/ModalPage.module.css.d.ts.map +1 -1
  131. package/src/components/ModalPageHeader/ModalPageHeader.module.css +5 -2
  132. package/src/components/ModalPageHeader/ModalPageHeader.module.css.d.ts.map +1 -1
  133. package/src/components/Panel/Panel.module.css +2 -1
  134. package/src/components/Panel/Panel.module.css.d.ts.map +1 -1
  135. package/src/components/PanelHeader/PanelHeader.module.css +1 -1
  136. package/src/components/PanelHeader/PanelHeader.module.css.d.ts.map +1 -1
  137. package/src/components/PanelHeaderButton/PanelHeaderButton.module.css +2 -2
  138. package/src/components/PopoutWrapper/PopoutWrapper.module.css +2 -2
  139. package/src/components/Removable/Removable.module.css +9 -4
  140. package/src/components/Removable/Removable.module.css.d.ts.map +1 -1
  141. package/src/components/Root/Root.module.css +8 -8
  142. package/src/components/Search/Search.module.css +2 -2
  143. package/src/components/Snackbar/Snackbar.module.css +4 -2
  144. package/src/components/Snackbar/Snackbar.module.css.d.ts.map +1 -1
  145. package/src/components/Snackbar/subcomponents/Basic/Basic.module.css +15 -15
  146. package/src/components/SplitLayout/SplitLayout.module.css +4 -2
  147. package/src/components/SplitLayout/SplitLayout.module.css.d.ts.map +1 -1
  148. package/src/components/SubnavigationBar/SubnavigationBar.module.css +9 -0
  149. package/src/components/SubnavigationBar/SubnavigationBar.module.css.d.ts.map +1 -1
  150. package/src/components/SubnavigationBar/SubnavigationBar.tsx +14 -3
  151. package/src/components/Switch/Switch.module.css +32 -20
  152. package/src/components/Switch/Switch.module.css.d.ts.map +1 -1
  153. package/src/components/Typography/Typography.module.css +12 -0
  154. package/src/components/Typography/Typography.module.css.d.ts.map +1 -1
  155. package/src/components/Typography/Typography.tsx +12 -0
  156. package/src/hooks/useAdaptivityHasPointer.ts +1 -1
  157. package/src/hooks/useDraggableWithDomApi/useDraggableWithDomApi.ts +7 -1
  158. package/src/hooks/useKeyboardInputTracker.ts +20 -4
  159. package/src/index.ts +1 -0
  160. package/src/lib/adaptivity/functions.ts +36 -6
  161. package/src/lib/animation/useReducedMotion.ts +7 -1
  162. package/src/lib/dom.tsx +11 -2
  163. package/src/lib/sheet/controllers/BottomSheetController.ts +1 -1
  164. package/src/styles/constants.css +2 -1
  165. package/src/styles/customMedias.generated.css +21 -21
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import './styles/constants.css';\nimport './styles/adaptivity.module.css';\nimport './styles/dynamicTokens.css';\nimport './styles/focusVisible.module.css';\nimport './styles/animationFades.module.css';\nimport './styles/transformOriginByPlacement.module.css';\nimport './styles/gaps.module.css';\nimport './styles/layout.css';\n\nexport { AppRoot } from './components/AppRoot/AppRoot';\nexport { AppRootPortal } from './components/AppRoot/AppRootPortal';\nexport type { AppRootProps } from './components/AppRoot/AppRoot';\nexport type { SafeAreaInsets } from './components/AppRoot/types';\n\n/**\n * Typography\n */\nexport type { TypographyProps } from './components/Typography/Typography';\nexport { DisplayTitle } from './components/Typography/DisplayTitle/DisplayTitle';\nexport type { DisplayTitleProps } from './components/Typography/DisplayTitle/DisplayTitle';\nexport { Title } from './components/Typography/Title/Title';\nexport type { TitleProps } from './components/Typography/Title/Title';\nexport { Headline } from './components/Typography/Headline/Headline';\nexport type { HeadlineProps } from './components/Typography/Headline/Headline';\nexport { Text } from './components/Typography/Text/Text';\nexport type { TextProps } from './components/Typography/Text/Text';\nexport { Paragraph } from './components/Typography/Paragraph/Paragraph';\nexport type { ParagraphProps } from './components/Typography/Paragraph/Paragraph';\nexport { Subhead } from './components/Typography/Subhead/Subhead';\nexport type { SubheadProps } from './components/Typography/Subhead/Subhead';\nexport { Footnote } from './components/Typography/Footnote/Footnote';\nexport type { FootnoteProps } from './components/Typography/Footnote/Footnote';\nexport { Caption } from './components/Typography/Caption/Caption';\nexport type { CaptionProps } from './components/Typography/Caption/Caption';\nexport { EllipsisText } from './components/Typography/EllipsisText/EllipsisText';\nexport type { EllipsisTextProps } from './components/Typography/EllipsisText/EllipsisText';\n/**\n * Service\n */\nexport { UnstyledTextField } from './components/UnstyledTextField/UnstyledTextField';\nexport type {\n UnstyledTextFieldAsInputProps,\n UnstyledTextFieldAsTextareaProps,\n UnstyledTextFieldBaseProps,\n UnstyledTextFieldProps,\n} from './components/UnstyledTextField/UnstyledTextField';\nexport { Tappable } from './components/Tappable/Tappable';\nexport type { TappableProps } from './components/Tappable/Tappable';\nexport { FixedLayout } from './components/FixedLayout/FixedLayout';\nexport type { FixedLayoutProps } from './components/FixedLayout/FixedLayout';\nexport {\n ImageBaseContext,\n ImageBase,\n getBadgeIconSizeByImageBaseSize,\n getFallbackIconSizeByImageBaseSize,\n getOverlayIconSizeByImageBaseSize,\n} from './components/ImageBase/ImageBase';\nexport type {\n ImageBaseProps,\n ImageBaseSize,\n ImageBaseExpectedIconProps,\n ImageBaseBadgeProps,\n ImageBaseOverlayProps,\n ImageBaseFloatElementProps,\n FloatElementPlacement,\n FloatElementIndentation,\n} from './components/ImageBase/ImageBase';\n\n/**\n * Primitives\n */\nexport { Button } from './components/Button/Button';\nexport type { ButtonProps } from './components/Button/Button';\nexport { IconButton } from './components/IconButton/IconButton';\nexport type { IconButtonProps } from './components/IconButton/IconButton';\nexport { ToolButton } from './components/ToolButton/ToolButton';\nexport type { ToolButtonProps } from './components/ToolButton/ToolButton';\n\n/**\n * Layout\n */\nexport { Root } from './components/Root/Root';\nexport type { RootProps } from './components/Root/Root';\nexport { View } from './components/View/View';\nexport type { ViewProps } from './components/View/View';\nexport { Panel } from './components/Panel/Panel';\nexport type { PanelProps } from './components/Panel/Panel';\nexport { PanelHeaderButton } from './components/PanelHeaderButton/PanelHeaderButton';\nexport type { PanelHeaderButtonProps } from './components/PanelHeaderButton/PanelHeaderButton';\nexport { PanelHeader } from './components/PanelHeader/PanelHeader';\nexport type { PanelHeaderProps } from './components/PanelHeader/PanelHeader';\nexport { PanelHeaderContent } from './components/PanelHeaderContent/PanelHeaderContent';\nexport type { PanelHeaderContentProps } from './components/PanelHeaderContent/PanelHeaderContent';\nexport { PanelHeaderContext } from './components/PanelHeaderContext/PanelHeaderContext';\nexport type { PanelHeaderContextProps } from './components/PanelHeaderContext/PanelHeaderContext';\nexport { SplitLayout } from './components/SplitLayout/SplitLayout';\nexport type { SplitLayoutProps } from './components/SplitLayout/SplitLayout';\nexport { SplitCol } from './components/SplitCol/SplitCol';\nexport type { SplitColProps } from './components/SplitCol/SplitCol';\nexport { Epic } from './components/Epic/Epic';\nexport type { EpicProps } from './components/Epic/Epic';\nexport { Tabbar } from './components/Tabbar/Tabbar';\nexport type { TabbarProps } from './components/Tabbar/Tabbar';\nexport { TabbarItem } from './components/TabbarItem/TabbarItem';\nexport type { TabbarItemProps } from './components/TabbarItem/TabbarItem';\nexport { ScrollArrow } from './components/ScrollArrow/ScrollArrow';\nexport type { ScrollArrowProps } from './components/ScrollArrow/ScrollArrow';\nexport { HorizontalScroll } from './components/HorizontalScroll/HorizontalScroll';\nexport type { HorizontalScrollProps } from './components/HorizontalScroll/HorizontalScroll';\nexport { AspectRatio } from './components/AspectRatio/AspectRatio';\nexport type { AspectRatioProps } from './components/AspectRatio/AspectRatio';\nexport { Flex } from './components/Flex/Flex';\nexport type { FlexProps } from './components/Flex/Flex';\nexport type { FlexItemProps } from './components/Flex/FlexItem/FlexItem';\nexport { SimpleGrid } from './components/SimpleGrid/SimpleGrid';\nexport type { SimpleGridProps } from './components/SimpleGrid/SimpleGrid';\n\n/**\n * Popouts\n */\nexport { PopoutWrapper } from './components/PopoutWrapper/PopoutWrapper';\nexport type { PopoutWrapperProps } from './components/PopoutWrapper/PopoutWrapper';\nexport { Alert } from './components/Alert/Alert';\nexport type { AlertProps, AlertActionProps, AlertActionInterface } from './components/Alert/Alert';\nexport { ActionSheet } from './components/ActionSheet/ActionSheet';\nexport type {\n ActionSheetProps,\n ActionSheetOnCloseOptions,\n} from './components/ActionSheet/ActionSheet';\nexport { ActionSheetItem } from './components/ActionSheetItem/ActionSheetItem';\nexport type { ActionSheetItemProps } from './components/ActionSheetItem/ActionSheetItem';\nexport { ActionSheetDefaultIosCloseItem } from './components/ActionSheet/ActionSheetDefaultIosCloseItem';\nexport { ScreenSpinner } from './components/ScreenSpinner/ScreenSpinner';\nexport { ScreenSpinnerContext } from './components/ScreenSpinner/context';\nexport type { ScreenSpinnerProps } from './components/ScreenSpinner/ScreenSpinner';\nexport type { ScreenSpinnerContextProps } from './components/ScreenSpinner/context';\nexport { Snackbar } from './components/Snackbar/Snackbar';\nexport type { SnackbarProps } from './components/Snackbar/Snackbar';\nexport { Tooltip } from './components/Tooltip/Tooltip';\nexport { useTooltip } from './components/Tooltip/useTooltip';\nexport type {\n TooltipProps,\n TooltipOnShownChange,\n TooltipArrowProps,\n} from './components/Tooltip/Tooltip';\n\n/**\n * Modals\n */\nexport { ModalRoot } from './components/ModalRoot/ModalRoot';\nexport type {\n ModalRootProps,\n ModalRootContextInterface,\n UseModalRootContext,\n} from './components/ModalRoot/types';\nexport { withModalRootContext } from './components/ModalRoot/withModalRootContext';\nexport { ModalRootContext } from './components/ModalRoot/ModalRootContext';\nexport { useModalRootContext } from './components/ModalRoot/useModalRootContext';\nexport { ModalPageContent } from './components/ModalPageContent/ModalPageContent';\nexport { ModalPage } from './components/ModalPage/ModalPage';\nexport type { ModalPageProps, ModalPageCloseReason } from './components/ModalPage/types';\nexport { ModalPageHeader } from './components/ModalPageHeader/ModalPageHeader';\nexport type { ModalPageHeaderProps } from './components/ModalPageHeader/ModalPageHeader';\nexport { ModalCard } from './components/ModalCard/ModalCard';\nexport type { ModalCardProps, ModalCardCloseReason } from './components/ModalCard/types';\nexport { ModalDismissButton } from './components/ModalDismissButton/ModalDismissButton';\nexport type { ModalDismissButtonProps } from './components/ModalDismissButton/ModalDismissButton';\nexport { ModalOutsideButton } from './components/ModalOutsideButton/ModalOutsideButton';\nexport type { ModalOutsideButtonProps } from './components/ModalOutsideButton/ModalOutsideButton';\n\n/**\n * Blocks\n */\nexport { Badge } from './components/Badge/Badge';\nexport type { BadgeProps } from './components/Badge/Badge';\nexport { ContentBadge } from './components/ContentBadge/ContentBadge';\nexport type { ContentBadgeProps } from './components/ContentBadge/ContentBadge';\nexport { ButtonGroup } from './components/ButtonGroup/ButtonGroup';\nexport type { ButtonGroupProps } from './components/ButtonGroup/ButtonGroup';\nexport { Card } from './components/Card/Card';\nexport type { CardProps } from './components/Card/Card';\nexport { CardGrid } from './components/CardGrid/CardGrid';\nexport type { CardGridProps } from './components/CardGrid/CardGrid';\nexport { CardScroll } from './components/CardScroll/CardScroll';\nexport type { CardScrollProps } from './components/CardScroll/CardScroll';\nexport { ContentCard } from './components/ContentCard/ContentCard';\nexport type { ContentCardProps } from './components/ContentCard/ContentCard';\nexport { Header } from './components/Header/Header';\nexport type { HeaderProps } from './components/Header/Header';\nexport { Group } from './components/Group/Group';\nexport type { GroupProps } from './components/Group/Group';\nexport { Gradient } from './components/Gradient/Gradient';\nexport type { GradientProps } from './components/Gradient/Gradient';\nexport { List } from './components/List/List';\nexport type { ListProps } from './components/List/List';\nexport { Cell } from './components/Cell/Cell';\nexport type { CellProps } from './components/Cell/Cell';\nexport type { CellCheckboxProps } from './components/Cell/CellCheckbox/CellCheckbox';\nexport { RichCell } from './components/RichCell/RichCell';\nexport type { RichCellProps } from './components/RichCell/RichCell';\nexport { SimpleCell } from './components/SimpleCell/SimpleCell';\nexport type { SimpleCellProps } from './components/SimpleCell/SimpleCell';\nexport { CellButton } from './components/CellButton/CellButton';\nexport type { CellButtonProps } from './components/CellButton/CellButton';\nexport { CellButtonGroup } from './components/CellButtonGroup/CellButtonGroup';\nexport type { CellButtonGroupProps } from './components/CellButtonGroup/CellButtonGroup';\nexport { HorizontalCell } from './components/HorizontalCell/HorizontalCell';\nexport type { HorizontalCellProps } from './components/HorizontalCell/HorizontalCell';\nexport { HorizontalCellShowMore } from './components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore';\nexport type { HorizontalCellShowMoreProps } from './components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore';\nexport { Footer } from './components/Footer/Footer';\nexport type { FooterProps } from './components/Footer/Footer';\nexport { InfoRow } from './components/InfoRow/InfoRow';\nexport type { InfoRowProps } from './components/InfoRow/InfoRow';\nexport { Gallery } from './components/Gallery/Gallery';\nexport type { GalleryProps } from './components/Gallery/Gallery';\nexport { Avatar } from './components/Avatar/Avatar';\nexport type { GetInitialsFontSizeType } from './components/Avatar/helpers';\nexport type {\n AvatarProps,\n AvatarBadgeProps,\n AvatarBadgeWithPresetProps,\n AvatarOverlayProps,\n} from './components/Avatar/Avatar';\nexport { GridAvatar } from './components/GridAvatar/GridAvatar';\nexport type { GridAvatarProps, GridAvatarBadgeProps } from './components/GridAvatar/GridAvatar';\nexport { Image } from './components/Image/Image';\nexport type { ImageProps, ImageBadgeProps, ImageOverlayProps } from './components/Image/Image';\nexport { Progress } from './components/Progress/Progress';\nexport type { ProgressProps } from './components/Progress/Progress';\nexport { Search } from './components/Search/Search';\nexport type { SearchProps, RenderIconButtonFn } from './components/Search/Search';\nexport { Tabs } from './components/Tabs/Tabs';\nexport type { TabsProps } from './components/Tabs/Tabs';\nexport { TabsItem } from './components/TabsItem/TabsItem';\nexport type { TabsItemProps } from './components/TabsItem/TabsItem';\nexport { Spinner } from './components/Spinner/Spinner';\nexport type { SpinnerProps } from './components/Spinner/Spinner';\nexport { PullToRefresh } from './components/PullToRefresh/PullToRefresh';\nexport type { PullToRefreshProps } from './components/PullToRefresh/PullToRefresh';\nexport { Link } from './components/Link/Link';\nexport type { LinkProps } from './components/Link/Link';\nexport { Mark } from './components/Mark/Mark';\nexport type { MarkProps } from './components/Mark/Mark';\nexport { OnboardingTooltip } from './components/OnboardingTooltip/OnboardingTooltip';\nexport type { OnboardingTooltipProps } from './components/OnboardingTooltip/OnboardingTooltip';\nexport { OnboardingTooltipContainer } from './components/OnboardingTooltip/OnboardingTooltipContainer';\nexport { Counter } from './components/Counter/Counter';\nexport type { CounterProps } from './components/Counter/Counter';\nexport { UsersStack } from './components/UsersStack/UsersStack';\nexport type {\n UsersStackProps,\n UsersStackPhoto,\n UsersStackRenderWrapperProps,\n} from './components/UsersStack/UsersStack';\nexport { Separator } from './components/Separator/Separator';\nexport type { SeparatorProps } from './components/Separator/Separator';\nexport { Spacing } from './components/Spacing/Spacing';\nexport type { SpacingProps } from './components/Spacing/Spacing';\nexport { Box } from './components/Box/Box';\nexport type { BoxProps } from './components/Box/Box';\nexport { Placeholder } from './components/Placeholder/Placeholder';\nexport type {\n PlaceholderProps,\n PlaceholderContainerProps,\n PlaceholderIconProps,\n PlaceholderTitleProps,\n PlaceholderDescriptionProps,\n PlaceholderActionsProps,\n} from './components/Placeholder/Placeholder';\nexport { Banner } from './components/Banner/Banner';\nexport type { BannerProps } from './components/Banner/Banner';\nexport { MiniInfoCell } from './components/MiniInfoCell/MiniInfoCell';\nexport type { MiniInfoCellProps } from './components/MiniInfoCell/MiniInfoCell';\nexport { WriteBar } from './components/WriteBar/WriteBar';\nexport type { WriteBarProps } from './components/WriteBar/WriteBar';\nexport { WriteBarIcon } from './components/WriteBarIcon/WriteBarIcon';\nexport type { WriteBarIconProps } from './components/WriteBarIcon/WriteBarIcon';\nexport { SubnavigationBar } from './components/SubnavigationBar/SubnavigationBar';\nexport type { SubnavigationBarProps } from './components/SubnavigationBar/SubnavigationBar';\nexport { SubnavigationButton } from './components/SubnavigationButton/SubnavigationButton';\nexport type { SubnavigationButtonProps } from './components/SubnavigationButton/SubnavigationButton';\nexport { Pagination } from './components/Pagination/Pagination';\nexport type { PaginationProps } from './components/Pagination/Pagination';\nexport type { CustomPaginationPageButtonProps } from './components/Pagination/PaginationPage/PaginationPageButton';\nexport type { CustomPaginationNavigationButton } from './components/Pagination/PaginationNavigationButton/PaginationNavigationButton';\nexport { Accordion } from './components/Accordion/Accordion';\nexport type { AccordionProps } from './components/Accordion/Accordion';\nexport { AccordionContext, useAccordionContext } from './components/Accordion/AccordionContext';\nexport type { AccordionSummaryProps } from './components/Accordion/AccordionSummary';\nexport type { AccordionContentProps } from './components/Accordion/AccordionContent';\n\n/**\n * Forms\n */\nexport { FormItem } from './components/FormItem/FormItem';\nexport type { FormItemTopProps } from './components/FormItem/FormItemTop/FormItemTop';\nexport type { FormItemTopLabelProps } from './components/FormItem/FormItemTop/FormItemTopLabel';\nexport type { FormItemTopAsideProps } from './components/FormItem/FormItemTop/FormItemTopAside';\nexport type { FormItemProps } from './components/FormItem/FormItem';\nexport { FormField } from './components/FormField/FormField';\nexport type { FormFieldProps, FieldIconsAlign } from './components/FormField/FormField';\nexport { FormLayoutGroup } from './components/FormLayoutGroup/FormLayoutGroup';\nexport type { FormLayoutGroupProps } from './components/FormLayoutGroup/FormLayoutGroup';\nexport { FormStatus } from './components/FormStatus/FormStatus';\nexport type { FormStatusProps } from './components/FormStatus/FormStatus';\nexport { Switch } from './components/Switch/Switch';\nexport type { SwitchProps } from './components/Switch/Switch';\nexport { File } from './components/File/File';\nexport type { FileProps } from './components/File/File';\nexport { DropZone } from './components/DropZone/DropZone';\nexport type { DropZoneProps } from './components/DropZone/DropZone';\nexport { Input } from './components/Input/Input';\nexport type { InputProps } from './components/Input/Input';\nexport type { ChipProps } from './components/ChipsInputBase/Chip/Chip';\nexport { Chip } from './components/ChipsInputBase/Chip/Chip';\nexport type {\n ChipOption,\n RenderChipProps,\n ChipOptionValue,\n ChipOptionLabel,\n} from './components/ChipsInputBase/types';\nexport { ChipsInput } from './components/ChipsInput/ChipsInput';\nexport type { ChipsInputProps } from './components/ChipsInput/ChipsInput';\nexport { ChipsSelect } from './components/ChipsSelect/ChipsSelect';\nexport type { ChipsSelectProps } from './components/ChipsSelect/ChipsSelect';\nexport type { FormFieldClearButtonProps } from './components/FormFieldClearButton/FormFieldClearButton';\nexport { Slider } from './components/Slider/Slider';\nexport type { SliderBaseProps, SliderProps, SliderMultipleProps } from './components/Slider/Slider';\nexport { Textarea } from './components/Textarea/Textarea';\nexport type { TextareaProps } from './components/Textarea/Textarea';\nexport { SelectionControl } from './components/SelectionControl/SelectionControl';\nexport type { SelectionControlProps } from './components/SelectionControl/SelectionControl';\nexport { Radio } from './components/Radio/Radio';\nexport type { RadioProps } from './components/Radio/Radio';\nexport { RadioGroup } from './components/RadioGroup/RadioGroup';\nexport type { RadioGroupProps } from './components/RadioGroup/RadioGroup';\nexport { Checkbox } from './components/Checkbox/Checkbox';\nexport type { CheckboxProps } from './components/Checkbox/Checkbox';\nexport type { CheckboxInputIconType } from './components/Checkbox/CheckboxInput/CheckboxInput';\nexport { Select } from './components/Select/Select';\nexport { SelectMimicry } from './components/SelectMimicry/SelectMimicry';\nexport type { SelectMimicryProps } from './components/SelectMimicry/SelectMimicry';\nexport { NativeSelect } from './components/NativeSelect/NativeSelect';\nexport type { NativeSelectProps } from './components/NativeSelect/NativeSelect';\nexport { CustomSelect } from './components/CustomSelect/CustomSelect';\nexport type {\n SelectProps,\n CustomSelectClearButtonProps,\n} from './components/CustomSelect/CustomSelect';\nexport type {\n CustomSelectOptionInterface,\n CustomSelectRenderOption,\n} from './components/CustomSelect/types';\nexport { CustomSelectOption } from './components/CustomSelectOption/CustomSelectOption';\nexport type { CustomSelectOptionProps } from './components/CustomSelectOption/CustomSelectOption';\nexport { SegmentedControl } from './components/SegmentedControl/SegmentedControl';\nexport type {\n SegmentedControlProps,\n SegmentedControlOptionInterface,\n SegmentedControlValue,\n} from './components/SegmentedControl/SegmentedControl';\nexport { Calendar } from './components/Calendar/Calendar';\nexport type { CalendarProps } from './components/Calendar/Calendar';\nexport { CalendarRange } from './components/CalendarRange/CalendarRange';\nexport type { CalendarRangeProps } from './components/CalendarRange/CalendarRange';\nexport { DateInput } from './components/DateInput/DateInput';\nexport type { DateInputProps } from './components/DateInput/DateInput';\nexport { DateRangeInput } from './components/DateRangeInput/DateRangeInput';\nexport type { DateRangeInputProps } from './components/DateRangeInput/DateRangeInput';\nexport { Skeleton } from './components/Skeleton/Skeleton';\nexport type { SkeletonProps } from './components/Skeleton/Skeleton';\n\n/**\n * Helpers\n */\nexport { Div } from './components/Div/Div';\nexport type { DivProps } from './components/Div/Div';\nexport {\n DEFAULT_ARROW_HEIGHT as DEFAULT_ICON_ARROW_HEIGHT,\n DEFAULT_ARROW_WIDTH as DEFAULT_ICON_ARROW_WIDTH,\n DEFAULT_ARROW_PADDING as DEFAULT_ICON_ARROW_PADDING,\n DefaultIcon,\n} from './components/FloatingArrow/DefaultIcon';\nexport { FloatingArrow } from './components/FloatingArrow/FloatingArrow';\nexport type { FloatingArrowProps } from './components/FloatingArrow/FloatingArrow';\nexport { Touch } from './components/Touch/Touch';\nexport type { TouchProps, CustomTouchEvent } from './components/Touch/Touch';\nexport { PanelSpinner } from './components/PanelSpinner/PanelSpinner';\nexport type { PanelSpinnerProps } from './components/PanelSpinner/PanelSpinner';\nexport { PanelHeaderClose } from './components/PanelHeaderClose/PanelHeaderClose';\nexport type { PanelHeaderCloseProps } from './components/PanelHeaderClose/PanelHeaderClose';\nexport { PanelHeaderBack } from './components/PanelHeaderBack/PanelHeaderBack';\nexport type { PanelHeaderBackProps } from './components/PanelHeaderBack/PanelHeaderBack';\nexport { PanelHeaderSubmit } from './components/PanelHeaderSubmit/PanelHeaderSubmit';\nexport type { PanelHeaderSubmitProps } from './components/PanelHeaderSubmit/PanelHeaderSubmit';\nexport { PanelHeaderEdit } from './components/PanelHeaderEdit/PanelHeaderEdit';\nexport type { PanelHeaderEditProps } from './components/PanelHeaderEdit/PanelHeaderEdit';\nexport { ModalCardBase } from './components/ModalCardBase/ModalCardBase';\nexport type { ModalCardBaseProps } from './components/ModalCardBase/ModalCardBase';\nexport { VisuallyHidden } from './components/VisuallyHidden/VisuallyHidden';\nexport type { VisuallyHiddenProps } from './components/VisuallyHidden/VisuallyHidden';\nexport { AdaptiveIconRenderer } from './components/AdaptiveIconRenderer/AdaptiveIconRenderer';\nexport type { AdaptiveIconRendererProps } from './components/AdaptiveIconRenderer/AdaptiveIconRenderer';\n\n/**\n * Wrappers\n */\nexport { AdaptivityProvider } from './components/AdaptivityProvider/AdaptivityProvider';\nexport type { AdaptivityProviderProps } from './components/AdaptivityProvider/AdaptivityProvider';\nexport { ConfigProvider } from './components/ConfigProvider/ConfigProvider';\nexport type { ConfigProviderProps } from './components/ConfigProvider/ConfigProvider';\nexport {\n useConfigProvider,\n ConfigProviderContext,\n} from './components/ConfigProvider/ConfigProviderContext';\nexport { ColorSchemeProvider } from './components/ColorSchemeProvider/ColorSchemeProvider';\nexport type { ColorSchemeProviderProps } from './components/ColorSchemeProvider/ColorSchemeProvider';\nexport { ColorScheme } from './lib/colorScheme';\nexport type { ColorSchemeType } from './lib/colorScheme';\nexport { DOMContext } from './lib/dom';\nexport { LocaleProvider } from './components/LocaleProvider/LocaleProvider';\nexport { DirectionProvider } from './components/DirectionProvider/DirectionProvider';\nexport type { LocaleProviderProps } from './components/LocaleProvider/LocaleProvider';\nexport type { DirectionProviderProps } from './components/DirectionProvider/DirectionProvider';\nexport { PlatformProvider } from './components/PlatformProvider/PlatformProvider';\nexport type { PlatformProviderProps } from './components/PlatformProvider/PlatformProvider';\nexport { Popover } from './components/Popover/Popover';\nexport type {\n PopoverProps,\n PopoverOnShownChange,\n PopoverArrowProps,\n PopoverContentRenderProp,\n} from './components/Popover/Popover';\nexport { usePopover } from './components/Popover/usePopover';\n\n/**\n * HOCs\n */\nexport { withPlatform } from './hoc/withPlatform';\n\n/**\n * Hooks\n */\nexport { usePlatform } from './hooks/usePlatform';\nexport { useConfigDirection as useDirection } from './hooks/useConfigDirection';\nexport { useLocale } from './hooks/useLocale';\nexport { useAdaptivity } from './hooks/useAdaptivity';\nexport {\n type UseAdaptivityConditionalRender,\n useAdaptivityConditionalRender,\n} from './hooks/useAdaptivityConditionalRender';\nexport {\n type UseAdaptivityWithJSMediaQueries,\n useAdaptivityWithJSMediaQueries,\n} from './hooks/useAdaptivityWithJSMediaQueries';\nexport { useColorScheme } from './hooks/useColorScheme';\nexport { usePagination } from './hooks/usePagination';\nexport { type Orientation, useOrientationChange } from './hooks/useOrientationChange';\nexport { usePatchChildren } from './hooks/usePatchChildren';\nexport { useTodayDate } from './hooks/useTodayDate';\nexport { useScrollLock, useManualScroll as useScroll } from './components/AppRoot/ScrollContext';\nexport { useNavTransition } from './components/NavTransitionContext/NavTransitionContext';\nexport { useNavDirection } from './components/NavTransitionDirectionContext/NavTransitionDirectionContext';\nexport { useNavId } from './components/NavIdContext/useNavId';\nexport type { TransitionDirection } from './components/NavTransitionDirectionContext/NavTransitionDirectionContext';\nexport { useCSSKeyframesAnimationController as unstable_useCSSKeyframesAnimationController } from './lib/animation';\nexport { useFocusVisible } from './hooks/useFocusVisible';\n\n/**\n * Utils\n */\nexport { classNames } from '@vkontakte/vkjs';\nexport { animate } from './lib/animate';\nexport { defaultFilterFn as filterFnForSelect } from './lib/select';\nexport { removeObjectKeys } from './lib/removeObjectKeys';\nexport { SSRWrapper } from './lib/SSR';\nexport type { SSRWrapperProps } from './lib/SSR';\nexport { platform, Platform } from './lib/platform';\nexport {\n ViewWidth,\n ViewHeight,\n SizeType,\n getViewWidthByViewportWidth,\n getViewHeightByViewportHeight,\n} from './lib/adaptivity';\nexport {\n type Placement as FloatingPlacement,\n type PlacementWithAuto as FloatingPlacementWithAuto,\n} from './lib/floating';\nexport type { AdaptivityProps } from './components/AdaptivityProvider/AdaptivityContext';\nexport { calcInitialsAvatarColor } from './helpers/avatar';\nexport { CustomScrollView } from './components/CustomScrollView/CustomScrollView';\nexport type { CustomScrollViewProps } from './components/CustomScrollView/CustomScrollView';\nexport { Popper } from './components/Popper/Popper';\nexport type { PopperProps } from './components/Popper/Popper';\n\n/**\n * Types\n */\nexport type { AlignType, HasPlatform, HasRef, HasRootRef } from './types';\nexport type { NavIdProps } from './lib/getNavId';\nexport type { PlatformType } from './lib/platform';\nexport type { TransitionContextProps } from './components/NavTransitionContext/NavTransitionContext';\n\n/**\n * Unstable\n */\nexport { ViewInfinite as unstable_ViewInfinite } from './components/View/ViewInfinite';\nexport type { ViewInfiniteProps as unstable_ViewInfiniteProps } from './components/View/ViewInfinite';\nexport { ModalPageFooter as unstable_ModalPageFooter } from './components/ModalPageFooter/ModalPageFooter';\nexport type { ModalPageFooterProps as unstable_ModalPageFooterProps } from './components/ModalPageFooter/ModalPageFooter';\n\nimport './styles/common.css';\n"],"names":["AppRoot","AppRootPortal","DisplayTitle","Title","Headline","Text","Paragraph","Subhead","Footnote","Caption","EllipsisText","UnstyledTextField","Tappable","FixedLayout","ImageBaseContext","ImageBase","getBadgeIconSizeByImageBaseSize","getFallbackIconSizeByImageBaseSize","getOverlayIconSizeByImageBaseSize","Button","IconButton","ToolButton","Root","View","Panel","PanelHeaderButton","PanelHeader","PanelHeaderContent","PanelHeaderContext","SplitLayout","SplitCol","Epic","Tabbar","TabbarItem","ScrollArrow","HorizontalScroll","AspectRatio","Flex","SimpleGrid","PopoutWrapper","Alert","ActionSheet","ActionSheetItem","ActionSheetDefaultIosCloseItem","ScreenSpinner","ScreenSpinnerContext","Snackbar","Tooltip","useTooltip","ModalRoot","withModalRootContext","ModalRootContext","useModalRootContext","ModalPageContent","ModalPage","ModalPageHeader","ModalCard","ModalDismissButton","ModalOutsideButton","Badge","ContentBadge","ButtonGroup","Card","CardGrid","CardScroll","ContentCard","Header","Group","Gradient","List","Cell","RichCell","SimpleCell","CellButton","CellButtonGroup","HorizontalCell","HorizontalCellShowMore","Footer","InfoRow","Gallery","Avatar","GridAvatar","Image","Progress","Search","Tabs","TabsItem","Spinner","PullToRefresh","Link","Mark","OnboardingTooltip","OnboardingTooltipContainer","Counter","UsersStack","Separator","Spacing","Box","Placeholder","Banner","MiniInfoCell","WriteBar","WriteBarIcon","SubnavigationBar","SubnavigationButton","Pagination","Accordion","AccordionContext","useAccordionContext","FormItem","FormField","FormLayoutGroup","FormStatus","Switch","File","DropZone","Input","Chip","ChipsInput","ChipsSelect","Slider","Textarea","SelectionControl","Radio","RadioGroup","Checkbox","Select","SelectMimicry","NativeSelect","CustomSelect","CustomSelectOption","SegmentedControl","Calendar","CalendarRange","DateInput","DateRangeInput","Skeleton","Div","DEFAULT_ARROW_HEIGHT","DEFAULT_ICON_ARROW_HEIGHT","DEFAULT_ARROW_WIDTH","DEFAULT_ICON_ARROW_WIDTH","DEFAULT_ARROW_PADDING","DEFAULT_ICON_ARROW_PADDING","DefaultIcon","FloatingArrow","Touch","PanelSpinner","PanelHeaderClose","PanelHeaderBack","PanelHeaderSubmit","PanelHeaderEdit","ModalCardBase","VisuallyHidden","AdaptiveIconRenderer","AdaptivityProvider","ConfigProvider","useConfigProvider","ConfigProviderContext","ColorSchemeProvider","ColorScheme","DOMContext","LocaleProvider","DirectionProvider","PlatformProvider","Popover","usePopover","withPlatform","usePlatform","useConfigDirection","useDirection","useLocale","useAdaptivity","useAdaptivityConditionalRender","useAdaptivityWithJSMediaQueries","useColorScheme","usePagination","useOrientationChange","usePatchChildren","useTodayDate","useScrollLock","useManualScroll","useScroll","useNavTransition","useNavDirection","useNavId","useCSSKeyframesAnimationController","unstable_useCSSKeyframesAnimationController","useFocusVisible","classNames","animate","defaultFilterFn","filterFnForSelect","removeObjectKeys","SSRWrapper","platform","Platform","ViewWidth","ViewHeight","SizeType","getViewWidthByViewportWidth","getViewHeightByViewportHeight","calcInitialsAvatarColor","CustomScrollView","Popper","ViewInfinite","unstable_ViewInfinite","ModalPageFooter","unstable_ModalPageFooter"],"mappings":"AAAA,OAAO,yBAAyB;AAChC,OAAO,iCAAiC;AACxC,OAAO,6BAA6B;AACpC,OAAO,mCAAmC;AAC1C,OAAO,qCAAqC;AAC5C,OAAO,iDAAiD;AACxD,OAAO,2BAA2B;AAClC,OAAO,sBAAsB;AAE7B,SAASA,OAAO,QAAQ,kCAA+B;AACvD,SAASC,aAAa,QAAQ,w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BC,SAAS,QAAQ,wCAAqC;AACjG,SAASC,gBAAgB,QAAQ,4DAAyD;AAC1F,SAASC,eAAe,QAAQ,8EAA2E;AAC3G,SAASC,QAAQ,QAAQ,wCAAqC;AAE9D,SAASC,sCAAsCC,2CAA2C,QAAQ,2BAAkB;AACpH,SAASC,eAAe,QAAQ,6BAA0B;AAE1D;;CAEC,GACD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,OAAO,QAAQ,mBAAgB;AACxC,SAASC,mBAAmBC,iBAAiB,QAAQ,kBAAe;AACpE,SAASC,gBAAgB,QAAQ,4BAAyB;AAC1D,SAASC,UAAU,QAAQ,eAAY;AAEvC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,oBAAiB;AACpD,SACEC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,2BAA2B,EAC3BC,6BAA6B,QACxB,4BAAmB;AAM1B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,gBAAgB,QAAQ,oDAAiD;AAElF,SAASC,MAAM,QAAQ,gCAA6B;AAWpD;;CAEC,GACD,SAASC,gBAAgBC,qBAAqB,QAAQ,oCAAiC;AAEvF,SAASC,mBAAmBC,wBAAwB,QAAQ,kDAA+C;AAG3G,OAAO,sBAAsB"}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import './styles/constants.css';\nimport './styles/adaptivity.module.css';\nimport './styles/dynamicTokens.css';\nimport './styles/focusVisible.module.css';\nimport './styles/animationFades.module.css';\nimport './styles/transformOriginByPlacement.module.css';\nimport './styles/gaps.module.css';\nimport './styles/layout.css';\n\nexport { AppRoot } from './components/AppRoot/AppRoot';\nexport { AppRootPortal } from './components/AppRoot/AppRootPortal';\nexport type { AppRootProps } from './components/AppRoot/AppRoot';\nexport type { SafeAreaInsets } from './components/AppRoot/types';\n\n/**\n * Typography\n */\nexport type { TypographyProps } from './components/Typography/Typography';\nexport { DisplayTitle } from './components/Typography/DisplayTitle/DisplayTitle';\nexport type { DisplayTitleProps } from './components/Typography/DisplayTitle/DisplayTitle';\nexport { Title } from './components/Typography/Title/Title';\nexport type { TitleProps } from './components/Typography/Title/Title';\nexport { Headline } from './components/Typography/Headline/Headline';\nexport type { HeadlineProps } from './components/Typography/Headline/Headline';\nexport { Text } from './components/Typography/Text/Text';\nexport type { TextProps } from './components/Typography/Text/Text';\nexport { Paragraph } from './components/Typography/Paragraph/Paragraph';\nexport type { ParagraphProps } from './components/Typography/Paragraph/Paragraph';\nexport { Subhead } from './components/Typography/Subhead/Subhead';\nexport type { SubheadProps } from './components/Typography/Subhead/Subhead';\nexport { Footnote } from './components/Typography/Footnote/Footnote';\nexport type { FootnoteProps } from './components/Typography/Footnote/Footnote';\nexport { Caption } from './components/Typography/Caption/Caption';\nexport type { CaptionProps } from './components/Typography/Caption/Caption';\nexport { EllipsisText } from './components/Typography/EllipsisText/EllipsisText';\nexport type { EllipsisTextProps } from './components/Typography/EllipsisText/EllipsisText';\n/**\n * Service\n */\nexport { UnstyledTextField } from './components/UnstyledTextField/UnstyledTextField';\nexport type {\n UnstyledTextFieldAsInputProps,\n UnstyledTextFieldAsTextareaProps,\n UnstyledTextFieldBaseProps,\n UnstyledTextFieldProps,\n} from './components/UnstyledTextField/UnstyledTextField';\nexport { Tappable } from './components/Tappable/Tappable';\nexport type { TappableProps } from './components/Tappable/Tappable';\nexport { FixedLayout } from './components/FixedLayout/FixedLayout';\nexport type { FixedLayoutProps } from './components/FixedLayout/FixedLayout';\nexport {\n ImageBaseContext,\n ImageBase,\n getBadgeIconSizeByImageBaseSize,\n getFallbackIconSizeByImageBaseSize,\n getOverlayIconSizeByImageBaseSize,\n} from './components/ImageBase/ImageBase';\nexport type {\n ImageBaseProps,\n ImageBaseSize,\n ImageBaseExpectedIconProps,\n ImageBaseBadgeProps,\n ImageBaseOverlayProps,\n ImageBaseFloatElementProps,\n FloatElementPlacement,\n FloatElementIndentation,\n} from './components/ImageBase/ImageBase';\n\n/**\n * Primitives\n */\nexport { Button } from './components/Button/Button';\nexport type { ButtonProps } from './components/Button/Button';\nexport { IconButton } from './components/IconButton/IconButton';\nexport type { IconButtonProps } from './components/IconButton/IconButton';\nexport { ToolButton } from './components/ToolButton/ToolButton';\nexport type { ToolButtonProps } from './components/ToolButton/ToolButton';\n\n/**\n * Layout\n */\nexport { Root } from './components/Root/Root';\nexport type { RootProps } from './components/Root/Root';\nexport { View } from './components/View/View';\nexport type { ViewProps } from './components/View/View';\nexport { Panel } from './components/Panel/Panel';\nexport type { PanelProps } from './components/Panel/Panel';\nexport { PanelHeaderButton } from './components/PanelHeaderButton/PanelHeaderButton';\nexport type { PanelHeaderButtonProps } from './components/PanelHeaderButton/PanelHeaderButton';\nexport { PanelHeader } from './components/PanelHeader/PanelHeader';\nexport type { PanelHeaderProps } from './components/PanelHeader/PanelHeader';\nexport { PanelHeaderContent } from './components/PanelHeaderContent/PanelHeaderContent';\nexport type { PanelHeaderContentProps } from './components/PanelHeaderContent/PanelHeaderContent';\nexport { PanelHeaderContext } from './components/PanelHeaderContext/PanelHeaderContext';\nexport type { PanelHeaderContextProps } from './components/PanelHeaderContext/PanelHeaderContext';\nexport { SplitLayout } from './components/SplitLayout/SplitLayout';\nexport type { SplitLayoutProps } from './components/SplitLayout/SplitLayout';\nexport { SplitCol } from './components/SplitCol/SplitCol';\nexport type { SplitColProps } from './components/SplitCol/SplitCol';\nexport { Epic } from './components/Epic/Epic';\nexport type { EpicProps } from './components/Epic/Epic';\nexport { Tabbar } from './components/Tabbar/Tabbar';\nexport type { TabbarProps } from './components/Tabbar/Tabbar';\nexport { TabbarItem } from './components/TabbarItem/TabbarItem';\nexport type { TabbarItemProps } from './components/TabbarItem/TabbarItem';\nexport { ScrollArrow } from './components/ScrollArrow/ScrollArrow';\nexport type { ScrollArrowProps } from './components/ScrollArrow/ScrollArrow';\nexport { HorizontalScroll } from './components/HorizontalScroll/HorizontalScroll';\nexport type { HorizontalScrollProps } from './components/HorizontalScroll/HorizontalScroll';\nexport { AspectRatio } from './components/AspectRatio/AspectRatio';\nexport type { AspectRatioProps } from './components/AspectRatio/AspectRatio';\nexport { Flex } from './components/Flex/Flex';\nexport type { FlexProps } from './components/Flex/Flex';\nexport type { FlexItemProps } from './components/Flex/FlexItem/FlexItem';\nexport { SimpleGrid } from './components/SimpleGrid/SimpleGrid';\nexport type { SimpleGridProps } from './components/SimpleGrid/SimpleGrid';\n\n/**\n * Popouts\n */\nexport { PopoutWrapper } from './components/PopoutWrapper/PopoutWrapper';\nexport type { PopoutWrapperProps } from './components/PopoutWrapper/PopoutWrapper';\nexport { Alert } from './components/Alert/Alert';\nexport type { AlertProps, AlertActionProps, AlertActionInterface } from './components/Alert/Alert';\nexport { ActionSheet } from './components/ActionSheet/ActionSheet';\nexport type {\n ActionSheetProps,\n ActionSheetOnCloseOptions,\n} from './components/ActionSheet/ActionSheet';\nexport { ActionSheetItem } from './components/ActionSheetItem/ActionSheetItem';\nexport type { ActionSheetItemProps } from './components/ActionSheetItem/ActionSheetItem';\nexport { ActionSheetDefaultIosCloseItem } from './components/ActionSheet/ActionSheetDefaultIosCloseItem';\nexport { ScreenSpinner } from './components/ScreenSpinner/ScreenSpinner';\nexport { ScreenSpinnerContext } from './components/ScreenSpinner/context';\nexport type { ScreenSpinnerProps } from './components/ScreenSpinner/ScreenSpinner';\nexport type { ScreenSpinnerContextProps } from './components/ScreenSpinner/context';\nexport { Snackbar } from './components/Snackbar/Snackbar';\nexport type { SnackbarProps } from './components/Snackbar/Snackbar';\nexport { Tooltip } from './components/Tooltip/Tooltip';\nexport { useTooltip } from './components/Tooltip/useTooltip';\nexport type {\n TooltipProps,\n TooltipOnShownChange,\n TooltipArrowProps,\n} from './components/Tooltip/Tooltip';\n\n/**\n * Modals\n */\nexport { ModalRoot } from './components/ModalRoot/ModalRoot';\nexport type {\n ModalRootProps,\n ModalRootContextInterface,\n UseModalRootContext,\n} from './components/ModalRoot/types';\nexport { withModalRootContext } from './components/ModalRoot/withModalRootContext';\nexport { ModalRootContext } from './components/ModalRoot/ModalRootContext';\nexport { useModalRootContext } from './components/ModalRoot/useModalRootContext';\nexport { ModalPageContent } from './components/ModalPageContent/ModalPageContent';\nexport { ModalPage } from './components/ModalPage/ModalPage';\nexport type { ModalPageProps, ModalPageCloseReason } from './components/ModalPage/types';\nexport { ModalPageHeader } from './components/ModalPageHeader/ModalPageHeader';\nexport type { ModalPageHeaderProps } from './components/ModalPageHeader/ModalPageHeader';\nexport { ModalCard } from './components/ModalCard/ModalCard';\nexport type { ModalCardProps, ModalCardCloseReason } from './components/ModalCard/types';\nexport { ModalDismissButton } from './components/ModalDismissButton/ModalDismissButton';\nexport type { ModalDismissButtonProps } from './components/ModalDismissButton/ModalDismissButton';\nexport { ModalOutsideButton } from './components/ModalOutsideButton/ModalOutsideButton';\nexport type { ModalOutsideButtonProps } from './components/ModalOutsideButton/ModalOutsideButton';\n\n/**\n * Blocks\n */\nexport { Badge } from './components/Badge/Badge';\nexport type { BadgeProps } from './components/Badge/Badge';\nexport { ContentBadge } from './components/ContentBadge/ContentBadge';\nexport type { ContentBadgeProps } from './components/ContentBadge/ContentBadge';\nexport { ButtonGroup } from './components/ButtonGroup/ButtonGroup';\nexport type { ButtonGroupProps } from './components/ButtonGroup/ButtonGroup';\nexport { Card } from './components/Card/Card';\nexport type { CardProps } from './components/Card/Card';\nexport { CardGrid } from './components/CardGrid/CardGrid';\nexport type { CardGridProps } from './components/CardGrid/CardGrid';\nexport { CardScroll } from './components/CardScroll/CardScroll';\nexport type { CardScrollProps } from './components/CardScroll/CardScroll';\nexport { ContentCard } from './components/ContentCard/ContentCard';\nexport type { ContentCardProps } from './components/ContentCard/ContentCard';\nexport { Header } from './components/Header/Header';\nexport type { HeaderProps } from './components/Header/Header';\nexport { Group } from './components/Group/Group';\nexport type { GroupProps } from './components/Group/Group';\nexport { Gradient } from './components/Gradient/Gradient';\nexport type { GradientProps } from './components/Gradient/Gradient';\nexport { List } from './components/List/List';\nexport type { ListProps } from './components/List/List';\nexport { Cell } from './components/Cell/Cell';\nexport type { CellProps } from './components/Cell/Cell';\nexport type { CellCheckboxProps } from './components/Cell/CellCheckbox/CellCheckbox';\nexport { RichCell } from './components/RichCell/RichCell';\nexport type { RichCellProps } from './components/RichCell/RichCell';\nexport { SimpleCell } from './components/SimpleCell/SimpleCell';\nexport type { SimpleCellProps } from './components/SimpleCell/SimpleCell';\nexport { CellButton } from './components/CellButton/CellButton';\nexport type { CellButtonProps } from './components/CellButton/CellButton';\nexport { CellButtonGroup } from './components/CellButtonGroup/CellButtonGroup';\nexport type { CellButtonGroupProps } from './components/CellButtonGroup/CellButtonGroup';\nexport { HorizontalCell } from './components/HorizontalCell/HorizontalCell';\nexport type { HorizontalCellProps } from './components/HorizontalCell/HorizontalCell';\nexport { HorizontalCellShowMore } from './components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore';\nexport type { HorizontalCellShowMoreProps } from './components/HorizontalScroll/HorizontalCellShowMore/HorizontalCellShowMore';\nexport { Footer } from './components/Footer/Footer';\nexport type { FooterProps } from './components/Footer/Footer';\nexport { InfoRow } from './components/InfoRow/InfoRow';\nexport type { InfoRowProps } from './components/InfoRow/InfoRow';\nexport { Gallery } from './components/Gallery/Gallery';\nexport type { GalleryProps } from './components/Gallery/Gallery';\nexport { Avatar } from './components/Avatar/Avatar';\nexport type { GetInitialsFontSizeType } from './components/Avatar/helpers';\nexport type {\n AvatarProps,\n AvatarBadgeProps,\n AvatarBadgeWithPresetProps,\n AvatarOverlayProps,\n} from './components/Avatar/Avatar';\nexport { GridAvatar } from './components/GridAvatar/GridAvatar';\nexport type { GridAvatarProps, GridAvatarBadgeProps } from './components/GridAvatar/GridAvatar';\nexport { Image } from './components/Image/Image';\nexport type { ImageProps, ImageBadgeProps, ImageOverlayProps } from './components/Image/Image';\nexport { Progress } from './components/Progress/Progress';\nexport type { ProgressProps } from './components/Progress/Progress';\nexport { Search } from './components/Search/Search';\nexport type { SearchProps, RenderIconButtonFn } from './components/Search/Search';\nexport { Tabs } from './components/Tabs/Tabs';\nexport type { TabsProps } from './components/Tabs/Tabs';\nexport { TabsItem } from './components/TabsItem/TabsItem';\nexport type { TabsItemProps } from './components/TabsItem/TabsItem';\nexport { Spinner } from './components/Spinner/Spinner';\nexport type { SpinnerProps } from './components/Spinner/Spinner';\nexport { PullToRefresh } from './components/PullToRefresh/PullToRefresh';\nexport type { PullToRefreshProps } from './components/PullToRefresh/PullToRefresh';\nexport { Link } from './components/Link/Link';\nexport type { LinkProps } from './components/Link/Link';\nexport { Mark } from './components/Mark/Mark';\nexport type { MarkProps } from './components/Mark/Mark';\nexport { OnboardingTooltip } from './components/OnboardingTooltip/OnboardingTooltip';\nexport type { OnboardingTooltipProps } from './components/OnboardingTooltip/OnboardingTooltip';\nexport { OnboardingTooltipContainer } from './components/OnboardingTooltip/OnboardingTooltipContainer';\nexport { Counter } from './components/Counter/Counter';\nexport type { CounterProps } from './components/Counter/Counter';\nexport { UsersStack } from './components/UsersStack/UsersStack';\nexport type {\n UsersStackProps,\n UsersStackPhoto,\n UsersStackRenderWrapperProps,\n} from './components/UsersStack/UsersStack';\nexport { Separator } from './components/Separator/Separator';\nexport type { SeparatorProps } from './components/Separator/Separator';\nexport { Spacing } from './components/Spacing/Spacing';\nexport type { SpacingProps } from './components/Spacing/Spacing';\nexport { Box } from './components/Box/Box';\nexport type { BoxProps } from './components/Box/Box';\nexport { Placeholder } from './components/Placeholder/Placeholder';\nexport type {\n PlaceholderProps,\n PlaceholderContainerProps,\n PlaceholderIconProps,\n PlaceholderTitleProps,\n PlaceholderDescriptionProps,\n PlaceholderActionsProps,\n} from './components/Placeholder/Placeholder';\nexport { Banner } from './components/Banner/Banner';\nexport type { BannerProps } from './components/Banner/Banner';\nexport { MiniInfoCell } from './components/MiniInfoCell/MiniInfoCell';\nexport type { MiniInfoCellProps } from './components/MiniInfoCell/MiniInfoCell';\nexport { WriteBar } from './components/WriteBar/WriteBar';\nexport type { WriteBarProps } from './components/WriteBar/WriteBar';\nexport { WriteBarIcon } from './components/WriteBarIcon/WriteBarIcon';\nexport type { WriteBarIconProps } from './components/WriteBarIcon/WriteBarIcon';\nexport { SubnavigationBar } from './components/SubnavigationBar/SubnavigationBar';\nexport type { SubnavigationBarProps } from './components/SubnavigationBar/SubnavigationBar';\nexport { SubnavigationButton } from './components/SubnavigationButton/SubnavigationButton';\nexport type { SubnavigationButtonProps } from './components/SubnavigationButton/SubnavigationButton';\nexport { Pagination } from './components/Pagination/Pagination';\nexport type { PaginationProps } from './components/Pagination/Pagination';\nexport type { CustomPaginationPageButtonProps } from './components/Pagination/PaginationPage/PaginationPageButton';\nexport type { CustomPaginationNavigationButton } from './components/Pagination/PaginationNavigationButton/PaginationNavigationButton';\nexport { Accordion } from './components/Accordion/Accordion';\nexport type { AccordionProps } from './components/Accordion/Accordion';\nexport { AccordionContext, useAccordionContext } from './components/Accordion/AccordionContext';\nexport type { AccordionSummaryProps } from './components/Accordion/AccordionSummary';\nexport type { AccordionContentProps } from './components/Accordion/AccordionContent';\n\n/**\n * Forms\n */\nexport { FormItem } from './components/FormItem/FormItem';\nexport type { FormItemTopProps } from './components/FormItem/FormItemTop/FormItemTop';\nexport type { FormItemTopLabelProps } from './components/FormItem/FormItemTop/FormItemTopLabel';\nexport type { FormItemTopAsideProps } from './components/FormItem/FormItemTop/FormItemTopAside';\nexport type { FormItemProps } from './components/FormItem/FormItem';\nexport { FormField } from './components/FormField/FormField';\nexport type { FormFieldProps, FieldIconsAlign } from './components/FormField/FormField';\nexport { FormLayoutGroup } from './components/FormLayoutGroup/FormLayoutGroup';\nexport type { FormLayoutGroupProps } from './components/FormLayoutGroup/FormLayoutGroup';\nexport { FormStatus } from './components/FormStatus/FormStatus';\nexport type { FormStatusProps } from './components/FormStatus/FormStatus';\nexport { Switch } from './components/Switch/Switch';\nexport type { SwitchProps } from './components/Switch/Switch';\nexport { File } from './components/File/File';\nexport type { FileProps } from './components/File/File';\nexport { DropZone } from './components/DropZone/DropZone';\nexport type { DropZoneProps } from './components/DropZone/DropZone';\nexport { Input } from './components/Input/Input';\nexport type { InputProps } from './components/Input/Input';\nexport type { ChipProps } from './components/ChipsInputBase/Chip/Chip';\nexport { Chip } from './components/ChipsInputBase/Chip/Chip';\nexport type {\n ChipOption,\n RenderChipProps,\n ChipOptionValue,\n ChipOptionLabel,\n} from './components/ChipsInputBase/types';\nexport { ChipsInput } from './components/ChipsInput/ChipsInput';\nexport type { ChipsInputProps } from './components/ChipsInput/ChipsInput';\nexport { ChipsSelect } from './components/ChipsSelect/ChipsSelect';\nexport type { ChipsSelectProps } from './components/ChipsSelect/ChipsSelect';\nexport type { FormFieldClearButtonProps } from './components/FormFieldClearButton/FormFieldClearButton';\nexport { Slider } from './components/Slider/Slider';\nexport type { SliderBaseProps, SliderProps, SliderMultipleProps } from './components/Slider/Slider';\nexport { Textarea } from './components/Textarea/Textarea';\nexport type { TextareaProps } from './components/Textarea/Textarea';\nexport { SelectionControl } from './components/SelectionControl/SelectionControl';\nexport type { SelectionControlProps } from './components/SelectionControl/SelectionControl';\nexport { Radio } from './components/Radio/Radio';\nexport type { RadioProps } from './components/Radio/Radio';\nexport { RadioGroup } from './components/RadioGroup/RadioGroup';\nexport type { RadioGroupProps } from './components/RadioGroup/RadioGroup';\nexport { Checkbox } from './components/Checkbox/Checkbox';\nexport type { CheckboxProps } from './components/Checkbox/Checkbox';\nexport type { CheckboxInputIconType } from './components/Checkbox/CheckboxInput/CheckboxInput';\nexport { Select } from './components/Select/Select';\nexport { SelectMimicry } from './components/SelectMimicry/SelectMimicry';\nexport type { SelectMimicryProps } from './components/SelectMimicry/SelectMimicry';\nexport { NativeSelect } from './components/NativeSelect/NativeSelect';\nexport type { NativeSelectProps } from './components/NativeSelect/NativeSelect';\nexport { CustomSelect } from './components/CustomSelect/CustomSelect';\nexport type {\n SelectProps,\n CustomSelectClearButtonProps,\n} from './components/CustomSelect/CustomSelect';\nexport type {\n CustomSelectOptionInterface,\n CustomSelectRenderOption,\n} from './components/CustomSelect/types';\nexport { CustomSelectOption } from './components/CustomSelectOption/CustomSelectOption';\nexport type { CustomSelectOptionProps } from './components/CustomSelectOption/CustomSelectOption';\nexport { SegmentedControl } from './components/SegmentedControl/SegmentedControl';\nexport type {\n SegmentedControlProps,\n SegmentedControlOptionInterface,\n SegmentedControlValue,\n} from './components/SegmentedControl/SegmentedControl';\nexport { Calendar } from './components/Calendar/Calendar';\nexport type { CalendarProps } from './components/Calendar/Calendar';\nexport { CalendarRange } from './components/CalendarRange/CalendarRange';\nexport type { CalendarRangeProps } from './components/CalendarRange/CalendarRange';\nexport { DateInput } from './components/DateInput/DateInput';\nexport type { DateInputProps } from './components/DateInput/DateInput';\nexport { DateRangeInput } from './components/DateRangeInput/DateRangeInput';\nexport type { DateRangeInputProps } from './components/DateRangeInput/DateRangeInput';\nexport { Skeleton } from './components/Skeleton/Skeleton';\nexport type { SkeletonProps } from './components/Skeleton/Skeleton';\n\n/**\n * Helpers\n */\nexport { Div } from './components/Div/Div';\nexport type { DivProps } from './components/Div/Div';\nexport {\n DEFAULT_ARROW_HEIGHT as DEFAULT_ICON_ARROW_HEIGHT,\n DEFAULT_ARROW_WIDTH as DEFAULT_ICON_ARROW_WIDTH,\n DEFAULT_ARROW_PADDING as DEFAULT_ICON_ARROW_PADDING,\n DefaultIcon,\n} from './components/FloatingArrow/DefaultIcon';\nexport { FloatingArrow } from './components/FloatingArrow/FloatingArrow';\nexport type { FloatingArrowProps } from './components/FloatingArrow/FloatingArrow';\nexport { Touch } from './components/Touch/Touch';\nexport type { TouchProps, CustomTouchEvent } from './components/Touch/Touch';\nexport { PanelSpinner } from './components/PanelSpinner/PanelSpinner';\nexport type { PanelSpinnerProps } from './components/PanelSpinner/PanelSpinner';\nexport { PanelHeaderClose } from './components/PanelHeaderClose/PanelHeaderClose';\nexport type { PanelHeaderCloseProps } from './components/PanelHeaderClose/PanelHeaderClose';\nexport { PanelHeaderBack } from './components/PanelHeaderBack/PanelHeaderBack';\nexport type { PanelHeaderBackProps } from './components/PanelHeaderBack/PanelHeaderBack';\nexport { PanelHeaderSubmit } from './components/PanelHeaderSubmit/PanelHeaderSubmit';\nexport type { PanelHeaderSubmitProps } from './components/PanelHeaderSubmit/PanelHeaderSubmit';\nexport { PanelHeaderEdit } from './components/PanelHeaderEdit/PanelHeaderEdit';\nexport type { PanelHeaderEditProps } from './components/PanelHeaderEdit/PanelHeaderEdit';\nexport { ModalCardBase } from './components/ModalCardBase/ModalCardBase';\nexport type { ModalCardBaseProps } from './components/ModalCardBase/ModalCardBase';\nexport { VisuallyHidden } from './components/VisuallyHidden/VisuallyHidden';\nexport type { VisuallyHiddenProps } from './components/VisuallyHidden/VisuallyHidden';\nexport { AdaptiveIconRenderer } from './components/AdaptiveIconRenderer/AdaptiveIconRenderer';\nexport type { AdaptiveIconRendererProps } from './components/AdaptiveIconRenderer/AdaptiveIconRenderer';\n\n/**\n * Wrappers\n */\nexport { AdaptivityProvider } from './components/AdaptivityProvider/AdaptivityProvider';\nexport type { AdaptivityProviderProps } from './components/AdaptivityProvider/AdaptivityProvider';\nexport { ConfigProvider } from './components/ConfigProvider/ConfigProvider';\nexport type { ConfigProviderProps } from './components/ConfigProvider/ConfigProvider';\nexport {\n useConfigProvider,\n ConfigProviderContext,\n} from './components/ConfigProvider/ConfigProviderContext';\nexport { ColorSchemeProvider } from './components/ColorSchemeProvider/ColorSchemeProvider';\nexport type { ColorSchemeProviderProps } from './components/ColorSchemeProvider/ColorSchemeProvider';\nexport { ColorScheme } from './lib/colorScheme';\nexport type { ColorSchemeType } from './lib/colorScheme';\nexport { DOMContext } from './lib/dom';\nexport { LocaleProvider } from './components/LocaleProvider/LocaleProvider';\nexport { DirectionProvider } from './components/DirectionProvider/DirectionProvider';\nexport type { LocaleProviderProps } from './components/LocaleProvider/LocaleProvider';\nexport type { DirectionProviderProps } from './components/DirectionProvider/DirectionProvider';\nexport { PlatformProvider } from './components/PlatformProvider/PlatformProvider';\nexport type { PlatformProviderProps } from './components/PlatformProvider/PlatformProvider';\nexport { Popover } from './components/Popover/Popover';\nexport type {\n PopoverProps,\n PopoverOnShownChange,\n PopoverArrowProps,\n PopoverContentRenderProp,\n} from './components/Popover/Popover';\nexport { usePopover } from './components/Popover/usePopover';\n\n/**\n * HOCs\n */\nexport { withPlatform } from './hoc/withPlatform';\n\n/**\n * Hooks\n */\nexport { usePlatform } from './hooks/usePlatform';\nexport { useConfigDirection as useDirection } from './hooks/useConfigDirection';\nexport { useLocale } from './hooks/useLocale';\nexport { useAdaptivity } from './hooks/useAdaptivity';\nexport {\n type UseAdaptivityConditionalRender,\n useAdaptivityConditionalRender,\n} from './hooks/useAdaptivityConditionalRender';\nexport {\n type UseAdaptivityWithJSMediaQueries,\n useAdaptivityWithJSMediaQueries,\n} from './hooks/useAdaptivityWithJSMediaQueries';\nexport { useColorScheme } from './hooks/useColorScheme';\nexport { usePagination } from './hooks/usePagination';\nexport { type Orientation, useOrientationChange } from './hooks/useOrientationChange';\nexport { usePatchChildren } from './hooks/usePatchChildren';\nexport { useTodayDate } from './hooks/useTodayDate';\nexport { useScrollLock, useManualScroll as useScroll } from './components/AppRoot/ScrollContext';\nexport { useNavTransition } from './components/NavTransitionContext/NavTransitionContext';\nexport { useNavDirection } from './components/NavTransitionDirectionContext/NavTransitionDirectionContext';\nexport { useNavId } from './components/NavIdContext/useNavId';\nexport type { TransitionDirection } from './components/NavTransitionDirectionContext/NavTransitionDirectionContext';\nexport { useCSSKeyframesAnimationController as unstable_useCSSKeyframesAnimationController } from './lib/animation';\nexport { useFocusVisible } from './hooks/useFocusVisible';\nexport { useReducedMotion as unstable_useReducedMotion } from './lib/animation';\n\n/**\n * Utils\n */\nexport { classNames } from '@vkontakte/vkjs';\nexport { animate } from './lib/animate';\nexport { defaultFilterFn as filterFnForSelect } from './lib/select';\nexport { removeObjectKeys } from './lib/removeObjectKeys';\nexport { SSRWrapper } from './lib/SSR';\nexport type { SSRWrapperProps } from './lib/SSR';\nexport { platform, Platform } from './lib/platform';\nexport {\n ViewWidth,\n ViewHeight,\n SizeType,\n getViewWidthByViewportWidth,\n getViewHeightByViewportHeight,\n} from './lib/adaptivity';\nexport {\n type Placement as FloatingPlacement,\n type PlacementWithAuto as FloatingPlacementWithAuto,\n} from './lib/floating';\nexport type { AdaptivityProps } from './components/AdaptivityProvider/AdaptivityContext';\nexport { calcInitialsAvatarColor } from './helpers/avatar';\nexport { CustomScrollView } from './components/CustomScrollView/CustomScrollView';\nexport type { CustomScrollViewProps } from './components/CustomScrollView/CustomScrollView';\nexport { Popper } from './components/Popper/Popper';\nexport type { PopperProps } from './components/Popper/Popper';\n\n/**\n * Types\n */\nexport type { AlignType, HasPlatform, HasRef, HasRootRef } from './types';\nexport type { NavIdProps } from './lib/getNavId';\nexport type { PlatformType } from './lib/platform';\nexport type { TransitionContextProps } from './components/NavTransitionContext/NavTransitionContext';\n\n/**\n * Unstable\n */\nexport { ViewInfinite as unstable_ViewInfinite } from './components/View/ViewInfinite';\nexport type { ViewInfiniteProps as unstable_ViewInfiniteProps } from './components/View/ViewInfinite';\nexport { ModalPageFooter as unstable_ModalPageFooter } from './components/ModalPageFooter/ModalPageFooter';\nexport type { ModalPageFooterProps as unstable_ModalPageFooterProps } from './components/ModalPageFooter/ModalPageFooter';\n\nimport './styles/common.css';\n"],"names":["AppRoot","AppRootPortal","DisplayTitle","Title","Headline","Text","Paragraph","Subhead","Footnote","Caption","EllipsisText","UnstyledTextField","Tappable","FixedLayout","ImageBaseContext","ImageBase","getBadgeIconSizeByImageBaseSize","getFallbackIconSizeByImageBaseSize","getOverlayIconSizeByImageBaseSize","Button","IconButton","ToolButton","Root","View","Panel","PanelHeaderButton","PanelHeader","PanelHeaderContent","PanelHeaderContext","SplitLayout","SplitCol","Epic","Tabbar","TabbarItem","ScrollArrow","HorizontalScroll","AspectRatio","Flex","SimpleGrid","PopoutWrapper","Alert","ActionSheet","ActionSheetItem","ActionSheetDefaultIosCloseItem","ScreenSpinner","ScreenSpinnerContext","Snackbar","Tooltip","useTooltip","ModalRoot","withModalRootContext","ModalRootContext","useModalRootContext","ModalPageContent","ModalPage","ModalPageHeader","ModalCard","ModalDismissButton","ModalOutsideButton","Badge","ContentBadge","ButtonGroup","Card","CardGrid","CardScroll","ContentCard","Header","Group","Gradient","List","Cell","RichCell","SimpleCell","CellButton","CellButtonGroup","HorizontalCell","HorizontalCellShowMore","Footer","InfoRow","Gallery","Avatar","GridAvatar","Image","Progress","Search","Tabs","TabsItem","Spinner","PullToRefresh","Link","Mark","OnboardingTooltip","OnboardingTooltipContainer","Counter","UsersStack","Separator","Spacing","Box","Placeholder","Banner","MiniInfoCell","WriteBar","WriteBarIcon","SubnavigationBar","SubnavigationButton","Pagination","Accordion","AccordionContext","useAccordionContext","FormItem","FormField","FormLayoutGroup","FormStatus","Switch","File","DropZone","Input","Chip","ChipsInput","ChipsSelect","Slider","Textarea","SelectionControl","Radio","RadioGroup","Checkbox","Select","SelectMimicry","NativeSelect","CustomSelect","CustomSelectOption","SegmentedControl","Calendar","CalendarRange","DateInput","DateRangeInput","Skeleton","Div","DEFAULT_ARROW_HEIGHT","DEFAULT_ICON_ARROW_HEIGHT","DEFAULT_ARROW_WIDTH","DEFAULT_ICON_ARROW_WIDTH","DEFAULT_ARROW_PADDING","DEFAULT_ICON_ARROW_PADDING","DefaultIcon","FloatingArrow","Touch","PanelSpinner","PanelHeaderClose","PanelHeaderBack","PanelHeaderSubmit","PanelHeaderEdit","ModalCardBase","VisuallyHidden","AdaptiveIconRenderer","AdaptivityProvider","ConfigProvider","useConfigProvider","ConfigProviderContext","ColorSchemeProvider","ColorScheme","DOMContext","LocaleProvider","DirectionProvider","PlatformProvider","Popover","usePopover","withPlatform","usePlatform","useConfigDirection","useDirection","useLocale","useAdaptivity","useAdaptivityConditionalRender","useAdaptivityWithJSMediaQueries","useColorScheme","usePagination","useOrientationChange","usePatchChildren","useTodayDate","useScrollLock","useManualScroll","useScroll","useNavTransition","useNavDirection","useNavId","useCSSKeyframesAnimationController","unstable_useCSSKeyframesAnimationController","useFocusVisible","useReducedMotion","unstable_useReducedMotion","classNames","animate","defaultFilterFn","filterFnForSelect","removeObjectKeys","SSRWrapper","platform","Platform","ViewWidth","ViewHeight","SizeType","getViewWidthByViewportWidth","getViewHeightByViewportHeight","calcInitialsAvatarColor","CustomScrollView","Popper","ViewInfinite","unstable_ViewInfinite","ModalPageFooter","unstable_ModalPageFooter"],"mappings":"AAAA,OAAO,yBAAyB;AAChC,OAAO,iCAAiC;AACxC,OAAO,6BAA6B;AACpC,OAAO,mCAAmC;AAC1C,OAAO,qCAAqC;AAC5C,OAAO,iDAAiD;AACxD,OAAO,2BAA2B;AAClC,OAAO,sBAAsB;AAE7B,SAASA,OAAO,QAAQ,kCAA+B;AACvD,SAASC,aAAa,QAAQ,wCAAqC;AAQnE,SAASC,YAAY,QAAQ,uDAAoD;AAEjF,SAASC,KAAK,QAAQ,yCAAsC;AAE5D,SAASC,QAAQ,QAAQ,+CAA4C;AAErE,SAASC,IAAI,QAAQ,uCAAoC;AAEzD,SAASC,SAAS,QAAQ,iDAA8C;AAExE,SAASC,OAAO,QAAQ,6CAA0C;AAElE,SAASC,QAAQ,QAAQ,+CAA4C;AAErE,SAASC,OAAO,QAAQ,6CAA0C;AAElE,SAASC,YAAY,QAAQ,uDAAoD;AAEjF;;CAEC,GACD,SAASC,iBAAiB,QAAQ,sDAAmD;AAOrF,SAASC,QAAQ,QAAQ,oCAAiC;AAE1D,SAASC,WAAW,QAAQ,0CAAuC;AAEnE,SACEC,gBAAgB,EAChBC,SAAS,EACTC,+BAA+B,EAC/BC,kCAAkC,EAClCC,iCAAiC,QAC5B,sCAAmC;AAY1C;;CAEC,GACD,SAASC,MAAM,QAAQ,gCAA6B;AAEpD,SAASC,UAAU,QAAQ,wCAAqC;AAEhE,SAASC,UAAU,QAAQ,wCAAqC;AAGhE;;CAEC,GACD,SAASC,IAAI,QAAQ,4BAAyB;AAE9C,SAASC,IAAI,QAAQ,4BAAyB;AAE9C,SAASC,KAAK,QAAQ,8BAA2B;AA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ASC,mBAAmBC,wBAAwB,QAAQ,kDAA+C;AAG3G,OAAO,sBAAsB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/adaptivity/functions.ts"],"sourcesContent":["import type { Exact } from '../../types';\nimport { type PlatformType } from '../platform';\nimport { BREAKPOINTS } from './breakpoints';\nimport {\n type SizeTypeValues,\n VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP,\n ViewHeight,\n type ViewHeightType,\n ViewWidth,\n type ViewWidthType,\n} from './constants';\nimport type { CSSBreakpointsClassNames, MediaQueries } from './types';\n\n/**\n * @public\n */\nexport function getViewWidthByViewportWidth(viewportWidth: number): ViewWidthType {\n if (viewportWidth >= BREAKPOINTS.DESKTOP) {\n return ViewWidth.DESKTOP;\n }\n if (viewportWidth >= BREAKPOINTS.TABLET) {\n return ViewWidth.TABLET;\n }\n if (viewportWidth >= BREAKPOINTS.SMALL_TABLET) {\n return ViewWidth.SMALL_TABLET;\n }\n if (viewportWidth >= BREAKPOINTS.MOBILE) {\n return ViewWidth.MOBILE;\n }\n return ViewWidth.SMALL_MOBILE;\n}\n\nexport function getViewWidthByMediaQueries(mediaQueries: MediaQueries): ViewWidthType {\n /* eslint-disable no-restricted-properties */\n if (mediaQueries.desktopPlus.matches) {\n return ViewWidth.DESKTOP;\n }\n if (mediaQueries.tablet.matches) {\n return ViewWidth.TABLET;\n }\n if (mediaQueries.smallTablet.matches) {\n return ViewWidth.SMALL_TABLET;\n }\n if (mediaQueries.mobile.matches) {\n return ViewWidth.MOBILE;\n }\n /* eslint-enable no-restricted-properties */\n return ViewWidth.SMALL_MOBILE;\n}\n\n/**\n * @public\n */\nexport function getViewHeightByViewportHeight(viewportHeight: number): ViewHeightType {\n if (viewportHeight >= BREAKPOINTS.MEDIUM_HEIGHT) {\n return ViewHeight.MEDIUM;\n }\n if (viewportHeight >= BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT) {\n return ViewHeight.SMALL;\n }\n return ViewHeight.EXTRA_SMALL;\n}\n\nexport function getViewHeightByMediaQueries(mediaQueries: MediaQueries): ViewHeightType {\n /* eslint-disable no-restricted-properties */\n if (mediaQueries.mediumHeight.matches) {\n return ViewHeight.MEDIUM;\n }\n if (mediaQueries.mobileLandscapeHeight.matches) {\n return ViewHeight.SMALL;\n }\n /* eslint-enable no-restricted-properties */\n return ViewHeight.EXTRA_SMALL;\n}\n\nexport function getSizeX(viewWidth: ViewWidthType): SizeTypeValues {\n return viewWidth <= ViewWidth.MOBILE ? 'compact' : 'regular';\n}\n\nexport function isCompactByViewWidth(\n viewWidth: ViewWidthType | undefined,\n hasPointer?: boolean,\n): boolean | undefined {\n return viewWidth !== undefined && viewWidth >= ViewWidth.SMALL_TABLET && hasPointer;\n}\n\nexport function isCompactByViewHeight(viewHeight: ViewHeightType | undefined): boolean {\n return viewHeight !== undefined && viewHeight <= ViewHeight.EXTRA_SMALL;\n}\n\nexport function getSizeY(\n viewWidth: ViewWidthType,\n viewHeight: ViewHeightType,\n hasPointer: boolean,\n): SizeTypeValues {\n if (isCompactByViewWidth(viewWidth, hasPointer) || isCompactByViewHeight(viewHeight)) {\n return 'compact';\n }\n return 'regular';\n}\n\n/**\n * Проверка на Desktop.\n *\n * Функция гарантировано вернёт `boolean` или `null` в зависимости от условий.\n *\n * Возвращаем `null` в случае, если у нас недостаточно данных, чтобы определить платформу.\n *\n * ⚠️ При передаче 'vkcom' всегда будет возвращать `true`.\n */\nexport function tryToCheckIsDesktop(viewWidth: ViewWidthType, viewHeight: ViewHeightType, hasPointer: undefined | boolean, platform?: PlatformType): boolean; // prettier-ignore\nexport function tryToCheckIsDesktop(viewWidth: ViewWidthType, viewHeight: undefined, hasPointer: boolean, platform?: PlatformType): boolean; // prettier-ignore\nexport function tryToCheckIsDesktop(viewWidth: undefined | ViewWidthType, viewHeight: undefined, hasPointer: undefined, platform?: PlatformType): null; // prettier-ignore\nexport function tryToCheckIsDesktop(viewWidth: undefined, viewHeight: undefined | ViewHeightType, hasPointer: undefined, platform?: PlatformType): null; // prettier-ignore\nexport function tryToCheckIsDesktop(viewWidth: undefined, viewHeight: undefined, hasPointer: undefined | boolean, platform?: PlatformType): null; // prettier-ignore\nexport function tryToCheckIsDesktop(viewWidth: undefined | ViewWidthType, viewHeight: undefined | ViewHeightType, hasPointer: undefined | boolean, platform?: PlatformType): null | boolean; // prettier-ignore\nexport function tryToCheckIsDesktop(\n viewWidth: undefined | ViewWidthType,\n viewHeight: undefined | ViewHeightType,\n hasPointer: undefined | boolean,\n platform?: PlatformType,\n): null | boolean {\n // см. https://github.com/VKCOM/VKUI/pull/2473\n const IS_VKCOM_CRUTCH = platform === 'vkcom';\n\n if (\n ((viewWidth === undefined || hasPointer === undefined) &&\n (viewWidth === undefined || viewHeight === undefined)) ||\n (hasPointer === undefined && viewHeight === undefined)\n ) {\n return IS_VKCOM_CRUTCH ? true : null;\n }\n\n const widthIsLikeDesktop = viewWidth >= ViewWidth.SMALL_TABLET;\n const otherParametersIsLikeDesktop =\n hasPointer || (viewHeight !== undefined ? viewHeight >= ViewHeight.MEDIUM : false);\n\n return (widthIsLikeDesktop && otherParametersIsLikeDesktop) || IS_VKCOM_CRUTCH;\n}\n\n/**\n * Конвертирует `viewWidth` в CSS брейкпоинты (см. тесты для наглядности).\n *\n * > Note: используется восклицательный знак (!), чтобы принудить TS поверить, что св-во точно не может быть\n * > `undefined`. Это всё из-за применения `Partial<...>` для объекта.\n */\nexport function viewWidthToClassName<T extends Partial<CSSBreakpointsClassNames>>(\n breakpointClassNames: Exact<CSSBreakpointsClassNames, T>,\n viewWidth: ViewWidthType | 'none' = 'none',\n): string | null {\n if (viewWidth === 'none') {\n return breakpointClassNames.hasOwnProperty('none') ? breakpointClassNames['none']! : null;\n }\n\n const breakpoints: string[] = [];\n const breakpointName = VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP[viewWidth];\n\n if (breakpointClassNames.hasOwnProperty(breakpointName)) {\n breakpoints.push(breakpointClassNames[breakpointName]!);\n }\n\n if (viewWidth >= ViewWidth.MOBILE) {\n if (breakpointClassNames.hasOwnProperty('mobilePlus')) {\n breakpoints.push(breakpointClassNames['mobilePlus']!);\n }\n }\n\n if (viewWidth >= ViewWidth.SMALL_TABLET) {\n if (breakpointClassNames.hasOwnProperty('smallTabletPlus')) {\n breakpoints.push(breakpointClassNames['smallTabletPlus']!);\n }\n } else {\n if (breakpointClassNames.hasOwnProperty('smallTabletMinus')) {\n breakpoints.push(breakpointClassNames['smallTabletMinus']!);\n }\n }\n\n if (viewWidth >= ViewWidth.TABLET) {\n if (breakpointClassNames.hasOwnProperty('tabletPlus')) {\n breakpoints.push(breakpointClassNames['tabletPlus']!);\n }\n } else {\n if (breakpointClassNames.hasOwnProperty('tabletMinus')) {\n breakpoints.push(breakpointClassNames['tabletMinus']!);\n }\n }\n\n return breakpoints.length > 0 ? breakpoints.join(' ') : null;\n}\n"],"names":["BREAKPOINTS","VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP","ViewHeight","ViewWidth","getViewWidthByViewportWidth","viewportWidth","DESKTOP","TABLET","SMALL_TABLET","MOBILE","SMALL_MOBILE","getViewWidthByMediaQueries","mediaQueries","desktopPlus","matches","tablet","smallTablet","mobile","getViewHeightByViewportHeight","viewportHeight","MEDIUM_HEIGHT","MEDIUM","MOBILE_LANDSCAPE_HEIGHT","SMALL","EXTRA_SMALL","getViewHeightByMediaQueries","mediumHeight","mobileLandscapeHeight","getSizeX","viewWidth","isCompactByViewWidth","hasPointer","undefined","isCompactByViewHeight","viewHeight","getSizeY","tryToCheckIsDesktop","platform","IS_VKCOM_CRUTCH","widthIsLikeDesktop","otherParametersIsLikeDesktop","viewWidthToClassName","breakpointClassNames","hasOwnProperty","breakpoints","breakpointName","push","length","join"],"mappings":"AAEA,SAASA,WAAW,QAAQ,mBAAgB;AAC5C,SAEEC,gCAAgC,EAChCC,UAAU,EAEVC,SAAS,QAEJ,iBAAc;AAGrB;;CAEC,GACD,OAAO,SAASC,4BAA4BC,aAAqB;IAC/D,IAAIA,i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e;IACvD;IAEA,IAAIhB,aAAa1B,UAAUM,MAAM,EAAE;QACjC,IAAIiC,qBAAqBC,cAAc,CAAC,eAAe;YACrDC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,aAAa;QACrD;IACF;IAEA,IAAIb,aAAa1B,UAAUK,YAAY,EAAE;QACvC,IAAIkC,qBAAqBC,cAAc,CAAC,oBAAoB;YAC1DC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,kBAAkB;QAC1D;IACF,OAAO;QACL,IAAIA,qBAAqBC,cAAc,CAAC,qBAAqB;YAC3DC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,mBAAmB;QAC3D;IACF;IAEA,IAAIb,aAAa1B,UAAUI,MAAM,EAAE;QACjC,IAAImC,qBAAqBC,cAAc,CAAC,eAAe;YACrDC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,aAAa;QACrD;IACF,OAAO;QACL,IAAIA,qBAAqBC,cAAc,CAAC,gBAAgB;YACtDC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,cAAc;QACtD;IACF;IAEA,OAAOE,YAAYG,MAAM,GAAG,IAAIH,YAAYI,IAAI,CAAC,OAAO;AAC1D"}
1
+ {"version":3,"sources":["../../../../src/lib/adaptivity/functions.ts"],"sourcesContent":["import type { Exact } from '../../types';\nimport { type PlatformType } from '../platform';\nimport { BREAKPOINTS } from './breakpoints';\nimport {\n type SizeTypeValues,\n VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP,\n ViewHeight,\n type ViewHeightType,\n ViewWidth,\n type ViewWidthType,\n} from './constants';\nimport type { CSSBreakpointsClassNames, MediaQueries } from './types';\n\n/**\n * @public\n */\nexport function getViewWidthByViewportWidth(viewportWidth: number): ViewWidthType {\n if (viewportWidth >= BREAKPOINTS.DESKTOP) {\n return ViewWidth.DESKTOP;\n }\n if (viewportWidth >= BREAKPOINTS.TABLET) {\n return ViewWidth.TABLET;\n }\n if (viewportWidth >= BREAKPOINTS.SMALL_TABLET) {\n return ViewWidth.SMALL_TABLET;\n }\n if (viewportWidth >= BREAKPOINTS.MOBILE) {\n return ViewWidth.MOBILE;\n }\n return ViewWidth.SMALL_MOBILE;\n}\n\nexport function getViewWidthByMediaQueries(mediaQueries: MediaQueries): ViewWidthType {\n /* eslint-disable no-restricted-properties */\n if (mediaQueries.desktopPlus.matches) {\n return ViewWidth.DESKTOP;\n }\n if (mediaQueries.tablet.matches) {\n return ViewWidth.TABLET;\n }\n if (mediaQueries.smallTablet.matches) {\n return ViewWidth.SMALL_TABLET;\n }\n if (mediaQueries.mobile.matches) {\n return ViewWidth.MOBILE;\n }\n /* eslint-enable no-restricted-properties */\n return ViewWidth.SMALL_MOBILE;\n}\n\n/**\n * @public\n */\nexport function getViewHeightByViewportHeight(viewportHeight: number): ViewHeightType {\n if (viewportHeight >= BREAKPOINTS.MEDIUM_HEIGHT) {\n return ViewHeight.MEDIUM;\n }\n if (viewportHeight >= BREAKPOINTS.MOBILE_LANDSCAPE_HEIGHT) {\n return ViewHeight.SMALL;\n }\n return ViewHeight.EXTRA_SMALL;\n}\n\nexport function getViewHeightByMediaQueries(mediaQueries: MediaQueries): ViewHeightType {\n /* eslint-disable no-restricted-properties */\n if (mediaQueries.mediumHeight.matches) {\n return ViewHeight.MEDIUM;\n }\n if (mediaQueries.mobileLandscapeHeight.matches) {\n return ViewHeight.SMALL;\n }\n /* eslint-enable no-restricted-properties */\n return ViewHeight.EXTRA_SMALL;\n}\n\nexport function getSizeX(viewWidth: ViewWidthType): SizeTypeValues {\n return viewWidth <= ViewWidth.MOBILE ? 'compact' : 'regular';\n}\n\nexport function isCompactByViewWidth(\n viewWidth: ViewWidthType | undefined,\n hasPointer?: boolean,\n): boolean | undefined {\n return viewWidth !== undefined && viewWidth >= ViewWidth.SMALL_TABLET && hasPointer;\n}\n\nexport function isCompactByViewHeight(viewHeight: ViewHeightType | undefined): boolean {\n return viewHeight !== undefined && viewHeight <= ViewHeight.EXTRA_SMALL;\n}\n\nexport function getSizeY(\n viewWidth: ViewWidthType,\n viewHeight: ViewHeightType,\n hasPointer: boolean,\n): SizeTypeValues {\n if (isCompactByViewWidth(viewWidth, hasPointer) || isCompactByViewHeight(viewHeight)) {\n return 'compact';\n }\n return 'regular';\n}\n\n/**\n * Проверка на Desktop.\n *\n * Функция гарантировано вернёт `boolean` или `null` в зависимости от условий.\n *\n * Возвращаем `null` в случае, если у нас недостаточно данных, чтобы определить платформу.\n *\n * ⚠️ При передаче 'vkcom' всегда будет возвращать `true`.\n */\nexport function tryToCheckIsDesktop(\n viewWidth: ViewWidthType,\n viewHeight: ViewHeightType,\n hasPointer: undefined | boolean,\n platform?: PlatformType,\n): boolean;\nexport function tryToCheckIsDesktop(\n viewWidth: ViewWidthType,\n viewHeight: undefined,\n hasPointer: boolean,\n platform?: PlatformType,\n): boolean;\nexport function tryToCheckIsDesktop(\n viewWidth: undefined | ViewWidthType,\n viewHeight: undefined,\n hasPointer: undefined,\n platform?: PlatformType,\n): null;\nexport function tryToCheckIsDesktop(\n viewWidth: undefined,\n viewHeight: undefined | ViewHeightType,\n hasPointer: undefined,\n platform?: PlatformType,\n): null;\nexport function tryToCheckIsDesktop(\n viewWidth: undefined,\n viewHeight: undefined,\n hasPointer: undefined | boolean,\n platform?: PlatformType,\n): null;\nexport function tryToCheckIsDesktop(\n viewWidth: undefined | ViewWidthType,\n viewHeight: undefined | ViewHeightType,\n hasPointer: undefined | boolean,\n platform?: PlatformType,\n): null | boolean;\nexport function tryToCheckIsDesktop(\n viewWidth: undefined | ViewWidthType,\n viewHeight: undefined | ViewHeightType,\n hasPointer: undefined | boolean,\n platform?: PlatformType,\n): null | boolean {\n // см. https://github.com/VKCOM/VKUI/pull/2473\n const IS_VKCOM_CRUTCH = platform === 'vkcom';\n\n if (\n ((viewWidth === undefined || hasPointer === undefined) &&\n (viewWidth === undefined || viewHeight === undefined)) ||\n (hasPointer === undefined && viewHeight === undefined)\n ) {\n return IS_VKCOM_CRUTCH ? true : null;\n }\n\n const widthIsLikeDesktop = viewWidth >= ViewWidth.SMALL_TABLET;\n const otherParametersIsLikeDesktop =\n hasPointer || (viewHeight !== undefined ? viewHeight >= ViewHeight.MEDIUM : false);\n\n return (widthIsLikeDesktop && otherParametersIsLikeDesktop) || IS_VKCOM_CRUTCH;\n}\n\n/**\n * Конвертирует `viewWidth` в CSS брейкпоинты (см. тесты для наглядности).\n *\n * > Note: используется восклицательный знак (!), чтобы принудить TS поверить, что св-во точно не может быть\n * > `undefined`. Это всё из-за применения `Partial<...>` для объекта.\n */\nexport function viewWidthToClassName<T extends Partial<CSSBreakpointsClassNames>>(\n breakpointClassNames: Exact<CSSBreakpointsClassNames, T>,\n viewWidth: ViewWidthType | 'none' = 'none',\n): string | null {\n if (viewWidth === 'none') {\n return breakpointClassNames.hasOwnProperty('none') ? breakpointClassNames['none']! : null;\n }\n\n const breakpoints: string[] = [];\n const breakpointName = VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP[viewWidth];\n\n if (breakpointClassNames.hasOwnProperty(breakpointName)) {\n breakpoints.push(breakpointClassNames[breakpointName]!);\n }\n\n if (viewWidth >= ViewWidth.MOBILE) {\n if (breakpointClassNames.hasOwnProperty('mobilePlus')) {\n breakpoints.push(breakpointClassNames['mobilePlus']!);\n }\n }\n\n if (viewWidth >= ViewWidth.SMALL_TABLET) {\n if (breakpointClassNames.hasOwnProperty('smallTabletPlus')) {\n breakpoints.push(breakpointClassNames['smallTabletPlus']!);\n }\n } else {\n if (breakpointClassNames.hasOwnProperty('smallTabletMinus')) {\n breakpoints.push(breakpointClassNames['smallTabletMinus']!);\n }\n }\n\n if (viewWidth >= ViewWidth.TABLET) {\n if (breakpointClassNames.hasOwnProperty('tabletPlus')) {\n breakpoints.push(breakpointClassNames['tabletPlus']!);\n }\n } else {\n if (breakpointClassNames.hasOwnProperty('tabletMinus')) {\n breakpoints.push(breakpointClassNames['tabletMinus']!);\n }\n }\n\n return breakpoints.length > 0 ? breakpoints.join(' ') : null;\n}\n"],"names":["BREAKPOINTS","VIEW_WIDTH_TO_CSS_BREAKPOINT_MAP","ViewHeight","ViewWidth","getViewWidthByViewportWidth","viewportWidth","DESKTOP","TABLET","SMALL_TABLET","MOBILE","SMALL_MOBILE","getViewWidthByMediaQueries","mediaQueries","desktopPlus","matches","tablet","smallTablet","mobile","getViewHeightByViewportHeight","viewportHeight","MEDIUM_HEIGHT","MEDIUM","MOBILE_LANDSCAPE_HEIGHT","SMALL","EXTRA_SMALL","getViewHeightByMediaQueries","mediumHeight","mobileLandscapeHeight","getSizeX","viewWidth","isCompactByViewWidth","hasPointer","undefined","isCompactByViewHeight","viewHeight","getSizeY","tryToCheckIsDesktop","platform","IS_VKCOM_CRUTCH","widthIsLikeDesktop","otherParametersIsLikeDesktop","viewWidthToClassName","breakpointClassNames","hasOwnProperty","breakpoints","breakpointName","push","length","join"],"mappings":"AAEA,SAASA,WAAW,QAAQ,mBAAgB;AAC5C,SAEEC,gCAAgC,EAChCC,UAAU,EAEVC,SAAS,QAEJ,iBAAc;AAGrB;;CAEC,GACD,OAAO,SAASC,4BAA4BC,aAAqB;IAC/D,IAAIA,iBAAiBL,YAAYM,OAAO,EAAE;QACxC,OAAOH,UAAUG,OAAO;IAC1B;IACA,IAAID,iBAAiBL,YAAYO,MAAM,EAAE;QACvC,OAAOJ,UAAUI,MAAM;IACzB;IACA,IAAIF,iBAAiBL,YAAYQ,YAAY,EAAE;QAC7C,OAAOL,UAAUK,YAAY;IAC/B;IACA,IAAIH,iBAAiBL,YAAYS,MAAM,EAAE;QACvC,OAAON,UAAUM,MAAM;IACzB;IACA,OAAON,UAAUO,YAAY;AAC/B;AAEA,OAAO,SAASC,2BAA2BC,YAA0B;IACnE,2CAA2C,GAC3C,IAAIA,aAAaC,WAAW,CAACC,OAAO,EAAE;QACpC,OAAOX,UAAUG,OAAO;IAC1B;IACA,IAAIM,aAAaG,MAAM,CAACD,OAAO,EAAE;QAC/B,OAAOX,UAAUI,MAAM;IACzB;IACA,IAAIK,aAAaI,WAAW,CAAC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ACF,OAAO;QACL,IAAIA,qBAAqBC,cAAc,CAAC,gBAAgB;YACtDC,YAAYE,IAAI,CAACJ,oBAAoB,CAAC,cAAc;QACtD;IACF;IAEA,OAAOE,YAAYG,MAAM,GAAG,IAAIH,YAAYI,IAAI,CAAC,OAAO;AAC1D"}
@@ -3,9 +3,14 @@ import { useDOM } from "../dom.js";
3
3
  import { matchMediaListAddListener, matchMediaListRemoveListener } from "../matchMedia.js";
4
4
  import { useIsomorphicLayoutEffect } from "../useIsomorphicLayoutEffect.js";
5
5
  export const REDUCE_MOTION_MEDIA_QUERY = 'screen and (prefers-reduced-motion: reduce)';
6
- export const useReducedMotion = ()=>{
6
+ /**
7
+ * Хук для отслеживания предпочтения пользователя в уменьшении анимации.
8
+ *
9
+ * @returns {boolean | undefined} Возвращает `true`, если пользователь предпочитает уменьшенную анимацию,
10
+ * `false` - если нет, и `undefined` во время серверного рендеринга или во время первого рендеринга на клиенте.
11
+ */ export const useReducedMotion = ()=>{
7
12
  const { window } = useDOM();
8
- const [reducedMotion, setReducedMotion] = React.useState(()=>undefined);
13
+ const [reducedMotion, setReducedMotion] = React.useState(undefined);
9
14
  useIsomorphicLayoutEffect(()=>{
10
15
  /* istanbul ignore if: невозможный кейс (в SSR вызова этой функции не будет) */ if (!window) {
11
16
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/animation/useReducedMotion.ts"],"sourcesContent":["/* eslint-disable no-restricted-properties */\nimport * as React from 'react';\nimport { useDOM } from '../dom';\nimport { matchMediaListAddListener, matchMediaListRemoveListener } from '../matchMedia';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\nexport const REDUCE_MOTION_MEDIA_QUERY = 'screen and (prefers-reduced-motion: reduce)';\n\nexport const useReducedMotion = (): boolean | undefined => {\n const { window } = useDOM();\n\n const [reducedMotion, setReducedMotion] = React.useState<boolean | undefined>(() => undefined);\n\n useIsomorphicLayoutEffect(() => {\n /* istanbul ignore if: невозможный кейс (в SSR вызова этой функции не будет) */\n if (!window) {\n return;\n }\n const match = window.matchMedia(REDUCE_MOTION_MEDIA_QUERY);\n setReducedMotion(match.matches);\n /* istanbul ignore next: на текущий момент, покрытие данного кейса неинтересно */\n const handleMediaQueryChange = (event: MediaQueryListEvent) => {\n /* istanbul ignore next */\n setReducedMotion(event.matches);\n };\n matchMediaListAddListener(match, handleMediaQueryChange);\n return () => matchMediaListRemoveListener(match, handleMediaQueryChange);\n }, [window]);\n\n return reducedMotion;\n};\n"],"names":["React","useDOM","matchMediaListAddListener","matchMediaListRemoveListener","useIsomorphicLayoutEffect","REDUCE_MOTION_MEDIA_QUERY","useReducedMotion","window","reducedMotion","setReducedMotion","useState","undefined","match","matchMedia","matches","handleMediaQueryChange","event"],"mappings":"AAAA,2CAA2C,GAC3C,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,YAAS;AAChC,SAASC,yBAAyB,EAAEC,4BAA4B,QAAQ,mBAAgB;AACxF,SAASC,yBAAyB,QAAQ,kCAA+B;AAEzE,OAAO,MAAMC,4BAA4B,8CAA8C;AAEvF,OAAO,MAAMC,mBAAmB;IAC9B,MAAM,EAAEC,MAAM,EAAE,GAAGN;IAEnB,MAAM,CAACO,eAAeC,iBAAiB,GAAGT,MAAMU,QAAQ,CAAsB,IAAMC;IAEpFP,0BAA0B;QACxB,6EAA6E,GAC7E,IAAI,CAACG,QAAQ;YACX;QACF;QACA,MAAMK,QAAQL,OAAOM,UAAU,CAACR;QAChCI,iBAAiBG,MAAME,OAAO;QAC9B,gFAAgF,GAChF,MAAMC,yBAAyB,CAACC;YAC9B,wBAAwB,GACxBP,iBAAiBO,MAAMF,OAAO;QAChC;QACAZ,0BAA0BU,OAAOG;QACjC,OAAO,IAAMZ,6BAA6BS,OAAOG;IACnD,GAAG;QAACR;KAAO;IAEX,OAAOC;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../../src/lib/animation/useReducedMotion.ts"],"sourcesContent":["/* eslint-disable no-restricted-properties */\nimport * as React from 'react';\nimport { useDOM } from '../dom';\nimport { matchMediaListAddListener, matchMediaListRemoveListener } from '../matchMedia';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\nexport const REDUCE_MOTION_MEDIA_QUERY = 'screen and (prefers-reduced-motion: reduce)';\n\n/**\n * Хук для отслеживания предпочтения пользователя в уменьшении анимации.\n *\n * @returns {boolean | undefined} Возвращает `true`, если пользователь предпочитает уменьшенную анимацию,\n * `false` - если нет, и `undefined` во время серверного рендеринга или во время первого рендеринга на клиенте.\n */\nexport const useReducedMotion = (): boolean | undefined => {\n const { window } = useDOM();\n\n const [reducedMotion, setReducedMotion] = React.useState<boolean | undefined>(undefined);\n\n useIsomorphicLayoutEffect(() => {\n /* istanbul ignore if: невозможный кейс (в SSR вызова этой функции не будет) */\n if (!window) {\n return;\n }\n const match = window.matchMedia(REDUCE_MOTION_MEDIA_QUERY);\n setReducedMotion(match.matches);\n /* istanbul ignore next: на текущий момент, покрытие данного кейса неинтересно */\n const handleMediaQueryChange = (event: MediaQueryListEvent) => {\n /* istanbul ignore next */\n setReducedMotion(event.matches);\n };\n matchMediaListAddListener(match, handleMediaQueryChange);\n return () => matchMediaListRemoveListener(match, handleMediaQueryChange);\n }, [window]);\n\n return reducedMotion;\n};\n"],"names":["React","useDOM","matchMediaListAddListener","matchMediaListRemoveListener","useIsomorphicLayoutEffect","REDUCE_MOTION_MEDIA_QUERY","useReducedMotion","window","reducedMotion","setReducedMotion","useState","undefined","match","matchMedia","matches","handleMediaQueryChange","event"],"mappings":"AAAA,2CAA2C,GAC3C,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,YAAS;AAChC,SAASC,yBAAyB,EAAEC,4BAA4B,QAAQ,mBAAgB;AACxF,SAASC,yBAAyB,QAAQ,kCAA+B;AAEzE,OAAO,MAAMC,4BAA4B,8CAA8C;AAEvF;;;;;CAKC,GACD,OAAO,MAAMC,mBAAmB;IAC9B,MAAM,EAAEC,MAAM,EAAE,GAAGN;IAEnB,MAAM,CAACO,eAAeC,iBAAiB,GAAGT,MAAMU,QAAQ,CAAsBC;IAE9EP,0BAA0B;QACxB,6EAA6E,GAC7E,IAAI,CAACG,QAAQ;YACX;QACF;QACA,MAAMK,QAAQL,OAAOM,UAAU,CAACR;QAChCI,iBAAiBG,MAAME,OAAO;QAC9B,gFAAgF,GAChF,MAAMC,yBAAyB,CAACC;YAC9B,wBAAwB,GACxBP,iBAAiBO,MAAMF,OAAO;QAChC;QACAZ,0BAA0BU,OAAOG;QACjC,OAAO,IAAMZ,6BAA6BS,OAAOG;IACnD,GAAG;QAACR;KAAO;IAEX,OAAOC;AACT,EAAE"}
@@ -224,14 +224,14 @@ const nonTextInputTypes = {
224
224
  image: true,
225
225
  checkbox: true,
226
226
  radio: true
227
- }; // prettier-ignore
227
+ };
228
228
  export const isHTMLContentEditableElement = (el)=>{
229
229
  if (el === null) {
230
230
  return false;
231
231
  }
232
232
  if (el.tagName === 'INPUT') {
233
233
  // @ts-expect-error: TS2339 за счёт `tagName` удовлетворяемся, что это `HTMLInputElement`
234
- return !nonTextInputTypes[el.type]; // prettier-ignore
234
+ return !nonTextInputTypes[el.type];
235
235
  }
236
236
  return el.tagName === 'TEXTAREA' || // eslint-disable-next-line no-restricted-properties
237
237
  el.closest('[contenteditable=true]') !== null;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/dom.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { canUseDOM } from '@vkontakte/vkjs';\nimport { rectToClientRect } from '@vkontakte/vkui-floating-ui/core';\nimport {\n getParentNode,\n getWindow,\n isElement,\n isHTMLElement,\n isLastTraversableNode,\n isOverflowElement,\n} from '@vkontakte/vkui-floating-ui/utils/dom';\n\nexport {\n getWindow,\n getNodeScroll,\n isHTMLElement,\n isElement,\n getParentNode,\n} from '@vkontakte/vkui-floating-ui/utils/dom';\n\nexport { canUseDOM, canUseEventListeners, onDOMLoaded } from '@vkontakte/vkjs';\nexport interface DOMContextInterface {\n /**\n * @ignore\n */\n window?: Window;\n /**\n * @ignore\n */\n document?: Document;\n}\n\nexport type DOMProps = DOMContextInterface;\n\n/* eslint-disable no-restricted-globals */\nconst getDOM = (): DOMContextInterface => ({\n window: canUseDOM ? window : undefined,\n document: canUseDOM ? document : undefined,\n});\n/* eslint-enable no-restricted-globals */\n\nexport const DOMContext: React.Context<DOMContextInterface> =\n React.createContext<DOMContextInterface>(getDOM());\n\nexport const useDOM = (): DOMContextInterface => {\n return React.useContext(DOMContext);\n};\n\n/**\n * В случае, если используется DOMContext, при проверке 'node instanceOf Window' – Window может быть\n * другим объектом.\n */\nexport const isWindow = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is Window => {\n return node !== null && node !== undefined && 'navigator' in node;\n};\n\nexport const isBody = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is HTMLBodyElement => {\n return node !== null && node !== undefined && 'tagName' in node && node.tagName === 'BODY';\n};\n\nexport const isDocumentElement = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is HTMLHtmlElement => {\n return node !== null && node !== undefined && 'tagName' in node && node.tagName === 'HTML';\n};\n\nexport function withDOM<Props>(\n Component: React.ComponentType<Props & DOMProps>,\n): React.ComponentType<Props> {\n const WithDOM = (props: Props) => {\n const dom = useDOM();\n return <Component {...props} {...dom} />;\n };\n return WithDOM;\n}\n\nexport function blurActiveElement(document: Document | undefined): void {\n if (document && document.activeElement) {\n (document.activeElement as HTMLElement).blur();\n }\n}\n\nexport const TRANSFORM_DEFAULT_VALUES: string[] = ['none', 'initial', 'inherit', 'unset'];\nexport const WILL_CHANGE_DEFAULT_VALUES: string[] = ['auto', 'initial', 'inherit', 'unset'];\nexport function getTransformedParentCoords(element: Element): {\n x: number;\n y: number;\n} {\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (isHTMLElement(parentNode)) {\n let { transform, willChange } = getComputedStyle(parentNode);\n if (transform === '') {\n transform = 'unset';\n }\n if (willChange === '') {\n willChange = 'unset';\n }\n if (\n !TRANSFORM_DEFAULT_VALUES.includes(transform) ||\n !WILL_CHANGE_DEFAULT_VALUES.includes(willChange)\n ) {\n const { x, y } = parentNode.getBoundingClientRect();\n return { x, y };\n }\n }\n parentNode = parentNode.parentNode;\n }\n return { x: 0, y: 0 };\n}\n\nexport const getBoundingClientRect = (node: Element | Window, isFixedStrategy = false) => {\n const element = isWindow(node) ? node.document.documentElement : node;\n const clientRect = element.getBoundingClientRect();\n\n if (isDocumentElement(element)) {\n /**\n * Если на странице не используется `html, body { height: 100% }` (или `height: 100vh`), то\n * `height`, полученный из `document.documentElement.getBoundingClientRect()`, будет возвращать\n * `scrollHeight`, а не `clientHeight`. Поэтому перебиваем `height` на `clientHeight`.\n */\n clientRect.height = element.clientHeight;\n }\n\n let offsetX = 0;\n let offsetY = 0;\n if (isFixedStrategy) {\n const { x, y } = getTransformedParentCoords(element);\n offsetX = x;\n offsetY = y;\n }\n\n return rectToClientRect({\n x: clientRect.left - offsetX,\n y: clientRect.top - offsetY,\n width: clientRect.width,\n height: clientRect.height,\n }) as DOMRect;\n};\n\nexport const getRelativeBoundingClientRect = (parent: Element, child: Element) => {\n const parentRect = getBoundingClientRect(parent);\n const childRect = getBoundingClientRect(child);\n return rectToClientRect({\n x: childRect.left - parentRect.left,\n y: childRect.top - parentRect.top,\n width: childRect.width,\n height: childRect.height,\n }) as DOMRect;\n};\n\n/**\n * Переписанный `getNearestOverflowAncestor` из @floating-ui/utils/dom.\n *\n * [1] добавляем ноду, на которой нужно остановить рекурсию\n * [2] document.body подменяем на window, т.к. на document.body нельзя применить скролл.\n *\n * @link https://github.com/floating-ui/floating-ui/blob/%40floating-ui/dom%401.6.3/packages/utils/src/dom.ts#L143\n */\nexport function getNearestOverflowAncestor(node: Node): HTMLElement | Window | null;\nexport function getNearestOverflowAncestor(node: Node, terminalNode: Node): HTMLElement | null;\nexport function getNearestOverflowAncestor(node: Node, terminalNode?: any): any {\n const parentNode = getParentNode(node);\n\n if (terminalNode === parentNode) {\n return null; /* [1] */\n }\n\n if (isLastTraversableNode(parentNode)) {\n return getWindow(parentNode); /* [2] */\n }\n\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n\n return getNearestOverflowAncestor(parentNode, terminalNode);\n}\n\nexport const getScrollHeight = (node: Element | Window): number => {\n return isWindow(node) ? node.document.documentElement.scrollHeight : node.scrollHeight;\n};\n\nexport const getScrollRect = (\n node: Element | Window,\n): {\n relative: DOMRect;\n edges: {\n y: [number, number];\n };\n} => {\n const window = isElement(node) ? getWindow(node) : node;\n const scrollElRect = getBoundingClientRect(node);\n\n const edgeTop = window.scrollY + scrollElRect.top;\n const edgeBottom = edgeTop + scrollElRect.height;\n const y: [number, number] = [edgeTop, edgeBottom];\n\n return {\n relative: scrollElRect,\n edges: { y },\n };\n};\n\nexport const getDocumentBody = (node?: any): HTMLElement => getWindow(node).document.body;\n\nexport const getActiveElementByAnotherElement = (el: Element | null): Element | null =>\n el ? el.ownerDocument.activeElement : null;\n\nexport const contains = (parent?: Element | null, child?: Element | null): boolean => {\n return parent && child ? parent.contains(child) : false;\n};\n\nexport const getFirstTouchEventData = (\n event: UIEvent | React.UIEvent<HTMLElement>,\n): {\n screenX: number;\n screenY: number;\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n} => {\n let dataRaw = (function resolveData() {\n switch (event.type) {\n case 'touchend':\n return (event as TouchEvent).changedTouches[0];\n case 'touchstart':\n case 'touchmove':\n case 'touchcancel':\n return (event as TouchEvent).touches[0];\n case 'mousedown':\n case 'mousemove':\n case 'mouseup':\n case 'mouseleave':\n return event as MouseEvent;\n default:\n return { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0 };\n }\n })();\n /* istanbul ignore if */\n if (process.env.NODE_ENV === 'test') {\n dataRaw = dataRaw\n ? dataRaw\n : { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0 };\n }\n return {\n screenX: dataRaw.screenX || 0,\n screenY: dataRaw.screenY || 0,\n clientX: dataRaw.clientX || 0,\n clientY: dataRaw.clientY || 0,\n pageX: dataRaw.pageX || 0,\n pageY: dataRaw.pageY || 0,\n };\n};\n\n/**\n * ⚠️ В частности, необходимо для iOS 15. Начиная с этой версии в Safari добавили\n * pull-to-refresh. CSS св-во `overflow-behavior` появился только с iOS 16.\n *\n * Во вторую очередь, полезна блокированием скролла, чтобы пользователь дождался обновления\n * данных.\n */\nexport const initializeBrowserGesturePreventionEffect = (window: Window): VoidFunction => {\n const options: AddEventListenerOptions & EventListenerOptions = { passive: false };\n const handleWindowTouchMove = (event: TouchEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n window.document.documentElement.classList.add('vkui--disable-overscroll-behavior'); // eslint-disable-line no-restricted-properties\n window.addEventListener('touchmove', handleWindowTouchMove, options);\n\n return function dispose() {\n window.document.documentElement.classList.remove('vkui--disable-overscroll-behavior'); // eslint-disable-line no-restricted-properties\n window.removeEventListener('touchmove', handleWindowTouchMove, options);\n };\n};\n\nconst nonTextInputTypes = { button: true, submit: true, reset: true, color: true, file: true, image: true, checkbox: true, radio: true }; // prettier-ignore\n\nexport const isHTMLContentEditableElement = (\n el: Element | null,\n): el is HTMLInputElement | HTMLTextAreaElement | HTMLElement => {\n if (el === null) {\n return false;\n }\n\n if (el.tagName === 'INPUT') {\n // @ts-expect-error: TS2339 за счёт `tagName` удовлетворяемся, что это `HTMLInputElement`\n return !nonTextInputTypes[el.type]; // prettier-ignore\n }\n\n return (\n el.tagName === 'TEXTAREA' ||\n // eslint-disable-next-line no-restricted-properties\n el.closest('[contenteditable=true]') !== null\n );\n};\n\nexport type VisualViewport = {\n offsetTop: number;\n offsetLeft: number;\n width: number;\n height: number;\n};\n\n/**\n * Фоллбек `visualViewport` для **Safari 12**.\n */\nexport function getVisualViewport(win: Window): VisualViewport {\n const result: VisualViewport = { offsetTop: 0, offsetLeft: 0, width: 0, height: 0 };\n if (win.visualViewport) {\n const { offsetTop, offsetLeft, width, height } = win.visualViewport;\n result.offsetTop = Math.round(offsetTop);\n result.offsetLeft = offsetLeft;\n result.width = width;\n result.height = Math.round(height);\n\n return result;\n }\n\n // TODO[Safari@>=13] Удалить фоллбек\n result.offsetTop = win.pageYOffset;\n result.offsetLeft = win.pageXOffset;\n result.width = win.innerWidth; // note: вызывает reflow в отличии от visualViewport\n result.height = win.innerHeight; // note: вызывает reflow в отличии от visualViewport\n return result;\n}\n\nexport const hasSelectionWithRangeType = (node: unknown) => {\n const selection = getWindow(node).getSelection();\n return selection ? selection.type === 'Range' : false;\n};\n\nexport function isSVGElement(value: unknown): value is SVGElement {\n if (!canUseDOM) {\n return false;\n }\n\n return value instanceof SVGElement || value instanceof getWindow(value).SVGElement;\n}\n"],"names":["React","canUseDOM","rectToClientRect","getParentNode","getWindow","isElement","isHTMLElement","isLastTraversableNode","isOverflowElement","getNodeScroll","canUseEventListeners","onDOMLoaded","getDOM","window","undefined","document","DOMContext","createContext","useDOM","useContext","isWindow","node","isBody","tagName","isDocumentElement","withDOM","Component","WithDOM","props","dom","blurActiveElement","activeElement","blur","TRANSFORM_DEFAULT_VALUES","WILL_CHANGE_DEFAULT_VALUES","getTransformedParentCoords","element","parentNode","transform","willChange","getComputedStyle","includes","x","y","getBoundingClientRect","isFixedStrategy","documentElement","clientRect","height","clientHeight","offsetX","offsetY","left","top","width","getRelativeBoundingClientRect","parent","child","parentRect","childRect","getNearestOverflowAncestor","terminalNode","getScrollHeight","scrollHeight","getScrollRect","scrollElRect","edgeTop","scrollY","edgeBottom","relative","edges","getDocumentBody","body","getActiveElementByAnotherElement","el","ownerDocument","contains","getFirstTouchEventData","event","dataRaw","resolveData","type","changedTouches","touches","screenX","screenY","clientX","clientY","pageX","pageY","process","env","NODE_ENV","initializeBrowserGesturePreventionEffect","options","passive","handleWindowTouchMove","preventDefault","stopPropagation","classList","add","addEventListener","dispose","remove","removeEventListener","nonTextInputTypes","button","submit","reset","color","file","image","checkbox","radio","isHTMLContentEditableElement","closest","getVisualViewport","win","result","offsetTop","offsetLeft","visualViewport","Math","round","pageYOffset","pageXOffset","innerWidth","innerHeight","hasSelectionWithRangeType","selection","getSelection","isSVGElement","value","SVGElement"],"mappings":"AAAA;;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SACEC,aAAa,EACbC,SAAS,EACTC,SAAS,EACTC,aAAa,EACbC,qBAAqB,EACrBC,iBAAiB,QACZ,wCAAwC;AAE/C,SACEJ,SAAS,EACTK,aAAa,EACbH,aAAa,EACbD,SAAS,EACTF,aAAa,QACR,wCAAwC;AAE/C,SAASF,SAAS,EAAES,oBAAoB,EAAEC,WAAW,QAAQ,kBAAkB;AAc/E,wCAAwC,GACxC,MAAMC,SAAS,IAA4B,CAAA;QACzCC,QAAQZ,YAAYY,SAASC;QAC7BC,UAAUd,YAAYc,WAAWD;IACnC,CAAA;AACA,uCAAuC,GAEvC,OAAO,MAAME,2BACXhB,MAAMiB,aAAa,CAAsBL,UAAU;AAErD,OAAO,MAAMM,SAAS;IACpB,OAAOlB,MAAMmB,UAAU,CAACH;AAC1B,EAAE;AAEF;;;CAGC,GACD,OAAO,MAAMI,WAAW,CACtBC;IAEA,OAAOA,SAAS,QAAQA,SAASP,aAAa,eAAeO;AAC/D,EAAE;AAEF,OAAO,MAAMC,SAAS,CACpBD;IAEA,OAAOA,SAAS,QAAQA,SAASP,aAAa,aAAaO,QAAQA,KAAKE,OAAO,KAAK;AACtF,EAAE;AAEF,OAAO,MAAMC,oBAAoB,CAC/BH;IAEA,OAAOA,SAAS,QAAQA,SAASP,aAAa,aAAaO,QAAQA,KAAKE,OAAO,KAAK;AACtF,EAAE;AAEF,OAAO,SAASE,QACdC,SAAgD;IAEhD,MAAMC,UAAU,CAACC;QACf,MAAMC,MAAMX;QACZ,qBAAO,KAACQ;YAAW,GAAGE,KAAK;YAAG,GAAGC,GAAG;;IACtC;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AAM,GAAG0E,KAAKC,KAAK,CAAC3E;QAE3B,OAAOsE;IACT;IAEA,oCAAoC;IACpCA,OAAOC,SAAS,GAAGF,IAAIO,WAAW;IAClCN,OAAOE,UAAU,GAAGH,IAAIQ,WAAW;IACnCP,OAAOhE,KAAK,GAAG+D,IAAIS,UAAU,EAAE,oDAAoD;IACnFR,OAAOtE,MAAM,GAAGqE,IAAIU,WAAW,EAAE,oDAAoD;IACrF,OAAOT;AACT;AAEA,OAAO,MAAMU,4BAA4B,CAAC3G;IACxC,MAAM4G,YAAY7H,UAAUiB,MAAM6G,YAAY;IAC9C,OAAOD,YAAYA,UAAUhD,IAAI,KAAK,UAAU;AAClD,EAAE;AAEF,OAAO,SAASkD,aAAaC,KAAc;IACzC,IAAI,CAACnI,WAAW;QACd,OAAO;IACT;IAEA,OAAOmI,iBAAiBC,cAAcD,iBAAiBhI,UAAUgI,OAAOC,UAAU;AACpF"}
1
+ {"version":3,"sources":["../../../src/lib/dom.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { canUseDOM } from '@vkontakte/vkjs';\nimport { rectToClientRect } from '@vkontakte/vkui-floating-ui/core';\nimport {\n getParentNode,\n getWindow,\n isElement,\n isHTMLElement,\n isLastTraversableNode,\n isOverflowElement,\n} from '@vkontakte/vkui-floating-ui/utils/dom';\n\nexport {\n getWindow,\n getNodeScroll,\n isHTMLElement,\n isElement,\n getParentNode,\n} from '@vkontakte/vkui-floating-ui/utils/dom';\n\nexport { canUseDOM, canUseEventListeners, onDOMLoaded } from '@vkontakte/vkjs';\nexport interface DOMContextInterface {\n /**\n * @ignore\n */\n window?: Window;\n /**\n * @ignore\n */\n document?: Document;\n}\n\nexport type DOMProps = DOMContextInterface;\n\n/* eslint-disable no-restricted-globals */\nconst getDOM = (): DOMContextInterface => ({\n window: canUseDOM ? window : undefined,\n document: canUseDOM ? document : undefined,\n});\n/* eslint-enable no-restricted-globals */\n\nexport const DOMContext: React.Context<DOMContextInterface> =\n React.createContext<DOMContextInterface>(getDOM());\n\nexport const useDOM = (): DOMContextInterface => {\n return React.useContext(DOMContext);\n};\n\n/**\n * В случае, если используется DOMContext, при проверке 'node instanceOf Window' – Window может быть\n * другим объектом.\n */\nexport const isWindow = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is Window => {\n return node !== null && node !== undefined && 'navigator' in node;\n};\n\nexport const isBody = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is HTMLBodyElement => {\n return node !== null && node !== undefined && 'tagName' in node && node.tagName === 'BODY';\n};\n\nexport const isDocumentElement = (\n node: Element | Window | VisualViewport | undefined | null,\n): node is HTMLHtmlElement => {\n return node !== null && node !== undefined && 'tagName' in node && node.tagName === 'HTML';\n};\n\nexport function withDOM<Props>(\n Component: React.ComponentType<Props & DOMProps>,\n): React.ComponentType<Props> {\n const WithDOM = (props: Props) => {\n const dom = useDOM();\n return <Component {...props} {...dom} />;\n };\n return WithDOM;\n}\n\nexport function blurActiveElement(document: Document | undefined): void {\n if (document && document.activeElement) {\n (document.activeElement as HTMLElement).blur();\n }\n}\n\nexport const TRANSFORM_DEFAULT_VALUES: string[] = ['none', 'initial', 'inherit', 'unset'];\nexport const WILL_CHANGE_DEFAULT_VALUES: string[] = ['auto', 'initial', 'inherit', 'unset'];\nexport function getTransformedParentCoords(element: Element): {\n x: number;\n y: number;\n} {\n let parentNode = element.parentNode;\n while (parentNode !== null) {\n if (isHTMLElement(parentNode)) {\n let { transform, willChange } = getComputedStyle(parentNode);\n if (transform === '') {\n transform = 'unset';\n }\n if (willChange === '') {\n willChange = 'unset';\n }\n if (\n !TRANSFORM_DEFAULT_VALUES.includes(transform) ||\n !WILL_CHANGE_DEFAULT_VALUES.includes(willChange)\n ) {\n const { x, y } = parentNode.getBoundingClientRect();\n return { x, y };\n }\n }\n parentNode = parentNode.parentNode;\n }\n return { x: 0, y: 0 };\n}\n\nexport const getBoundingClientRect = (node: Element | Window, isFixedStrategy = false) => {\n const element = isWindow(node) ? node.document.documentElement : node;\n const clientRect = element.getBoundingClientRect();\n\n if (isDocumentElement(element)) {\n /**\n * Если на странице не используется `html, body { height: 100% }` (или `height: 100vh`), то\n * `height`, полученный из `document.documentElement.getBoundingClientRect()`, будет возвращать\n * `scrollHeight`, а не `clientHeight`. Поэтому перебиваем `height` на `clientHeight`.\n */\n clientRect.height = element.clientHeight;\n }\n\n let offsetX = 0;\n let offsetY = 0;\n if (isFixedStrategy) {\n const { x, y } = getTransformedParentCoords(element);\n offsetX = x;\n offsetY = y;\n }\n\n return rectToClientRect({\n x: clientRect.left - offsetX,\n y: clientRect.top - offsetY,\n width: clientRect.width,\n height: clientRect.height,\n }) as DOMRect;\n};\n\nexport const getRelativeBoundingClientRect = (parent: Element, child: Element) => {\n const parentRect = getBoundingClientRect(parent);\n const childRect = getBoundingClientRect(child);\n return rectToClientRect({\n x: childRect.left - parentRect.left,\n y: childRect.top - parentRect.top,\n width: childRect.width,\n height: childRect.height,\n }) as DOMRect;\n};\n\n/**\n * Переписанный `getNearestOverflowAncestor` из @floating-ui/utils/dom.\n *\n * [1] добавляем ноду, на которой нужно остановить рекурсию\n * [2] document.body подменяем на window, т.к. на document.body нельзя применить скролл.\n *\n * @link https://github.com/floating-ui/floating-ui/blob/%40floating-ui/dom%401.6.3/packages/utils/src/dom.ts#L143\n */\nexport function getNearestOverflowAncestor(node: Node): HTMLElement | Window | null;\nexport function getNearestOverflowAncestor(node: Node, terminalNode: Node): HTMLElement | null;\nexport function getNearestOverflowAncestor(node: Node, terminalNode?: any): any {\n const parentNode = getParentNode(node);\n\n if (terminalNode === parentNode) {\n return null; /* [1] */\n }\n\n if (isLastTraversableNode(parentNode)) {\n return getWindow(parentNode); /* [2] */\n }\n\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n\n return getNearestOverflowAncestor(parentNode, terminalNode);\n}\n\nexport const getScrollHeight = (node: Element | Window): number => {\n return isWindow(node) ? node.document.documentElement.scrollHeight : node.scrollHeight;\n};\n\nexport const getScrollRect = (\n node: Element | Window,\n): {\n relative: DOMRect;\n edges: {\n y: [number, number];\n };\n} => {\n const window = isElement(node) ? getWindow(node) : node;\n const scrollElRect = getBoundingClientRect(node);\n\n const edgeTop = window.scrollY + scrollElRect.top;\n const edgeBottom = edgeTop + scrollElRect.height;\n const y: [number, number] = [edgeTop, edgeBottom];\n\n return {\n relative: scrollElRect,\n edges: { y },\n };\n};\n\nexport const getDocumentBody = (node?: any): HTMLElement => getWindow(node).document.body;\n\nexport const getActiveElementByAnotherElement = (el: Element | null): Element | null =>\n el ? el.ownerDocument.activeElement : null;\n\nexport const contains = (parent?: Element | null, child?: Element | null): boolean => {\n return parent && child ? parent.contains(child) : false;\n};\n\nexport const getFirstTouchEventData = (\n event: UIEvent | React.UIEvent<HTMLElement>,\n): {\n screenX: number;\n screenY: number;\n clientX: number;\n clientY: number;\n pageX: number;\n pageY: number;\n} => {\n let dataRaw = (function resolveData() {\n switch (event.type) {\n case 'touchend':\n return (event as TouchEvent).changedTouches[0];\n case 'touchstart':\n case 'touchmove':\n case 'touchcancel':\n return (event as TouchEvent).touches[0];\n case 'mousedown':\n case 'mousemove':\n case 'mouseup':\n case 'mouseleave':\n return event as MouseEvent;\n default:\n return { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0 };\n }\n })();\n /* istanbul ignore if */\n if (process.env.NODE_ENV === 'test') {\n dataRaw = dataRaw\n ? dataRaw\n : { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0 };\n }\n return {\n screenX: dataRaw.screenX || 0,\n screenY: dataRaw.screenY || 0,\n clientX: dataRaw.clientX || 0,\n clientY: dataRaw.clientY || 0,\n pageX: dataRaw.pageX || 0,\n pageY: dataRaw.pageY || 0,\n };\n};\n\n/**\n * ⚠️ В частности, необходимо для iOS 15. Начиная с этой версии в Safari добавили\n * pull-to-refresh. CSS св-во `overflow-behavior` появился только с iOS 16.\n *\n * Во вторую очередь, полезна блокированием скролла, чтобы пользователь дождался обновления\n * данных.\n */\nexport const initializeBrowserGesturePreventionEffect = (window: Window): VoidFunction => {\n const options: AddEventListenerOptions & EventListenerOptions = { passive: false };\n const handleWindowTouchMove = (event: TouchEvent) => {\n event.preventDefault();\n event.stopPropagation();\n };\n\n window.document.documentElement.classList.add('vkui--disable-overscroll-behavior'); // eslint-disable-line no-restricted-properties\n window.addEventListener('touchmove', handleWindowTouchMove, options);\n\n return function dispose() {\n window.document.documentElement.classList.remove('vkui--disable-overscroll-behavior'); // eslint-disable-line no-restricted-properties\n window.removeEventListener('touchmove', handleWindowTouchMove, options);\n };\n};\n\nconst nonTextInputTypes = {\n button: true,\n submit: true,\n reset: true,\n color: true,\n file: true,\n image: true,\n checkbox: true,\n radio: true,\n};\n\nexport const isHTMLContentEditableElement = (\n el: Element | null,\n): el is HTMLInputElement | HTMLTextAreaElement | HTMLElement => {\n if (el === null) {\n return false;\n }\n\n if (el.tagName === 'INPUT') {\n // @ts-expect-error: TS2339 за счёт `tagName` удовлетворяемся, что это `HTMLInputElement`\n return !nonTextInputTypes[el.type];\n }\n\n return (\n el.tagName === 'TEXTAREA' ||\n // eslint-disable-next-line no-restricted-properties\n el.closest('[contenteditable=true]') !== null\n );\n};\n\nexport type VisualViewport = {\n offsetTop: number;\n offsetLeft: number;\n width: number;\n height: number;\n};\n\n/**\n * Фоллбек `visualViewport` для **Safari 12**.\n */\nexport function getVisualViewport(win: Window): VisualViewport {\n const result: VisualViewport = { offsetTop: 0, offsetLeft: 0, width: 0, height: 0 };\n if (win.visualViewport) {\n const { offsetTop, offsetLeft, width, height } = win.visualViewport;\n result.offsetTop = Math.round(offsetTop);\n result.offsetLeft = offsetLeft;\n result.width = width;\n result.height = Math.round(height);\n\n return result;\n }\n\n // TODO[Safari@>=13] Удалить фоллбек\n result.offsetTop = win.pageYOffset;\n result.offsetLeft = win.pageXOffset;\n result.width = win.innerWidth; // note: вызывает reflow в отличии от visualViewport\n result.height = win.innerHeight; // note: вызывает reflow в отличии от visualViewport\n return result;\n}\n\nexport const hasSelectionWithRangeType = (node: unknown) => {\n const selection = getWindow(node).getSelection();\n return selection ? selection.type === 'Range' : false;\n};\n\nexport function isSVGElement(value: unknown): value is SVGElement {\n if (!canUseDOM) {\n return false;\n }\n\n return value instanceof SVGElement || value instanceof getWindow(value).SVGElement;\n}\n"],"names":["React","canUseDOM","rectToClientRect","getParentNode","getWindow","isElement","isHTMLElement","isLastTraversableNode","isOverflowElement","getNodeScroll","canUseEventListeners","onDOMLoaded","getDOM","window","undefined","document","DOMContext","createContext","useDOM","useContext","isWindow","node","isBody","tagName","isDocumentElement","withDOM","Component","WithDOM","props","dom","blurActiveElement","activeElement","blur","TRANSFORM_DEFAULT_VALUES","WILL_CHANGE_DEFAULT_VALUES","getTransformedParentCoords","element","parentNode","transform","willChange","getComputedStyle","includes","x","y","getBoundingClientRect","isFixedStrategy","documentElement","clientRect","height","clientHeight","offsetX","offsetY","left","top","width","getRelativeBoundingClientRect","parent","child","parentRect","childRect","getNearestOverflowAncestor","terminalNode","getScrollHeight","scrollHeight","getScrollRect","scrollElRect","edgeTop","scrollY","edgeBottom","relative","edges","getDocumentBody","body","getActiveElementByAnotherElement","el","ownerDocument","contains","getFirstTouchEventData","event","dataRaw","resolveData","type","changedTouches","touches","screenX","screenY","clientX","clientY","pageX","pageY","process","env","NODE_ENV","initializeBrowserGesturePreventionEffect","options","passive","handleWindowTouchMove","preventDefault","stopPropagation","classList","add","addEventListener","dispose","remove","removeEventListener","nonTextInputTypes","button","submit","reset","color","file","image","checkbox","radio","isHTMLContentEditableElement","closest","getVisualViewport","win","result","offsetTop","offsetLeft","visualViewport","Math","round","pageYOffset","pageXOffset","innerWidth","innerHeight","hasSelectionWithRangeType","selection","getSelection","isSVGElement","value","SVGElement"],"mappings":"AAAA;;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SACEC,aAAa,EACbC,S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BAA4B,CAAC3G;IACxC,MAAM4G,YAAY7H,UAAUiB,MAAM6G,YAAY;IAC9C,OAAOD,YAAYA,UAAUhD,IAAI,KAAK,UAAU;AAClD,EAAE;AAEF,OAAO,SAASkD,aAAaC,KAAc;IACzC,IAAI,CAACnI,WAAW;QACd,OAAO;IACT;IAEA,OAAOmI,iBAAiBC,cAAcD,iBAAiBhI,UAAUgI,OAAOC,UAAU;AACpF"}
@@ -202,7 +202,7 @@ export class BottomSheetController {
202
202
  return currentY === snapPointDetents[snapPointDetents.length - 1];
203
203
  }
204
204
  static getClosestSnapPointByDirection(snapPointDetents, currentY, direction) {
205
- const foundIndex = snapPointDetents.findIndex((i)=>i === currentY);
205
+ const foundIndex = snapPointDetents.indexOf(currentY);
206
206
  switch(direction){
207
207
  case -1:
208
208
  return snapPointDetents[foundIndex + 1] ?? snapPointDetents[snapPointDetents.length - 1];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/lib/sheet/controllers/BottomSheetController.ts"],"sourcesContent":["import { noop } from '@vkontakte/vkjs';\nimport { clamp } from '../../../helpers/math';\nimport { rubberbandIfOutOfBounds } from '../../animation';\nimport { getNearestOverflowAncestor, hasSelectionWithRangeType } from '../../dom';\nimport { UIPanGestureRecognizer } from '../../touch/UIPanGestureRecognizer';\nimport {\n BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY,\n DRAG_THRESHOLDS,\n DYNAMIC_SNAP_POINT_DATA,\n SNAP_POINT_DETENTS,\n} from '../constants';\nimport type { CSSTransitionController } from './CSSTransitionController';\n\nexport type SnapPointDetents = [number, number] | [number, number, number];\n\nexport type SnapPoint = 'auto' | { initial: number; detents: SnapPointDetents };\n\nexport type SnapPointChange = (snapPoint: number) => void;\n\nexport type BottomSheetControllerOptions = {\n sheetScrollEl: HTMLElement | null;\n sheetTransitionController: CSSTransitionController<string>;\n backdropTransitionController: CSSTransitionController | null;\n onSnapPointChange: SnapPointChange;\n onDismiss: VoidFunction;\n};\n\nexport class BottomSheetController {\n private readonly sheetEl: HTMLElement;\n\n constructor(\n sheetEl: HTMLElement,\n {\n sheetScrollEl,\n sheetTransitionController,\n backdropTransitionController,\n onSnapPointChange,\n onDismiss,\n }: BottomSheetControllerOptions,\n ) {\n this.sheetEl = sheetEl;\n this.onSnapPointChange = onSnapPointChange;\n this.onDismiss = onDismiss;\n this.panGestureRecognizer = new UIPanGestureRecognizer();\n this.sheetScrollEl = sheetScrollEl;\n this.sheetTransitionController = sheetTransitionController;\n this.backdropTransitionController = backdropTransitionController;\n }\n\n init(snapPoint: SnapPoint) {\n this.isInitialized = true;\n\n if (snapPoint === 'auto') {\n this.unit = 'px';\n this.currentSnapPoint = DYNAMIC_SNAP_POINT_DATA.IDLE_POINT_VALUE;\n this.snapPointDetents = [SNAP_POINT_DETENTS.MIN, DYNAMIC_SNAP_POINT_DATA.IDLE_POINT_VALUE];\n } else {\n this.unit = '%';\n this.currentSnapPoint = snapPoint.initial;\n this.snapPointDetents = snapPoint.detents;\n }\n }\n\n destroy() {\n this.isInitialized = false;\n this.pannedEl = null;\n this.sheetTransitionController.cleanup();\n this.backdropTransitionController?.cleanup();\n\n this.disableVerticalScrollBouncingDispose();\n this.disableVerticalScrollBouncingDispose = noop;\n }\n\n panStart(event: UIEvent) {\n if (\n !this.isInitialized ||\n this.panState !== 'idle' ||\n hasSelectionWithRangeType(event.target)\n ) {\n return;\n }\n\n this.panState = 'start';\n this.pannedEl = event.target as HTMLElement;\n this.panGestureRecognizer.setStartCoords(event);\n }\n\n panMove(event: UIEvent) {\n switch (this.panState) {\n case 'start':\n this.panGestureRecognizer.setInitialTimeOnce();\n this.panGestureRecognizer.setEndCoords(event);\n\n if (this.preventUntilPanGestureBecomesExpected()) {\n return;\n }\n\n if (this.preventImmediatelyIfPannedElIsNotValid()) {\n this.panState = 'idle';\n return;\n }\n\n if (this.preventUntilVerticalScrollingOnSheetScrollElBecomesExpected()) {\n return;\n }\n\n if (this.preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled()) {\n this.panState = 'idle';\n return;\n }\n\n this.panState = 'moving';\n this.panGestureRecognizer.setStartCoords(event);\n\n this.sheetHeight = this.sheetEl.offsetHeight;\n\n this.disableVerticalScrollBouncingDispose =\n BottomSheetController.disableVerticalScrollBouncingIfNeeded(\n this.sheetScrollEl,\n this.pannedEl,\n );\n\n if (this.isDynamicSnapPoint) {\n this.currentSnapPoint = this.sheetHeight;\n this.snapPointDetents[DYNAMIC_SNAP_POINT_DATA.COMPUTED_INDEX] = this.sheetHeight;\n }\n break;\n case 'moving':\n this.panGestureRecognizer.setEndCoords(event);\n\n const { y1, y2 } = this.panGestureRecognizer;\n\n this.nextSnapPoint = rubberbandIfOutOfBounds(\n this.currentSnapPoint - ((y2 - y1) / this.sheetHeight) * this.currentSnapPoint,\n SNAP_POINT_DETENTS.MIN,\n this.isDynamicSnapPoint ? this.sheetHeight : SNAP_POINT_DETENTS.LARGE,\n );\n\n this.calculateSnapPoint(this.nextSnapPoint, true);\n break;\n }\n }\n\n panEnd() {\n switch (this.panState) {\n case 'moving':\n const prevCurrentSnapPoint = this.currentSnapPoint;\n this.currentSnapPoint = this.getSnapPointTo(this.nextSnapPoint);\n\n if (\n prevCurrentSnapPoint !== this.currentSnapPoint &&\n this.currentSnapPoint > SNAP_POINT_DETENTS.MIN\n ) {\n this.onSnapPointChange(this.currentSnapPoint);\n }\n\n this.calculateSnapPoint(this.currentSnapPoint);\n break;\n }\n\n this.panState = 'idle';\n this.panGestureRecognizer.reset();\n\n this.disableVerticalScrollBouncingDispose();\n this.disableVerticalScrollBouncingDispose = noop;\n }\n\n private isInitialized = false;\n private panState: 'idle' | 'start' | 'moving' = 'idle';\n private pannedEl: HTMLElement | null = null;\n private sheetHeight = 0;\n private rafId: number | null = null;\n private currentSnapPoint = 0;\n private nextSnapPoint = 0;\n private snapPointDetents: SnapPointDetents = [0, 0];\n private unit: 'px' | '%' = '%';\n private get isDynamicSnapPoint() {\n return this.unit === 'px';\n }\n private disableVerticalScrollBouncingDispose = noop;\n private readonly sheetScrollEl: HTMLElement | null;\n private readonly sheetTransitionController: CSSTransitionController<string>;\n private readonly backdropTransitionController: CSSTransitionController | null;\n private readonly panGestureRecognizer: UIPanGestureRecognizer;\n private readonly onSnapPointChange: SnapPointChange;\n private readonly onDismiss: VoidFunction;\n\n private calculateSnapPoint(nextSnapPoint: number, immediately = false) {\n if (this.rafId !== null) {\n cancelAnimationFrame(this.rafId);\n }\n\n if (nextSnapPoint <= SNAP_POINT_DETENTS.MIN) {\n this.sheetTransitionController.enableTransition();\n this.backdropTransitionController?.enableTransition();\n this.panState = 'idle';\n this.onDismiss();\n return;\n }\n\n const backdropOpacity = clamp(\n this.isDynamicSnapPoint\n ? nextSnapPoint / this.sheetHeight\n : (nextSnapPoint * 2) / SNAP_POINT_DETENTS.LARGE,\n 0,\n 1,\n );\n\n this.rafId = requestAnimationFrame(() => {\n if (immediately) {\n this.backdropTransitionController?.disableTransition().set(backdropOpacity);\n this.sheetTransitionController.disableTransition().set(`${nextSnapPoint}${this.unit}`);\n return;\n }\n\n if (this.isDynamicSnapPoint) {\n this.sheetTransitionController.cleanupOnTransitionEnd();\n }\n\n this.backdropTransitionController?.unset();\n this.sheetTransitionController.enableTransition().set(`${this.currentSnapPoint}${this.unit}`);\n });\n }\n\n private getSnapPointTo(nextSnapPoint: number) {\n const closestSnapPoint = BottomSheetController.getClosestSnapPoint(\n this.snapPointDetents,\n nextSnapPoint,\n );\n if (closestSnapPoint !== this.currentSnapPoint) {\n return closestSnapPoint;\n }\n\n const panDirection = this.panGestureRecognizer.direction();\n if (panDirection.axis !== 'y' || panDirection.direction === null) {\n return this.currentSnapPoint;\n }\n\n const velocity = this.panGestureRecognizer.velocity();\n if (Math.abs(velocity.y) < DRAG_THRESHOLDS.VELOCITY) {\n return this.currentSnapPoint;\n }\n\n const closestSnapPointByDirection = BottomSheetController.getClosestSnapPointByDirection(\n this.snapPointDetents,\n closestSnapPoint,\n panDirection.direction,\n );\n\n return closestSnapPointByDirection;\n }\n\n private preventUntilPanGestureBecomesExpected() {\n return (\n this.panGestureRecognizer.direction().axis === 'x' ||\n this.panGestureRecognizer.distance() < DRAG_THRESHOLDS.DISTANCE_FOR_MOVING_START\n );\n }\n\n private preventImmediatelyIfPannedElIsNotValid() {\n return (\n this.pannedEl === null ||\n // Элемент со специальным атрибутом\n this.pannedEl.closest(`[${BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY}=true]`) !== null || // eslint-disable-line no-restricted-properties\n // Элемент за пределами панели.\n !this.sheetEl.contains(this.pannedEl)\n );\n }\n\n private preventUntilVerticalScrollingOnSheetScrollElBecomesExpected() {\n if (\n this.sheetScrollEl === null ||\n !this.sheetScrollEl.contains(this.pannedEl) ||\n this.sheetScrollEl.scrollHeight <= this.sheetScrollEl.clientHeight\n ) {\n return false;\n }\n\n if (this.sheetScrollEl.scrollTop === 0) {\n return (\n this.panGestureRecognizer.direction().direction === -1 &&\n BottomSheetController.isLastSnapPointDetents(this.snapPointDetents, this.currentSnapPoint)\n );\n }\n\n return true;\n }\n\n private preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled() {\n if (\n /* istanbul ignore next: покрываем TypeScript */\n this.pannedEl === null ||\n this.pannedEl === this.sheetEl ||\n this.pannedEl === this.sheetScrollEl\n ) {\n return false;\n }\n\n const overflowAncestor = getNearestOverflowAncestor(this.pannedEl, this.sheetEl);\n\n if (\n overflowAncestor === null ||\n this.sheetScrollEl === overflowAncestor ||\n overflowAncestor.scrollHeight <= overflowAncestor.clientHeight\n ) {\n return false;\n }\n\n return (\n overflowAncestor.scrollTop !== 0 || this.panGestureRecognizer.direction().direction === -1\n );\n }\n\n private static disableVerticalScrollBouncingIfNeeded(\n sheetScrollEl: HTMLElement | null,\n targetEl: HTMLElement | null,\n ) {\n if (\n sheetScrollEl !== null &&\n sheetScrollEl.scrollTop <= 0 &&\n sheetScrollEl.contains(targetEl) &&\n sheetScrollEl.scrollHeight > sheetScrollEl.clientHeight\n ) {\n sheetScrollEl.style.setProperty('overflow-y', 'hidden');\n return function dispose() {\n sheetScrollEl.style.removeProperty('overflow-y');\n };\n }\n return noop;\n }\n\n private static isLastSnapPointDetents(\n snapPointDetents: SnapPointDetents,\n currentY: number,\n ): boolean {\n return currentY === snapPointDetents[snapPointDetents.length - 1];\n }\n\n private static getClosestSnapPointByDirection(\n snapPointDetents: SnapPointDetents,\n currentY: number,\n direction: -1 | 1,\n ): number {\n const foundIndex = snapPointDetents.findIndex((i) => i === currentY);\n switch (direction) {\n case -1:\n return snapPointDetents[foundIndex + 1] ?? snapPointDetents[snapPointDetents.length - 1];\n case 1:\n return snapPointDetents[foundIndex - 1] ?? snapPointDetents[0];\n }\n }\n\n private static getClosestSnapPoint(snapPointDetents: SnapPointDetents, currentY: number) {\n let closest = snapPointDetents[0];\n let minDifference = Math.abs(snapPointDetents[0] - currentY);\n\n for (let i = 1; i < snapPointDetents.length; i += 1) {\n const difference = Math.abs(snapPointDetents[i] - currentY);\n if (difference < minDifference) {\n closest = snapPointDetents[i];\n minDifference = difference;\n }\n }\n\n return closest;\n }\n}\n"],"names":["noop","clamp","rubberbandIfOutOfBounds","getNearestOverflowAncestor","hasSelectionWithRangeType","UIPanGestureRecognizer","BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY","DRAG_THRESHOLDS","DYNAMIC_SNAP_POINT_DATA","SNAP_POINT_DETENTS","BottomSheetController","sheetEl","sheetScrollEl","sheetTransitionController","backdropTransitionController","onSnapPointChange","onDismiss","panGestureRecognizer","init","snapPoint","isInitialized","unit","currentSnapPoint","IDLE_POINT_VALUE","snapPointDetents","MIN","initial","detents","destroy","pannedEl","cleanup","disableVerticalScrollBouncingDispose","panStart","event","panState","target","setStartCoords","panMove","setInitialTimeOnce","setEndCoords","preventUntilPanGestureBecomesExpected","preventImmediatelyIfPannedElIsNotValid","preventUntilVerticalScrollingOnSheetScrollElBecomesExpected","preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled","sheetHeight","offsetHeight","disableVerticalScrollBouncingIfNeeded","isDynamicSnapPoint","COMPUTED_INDEX","y1","y2","nextSnapPoint","LARGE","calculateSnapPoint","panEnd","prevCurrentSnapPoint","getSnapPointTo","reset","rafId","immediately","cancelAnimationFrame","enableTransition","backdropOpacity","requestAnimationFrame","disableTransition","set","cleanupOnTransitionEnd","unset","closestSnapPoint","getClosestSnapPoint","panDirection","direction","axis","velocity","Math","abs","y","VELOCITY","closestSnapPointByDirection","getClosestSnapPointByDirection","distance","DISTANCE_FOR_MOVING_START","closest","contains","scrollHeight","clientHeight","scrollTop","isLastSnapPointDetents","overflowAncestor","targetEl","style","setProperty","dispose","removeProperty","currentY","length","foundIndex","findIndex","i","minDifference","difference"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SAASC,uBAAuB,QAAQ,2BAAkB;AAC1D,SAASC,0BAA0B,EAAEC,yBAAyB,QAAQ,eAAY;AAClF,SAASC,sBAAsB,QAAQ,wCAAqC;AAC5E,SACEC,uCAAuC,EACvCC,eAAe,EACfC,uBAAuB,EACvBC,kBAAkB,QACb,kBAAe;AAiBtB,OAAO,MAAMC;IACMC,QAAqB;IAEtC,YACEA,OAAoB,EACpB,EACEC,aAAa,EACbC,yBAAyB,EACzBC,4BAA4B,EAC5BC,iBAAiB,EACjBC,SAAS,EACoB,CAC/B;QACA,IAAI,CAACL,OAAO,GAAGA;QACf,IAAI,CAACI,iBAAiB,GAAGA;QACzB,IAAI,CAACC,SAAS,GAAGA;QACjB,IAAI,CAACC,oBAAoB,GAAG,IAAIZ;QAChC,IAAI,CAACO,aAAa,GAAGA;QACrB,IAAI,CAACC,yBAAyB,GAAGA;QACjC,IAAI,CAACC,4BAA4B,GAAGA;IACtC;IAEAI,KAAKC,SAAoB,EAAE;QACzB,IAAI,CAACC,aAAa,GAAG;QAErB,IAAID,cAAc,QAAQ;YACxB,IAAI,CAACE,IAAI,GAAG;YACZ,IA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etController.ts"],"sourcesContent":["import { noop } from '@vkontakte/vkjs';\nimport { clamp } from '../../../helpers/math';\nimport { rubberbandIfOutOfBounds } from '../../animation';\nimport { getNearestOverflowAncestor, hasSelectionWithRangeType } from '../../dom';\nimport { UIPanGestureRecognizer } from '../../touch/UIPanGestureRecognizer';\nimport {\n BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY,\n DRAG_THRESHOLDS,\n DYNAMIC_SNAP_POINT_DATA,\n SNAP_POINT_DETENTS,\n} from '../constants';\nimport type { CSSTransitionController } from './CSSTransitionController';\n\nexport type SnapPointDetents = [number, number] | [number, number, number];\n\nexport type SnapPoint = 'auto' | { initial: number; detents: SnapPointDetents };\n\nexport type SnapPointChange = (snapPoint: number) => void;\n\nexport type BottomSheetControllerOptions = {\n sheetScrollEl: HTMLElement | null;\n sheetTransitionController: CSSTransitionController<string>;\n backdropTransitionController: CSSTransitionController | null;\n onSnapPointChange: SnapPointChange;\n onDismiss: VoidFunction;\n};\n\nexport class BottomSheetController {\n private readonly sheetEl: HTMLElement;\n\n constructor(\n sheetEl: HTMLElement,\n {\n sheetScrollEl,\n sheetTransitionController,\n backdropTransitionController,\n onSnapPointChange,\n onDismiss,\n }: BottomSheetControllerOptions,\n ) {\n this.sheetEl = sheetEl;\n this.onSnapPointChange = onSnapPointChange;\n this.onDismiss = onDismiss;\n this.panGestureRecognizer = new UIPanGestureRecognizer();\n this.sheetScrollEl = sheetScrollEl;\n this.sheetTransitionController = sheetTransitionController;\n this.backdropTransitionController = backdropTransitionController;\n }\n\n init(snapPoint: SnapPoint) {\n this.isInitialized = true;\n\n if (snapPoint === 'auto') {\n this.unit = 'px';\n this.currentSnapPoint = DYNAMIC_SNAP_POINT_DATA.IDLE_POINT_VALUE;\n this.snapPointDetents = [SNAP_POINT_DETENTS.MIN, DYNAMIC_SNAP_POINT_DATA.IDLE_POINT_VALUE];\n } else {\n this.unit = '%';\n this.currentSnapPoint = snapPoint.initial;\n this.snapPointDetents = snapPoint.detents;\n }\n }\n\n destroy() {\n this.isInitialized = false;\n this.pannedEl = null;\n this.sheetTransitionController.cleanup();\n this.backdropTransitionController?.cleanup();\n\n this.disableVerticalScrollBouncingDispose();\n this.disableVerticalScrollBouncingDispose = noop;\n }\n\n panStart(event: UIEvent) {\n if (\n !this.isInitialized ||\n this.panState !== 'idle' ||\n hasSelectionWithRangeType(event.target)\n ) {\n return;\n }\n\n this.panState = 'start';\n this.pannedEl = event.target as HTMLElement;\n this.panGestureRecognizer.setStartCoords(event);\n }\n\n panMove(event: UIEvent) {\n switch (this.panState) {\n case 'start':\n this.panGestureRecognizer.setInitialTimeOnce();\n this.panGestureRecognizer.setEndCoords(event);\n\n if (this.preventUntilPanGestureBecomesExpected()) {\n return;\n }\n\n if (this.preventImmediatelyIfPannedElIsNotValid()) {\n this.panState = 'idle';\n return;\n }\n\n if (this.preventUntilVerticalScrollingOnSheetScrollElBecomesExpected()) {\n return;\n }\n\n if (this.preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled()) {\n this.panState = 'idle';\n return;\n }\n\n this.panState = 'moving';\n this.panGestureRecognizer.setStartCoords(event);\n\n this.sheetHeight = this.sheetEl.offsetHeight;\n\n this.disableVerticalScrollBouncingDispose =\n BottomSheetController.disableVerticalScrollBouncingIfNeeded(\n this.sheetScrollEl,\n this.pannedEl,\n );\n\n if (this.isDynamicSnapPoint) {\n this.currentSnapPoint = this.sheetHeight;\n this.snapPointDetents[DYNAMIC_SNAP_POINT_DATA.COMPUTED_INDEX] = this.sheetHeight;\n }\n break;\n case 'moving':\n this.panGestureRecognizer.setEndCoords(event);\n\n const { y1, y2 } = this.panGestureRecognizer;\n\n this.nextSnapPoint = rubberbandIfOutOfBounds(\n this.currentSnapPoint - ((y2 - y1) / this.sheetHeight) * this.currentSnapPoint,\n SNAP_POINT_DETENTS.MIN,\n this.isDynamicSnapPoint ? this.sheetHeight : SNAP_POINT_DETENTS.LARGE,\n );\n\n this.calculateSnapPoint(this.nextSnapPoint, true);\n break;\n }\n }\n\n panEnd() {\n switch (this.panState) {\n case 'moving':\n const prevCurrentSnapPoint = this.currentSnapPoint;\n this.currentSnapPoint = this.getSnapPointTo(this.nextSnapPoint);\n\n if (\n prevCurrentSnapPoint !== this.currentSnapPoint &&\n this.currentSnapPoint > SNAP_POINT_DETENTS.MIN\n ) {\n this.onSnapPointChange(this.currentSnapPoint);\n }\n\n this.calculateSnapPoint(this.currentSnapPoint);\n break;\n }\n\n this.panState = 'idle';\n this.panGestureRecognizer.reset();\n\n this.disableVerticalScrollBouncingDispose();\n this.disableVerticalScrollBouncingDispose = noop;\n }\n\n private isInitialized = false;\n private panState: 'idle' | 'start' | 'moving' = 'idle';\n private pannedEl: HTMLElement | null = null;\n private sheetHeight = 0;\n private rafId: number | null = null;\n private currentSnapPoint = 0;\n private nextSnapPoint = 0;\n private snapPointDetents: SnapPointDetents = [0, 0];\n private unit: 'px' | '%' = '%';\n private get isDynamicSnapPoint() {\n return this.unit === 'px';\n }\n private disableVerticalScrollBouncingDispose = noop;\n private readonly sheetScrollEl: HTMLElement | null;\n private readonly sheetTransitionController: CSSTransitionController<string>;\n private readonly backdropTransitionController: CSSTransitionController | null;\n private readonly panGestureRecognizer: UIPanGestureRecognizer;\n private readonly onSnapPointChange: SnapPointChange;\n private readonly onDismiss: VoidFunction;\n\n private calculateSnapPoint(nextSnapPoint: number, immediately = false) {\n if (this.rafId !== null) {\n cancelAnimationFrame(this.rafId);\n }\n\n if (nextSnapPoint <= SNAP_POINT_DETENTS.MIN) {\n this.sheetTransitionController.enableTransition();\n this.backdropTransitionController?.enableTransition();\n this.panState = 'idle';\n this.onDismiss();\n return;\n }\n\n const backdropOpacity = clamp(\n this.isDynamicSnapPoint\n ? nextSnapPoint / this.sheetHeight\n : (nextSnapPoint * 2) / SNAP_POINT_DETENTS.LARGE,\n 0,\n 1,\n );\n\n this.rafId = requestAnimationFrame(() => {\n if (immediately) {\n this.backdropTransitionController?.disableTransition().set(backdropOpacity);\n this.sheetTransitionController.disableTransition().set(`${nextSnapPoint}${this.unit}`);\n return;\n }\n\n if (this.isDynamicSnapPoint) {\n this.sheetTransitionController.cleanupOnTransitionEnd();\n }\n\n this.backdropTransitionController?.unset();\n this.sheetTransitionController.enableTransition().set(`${this.currentSnapPoint}${this.unit}`);\n });\n }\n\n private getSnapPointTo(nextSnapPoint: number) {\n const closestSnapPoint = BottomSheetController.getClosestSnapPoint(\n this.snapPointDetents,\n nextSnapPoint,\n );\n if (closestSnapPoint !== this.currentSnapPoint) {\n return closestSnapPoint;\n }\n\n const panDirection = this.panGestureRecognizer.direction();\n if (panDirection.axis !== 'y' || panDirection.direction === null) {\n return this.currentSnapPoint;\n }\n\n const velocity = this.panGestureRecognizer.velocity();\n if (Math.abs(velocity.y) < DRAG_THRESHOLDS.VELOCITY) {\n return this.currentSnapPoint;\n }\n\n const closestSnapPointByDirection = BottomSheetController.getClosestSnapPointByDirection(\n this.snapPointDetents,\n closestSnapPoint,\n panDirection.direction,\n );\n\n return closestSnapPointByDirection;\n }\n\n private preventUntilPanGestureBecomesExpected() {\n return (\n this.panGestureRecognizer.direction().axis === 'x' ||\n this.panGestureRecognizer.distance() < DRAG_THRESHOLDS.DISTANCE_FOR_MOVING_START\n );\n }\n\n private preventImmediatelyIfPannedElIsNotValid() {\n return (\n this.pannedEl === null ||\n // Элемент со специальным атрибутом\n this.pannedEl.closest(`[${BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY}=true]`) !== null || // eslint-disable-line no-restricted-properties\n // Элемент за пределами панели.\n !this.sheetEl.contains(this.pannedEl)\n );\n }\n\n private preventUntilVerticalScrollingOnSheetScrollElBecomesExpected() {\n if (\n this.sheetScrollEl === null ||\n !this.sheetScrollEl.contains(this.pannedEl) ||\n this.sheetScrollEl.scrollHeight <= this.sheetScrollEl.clientHeight\n ) {\n return false;\n }\n\n if (this.sheetScrollEl.scrollTop === 0) {\n return (\n this.panGestureRecognizer.direction().direction === -1 &&\n BottomSheetController.isLastSnapPointDetents(this.snapPointDetents, this.currentSnapPoint)\n );\n }\n\n return true;\n }\n\n private preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled() {\n if (\n /* istanbul ignore next: покрываем TypeScript */\n this.pannedEl === null ||\n this.pannedEl === this.sheetEl ||\n this.pannedEl === this.sheetScrollEl\n ) {\n return false;\n }\n\n const overflowAncestor = getNearestOverflowAncestor(this.pannedEl, this.sheetEl);\n\n if (\n overflowAncestor === null ||\n this.sheetScrollEl === overflowAncestor ||\n overflowAncestor.scrollHeight <= overflowAncestor.clientHeight\n ) {\n return false;\n }\n\n return (\n overflowAncestor.scrollTop !== 0 || this.panGestureRecognizer.direction().direction === -1\n );\n }\n\n private static disableVerticalScrollBouncingIfNeeded(\n sheetScrollEl: HTMLElement | null,\n targetEl: HTMLElement | null,\n ) {\n if (\n sheetScrollEl !== null &&\n sheetScrollEl.scrollTop <= 0 &&\n sheetScrollEl.contains(targetEl) &&\n sheetScrollEl.scrollHeight > sheetScrollEl.clientHeight\n ) {\n sheetScrollEl.style.setProperty('overflow-y', 'hidden');\n return function dispose() {\n sheetScrollEl.style.removeProperty('overflow-y');\n };\n }\n return noop;\n }\n\n private static isLastSnapPointDetents(\n snapPointDetents: SnapPointDetents,\n currentY: number,\n ): boolean {\n return currentY === snapPointDetents[snapPointDetents.length - 1];\n }\n\n private static getClosestSnapPointByDirection(\n snapPointDetents: SnapPointDetents,\n currentY: number,\n direction: -1 | 1,\n ): number {\n const foundIndex = snapPointDetents.indexOf(currentY);\n switch (direction) {\n case -1:\n return snapPointDetents[foundIndex + 1] ?? snapPointDetents[snapPointDetents.length - 1];\n case 1:\n return snapPointDetents[foundIndex - 1] ?? snapPointDetents[0];\n }\n }\n\n private static getClosestSnapPoint(snapPointDetents: SnapPointDetents, currentY: number) {\n let closest = snapPointDetents[0];\n let minDifference = Math.abs(snapPointDetents[0] - currentY);\n\n for (let i = 1; i < snapPointDetents.length; i += 1) {\n const difference = Math.abs(snapPointDetents[i] - currentY);\n if (difference < minDifference) {\n closest = snapPointDetents[i];\n minDifference = difference;\n }\n }\n\n return closest;\n }\n}\n"],"names":["noop","clamp","rubberbandIfOutOfBounds","getNearestOverflowAncestor","hasSelectionWithRangeType","UIPanGestureRecognizer","BLOCK_SHEET_BEHAVIOR_DATA_ATTRIBUTE_KEY","DRAG_THRESHOLDS","DYNAMIC_SNAP_POINT_DATA","SNAP_POINT_DETENTS","BottomSheetController","sheetEl","sheetScrollEl","sheetTransitionController","backdropTransitionController","onSnapPointChange","onDismiss","panGestureRecognizer","init","snapPoint","isInitialized","unit","currentSnapPoint","IDLE_POINT_VALUE","snapPointDetents","MIN","initial","detents","destroy","pannedEl","cleanup","disableVerticalScrollBouncingDispose","panStart","event","panState","target","setStartCoords","panMove","setInitialTimeOnce","setEndCoords","preventUntilPanGestureBecomesExpected","preventImmediatelyIfPannedElIsNotValid","preventUntilVerticalScrollingOnSheetScrollElBecomesExpected","preventImmediatelyIfVerticalScrollingOnPannedElIsScrolled","sheetHeight","offsetHeight","disableVerticalScrollBouncingIfNeeded","isDynamicSnapPoint","COMPUTED_INDEX","y1","y2","nextSnapPoint","LARGE","calculateSnapPoint","panEnd","prevCurrentSnapPoint","getSnapPointTo","reset","rafId","immediately","cancelAnimationFrame","enableTransition","backdropOpacity","requestAnimationFrame","disableTransition","set","cleanupOnTransitionEnd","unset","closestSnapPoint","getClosestSnapPoint","panDirection","direction","axis","velocity","Math","abs","y","VELOCITY","closestSnapPointByDirection","getClosestSnapPointByDirection","distance","DISTANCE_FOR_MOVING_START","closest","contains","scrollHeight","clientHeight","scrollTop","isLastSnapPointDetents","overflowAncestor","targetEl","style","setProperty","dispose","removeProperty","currentY","length","foundIndex","indexOf","minDifference","i","difference"],"mappings":"AAAA,SAASA,IAAI,QAAQ,kBAAkB;AACvC,SAASC,KAAK,QAAQ,2BAAwB;AAC9C,SAASC,uBAAuB,QAAQ,2BAAkB;AAC1D,SAASC,0BAA0B,EAAEC,yBAAyB,QAAQ,eAAY;AAClF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EAAE;YAC1F,KAAK;gBACH,OAAOvE,gBAAgB,CAACwE,aAAa,EAAE,IAAIxE,gBAAgB,CAAC,EAAE;QAClE;IACF;IAEA,OAAe6C,oBAAoB7C,gBAAkC,EAAEsE,QAAgB,EAAE;QACvF,IAAIZ,UAAU1D,gBAAgB,CAAC,EAAE;QACjC,IAAI0E,gBAAgBxB,KAAKC,GAAG,CAACnD,gBAAgB,CAAC,EAAE,GAAGsE;QAEnD,IAAK,IAAIK,IAAI,GAAGA,IAAI3E,iBAAiBuE,MAAM,EAAEI,KAAK,EAAG;YACnD,MAAMC,aAAa1B,KAAKC,GAAG,CAACnD,gBAAgB,CAAC2E,EAAE,GAAGL;YAClD,IAAIM,aAAaF,eAAe;gBAC9BhB,UAAU1D,gBAAgB,CAAC2E,EAAE;gBAC7BD,gBAAgBE;YAClB;QACF;QAEA,OAAOlB;IACT;AACF"}
@@ -5,7 +5,8 @@
5
5
  --vkui_internal--grid_avatar_image_offset: 2px;
6
6
  --vkui_internal--slider_thumb_size: 28px;
7
7
  --vkui_internal--side_cell_gap: calc(
8
- var(--vkui--size_base_padding_horizontal--regular) - var(--vkui--spacing_size_s)
8
+ var(--vkui--size_base_padding_horizontal--regular) -
9
+ var(--vkui--spacing_size_s)
9
10
  );
10
11
  --vkui_internal--panel_header_height: var(--vkui--size_panel_header_height--regular);
11
12