@finam/web-ui-kit-components 3.33.2 → 3.34.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 (249) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/Avatar/index.d.ts +1 -3
  3. package/dist/Avatar/index.d.ts.map +1 -1
  4. package/dist/Avatar/index.js +1 -5
  5. package/dist/Avatar/utils.d.ts.map +1 -1
  6. package/dist/Avatar/utils.js.map +1 -1
  7. package/dist/Breadcrumbs/Breadcrumb/Breadcrumb.d.ts +2 -1
  8. package/dist/Breadcrumbs/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  9. package/dist/Breadcrumbs/Breadcrumb/Breadcrumb.js.map +1 -1
  10. package/dist/Breadcrumbs/utils/getRenderOnPageItems.d.ts.map +1 -1
  11. package/dist/Breadcrumbs/utils/getRenderOnPageItems.js +7 -8
  12. package/dist/Breadcrumbs/utils/getRenderOnPageItems.js.map +1 -1
  13. package/dist/Calendar/Calendar.js +8 -1
  14. package/dist/Calendar/Calendar.js.map +1 -1
  15. package/dist/Calendar/Calendar.styles.css +1 -1
  16. package/dist/Calendar/Calendar.styles.d.ts +1 -1
  17. package/dist/Calendar/Calendar.styles.d.ts.map +1 -1
  18. package/dist/Calendar/Calendar.styles.js +1 -1
  19. package/dist/Calendar/Calendar.styles.js.map +1 -1
  20. package/dist/Calendar/Day/Day.d.ts +3 -2
  21. package/dist/Calendar/Day/Day.d.ts.map +1 -1
  22. package/dist/Calendar/Day/Day.js +5 -2
  23. package/dist/Calendar/Day/Day.js.map +1 -1
  24. package/dist/Calendar/Day/Day.styles.css +2 -2
  25. package/dist/Calendar/Day/Day.styles.d.ts.map +1 -1
  26. package/dist/Calendar/Day/Day.styles.js.map +1 -1
  27. package/dist/Calendar/Day/index.d.ts +1 -3
  28. package/dist/Calendar/Day/index.d.ts.map +1 -1
  29. package/dist/Calendar/Day/index.js +1 -5
  30. package/dist/Calendar/DayWrapper.d.ts +1 -1
  31. package/dist/Calendar/DayWrapper.d.ts.map +1 -1
  32. package/dist/Calendar/DayWrapper.js +15 -7
  33. package/dist/Calendar/DayWrapper.js.map +1 -1
  34. package/dist/Calendar/SelectMonthTable/SelectMonthTable.styles.css +1 -1
  35. package/dist/Calendar/SelectMonthTable/SelectMonthTable.styles.d.ts +1 -1
  36. package/dist/Calendar/SelectMonthTable/SelectMonthTable.styles.d.ts.map +1 -1
  37. package/dist/Calendar/SelectMonthTable/SelectMonthTable.styles.js.map +1 -1
  38. package/dist/Calendar/SelectYearTable/SelectYearTable.styles.css +1 -1
  39. package/dist/Calendar/SelectYearTable/SelectYearTable.styles.d.ts +1 -1
  40. package/dist/Calendar/SelectYearTable/SelectYearTable.styles.d.ts.map +1 -1
  41. package/dist/Calendar/SelectYearTable/SelectYearTable.styles.js.map +1 -1
  42. package/dist/Calendar/SlideTransition/index.d.ts +1 -3
  43. package/dist/Calendar/SlideTransition/index.d.ts.map +1 -1
  44. package/dist/Calendar/SlideTransition/index.js +1 -5
  45. package/dist/Calendar/utils.js +9 -9
  46. package/dist/Calendar/utils.js.map +1 -1
  47. package/dist/CheckboxField/index.d.ts +1 -3
  48. package/dist/CheckboxField/index.d.ts.map +1 -1
  49. package/dist/CheckboxField/index.js +1 -5
  50. package/dist/CheckboxField/types.d.ts +2 -2
  51. package/dist/CheckboxField/types.d.ts.map +1 -1
  52. package/dist/Chip/index.d.ts +1 -3
  53. package/dist/Chip/index.d.ts.map +1 -1
  54. package/dist/Chip/index.js +1 -5
  55. package/dist/ClickAwayListener/ClickAwayListener.d.ts.map +1 -1
  56. package/dist/ClickAwayListener/ClickAwayListener.js +3 -1
  57. package/dist/ClickAwayListener/ClickAwayListener.js.map +1 -1
  58. package/dist/ClickAwayListener/index.d.ts +1 -3
  59. package/dist/ClickAwayListener/index.d.ts.map +1 -1
  60. package/dist/ClickAwayListener/index.js +1 -5
  61. package/dist/Counter/index.d.ts +1 -3
  62. package/dist/Counter/index.d.ts.map +1 -1
  63. package/dist/Counter/index.js +1 -5
  64. package/dist/DatePicker/DatePicker.d.ts.map +1 -1
  65. package/dist/DatePicker/DatePicker.js +1 -1
  66. package/dist/DatePicker/DatePicker.js.map +1 -1
  67. package/dist/DateTimePeriod/index.d.ts +2 -5
  68. package/dist/DateTimePeriod/index.d.ts.map +1 -1
  69. package/dist/DateTimePeriod/index.js +1 -5
  70. package/dist/DateTimePicker/index.d.ts +1 -3
  71. package/dist/DateTimePicker/index.d.ts.map +1 -1
  72. package/dist/DateTimePicker/index.js +1 -5
  73. package/dist/Dialog/Dialog.js +1 -1
  74. package/dist/Dialog/Dialog.js.map +1 -1
  75. package/dist/DialogActions/index.d.ts +1 -3
  76. package/dist/DialogActions/index.d.ts.map +1 -1
  77. package/dist/DialogActions/index.js +1 -5
  78. package/dist/DialogContent/index.d.ts +1 -3
  79. package/dist/DialogContent/index.d.ts.map +1 -1
  80. package/dist/DialogContent/index.js +1 -5
  81. package/dist/DialogTitle/index.d.ts +1 -3
  82. package/dist/DialogTitle/index.d.ts.map +1 -1
  83. package/dist/DialogTitle/index.js +1 -5
  84. package/dist/Divider/index.d.ts +1 -3
  85. package/dist/Divider/index.d.ts.map +1 -1
  86. package/dist/Divider/index.js +1 -5
  87. package/dist/DraggablePopover/DraggablePopover.d.ts.map +1 -1
  88. package/dist/DraggablePopover/DraggablePopover.js +2 -2
  89. package/dist/DraggablePopover/DraggablePopover.js.map +1 -1
  90. package/dist/DraggablePopover/layersManager.d.ts +1 -1
  91. package/dist/DraggablePopover/layersManager.d.ts.map +1 -1
  92. package/dist/DraggablePopover/layersManager.js.map +1 -1
  93. package/dist/DropDownMenu/index.d.ts +1 -3
  94. package/dist/DropDownMenu/index.d.ts.map +1 -1
  95. package/dist/DropDownMenu/index.js +1 -5
  96. package/dist/FeatureCallout/FeatureCalloutActions/index.d.ts +1 -3
  97. package/dist/FeatureCallout/FeatureCalloutActions/index.d.ts.map +1 -1
  98. package/dist/FeatureCallout/FeatureCalloutActions/index.js +1 -5
  99. package/dist/FeatureCallout/FeatureCalloutText/index.d.ts +1 -3
  100. package/dist/FeatureCallout/FeatureCalloutText/index.d.ts.map +1 -1
  101. package/dist/FeatureCallout/FeatureCalloutText/index.js +1 -5
  102. package/dist/FeatureCallout/FeatureCalloutTitle/index.d.ts +1 -3
  103. package/dist/FeatureCallout/FeatureCalloutTitle/index.d.ts.map +1 -1
  104. package/dist/FeatureCallout/FeatureCalloutTitle/index.js +1 -5
  105. package/dist/FeatureCallout/index.d.ts +4 -7
  106. package/dist/FeatureCallout/index.d.ts.map +1 -1
  107. package/dist/FeatureCallout/index.js +1 -5
  108. package/dist/FeatureCallout/utils.d.ts.map +1 -1
  109. package/dist/FeatureCallout/utils.js +1 -37
  110. package/dist/FeatureCallout/utils.js.map +1 -1
  111. package/dist/FieldHint/index.d.ts +1 -3
  112. package/dist/FieldHint/index.d.ts.map +1 -1
  113. package/dist/FieldHint/index.js +1 -5
  114. package/dist/FilterButton/FilterButton.js +1 -1
  115. package/dist/FilterButton/FilterButton.js.map +1 -1
  116. package/dist/FormGroup/index.d.ts +1 -3
  117. package/dist/FormGroup/index.d.ts.map +1 -1
  118. package/dist/FormGroup/index.js +1 -5
  119. package/dist/Loader/index.d.ts +1 -3
  120. package/dist/Loader/index.d.ts.map +1 -1
  121. package/dist/Loader/index.js +1 -5
  122. package/dist/LoaderBackdrop/index.d.ts +1 -3
  123. package/dist/LoaderBackdrop/index.d.ts.map +1 -1
  124. package/dist/LoaderBackdrop/index.js +1 -5
  125. package/dist/LoaderDots/index.d.ts +1 -3
  126. package/dist/LoaderDots/index.d.ts.map +1 -1
  127. package/dist/LoaderDots/index.js +1 -5
  128. package/dist/MarketingButton/useMarketingAnimations.d.ts +2 -2
  129. package/dist/MarketingButton/useMarketingAnimations.d.ts.map +1 -1
  130. package/dist/MarketingButton/useMarketingAnimations.js +27 -14
  131. package/dist/MarketingButton/useMarketingAnimations.js.map +1 -1
  132. package/dist/Modal/ModalManager.d.ts +1 -1
  133. package/dist/Modal/ModalManager.d.ts.map +1 -1
  134. package/dist/Modal/ModalManager.js.map +1 -1
  135. package/dist/Modal/Portal.js +1 -1
  136. package/dist/Modal/Portal.js.map +1 -1
  137. package/dist/ModalsProvider/index.d.ts +1 -3
  138. package/dist/ModalsProvider/index.d.ts.map +1 -1
  139. package/dist/ModalsProvider/index.js +1 -6
  140. package/dist/MultiSelectField/MultiSelectField.d.ts.map +1 -1
  141. package/dist/MultiSelectField/MultiSelectField.js +3 -8
  142. package/dist/MultiSelectField/MultiSelectField.js.map +1 -1
  143. package/dist/MultiSelectField/index.d.ts +1 -3
  144. package/dist/MultiSelectField/index.d.ts.map +1 -1
  145. package/dist/MultiSelectField/index.js +1 -5
  146. package/dist/NumberTextField/NumberTextField.js +4 -4
  147. package/dist/NumberTextField/NumberTextField.js.map +1 -1
  148. package/dist/NumberTextField/index.d.ts +1 -3
  149. package/dist/NumberTextField/index.d.ts.map +1 -1
  150. package/dist/NumberTextField/index.js +1 -5
  151. package/dist/NumberTextField/utils.d.ts.map +1 -1
  152. package/dist/NumberTextField/utils.js +1 -1
  153. package/dist/NumberTextField/utils.js.map +1 -1
  154. package/dist/PaginatorNumber/NavButton/index.d.ts +1 -3
  155. package/dist/PaginatorNumber/NavButton/index.d.ts.map +1 -1
  156. package/dist/PaginatorNumber/NavButton/index.js +1 -5
  157. package/dist/PaginatorNumber/PageButton/index.d.ts +1 -3
  158. package/dist/PaginatorNumber/PageButton/index.d.ts.map +1 -1
  159. package/dist/PaginatorNumber/PageButton/index.js +1 -5
  160. package/dist/PaginatorNumber/index.d.ts +1 -3
  161. package/dist/PaginatorNumber/index.d.ts.map +1 -1
  162. package/dist/PaginatorNumber/index.js +1 -5
  163. package/dist/PaginatorOverflow/NavButton/index.d.ts +1 -3
  164. package/dist/PaginatorOverflow/NavButton/index.d.ts.map +1 -1
  165. package/dist/PaginatorOverflow/NavButton/index.js +1 -5
  166. package/dist/PaginatorOverflow/PaginatorOverflow.js +2 -2
  167. package/dist/PaginatorOverflow/PaginatorOverflow.js.map +1 -1
  168. package/dist/PaginatorOverflow/index.d.ts +1 -3
  169. package/dist/PaginatorOverflow/index.d.ts.map +1 -1
  170. package/dist/PaginatorOverflow/index.js +1 -5
  171. package/dist/Paper/types.d.ts +6 -1
  172. package/dist/Paper/types.d.ts.map +1 -1
  173. package/dist/Paper/utils.d.ts +2 -2
  174. package/dist/PickersUtilsProvider/defaultDateFormatUtils.js +1 -1
  175. package/dist/PickersUtilsProvider/defaultDateFormatUtils.js.map +1 -1
  176. package/dist/PickersUtilsProvider/defaultTimeFormatUtils.js +4 -4
  177. package/dist/PickersUtilsProvider/defaultTimeFormatUtils.js.map +1 -1
  178. package/dist/PickersUtilsProvider/utils.js +1 -1
  179. package/dist/PickersUtilsProvider/utils.js.map +1 -1
  180. package/dist/ProductCard/layouts/ipo/Content.d.ts +2 -2
  181. package/dist/ProductCard/layouts/ipo/Content.d.ts.map +1 -1
  182. package/dist/ProductCard/layouts/ipo/Content.js.map +1 -1
  183. package/dist/ProductCard/utils.d.ts.map +1 -1
  184. package/dist/ProductCard/utils.js +4 -1
  185. package/dist/ProductCard/utils.js.map +1 -1
  186. package/dist/Skeleton/index.d.ts +2 -3
  187. package/dist/Skeleton/index.d.ts.map +1 -1
  188. package/dist/Skeleton/index.js +1 -5
  189. package/dist/Slider/Slider.js +9 -5
  190. package/dist/Slider/Slider.js.map +1 -1
  191. package/dist/Snackbar/Snackbar.js.map +1 -1
  192. package/dist/Stepper/index.d.ts +2 -3
  193. package/dist/Stepper/index.d.ts.map +1 -1
  194. package/dist/Stepper/index.js +1 -5
  195. package/dist/Tab/Tab.d.ts +2 -1
  196. package/dist/Tab/Tab.d.ts.map +1 -1
  197. package/dist/Tab/Tab.js +1 -1
  198. package/dist/Tab/Tab.js.map +1 -1
  199. package/dist/Tag/Tag.d.ts.map +1 -1
  200. package/dist/Tag/Tag.js +2 -13
  201. package/dist/Tag/Tag.js.map +1 -1
  202. package/dist/Tag/Tag.styles.css +1 -1
  203. package/dist/Tag/Tag.styles.d.ts.map +1 -1
  204. package/dist/Tag/Tag.styles.js.map +1 -1
  205. package/dist/TextArea/TextArea.d.ts +9 -4
  206. package/dist/TextArea/TextArea.d.ts.map +1 -1
  207. package/dist/TextArea/TextArea.js +58 -9
  208. package/dist/TextArea/TextArea.js.map +1 -1
  209. package/dist/TextArea/TextArea.styles.css +2 -0
  210. package/dist/TextArea/TextArea.styles.d.ts +2 -0
  211. package/dist/TextArea/TextArea.styles.d.ts.map +1 -1
  212. package/dist/TextArea/TextArea.styles.js +3 -1
  213. package/dist/TextArea/TextArea.styles.js.map +1 -1
  214. package/dist/Tooltip/Tooltip.js.map +1 -1
  215. package/dist/index.js +1 -1
  216. package/package.json +2 -1
  217. package/dist/Avatar/index.js.map +0 -1
  218. package/dist/Calendar/Day/index.js.map +0 -1
  219. package/dist/Calendar/SlideTransition/index.js.map +0 -1
  220. package/dist/CheckboxField/index.js.map +0 -1
  221. package/dist/Chip/index.js.map +0 -1
  222. package/dist/ClickAwayListener/index.js.map +0 -1
  223. package/dist/Counter/index.js.map +0 -1
  224. package/dist/DateTimePeriod/index.js.map +0 -1
  225. package/dist/DateTimePicker/index.js.map +0 -1
  226. package/dist/DialogActions/index.js.map +0 -1
  227. package/dist/DialogContent/index.js.map +0 -1
  228. package/dist/DialogTitle/index.js.map +0 -1
  229. package/dist/Divider/index.js.map +0 -1
  230. package/dist/DropDownMenu/index.js.map +0 -1
  231. package/dist/FeatureCallout/FeatureCalloutActions/index.js.map +0 -1
  232. package/dist/FeatureCallout/FeatureCalloutText/index.js.map +0 -1
  233. package/dist/FeatureCallout/FeatureCalloutTitle/index.js.map +0 -1
  234. package/dist/FeatureCallout/index.js.map +0 -1
  235. package/dist/FieldHint/index.js.map +0 -1
  236. package/dist/FormGroup/index.js.map +0 -1
  237. package/dist/Loader/index.js.map +0 -1
  238. package/dist/LoaderBackdrop/index.js.map +0 -1
  239. package/dist/LoaderDots/index.js.map +0 -1
  240. package/dist/ModalsProvider/index.js.map +0 -1
  241. package/dist/MultiSelectField/index.js.map +0 -1
  242. package/dist/NumberTextField/index.js.map +0 -1
  243. package/dist/PaginatorNumber/NavButton/index.js.map +0 -1
  244. package/dist/PaginatorNumber/PageButton/index.js.map +0 -1
  245. package/dist/PaginatorNumber/index.js.map +0 -1
  246. package/dist/PaginatorOverflow/NavButton/index.js.map +0 -1
  247. package/dist/PaginatorOverflow/index.js.map +0 -1
  248. package/dist/Skeleton/index.js.map +0 -1
  249. package/dist/Stepper/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea/TextArea.js","sources":["../../src/TextArea/TextArea.tsx"],"sourcesContent":["import { Ref, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type * as React from 'react';\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize';\nimport throttle from 'lodash/throttle.js';\nimport classnames from 'clsx';\nimport type { Placement, InputSize, InputVariant } from '../types.js';\nimport Input, { InputProps } from '../Input/index.js';\nimport { setRef } from '../utils/withForwardedRef.js';\nimport { inputStyles } from './TextArea.styles.js';\n\ntype InheritedInputProps = Pick<InputProps,\n| 'hideReadOnlyIcon'\n| 'singleLine'\n| 'hintTooltipMaxWidth'\n| 'hintTooltipVariant'\n| 'alignRight'\n| 'hideEmptyHint'\n| 'error'\n>;\n\nexport interface Props extends Omit<TextareaAutosizeProps & InheritedInputProps, 'as'> {\n /** Состояние значения поля ввода */\n value?: string;\n /** Текст сообщения подсказки */\n message?: React.ReactNode;\n /** Содержимое label поля ввода */\n label?: string;\n /** Вариант отображения поля ввода */\n variant?: InputVariant;\n /** Размер поля ввода */\n size?: InputSize;\n /** Растяжение компонента по ширине контейнера */\n fullWidth?: boolean;\n /** Сообщение об ошибке для подсказки */\n errorText?: string;\n /** Флаг отображения подсказки в виде всплывающего окна */\n hintTooltip?: boolean;\n /** Расположение всплывающего окна подсказки */\n hintTooltipPlacement?: Placement;\n /** Текст дополнительной подписи */\n secondaryLabel?: string;\n /** ref-ссылка на элемент textarea */\n inputRef?: Ref<HTMLTextAreaElement>;\n /** Флаг, управляющий отображением счётчика символов */\n symbolCounterVisible?: boolean;\n}\n\ntype InputStyledProps =\n Omit<InputProps, keyof React.HTMLAttributes<HTMLInputElement>> &\n React.TextareaHTMLAttributes<HTMLTextAreaElement> &\n React.RefAttributes<HTMLTextAreaElement>;\n\nconst InputStyled = Input as React.ComponentType<InputStyledProps>;\n\nconst TextArea = ({\n label,\n errorText,\n message,\n inputRef,\n onScroll,\n className,\n symbolCounterVisible,\n ...other\n}: Props) => {\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const [showLabel, setShowLabel] = useState(true);\n\n const updateState = useMemo(() => (\n throttle(() => {\n if (textareaRef.current) {\n setShowLabel(textareaRef.current.scrollTop <= 1);\n }\n }, 100)\n ), []);\n\n useEffect(() => () => {\n updateState.cancel();\n }, [updateState]);\n\n const handleRef = useCallback((node: HTMLTextAreaElement | null) => {\n if (inputRef) {\n setRef(inputRef, node);\n }\n textareaRef.current = node;\n }, [inputRef]);\n\n const handleScroll = useCallback((event: React.UIEvent<HTMLTextAreaElement>) => {\n if (onScroll) {\n onScroll(event);\n }\n updateState();\n }, [onScroll, updateState]);\n\n return (\n <InputStyled\n as={TextareaAutosize}\n label={showLabel ? label : undefined}\n message={errorText || message}\n error={Boolean(errorText)}\n errorIcon={!!errorText}\n symbolCounterVisible={symbolCounterVisible}\n {...other}\n className={classnames(inputStyles, className)}\n ref={handleRef}\n onScroll={handleScroll}\n />\n );\n};\n\nexport default TextArea;\n"],"names":["InputStyled","Input","TextArea","label","errorText","message","inputRef","onScroll","className","symbolCounterVisible","other","textareaRef","useRef","showLabel","setShowLabel","useState","updateState","useMemo","throttle","useEffect","handleRef","useCallback","node","setRef","handleScroll","event","TextareaAutosize","undefined","Boolean","classnames","inputStyles"],"mappings":";;;;;;;;;;;AAoDA,MAAMA,cAAcC;AAEpB,MAAMC,WAAW,CAAC;QAAA,EAChBC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,oBAAoB,EAEd,OADHC,QAAAA,6BAAAA,IAAAA;;;;;;;;;IAEH,MAAMC,cAAcC,OAAmC;IACvD,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAAS;IAE3C,MAAMC,cAAcC,QAAQ,IAC1BC,SAAS;YACP,IAAIP,YAAY,OAAO,EACrBG,aAAaH,YAAY,OAAO,CAAC,SAAS,IAAI;QAElD,GAAG,MACF,EAAE;IAELQ,UAAU,IAAM;YACdH,YAAY,MAAM;QACpB,GAAG;QAACA;KAAY;IAEhB,MAAMI,YAAYC,YAAY,CAACC;QAC7B,IAAIhB,UACFiB,OAAOjB,UAAUgB;QAEnBX,YAAY,OAAO,GAAGW;IACxB,GAAG;QAAChB;KAAS;IAEb,MAAMkB,eAAeH,YAAY,CAACI;QAChC,IAAIlB,UACFA,SAASkB;QAEXT;IACF,GAAG;QAACT;QAAUS;KAAY;IAE1B,OAAO,WAAP,GACE,IAAChB,aAAAA,uBAAAA,EAAAA;QACC,IAAI0B;QACJ,OAAOb,YAAYV,QAAQwB;QAC3B,SAASvB,aAAaC;QACtB,OAAOuB,QAAQxB;QACf,WAAW,CAAC,CAACA;QACb,sBAAsBK;OAClBC,QAAAA;QACJ,WAAWmB,KAAWC,aAAatB;QACnC,KAAKY;QACL,UAAUI;;AAGhB;AAEA,0BAAetB"}
1
+ {"version":3,"file":"TextArea/TextArea.js","sources":["../../src/TextArea/TextArea.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ComponentType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n type RefAttributes,\n type TextareaHTMLAttributes,\n type UIEvent,\n} from 'react';\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize';\nimport throttle from 'lodash/throttle.js';\nimport classnames from 'clsx';\nimport { customScroll } from '@finam/web-ui-kit-core/styles/scroll';\nimport DragHandleArea from '@finam/web-ui-kit-icons/DragHandle/DragHandleArea';\nimport type { Placement, InputSize, InputVariant } from '../types.js';\nimport Input, { InputProps } from '../Input/index.js';\nimport { setRef } from '../utils/withForwardedRef.js';\nimport { inputStyles, resizableStyles, resizeHandleStyles } from './TextArea.styles.js';\n\ntype InheritedInputProps = Pick<InputProps,\n| 'hideReadOnlyIcon'\n| 'singleLine'\n| 'hintTooltipMaxWidth'\n| 'hintTooltipVariant'\n| 'alignRight'\n| 'hideEmptyHint'\n| 'error'\n>;\n\nexport interface Props extends Omit<TextareaAutosizeProps & InheritedInputProps, 'as'> {\n /** Состояние значения поля ввода */\n value?: string;\n /** Текст сообщения подсказки */\n message?: ReactNode;\n /** Содержимое label поля ввода */\n label?: string;\n /** Вариант отображения поля ввода */\n variant?: InputVariant;\n /** Размер поля ввода */\n size?: InputSize;\n /** Растяжение компонента по ширине контейнера */\n fullWidth?: boolean;\n /** Сообщение об ошибке для подсказки */\n errorText?: string;\n /** Флаг отображения подсказки в виде всплывающего окна */\n hintTooltip?: boolean;\n /** Расположение всплывающего окна подсказки */\n hintTooltipPlacement?: Placement;\n /** Текст дополнительной подписи */\n secondaryLabel?: string;\n /** ref-ссылка на элемент textarea */\n inputRef?: Ref<HTMLTextAreaElement>;\n /** Флаг, управляющий отображением счётчика символов */\n symbolCounterVisible?: boolean;\n /**\n * Позволяет пользователю менять высоту поля, растягивая его за правый нижний угол.\n * Автоподстройка высоты под содержимое при этом отключается, `minRows` задаёт начальную высоту,\n * `maxRows` не учитывается\n */\n resizable?: boolean;\n}\n\ntype InputStyledProps =\n Omit<InputProps, keyof HTMLAttributes<HTMLInputElement>> &\n TextareaHTMLAttributes<HTMLTextAreaElement> &\n RefAttributes<HTMLTextAreaElement>;\n\nconst InputStyled = Input as ComponentType<InputStyledProps>;\n\nconst AutosizeField = forwardRef<HTMLTextAreaElement, TextareaAutosizeProps>(({ className, ...props }, ref) => (\n <TextareaAutosize {...props} ref={ref} className={classnames(className, customScroll())} />\n));\nAutosizeField.displayName = 'AutosizeField';\n\nconst ResizableField = forwardRef<HTMLTextAreaElement, TextareaHTMLAttributes<HTMLTextAreaElement>>(\n ({ className, ...props }, ref) => (\n <textarea {...props} ref={ref} className={classnames(className, customScroll())} />\n ),\n);\nResizableField.displayName = 'ResizableField';\n\nconst TextArea = ({\n label,\n errorText,\n message,\n inputRef,\n onScroll,\n className,\n symbolCounterVisible,\n resizable = false,\n minRows,\n maxRows,\n cacheMeasurements,\n onHeightChange,\n ...other\n}: Props) => {\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n const [showLabel, setShowLabel] = useState(true);\n\n const updateState = useMemo(() => (\n throttle(() => {\n if (textareaRef.current) {\n setShowLabel(textareaRef.current.scrollTop <= 1);\n }\n }, 100)\n ), []);\n\n useEffect(() => () => {\n updateState.cancel();\n }, [updateState]);\n\n const handleRef = useCallback((node: HTMLTextAreaElement | null) => {\n if (inputRef) {\n setRef(inputRef, node);\n }\n textareaRef.current = node;\n }, [inputRef]);\n\n const handleScroll = useCallback((event: UIEvent<HTMLTextAreaElement>) => {\n if (onScroll) {\n onScroll(event);\n }\n updateState();\n }, [onScroll, updateState]);\n\n const autosizeProps = resizable ? { rows: minRows } : {\n minRows,\n maxRows,\n cacheMeasurements,\n onHeightChange,\n };\n\n return (\n <InputStyled\n as={resizable ? ResizableField : AutosizeField}\n {...autosizeProps}\n label={showLabel ? label : undefined}\n message={errorText || message}\n error={Boolean(errorText)}\n errorIcon={!!errorText}\n symbolCounterVisible={symbolCounterVisible}\n adornment={resizable && !other.disabled ? (\n <div className={classnames(resizeHandleStyles, 'ui-textarea__resize-handle')} aria-hidden>\n <DragHandleArea color=\"tertiary\" />\n </div>\n ) : undefined}\n {...other}\n className={classnames(inputStyles, resizable && resizableStyles, className)}\n ref={handleRef}\n onScroll={handleScroll}\n />\n );\n};\n\nexport default TextArea;\n"],"names":["InputStyled","Input","AutosizeField","forwardRef","className","props","ref","TextareaAutosize","classnames","customScroll","ResizableField","TextArea","label","errorText","message","inputRef","onScroll","symbolCounterVisible","resizable","minRows","maxRows","cacheMeasurements","onHeightChange","other","textareaRef","useRef","showLabel","setShowLabel","useState","updateState","useMemo","throttle","useEffect","handleRef","useCallback","node","setRef","handleScroll","event","autosizeProps","undefined","Boolean","resizeHandleStyles","DragHandleArea","inputStyles","resizableStyles"],"mappings":";;;;;;;;;;;;;AAyEA,MAAMA,cAAcC;AAEpB,MAAMC,gBAAgB,WAAHA,GAAGC,WAAuD,CAAC,IAAD;;;;iCAAC,EAAEC,SAAS,EAAY,UAAPC,QAAAA,6BAAAA,OAAAA;;SAASC,IAAAA,GAAAA;yBACrG,IAACC,yBAAgBA,uBAAAA,EAAAA,CAAAA,GAAKF,QAAAA;QAAO,KAAKC;QAAK,WAAWE,KAAWJ,WAAWK;;;AAE1EP,cAAc,WAAW,GAAG;AAE5B,MAAMQ,iBAAiB,WAAHA,GAAGP,WACrB,CAAC,IAAD;;;;iCAAC,EAAEC,SAAS,EAAY,UAAPC,QAAAA,6BAAAA,OAAAA;;SAASC,IAAAA,GAAAA;yBACxB,IAAC,yCAAaD,QAAAA;QAAO,KAAKC;QAAK,WAAWE,KAAWJ,WAAWK;;;AAGpEC,eAAe,WAAW,GAAG;AAE7B,MAAMC,WAAW,CAAC;QAAA,EAChBC,KAAK,EACLC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRZ,SAAS,EACTa,oBAAoB,EACpBC,YAAY,KAAK,EACjBC,OAAO,EACPC,OAAO,EACPC,iBAAiB,EACjBC,cAAc,EAER,OADHC,QAAAA,6BAAAA,IAAAA;;;;;;;;;;;;;;IAEH,MAAMC,cAAcC,OAAmC;IACvD,MAAM,CAACC,WAAWC,aAAa,GAAGC,SAAS;IAE3C,MAAMC,cAAcC,QAAQ,IAC1BC,SAAS;YACP,IAAIP,YAAY,OAAO,EACrBG,aAAaH,YAAY,OAAO,CAAC,SAAS,IAAI;QAElD,GAAG,MACF,EAAE;IAELQ,UAAU,IAAM;YACdH,YAAY,MAAM;QACpB,GAAG;QAACA;KAAY;IAEhB,MAAMI,YAAYC,YAAY,CAACC;QAC7B,IAAIpB,UACFqB,OAAOrB,UAAUoB;QAEnBX,YAAY,OAAO,GAAGW;IACxB,GAAG;QAACpB;KAAS;IAEb,MAAMsB,eAAeH,YAAY,CAACI;QAChC,IAAItB,UACFA,SAASsB;QAEXT;IACF,GAAG;QAACb;QAAUa;KAAY;IAE1B,MAAMU,gBAAgBrB,YAAY;QAAE,MAAMC;IAAQ,IAAI;QACpDA;QACAC;QACAC;QACAC;IACF;IAEA,OAAO,WAAP,GACE,IAACtB,aAAAA,uBAAAA,EAAAA,uBAAAA,EAAAA;QACC,IAAIkB,YAAYR,iBAAiBR;OAC7BqC,gBAAAA;QACJ,OAAOb,YAAYd,QAAQ4B;QAC3B,SAAS3B,aAAaC;QACtB,OAAO2B,QAAQ5B;QACf,WAAW,CAAC,CAACA;QACb,sBAAsBI;QACtB,WAAWC,aAAa,CAACK,MAAM,QAAQ,GAAG,WAAH,GACrC,IAAC;YAAI,WAAWf,KAAWkC,oBAAoB;YAA+B,eAAW;sBACvF,kBAACC,gBAAcA;gBAAC,OAAM;;aAEtBH;QACAjB,QAAAA;QACJ,WAAWf,KAAWoC,aAAa1B,aAAa2B,iBAAiBzC;QACjE,KAAK6B;QACL,UAAUI;;AAGhB;AAEA,0BAAe1B"}
@@ -1 +1,3 @@
1
1
  .ui_components_i12kkm66 textarea{display:block;resize:none;}.ui_components_i12kkm66 .ui-input__adornment{align-self:flex-start;margin-top:var(--ui-spacing-inputM-paddingVert);}
2
+ .ui_components_rtjawjx textarea{resize:vertical;}.ui_components_rtjawjx textarea:disabled{resize:none;}.ui_components_rtjawjx textarea::-webkit-scrollbar{width:20px;height:20px;}.ui_components_rtjawjx textarea::-webkit-scrollbar-thumb{border-width:7px;}.ui_components_rtjawjx textarea::-webkit-resizer,.ui_components_rtjawjx textarea::-webkit-scrollbar-corner{background:transparent;}
3
+ .ui_components_r1ghzquy{position:absolute;right:var(--ui-spacing-xs);bottom:var(--ui-spacing-xs);display:flex;pointer-events:none;}.ui_components_r1ghzquy>svg{width:15px;height:15px;}
@@ -1,2 +1,4 @@
1
1
  export declare const inputStyles: import("@linaria/core").LinariaClassName;
2
+ export declare const resizableStyles: import("@linaria/core").LinariaClassName;
3
+ export declare const resizeHandleStyles: import("@linaria/core").LinariaClassName;
2
4
  //# sourceMappingURL=TextArea.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.styles.d.ts","sourceRoot":"","sources":["../../src/TextArea/TextArea.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,0CAUvB,CAAC"}
1
+ {"version":3,"file":"TextArea.styles.d.ts","sourceRoot":"","sources":["../../src/TextArea/TextArea.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,0CAUvB,CAAC;AAEF,eAAO,MAAM,eAAe,0CAsB3B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0CAW9B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  const inputStyles = "ui_components_i12kkm66";
2
- export { inputStyles };
2
+ const resizableStyles = "ui_components_rtjawjx";
3
+ const resizeHandleStyles = "ui_components_r1ghzquy";
4
+ export { inputStyles, resizableStyles, resizeHandleStyles };
3
5
  //# sourceMappingURL=TextArea.styles.js.map
4
6
 
5
7
  import "./TextArea.styles.css";
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea/TextArea.styles.js","sources":["../../src/TextArea/TextArea.styles.ts"],"sourcesContent":["import { tokens } from '@finam/web-ui-kit-core/theme/contract';\nimport { css } from '@linaria/core';\n\nexport const inputStyles = css`\n & textarea {\n display: block;\n resize: none;\n }\n\n & .ui-input__adornment {\n align-self: flex-start;\n margin-top: ${tokens.spacing.inputM.paddingVert};\n }\n`;\n"],"names":["inputStyles","css","tokens"],"mappings":";;AAGO,MAAMA,cAAcC,GAAG,CAAC;;;;;;;;gBAQf,EAAEC,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;;AAEpD,CAAC"}
1
+ {"version":3,"file":"TextArea/TextArea.styles.js","sources":["../../src/TextArea/TextArea.styles.ts"],"sourcesContent":["import { tokens } from '@finam/web-ui-kit-core/theme/contract';\nimport { css } from '@linaria/core';\n\nexport const inputStyles = css`\n & textarea {\n display: block;\n resize: none;\n }\n\n & .ui-input__adornment {\n align-self: flex-start;\n margin-top: ${tokens.spacing.inputM.paddingVert};\n }\n`;\n\nexport const resizableStyles = css`\n & textarea {\n resize: vertical;\n }\n\n & textarea:disabled {\n resize: none;\n }\n\n & textarea::-webkit-scrollbar {\n width: 20px;\n height: 20px;\n }\n\n & textarea::-webkit-scrollbar-thumb {\n border-width: 7px;\n }\n\n & textarea::-webkit-resizer,\n & textarea::-webkit-scrollbar-corner {\n background: transparent;\n }\n`;\n\nexport const resizeHandleStyles = css`\n position: absolute;\n right: ${tokens.spacing.xs};\n bottom: ${tokens.spacing.xs};\n display: flex;\n pointer-events: none;\n\n & > svg {\n width: 15px;\n height: 15px;\n }\n`;\n"],"names":["inputStyles","css","tokens","resizableStyles","resizeHandleStyles"],"mappings":";;AAGO,MAAMA,cAAcC,GAAG,CAAC;;;;;;;;gBAQf,EAAEC,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC;;AAEpD,CAAC;AAEM,MAAMC,kBAAkBF,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBnC,CAAC;AAEM,MAAMG,qBAAqBH,GAAG,CAAC;;SAE7B,EAAEC,OAAO,OAAO,CAAC,EAAE,CAAC;UACnB,EAAEA,OAAO,OAAO,CAAC,EAAE,CAAC;;;;;;;;AAQ9B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip/Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useCallback,\n useEffect,\n cloneElement,\n ReactElement,\n ReactNode,\n ComponentPropsWithoutRef,\n memo,\n useMemo,\n} from 'react';\nimport classnames from 'clsx';\nimport { transitionGrow, transitionGrowParent } from '@finam/web-ui-kit-core/styles/transition';\nimport { typography } from '@finam/web-ui-kit-core/styles/typography';\nimport type { Middleware } from '@floating-ui/dom';\nimport { arrow, flip, shift } from '@floating-ui/react';\nimport type { Placement, CSSTransitionProps } from '../types.js';\nimport type { PopperProps } from '../Popper/index.js';\nimport { useForkRef } from '../utils/withForwardedRef.js';\nimport { ModalManager } from '../Modal/index.js';\nimport {\n Popper,\n Root,\n TooltipElement,\n Corner,\n Line,\n} from './Tooltip.styles.js';\nimport { windowPadding } from './constants.js';\n\nconst SHORTEST_TRANSITION_DURATION = 150;\n\nconst tooltipModalManager = new ModalManager();\n\nfunction stickToViewportWhenFlipped(): Middleware {\n return {\n name: 'stickToViewportWhenFlipped',\n fn(state) {\n const { y, placement, rects, elements } = state;\n if (!placement.startsWith('top') || !rects.floating) {\n return {};\n }\n const win = elements.floating?.ownerDocument?.defaultView ?? (typeof window !== 'undefined' ? window : null);\n if (!win) {\n return {};\n }\n\n const viewportSafety = 1;\n const maxBottom = win.innerHeight - windowPadding - viewportSafety;\n const bottom = y + rects.floating.height;\n if (bottom <= maxBottom) {\n return {};\n }\n return { y: maxBottom - rects.floating.height };\n },\n };\n}\n\nexport type Variant = 'primary' | 'positive' | 'negative';\n\nexport interface Props extends Omit<ComponentPropsWithoutRef<typeof TooltipElement>, 'title'> {\n /** Элемент инициирующий появление всплывающего окна */\n children: ReactElement<any>;\n /** Контент всплывающего окна */\n title: ReactNode;\n /** Управление видимостью всплывающего окна */\n open?: boolean;\n /** Вариант стиля всплывающего окна */\n variant?: Variant;\n /** Функция обратного вызова, вызываемая при открытии всплывающего окна */\n onOpen?(event: MouseEvent | TouchEvent | FocusEvent): void;\n /** Функция обратного вызова, вызываемая при закрытии всплывающего окна */\n onClose?(event: MouseEvent | TouchEvent | FocusEvent): void;\n /** Позволяет всплывающему окну оставаться видимым при наведении на него */\n interactive?: boolean;\n /** Отключает открытие всплывающего окна на событие фокуса */\n disableFocusListener?: boolean;\n /** Отключает открытие всплывающего окна на событие наведения */\n disableHoverListener?: boolean;\n /** Отключает открытие всплывающего окна на событие сенсорного ввода */\n disableTouchListener?: boolean;\n /** Устанавливает задержку на открытие всплывающего окна на указанное количество миллисекунд */\n enterDelay?: number;\n /** Устанавливает задержку на открытие всплывающего окна на указанное количество миллисекунд\n * для сенсорного ввода */\n enterTouchDelay?: number;\n /** Устанавливает задержку на закрытие всплывающего окна на указанное количество миллисекунд */\n leaveDelay?: number;\n /** Устанавливает задержку на закрытие всплывающего окна на указанное количество миллисекунд\n * для сенсорного ввода */\n leaveTouchDelay?: number;\n /** Устанавливает позиционирование всплывающего окна относительно инициирующего элемента */\n placement?: Placement;\n /** Дополнительные свойства всплывающего окна */\n PopperProps?: Partial<PopperProps>;\n /** from Modal */\n TransitionProps?: Partial<CSSTransitionProps<HTMLElement>>;\n /** Управляет отображением пина */\n withCorner?: boolean;\n /** При развороте тултипа вверх, прижимает его к низу вьюпорта, не давая выйти за вьюпорт */\n stickToViewport?: boolean;\n}\n\nconst Tooltip = ({\n children,\n disableFocusListener = true,\n disableHoverListener = false,\n disableTouchListener = false,\n interactive = false,\n enterDelay = 300,\n enterTouchDelay = 200,\n leaveDelay,\n leaveTouchDelay = 1500,\n id,\n onClose,\n onOpen,\n className,\n open: openProp,\n placement = 'bottom',\n PopperProps: popperProps,\n TransitionProps,\n title,\n variant = 'primary',\n withCorner = true,\n stickToViewport,\n ...otherProps\n}: Props) => {\n const [openState, setOpenState] = useState(false);\n const [, forceUpdate] = useState(false);\n const [childNode, setChildNode] = useState<HTMLElement | null>(null);\n const ignoreNonTouchEvents = useRef(false);\n const ignoreNonFocusEvents = useRef(false);\n const interactiveWrapperListeners = useRef({});\n const { current: isControlled } = useRef(openProp !== undefined);\n const defaultId = useRef<string | undefined>(undefined);\n const closeTimer = useRef<number | undefined>(undefined);\n const enterTimer = useRef<number | undefined>(undefined);\n const leaveTimer = useRef<number | undefined>(undefined);\n const touchTimer = useRef<number | undefined>(undefined);\n const tooltipRef = useRef<HTMLDivElement | null>(null);\n const arrowRef = useRef<SVGSVGElement | null>(null);\n const prevUserSelectRef = useRef<string | undefined>(undefined);\n\n const computedLeaveDelay = interactive ? leaveDelay ?? 200 : leaveDelay;\n\n const handleOwnRef = useCallback((ref: HTMLElement) => {\n setChildNode(ref);\n }, []);\n const handleRef = useForkRef(children.props.ref || (children as any).ref, handleOwnRef);\n\n const popperMiddleware = useMemo(() => {\n const middleware = [\n flip({ fallbackAxisSideDirection: 'end' }),\n shift({ padding: windowPadding }),\n ];\n if (stickToViewport) {\n middleware.push(stickToViewportWhenFlipped());\n }\n if (withCorner) {\n middleware.push(arrow({ element: arrowRef, padding: 4 }));\n }\n return middleware;\n }, [stickToViewport, withCorner]);\n\n useEffect(() => {\n // Fallback to this default id when possible.\n // Use the random value for client side rendering only.\n // We can't use it server-side.\n if (!defaultId.current) {\n defaultId.current = `ui-tooltip-${Math.round(Math.random() * 1e5)}`;\n }\n\n // Rerender with defaultId and childNode.\n if (openProp) {\n forceUpdate(n => !n);\n }\n }, [openProp]);\n\n useEffect(() => () => {\n window.clearTimeout(closeTimer.current);\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n window.clearTimeout(touchTimer.current);\n }, []);\n\n useEffect(() => {\n const handleOpen = (event: MouseEvent | TouchEvent | FocusEvent) => {\n // The mouseover event will trigger for every nested element in the tooltip.\n // We can skip rerendering when the tooltip is already open.\n // We are using the mouseover event instead of the mouseenter event to fix a hide/show issue.\n if (!isControlled) {\n setOpenState(true);\n }\n\n if (onOpen) {\n onOpen(event);\n }\n };\n\n const handleEnter = (event: MouseEvent | TouchEvent | FocusEvent) => {\n if (\n ignoreNonTouchEvents.current && event.type !== 'touchstart' ||\n ignoreNonFocusEvents.current && event.type !== 'focusin' && event.type !== 'focus'\n ) {\n return;\n }\n\n // Remove the title ahead of time.\n // We don't want to wait for the next render commit.\n // We would risk displaying two tooltips at the same time (native + this one).\n if (childNode) {\n childNode.setAttribute('title', '');\n }\n\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n if (enterDelay) {\n enterTimer.current = window.setTimeout(() => {\n handleOpen(event);\n }, enterDelay);\n } else {\n handleOpen(event);\n }\n };\n\n const handleFocus = (event: FocusEvent) => {\n // Workaround for https://github.com/facebook/react/issues/7769\n // The autoFocus of React might trigger the event before the componentDidMount.\n // We need to account for this eventuality.\n if (!childNode) {\n setChildNode(event.currentTarget as HTMLElement);\n }\n\n ignoreNonFocusEvents.current = true;\n window.clearTimeout(closeTimer.current);\n handleEnter(event);\n };\n\n const restoreUserSelect = () => {\n if (childNode && prevUserSelectRef.current !== undefined) {\n childNode.style.userSelect = prevUserSelectRef.current;\n prevUserSelectRef.current = undefined;\n // @ts-expect-error\n delete childNode.style.WebkitUserSelect;\n }\n };\n\n const disableUserSelect = () => {\n restoreUserSelect();\n\n if (childNode) {\n prevUserSelectRef.current = window.getComputedStyle(childNode).getPropertyValue('user-select');\n childNode.style.userSelect = 'none';\n // @ts-expect-error\n childNode.style.WebkitUserSelect = 'none';\n }\n };\n\n const handleClose = (event: MouseEvent | TouchEvent | FocusEvent) => {\n restoreUserSelect();\n\n if (!isControlled) {\n setOpenState(false);\n }\n\n if (onClose) {\n onClose(event);\n }\n\n window.clearTimeout(closeTimer.current);\n closeTimer.current = window.setTimeout(() => {\n ignoreNonTouchEvents.current = false;\n ignoreNonFocusEvents.current = false;\n }, SHORTEST_TRANSITION_DURATION);\n };\n\n const handleLeave = (event: MouseEvent | FocusEvent) => {\n if (!disableFocusListener && event.currentTarget === document.activeElement) {\n return;\n }\n if (ignoreNonFocusEvents.current && event.type !== 'focusout' && event.type !== 'blur') {\n return;\n }\n\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n if (computedLeaveDelay) {\n leaveTimer.current = window.setTimeout(() => {\n handleClose(event);\n }, computedLeaveDelay);\n } else {\n handleClose(event);\n }\n };\n\n const handleTouchStart = (event: TouchEvent) => {\n ignoreNonTouchEvents.current = true;\n\n disableUserSelect();\n\n window.clearTimeout(leaveTimer.current);\n window.clearTimeout(closeTimer.current);\n window.clearTimeout(touchTimer.current);\n touchTimer.current = window.setTimeout(() => {\n handleEnter(event);\n }, enterTouchDelay);\n };\n\n const handleTouchEnd = (event: TouchEvent) => {\n window.clearTimeout(touchTimer.current);\n window.clearTimeout(leaveTimer.current);\n leaveTimer.current = window.setTimeout(() => {\n handleClose(event);\n }, leaveTouchDelay);\n };\n\n if (!disableTouchListener) {\n childNode?.addEventListener('touchstart', handleTouchStart);\n childNode?.addEventListener('touchend', handleTouchEnd);\n }\n\n if (!disableHoverListener) {\n childNode?.addEventListener('mouseenter', handleEnter);\n childNode?.addEventListener('mouseleave', handleLeave);\n }\n\n if (!disableFocusListener) {\n childNode?.addEventListener('focusin', handleFocus);\n childNode?.addEventListener('focusout', handleLeave);\n }\n\n interactiveWrapperListeners.current = interactive\n ? {\n onMouseOver: handleEnter,\n onMouseLeave: handleLeave,\n onFocus: handleFocus,\n onBlur: handleLeave,\n }\n : {};\n\n return () => {\n if (!disableTouchListener) {\n childNode?.removeEventListener('touchstart', handleTouchStart);\n childNode?.removeEventListener('touchend', handleTouchEnd);\n }\n\n if (!disableHoverListener) {\n childNode?.removeEventListener('mouseenter', handleEnter);\n childNode?.removeEventListener('mouseleave', handleLeave);\n }\n\n if (!disableFocusListener) {\n childNode?.removeEventListener('focusin', handleFocus);\n childNode?.removeEventListener('focusout', handleLeave);\n }\n };\n }, [\n childNode,\n disableTouchListener,\n disableHoverListener,\n disableFocusListener,\n isControlled,\n onOpen,\n onClose,\n enterDelay,\n computedLeaveDelay,\n enterTouchDelay,\n leaveTouchDelay,\n interactive,\n ]);\n\n let open = isControlled ? openProp : openState;\n\n if (!title) {\n open = false;\n }\n\n const shouldShowNativeTitle = !open && !disableHoverListener;\n const childrenProps = {\n ...children.props,\n 'aria-describedby': open ? id || defaultId.current : null,\n title: shouldShowNativeTitle && typeof title === 'string' ? title : null,\n ref: handleRef,\n };\n\n return (\n <>\n {cloneElement(children, childrenProps)}\n <Popper\n placement={placement}\n anchorEl={childNode}\n open={childNode ? Boolean(open) : false}\n manager={tooltipModalManager}\n id={childrenProps['aria-describedby']}\n TransitionProps={{\n timeout: 300,\n classNames: transitionGrowParent,\n ...TransitionProps,\n nodeRef: tooltipRef,\n }}\n {...interactiveWrapperListeners.current}\n {...popperProps}\n middleware={popperMiddleware}\n className={classnames(popperProps?.className, { interactive })}\n >\n <Root className=\"ui-tooltip__root\" ref={tooltipRef}>\n <div className={classnames(transitionGrow({ inner: true }), 'ui-tooltip__container')}>\n {withCorner && <Corner ref={arrowRef} className=\"ui-tooltip__corner\" />}\n <TooltipElement\n {...otherProps}\n className={classnames(\n typography({\n variant: ignoreNonTouchEvents.current ? 'body14' : 'caption12',\n color: 'ondark',\n }),\n className,\n )}\n >\n <Line className={variant} />\n {title}\n </TooltipElement>\n </div>\n </Root>\n </Popper>\n </>\n );\n};\n\nexport default memo(Tooltip);\n"],"names":["SHORTEST_TRANSITION_DURATION","tooltipModalManager","ModalManager","stickToViewportWhenFlipped","state","_elements_floating_ownerDocument","y","placement","rects","elements","win","window","viewportSafety","maxBottom","windowPadding","bottom","Tooltip","children","disableFocusListener","disableHoverListener","disableTouchListener","interactive","enterDelay","enterTouchDelay","leaveDelay","leaveTouchDelay","id","onClose","onOpen","className","openProp","popperProps","TransitionProps","title","variant","withCorner","stickToViewport","otherProps","openState","setOpenState","useState","forceUpdate","childNode","setChildNode","ignoreNonTouchEvents","useRef","ignoreNonFocusEvents","interactiveWrapperListeners","isControlled","undefined","defaultId","closeTimer","enterTimer","leaveTimer","touchTimer","tooltipRef","arrowRef","prevUserSelectRef","computedLeaveDelay","handleOwnRef","useCallback","ref","handleRef","useForkRef","popperMiddleware","useMemo","middleware","flip","shift","arrow","useEffect","Math","n","handleOpen","event","handleEnter","handleFocus","restoreUserSelect","disableUserSelect","handleClose","handleLeave","document","handleTouchStart","handleTouchEnd","open","shouldShowNativeTitle","childrenProps","cloneElement","Popper","Boolean","transitionGrowParent","classnames","Root","transitionGrow","Corner","TooltipElement","typography","Line","memo"],"mappings":";;;;;;;;;;;;;AA8BA,MAAMA,+BAA+B;AAErC,MAAMC,sBAAsB,IAAIC;AAEhC,SAASC;IACP,OAAO;QACL,MAAM;QACN,IAAGC,KAAK;;gBAKMC,kCAAAA;YAJZ,MAAM,EAAEC,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGL;YAC1C,IAAI,CAACG,UAAU,UAAU,CAAC,UAAU,CAACC,MAAM,QAAQ,EACjD,OAAO,CAAC;YAEV,MAAME,MAAM,QAANA,CAAAA,OAAAA,QAAML,CAAAA,qBAAAA,SAAS,QAAQ,AAAD,IAAhBA,KAAAA,IAAAA,QAAAA,CAAAA,mCAAAA,mBAAmB,aAAa,AAAD,IAA/BA,KAAAA,IAAAA,iCAAkC,WAAW,AAAD,IAAC,OAAK,AAAkB,MAAlB,OAAOM,SAAyBA,SAAS;YACvG,IAAI,CAACD,KACH,OAAO,CAAC;YAGV,MAAME,iBAAiB;YACvB,MAAMC,YAAYH,IAAI,WAAW,GAAGI,gBAAgBF;YACpD,MAAMG,SAAST,IAAIE,MAAM,QAAQ,CAAC,MAAM;YACxC,IAAIO,UAAUF,WACZ,OAAO,CAAC;YAEV,OAAO;gBAAE,GAAGA,YAAYL,MAAM,QAAQ,CAAC,MAAM;YAAC;QAChD;IACF;AACF;AA+CA,MAAMQ,UAAU,CAAC;QAAA,EACfC,QAAQ,EACRC,uBAAuB,IAAI,EAC3BC,uBAAuB,KAAK,EAC5BC,uBAAuB,KAAK,EAC5BC,cAAc,KAAK,EACnBC,aAAa,GAAG,EAChBC,kBAAkB,GAAG,EACrBC,UAAU,EACVC,kBAAkB,IAAI,EACtBC,EAAE,EACFC,OAAO,EACPC,MAAM,EACNC,SAAS,EACT,MAAMC,QAAQ,EACdvB,YAAY,QAAQ,EACpB,aAAaw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CAACL,OACHmD,OAAO;IAGT,MAAMC,wBAAwB,CAACD,QAAQ,CAACjE;IACxC,MAAMmE,gBAAgB,6BACjBrE,SAAS,KAAK;QACjB,oBAAoBmE,OAAO1D,MAAMwB,UAAU,OAAO,GAAG;QACrD,OAAOmC,yBAAyB,AAAiB,YAAjB,OAAOpD,QAAqBA,QAAQ;QACpE,KAAK6B;;IAGP,OAAO,WAAP,GACE;;0BACGyB,aAAatE,UAAUqE;0BACxB,IAACE,QAAMA,uBAAAA,EAAAA;gBACL,WAAWjF;gBACX,UAAUmC;gBACV,MAAMA,YAAY+C,QAAQL,QAAQ;gBAClC,SAASnF;gBACT,IAAIqF,aAAa,CAAC,mBAAmB;gBACrC,iBAAiB;oBACf,SAAS;oBACT,YAAYI;mBACT1D,kBAAAA;oBACH,SAASuB;;eAEPR,4BAA4B,OAAO,EACnChB,cAAAA;gBACJ,YAAYiC;gBACZ,WAAW2B,KAAW5D,QAAAA,cAAAA,KAAAA,IAAAA,YAAa,SAAS,EAAE;oBAAEV;gBAAY;0BAE5D,kBAACuE,MAAIA;oBAAC,WAAU;oBAAmB,KAAKrC;8BACtC,mBAAC;wBAAI,WAAWoC,KAAWE,eAAe;4BAAE,OAAO;wBAAK,IAAI;;4BACzD1D,cAAc,WAAdA,GAAc,IAAC2D,QAAMA;gCAAC,KAAKtC;gCAAU,WAAU;;0CAChD,KAACuC,gBAAcA,uBAAAA,EAAAA,CAAAA,GACT1D,aAAAA;gCACJ,WAAWsD,KACTK,WAAW;oCACT,SAASpD,qBAAqB,OAAO,GAAG,WAAW;oCACnD,OAAO;gCACT,IACAf;;kDAGF,IAACoE,MAAIA;wCAAC,WAAW/D;;oCAChBD;;;;;;;;;AAOf;AAEA,sCAAeiE,KAAKlF"}
1
+ {"version":3,"file":"Tooltip/Tooltip.js","sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import {\n useState,\n useRef,\n useCallback,\n useEffect,\n cloneElement,\n ReactElement,\n ReactNode,\n ComponentPropsWithoutRef,\n memo,\n useMemo,\n} from 'react';\nimport classnames from 'clsx';\nimport { transitionGrow, transitionGrowParent } from '@finam/web-ui-kit-core/styles/transition';\nimport { typography } from '@finam/web-ui-kit-core/styles/typography';\nimport type { Middleware } from '@floating-ui/dom';\nimport { arrow, flip, shift } from '@floating-ui/react';\nimport type { Placement, CSSTransitionProps } from '../types.js';\nimport type { PopperProps } from '../Popper/index.js';\nimport { useForkRef } from '../utils/withForwardedRef.js';\nimport { ModalManager } from '../Modal/index.js';\nimport {\n Popper,\n Root,\n TooltipElement,\n Corner,\n Line,\n} from './Tooltip.styles.js';\nimport { windowPadding } from './constants.js';\n\nconst SHORTEST_TRANSITION_DURATION = 150;\n\nconst tooltipModalManager = new ModalManager();\n\nfunction stickToViewportWhenFlipped(): Middleware {\n return {\n name: 'stickToViewportWhenFlipped',\n fn(state) {\n const { y, placement, rects, elements } = state;\n if (!placement.startsWith('top') || !rects.floating) {\n return {};\n }\n const win = elements.floating?.ownerDocument?.defaultView ?? (typeof window !== 'undefined' ? window : null);\n if (!win) {\n return {};\n }\n\n const viewportSafety = 1;\n const maxBottom = win.innerHeight - windowPadding - viewportSafety;\n const bottom = y + rects.floating.height;\n if (bottom <= maxBottom) {\n return {};\n }\n return { y: maxBottom - rects.floating.height };\n },\n };\n}\n\nexport type Variant = 'primary' | 'positive' | 'negative';\n\nexport interface Props extends Omit<ComponentPropsWithoutRef<typeof TooltipElement>, 'title'> {\n /** Элемент инициирующий появление всплывающего окна */\n children: ReactElement<any>;\n /** Контент всплывающего окна */\n title: ReactNode;\n /** Управление видимостью всплывающего окна */\n open?: boolean;\n /** Вариант стиля всплывающего окна */\n variant?: Variant;\n /** Функция обратного вызова, вызываемая при открытии всплывающего окна */\n onOpen?(event: MouseEvent | TouchEvent | FocusEvent): void;\n /** Функция обратного вызова, вызываемая при закрытии всплывающего окна */\n onClose?(event: MouseEvent | TouchEvent | FocusEvent): void;\n /** Позволяет всплывающему окну оставаться видимым при наведении на него */\n interactive?: boolean;\n /** Отключает открытие всплывающего окна на событие фокуса */\n disableFocusListener?: boolean;\n /** Отключает открытие всплывающего окна на событие наведения */\n disableHoverListener?: boolean;\n /** Отключает открытие всплывающего окна на событие сенсорного ввода */\n disableTouchListener?: boolean;\n /** Устанавливает задержку на открытие всплывающего окна на указанное количество миллисекунд */\n enterDelay?: number;\n /** Устанавливает задержку на открытие всплывающего окна на указанное количество миллисекунд\n * для сенсорного ввода */\n enterTouchDelay?: number;\n /** Устанавливает задержку на закрытие всплывающего окна на указанное количество миллисекунд */\n leaveDelay?: number;\n /** Устанавливает задержку на закрытие всплывающего окна на указанное количество миллисекунд\n * для сенсорного ввода */\n leaveTouchDelay?: number;\n /** Устанавливает позиционирование всплывающего окна относительно инициирующего элемента */\n placement?: Placement;\n /** Дополнительные свойства всплывающего окна */\n PopperProps?: Partial<PopperProps>;\n /** from Modal */\n TransitionProps?: Partial<CSSTransitionProps<HTMLElement>>;\n /** Управляет отображением пина */\n withCorner?: boolean;\n /** При развороте тултипа вверх, прижимает его к низу вьюпорта, не давая выйти за вьюпорт */\n stickToViewport?: boolean;\n}\n\nconst Tooltip = ({\n children,\n disableFocusListener = true,\n disableHoverListener = false,\n disableTouchListener = false,\n interactive = false,\n enterDelay = 300,\n enterTouchDelay = 200,\n leaveDelay,\n leaveTouchDelay = 1500,\n id,\n onClose,\n onOpen,\n className,\n open: openProp,\n placement = 'bottom',\n PopperProps: popperProps,\n TransitionProps,\n title,\n variant = 'primary',\n withCorner = true,\n stickToViewport,\n ...otherProps\n}: Props) => {\n const [openState, setOpenState] = useState(false);\n const [, forceUpdate] = useState(false);\n const [childNode, setChildNode] = useState<HTMLElement | null>(null);\n const ignoreNonTouchEvents = useRef(false);\n const ignoreNonFocusEvents = useRef(false);\n const interactiveWrapperListeners = useRef({});\n const { current: isControlled } = useRef(openProp !== undefined);\n const defaultId = useRef<string | undefined>(undefined);\n const closeTimer = useRef<number | undefined>(undefined);\n const enterTimer = useRef<number | undefined>(undefined);\n const leaveTimer = useRef<number | undefined>(undefined);\n const touchTimer = useRef<number | undefined>(undefined);\n const tooltipRef = useRef<HTMLDivElement | null>(null);\n const arrowRef = useRef<SVGSVGElement | null>(null);\n const prevUserSelectRef = useRef<string | undefined>(undefined);\n\n const computedLeaveDelay = interactive ? leaveDelay ?? 200 : leaveDelay;\n\n const handleOwnRef = useCallback((ref: HTMLElement) => {\n setChildNode(ref);\n }, []);\n const handleRef = useForkRef(children.props.ref || (children as any).ref, handleOwnRef);\n\n const popperMiddleware = useMemo(() => {\n const middleware = [\n flip({ fallbackAxisSideDirection: 'end' }),\n shift({ padding: windowPadding }),\n ];\n if (stickToViewport) {\n middleware.push(stickToViewportWhenFlipped());\n }\n if (withCorner) {\n middleware.push(arrow({ element: arrowRef, padding: 4 }));\n }\n return middleware;\n }, [stickToViewport, withCorner]);\n\n useEffect(() => {\n // Fallback to this default id when possible.\n // Use the random value for client side rendering only.\n // We can't use it server-side.\n if (!defaultId.current) {\n defaultId.current = `ui-tooltip-${Math.round(Math.random() * 1e5)}`;\n }\n\n // Rerender with defaultId and childNode.\n if (openProp) {\n forceUpdate(n => !n);\n }\n }, [openProp]);\n\n useEffect(() => () => {\n window.clearTimeout(closeTimer.current);\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n window.clearTimeout(touchTimer.current);\n }, []);\n\n useEffect(() => {\n const handleOpen = (event: MouseEvent | TouchEvent | FocusEvent) => {\n // The mouseover event will trigger for every nested element in the tooltip.\n // We can skip rerendering when the tooltip is already open.\n // We are using the mouseover event instead of the mouseenter event to fix a hide/show issue.\n if (!isControlled) {\n setOpenState(true);\n }\n\n if (onOpen) {\n onOpen(event);\n }\n };\n\n const handleEnter = (event: MouseEvent | TouchEvent | FocusEvent) => {\n if (\n ignoreNonTouchEvents.current && event.type !== 'touchstart' ||\n ignoreNonFocusEvents.current && event.type !== 'focusin' && event.type !== 'focus'\n ) {\n return;\n }\n\n // Remove the title ahead of time.\n // We don't want to wait for the next render commit.\n // We would risk displaying two tooltips at the same time (native + this one).\n if (childNode) {\n childNode.setAttribute('title', '');\n }\n\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n if (enterDelay) {\n enterTimer.current = window.setTimeout(() => {\n handleOpen(event);\n }, enterDelay);\n } else {\n handleOpen(event);\n }\n };\n\n const handleFocus = (event: FocusEvent) => {\n // Workaround for https://github.com/facebook/react/issues/7769\n // The autoFocus of React might trigger the event before the componentDidMount.\n // We need to account for this eventuality.\n if (!childNode) {\n setChildNode(event.currentTarget as HTMLElement); // NOSONAR: currentTarget is EventTarget | null\n }\n\n ignoreNonFocusEvents.current = true;\n window.clearTimeout(closeTimer.current);\n handleEnter(event);\n };\n\n const restoreUserSelect = () => {\n if (childNode && prevUserSelectRef.current !== undefined) {\n childNode.style.userSelect = prevUserSelectRef.current;\n prevUserSelectRef.current = undefined;\n // @ts-expect-error\n delete childNode.style.WebkitUserSelect;\n }\n };\n\n const disableUserSelect = () => {\n restoreUserSelect();\n\n if (childNode) {\n prevUserSelectRef.current = window.getComputedStyle(childNode).getPropertyValue('user-select');\n childNode.style.userSelect = 'none';\n // @ts-expect-error\n childNode.style.WebkitUserSelect = 'none';\n }\n };\n\n const handleClose = (event: MouseEvent | TouchEvent | FocusEvent) => {\n restoreUserSelect();\n\n if (!isControlled) {\n setOpenState(false);\n }\n\n if (onClose) {\n onClose(event);\n }\n\n window.clearTimeout(closeTimer.current);\n closeTimer.current = window.setTimeout(() => {\n ignoreNonTouchEvents.current = false;\n ignoreNonFocusEvents.current = false;\n }, SHORTEST_TRANSITION_DURATION);\n };\n\n const handleLeave = (event: MouseEvent | FocusEvent) => {\n if (!disableFocusListener && event.currentTarget === document.activeElement) {\n return;\n }\n if (ignoreNonFocusEvents.current && event.type !== 'focusout' && event.type !== 'blur') {\n return;\n }\n\n window.clearTimeout(enterTimer.current);\n window.clearTimeout(leaveTimer.current);\n if (computedLeaveDelay) {\n leaveTimer.current = window.setTimeout(() => {\n handleClose(event);\n }, computedLeaveDelay);\n } else {\n handleClose(event);\n }\n };\n\n const handleTouchStart = (event: TouchEvent) => {\n ignoreNonTouchEvents.current = true;\n\n disableUserSelect();\n\n window.clearTimeout(leaveTimer.current);\n window.clearTimeout(closeTimer.current);\n window.clearTimeout(touchTimer.current);\n touchTimer.current = window.setTimeout(() => {\n handleEnter(event);\n }, enterTouchDelay);\n };\n\n const handleTouchEnd = (event: TouchEvent) => {\n window.clearTimeout(touchTimer.current);\n window.clearTimeout(leaveTimer.current);\n leaveTimer.current = window.setTimeout(() => {\n handleClose(event);\n }, leaveTouchDelay);\n };\n\n if (!disableTouchListener) {\n childNode?.addEventListener('touchstart', handleTouchStart);\n childNode?.addEventListener('touchend', handleTouchEnd);\n }\n\n if (!disableHoverListener) {\n childNode?.addEventListener('mouseenter', handleEnter);\n childNode?.addEventListener('mouseleave', handleLeave);\n }\n\n if (!disableFocusListener) {\n childNode?.addEventListener('focusin', handleFocus);\n childNode?.addEventListener('focusout', handleLeave);\n }\n\n interactiveWrapperListeners.current = interactive\n ? {\n onMouseOver: handleEnter,\n onMouseLeave: handleLeave,\n onFocus: handleFocus,\n onBlur: handleLeave,\n }\n : {};\n\n return () => {\n if (!disableTouchListener) {\n childNode?.removeEventListener('touchstart', handleTouchStart);\n childNode?.removeEventListener('touchend', handleTouchEnd);\n }\n\n if (!disableHoverListener) {\n childNode?.removeEventListener('mouseenter', handleEnter);\n childNode?.removeEventListener('mouseleave', handleLeave);\n }\n\n if (!disableFocusListener) {\n childNode?.removeEventListener('focusin', handleFocus);\n childNode?.removeEventListener('focusout', handleLeave);\n }\n };\n }, [\n childNode,\n disableTouchListener,\n disableHoverListener,\n disableFocusListener,\n isControlled,\n onOpen,\n onClose,\n enterDelay,\n computedLeaveDelay,\n enterTouchDelay,\n leaveTouchDelay,\n interactive,\n ]);\n\n let open = isControlled ? openProp : openState;\n\n if (!title) {\n open = false;\n }\n\n const shouldShowNativeTitle = !open && !disableHoverListener;\n const childrenProps = {\n ...children.props,\n 'aria-describedby': open ? id || defaultId.current : null,\n title: shouldShowNativeTitle && typeof title === 'string' ? title : null,\n ref: handleRef,\n };\n\n return (\n <>\n {cloneElement(children, childrenProps)}\n <Popper\n placement={placement}\n anchorEl={childNode}\n open={childNode ? Boolean(open) : false}\n manager={tooltipModalManager}\n id={childrenProps['aria-describedby']}\n TransitionProps={{\n timeout: 300,\n classNames: transitionGrowParent,\n ...TransitionProps,\n nodeRef: tooltipRef,\n }}\n {...interactiveWrapperListeners.current}\n {...popperProps}\n middleware={popperMiddleware}\n className={classnames(popperProps?.className, { interactive })}\n >\n <Root className=\"ui-tooltip__root\" ref={tooltipRef}>\n <div className={classnames(transitionGrow({ inner: true }), 'ui-tooltip__container')}>\n {withCorner && <Corner ref={arrowRef} className=\"ui-tooltip__corner\" />}\n <TooltipElement\n {...otherProps}\n className={classnames(\n typography({\n variant: ignoreNonTouchEvents.current ? 'body14' : 'caption12',\n color: 'ondark',\n }),\n className,\n )}\n >\n <Line className={variant} />\n {title}\n </TooltipElement>\n </div>\n </Root>\n </Popper>\n </>\n );\n};\n\nexport default memo(Tooltip);\n"],"names":["SHORTEST_TRANSITION_DURATION","tooltipModalManager","ModalManager","stickToViewportWhenFlipped","state","_elements_floating_ownerDocument","y","placement","rects","elements","win","window","viewportSafety","maxBottom","windowPadding","bottom","Tooltip","children","disableFocusListener","disableHoverListener","disableTouchListener","interactive","enterDelay","enterTouchDelay","leaveDelay","leaveTouchDelay","id","onClose","onOpen","className","openProp","popperProps","TransitionProps","title","variant","withCorner","stickToViewport","otherProps","openState","setOpenState","useState","forceUpdate","childNode","setChildNode","ignoreNonTouchEvents","useRef","ignoreNonFocusEvents","interactiveWrapperListeners","isControlled","undefined","defaultId","closeTimer","enterTimer","leaveTimer","touchTimer","tooltipRef","arrowRef","prevUserSelectRef","computedLeaveDelay","handleOwnRef","useCallback","ref","handleRef","useForkRef","popperMiddleware","useMemo","middleware","flip","shift","arrow","useEffect","Math","n","handleOpen","event","handleEnter","handleFocus","restoreUserSelect","disableUserSelect","handleClose","handleLeave","document","handleTouchStart","handleTouchEnd","open","shouldShowNativeTitle","childrenProps","cloneElement","Popper","Boolean","transitionGrowParent","classnames","Root","transitionGrow","Corner","TooltipElement","typography","Line","memo"],"mappings":";;;;;;;;;;;;;AA8BA,MAAMA,+BAA+B;AAErC,MAAMC,sBAAsB,IAAIC;AAEhC,SAASC;IACP,OAAO;QACL,MAAM;QACN,IAAGC,KAAK;;gBAKMC,kCAAAA;YAJZ,MAAM,EAAEC,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGL;YAC1C,IAAI,CAACG,UAAU,UAAU,CAAC,UAAU,CAACC,MAAM,QAAQ,EACjD,OAAO,CAAC;YAEV,MAAME,MAAM,QAANA,CAAAA,OAAAA,QAAML,CAAAA,qBAAAA,SAAS,QAAQ,AAAD,IAAhBA,KAAAA,IAAAA,QAAAA,CAAAA,mCAAAA,mBAAmB,aAAa,AAAD,IAA/BA,KAAAA,IAAAA,iCAAkC,WAAW,AAAD,IAAC,OAAK,AAAkB,MAAlB,OAAOM,SAAyBA,SAAS;YACvG,IAAI,CAACD,KACH,OAAO,CAAC;YAGV,MAAME,iBAAiB;YACvB,MAAMC,YAAYH,IAAI,WAAW,GAAGI,gBAAgBF;YACpD,MAAMG,SAAST,IAAIE,MAAM,QAAQ,CAAC,MAAM;YACxC,IAAIO,UAAUF,WACZ,OAAO,CAAC;YAEV,OAAO;gBAAE,GAAGA,YAAYL,MAAM,QAAQ,CAAC,MAAM;YAAC;QAChD;IACF;AACF;AA+CA,MAAMQ,UAAU,CAAC;QAAA,EACfC,QAAQ,EACRC,uBAAuB,IAAI,EAC3BC,uBAAuB,KAAK,EAC5BC,uBAAuB,KAAK,EAC5BC,cAAc,KAAK,EACnBC,aAAa,GAAG,EAChBC,kBAAkB,GAAG,EACrBC,UAAU,EACVC,kBAAkB,IAAI,EACtBC,EAAE,EACFC,OAAO,EACPC,MAAM,EACN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AJ;KACD;IAED,IAAI+D,OAAOpC,eAAelB,WAAWQ;IAErC,IAAI,CAACL,OACHmD,OAAO;IAGT,MAAMC,wBAAwB,CAACD,QAAQ,CAACjE;IACxC,MAAMmE,gBAAgB,6BACjBrE,SAAS,KAAK;QACjB,oBAAoBmE,OAAO1D,MAAMwB,UAAU,OAAO,GAAG;QACrD,OAAOmC,yBAAyB,AAAiB,YAAjB,OAAOpD,QAAqBA,QAAQ;QACpE,KAAK6B;;IAGP,OAAO,WAAP,GACE;;0BACGyB,aAAatE,UAAUqE;0BACxB,IAACE,QAAMA,uBAAAA,EAAAA;gBACL,WAAWjF;gBACX,UAAUmC;gBACV,MAAMA,YAAY+C,QAAQL,QAAQ;gBAClC,SAASnF;gBACT,IAAIqF,aAAa,CAAC,mBAAmB;gBACrC,iBAAiB;oBACf,SAAS;oBACT,YAAYI;mBACT1D,kBAAAA;oBACH,SAASuB;;eAEPR,4BAA4B,OAAO,EACnChB,cAAAA;gBACJ,YAAYiC;gBACZ,WAAW2B,KAAW5D,QAAAA,cAAAA,KAAAA,IAAAA,YAAa,SAAS,EAAE;oBAAEV;gBAAY;0BAE5D,kBAACuE,MAAIA;oBAAC,WAAU;oBAAmB,KAAKrC;8BACtC,mBAAC;wBAAI,WAAWoC,KAAWE,eAAe;4BAAE,OAAO;wBAAK,IAAI;;4BACzD1D,cAAc,WAAdA,GAAc,IAAC2D,QAAMA;gCAAC,KAAKtC;gCAAU,WAAU;;0CAChD,KAACuC,gBAAcA,uBAAAA,EAAAA,CAAAA,GACT1D,aAAAA;gCACJ,WAAWsD,KACTK,WAAW;oCACT,SAASpD,qBAAqB,OAAO,GAAG,WAAW;oCACnD,OAAO;gCACT,IACAf;;kDAGF,IAACoE,MAAIA;wCAAC,WAAW/D;;oCAChBD;;;;;;;;;AAOf;AAEA,sCAAeiE,KAAKlF"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./types.js";
2
- const version = "3.33.2";
2
+ const version = "3.34.0";
3
3
  export { default as Button } from "./Button/index.js";
4
4
  export { default as ButtonAsync } from "./ButtonAsync/index.js";
5
5
  export { default as MarketingButton } from "./MarketingButton/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finam/web-ui-kit-components",
3
- "version": "3.33.2",
3
+ "version": "3.34.0",
4
4
  "description": "Components library for web-ui-kit",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -97,6 +97,7 @@
97
97
  "@finam/web-ui-kit-core": "^4.0.0",
98
98
  "@testing-library/jest-dom": "^6.9.1",
99
99
  "@testing-library/react": "^16.3.2",
100
+ "@testing-library/user-event": "^14.6.1",
100
101
  "@types/lodash": "^4.17.21",
101
102
  "@types/react": "^19.2.14",
102
103
  "@types/react-dom": "^19.2.3",
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar/index.js","sources":["../../src/Avatar/index.ts"],"sourcesContent":["import Avatar, { Props } from './Avatar.js';\n\nexport type { Props as AvatarProps };\nexport default Avatar;\n"],"names":["Avatar"],"mappings":";AAGA,mBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Calendar/Day/index.js","sources":["../../../src/Calendar/Day/index.ts"],"sourcesContent":["import Day, { Props } from './Day.js';\n\nexport type { Props as DayProps };\nexport default Day;\n"],"names":["Day"],"mappings":";AAGA,qBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Calendar/SlideTransition/index.js","sources":["../../../src/Calendar/SlideTransition/index.ts"],"sourcesContent":["import SlideTransition, { Props } from './SlideTransition.js';\n\nexport type { SlideDirection } from './types.js';\nexport type { Props as SlideTransitionProps };\nexport default SlideTransition;\n"],"names":["SlideTransition"],"mappings":";AAIA,iCAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CheckboxField/index.js","sources":["../../src/CheckboxField/index.ts"],"sourcesContent":["import CheckboxField, { Props } from './CheckboxField.js';\n\nexport type { Props as CheckboxFieldProps };\nexport default CheckboxField;\n"],"names":["CheckboxField"],"mappings":";AAGA,0BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Chip/index.js","sources":["../../src/Chip/index.ts"],"sourcesContent":["import Chip, { Props } from './Chip.js';\n\nexport type { Props as ChipProps };\nexport default Chip;\n"],"names":["Chip"],"mappings":";AAGA,iBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClickAwayListener/index.js","sources":["../../src/ClickAwayListener/index.ts"],"sourcesContent":["import ClickAwayListener, { Props } from './ClickAwayListener.js';\n\nexport type { Props as ClickAwayListenerProps };\nexport default ClickAwayListener;\n"],"names":["ClickAwayListener"],"mappings":";AAGA,8BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Counter/index.js","sources":["../../src/Counter/index.ts"],"sourcesContent":["import Counter, { Props } from './Counter.js';\n\nexport type { Props as CounterProps };\nexport default Counter;\n"],"names":["Counter"],"mappings":";AAGA,oBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePeriod/index.js","sources":["../../src/DateTimePeriod/index.ts"],"sourcesContent":["import DateTimePeriod, { Props } from './DateTimePeriod.js';\nimport type { ChangePeriodHandler } from './types.js';\n\nexport type { Props as DateTimePeriodProps };\nexport type { ChangePeriodHandler };\nexport default DateTimePeriod;\n"],"names":["DateTimePeriod"],"mappings":";AAKA,2BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateTimePicker/index.js","sources":["../../src/DateTimePicker/index.ts"],"sourcesContent":["import DateTimePicker, { Props } from './DateTimePicker.js';\n\nexport type { Props as DateTimePickerProps };\nexport default DateTimePicker;\n"],"names":["DateTimePicker"],"mappings":";AAGA,2BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogActions/index.js","sources":["../../src/DialogActions/index.ts"],"sourcesContent":["import DialogActions, { Props } from './DialogActions.js';\n\nexport type { Props as DialogActionsProps };\nexport default DialogActions;\n"],"names":["DialogActions"],"mappings":";AAGA,0BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogContent/index.js","sources":["../../src/DialogContent/index.ts"],"sourcesContent":["import DialogContent, { Props, DialogContentScrollHandle } from './DialogContent.js';\n\nexport type { Props as DialogContentProps, DialogContentScrollHandle };\nexport default DialogContent;\n"],"names":["DialogContent"],"mappings":";AAGA,0BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DialogTitle/index.js","sources":["../../src/DialogTitle/index.ts"],"sourcesContent":["import DialogTitle, { Props } from './DialogTitle.js';\n\nexport type { Props as DialogTitleProps };\nexport default DialogTitle;\n"],"names":["DialogTitle"],"mappings":";AAGA,wBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Divider/index.js","sources":["../../src/Divider/index.ts"],"sourcesContent":["import Divider, { Props } from './Divider.js';\n\nexport type { Color, Size } from './types.js';\nexport type { Props as DividerProps };\nexport default Divider;\n"],"names":["Divider"],"mappings":";AAIA,oBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DropDownMenu/index.js","sources":["../../src/DropDownMenu/index.ts"],"sourcesContent":["import DropDownMenu, { Props } from './DropDownMenu.js';\n\nexport type { Props as DropDownMenuProps };\nexport default DropDownMenu;\n"],"names":["DropDownMenu"],"mappings":";AAGA,yBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FeatureCallout/FeatureCalloutActions/index.js","sources":["../../../src/FeatureCallout/FeatureCalloutActions/index.ts"],"sourcesContent":["import FeatureCalloutActions, { Props } from './FeatureCalloutActions.js';\n\nexport type { Props as FeatureCalloutActionsProps };\nexport default FeatureCalloutActions;\n"],"names":["FeatureCalloutActions"],"mappings":";AAGA,6CAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FeatureCallout/FeatureCalloutText/index.js","sources":["../../../src/FeatureCallout/FeatureCalloutText/index.ts"],"sourcesContent":["import FeatureCalloutText, { Props } from './FeatureCalloutText.js';\n\nexport type { Props as FeatureCalloutTextProps };\nexport default FeatureCalloutText;\n"],"names":["FeatureCalloutText"],"mappings":";AAGA,0CAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FeatureCallout/FeatureCalloutTitle/index.js","sources":["../../../src/FeatureCallout/FeatureCalloutTitle/index.ts"],"sourcesContent":["import FeatureCalloutTitle, { Props } from './FeatureCalloutTitle.js';\n\nexport type { Props as FeatureCalloutTitleProps };\nexport default FeatureCalloutTitle;\n"],"names":["FeatureCalloutTitle"],"mappings":";AAGA,2CAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FeatureCallout/index.js","sources":["../../src/FeatureCallout/index.ts"],"sourcesContent":["import FeatureCallout, { Props as FeatureCalloutProps } from './FeatureCallout.js';\nimport FeatureCalloutActions, { FeatureCalloutActionsProps } from './FeatureCalloutActions/index.js';\nimport FeatureCalloutTitle, { FeatureCalloutTitleProps } from './FeatureCalloutTitle/index.js';\nimport FeatureCalloutText, { FeatureCalloutTextProps } from './FeatureCalloutText/index.js';\n\nexport type {\n FeatureCalloutProps,\n FeatureCalloutActionsProps,\n FeatureCalloutTitleProps,\n FeatureCalloutTextProps,\n};\nexport default FeatureCallout;\nexport { FeatureCalloutPosition } from './constants.js';\nexport { FeatureCalloutActions, FeatureCalloutTitle, FeatureCalloutText };\n"],"names":["FeatureCallout"],"mappings":";AAWA,2BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldHint/index.js","sources":["../../src/FieldHint/index.ts"],"sourcesContent":["import FieldHint, { Props } from './FieldHint.js';\n\nexport type { Props as FieldHintProps };\nexport default FieldHint;\n"],"names":["FieldHint"],"mappings":";AAGA,sBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormGroup/index.js","sources":["../../src/FormGroup/index.ts"],"sourcesContent":["import FormGroup, { Props } from './FormGroup.js';\n\nexport type { Props as FormGroupProps };\nexport default FormGroup;\n"],"names":["FormGroup"],"mappings":";AAGA,sBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Loader/index.js","sources":["../../src/Loader/index.ts"],"sourcesContent":["import Loader, { Props, Color } from './Loader.js';\n\nexport type { Props as LoaderProps, Color as LoaderColor };\nexport default Loader;\n"],"names":["Loader"],"mappings":";AAGA,mBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoaderBackdrop/index.js","sources":["../../src/LoaderBackdrop/index.ts"],"sourcesContent":["import LoaderBackdrop, { Props } from './LoaderBackdrop.js';\n\nexport type { Props as LoaderBackdropProps };\nexport default LoaderBackdrop;\n"],"names":["LoaderBackdrop"],"mappings":";AAGA,2BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoaderDots/index.js","sources":["../../src/LoaderDots/index.ts"],"sourcesContent":["import LoaderDots, { Props } from './LoaderDots.js';\n\nexport type { Props as LoaderProps };\nexport default LoaderDots;\n"],"names":["LoaderDots"],"mappings":";AAGA,uBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalsProvider/index.js","sources":["../../src/ModalsProvider/index.ts"],"sourcesContent":["import ModalsProvider, { ModalsProviderProps } from './ModalsProvider.js';\n\nexport { ModalsProvider, type ModalsProviderProps };\nexport { default as useModalState } from './useModalState.js';\nexport * from './types.js';\n\nexport default ModalsProvider;\n"],"names":["ModalsProvider"],"mappings":";;AAMA,2BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MultiSelectField/index.js","sources":["../../src/MultiSelectField/index.ts"],"sourcesContent":["import MultiSelectField, { Props } from './MultiSelectField.js';\n\nexport type { Props as MultiSelectFieldProps };\nexport default MultiSelectField;\n"],"names":["MultiSelectField"],"mappings":";AAGA,6BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"NumberTextField/index.js","sources":["../../src/NumberTextField/index.ts"],"sourcesContent":["import NumberTextField, { Props } from './NumberTextField.js';\n\nexport type { Props as NumberTextFieldProps };\nexport default NumberTextField;\n"],"names":["NumberTextField"],"mappings":";AAGA,4BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginatorNumber/NavButton/index.js","sources":["../../../src/PaginatorNumber/NavButton/index.ts"],"sourcesContent":["import NavButton, { Props } from './NavButton.js';\n\nexport type { Props as NavButtonProps };\nexport default NavButton;\n"],"names":["NavButton"],"mappings":";AAGA,kCAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginatorNumber/PageButton/index.js","sources":["../../../src/PaginatorNumber/PageButton/index.ts"],"sourcesContent":["import PageButton, { Props } from './PageButton.js';\n\nexport type { Props as PageButtonProps };\nexport default PageButton;\n"],"names":["PageButton"],"mappings":";AAGA,mCAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginatorNumber/index.js","sources":["../../src/PaginatorNumber/index.ts"],"sourcesContent":["import PaginatorNumber, { Props } from './PaginatorNumber.js';\n\nexport type { Props as PaginatorNumberProps };\nexport default PaginatorNumber;\n"],"names":["PaginatorNumber"],"mappings":";AAGA,4BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginatorOverflow/NavButton/index.js","sources":["../../../src/PaginatorOverflow/NavButton/index.ts"],"sourcesContent":["import NavButton, { Props } from './NavButton.js';\n\nexport type { Props as NavButtonProps };\nexport default NavButton;\n"],"names":["NavButton"],"mappings":";AAGA,oCAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PaginatorOverflow/index.js","sources":["../../src/PaginatorOverflow/index.ts"],"sourcesContent":["import PaginatorOverflow, { Props } from './PaginatorOverflow.js';\nexport type { Props as PaginatorOverflowProps };\n\nexport default PaginatorOverflow;\n"],"names":["PaginatorOverflow"],"mappings":";AAGA,8BAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Skeleton/index.js","sources":["../../src/Skeleton/index.ts"],"sourcesContent":["import Skeleton, { Props } from './Skeleton.js';\n\nexport type { TypographyVariant, SkeletonTypographyProps } from './types.js';\nexport type { Props as SkeletonProps };\nexport default Skeleton;\n"],"names":["Skeleton"],"mappings":";AAIA,qBAAeA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Stepper/index.js","sources":["../../src/Stepper/index.ts"],"sourcesContent":["import Stepper, { Props } from './Stepper.js';\n\nexport type { Size } from './types.js';\nexport type { Props as StepperProps };\nexport default Stepper;\n"],"names":["Stepper"],"mappings":";AAIA,oBAAeA"}