@consta/uikit 5.25.1 → 5.27.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 (229) hide show
  1. package/FlatSelect/index.d.ts +1 -0
  2. package/FlatSelect/index.js +1 -0
  3. package/__internal__/src/components/Banner/Banner.d.ts +20 -8
  4. package/__internal__/src/components/Banner/Banner.js +1 -1
  5. package/__internal__/src/components/Banner/Banner.js.map +1 -1
  6. package/__internal__/src/components/Combobox/Combobox.js +1 -1
  7. package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
  8. package/__internal__/src/components/ContextMenu/ContextMenu.js +1 -1
  9. package/__internal__/src/components/ContextMenu/ContextMenu.js.map +1 -1
  10. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.d.ts +2 -2
  11. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js +1 -1
  12. package/__internal__/src/components/ContextMenu/ContextMenuLevels/ContextMenuLevels.js.map +1 -1
  13. package/__internal__/src/components/ContextMenu/helpers.d.ts +2 -2
  14. package/__internal__/src/components/ContextMenu/types.d.ts +5 -5
  15. package/__internal__/src/components/ContextMenu/types.js.map +1 -1
  16. package/__internal__/src/components/FieldComponents/FieldButton/FieldButton.d.ts +1 -1
  17. package/__internal__/src/components/FieldComponents/FieldButton/FieldButton.js.map +1 -1
  18. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.d.ts +1 -0
  19. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.js +1 -1
  20. package/__internal__/src/components/FieldComponents/FieldClearButton/FieldClearButton.js.map +1 -1
  21. package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js +1 -1
  22. package/__internal__/src/components/FieldComponents/FieldWrapper/FieldWrapper.js.map +1 -1
  23. package/__internal__/src/components/FieldComponents/FieldWrapper/types.d.ts +1 -0
  24. package/__internal__/src/components/FieldComponents/FieldWrapper/types.js.map +1 -1
  25. package/__internal__/src/components/FlatSelect/FlatSelect.css +9 -0
  26. package/__internal__/src/components/FlatSelect/FlatSelect.d.ts +4 -0
  27. package/__internal__/src/components/FlatSelect/FlatSelect.js +2 -0
  28. package/__internal__/src/components/FlatSelect/FlatSelect.js.map +1 -0
  29. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.d.ts +16 -0
  30. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.js +2 -0
  31. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/FlatSelectControlLayout.js.map +1 -0
  32. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.d.ts +1 -0
  33. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.js +2 -0
  34. package/__internal__/src/components/FlatSelect/FlatSelectControlLayout/index.js.map +1 -0
  35. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.css +1 -0
  36. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.d.ts +19 -0
  37. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.js +2 -0
  38. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/FlatSelectCreateButton.js.map +1 -0
  39. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.d.ts +1 -0
  40. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.js +2 -0
  41. package/__internal__/src/components/FlatSelect/FlatSelectCreateButton/index.js.map +1 -0
  42. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.css +1 -0
  43. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.d.ts +12 -0
  44. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.js +2 -0
  45. package/__internal__/src/components/FlatSelect/FlatSelectFooter/FlatSelectFooter.js.map +1 -0
  46. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.d.ts +1 -0
  47. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.js +2 -0
  48. package/__internal__/src/components/FlatSelect/FlatSelectFooter/index.js.map +1 -0
  49. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.d.ts +10 -0
  50. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.js +2 -0
  51. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/FlatSelectGroupLabel.js.map +1 -0
  52. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.d.ts +1 -0
  53. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.js +2 -0
  54. package/__internal__/src/components/FlatSelect/FlatSelectGroupLabel/index.js.map +1 -0
  55. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.css +1 -0
  56. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.d.ts +17 -0
  57. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.js +2 -0
  58. package/__internal__/src/components/FlatSelect/FlatSelectItem/FlatSelectItem.js.map +1 -0
  59. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.d.ts +1 -0
  60. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.js +2 -0
  61. package/__internal__/src/components/FlatSelect/FlatSelectItem/index.js.map +1 -0
  62. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.css +1 -0
  63. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.d.ts +17 -0
  64. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.js +2 -0
  65. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/FlatSelectItemAll.js.map +1 -0
  66. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.d.ts +1 -0
  67. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.js +2 -0
  68. package/__internal__/src/components/FlatSelect/FlatSelectItemAll/index.js.map +1 -0
  69. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.css +1 -0
  70. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.d.ts +53 -0
  71. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js +2 -0
  72. package/__internal__/src/components/FlatSelect/FlatSelectList/FlatSelectList.js.map +1 -0
  73. package/__internal__/src/components/FlatSelect/FlatSelectList/index.d.ts +1 -0
  74. package/__internal__/src/components/FlatSelect/FlatSelectList/index.js +2 -0
  75. package/__internal__/src/components/FlatSelect/FlatSelectList/index.js.map +1 -0
  76. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.css +1 -0
  77. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.d.ts +3 -0
  78. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.js +2 -0
  79. package/__internal__/src/components/FlatSelect/FlatSelectLoader/FlatSelectLoader.js.map +1 -0
  80. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.d.ts +1 -0
  81. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.js +2 -0
  82. package/__internal__/src/components/FlatSelect/FlatSelectLoader/index.js.map +1 -0
  83. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.d.ts +24 -0
  84. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.js +2 -0
  85. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/FlatSelectRenderItem.js.map +1 -0
  86. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.d.ts +1 -0
  87. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.js +2 -0
  88. package/__internal__/src/components/FlatSelect/FlatSelectRenderItem/index.js.map +1 -0
  89. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.css +1 -0
  90. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.d.ts +14 -0
  91. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js +2 -0
  92. package/__internal__/src/components/FlatSelect/FlatSelectRoot/FlatSelectRoot.js.map +1 -0
  93. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.d.ts +1 -0
  94. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.js +2 -0
  95. package/__internal__/src/components/FlatSelect/FlatSelectRoot/index.js.map +1 -0
  96. package/__internal__/src/components/FlatSelect/defaultProps.d.ts +22 -0
  97. package/__internal__/src/components/FlatSelect/defaultProps.js +2 -0
  98. package/__internal__/src/components/FlatSelect/defaultProps.js.map +1 -0
  99. package/__internal__/src/components/FlatSelect/index.d.ts +2 -0
  100. package/__internal__/src/components/FlatSelect/index.js +2 -0
  101. package/__internal__/src/components/FlatSelect/index.js.map +1 -0
  102. package/__internal__/src/components/FlatSelect/types.d.ts +133 -0
  103. package/__internal__/src/components/FlatSelect/types.js +2 -0
  104. package/__internal__/src/components/FlatSelect/types.js.map +1 -0
  105. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.d.ts +4 -0
  106. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.js +2 -0
  107. package/__internal__/src/components/FlatSelect/useFlatSelect/helpers.js.map +1 -0
  108. package/__internal__/src/components/FlatSelect/useFlatSelect/index.d.ts +1 -0
  109. package/__internal__/src/components/FlatSelect/useFlatSelect/index.js +2 -0
  110. package/__internal__/src/components/FlatSelect/useFlatSelect/index.js.map +1 -0
  111. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.d.ts +52 -0
  112. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.js +2 -0
  113. package/__internal__/src/components/FlatSelect/useFlatSelect/useFlatSelect.js.map +1 -0
  114. package/__internal__/src/components/FlatSelect/useRenderItem/index.d.ts +1 -0
  115. package/__internal__/src/components/FlatSelect/useRenderItem/index.js +2 -0
  116. package/__internal__/src/components/FlatSelect/useRenderItem/index.js.map +1 -0
  117. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.d.ts +10 -0
  118. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.js +2 -0
  119. package/__internal__/src/components/FlatSelect/useRenderItem/useRenderItem.js.map +1 -0
  120. package/__internal__/src/components/ListCanary/ListBox/ListBox.js +1 -1
  121. package/__internal__/src/components/ListCanary/ListBox/ListBox.js.map +1 -1
  122. package/__internal__/src/components/ListCanary/types.d.ts +1 -0
  123. package/__internal__/src/components/ListCanary/types.js.map +1 -1
  124. package/__internal__/src/components/Modal/Modal.css +1 -1
  125. package/__internal__/src/components/Modal/Modal.d.ts +8 -13
  126. package/__internal__/src/components/Modal/Modal.js +1 -1
  127. package/__internal__/src/components/Modal/Modal.js.map +1 -1
  128. package/__internal__/src/components/Modal/ModalHeader/ModalHeader.css +1 -0
  129. package/__internal__/src/components/Modal/ModalHeader/ModalHeader.d.ts +14 -0
  130. package/__internal__/src/components/Modal/ModalHeader/ModalHeader.js +2 -0
  131. package/__internal__/src/components/Modal/ModalHeader/ModalHeader.js.map +1 -0
  132. package/__internal__/src/components/Modal/ModalHeader/index.d.ts +1 -0
  133. package/__internal__/src/components/Modal/ModalHeader/index.js +2 -0
  134. package/__internal__/src/components/Modal/ModalHeader/index.js.map +1 -0
  135. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.css +5 -0
  136. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.d.ts +10 -0
  137. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.js +2 -0
  138. package/__internal__/src/components/Modal/ModalLayout/ModalLayout.js.map +1 -0
  139. package/__internal__/src/components/Modal/ModalLayout/index.d.ts +1 -0
  140. package/__internal__/src/components/Modal/ModalLayout/index.js +2 -0
  141. package/__internal__/src/components/Modal/ModalLayout/index.js.map +1 -0
  142. package/__internal__/src/components/Modal/index.d.ts +3 -0
  143. package/__internal__/src/components/Modal/index.js +1 -1
  144. package/__internal__/src/components/Modal/index.js.map +1 -1
  145. package/__internal__/src/components/Modal/types.d.ts +23 -0
  146. package/__internal__/src/components/Modal/types.js +2 -0
  147. package/__internal__/src/components/Modal/types.js.map +1 -0
  148. package/__internal__/src/components/Modal/useModal.d.ts +20 -0
  149. package/__internal__/src/components/Modal/useModal.js +2 -0
  150. package/__internal__/src/components/Modal/useModal.js.map +1 -0
  151. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.d.ts +1 -0
  152. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.js +1 -1
  153. package/__internal__/src/components/Pagination/PaginationArrow/PaginationArrow.js.map +1 -1
  154. package/__internal__/src/components/Popover/Popover.d.ts +2 -2
  155. package/__internal__/src/components/Popover/Popover.js.map +1 -1
  156. package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js +1 -1
  157. package/__internal__/src/components/PortalWithTheme/PortalWithTheme.js.map +1 -1
  158. package/__internal__/src/components/RadioGroup/RadioGroup.js +1 -1
  159. package/__internal__/src/components/RadioGroup/RadioGroup.js.map +1 -1
  160. package/__internal__/src/components/SelectCanary/helpers.d.ts +1 -1
  161. package/__internal__/src/components/Sidebar/Sidebar.css +1 -1
  162. package/__internal__/src/components/Sidebar/Sidebar.d.ts +1 -36
  163. package/__internal__/src/components/Sidebar/Sidebar.js +1 -1
  164. package/__internal__/src/components/Sidebar/Sidebar.js.map +1 -1
  165. package/__internal__/src/components/Sidebar/index.d.ts +1 -0
  166. package/__internal__/src/components/Sidebar/index.js +1 -1
  167. package/__internal__/src/components/Sidebar/index.js.map +1 -1
  168. package/__internal__/src/components/Sidebar/types.d.ts +47 -0
  169. package/__internal__/src/components/Sidebar/types.js +2 -0
  170. package/__internal__/src/components/Sidebar/types.js.map +1 -0
  171. package/__internal__/src/components/Sidebar/useAnimateTimeout.d.ts +2 -0
  172. package/__internal__/src/components/Sidebar/useAnimateTimeout.js +2 -0
  173. package/__internal__/src/components/Sidebar/useAnimateTimeout.js.map +1 -0
  174. package/__internal__/src/components/ThemeToggler/helpers.d.ts +1 -1
  175. package/__internal__/src/components/ThemeToggler/types.d.ts +1 -1
  176. package/__internal__/src/components/ThemeToggler/types.js.map +1 -1
  177. package/__internal__/src/components/Tooltip/types.d.ts +1 -1
  178. package/__internal__/src/components/Tooltip/types.js.map +1 -1
  179. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.d.ts +1 -1
  180. package/__internal__/src/components/TooltipDeprecated/TooltipDeprecated.js.map +1 -1
  181. package/__internal__/src/hooks/useComponentSize/useComponentSize.d.ts +1 -1
  182. package/__internal__/src/hooks/useComponentSize/useComponentSize.js +1 -1
  183. package/__internal__/src/hooks/useComponentSize/useComponentSize.js.map +1 -1
  184. package/__internal__/src/mixs/MixFlex/MixFlex.d.ts +2 -2
  185. package/__internal__/src/mixs/MixFlex/MixFlex.js.map +1 -1
  186. package/__internal__/src/mixs/MixSpace/MixSpace.d.ts +1 -1
  187. package/__internal__/src/mixs/MixSpace/MixSpace.js +1 -1
  188. package/__internal__/src/mixs/MixSpace/MixSpace.js.map +1 -1
  189. package/__internal__/src/utils/state/useClickOutsideAtom/index.d.ts +1 -0
  190. package/__internal__/src/utils/state/useClickOutsideAtom/index.js +2 -0
  191. package/__internal__/src/utils/state/useClickOutsideAtom/index.js.map +1 -0
  192. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.d.ts +9 -0
  193. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.js +2 -0
  194. package/__internal__/src/utils/state/useClickOutsideAtom/useClickOutside.js.map +1 -0
  195. package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.d.ts +4 -0
  196. package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.js +2 -0
  197. package/__internal__/src/utils/state/useComponentSizeAtom/getElementSize.js.map +1 -0
  198. package/__internal__/src/utils/state/useComponentSizeAtom/index.d.ts +3 -0
  199. package/__internal__/src/utils/state/useComponentSizeAtom/index.js +2 -0
  200. package/__internal__/src/utils/state/useComponentSizeAtom/index.js.map +1 -0
  201. package/__internal__/src/utils/state/useComponentSizeAtom/types.d.ts +4 -0
  202. package/__internal__/src/utils/state/useComponentSizeAtom/types.js +2 -0
  203. package/__internal__/src/utils/state/useComponentSizeAtom/types.js.map +1 -0
  204. package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.d.ts +2 -0
  205. package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.js +2 -0
  206. package/__internal__/src/utils/state/useComponentSizeAtom/useComponentSize.js.map +1 -0
  207. package/__internal__/src/utils/state/useElementAtomEventListener/index.d.ts +1 -0
  208. package/__internal__/src/utils/state/useElementAtomEventListener/index.js +2 -0
  209. package/__internal__/src/utils/state/useElementAtomEventListener/index.js.map +1 -0
  210. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.d.ts +2 -0
  211. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.js +2 -0
  212. package/__internal__/src/utils/state/useElementAtomEventListener/useElementAtomEventListener.js.map +1 -0
  213. package/__internal__/src/utils/state/useKeysAtom/index.d.ts +1 -0
  214. package/__internal__/src/utils/state/useKeysAtom/index.js +2 -0
  215. package/__internal__/src/utils/state/useKeysAtom/index.js.map +1 -0
  216. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.d.ts +14 -0
  217. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.js +2 -0
  218. package/__internal__/src/utils/state/useKeysAtom/useKeysAtom.js.map +1 -0
  219. package/__internal__/src/utils/state/useRefAtom/useRefAtom.d.ts +1 -1
  220. package/__internal__/src/utils/state/useRefAtom/useRefAtom.js.map +1 -1
  221. package/__internal__/src/utils/state/useResizeObservedAtom/index.d.ts +1 -0
  222. package/__internal__/src/utils/state/useResizeObservedAtom/index.js +2 -0
  223. package/__internal__/src/utils/state/useResizeObservedAtom/index.js.map +1 -0
  224. package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.d.ts +2 -0
  225. package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.js +2 -0
  226. package/__internal__/src/utils/state/useResizeObservedAtom/useResizeObservedAtom.js.map +1 -0
  227. package/__internal__/src/utils/state/withCtx/withCtx.js +1 -1
  228. package/__internal__/src/utils/state/withCtx/withCtx.js.map +1 -1
  229. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"TooltipDeprecated.js","names":["React","useMemo","useState","cnMixPopoverArrow","cnDeprecated","Popover","Text","generateDeps","generateThemeClassNames","ThemeContext","useTheme","ARROW_SIZE","ARROW_OFFSET","cnTooltip","tooltipPropSizes","tooltipPropSizesDefault","tooltipPropStatus","renderChildren","children","Tooltip","forwardRef","props","ref","size","className","status","onSetDirectionProp","onSetDirection","style","offset","rest","theme","direction","setDirection","value","tooltipTheme","color","primary","accent","invert","themeClassNames"],"sources":["../../../../../src/components/TooltipDeprecated/TooltipDeprecated.tsx"],"sourcesContent":["import './Tooltip.css';\n\nimport React, { useMemo, useState } from 'react';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { cnMixPopoverArrow } from '../../mixs/MixPopoverArrow/MixPopoverArrow';\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';\nimport { Direction, Popover, PositioningProps } from '../Popover/Popover';\nimport { Text } from '../Text/Text';\nimport {\n generateDeps,\n generateThemeClassNames,\n ThemeContext,\n useTheme,\n} from '../Theme/Theme';\n\nconst ARROW_SIZE = 6;\nconst ARROW_OFFSET = 8;\n\nconst cnTooltip = cnDeprecated('Tooltip');\n\nexport const tooltipPropSizes = ['m', 's', 'l'] as const;\nexport const tooltipPropSizesDefault = tooltipPropSizes[0];\nexport type TooltipPropSize = typeof tooltipPropSizes[number];\n\nexport const tooltipPropStatus = [\n 'normal',\n 'alert',\n 'success',\n 'warning',\n] as const;\nexport type TooltipPropStatus = typeof tooltipPropStatus[number];\n\nexport type TooltipProps = PropsWithJsxAttributes<\n {\n size?: TooltipPropSize;\n status?: TooltipPropStatus;\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: readonly Direction[];\n isInteractive?: boolean;\n children: React.ReactNode;\n onClickOutside?: ClickOutsideHandler;\n className?: string;\n offset?: number;\n onSetDirection?: (direction: Direction) => void;\n } & PositioningProps\n>;\n\nfunction renderChildren(children: React.ReactNode): React.ReactNode {\n return typeof children === 'string' || typeof children === 'number' ? (\n <Text size=\"xs\" view=\"primary\" lineHeight=\"m\">\n {children}\n </Text>\n ) : (\n children\n );\n}\n\nexport const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(\n (props, ref) => {\n const {\n children,\n size = tooltipPropSizesDefault,\n className,\n status,\n onSetDirection: onSetDirectionProp,\n style,\n offset = 0,\n ...rest\n } = props;\n const { theme } = useTheme();\n const [direction, setDirection] = useState<Direction | undefined>();\n\n const onSetDirection = (direction: Direction) => {\n onSetDirectionProp && onSetDirectionProp(direction);\n setDirection(direction);\n };\n\n const value = useMemo(() => {\n const tooltipTheme = status\n ? {\n ...theme,\n color: {\n primary: theme.color.accent,\n accent: theme.color.accent,\n invert: theme.color.primary,\n },\n }\n : {\n ...theme,\n color: {\n primary: theme.color.invert,\n accent: theme.color.accent,\n invert: theme.color.primary,\n },\n };\n\n return {\n theme: tooltipTheme,\n themeClassNames: generateThemeClassNames(tooltipTheme),\n };\n }, [generateDeps(theme), status]);\n\n return (\n <ThemeContext.Provider value={value}>\n <Popover\n {...rest}\n arrowOffset={ARROW_OFFSET + ARROW_SIZE}\n offset={ARROW_SIZE + 4 + offset}\n onSetDirection={onSetDirection}\n ref={ref}\n className={cnTooltip({ status }, [className])}\n style={{\n ['--popover-arrow-size' as string]: `${ARROW_SIZE}px`,\n ['--popover-arrow-offset' as string]: `${ARROW_OFFSET}px`,\n ...style,\n }}\n >\n <div className={cnTooltip('Background')} />\n <div\n className={cnTooltip('Arrow', [cnMixPopoverArrow({ direction })])}\n />\n <div className={cnTooltip('Content', { size })}>\n {renderChildren(children)}\n </div>\n </Popover>\n </ThemeContext.Provider>\n );\n },\n);\n"],"mappings":"o5BAAA,sBAEA,MAAOA,MAAP,EAAgBC,OAAhB,CAAyBC,QAAzB,KAAyC,OAAzC,CAGA,OAASC,iBAAT,kDACA,OAASC,YAAT,uBAEA,OAAoBC,OAApB,0BACA,OAASC,IAAT,oBACA,OACEC,YADF,CAEEC,uBAFF,CAGEC,YAHF,CAIEC,QAJF,sB,GAOMC,WAAU,CAAG,C,CACbC,YAAY,CAAG,C,CAEfC,SAAS,CAAGT,YAAY,CAAC,SAAD,C,CAE9B,MAAO,IAAMU,iBAAgB,CAAG,CAAC,GAAD,CAAM,GAAN,CAAW,GAAX,CAAzB,CACP,MAAO,IAAMC,wBAAuB,CAAGD,gBAAgB,CAAC,CAAD,CAAhD,CAGP,MAAO,IAAME,kBAAiB,CAAG,CAC/B,QAD+B,CAE/B,OAF+B,CAG/B,SAH+B,CAI/B,SAJ+B,CAA1B,CAwBP,QAASC,eAAT,CAAwBC,CAAxB,CAAoE,CAClE,MAA2B,QAApB,QAAOA,EAAP,EAAoD,QAApB,QAAOA,EAAvC,CACL,oBAAC,IAAD,EAAM,IAAI,CAAC,IAAX,CAAgB,IAAI,CAAC,SAArB,CAA+B,UAAU,CAAC,GAA1C,EACGA,CADH,CADK,CAKLA,CAEH,CAED,MAAO,IAAMC,QAAO,CAAGnB,KAAK,CAACoB,UAAN,CACrB,SAACC,CAAD,CAAQC,CAAR,CAAgB,OAEZJ,CAFY,CAUVG,CAVU,CAEZH,QAFY,GAUVG,CAVU,CAGZE,IAHY,CAGZA,CAHY,YAGLR,uBAHK,GAIZS,CAJY,CAUVH,CAVU,CAIZG,SAJY,CAKZC,CALY,CAUVJ,CAVU,CAKZI,MALY,CAMIC,CANJ,CAUVL,CAVU,CAMZM,cANY,CAOZC,CAPY,CAUVP,CAVU,CAOZO,KAPY,GAUVP,CAVU,CAQZQ,MARY,CAQZA,CARY,YAQH,CARG,GASTC,CATS,0BAUVT,CAVU,cAWIX,QAAQ,EAXZ,CAWNqB,CAXM,GAWNA,KAXM,GAYoB7B,QAAQ,EAZ5B,uBAYP8B,CAZO,MAYIC,CAZJ,MAmBRC,CAAK,CAAGjC,OAAO,CAAC,UAAM,CAC1B,GAAMkC,EAAY,CAAGV,CAAM,gCAElBM,CAFkB,MAGrBK,KAAK,CAAE,CACLC,OAAO,CAAEN,CAAK,CAACK,KAAN,CAAYE,MADhB,CAELA,MAAM,CAAEP,CAAK,CAACK,KAAN,CAAYE,MAFf,CAGLC,MAAM,CAAER,CAAK,CAACK,KAAN,CAAYC,OAHf,CAHc,kCAUlBN,CAVkB,MAWrBK,KAAK,CAAE,CACLC,OAAO,CAAEN,CAAK,CAACK,KAAN,CAAYG,MADhB,CAELD,MAAM,CAAEP,CAAK,CAACK,KAAN,CAAYE,MAFf,CAGLC,MAAM,CAAER,CAAK,CAACK,KAAN,CAAYC,OAHf,CAXc,EAA3B,CAkBA,MAAO,CACLN,KAAK,CAAEI,CADF,CAELK,eAAe,CAAEhC,uBAAuB,CAAC2B,CAAD,CAFnC,CAIR,CAvBoB,CAuBlB,CAAC5B,YAAY,CAACwB,CAAD,CAAb,CAAsBN,CAAtB,CAvBkB,CAnBP,CA4Cd,MACE,qBAAC,YAAD,CAAc,QAAd,EAAuB,KAAK,CAAES,CAA9B,EACE,oBAAC,OAAD,kBACMJ,CADN,EAEE,WAAW,CAAElB,YAAY,CAAGD,UAF9B,CAGE,MAAM,CAAE,GAAiBkB,CAH3B,CAIE,cAAc,CApCG,QAAjBF,eAAiB,CAACK,CAAD,CAA0B,CAC/CN,CAAkB,EAAIA,CAAkB,CAACM,CAAD,CADO,CAE/CC,CAAY,CAACD,CAAD,CACb,CA6BG,CAKE,GAAG,CAAEV,CALP,CAME,SAAS,CAAET,SAAS,CAAC,CAAEY,MAAM,CAANA,CAAF,CAAD,CAAa,CAACD,CAAD,CAAb,CANtB,CAOE,KAAK,uCACF,sBADE,WACoCb,UADpC,0BAEF,wBAFE,WAEsCC,YAFtC,WAGAgB,CAHA,CAPP,GAaE,2BAAK,SAAS,CAAEf,SAAS,CAAC,YAAD,CAAzB,EAbF,CAcE,2BACE,SAAS,CAAEA,SAAS,CAAC,OAAD,CAAU,CAACV,iBAAiB,CAAC,CAAE6B,SAAS,CAATA,CAAF,CAAD,CAAlB,CAAV,CADtB,EAdF,CAiBE,2BAAK,SAAS,CAAEnB,SAAS,CAAC,SAAD,CAAY,CAAEU,IAAI,CAAJA,CAAF,CAAZ,CAAzB,EACGN,cAAc,CAACC,CAAD,CADjB,CAjBF,CADF,CAwBH,CAtEoB,CAAhB"}
1
+ {"version":3,"file":"TooltipDeprecated.js","names":["React","useMemo","useState","cnMixPopoverArrow","cnDeprecated","Popover","Text","generateDeps","generateThemeClassNames","ThemeContext","useTheme","ARROW_SIZE","ARROW_OFFSET","cnTooltip","tooltipPropSizes","tooltipPropSizesDefault","tooltipPropStatus","renderChildren","children","Tooltip","forwardRef","props","ref","size","className","status","onSetDirectionProp","onSetDirection","style","offset","rest","theme","direction","setDirection","value","tooltipTheme","color","primary","accent","invert","themeClassNames"],"sources":["../../../../../src/components/TooltipDeprecated/TooltipDeprecated.tsx"],"sourcesContent":["import './Tooltip.css';\n\nimport React, { useMemo, useState } from 'react';\n\nimport { ClickOutsideHandler } from '../../hooks/useClickOutside/useClickOutside';\nimport { cnMixPopoverArrow } from '../../mixs/MixPopoverArrow/MixPopoverArrow';\nimport { cnDeprecated } from '../../utils/bem';\nimport { PropsWithJsxAttributes } from '../../utils/types/PropsWithJsxAttributes';\nimport { Direction, Popover, PositioningProps } from '../Popover/Popover';\nimport { Text } from '../Text/Text';\nimport {\n generateDeps,\n generateThemeClassNames,\n ThemeContext,\n useTheme,\n} from '../Theme/Theme';\n\nconst ARROW_SIZE = 6;\nconst ARROW_OFFSET = 8;\n\nconst cnTooltip = cnDeprecated('Tooltip');\n\nexport const tooltipPropSizes = ['m', 's', 'l'] as const;\nexport const tooltipPropSizesDefault = tooltipPropSizes[0];\nexport type TooltipPropSize = typeof tooltipPropSizes[number];\n\nexport const tooltipPropStatus = [\n 'normal',\n 'alert',\n 'success',\n 'warning',\n] as const;\nexport type TooltipPropStatus = typeof tooltipPropStatus[number];\n\nexport type TooltipProps = PropsWithJsxAttributes<\n {\n size?: TooltipPropSize;\n status?: TooltipPropStatus;\n direction?: Direction;\n spareDirection?: Direction;\n possibleDirections?: Direction[];\n isInteractive?: boolean;\n children: React.ReactNode;\n onClickOutside?: ClickOutsideHandler;\n className?: string;\n offset?: number;\n onSetDirection?: (direction: Direction) => void;\n } & PositioningProps\n>;\n\nfunction renderChildren(children: React.ReactNode): React.ReactNode {\n return typeof children === 'string' || typeof children === 'number' ? (\n <Text size=\"xs\" view=\"primary\" lineHeight=\"m\">\n {children}\n </Text>\n ) : (\n children\n );\n}\n\nexport const Tooltip = React.forwardRef<HTMLDivElement, TooltipProps>(\n (props, ref) => {\n const {\n children,\n size = tooltipPropSizesDefault,\n className,\n status,\n onSetDirection: onSetDirectionProp,\n style,\n offset = 0,\n ...rest\n } = props;\n const { theme } = useTheme();\n const [direction, setDirection] = useState<Direction | undefined>();\n\n const onSetDirection = (direction: Direction) => {\n onSetDirectionProp && onSetDirectionProp(direction);\n setDirection(direction);\n };\n\n const value = useMemo(() => {\n const tooltipTheme = status\n ? {\n ...theme,\n color: {\n primary: theme.color.accent,\n accent: theme.color.accent,\n invert: theme.color.primary,\n },\n }\n : {\n ...theme,\n color: {\n primary: theme.color.invert,\n accent: theme.color.accent,\n invert: theme.color.primary,\n },\n };\n\n return {\n theme: tooltipTheme,\n themeClassNames: generateThemeClassNames(tooltipTheme),\n };\n }, [generateDeps(theme), status]);\n\n return (\n <ThemeContext.Provider value={value}>\n <Popover\n {...rest}\n arrowOffset={ARROW_OFFSET + ARROW_SIZE}\n offset={ARROW_SIZE + 4 + offset}\n onSetDirection={onSetDirection}\n ref={ref}\n className={cnTooltip({ status }, [className])}\n style={{\n ['--popover-arrow-size' as string]: `${ARROW_SIZE}px`,\n ['--popover-arrow-offset' as string]: `${ARROW_OFFSET}px`,\n ...style,\n }}\n >\n <div className={cnTooltip('Background')} />\n <div\n className={cnTooltip('Arrow', [cnMixPopoverArrow({ direction })])}\n />\n <div className={cnTooltip('Content', { size })}>\n {renderChildren(children)}\n </div>\n </Popover>\n </ThemeContext.Provider>\n );\n },\n);\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
1
  import { ComponentSize } from './types';
2
- export declare const useComponentSize: (ref: React.RefObject<HTMLElement | SVGGraphicsElement>) => ComponentSize;
2
+ export declare const useComponentSize: (ref: React.RefObject<HTMLElement | SVGGraphicsElement>, deps?: unknown[]) => ComponentSize;
@@ -1,2 +1,2 @@
1
- import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../useResizeObserved";export var useComponentSize=function(a){return useResizeObserved(useMemo(function(){return[a]},[a.current]),getElementSize)[0]};
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../useResizeObserved";export var useComponentSize=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return useResizeObserved(useMemo(function(){return[a]},[a.current].concat(_toConsumableArray(b))),getElementSize)[0]};
2
2
  //# sourceMappingURL=useComponentSize.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","current"],"sources":["../../../../../src/hooks/useComponentSize/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current],\n ),\n getElementSize,\n )[0];\n"],"mappings":"AAAA,OAASA,OAAT,KAAwB,OAAxB,CAEA,OAASC,cAAT,CAAyBC,iBAAzB,4BAIA,MAAO,IAAMC,iBAAgB,CAAG,SAC9BC,CAD8B,QAG9BF,kBAAiB,CACfF,OAAO,CACL,iBAAM,CAACI,CAAD,CAAN,CADK,CAGL,CAACA,CAAG,CAACC,OAAL,CAHK,CADQ,CAMfJ,cANe,CAAjB,CAOE,CAPF,CAH8B,CAAzB"}
1
+ {"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","deps","current"],"sources":["../../../../../src/hooks/useComponentSize/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n deps: unknown[] = [],\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current, ...deps],\n ),\n getElementSize,\n )[0];\n"],"mappings":"yEAAA,OAASA,OAAT,KAAwB,OAAxB,CAEA,OAASC,cAAT,CAAyBC,iBAAzB,4BAIA,MAAO,IAAMC,iBAAgB,CAAG,SAC9BC,CAD8B,KAE9BC,EAF8B,wDAEZ,EAFY,OAI9BH,kBAAiB,CACfF,OAAO,CACL,iBAAM,CAACI,CAAD,CAAN,CADK,EAGJA,CAAG,CAACE,OAHA,4BAGYD,CAHZ,GADQ,CAMfJ,cANe,CAAjB,CAOE,CAPF,CAJ8B,CAAzB"}
@@ -10,7 +10,7 @@ export declare const mixFlexPropWrap: readonly ["nowrap", "wrap", "wrap-reverse"
10
10
  export type MixFlexPropWrap = typeof mixFlexPropWrap[number];
11
11
  export declare const mixFlexPropDirection: readonly ["row", "row-reverse", "column", "column-reverse"];
12
12
  export type MixFlexPropDirection = typeof mixFlexPropDirection[number];
13
- type Props = {
13
+ export type CnMixFlexProps = {
14
14
  align?: MixFlexPropAlign;
15
15
  justify?: MixFlexPropJustify;
16
16
  flex?: MixFlexPropFlex;
@@ -19,6 +19,6 @@ type Props = {
19
19
  gap?: Space;
20
20
  order?: -1 | 0 | 1;
21
21
  };
22
- type CnMixFlex = (props: Props, classNames?: Array<string | undefined>) => string;
22
+ type CnMixFlex = (props: CnMixFlexProps, classNames?: Array<string | undefined>) => string;
23
23
  export declare const cnMixFlex: CnMixFlex;
24
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"MixFlex.js","names":["cn","mixFlexPropAlign","mixFlexPropJustify","mixFlexPropFlex","mixFlexPropWrap","mixFlexPropDirection","cnFlex","cnMixFlex","props","classNames"],"sources":["../../../../../src/mixs/MixFlex/MixFlex.ts"],"sourcesContent":["import './MixFlex.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { Space } from '../MixSpace';\n\nexport const mixFlexPropAlign = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\nexport type MixFlexPropAlign = typeof mixFlexPropAlign[number];\n\nexport const mixFlexPropJustify = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n] as const;\nexport type MixFlexPropJustify = typeof mixFlexPropJustify[number];\n\nexport const mixFlexPropFlex = ['flex', 'inline-flex'] as const;\nexport type MixFlexPropFlex = typeof mixFlexPropFlex[number];\n\nexport const mixFlexPropWrap = ['nowrap', 'wrap', 'wrap-reverse'] as const;\nexport type MixFlexPropWrap = typeof mixFlexPropWrap[number];\n\nexport const mixFlexPropDirection = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\nexport type MixFlexPropDirection = typeof mixFlexPropDirection[number];\n\ntype Props = {\n align?: MixFlexPropAlign;\n justify?: MixFlexPropJustify;\n flex?: MixFlexPropFlex;\n wrap?: MixFlexPropWrap;\n direction?: MixFlexPropDirection;\n gap?: Space;\n order?: -1 | 0 | 1;\n};\n\ntype CnMixFlex = (\n props: Props,\n classNames?: Array<string | undefined>,\n) => string;\n\nconst cnFlex = cn('MixFlex');\n\nexport const cnMixFlex: CnMixFlex = (props, classNames = []) =>\n cnFlex(props, classNames);\n"],"mappings":"AAAA,sBAEA,OAASA,EAAT,uBAIA,MAAO,IAAMC,iBAAgB,CAAG,CAC9B,YAD8B,CAE9B,UAF8B,CAG9B,QAH8B,CAI9B,UAJ8B,CAK9B,SAL8B,CAAzB,CASP,MAAO,IAAMC,mBAAkB,CAAG,CAChC,YADgC,CAEhC,UAFgC,CAGhC,QAHgC,CAIhC,eAJgC,CAKhC,cALgC,CAMhC,cANgC,CAA3B,CAUP,MAAO,IAAMC,gBAAe,CAAG,CAAC,MAAD,CAAS,aAAT,CAAxB,CAGP,MAAO,IAAMC,gBAAe,CAAG,CAAC,QAAD,CAAW,MAAX,CAAmB,cAAnB,CAAxB,CAGP,MAAO,IAAMC,qBAAoB,CAAG,CAClC,KADkC,CAElC,aAFkC,CAGlC,QAHkC,CAIlC,gBAJkC,CAA7B,CAuBP,GAAMC,OAAM,CAAGN,EAAE,CAAC,SAAD,CAAjB,CAEA,MAAO,IAAMO,UAAoB,CAAG,SAACC,CAAD,KAAQC,EAAR,wDAAqB,EAArB,OAClCH,OAAM,CAACE,CAAD,CAAQC,CAAR,CAD4B,CAA7B"}
1
+ {"version":3,"file":"MixFlex.js","names":["cn","mixFlexPropAlign","mixFlexPropJustify","mixFlexPropFlex","mixFlexPropWrap","mixFlexPropDirection","cnFlex","cnMixFlex","props","classNames"],"sources":["../../../../../src/mixs/MixFlex/MixFlex.ts"],"sourcesContent":["import './MixFlex.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { Space } from '../MixSpace';\n\nexport const mixFlexPropAlign = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\nexport type MixFlexPropAlign = typeof mixFlexPropAlign[number];\n\nexport const mixFlexPropJustify = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n] as const;\nexport type MixFlexPropJustify = typeof mixFlexPropJustify[number];\n\nexport const mixFlexPropFlex = ['flex', 'inline-flex'] as const;\nexport type MixFlexPropFlex = typeof mixFlexPropFlex[number];\n\nexport const mixFlexPropWrap = ['nowrap', 'wrap', 'wrap-reverse'] as const;\nexport type MixFlexPropWrap = typeof mixFlexPropWrap[number];\n\nexport const mixFlexPropDirection = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\nexport type MixFlexPropDirection = typeof mixFlexPropDirection[number];\n\nexport type CnMixFlexProps = {\n align?: MixFlexPropAlign;\n justify?: MixFlexPropJustify;\n flex?: MixFlexPropFlex;\n wrap?: MixFlexPropWrap;\n direction?: MixFlexPropDirection;\n gap?: Space;\n order?: -1 | 0 | 1;\n};\n\ntype CnMixFlex = (\n props: CnMixFlexProps,\n classNames?: Array<string | undefined>,\n) => string;\n\nconst cnFlex = cn('MixFlex');\n\nexport const cnMixFlex: CnMixFlex = (props, classNames = []) =>\n cnFlex(props, classNames);\n"],"mappings":"AAAA,sBAEA,OAASA,EAAT,uBAIA,MAAO,IAAMC,iBAAgB,CAAG,CAC9B,YAD8B,CAE9B,UAF8B,CAG9B,QAH8B,CAI9B,UAJ8B,CAK9B,SAL8B,CAAzB,CASP,MAAO,IAAMC,mBAAkB,CAAG,CAChC,YADgC,CAEhC,UAFgC,CAGhC,QAHgC,CAIhC,eAJgC,CAKhC,cALgC,CAMhC,cANgC,CAA3B,CAUP,MAAO,IAAMC,gBAAe,CAAG,CAAC,MAAD,CAAS,aAAT,CAAxB,CAGP,MAAO,IAAMC,gBAAe,CAAG,CAAC,QAAD,CAAW,MAAX,CAAmB,cAAnB,CAAxB,CAGP,MAAO,IAAMC,qBAAoB,CAAG,CAClC,KADkC,CAElC,aAFkC,CAGlC,QAHkC,CAIlC,gBAJkC,CAA7B,CAuBP,GAAMC,OAAM,CAAGN,EAAE,CAAC,SAAD,CAAjB,CAEA,MAAO,IAAMO,UAAoB,CAAG,SAACC,CAAD,KAAQC,EAAR,wDAAqB,EAArB,OAClCH,OAAM,CAACE,CAAD,CAAQC,CAAR,CAD4B,CAA7B"}
@@ -1,5 +1,5 @@
1
1
  import './MixSpace.css';
2
2
  import { MixSpaceProps } from './types';
3
- type CnMixSpace = (props: MixSpaceProps) => string;
3
+ type CnMixSpace = (props?: MixSpaceProps) => string;
4
4
  export declare const cnMixSpace: CnMixSpace;
5
5
  export {};
@@ -1,2 +1,2 @@
1
- import"./MixSpace.css";import{cn}from"../../utils/bem";var cnSpace=cn("MixSpace");export var cnMixSpace=function(a){var b=a.p,c=a.m,d=a.pV,e=a.pH,f=a.mV,g=a.mH,h=a.mT,i=a.mL,j=a.mR,k=a.mB,l=a.pT,m=a.pL,n=a.pR,o=a.pB;return cnSpace({pT:l||d||b,pL:m||e||b,pR:n||e||b,pB:o||d||b,mT:h||f||c,mL:i||g||c,mR:j||g||c,mB:k||f||c})};
1
+ import"./MixSpace.css";import{cn}from"../../utils/bem";var cnSpace=cn("MixSpace");export var cnMixSpace=function(a){if(!a)return"";var b=a.p,c=a.m,d=a.pV,e=a.pH,f=a.mV,g=a.mH,h=a.mT,i=a.mL,j=a.mR,k=a.mB,l=a.pT,m=a.pL,n=a.pR,o=a.pB;return cnSpace({pT:l||d||b,pL:m||e||b,pR:n||e||b,pB:o||d||b,mT:h||f||c,mL:i||g||c,mR:j||g||c,mB:k||f||c})};
2
2
  //# sourceMappingURL=MixSpace.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MixSpace.js","names":["cn","cnSpace","cnMixSpace","p","m","pV","pH","mV","mH","mT","mL","mR","mB","pT","pL","pR","pB"],"sources":["../../../../../src/mixs/MixSpace/MixSpace.tsx"],"sourcesContent":["import './MixSpace.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { MixSpaceProps } from './types';\n\ntype CnMixSpace = (props: MixSpaceProps) => string;\n\nconst cnSpace = cn('MixSpace');\n\nexport const cnMixSpace: CnMixSpace = ({\n p,\n m,\n pV,\n pH,\n mV,\n mH,\n mT,\n mL,\n mR,\n mB,\n pT,\n pL,\n pR,\n pB,\n}) =>\n cnSpace({\n pT: pT || pV || p,\n pL: pL || pH || p,\n pR: pR || pH || p,\n pB: pB || pV || p,\n mT: mT || mV || m,\n mL: mL || mH || m,\n mR: mR || mH || m,\n mB: mB || mV || m,\n });\n"],"mappings":"AAAA,uBAEA,OAASA,EAAT,uBAMA,GAAMC,QAAO,CAAGD,EAAE,CAAC,UAAD,CAAlB,CAEA,MAAO,IAAME,WAAsB,CAAG,eACpCC,EADoC,GACpCA,CADoC,CAEpCC,CAFoC,GAEpCA,CAFoC,CAGpCC,CAHoC,GAGpCA,EAHoC,CAIpCC,CAJoC,GAIpCA,EAJoC,CAKpCC,CALoC,GAKpCA,EALoC,CAMpCC,CANoC,GAMpCA,EANoC,CAOpCC,CAPoC,GAOpCA,EAPoC,CAQpCC,CARoC,GAQpCA,EARoC,CASpCC,CAToC,GASpCA,EAToC,CAUpCC,CAVoC,GAUpCA,EAVoC,CAWpCC,CAXoC,GAWpCA,EAXoC,CAYpCC,CAZoC,GAYpCA,EAZoC,CAapCC,CAboC,GAapCA,EAboC,CAcpCC,CAdoC,GAcpCA,EAdoC,OAgBpCf,QAAO,CAAC,CACNY,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYF,CADV,CAENW,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYH,CAFV,CAGNY,EAAE,CAAEA,CAAE,EAAIT,CAAN,EAAYH,CAHV,CAINa,EAAE,CAAEA,CAAE,EAAIX,CAAN,EAAYF,CAJV,CAKNM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYH,CALV,CAMNM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYJ,CANV,CAONO,EAAE,CAAEA,CAAE,EAAIH,CAAN,EAAYJ,CAPV,CAQNQ,EAAE,CAAEA,CAAE,EAAIL,CAAN,EAAYH,CARV,CAAD,CAhB6B,CAA/B"}
1
+ {"version":3,"file":"MixSpace.js","names":["cn","cnSpace","cnMixSpace","props","p","m","pV","pH","mV","mH","mT","mL","mR","mB","pT","pL","pR","pB"],"sources":["../../../../../src/mixs/MixSpace/MixSpace.tsx"],"sourcesContent":["import './MixSpace.css';\n\nimport { cn } from '##/utils/bem';\n\nimport { MixSpaceProps } from './types';\n\ntype CnMixSpace = (props?: MixSpaceProps) => string;\n\nconst cnSpace = cn('MixSpace');\n\nexport const cnMixSpace: CnMixSpace = (props) => {\n if (!props) return '';\n const { p, m, pV, pH, mV, mH, mT, mL, mR, mB, pT, pL, pR, pB } = props;\n return cnSpace({\n pT: pT || pV || p,\n pL: pL || pH || p,\n pR: pR || pH || p,\n pB: pB || pV || p,\n mT: mT || mV || m,\n mL: mL || mH || m,\n mR: mR || mH || m,\n mB: mB || mV || m,\n });\n};\n"],"mappings":"AAAA,uBAEA,OAASA,EAAT,uBAMA,GAAMC,QAAO,CAAGD,EAAE,CAAC,UAAD,CAAlB,CAEA,MAAO,IAAME,WAAsB,CAAG,SAACC,CAAD,CAAW,CAC/C,GAAI,CAACA,CAAL,CAAY,MAAO,EAAP,CACZ,GAAQC,EAAR,CAAiED,CAAjE,CAAQC,CAAR,CAAWC,CAAX,CAAiEF,CAAjE,CAAWE,CAAX,CAAcC,CAAd,CAAiEH,CAAjE,CAAcG,EAAd,CAAkBC,CAAlB,CAAiEJ,CAAjE,CAAkBI,EAAlB,CAAsBC,CAAtB,CAAiEL,CAAjE,CAAsBK,EAAtB,CAA0BC,CAA1B,CAAiEN,CAAjE,CAA0BM,EAA1B,CAA8BC,CAA9B,CAAiEP,CAAjE,CAA8BO,EAA9B,CAAkCC,CAAlC,CAAiER,CAAjE,CAAkCQ,EAAlC,CAAsCC,CAAtC,CAAiET,CAAjE,CAAsCS,EAAtC,CAA0CC,CAA1C,CAAiEV,CAAjE,CAA0CU,EAA1C,CAA8CC,CAA9C,CAAiEX,CAAjE,CAA8CW,EAA9C,CAAkDC,CAAlD,CAAiEZ,CAAjE,CAAkDY,EAAlD,CAAsDC,CAAtD,CAAiEb,CAAjE,CAAsDa,EAAtD,CAA0DC,CAA1D,CAAiEd,CAAjE,CAA0Dc,EAA1D,CACA,MAAOhB,QAAO,CAAC,CACba,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYF,CADH,CAEbW,EAAE,CAAEA,CAAE,EAAIR,CAAN,EAAYH,CAFH,CAGbY,EAAE,CAAEA,CAAE,EAAIT,CAAN,EAAYH,CAHH,CAIba,EAAE,CAAEA,CAAE,EAAIX,CAAN,EAAYF,CAJH,CAKbM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYH,CALH,CAMbM,EAAE,CAAEA,CAAE,EAAIF,CAAN,EAAYJ,CANH,CAObO,EAAE,CAAEA,CAAE,EAAIH,CAAN,EAAYJ,CAPH,CAQbQ,EAAE,CAAEA,CAAE,EAAIL,CAAN,EAAYH,CARH,CAAD,CAUf,CAbM"}
@@ -0,0 +1 @@
1
+ export * from './useClickOutside';
@@ -0,0 +1,2 @@
1
+ export*from"./useClickOutside";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useClickOutsideAtom/index.ts"],"sourcesContent":["export * from './useClickOutside';\n"],"mappings":"AAAA"}
@@ -0,0 +1,9 @@
1
+ import { AtomMut } from '@reatom/core';
2
+ export type ClickOutsideHandler = (event: MouseEvent) => void;
3
+ type UseClickOutsideProps = {
4
+ isActiveAtom?: AtomMut<boolean>;
5
+ ignoreClicksElementsAtom?: AtomMut<(HTMLElement | null)[]>;
6
+ handler?: ClickOutsideHandler;
7
+ };
8
+ export declare const useClickOutsideAtom: ({ isActiveAtom, ignoreClicksElementsAtom, handler, }: UseClickOutsideProps) => void;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import{useAction}from"@reatom/npm-react";import{useEffect}from"react";import{useSendToAtom}from"../useSendToAtom";export var useClickOutsideAtom=function(a){var b=a.isActiveAtom,c=a.ignoreClicksElementsAtom,d=a.handler,f=useSendToAtom([d]),g=useAction(function(a,d){var e=b&&a.get(b),g=c&&a.get(c),h=a.get(f)[0];e&&h&&(null===g||void 0===g?void 0:g.length)&&g.every(function(a){return!(null!==a&&void 0!==a&&a.contains(d.target))})&&h(d)});useEffect(function(){return document.addEventListener("mousedown",g),function(){document.removeEventListener("mousedown",g)}},[])};
2
+ //# sourceMappingURL=useClickOutside.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClickOutside.js","names":["useAction","useEffect","useSendToAtom","useClickOutsideAtom","isActiveAtom","ignoreClicksElementsAtom","handler","handlerAtom","fn","ctx","e","isActive","get","ignoreClicksElements","length","every","el","contains","target","document","addEventListener","removeEventListener"],"sources":["../../../../../../src/utils/state/useClickOutsideAtom/useClickOutside.tsx"],"sourcesContent":["import { AtomMut } from '@reatom/core';\nimport { useAction } from '@reatom/npm-react';\nimport { useEffect } from 'react';\n\nimport { useSendToAtom } from '##/utils/state/useSendToAtom';\n\nexport type ClickOutsideHandler = (event: MouseEvent) => void;\n\ntype UseClickOutsideProps = {\n isActiveAtom?: AtomMut<boolean>;\n ignoreClicksElementsAtom?: AtomMut<(HTMLElement | null)[]>;\n handler?: ClickOutsideHandler;\n};\n\nexport const useClickOutsideAtom = ({\n isActiveAtom,\n ignoreClicksElementsAtom,\n handler,\n}: UseClickOutsideProps) => {\n const handlerAtom = useSendToAtom([handler]);\n\n const fn = useAction((ctx, e: MouseEvent) => {\n const isActive = isActiveAtom && ctx.get(isActiveAtom);\n const ignoreClicksElements =\n ignoreClicksElementsAtom && ctx.get(ignoreClicksElementsAtom);\n const handler = ctx.get(handlerAtom)[0];\n isActive &&\n handler &&\n ignoreClicksElements?.length &&\n ignoreClicksElements.every((el) => !el?.contains(e.target as Node)) &&\n handler(e);\n });\n\n useEffect(() => {\n document.addEventListener('mousedown', fn);\n\n return () => {\n document.removeEventListener('mousedown', fn);\n };\n }, []);\n};\n"],"mappings":"AACA,OAASA,SAAT,KAA0B,mBAA1B,CACA,OAASC,SAAT,KAA0B,OAA1B,CAEA,OAASC,aAAT,wBAUA,MAAO,IAAMC,oBAAmB,CAAG,WAIP,IAH1BC,EAG0B,GAH1BA,YAG0B,CAF1BC,CAE0B,GAF1BA,wBAE0B,CAD1BC,CAC0B,GAD1BA,OAC0B,CACpBC,CAAW,CAAGL,aAAa,CAAC,CAACI,CAAD,CAAD,CADP,CAGpBE,CAAE,CAAGR,SAAS,CAAC,SAACS,CAAD,CAAMC,CAAN,CAAwB,IACrCC,EAAQ,CAAGP,CAAY,EAAIK,CAAG,CAACG,GAAJ,CAAQR,CAAR,CADU,CAErCS,CAAoB,CACxBR,CAAwB,EAAII,CAAG,CAACG,GAAJ,CAAQP,CAAR,CAHa,CAIrCC,CAAO,CAAGG,CAAG,CAACG,GAAJ,CAAQL,CAAR,EAAqB,CAArB,CAJ2B,CAK3CI,CAAQ,EACNL,CADF,UAEEO,CAFF,WAEEA,CAFF,QAEEA,CAAoB,CAAEC,MAFxB,GAGED,CAAoB,CAACE,KAArB,CAA2B,SAACC,CAAD,QAAQ,SAACA,CAAD,WAACA,CAAD,EAACA,CAAE,CAAEC,QAAJ,CAAaP,CAAC,CAACQ,MAAf,CAAD,CAAR,CAA3B,CAHF,EAIEZ,CAAO,CAACI,CAAD,CACV,CAVmB,CAHM,CAe1BT,SAAS,CAAC,UAAM,CAGd,MAFAkB,SAAQ,CAACC,gBAAT,CAA0B,WAA1B,CAAuCZ,CAAvC,CAEA,CAAO,UAAM,CACXW,QAAQ,CAACE,mBAAT,CAA6B,WAA7B,CAA0Cb,CAA1C,CACD,CACF,CANQ,CAMN,EANM,CAOV,CA1BM"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @deprecated use import { getElementSize } from '@consta/uikit/useResizeObserved'
3
+ */
4
+ export declare const getElementSize: (el: HTMLElement | SVGGraphicsElement | null) => import("../../../hooks/useResizeObserved/getElementSize").ComponentSize;
@@ -0,0 +1,2 @@
1
+ import{getElementSize as fn}from"../../../hooks/useResizeObserved/getElementSize";export var getElementSize=fn;
2
+ //# sourceMappingURL=getElementSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getElementSize.js","names":["getElementSize","fn"],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/getElementSize.ts"],"sourcesContent":["import { getElementSize as fn } from '##/hooks/useResizeObserved/getElementSize';\n\n/**\n * @deprecated use import { getElementSize } from '@consta/uikit/useResizeObserved'\n */\nexport const getElementSize = fn;\n"],"mappings":"AAAA,OAASA,cAAc,GAAIC,GAA3B,uDAKA,MAAO,IAAMD,eAAc,CAAGC,EAAvB"}
@@ -0,0 +1,3 @@
1
+ export * from './useComponentSize';
2
+ export * from './getElementSize';
3
+ export * from './types';
@@ -0,0 +1,2 @@
1
+ export*from"./useComponentSize";export*from"./getElementSize";export*from"./types";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/index.ts"],"sourcesContent":["export * from './useComponentSize';\nexport * from './getElementSize';\nexport * from './types';\n"],"mappings":"AAAA,gCACA,8BACA"}
@@ -0,0 +1,4 @@
1
+ export type ComponentSize = {
2
+ width: number;
3
+ height: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ export{};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/types.ts"],"sourcesContent":["export type ComponentSize = {\n width: number;\n height: number;\n};\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { ComponentSize } from './types';
2
+ export declare const useComponentSize: (ref: React.RefObject<HTMLElement | SVGGraphicsElement>, deps?: unknown[]) => ComponentSize;
@@ -0,0 +1,2 @@
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{useMemo}from"react";import{getElementSize,useResizeObserved}from"../../../hooks/useResizeObserved";export var useComponentSize=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:[];return useResizeObserved(useMemo(function(){return[a]},[a.current].concat(_toConsumableArray(b))),getElementSize)[0]};
2
+ //# sourceMappingURL=useComponentSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComponentSize.js","names":["useMemo","getElementSize","useResizeObserved","useComponentSize","ref","deps","current"],"sources":["../../../../../../src/utils/state/useComponentSizeAtom/useComponentSize.tsx"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getElementSize, useResizeObserved } from '##/hooks/useResizeObserved';\n\nimport { ComponentSize } from './types';\n\nexport const useComponentSize = (\n ref: React.RefObject<HTMLElement | SVGGraphicsElement>,\n deps: unknown[] = [],\n): ComponentSize =>\n useResizeObserved(\n useMemo(\n () => [ref],\n // Если реф начал указывать на другой элемент, нужно обновить подписки\n [ref.current, ...deps],\n ),\n getElementSize,\n )[0];\n"],"mappings":"yEAAA,OAASA,OAAT,KAAwB,OAAxB,CAEA,OAASC,cAAT,CAAyBC,iBAAzB,wCAIA,MAAO,IAAMC,iBAAgB,CAAG,SAC9BC,CAD8B,KAE9BC,EAF8B,wDAEZ,EAFY,OAI9BH,kBAAiB,CACfF,OAAO,CACL,iBAAM,CAACI,CAAD,CAAN,CADK,EAGJA,CAAG,CAACE,OAHA,4BAGYD,CAHZ,GADQ,CAMfJ,cANe,CAAjB,CAOE,CAPF,CAJ8B,CAAzB"}
@@ -0,0 +1 @@
1
+ export * from './useElementAtomEventListener';
@@ -0,0 +1,2 @@
1
+ export*from"./useElementAtomEventListener";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useElementAtomEventListener/index.ts"],"sourcesContent":["export * from './useElementAtomEventListener';\n"],"mappings":"AAAA"}
@@ -0,0 +1,2 @@
1
+ import { AtomMut } from '@reatom/framework';
2
+ export declare const useElementAtomEventListener: <T extends HTMLElement>(elementAtom: AtomMut<T | null>, type: keyof DocumentEventMap, listener: EventListener) => void;
@@ -0,0 +1,2 @@
1
+ import{useUpdate}from"@reatom/npm-react";import{useEffect,useRef}from"react";import{setRef}from"../../setRef";export var useElementAtomEventListener=function(a,b,c){var d=useRef(null);useUpdate(function(a,c,e){var f;null===(f=d.current)||void 0===f?void 0:f.removeEventListener(b,e),null===c||void 0===c?void 0:c.addEventListener(b,e),setRef(d,c||null)},[a,c]),useEffect(function(){return function(){var a;null===(a=d.current)||void 0===a?void 0:a.removeEventListener(b,c)}},[b,c])};
2
+ //# sourceMappingURL=useElementAtomEventListener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElementAtomEventListener.js","names":["useUpdate","useEffect","useRef","setRef","useElementAtomEventListener","elementAtom","type","listener","currentRef","ctx","element","current","removeEventListener","addEventListener"],"sources":["../../../../../../src/utils/state/useElementAtomEventListener/useElementAtomEventListener.ts"],"sourcesContent":["import { AtomMut } from '@reatom/framework';\nimport { useUpdate } from '@reatom/npm-react';\nimport { useEffect, useRef } from 'react';\n\nimport { setRef } from '##/utils/setRef';\n\nexport const useElementAtomEventListener = <T extends HTMLElement>(\n elementAtom: AtomMut<T | null>,\n type: keyof DocumentEventMap,\n listener: EventListener,\n) => {\n const currentRef = useRef<T | null>(null);\n useUpdate(\n (ctx, element, listener) => {\n currentRef.current?.removeEventListener(type, listener);\n element?.addEventListener(type, listener);\n\n setRef(currentRef, element || null);\n },\n [elementAtom, listener],\n );\n useEffect(() => {\n return () => {\n currentRef.current?.removeEventListener(type, listener);\n };\n }, [type, listener]);\n};\n"],"mappings":"AACA,OAASA,SAAT,KAA0B,mBAA1B,CACA,OAASC,SAAT,CAAoBC,MAApB,KAAkC,OAAlC,CAEA,OAASC,MAAT,oBAEA,MAAO,IAAMC,4BAA2B,CAAG,SACzCC,CADyC,CAEzCC,CAFyC,CAGzCC,CAHyC,CAItC,CACH,GAAMC,EAAU,CAAGN,MAAM,CAAW,IAAX,CAAzB,CACAF,SAAS,CACP,SAACS,CAAD,CAAMC,CAAN,CAAeH,CAAf,CAA4B,iBAC1BC,CAAU,CAACG,OADe,qBAC1B,EAAoBC,mBAApB,CAAwCN,CAAxC,CAA8CC,CAA9C,CAD0B,QAE1BG,CAF0B,WAE1BA,CAF0B,QAE1BA,CAAO,CAAEG,gBAAT,CAA0BP,CAA1B,CAAgCC,CAAhC,CAF0B,CAI1BJ,MAAM,CAACK,CAAD,CAAaE,CAAO,EAAI,IAAxB,CACP,CANM,CAOP,CAACL,CAAD,CAAcE,CAAd,CAPO,CAFN,CAWHN,SAAS,CAAC,UAAM,CACd,MAAO,WAAM,iBACXO,CAAU,CAACG,OADA,qBACX,EAAoBC,mBAApB,CAAwCN,CAAxC,CAA8CC,CAA9C,CACD,CACF,CAJQ,CAIN,CAACD,CAAD,CAAOC,CAAP,CAJM,CAKV,CApBM"}
@@ -0,0 +1 @@
1
+ export * from './useKeysAtom';
@@ -0,0 +1,2 @@
1
+ export*from"./useKeysAtom";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useKeysAtom/index.ts"],"sourcesContent":["export * from './useKeysAtom';\n"],"mappings":"AAAA"}
@@ -0,0 +1,14 @@
1
+ import { AtomMut } from '@reatom/core';
2
+ import { KeyCode } from '../../types/KeyCode';
3
+ export type KeyHandlers = Partial<Record<KeyCode, (e: KeyboardEvent) => void>> & {
4
+ [key: string]: (e: KeyboardEvent) => void;
5
+ };
6
+ type UseKeysProps<E extends HTMLElement> = {
7
+ elAtom: AtomMut<E | null>;
8
+ keysAtom?: AtomMut<KeyHandlers>;
9
+ isActiveAtom?: AtomMut<boolean>;
10
+ eventHandler?: (e: KeyboardEvent) => void;
11
+ eventType?: 'keypress' | 'keydown' | 'keyup';
12
+ };
13
+ export declare const useKeysAtom: <E extends HTMLElement>({ elAtom, keysAtom, isActiveAtom, eventType, eventHandler, }: UseKeysProps<E>) => void;
14
+ export {};
@@ -0,0 +1,2 @@
1
+ import{useAction}from"@reatom/npm-react";import{useElementAtomEventListener}from"../useElementAtomEventListener";import{useSendToAtom}from"../useSendToAtom";export var useKeysAtom=function(a){var b=a.elAtom,c=a.keysAtom,d=a.isActiveAtom,e=a.eventType,f=void 0===e?"keydown":e,g=a.eventHandler,h=useSendToAtom([g]),i=useAction(function(a,b){var e,f,g=c&&a.get(c),i=d&&a.get(d);if(g&&i){var j;null===(j=g[b.code]||g[b.key])||void 0===j?void 0:j(b)}null===(e=(f=a.get(h))[0])||void 0===e?void 0:e.call(f,b)});useElementAtomEventListener(b,f,i)};
2
+ //# sourceMappingURL=useKeysAtom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useKeysAtom.js","names":["useAction","useElementAtomEventListener","useSendToAtom","useKeysAtom","elAtom","keysAtom","isActiveAtom","eventType","eventHandler","eventHandlerAtom","fn","ctx","e","keys","get","isActive","code","key"],"sources":["../../../../../../src/utils/state/useKeysAtom/useKeysAtom.ts"],"sourcesContent":["import { AtomMut } from '@reatom/core';\nimport { useAction } from '@reatom/npm-react';\n\nimport { useElementAtomEventListener } from '##/utils/state/useElementAtomEventListener';\nimport { useSendToAtom } from '##/utils/state/useSendToAtom';\nimport { KeyCode } from '##/utils/types/KeyCode';\n\nexport type KeyHandlers = Partial<\n Record<KeyCode, (e: KeyboardEvent) => void>\n> & {\n [key: string]: (e: KeyboardEvent) => void;\n};\n\ntype UseKeysProps<E extends HTMLElement> = {\n elAtom: AtomMut<E | null>;\n keysAtom?: AtomMut<KeyHandlers>;\n isActiveAtom?: AtomMut<boolean>;\n eventHandler?: (e: KeyboardEvent) => void;\n eventType?: 'keypress' | 'keydown' | 'keyup';\n};\n\nexport const useKeysAtom = <E extends HTMLElement>({\n elAtom,\n keysAtom,\n isActiveAtom,\n eventType = 'keydown',\n eventHandler,\n}: UseKeysProps<E>) => {\n const eventHandlerAtom = useSendToAtom([eventHandler]);\n const fn = useAction((ctx, e: KeyboardEvent) => {\n const keys = keysAtom && ctx.get(keysAtom);\n const isActive = isActiveAtom && ctx.get(isActiveAtom);\n if (keys && isActive) {\n (keys[e.code as KeyCode] || keys[e.key as KeyCode])?.(e);\n }\n ctx.get(eventHandlerAtom)[0]?.(e);\n });\n\n useElementAtomEventListener(elAtom, eventType, fn as EventListener);\n};\n"],"mappings":"AACA,OAASA,SAAT,KAA0B,mBAA1B,CAEA,OAASC,2BAAT,sCACA,OAASC,aAAT,wBAiBA,MAAO,IAAMC,YAAW,CAAG,WAMJ,IALrBC,EAKqB,GALrBA,MAKqB,CAJrBC,CAIqB,GAJrBA,QAIqB,CAHrBC,CAGqB,GAHrBA,YAGqB,KAFrBC,SAEqB,CAFrBA,CAEqB,YAFT,SAES,GADrBC,CACqB,GADrBA,YACqB,CACfC,CAAgB,CAAGP,aAAa,CAAC,CAACM,CAAD,CAAD,CADjB,CAEfE,CAAE,CAAGV,SAAS,CAAC,SAACW,CAAD,CAAMC,CAAN,CAA2B,SACxCC,CAAI,CAAGR,CAAQ,EAAIM,CAAG,CAACG,GAAJ,CAAQT,CAAR,CADqB,CAExCU,CAAQ,CAAGT,CAAY,EAAIK,CAAG,CAACG,GAAJ,CAAQR,CAAR,CAFa,CAG9C,GAAIO,CAAI,EAAIE,CAAZ,CAAsB,iBACnBF,CAAI,CAACD,CAAC,CAACI,IAAH,CAAJ,EAA2BH,CAAI,CAACD,CAAC,CAACK,GAAH,CADZ,qBACpB,EAAsDL,CAAtD,CACD,CAL6C,UAM9C,GAAAD,CAAG,CAACG,GAAJ,CAAQL,CAAR,GAA0B,CAA1B,CAN8C,qBAM9C,SAA+BG,CAA/B,CACD,CAPmB,CAFC,CAWrBX,2BAA2B,CAACG,CAAD,CAASG,CAAT,CAAoBG,CAApB,CAC5B,CAlBM"}
@@ -1,2 +1,2 @@
1
1
  import { RefCallback } from 'react';
2
- export declare const useRefAtom: <T extends HTMLElement>() => readonly [import("@reatom/core").AtomMut<T | null>, RefCallback<T>];
2
+ export declare const useRefAtom: <T extends HTMLElement>() => readonly [import("@reatom/core").AtomMut<T | null>, RefCallback<T | null>];
@@ -1 +1 @@
1
- {"version":3,"file":"useRefAtom.js","names":["useAction","useCreateAtom","useRefAtom","atom","ref","ctx","el"],"sources":["../../../../../../src/utils/state/useRefAtom/useRefAtom.ts"],"sourcesContent":["import { useAction } from '@reatom/npm-react';\nimport { RefCallback } from 'react';\n\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\n\nexport const useRefAtom = <T extends HTMLElement>() => {\n const atom = useCreateAtom<T | null>(null);\n const ref: RefCallback<T> = useAction((ctx, el: T) => atom(ctx, el));\n return [atom, ref] as const;\n};\n"],"mappings":"AAAA,OAASA,SAAT,KAA0B,mBAA1B,CAGA,OAASC,aAAT,wBAEA,MAAO,IAAMC,WAAU,CAAG,UAA6B,IAC/CC,EAAI,CAAGF,aAAa,CAAW,IAAX,CAD2B,CAE/CG,CAAmB,CAAGJ,SAAS,CAAC,SAACK,CAAD,CAAMC,CAAN,QAAgBH,EAAI,CAACE,CAAD,CAAMC,CAAN,CAApB,CAAD,CAFgB,CAGrD,MAAO,CAACH,CAAD,CAAOC,CAAP,CACR,CAJM"}
1
+ {"version":3,"file":"useRefAtom.js","names":["useAction","useCreateAtom","useRefAtom","atom","ref","ctx","el"],"sources":["../../../../../../src/utils/state/useRefAtom/useRefAtom.ts"],"sourcesContent":["import { useAction } from '@reatom/npm-react';\nimport { RefCallback } from 'react';\n\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\n\nexport const useRefAtom = <T extends HTMLElement>() => {\n const atom = useCreateAtom<T | null>(null);\n const ref: RefCallback<T | null> = useAction((ctx, el: T) => atom(ctx, el));\n return [atom, ref] as const;\n};\n"],"mappings":"AAAA,OAASA,SAAT,KAA0B,mBAA1B,CAGA,OAASC,aAAT,wBAEA,MAAO,IAAMC,WAAU,CAAG,UAA6B,IAC/CC,EAAI,CAAGF,aAAa,CAAW,IAAX,CAD2B,CAE/CG,CAA0B,CAAGJ,SAAS,CAAC,SAACK,CAAD,CAAMC,CAAN,QAAgBH,EAAI,CAACE,CAAD,CAAMC,CAAN,CAApB,CAAD,CAFS,CAGrD,MAAO,CAACH,CAAD,CAAOC,CAAP,CACR,CAJM"}
@@ -0,0 +1 @@
1
+ export * from './useResizeObservedAtom';
@@ -0,0 +1,2 @@
1
+ export*from"./useResizeObservedAtom";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/utils/state/useResizeObservedAtom/index.ts"],"sourcesContent":["export * from './useResizeObservedAtom';\n"],"mappings":"AAAA"}
@@ -0,0 +1,2 @@
1
+ import { AtomMut } from '@reatom/framework';
2
+ export declare const useResizeObservedAtom: <ELEMENT extends HTMLElement | null, RETURN_TYPE>(elementsAtom: AtomMut<ELEMENT[]>, mapper: (el: ELEMENT | null) => RETURN_TYPE) => AtomMut<(RETURN_TYPE | undefined)[]>;
@@ -0,0 +1,2 @@
1
+ function _createForOfIteratorHelper(a,b){var c="undefined"!=typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(!c){if(Array.isArray(a)||(c=_unsupportedIterableToArray(a))||b&&a&&"number"==typeof a.length){c&&(a=c);var d=0,e=function(){};return{s:e,n:function n(){return d>=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}import{useAction,useUpdate}from"@reatom/npm-react";import{useEffect,useMemo}from"react";import{useCreateAtom}from"../useCreateAtom";import{useSendToAtom}from"../useSendToAtom";export var useResizeObservedAtom=function(a,b){var c=useSendToAtom([b]),d=useCreateAtom([]),e=useAction(function(b){return d(b,b.get(a).map(function(a){return b.get(c)[0](a)}))}),f=useMemo(function(){return new ResizeObserver(e)},[]);return useUpdate(function(a,b){e(),f.disconnect();var c,d=_createForOfIteratorHelper(b);try{for(d.s();!(c=d.n()).done;){var g=c.value;g&&f.observe(g)}}catch(a){d.e(a)}finally{d.f()}},[a]),useEffect(function(){return function(){f.disconnect()}},[]),d};
2
+ //# sourceMappingURL=useResizeObservedAtom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useResizeObservedAtom.js","names":["useAction","useUpdate","useEffect","useMemo","useCreateAtom","useSendToAtom","useResizeObservedAtom","elementsAtom","mapper","mapperAtom","stateAtom","update","ctx","get","map","el","resizeObserver","ResizeObserver","elements","disconnect","observe"],"sources":["../../../../../../src/utils/state/useResizeObservedAtom/useResizeObservedAtom.ts"],"sourcesContent":["import { AtomMut } from '@reatom/framework';\nimport { useAction, useUpdate } from '@reatom/npm-react';\nimport { useEffect, useMemo } from 'react';\n\nimport { useCreateAtom } from '##/utils/state/useCreateAtom';\nimport { useSendToAtom } from '##/utils/state/useSendToAtom';\n\nexport const useResizeObservedAtom = <\n ELEMENT extends HTMLElement | null,\n RETURN_TYPE,\n>(\n elementsAtom: AtomMut<ELEMENT[]>,\n mapper: (el: ELEMENT | null) => RETURN_TYPE,\n) => {\n const mapperAtom = useSendToAtom([mapper]);\n const stateAtom = useCreateAtom<(RETURN_TYPE | undefined)[]>([]);\n\n const update = useAction((ctx) =>\n stateAtom(\n ctx,\n ctx.get(elementsAtom).map((el) => ctx.get(mapperAtom)[0](el)),\n ),\n );\n\n const resizeObserver = useMemo(() => new ResizeObserver(update), []);\n\n useUpdate(\n (ctx, elements) => {\n update();\n resizeObserver.disconnect();\n for (const el of elements) {\n el && resizeObserver.observe(el);\n }\n },\n [elementsAtom],\n );\n\n useEffect(() => {\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n return stateAtom;\n};\n"],"mappings":"qpCACA,OAASA,SAAT,CAAoBC,SAApB,KAAqC,mBAArC,CACA,OAASC,SAAT,CAAoBC,OAApB,KAAmC,OAAnC,CAEA,OAASC,aAAT,wBACA,OAASC,aAAT,wBAEA,MAAO,IAAMC,sBAAqB,CAAG,SAInCC,CAJmC,CAKnCC,CALmC,CAMhC,IACGC,EAAU,CAAGJ,aAAa,CAAC,CAACG,CAAD,CAAD,CAD7B,CAEGE,CAAS,CAAGN,aAAa,CAA8B,EAA9B,CAF5B,CAIGO,CAAM,CAAGX,SAAS,CAAC,SAACY,CAAD,QACvBF,EAAS,CACPE,CADO,CAEPA,CAAG,CAACC,GAAJ,CAAQN,CAAR,EAAsBO,GAAtB,CAA0B,SAACC,CAAD,QAAQH,EAAG,CAACC,GAAJ,CAAQJ,CAAR,EAAoB,CAApB,EAAuBM,CAAvB,CAAR,CAA1B,CAFO,CADc,CAAD,CAJrB,CAWGC,CAAc,CAAGb,OAAO,CAAC,iBAAM,IAAIc,eAAJ,CAAmBN,CAAnB,CAAN,CAAD,CAAmC,EAAnC,CAX3B,CA8BH,MAjBAV,UAAS,CACP,SAACW,CAAD,CAAMM,CAAN,CAAmB,CACjBP,CAAM,EADW,CAEjBK,CAAc,CAACG,UAAf,EAFiB,oCAGAD,CAHA,MAGjB,2BAA2B,IAAhBH,EAAgB,SACzBA,CAAE,EAAIC,CAAc,CAACI,OAAf,CAAuBL,CAAvB,CACP,CALgB,+BAMlB,CAPM,CAQP,CAACR,CAAD,CARO,CAiBT,CANAL,SAAS,CAAC,UAAM,CACd,MAAO,WAAM,CACXc,CAAc,CAACG,UAAf,EACD,CACF,CAJQ,CAIN,EAJM,CAMT,CAAOT,CACR,CArCM"}
@@ -1,2 +1,2 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{reatomContext,useCreateCtx}from"@reatom/npm-react";import React,{createElement,forwardRef,useContext}from"react";var ProviderWithCtx=function(a){var b=a.children;return React.createElement(reatomContext.Provider,{value:useCreateCtx()},b)};export var withCtx=function(a){return forwardRef(function(b,c){var d=createElement(a,_objectSpread(_objectSpread({},b),{},{ref:c}));return useContext(reatomContext)?d:React.createElement(ProviderWithCtx,null,d)})};
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{reatomContext,useCreateCtx}from"@reatom/npm-react";import React,{createElement,forwardRef,useContext}from"react";var ProviderWithCtx=function(a){var b=a.children;return createElement(reatomContext.Provider,{value:useCreateCtx()},b)};export var withCtx=function(a){return forwardRef(function(b,c){var d=createElement(a,_objectSpread(_objectSpread({},b),{},{ref:c}));return useContext(reatomContext)?d:React.createElement(ProviderWithCtx,null,d)})};
2
2
  //# sourceMappingURL=withCtx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withCtx.js","names":["reatomContext","useCreateCtx","React","createElement","forwardRef","useContext","ProviderWithCtx","children","withCtx","component","props","ref","element"],"sources":["../../../../../../src/utils/state/withCtx/withCtx.tsx"],"sourcesContent":["import { reatomContext, useCreateCtx } from '@reatom/npm-react';\nimport React, { createElement, forwardRef, useContext } from 'react';\n\nconst ProviderWithCtx = ({ children }: { children: React.ReactNode }) => (\n <reatomContext.Provider value={useCreateCtx()}>\n {children}\n </reatomContext.Provider>\n);\n\nexport const withCtx = <C, P extends {}>(component: C): C =>\n forwardRef<HTMLElement, P>((props, ref) => {\n const element = createElement(\n component as unknown as React.ComponentType<P>,\n {\n ...(props as P),\n ref,\n },\n );\n\n if (useContext(reatomContext)) {\n return element;\n }\n\n return <ProviderWithCtx>{element}</ProviderWithCtx>;\n }) as unknown as C;\n"],"mappings":"qqBAAA,OAASA,aAAT,CAAwBC,YAAxB,KAA4C,mBAA5C,CACA,MAAOC,MAAP,EAAgBC,aAAhB,CAA+BC,UAA/B,CAA2CC,UAA3C,KAA6D,OAA7D,CAEA,GAAMC,gBAAe,CAAG,eAAGC,EAAH,GAAGA,QAAH,OACtB,qBAAC,aAAD,CAAe,QAAf,EAAwB,KAAK,CAAEN,YAAY,EAA3C,EACGM,CADH,CADsB,CAAxB,CAMA,MAAO,IAAMC,QAAO,CAAG,SAAkBC,CAAlB,QACrBL,WAAU,CAAiB,SAACM,CAAD,CAAQC,CAAR,CAAgB,CACzC,GAAMC,EAAO,CAAGT,aAAa,CAC3BM,CAD2B,gCAGrBC,CAHqB,MAIzBC,GAAG,CAAHA,CAJyB,GAA7B,CADyC,MASrCN,WAAU,CAACL,aAAD,CAT2B,CAUhCY,CAVgC,CAalC,oBAAC,eAAD,MAAkBA,CAAlB,CACR,CAdS,CADW,CAAhB"}
1
+ {"version":3,"file":"withCtx.js","names":["reatomContext","useCreateCtx","React","createElement","forwardRef","useContext","ProviderWithCtx","children","Provider","value","withCtx","component","props","ref","element"],"sources":["../../../../../../src/utils/state/withCtx/withCtx.tsx"],"sourcesContent":["import { reatomContext, useCreateCtx } from '@reatom/npm-react';\nimport React, { createElement, forwardRef, useContext } from 'react';\n\nconst ProviderWithCtx = ({ children }: { children: React.ReactNode }) =>\n createElement(reatomContext.Provider, { value: useCreateCtx() }, children);\n\nexport const withCtx = <C, P extends {}>(component: C): C =>\n forwardRef<HTMLElement, P>((props, ref) => {\n const element = createElement(\n component as unknown as React.ComponentType<P>,\n {\n ...(props as P),\n ref,\n },\n );\n\n if (useContext(reatomContext)) {\n return element;\n }\n\n return <ProviderWithCtx>{element}</ProviderWithCtx>;\n }) as unknown as C;\n"],"mappings":"qqBAAA,OAASA,aAAT,CAAwBC,YAAxB,KAA4C,mBAA5C,CACA,MAAOC,MAAP,EAAgBC,aAAhB,CAA+BC,UAA/B,CAA2CC,UAA3C,KAA6D,OAA7D,CAEA,GAAMC,gBAAe,CAAG,eAAGC,EAAH,GAAGA,QAAH,OACtBJ,cAAa,CAACH,aAAa,CAACQ,QAAf,CAAyB,CAAEC,KAAK,CAAER,YAAY,EAArB,CAAzB,CAAoDM,CAApD,CADS,CAAxB,CAGA,MAAO,IAAMG,QAAO,CAAG,SAAkBC,CAAlB,QACrBP,WAAU,CAAiB,SAACQ,CAAD,CAAQC,CAAR,CAAgB,CACzC,GAAMC,EAAO,CAAGX,aAAa,CAC3BQ,CAD2B,gCAGrBC,CAHqB,MAIzBC,GAAG,CAAHA,CAJyB,GAA7B,CADyC,MASrCR,WAAU,CAACL,aAAD,CAT2B,CAUhCc,CAVgC,CAalC,oBAAC,eAAD,MAAkBA,CAAlB,CACR,CAdS,CADW,CAAhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@consta/uikit",
3
- "version": "5.25.1",
3
+ "version": "5.27.0",
4
4
  "keywords": [
5
5
  "ui-kit",
6
6
  "design-system",
@@ -16,7 +16,8 @@
16
16
  "peerDependencies": {
17
17
  "@bem-react/classname": "^1.6.0",
18
18
  "@bem-react/classnames": "^1.3.10",
19
- "@consta/icons": "^1.0.0",
19
+ "@consta/icons": "^1.3.0",
20
+ "@consta/table": "^0.7.0",
20
21
  "@reatom/core": "^3.10.1",
21
22
  "@reatom/npm-react": "^3.10.6",
22
23
  "compute-scroll-into-view": "^3.1.1",