@salutejs/plasma-new-hope 0.229.0-canary.1666.12456056975.0 → 0.230.0-canary.1670.12462995068.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
  2. package/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  3. package/cjs/components/Breadcrumbs/utils/index.js +38 -0
  4. package/cjs/components/Breadcrumbs/utils/index.js.map +1 -1
  5. package/cjs/components/Calendar/utils/getDateWithModification.js.map +1 -1
  6. package/cjs/components/Combobox/ComboboxNew/Combobox.js +3 -2
  7. package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  8. package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
  9. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
  10. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +2 -2
  11. package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  12. package/cjs/components/Dropdown/Dropdown.js +3 -2
  13. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  14. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  15. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  16. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
  17. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +2 -2
  18. package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  19. package/cjs/components/Select/Select.js +3 -2
  20. package/cjs/components/Select/Select.js.map +1 -1
  21. package/cjs/components/Select/ui/Inner/Inner.css +109 -0
  22. package/cjs/components/Select/ui/Inner/Inner.js +1 -1
  23. package/cjs/components/Select/ui/Inner/Inner.js.map +1 -1
  24. package/cjs/components/Select/ui/Inner/ui/Item/Item.css +112 -0
  25. package/cjs/components/Select/ui/Inner/ui/Item/Item.js +2 -2
  26. package/cjs/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  27. package/cjs/components/Slider/components/Double/Double.css +91 -0
  28. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
  29. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
  30. package/cjs/components/TextArea/TextArea.js +6 -0
  31. package/cjs/components/TextArea/TextArea.js.map +1 -1
  32. package/cjs/components/TextField/TextField.js +1 -0
  33. package/cjs/components/TextField/TextField.js.map +1 -1
  34. package/cjs/engines/common.js +36 -0
  35. package/cjs/engines/common.js.map +1 -1
  36. package/cjs/engines/linaria.js +3 -3
  37. package/cjs/engines/linaria.js.map +1 -1
  38. package/emotion/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
  39. package/emotion/cjs/components/Breadcrumbs/utils/index.js +37 -1
  40. package/emotion/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
  41. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
  42. package/emotion/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
  43. package/emotion/cjs/components/Dropdown/Dropdown.js +4 -3
  44. package/emotion/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
  45. package/emotion/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
  46. package/emotion/cjs/components/Select/Select.js +4 -3
  47. package/emotion/cjs/components/Select/ui/Inner/Inner.js +3 -3
  48. package/emotion/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
  49. package/emotion/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
  50. package/emotion/cjs/components/TextArea/TextArea.js +7 -1
  51. package/emotion/cjs/components/TextField/TextField.js +2 -1
  52. package/emotion/cjs/engines/common.js +42 -2
  53. package/emotion/cjs/engines/emotion.js +4 -4
  54. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
  55. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
  56. package/emotion/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
  57. package/emotion/es/components/Breadcrumbs/utils/index.js +35 -0
  58. package/emotion/es/components/Calendar/utils/getDateWithModification.js +1 -1
  59. package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
  60. package/emotion/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
  61. package/emotion/es/components/Dropdown/Dropdown.js +2 -2
  62. package/emotion/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  63. package/emotion/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
  64. package/emotion/es/components/Select/Select.js +2 -2
  65. package/emotion/es/components/Select/ui/Inner/Inner.js +1 -1
  66. package/emotion/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
  67. package/emotion/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
  68. package/emotion/es/components/TextArea/TextArea.js +8 -2
  69. package/emotion/es/components/TextField/TextField.js +2 -1
  70. package/emotion/es/engines/common.js +40 -0
  71. package/emotion/es/engines/emotion.js +2 -2
  72. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
  73. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
  74. package/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
  75. package/es/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  76. package/es/components/Breadcrumbs/utils/index.js +37 -1
  77. package/es/components/Breadcrumbs/utils/index.js.map +1 -1
  78. package/es/components/Calendar/utils/getDateWithModification.js.map +1 -1
  79. package/es/components/Combobox/ComboboxNew/Combobox.js +3 -3
  80. package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
  81. package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +75 -0
  82. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +112 -0
  83. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
  84. package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js.map +1 -1
  85. package/es/components/Dropdown/Dropdown.js +3 -3
  86. package/es/components/Dropdown/Dropdown.js.map +1 -1
  87. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  88. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
  89. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.css +25 -0
  90. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
  91. package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
  92. package/es/components/Select/Select.js +3 -3
  93. package/es/components/Select/Select.js.map +1 -1
  94. package/es/components/Select/ui/Inner/Inner.css +109 -0
  95. package/es/components/Select/ui/Inner/Inner.js +1 -1
  96. package/es/components/Select/ui/Inner/Inner.js.map +1 -1
  97. package/es/components/Select/ui/Inner/ui/Item/Item.css +112 -0
  98. package/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
  99. package/es/components/Select/ui/Inner/ui/Item/Item.js.map +1 -1
  100. package/es/components/Slider/components/Double/Double.css +91 -0
  101. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +7 -0
  102. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js.map +1 -1
  103. package/es/components/TextArea/TextArea.js +7 -1
  104. package/es/components/TextArea/TextArea.js.map +1 -1
  105. package/es/components/TextField/TextField.js +1 -0
  106. package/es/components/TextField/TextField.js.map +1 -1
  107. package/es/engines/common.js +36 -2
  108. package/es/engines/common.js.map +1 -1
  109. package/es/engines/linaria.js +1 -1
  110. package/es/engines/linaria.js.map +1 -1
  111. package/package.json +5 -17
  112. package/styled-components/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
  113. package/styled-components/cjs/components/Breadcrumbs/utils/index.js +37 -1
  114. package/styled-components/cjs/components/Calendar/utils/getDateWithModification.js +3 -3
  115. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +4 -3
  116. package/styled-components/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
  117. package/styled-components/cjs/components/Dropdown/Dropdown.js +4 -3
  118. package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +3 -3
  119. package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
  120. package/styled-components/cjs/components/Select/Select.js +4 -3
  121. package/styled-components/cjs/components/Select/ui/Inner/Inner.js +3 -3
  122. package/styled-components/cjs/components/Select/ui/Inner/ui/Item/Item.js +1 -1
  123. package/styled-components/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +3 -3
  124. package/styled-components/cjs/components/TextArea/TextArea.js +6 -0
  125. package/styled-components/cjs/components/TextField/TextField.js +1 -0
  126. package/styled-components/cjs/engines/common.js +42 -2
  127. package/styled-components/cjs/engines/styled-components.js +3 -3
  128. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
  129. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
  130. package/styled-components/es/components/Breadcrumbs/Breadcrumbs.js +1 -2
  131. package/styled-components/es/components/Breadcrumbs/utils/index.js +35 -0
  132. package/styled-components/es/components/Calendar/utils/getDateWithModification.js +1 -1
  133. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +2 -2
  134. package/styled-components/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.js +1 -1
  135. package/styled-components/es/components/Dropdown/Dropdown.js +2 -2
  136. package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +1 -1
  137. package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +1 -1
  138. package/styled-components/es/components/Select/Select.js +2 -2
  139. package/styled-components/es/components/Select/ui/Inner/Inner.js +1 -1
  140. package/styled-components/es/components/Select/ui/Inner/ui/Item/Item.js +1 -1
  141. package/styled-components/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.js +1 -1
  142. package/styled-components/es/components/TextArea/TextArea.js +7 -1
  143. package/styled-components/es/components/TextField/TextField.js +1 -0
  144. package/styled-components/es/engines/common.js +40 -0
  145. package/styled-components/es/engines/styled-components.js +1 -1
  146. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -8
  147. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +69 -7
  148. package/types/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  149. package/types/components/Breadcrumbs/utils/index.d.ts +5 -2
  150. package/types/components/Breadcrumbs/utils/index.d.ts.map +1 -1
  151. package/types/components/Calendar/utils/getDateWithModification.d.ts +1 -1
  152. package/types/components/Calendar/utils/getDateWithModification.d.ts.map +1 -1
  153. package/types/components/Combobox/ComboboxNew/Combobox.d.ts +2 -1
  154. package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
  155. package/types/components/Dropdown/Dropdown.d.ts +2 -1
  156. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  157. package/types/components/Select/Select.d.ts +2 -1
  158. package/types/components/Select/Select.d.ts.map +1 -1
  159. package/types/components/TextArea/TextArea.d.ts.map +1 -1
  160. package/types/components/TextField/TextField.d.ts.map +1 -1
  161. package/types/engines/common.d.ts +3 -1
  162. package/types/engines/common.d.ts.map +1 -1
  163. package/cjs/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
  164. package/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -44
  165. package/cjs/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
  166. package/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -10
  167. package/cjs/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
  168. package/cjs/components/Dropdown/Dropdown.context.js +0 -10
  169. package/cjs/components/Dropdown/Dropdown.context.js.map +0 -1
  170. package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
  171. package/cjs/components/Select/Select.context.js +0 -10
  172. package/cjs/components/Select/Select.context.js.map +0 -1
  173. package/cjs/engines/utils.js +0 -40
  174. package/cjs/engines/utils.js.map +0 -1
  175. package/emotion/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
  176. package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
  177. package/emotion/cjs/components/Dropdown/Dropdown.context.js +0 -8
  178. package/emotion/cjs/components/Select/Select.context.js +0 -8
  179. package/emotion/cjs/engines/utils.js +0 -42
  180. package/emotion/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
  181. package/emotion/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
  182. package/emotion/es/components/Dropdown/Dropdown.context.js +0 -2
  183. package/emotion/es/components/Select/Select.context.js +0 -2
  184. package/emotion/es/engines/utils.js +0 -36
  185. package/es/components/Breadcrumbs/ui/BreadcrumbShorter/BreadcrumbShorter.css +0 -3
  186. package/es/components/Breadcrumbs/utils/getShortItems.js +0 -39
  187. package/es/components/Breadcrumbs/utils/getShortItems.js.map +0 -1
  188. package/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -6
  189. package/es/components/Combobox/ComboboxNew/Combobox.context.js.map +0 -1
  190. package/es/components/Dropdown/Dropdown.context.js +0 -6
  191. package/es/components/Dropdown/Dropdown.context.js.map +0 -1
  192. package/es/components/Dropdown/ui/DropdownInner/DropdownInner.css +0 -27
  193. package/es/components/Select/Select.context.js +0 -6
  194. package/es/components/Select/Select.context.js.map +0 -1
  195. package/es/engines/utils.js +0 -35
  196. package/es/engines/utils.js.map +0 -1
  197. package/styled-components/cjs/components/Breadcrumbs/utils/getShortItems.js +0 -42
  198. package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.context.js +0 -8
  199. package/styled-components/cjs/components/Dropdown/Dropdown.context.js +0 -8
  200. package/styled-components/cjs/components/Select/Select.context.js +0 -8
  201. package/styled-components/cjs/engines/utils.js +0 -42
  202. package/styled-components/es/components/Breadcrumbs/utils/getShortItems.js +0 -35
  203. package/styled-components/es/components/Combobox/ComboboxNew/Combobox.context.js +0 -2
  204. package/styled-components/es/components/Dropdown/Dropdown.context.js +0 -2
  205. package/styled-components/es/components/Select/Select.context.js +0 -2
  206. package/styled-components/es/engines/utils.js +0 -36
  207. package/types/components/Breadcrumbs/utils/getShortItems.d.ts +0 -6
  208. package/types/components/Breadcrumbs/utils/getShortItems.d.ts.map +0 -1
  209. package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts +0 -4
  210. package/types/components/Combobox/ComboboxNew/Combobox.context.d.ts.map +0 -1
  211. package/types/components/Dropdown/Dropdown.context.d.ts +0 -4
  212. package/types/components/Dropdown/Dropdown.context.d.ts.map +0 -1
  213. package/types/components/Select/Select.context.d.ts +0 -4
  214. package/types/components/Select/Select.context.d.ts.map +0 -1
  215. package/types/engines/utils.d.ts +0 -4
  216. package/types/engines/utils.d.ts.map +0 -1
  217. /package/cjs/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
  218. /package/es/components/Breadcrumbs/utils/{getShortItems.css → index.css} +0 -0
@@ -1,6 +1,6 @@
1
1
  import './TextArea_e0xkpd.css';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
3
- import React, { forwardRef, useState, useRef, useCallback, createRef } from 'react';
3
+ import React, { forwardRef, useState, useRef, useLayoutEffect, useCallback, createRef } from 'react';
4
4
  import { useForkRef, useResizeObserver } from '@salutejs/plasma-core';
5
5
  import { cx } from '../../utils/index.js';
6
6
  import { OuterLabelWrapper, StyledIndicatorWrapper, StyledLabel, StyledHintWrapper, StyledIndicator, TitleCaption, StyledContainer, StyledContent, StyledTextAreaWrapper, StyledTextArea, StyledHiddenTextArea, StyledHelpers, StyledLeftHelper, StyledRightHelper, StyledPlaceholder, StyledOutsideHelpersWrapper, StyledOptionalText } from './TextArea.styles.js';
@@ -175,6 +175,11 @@ var textAreaRoot = function textAreaRoot(Root) {
175
175
  setIsHintVisible(true);
176
176
  }
177
177
  };
178
+ useLayoutEffect(function () {
179
+ if (outerRef.current) {
180
+ setUncontrolledValue(outerRef.current.value);
181
+ }
182
+ }, [outerRef]);
178
183
  useResizeObserver(outerRef, function (currentElement) {
179
184
  var inlineWidth = currentElement.style.width;
180
185
  if (inlineWidth || cols) {
@@ -280,6 +285,7 @@ var textAreaRoot = function textAreaRoot(Root) {
280
285
  applyCustomWidth: applyCustomWidth,
281
286
  ref: mergeRefs(outerRef, innerRef),
282
287
  disabled: disabled,
288
+ required: required,
283
289
  height: applyAutoResize ? minAuto : height,
284
290
  width: width,
285
291
  placeholder: placeholderLabel,
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import React, { forwardRef, useState, createRef, useCallback, useRef, MouseEventHandler } from 'react';\nimport { css } from '@linaria/core';\nimport { useForkRef, useResizeObserver } from '@salutejs/plasma-core';\n\nimport { cx, mergeRefs } from '../../utils';\nimport type { RootProps } from '../../engines/types';\nimport { useOutsideClick } from '../../hooks';\n\nimport { applyDynamicLabel } from './mixins';\nimport { useAutoResize, ROOT_FONT_SIZE } from './hooks';\nimport {\n StyledContent,\n StyledHelpers,\n StyledLeftHelper,\n StyledRightHelper,\n StyledLabel,\n StyledPlaceholder,\n StyledTextArea,\n StyledTextAreaWrapper,\n StyledContainer,\n StyledIndicator,\n StyledOptionalText,\n OuterLabelWrapper,\n StyledIndicatorWrapper,\n StyledHintWrapper,\n TitleCaption,\n StyledOutsideHelpersWrapper,\n StyledHiddenTextArea,\n} from './TextArea.styles';\nimport { classes } from './TextArea.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport type { TextAreaProps, TextAreaRootProps } from './TextArea.types';\nimport { HintComponent } from './ui/Hint/Hint';\n\nconst {\n innerPlaceholderUp,\n focusedOuterPlaceholderColor,\n hidePlaceHolder,\n styledContainer,\n styledTextArea,\n styledTextAreaWrapper,\n styledPlaceholder,\n styledHelpers,\n} = classes;\n\nconst optionalText = 'optional';\n\nconst base = css`\n ${applyDynamicLabel};\n\n position: relative;\n box-sizing: border-box;\n`;\n\n// TODO: Удалить после отказа от старых библиотек plasma-web / plasma-b2c\nconst fallbackStatusMap = {\n '': 'primary',\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\n// TODO: Перенести этот метод в файл applyDynamicLabel.ts\nexport const getDynamicLabelClasses = (props: TextAreaProps, focused: boolean) => {\n const { readOnly, label, labelPlacement, rows, value, size } = props;\n\n // Добавить класс отвечающий за изменение цвета плейсхолдера при фокусе\n const withFocusedOuterUpPlaceholder =\n !readOnly && focused && (!label || labelPlacement === 'outer') ? focusedOuterPlaceholderColor : undefined;\n\n // Добавить класс отвечающий за поднятие и уменьшение плейсхолдера\n const withInnerPlaceholderUp =\n labelPlacement === 'inner' &&\n label &&\n !rows &&\n size !== 'xs' &&\n ((!readOnly && (value || focused)) || (readOnly && value))\n ? innerPlaceholderUp\n : undefined;\n\n // Добавить класс отвечающий за скрытие плейсхолдера\n const withHidePlaceholder =\n (value && !label) ||\n (labelPlacement === 'inner' && ((focused && !readOnly) || value) && label && rows) ||\n (labelPlacement === 'outer' && value) ||\n (labelPlacement === 'inner' && size === 'xs' && value)\n ? hidePlaceHolder\n : undefined;\n\n return [withFocusedOuterUpPlaceholder, withInnerPlaceholderUp, withHidePlaceholder];\n};\n\nexport const textAreaRoot = (Root: RootProps<HTMLTextAreaElement, TextAreaRootProps>) =>\n forwardRef<HTMLTextAreaElement, TextAreaProps>((props, innerRef) => {\n const {\n helperText,\n status,\n resize,\n rightHelper,\n leftHelper,\n leftHelperPlacement = 'inner',\n contentRight,\n autoResize = false,\n minAuto = 0,\n maxAuto,\n label,\n labelPlacement = 'inner',\n titleCaption,\n placeholder,\n defaultValue,\n height,\n width,\n value,\n disabled,\n required = false,\n requiredPlacement = 'right',\n optional = false,\n clear,\n hasDivider,\n size,\n view,\n id,\n style,\n className,\n readOnly,\n rows,\n cols,\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n onChange,\n ...rest\n } = props;\n\n const [isHintVisible, setIsHintVisible] = useState(false);\n const [helperWidth, setHelperWidth] = useState<string>(width ? `${width}rem` : '100%');\n const [focused, setFocused] = useState(false);\n // TODO: перенести в общую переменную для value снаружи и внутри\n const [uncontrolledValue, setUncontrolledValue] = useState<string | undefined>();\n\n const outerRef = createRef<HTMLTextAreaElement>();\n const hiddenRef = useRef<HTMLTextAreaElement | null>(null);\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const isInnerLeftHelperPlacement = leftHelperPlacement === 'inner';\n const leftHelperText = leftHelper || helperText;\n const innerOptional = required ? false : optional;\n const hasLeftHelper = Boolean(leftHelper || helperText);\n const hasRightHelper = Boolean(rightHelper);\n const hasHelper = !isInnerLeftHelperPlacement ? hasRightHelper : hasLeftHelper || hasRightHelper;\n const hasOuterLabel = Boolean(label && labelPlacement === 'outer');\n const hasInnerLabel = Boolean(label && labelPlacement === 'inner' && size !== 'xs');\n const hasPlaceholderOptional = innerOptional && !hasOuterLabel;\n\n const overriddenView = status !== undefined ? fallbackStatusMap[status] : view;\n const textareaHelperId = id ? `${id}-helper` : undefined;\n const applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;\n const placeholderLabel = hasInnerLabel ? label : placeholder;\n const applyAutoResize = autoResize || Boolean(clear);\n\n const clearClass = clear ? classes.clear : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const hasRightContentClass = contentRight ? classes.hasRightContent : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n useResizeObserver(outerRef, (currentElement) => {\n const { width: inlineWidth } = currentElement.style;\n\n if (inlineWidth || cols) {\n const { width: elementWidth } = currentElement.getBoundingClientRect();\n setHelperWidth(`${elementWidth / ROOT_FONT_SIZE}rem`);\n }\n });\n\n useAutoResize(applyAutoResize, outerRef, value || uncontrolledValue, minAuto, maxAuto, resize, hiddenRef);\n\n const onFocusHandler = useCallback(() => {\n setFocused(true);\n }, []);\n\n const onBlurHandler = useCallback(() => {\n setFocused(false);\n }, []);\n\n const onChangeHandler = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n // INFO: Для крайне редких кейсов, когда value снаружи не контролируется\n if (value === undefined) {\n setUncontrolledValue(event?.target.value);\n }\n\n onChange?.(event);\n },\n [value, onChange],\n );\n\n const handleTextAreaFocus = () => {\n if (readOnly || disabled || !outerRef?.current) {\n return;\n }\n\n outerRef.current.focus();\n };\n\n const dynamicLabelClasses = getDynamicLabelClasses(\n {\n size,\n readOnly,\n label,\n labelPlacement,\n value: value || uncontrolledValue || defaultValue,\n rows,\n },\n focused,\n );\n\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText inheritFont={!hasOuterLabel}>\n {Boolean(hasPlaceholderOptional ? placeholderLabel : label) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={overriddenView}\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n clear={clear}\n style={{ width: helperWidth, ...style }}\n className={cx(clearClass, hasDividerClass, hasHintClass, className)}\n onClick={handleTextAreaFocus}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <StyledLabel>{label}</StyledLabel>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <StyledContainer\n className={cx(styledContainer, ...dynamicLabelClasses)}\n width={helperWidth}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator className={cx(classes.innerLabelPlacement, requiredPlacementClass)} />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentRight && <StyledContent>{contentRight}</StyledContent>}\n <StyledTextAreaWrapper className={cx(styledTextAreaWrapper)} hasHelper={hasHelper}>\n <StyledTextArea\n className={cx(styledTextArea, hasRightContentClass)}\n id={id}\n hasContentRight={Boolean(contentRight)}\n hasHelper={hasHelper}\n applyCustomWidth={applyCustomWidth}\n ref={mergeRefs(outerRef, innerRef)}\n disabled={disabled}\n height={applyAutoResize ? minAuto : height}\n width={width}\n placeholder={placeholderLabel}\n aria-describedby={textareaHelperId}\n value={value}\n readOnly={readOnly}\n rows={rows}\n cols={cols}\n resize={resize}\n defaultValue={defaultValue}\n onChange={onChangeHandler}\n {...rest}\n />\n {applyAutoResize && (\n <StyledHiddenTextArea\n aria-hidden\n ref={hiddenRef}\n hasContentRight={Boolean(contentRight)}\n value={value || uncontrolledValue || ' '}\n defaultValue={defaultValue}\n />\n )}\n </StyledTextAreaWrapper>\n {hasHelper && (\n <StyledHelpers className={styledHelpers} id={textareaHelperId}>\n {isInnerLeftHelperPlacement && (leftHelper || helperText) && (\n <StyledLeftHelper>{leftHelper || helperText}</StyledLeftHelper>\n )}\n {rightHelper && <StyledRightHelper>{rightHelper}</StyledRightHelper>}\n </StyledHelpers>\n )}\n {placeholderLabel && (\n <StyledPlaceholder\n hasContentRight={Boolean(contentRight)}\n className={styledPlaceholder}\n htmlFor={id}\n >\n {placeholderLabel}\n {!hasOuterLabel && optionalTextNode}\n </StyledPlaceholder>\n )}\n </StyledContainer>\n {hasLeftHelper && !isInnerLeftHelperPlacement && (\n <StyledOutsideHelpersWrapper id={textareaHelperId}>\n <StyledLeftHelper>{leftHelperText}</StyledLeftHelper>\n </StyledOutsideHelpersWrapper>\n )}\n </Root>\n );\n });\n\nexport const textAreaConfig = {\n name: 'TextArea',\n tag: 'div',\n layout: textAreaRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n attrs: true,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'primary',\n },\n};\n"],"names":["innerPlaceholderUp","classes","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","optionalText","base","fallbackStatusMap","success","warning","error","HINT_DEFAULT_OFFSET","getDynamicLabelClasses","props","focused","readOnly","label","labelPlacement","rows","value","size","withFocusedOuterUpPlaceholder","undefined","withInnerPlaceholderUp","withHidePlaceholder","textAreaRoot","Root","forwardRef","innerRef","helperText","status","resize","rightHelper","leftHelper","_props$leftHelperPlac","leftHelperPlacement","contentRight","_props$autoResize","autoResize","_props$minAuto","minAuto","maxAuto","_props$labelPlacement","titleCaption","placeholder","defaultValue","height","width","disabled","_props$required","required","_props$requiredPlacem","requiredPlacement","_props$optional","optional","clear","hasDivider","view","id","style","className","cols","_props$hintTrigger","hintTrigger","hintText","_props$hintView","hintView","_props$hintSize","hintSize","hintTargetIcon","_props$hintPlacement","hintPlacement","hintHasArrow","_props$hintOffset","hintOffset","hintWidth","hintContentLeft","onChange","rest","_excluded","_useState","useState","_useState2","_slicedToArray","isHintVisible","setIsHintVisible","_useState3","concat","_useState4","helperWidth","setHelperWidth","_useState5","_useState6","setFocused","_useState7","_useState8","uncontrolledValue","setUncontrolledValue","outerRef","createRef","hiddenRef","useRef","hintRef","useOutsideClick","hintInnerRef","hintForkRef","useForkRef","isInnerLeftHelperPlacement","leftHelperText","innerOptional","hasLeftHelper","Boolean","hasRightHelper","hasHelper","hasOuterLabel","hasInnerLabel","hasPlaceholderOptional","overriddenView","textareaHelperId","applyCustomWidth","placeholderLabel","applyAutoResize","clearClass","hasHintClass","hasHint","hasRightContentClass","hasRightContent","hasDividerClass","requiredPlacementClass","requiredAlignRight","handleHintShow","handleHintHide","handleHintClick","event","_hintInnerRef$current","stopPropagation","targetIsPopover","target","current","rootHasTarget","contains","useResizeObserver","currentElement","inlineWidth","_currentElement$getBo","getBoundingClientRect","elementWidth","ROOT_FONT_SIZE","useAutoResize","onFocusHandler","useCallback","onBlurHandler","onChangeHandler","handleTextAreaFocus","focus","dynamicLabelClasses","optionalTextNode","React","createElement","StyledOptionalText","inheritFont","_extends","_objectSpread","cx","onClick","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","StyledLabel","StyledHintWrapper","HintComponent","ref","StyledIndicator","outerLabelPlacement","TitleCaption","StyledContainer","apply","_toConsumableArray","onFocus","onBlur","Fragment","innerLabelPlacement","StyledContent","StyledTextAreaWrapper","StyledTextArea","hasContentRight","mergeRefs","StyledHiddenTextArea","StyledHelpers","StyledLeftHelper","StyledRightHelper","StyledPlaceholder","htmlFor","StyledOutsideHelpersWrapper","textAreaConfig","name","tag","layout","variations","css","sizeCSS","viewCSS","clearCSS","attrs","disabledCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,IACIA,kBAAkB,GAQlBC,OAAO,CARPD,kBAAkB;EAClBE,4BAA4B,GAO5BD,OAAO,CAPPC,4BAA4B;EAC5BC,eAAe,GAMfF,OAAO,CANPE,eAAe;EACfC,eAAe,GAKfH,OAAO,CALPG,eAAe;EACfC,cAAc,GAIdJ,OAAO,CAJPI,cAAc;EACdC,qBAAqB,GAGrBL,OAAO,CAHPK,qBAAqB;EACrBC,iBAAiB,GAEjBN,OAAO,CAFPM,iBAAiB;EACjBC,aAAAA,GACAP,OAAO,CADPO,aAAAA,CAAAA;AAGJ,IAAMC,YAAY,GAAG,UAAU,CAAA;AAE/B,IAAMC,IAAI,GAKT,SAAA,CAAA;;AAED;AACA,IAAMC,iBAAiB,GAAG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AAQ;AACbC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3J,IAAAA,QAAQ,EAAE;AACNuJ,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD5L,IAAAA,QAAQ,EAAE;AACN4L,MAAAA,KAAK,EAAE,IAAA;KACV;AACDzI,IAAAA,QAAQ,EAAE;AACNqI,MAAAA,GAAG,EAAEM,MAAAA;KACR;AACDzI,IAAAA,QAAQ,EAAE;AACNmI,MAAAA,GAAG,EAAEO,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN3L,IAAAA,IAAI,EAAE,GAAG;AACTqC,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import React, { forwardRef, useState, createRef, useCallback, useRef, MouseEventHandler, useLayoutEffect } from 'react';\nimport { css } from '@linaria/core';\nimport { useForkRef, useResizeObserver } from '@salutejs/plasma-core';\n\nimport { cx, mergeRefs } from '../../utils';\nimport type { RootProps } from '../../engines/types';\nimport { useOutsideClick } from '../../hooks';\n\nimport { applyDynamicLabel } from './mixins';\nimport { useAutoResize, ROOT_FONT_SIZE } from './hooks';\nimport {\n StyledContent,\n StyledHelpers,\n StyledLeftHelper,\n StyledRightHelper,\n StyledLabel,\n StyledPlaceholder,\n StyledTextArea,\n StyledTextAreaWrapper,\n StyledContainer,\n StyledIndicator,\n StyledOptionalText,\n OuterLabelWrapper,\n StyledIndicatorWrapper,\n StyledHintWrapper,\n TitleCaption,\n StyledOutsideHelpersWrapper,\n StyledHiddenTextArea,\n} from './TextArea.styles';\nimport { classes } from './TextArea.tokens';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport type { TextAreaProps, TextAreaRootProps } from './TextArea.types';\nimport { HintComponent } from './ui/Hint/Hint';\n\nconst {\n innerPlaceholderUp,\n focusedOuterPlaceholderColor,\n hidePlaceHolder,\n styledContainer,\n styledTextArea,\n styledTextAreaWrapper,\n styledPlaceholder,\n styledHelpers,\n} = classes;\n\nconst optionalText = 'optional';\n\nconst base = css`\n ${applyDynamicLabel};\n\n position: relative;\n box-sizing: border-box;\n`;\n\n// TODO: Удалить после отказа от старых библиотек plasma-web / plasma-b2c\nconst fallbackStatusMap = {\n '': 'primary',\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\n// TODO: Перенести этот метод в файл applyDynamicLabel.ts\nexport const getDynamicLabelClasses = (props: TextAreaProps, focused: boolean) => {\n const { readOnly, label, labelPlacement, rows, value, size } = props;\n\n // Добавить класс отвечающий за изменение цвета плейсхолдера при фокусе\n const withFocusedOuterUpPlaceholder =\n !readOnly && focused && (!label || labelPlacement === 'outer') ? focusedOuterPlaceholderColor : undefined;\n\n // Добавить класс отвечающий за поднятие и уменьшение плейсхолдера\n const withInnerPlaceholderUp =\n labelPlacement === 'inner' &&\n label &&\n !rows &&\n size !== 'xs' &&\n ((!readOnly && (value || focused)) || (readOnly && value))\n ? innerPlaceholderUp\n : undefined;\n\n // Добавить класс отвечающий за скрытие плейсхолдера\n const withHidePlaceholder =\n (value && !label) ||\n (labelPlacement === 'inner' && ((focused && !readOnly) || value) && label && rows) ||\n (labelPlacement === 'outer' && value) ||\n (labelPlacement === 'inner' && size === 'xs' && value)\n ? hidePlaceHolder\n : undefined;\n\n return [withFocusedOuterUpPlaceholder, withInnerPlaceholderUp, withHidePlaceholder];\n};\n\nexport const textAreaRoot = (Root: RootProps<HTMLTextAreaElement, TextAreaRootProps>) =>\n forwardRef<HTMLTextAreaElement, TextAreaProps>((props, innerRef) => {\n const {\n helperText,\n status,\n resize,\n rightHelper,\n leftHelper,\n leftHelperPlacement = 'inner',\n contentRight,\n autoResize = false,\n minAuto = 0,\n maxAuto,\n label,\n labelPlacement = 'inner',\n titleCaption,\n placeholder,\n defaultValue,\n height,\n width,\n value,\n disabled,\n required = false,\n requiredPlacement = 'right',\n optional = false,\n clear,\n hasDivider,\n size,\n view,\n id,\n style,\n className,\n readOnly,\n rows,\n cols,\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n onChange,\n ...rest\n } = props;\n\n const [isHintVisible, setIsHintVisible] = useState(false);\n const [helperWidth, setHelperWidth] = useState<string>(width ? `${width}rem` : '100%');\n const [focused, setFocused] = useState(false);\n // TODO: перенести в общую переменную для value снаружи и внутри\n const [uncontrolledValue, setUncontrolledValue] = useState<string | undefined>();\n\n const outerRef = createRef<HTMLTextAreaElement>();\n const hiddenRef = useRef<HTMLTextAreaElement | null>(null);\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const isInnerLeftHelperPlacement = leftHelperPlacement === 'inner';\n const leftHelperText = leftHelper || helperText;\n const innerOptional = required ? false : optional;\n const hasLeftHelper = Boolean(leftHelper || helperText);\n const hasRightHelper = Boolean(rightHelper);\n const hasHelper = !isInnerLeftHelperPlacement ? hasRightHelper : hasLeftHelper || hasRightHelper;\n const hasOuterLabel = Boolean(label && labelPlacement === 'outer');\n const hasInnerLabel = Boolean(label && labelPlacement === 'inner' && size !== 'xs');\n const hasPlaceholderOptional = innerOptional && !hasOuterLabel;\n\n const overriddenView = status !== undefined ? fallbackStatusMap[status] : view;\n const textareaHelperId = id ? `${id}-helper` : undefined;\n const applyCustomWidth = resize !== 'horizontal' && resize !== 'both' && !cols;\n const placeholderLabel = hasInnerLabel ? label : placeholder;\n const applyAutoResize = autoResize || Boolean(clear);\n\n const clearClass = clear ? classes.clear : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const hasRightContentClass = contentRight ? classes.hasRightContent : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n useLayoutEffect(() => {\n if (outerRef.current) {\n setUncontrolledValue(outerRef.current.value);\n }\n }, [outerRef]);\n\n useResizeObserver(outerRef, (currentElement) => {\n const { width: inlineWidth } = currentElement.style;\n\n if (inlineWidth || cols) {\n const { width: elementWidth } = currentElement.getBoundingClientRect();\n setHelperWidth(`${elementWidth / ROOT_FONT_SIZE}rem`);\n }\n });\n\n useAutoResize(applyAutoResize, outerRef, value || uncontrolledValue, minAuto, maxAuto, resize, hiddenRef);\n\n const onFocusHandler = useCallback(() => {\n setFocused(true);\n }, []);\n\n const onBlurHandler = useCallback(() => {\n setFocused(false);\n }, []);\n\n const onChangeHandler = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n // INFO: Для крайне редких кейсов, когда value снаружи не контролируется\n if (value === undefined) {\n setUncontrolledValue(event?.target.value);\n }\n\n onChange?.(event);\n },\n [value, onChange],\n );\n\n const handleTextAreaFocus = () => {\n if (readOnly || disabled || !outerRef?.current) {\n return;\n }\n\n outerRef.current.focus();\n };\n\n const dynamicLabelClasses = getDynamicLabelClasses(\n {\n size,\n readOnly,\n label,\n labelPlacement,\n value: value || uncontrolledValue || defaultValue,\n rows,\n },\n focused,\n );\n\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText inheritFont={!hasOuterLabel}>\n {Boolean(hasPlaceholderOptional ? placeholderLabel : label) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={overriddenView}\n size={size}\n disabled={disabled}\n readOnly={readOnly}\n clear={clear}\n style={{ width: helperWidth, ...style }}\n className={cx(clearClass, hasDividerClass, hasHintClass, className)}\n onClick={handleTextAreaFocus}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <StyledLabel>{label}</StyledLabel>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <StyledContainer\n className={cx(styledContainer, ...dynamicLabelClasses)}\n width={helperWidth}\n onFocus={onFocusHandler}\n onBlur={onBlurHandler}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator className={cx(classes.innerLabelPlacement, requiredPlacementClass)} />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentRight && <StyledContent>{contentRight}</StyledContent>}\n <StyledTextAreaWrapper className={cx(styledTextAreaWrapper)} hasHelper={hasHelper}>\n <StyledTextArea\n className={cx(styledTextArea, hasRightContentClass)}\n id={id}\n hasContentRight={Boolean(contentRight)}\n hasHelper={hasHelper}\n applyCustomWidth={applyCustomWidth}\n ref={mergeRefs(outerRef, innerRef)}\n disabled={disabled}\n required={required}\n height={applyAutoResize ? minAuto : height}\n width={width}\n placeholder={placeholderLabel}\n aria-describedby={textareaHelperId}\n value={value}\n readOnly={readOnly}\n rows={rows}\n cols={cols}\n resize={resize}\n defaultValue={defaultValue}\n onChange={onChangeHandler}\n {...rest}\n />\n {applyAutoResize && (\n <StyledHiddenTextArea\n aria-hidden\n ref={hiddenRef}\n hasContentRight={Boolean(contentRight)}\n value={value || uncontrolledValue || ' '}\n defaultValue={defaultValue}\n />\n )}\n </StyledTextAreaWrapper>\n {hasHelper && (\n <StyledHelpers className={styledHelpers} id={textareaHelperId}>\n {isInnerLeftHelperPlacement && (leftHelper || helperText) && (\n <StyledLeftHelper>{leftHelper || helperText}</StyledLeftHelper>\n )}\n {rightHelper && <StyledRightHelper>{rightHelper}</StyledRightHelper>}\n </StyledHelpers>\n )}\n {placeholderLabel && (\n <StyledPlaceholder\n hasContentRight={Boolean(contentRight)}\n className={styledPlaceholder}\n htmlFor={id}\n >\n {placeholderLabel}\n {!hasOuterLabel && optionalTextNode}\n </StyledPlaceholder>\n )}\n </StyledContainer>\n {hasLeftHelper && !isInnerLeftHelperPlacement && (\n <StyledOutsideHelpersWrapper id={textareaHelperId}>\n <StyledLeftHelper>{leftHelperText}</StyledLeftHelper>\n </StyledOutsideHelpersWrapper>\n )}\n </Root>\n );\n });\n\nexport const textAreaConfig = {\n name: 'TextArea',\n tag: 'div',\n layout: textAreaRoot,\n base,\n variations: {\n size: {\n css: sizeCSS,\n },\n view: {\n css: viewCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n attrs: true,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'primary',\n },\n};\n"],"names":["innerPlaceholderUp","classes","focusedOuterPlaceholderColor","hidePlaceHolder","styledContainer","styledTextArea","styledTextAreaWrapper","styledPlaceholder","styledHelpers","optionalText","base","fallbackStatusMap","success","warning","error","HINT_DEFAULT_OFFSET","getDynamicLabelClasses","props","focused","readOnly","label","labelPlacement","rows","value","size","withFocusedOuterUpPlaceholder","undefined","withInnerPlaceholderUp","withHidePlaceholder","textAreaRoot","Root","forwardRef","innerRef","helperText","status","resize","rightHelper","leftHelper","_props$leftHelperPlac","leftHelperPlacement","contentRight","_props$autoResize","autoResize","_props$minAuto","minAuto","maxAuto","_props$labelPlacement","titleCaption","placeholder","defaultValue","height","width","disabled","_props$required","required","_props$requiredPlacem","requiredPlacement","_props$optional","optional","clear","hasDivider","view","id","style","className","cols","_props$hintTrigger","hintTrigger","hintText","_props$hintView","hintView","_props$hintSize","hintSize","hintTargetIcon","_props$hintPlacement","hintPlacement","hintHasArrow","_props$hintOffset","hintOffset","hintWidth","hintContentLeft","onChange","rest","_excluded","_useState","useState","_useState2","_slicedToArray","isHintVisible","setIsHintVisible","_useState3","concat","_useState4","helperWidth","setHelperWidth","_useState5","_useState6","setFocused","_useState7","_useState8","uncontrolledValue","setUncontrolledValue","outerRef","createRef","hiddenRef","useRef","hintRef","useOutsideClick","hintInnerRef","hintForkRef","useForkRef","isInnerLeftHelperPlacement","leftHelperText","innerOptional","hasLeftHelper","Boolean","hasRightHelper","hasHelper","hasOuterLabel","hasInnerLabel","hasPlaceholderOptional","overriddenView","textareaHelperId","applyCustomWidth","placeholderLabel","applyAutoResize","clearClass","hasHintClass","hasHint","hasRightContentClass","hasRightContent","hasDividerClass","requiredPlacementClass","requiredAlignRight","handleHintShow","handleHintHide","handleHintClick","event","_hintInnerRef$current","stopPropagation","targetIsPopover","target","current","rootHasTarget","contains","useLayoutEffect","useResizeObserver","currentElement","inlineWidth","_currentElement$getBo","getBoundingClientRect","elementWidth","ROOT_FONT_SIZE","useAutoResize","onFocusHandler","useCallback","onBlurHandler","onChangeHandler","handleTextAreaFocus","focus","dynamicLabelClasses","optionalTextNode","React","createElement","StyledOptionalText","inheritFont","_extends","_objectSpread","cx","onClick","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","StyledLabel","StyledHintWrapper","HintComponent","ref","StyledIndicator","outerLabelPlacement","TitleCaption","StyledContainer","apply","_toConsumableArray","onFocus","onBlur","Fragment","innerLabelPlacement","StyledContent","StyledTextAreaWrapper","StyledTextArea","hasContentRight","mergeRefs","StyledHiddenTextArea","StyledHelpers","StyledLeftHelper","StyledRightHelper","StyledPlaceholder","htmlFor","StyledOutsideHelpersWrapper","textAreaConfig","name","tag","layout","variations","css","sizeCSS","viewCSS","clearCSS","attrs","disabledCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,IACIA,kBAAkB,GAQlBC,OAAO,CARPD,kBAAkB;EAClBE,4BAA4B,GAO5BD,OAAO,CAPPC,4BAA4B;EAC5BC,eAAe,GAMfF,OAAO,CANPE,eAAe;EACfC,eAAe,GAKfH,OAAO,CALPG,eAAe;EACfC,cAAc,GAIdJ,OAAO,CAJPI,cAAc;EACdC,qBAAqB,GAGrBL,OAAO,CAHPK,qBAAqB;EACrBC,iBAAiB,GAEjBN,OAAO,CAFPM,iBAAiB;EACjBC,aAAAA,GACAP,OAAO,CADPO,aAAAA,CAAAA;AAGJ,IAA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AG;AAC1BC,EAAAA,IAAI,EAAE,UAAU;AAChBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE7K,YAAY;AACpBnB,EAAAA,IAAI,EAAJA,IAAI;AACJiM,EAAAA,UAAU,EAAE;AACRnL,IAAAA,IAAI,EAAE;AACFoL,MAAAA,GAAG,EAAEC,MAAAA;KACR;AACDhJ,IAAAA,IAAI,EAAE;AACF+I,MAAAA,GAAG,EAAEE,MAAAA;KACR;AACDnJ,IAAAA,KAAK,EAAE;AACHiJ,MAAAA,GAAG,EAAEG,MAAQ;AACbC,MAAAA,KAAK,EAAE,IAAA;KACV;AACD5J,IAAAA,QAAQ,EAAE;AACNwJ,MAAAA,GAAG,EAAEK,MAAW;AAChBD,MAAAA,KAAK,EAAE,IAAA;KACV;AACD7L,IAAAA,QAAQ,EAAE;AACN6L,MAAAA,KAAK,EAAE,IAAA;KACV;AACD1I,IAAAA,QAAQ,EAAE;AACNsI,MAAAA,GAAG,EAAEM,MAAAA;KACR;AACD1I,IAAAA,QAAQ,EAAE;AACNoI,MAAAA,GAAG,EAAEO,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACN5L,IAAAA,IAAI,EAAE,GAAG;AACTqC,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
@@ -382,6 +382,7 @@ var textFieldRoot = function textFieldRoot(Root) {
382
382
  ref: inputForkRef,
383
383
  id: innerId,
384
384
  value: outerValue,
385
+ required: required,
385
386
  "aria-labelledby": labelId,
386
387
  "aria-describedby": helperTextId,
387
388
  placeholder: innerPlaceholderValue,
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { FormEventHandler, ChangeEventHandler, KeyboardEvent, ChangeEvent, MouseEventHandler } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps, TextFieldRootProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport {\n Input,\n InputContainer,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n StyledTextBefore,\n StyledTextAfter,\n StyledIndicator,\n StyledOptionalText,\n InputPlaceholder,\n OuterLabelWrapper,\n TitleCaption,\n StyledHintWrapper,\n StyledIndicatorWrapper,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation } from './hooks';\nimport { HintComponent } from './ui/Hint/Hint';\nimport { getInputWidth } from './getInputWidth';\n\nconst optionalText = 'optional';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n`;\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldRootProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n style,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n keepPlaceholder,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n chipView = 'default',\n chipValidator,\n\n // hint\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n required = false,\n clear = false,\n optional,\n hasDivider,\n\n // controlled\n value: outerValue,\n chips: values,\n chipType = 'default',\n\n // events\n onChange,\n onChangeChips,\n onSearch,\n onKeyDown,\n onFocus,\n onBlur,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [hasValue, setHasValue] = useState(\n Boolean(outerValue) || Boolean(inputRef?.current?.value) || Boolean(rest?.defaultValue),\n );\n const [hasFocus, setHasFocus] = useState(false);\n\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n const [isHintVisible, setIsHintVisible] = useState(false);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isDefaultView = view === 'default' || readOnly || disabled;\n\n const isChipEnumeration = enumerationType === 'chip';\n const isChipsVisible = isChipEnumeration && Boolean(chips?.length);\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n\n const hasLabelValue = Boolean(label);\n const hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;\n const hasOuterLabel = labelPlacement === 'outer' && hasLabelValue;\n const innerKeepPlaceholder = keepPlaceholder && labelPlacement === 'inner';\n const hasPlaceholder = Boolean(placeholder) && (innerKeepPlaceholder || !hasInnerLabel);\n let hasTextAfter = Boolean(textAfter);\n let hasTextBefore = textBefore && !isChipEnumeration;\n if (labelPlacement === 'inner') {\n if (!hasValue && !hasPlaceholder && !hasFocus) {\n hasTextAfter = false;\n hasTextBefore = false;\n }\n }\n\n const hasPlaceholderPadding = hasInnerLabel && keepPlaceholder && size !== 'xs';\n\n const innerLabelValue = hasInnerLabel || hasOuterLabel ? label : undefined;\n const innerLabelPlacementValue = labelPlacement === 'inner' && !hasInnerLabel ? undefined : labelPlacement;\n\n const innerPlaceholderValue = hasPlaceholder ? placeholder : undefined;\n const placeholderShown = Boolean(innerPlaceholderValue) && !hasValue;\n\n const clearClass = clear ? classes.clear : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n const labelPlacementClass = innerLabelPlacementValue\n ? classes[`${innerLabelPlacementValue}LabelPlacement` as keyof typeof classes]\n : undefined;\n const hasValueClass = hasValue ? classes.hasValue : undefined;\n const keepPlaceholderClass = hasPlaceholder && placeholderShown && classes.keepPlaceholder;\n\n const wrapperWithoutLeftContent =\n !contentLeft && isChipsVisible && chipType === 'default' ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible && chipType === 'default' ? classes.hasEmptyContentRight : undefined;\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const handleInput: FormEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target as HTMLInputElement;\n if (hasTextAfter) {\n const textWidth = getInputWidth(event.currentTarget, inputContainerRef.current);\n event.currentTarget.style.width = `${textWidth}px`;\n }\n setHasValue(Boolean(value));\n };\n\n useEffect(() => {\n if (hasTextAfter && inputRef.current) {\n const textWidth = getInputWidth(inputRef.current, inputContainerRef.current);\n inputRef.current.style.width = `${textWidth}px`;\n } else {\n inputRef.current?.style.removeProperty('width');\n }\n }, [hasTextAfter]);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(false);\n onBlur?.(event);\n };\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n onEnterDisabled: (rest as any).onEnterDisabled,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollTo({\n top: 0,\n left: inputRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n inputRef.current.focus();\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n const handleOnKeyDown = (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => {\n handleInputKeydown(event);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n useEffect(() => {\n setHasValue(Boolean(rest?.defaultValue));\n }, [rest.defaultValue]);\n\n useEffect(() => {\n setHasValue(Boolean(outerValue) || Boolean(inputRef?.current?.value));\n }, [outerValue, inputRef?.current?.value]);\n\n const innerOptional = Boolean(required ? false : optional);\n const hasPlaceholderOptional = innerOptional && !innerLabelValue && !hasOuterLabel;\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText>\n {Boolean(hasPlaceholderOptional ? innerPlaceholderValue : innerLabelValue) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n clear={clear}\n labelPlacement={innerLabelPlacementValue}\n chipView={chipView}\n onClick={handleInputFocus}\n className={cx(\n labelPlacementClass,\n clearClass,\n hasDividerClass,\n hasHintClass,\n classes.textFieldGroupItem,\n className,\n )}\n style={style}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <InputWrapper\n // Ref для внутреннего использования. Не отдается наружу.\n ref={(rest as any).inputWrapperRef}\n // TODO: #1544, и после убрать classes.inputWrapper\n className={cx(\n withHasChips,\n wrapperWithoutLeftContent,\n wrapperWithoutRightContent,\n classes.inputWrapper,\n )}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator\n className={cx(classes.innerLabelPlacement, requiredPlacementClass)}\n />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentLeft && (\n <StyledContentLeft isClear={clear} isDefaultView={isDefaultView}>\n {contentLeft}\n </StyledContentLeft>\n )}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {Boolean(textBefore && isChipEnumeration) && (\n <StyledTextBefore>{textBefore}</StyledTextBefore>\n )}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips className={classes.chipsWrapper}>\n {chips?.map(({ id: chipId, text }, index) => {\n const validationView = chipValidator?.(String(text));\n const resView = validationView?.view || chipView;\n\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n chipType={chipType}\n view={resView}\n rootWrapper={Root}\n // TODO: #1547\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _forceChipManipulationWithReadonly={\n // eslint-disable-next-line no-underscore-dangle\n (rest as any)._forceChipManipulationWithReadonly\n }\n />\n );\n })}\n </StyledChips>\n )}\n <InputContainer ref={inputContainerRef} hasDynamicWidth={hasTextAfter}>\n {hasTextBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\n <Input\n ref={inputForkRef}\n id={innerId}\n value={outerValue}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n className={cx(hasValueClass, keepPlaceholderClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder hasPadding={hasPlaceholderPadding}>\n {hasTextBefore && <StyledTextBefore isHidden>{textBefore}</StyledTextBefore>}\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n {hasTextAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputContainer>\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["optionalText","base","HINT_DEFAULT_OFFSET","textFieldRoot","Root","forwardRef","_ref","ref","_inputRef$current","_inputRef$current4","id","className","style","contentLeft","contentRight","label","labelPlacement","keepPlaceholder","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$chipView","chipView","chipValidator","_ref$hintTrigger","hintTrigger","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","hintTargetIcon","_ref$hintPlacement","hintPlacement","hintHasArrow","_ref$hintOffset","hintOffset","hintWidth","hintContentLeft","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$required","required","_ref$clear","clear","optional","hasDivider","outerValue","value","values","chips","_ref$chipType","chipType","onChange","onChangeChips","onSearch","onKeyDown","onFocus","onBlur","rest","contentRef","useRef","inputContainerRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","hasFocus","setHasFocus","_useState5","_useState6","setChips","_useState7","_useState8","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","innerKeepPlaceholder","hasPlaceholder","hasTextAfter","hasTextBefore","hasPlaceholderPadding","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","keepPlaceholderClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","_ref2","target","textWidth","getInputWidth","currentTarget","width","useEffect","_inputRef$current2","removeProperty","handleFocus","handleBlur","handleHintShow","handleHintHide","handleHintClick","_hintInnerRef$current","stopPropagation","targetIsPopover","rootHasTarget","contains","handleChange","_event$target","maxLength","updateChips","newChips","newValues","_useKeyNavigation","useKeyNavigation","onEnterDisabled","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","handleInputFocus","scrollTo","top","left","offsetLeft","behavior","focus","getRef","element","index","handleOnKeyDown","map","text","_inputRef$current3","innerOptional","hasPlaceholderOptional","optionalTextNode","React","createElement","StyledOptionalText","_extends","onClick","cx","textFieldGroupItem","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","Label","htmlFor","StyledHintWrapper","HintComponent","StyledIndicator","outerLabelPlacement","TitleCaption","InputWrapper","inputWrapperRef","inputWrapper","Fragment","innerLabelPlacement","StyledContentLeft","isClear","InputLabelWrapper","tabIndex","StyledTextBefore","StyledChips","chipsWrapper","_ref3","chipId","validationView","String","resView","TextFieldChip","key","onClear","rootWrapper","_forceChipManipulationWithReadonly","InputContainer","hasDynamicWidth","Input","onInput","InputPlaceholder","hasPadding","isHidden","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,YAAY,GAAG,UAAU,CAAA;AAExB,IAAMC,IAAI,GAGhB,UAAA;AAED,IAAMC,mBAAqC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEvCC,aAAa,GAAGA,SAAhBA,aAAaA,CAAIC,IAAmD,EAAA;AAAA,EAAA,oBAC7EC,UAAU,CACN,UAAAC,IAAA,EA2DIC,GAAG,EACF;IAAA,IAAAC,iBAAA,EAAAC,kBAAA,CAAA;AAAA,IAAA,IA1DGC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;MACFC,SAAS,GAAAL,IAAA,CAATK,SAAS;MACTC,KAAK,GAAAN,IAAA,CAALM,KAAK;MAGLC,WAAW,GAAAP,IA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G;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef, useEffect, useRef, useState } from 'react';\nimport type { FormEventHandler, ChangeEventHandler, KeyboardEvent, ChangeEvent, MouseEventHandler } from 'react';\nimport { safeUseId, useForkRef } from '@salutejs/plasma-core';\nimport { css } from '@linaria/core';\n\nimport type { RootProps } from '../../engines';\nimport { cx } from '../../utils';\nimport { useOutsideClick } from '../../hooks';\n\nimport type { ChipValues, TextFieldPrimitiveValue, TextFieldProps, TextFieldRootProps } from './TextField.types';\nimport { base as sizeCSS } from './variations/_size/base';\nimport { base as viewCSS } from './variations/_view/base';\nimport { base as clearCSS } from './variations/_clear/base';\nimport { base as disabledCSS } from './variations/_disabled/base';\nimport { base as readOnlyCSS } from './variations/_read-only/base';\nimport { base as labelPlacementCSS } from './variations/_label-placement/base';\nimport { base as hintViewCSS } from './variations/_hint-view/base';\nimport { base as hintSizeCSS } from './variations/_hint-size/base';\nimport {\n Input,\n InputContainer,\n LeftHelper,\n Label,\n InputWrapper,\n InputLabelWrapper,\n StyledContentLeft,\n StyledContentRight,\n StyledChips,\n StyledTextBefore,\n StyledTextAfter,\n StyledIndicator,\n StyledOptionalText,\n InputPlaceholder,\n OuterLabelWrapper,\n TitleCaption,\n StyledHintWrapper,\n StyledIndicatorWrapper,\n} from './TextField.styles';\nimport { classes } from './TextField.tokens';\nimport { TextFieldChip } from './ui';\nimport { useKeyNavigation } from './hooks';\nimport { HintComponent } from './ui/Hint/Hint';\nimport { getInputWidth } from './getInputWidth';\n\nconst optionalText = 'optional';\n\nexport const base = css`\n /* NOTE: Webkit не применяет opacity к inline тегам */\n display: block;\n`;\n\nconst HINT_DEFAULT_OFFSET: [number, number] = [0, 0];\n\nexport const textFieldRoot = (Root: RootProps<HTMLDivElement, TextFieldRootProps>) =>\n forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n style,\n\n // layout\n contentLeft,\n contentRight,\n label,\n labelPlacement,\n keepPlaceholder,\n textBefore,\n textAfter,\n placeholder,\n leftHelper,\n enumerationType = 'plain',\n requiredPlacement = 'right',\n titleCaption,\n chipView = 'default',\n chipValidator,\n\n // hint\n hintTrigger = 'hover',\n hintText,\n hintView = 'default',\n hintSize = 'm',\n hintTargetIcon,\n hintPlacement = 'auto',\n hintHasArrow,\n hintOffset = HINT_DEFAULT_OFFSET,\n hintWidth,\n hintContentLeft,\n\n // variations\n view,\n size,\n readOnly = false,\n disabled = false,\n required = false,\n clear = false,\n optional,\n hasDivider,\n\n // controlled\n value: outerValue,\n chips: values,\n chipType = 'default',\n\n // events\n onChange,\n onChangeChips,\n onSearch,\n onKeyDown,\n onFocus,\n onBlur,\n\n ...rest\n },\n ref,\n ) => {\n const contentRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputForkRef = useForkRef(inputRef, ref);\n const chipsRefs = useRef<Array<HTMLButtonElement>>([]);\n\n const controlledRefs = { contentRef, inputRef, chipsRefs };\n\n const [hasValue, setHasValue] = useState(\n Boolean(outerValue) || Boolean(inputRef?.current?.value) || Boolean(rest?.defaultValue),\n );\n const [hasFocus, setHasFocus] = useState(false);\n\n const [chips, setChips] = useState<Array<ChipValues>>([]);\n const [isHintVisible, setIsHintVisible] = useState(false);\n\n const uniqId = safeUseId();\n const innerId = id || uniqId;\n const labelId = safeUseId();\n const helperTextId = safeUseId();\n\n const isDefaultView = view === 'default' || readOnly || disabled;\n\n const isChipEnumeration = enumerationType === 'chip';\n const isChipsVisible = isChipEnumeration && Boolean(chips?.length);\n const withHasChips = isChipsVisible ? classes.hasChips : undefined;\n\n const hasLabelValue = Boolean(label);\n const hasInnerLabel = size !== 'xs' && labelPlacement === 'inner' && !isChipsVisible && hasLabelValue;\n const hasOuterLabel = labelPlacement === 'outer' && hasLabelValue;\n const innerKeepPlaceholder = keepPlaceholder && labelPlacement === 'inner';\n const hasPlaceholder = Boolean(placeholder) && (innerKeepPlaceholder || !hasInnerLabel);\n let hasTextAfter = Boolean(textAfter);\n let hasTextBefore = textBefore && !isChipEnumeration;\n if (labelPlacement === 'inner') {\n if (!hasValue && !hasPlaceholder && !hasFocus) {\n hasTextAfter = false;\n hasTextBefore = false;\n }\n }\n\n const hasPlaceholderPadding = hasInnerLabel && keepPlaceholder && size !== 'xs';\n\n const innerLabelValue = hasInnerLabel || hasOuterLabel ? label : undefined;\n const innerLabelPlacementValue = labelPlacement === 'inner' && !hasInnerLabel ? undefined : labelPlacement;\n\n const innerPlaceholderValue = hasPlaceholder ? placeholder : undefined;\n const placeholderShown = Boolean(innerPlaceholderValue) && !hasValue;\n\n const clearClass = clear ? classes.clear : undefined;\n const hasDividerClass = hasDivider ? classes.hasDivider : undefined;\n const hasHintClass = hintText ? classes.hasHint : undefined;\n const requiredPlacementClass = requiredPlacement === 'right' ? classes.requiredAlignRight : undefined;\n const labelPlacementClass = innerLabelPlacementValue\n ? classes[`${innerLabelPlacementValue}LabelPlacement` as keyof typeof classes]\n : undefined;\n const hasValueClass = hasValue ? classes.hasValue : undefined;\n const keepPlaceholderClass = hasPlaceholder && placeholderShown && classes.keepPlaceholder;\n\n const wrapperWithoutLeftContent =\n !contentLeft && isChipsVisible && chipType === 'default' ? classes.hasEmptyContentLeft : undefined;\n const wrapperWithoutRightContent =\n !contentRight && isChipsVisible && chipType === 'default' ? classes.hasEmptyContentRight : undefined;\n\n const hintRef = useOutsideClick<HTMLDivElement>(() => {\n setIsHintVisible(false);\n });\n const hintInnerRef = useRef<HTMLDivElement>(null);\n const hintForkRef = useForkRef(hintRef, hintInnerRef);\n\n const handleInput: FormEventHandler<HTMLInputElement> = (event) => {\n const { value } = event.target as HTMLInputElement;\n if (hasTextAfter) {\n const textWidth = getInputWidth(event.currentTarget, inputContainerRef.current);\n event.currentTarget.style.width = `${textWidth}px`;\n }\n setHasValue(Boolean(value));\n };\n\n useEffect(() => {\n if (hasTextAfter && inputRef.current) {\n const textWidth = getInputWidth(inputRef.current, inputContainerRef.current);\n inputRef.current.style.width = `${textWidth}px`;\n } else {\n inputRef.current?.style.removeProperty('width');\n }\n }, [hasTextAfter]);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n setHasFocus(false);\n onBlur?.(event);\n };\n\n const handleHintShow = () => setIsHintVisible(true);\n const handleHintHide = () => setIsHintVisible(false);\n const handleHintClick: MouseEventHandler = (event) => {\n if (!hintText || hintTrigger !== 'click') {\n return;\n }\n\n event.stopPropagation();\n const targetIsPopover = event.target === hintInnerRef.current;\n const rootHasTarget = hintInnerRef.current?.contains(event.target as Element);\n\n if (!targetIsPopover && !rootHasTarget) {\n setIsHintVisible(true);\n }\n };\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n if (disabled || readOnly) {\n return;\n }\n\n const { maxLength, value } = event.target;\n\n if (maxLength !== -1 && value.length > maxLength) {\n return;\n }\n\n onChange?.(event);\n };\n\n const updateChips = (newChips: Array<ChipValues>, newValues: Array<TextFieldPrimitiveValue>) => {\n setChips(newChips);\n onChangeChips?.(newValues);\n };\n\n const { handleInputKeydown, handleChipKeyDown, onChipClear, handleContentKeyDown } = useKeyNavigation({\n controlledRefs,\n disabled,\n readOnly,\n chips,\n enumerationType,\n updateChips,\n onSearch,\n onChange,\n onEnterDisabled: (rest as any).onEnterDisabled,\n });\n\n const onChipClick = (event: React.MouseEvent<HTMLButtonElement>) => event.stopPropagation();\n\n const handleInputFocus = () => {\n if (readOnly || disabled || !inputRef?.current) {\n return;\n }\n\n inputRef.current.scrollTo({\n top: 0,\n left: inputRef.current.offsetLeft,\n behavior: 'smooth',\n });\n\n inputRef.current.focus();\n };\n\n const getRef = (element: HTMLButtonElement | null, index: number) => {\n if (element && chipsRefs?.current) {\n chipsRefs.current[index] = element;\n }\n };\n\n const handleOnKeyDown = (event: ChangeEvent<HTMLInputElement> & KeyboardEvent<HTMLInputElement>) => {\n handleInputKeydown(event);\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n useEffect(() => {\n if (!isChipEnumeration && !values?.length) {\n return;\n }\n\n const newChips =\n values?.map((value, index) => ({\n id: `${index}_${value}`,\n text: value,\n })) || [];\n\n setChips(newChips);\n }, [isChipEnumeration, values]);\n\n useEffect(() => {\n setHasValue(Boolean(rest?.defaultValue));\n }, [rest.defaultValue]);\n\n useEffect(() => {\n setHasValue(Boolean(outerValue) || Boolean(inputRef?.current?.value));\n }, [outerValue, inputRef?.current?.value]);\n\n const innerOptional = Boolean(required ? false : optional);\n const hasPlaceholderOptional = innerOptional && !innerLabelValue && !hasOuterLabel;\n const optionalTextNode = innerOptional ? (\n <StyledOptionalText>\n {Boolean(hasPlaceholderOptional ? innerPlaceholderValue : innerLabelValue) && '\\xa0'}\n {optionalText}\n </StyledOptionalText>\n ) : null;\n\n return (\n <Root\n view={view}\n size={size}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n clear={clear}\n labelPlacement={innerLabelPlacementValue}\n chipView={chipView}\n onClick={handleInputFocus}\n className={cx(\n labelPlacementClass,\n clearClass,\n hasDividerClass,\n hasHintClass,\n classes.textFieldGroupItem,\n className,\n )}\n style={style}\n {...(hintText && { hintView, hintSize })}\n >\n {(hasOuterLabel || titleCaption) && (\n <OuterLabelWrapper isInnerLabel={labelPlacement === 'inner'}>\n {hasOuterLabel && (\n <StyledIndicatorWrapper>\n <Label id={labelId} htmlFor={id}>\n {innerLabelValue}\n </Label>\n\n {hintText && (\n <StyledHintWrapper>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n {required && (\n <StyledIndicator\n className={cx(\n classes.outerLabelPlacement,\n requiredPlacementClass,\n hasHintClass,\n )}\n />\n )}\n {optionalTextNode}\n </StyledIndicatorWrapper>\n )}\n {titleCaption && <TitleCaption>{titleCaption}</TitleCaption>}\n </OuterLabelWrapper>\n )}\n <InputWrapper\n // Ref для внутреннего использования. Не отдается наружу.\n ref={(rest as any).inputWrapperRef}\n // TODO: #1544, и после убрать classes.inputWrapper\n className={cx(\n withHasChips,\n wrapperWithoutLeftContent,\n wrapperWithoutRightContent,\n classes.inputWrapper,\n )}\n >\n {!hasOuterLabel && (\n <>\n {required && (\n <StyledIndicator\n className={cx(classes.innerLabelPlacement, requiredPlacementClass)}\n />\n )}\n {hintText && (\n <StyledHintWrapper className={classes.innerLabelPlacement}>\n <HintComponent\n ref={hintForkRef}\n hintText={hintText}\n hintTrigger={hintTrigger}\n isHintVisible={isHintVisible}\n hintTargetIcon={hintTargetIcon}\n hintPlacement={hintPlacement}\n hintHasArrow={hintHasArrow}\n hintOffset={hintOffset}\n hintWidth={hintWidth}\n hintContentLeft={hintContentLeft}\n handleHintShow={handleHintShow}\n handleHintHide={handleHintHide}\n handleHintClick={handleHintClick}\n />\n </StyledHintWrapper>\n )}\n </>\n )}\n {contentLeft && (\n <StyledContentLeft isClear={clear} isDefaultView={isDefaultView}>\n {contentLeft}\n </StyledContentLeft>\n )}\n <InputLabelWrapper\n tabIndex={-1}\n ref={contentRef}\n onKeyDown={handleContentKeyDown}\n className={withHasChips}\n >\n {Boolean(textBefore && isChipEnumeration) && (\n <StyledTextBefore>{textBefore}</StyledTextBefore>\n )}\n {isChipEnumeration && Boolean(chips?.length) && (\n <StyledChips className={classes.chipsWrapper}>\n {chips?.map(({ id: chipId, text }, index) => {\n const validationView = chipValidator?.(String(text));\n const resView = validationView?.view || chipView;\n\n return (\n <TextFieldChip\n id={chipId}\n ref={(element) => getRef(element, index)}\n key={`${chipId}_${index}`}\n disabled={disabled}\n readOnly={readOnly}\n value={text}\n text={text}\n onKeyDown={(event) => handleChipKeyDown(event, chipId, index)}\n onClear={() => onChipClear(chipId, index)}\n onClick={onChipClick}\n chipType={chipType}\n view={resView}\n rootWrapper={Root}\n // TODO: #1547\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _forceChipManipulationWithReadonly={\n // eslint-disable-next-line no-underscore-dangle\n (rest as any)._forceChipManipulationWithReadonly\n }\n />\n );\n })}\n </StyledChips>\n )}\n <InputContainer ref={inputContainerRef} hasDynamicWidth={hasTextAfter}>\n {hasTextBefore && <StyledTextBefore>{textBefore}</StyledTextBefore>}\n <Input\n ref={inputForkRef}\n id={innerId}\n value={outerValue}\n required={required}\n aria-labelledby={labelId}\n aria-describedby={helperTextId}\n placeholder={innerPlaceholderValue}\n className={cx(hasValueClass, keepPlaceholderClass)}\n disabled={disabled}\n readOnly={!disabled && readOnly}\n onInput={handleInput}\n onChange={handleChange}\n onKeyDown={handleOnKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n {...rest}\n />\n {hasInnerLabel && (\n <Label id={labelId} htmlFor={innerId}>\n {innerLabelValue}\n {optionalTextNode}\n </Label>\n )}\n {placeholderShown && !hasValue && (\n <InputPlaceholder hasPadding={hasPlaceholderPadding}>\n {hasTextBefore && <StyledTextBefore isHidden>{textBefore}</StyledTextBefore>}\n {innerPlaceholderValue}\n {hasPlaceholderOptional && optionalTextNode}\n </InputPlaceholder>\n )}\n {hasTextAfter && <StyledTextAfter>{textAfter}</StyledTextAfter>}\n </InputContainer>\n </InputLabelWrapper>\n {contentRight && <StyledContentRight>{contentRight}</StyledContentRight>}\n </InputWrapper>\n {leftHelper && <LeftHelper id={helperTextId}>{leftHelper}</LeftHelper>}\n </Root>\n );\n },\n );\n\nexport const textFieldConfig = {\n name: 'TextField',\n tag: 'div',\n layout: textFieldRoot,\n base,\n variations: {\n view: {\n css: viewCSS,\n },\n size: {\n css: sizeCSS,\n },\n clear: {\n css: clearCSS,\n attrs: true,\n },\n disabled: {\n css: disabledCSS,\n attrs: true,\n },\n readOnly: {\n css: readOnlyCSS,\n attrs: true,\n },\n labelPlacement: {\n css: labelPlacementCSS,\n },\n hintView: {\n css: hintViewCSS,\n },\n hintSize: {\n css: hintSizeCSS,\n },\n },\n defaults: {\n size: 'm',\n view: 'default',\n },\n};\n"],"names":["optionalText","base","HINT_DEFAULT_OFFSET","textFieldRoot","Root","forwardRef","_ref","ref","_inputRef$current","_inputRef$current4","id","className","style","contentLeft","contentRight","label","labelPlacement","keepPlaceholder","textBefore","textAfter","placeholder","leftHelper","_ref$enumerationType","enumerationType","_ref$requiredPlacemen","requiredPlacement","titleCaption","_ref$chipView","chipView","chipValidator","_ref$hintTrigger","hintTrigger","hintText","_ref$hintView","hintView","_ref$hintSize","hintSize","hintTargetIcon","_ref$hintPlacement","hintPlacement","hintHasArrow","_ref$hintOffset","hintOffset","hintWidth","hintContentLeft","view","size","_ref$readOnly","readOnly","_ref$disabled","disabled","_ref$required","required","_ref$clear","clear","optional","hasDivider","outerValue","value","values","chips","_ref$chipType","chipType","onChange","onChangeChips","onSearch","onKeyDown","onFocus","onBlur","rest","contentRef","useRef","inputContainerRef","inputRef","inputForkRef","useForkRef","chipsRefs","controlledRefs","_useState","useState","Boolean","current","defaultValue","_useState2","_slicedToArray","hasValue","setHasValue","_useState3","_useState4","hasFocus","setHasFocus","_useState5","_useState6","setChips","_useState7","_useState8","isHintVisible","setIsHintVisible","uniqId","safeUseId","innerId","labelId","helperTextId","isDefaultView","isChipEnumeration","isChipsVisible","length","withHasChips","classes","hasChips","undefined","hasLabelValue","hasInnerLabel","hasOuterLabel","innerKeepPlaceholder","hasPlaceholder","hasTextAfter","hasTextBefore","hasPlaceholderPadding","innerLabelValue","innerLabelPlacementValue","innerPlaceholderValue","placeholderShown","clearClass","hasDividerClass","hasHintClass","hasHint","requiredPlacementClass","requiredAlignRight","labelPlacementClass","concat","hasValueClass","keepPlaceholderClass","wrapperWithoutLeftContent","hasEmptyContentLeft","wrapperWithoutRightContent","hasEmptyContentRight","hintRef","useOutsideClick","hintInnerRef","hintForkRef","handleInput","event","_ref2","target","textWidth","getInputWidth","currentTarget","width","useEffect","_inputRef$current2","removeProperty","handleFocus","handleBlur","handleHintShow","handleHintHide","handleHintClick","_hintInnerRef$current","stopPropagation","targetIsPopover","rootHasTarget","contains","handleChange","_event$target","maxLength","updateChips","newChips","newValues","_useKeyNavigation","useKeyNavigation","onEnterDisabled","handleInputKeydown","handleChipKeyDown","onChipClear","handleContentKeyDown","onChipClick","handleInputFocus","scrollTo","top","left","offsetLeft","behavior","focus","getRef","element","index","handleOnKeyDown","map","text","_inputRef$current3","innerOptional","hasPlaceholderOptional","optionalTextNode","React","createElement","StyledOptionalText","_extends","onClick","cx","textFieldGroupItem","OuterLabelWrapper","isInnerLabel","StyledIndicatorWrapper","Label","htmlFor","StyledHintWrapper","HintComponent","StyledIndicator","outerLabelPlacement","TitleCaption","InputWrapper","inputWrapperRef","inputWrapper","Fragment","innerLabelPlacement","StyledContentLeft","isClear","InputLabelWrapper","tabIndex","StyledTextBefore","StyledChips","chipsWrapper","_ref3","chipId","validationView","String","resView","TextFieldChip","key","onClear","rootWrapper","_forceChipManipulationWithReadonly","InputContainer","hasDynamicWidth","Input","onInput","InputPlaceholder","hasPadding","isHidden","StyledTextAfter","StyledContentRight","LeftHelper","textFieldConfig","name","tag","layout","variations","css","viewCSS","sizeCSS","clearCSS","attrs","disabledCSS","readOnlyCSS","labelPlacementCSS","hintViewCSS","hintSizeCSS","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,IAAMA,YAAY,GAAG,UAAU,CAAA;AAExB,IAAMC,IAAI,GAGhB,UAAA;AAED,IAAMC,mBAAqC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAEvCC,aAAa,GAAGA,SAAhBA,aAAaA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M,MAAW;AAChBF,MAAAA,KAAK,EAAE,IAAA;KACV;AACD3O,IAAAA,cAAc,EAAE;AACZuO,MAAAA,GAAG,EAAEO,MAAAA;KACR;AACD5N,IAAAA,QAAQ,EAAE;AACNqN,MAAAA,GAAG,EAAEQ,MAAAA;KACR;AACD3N,IAAAA,QAAQ,EAAE;AACNmN,MAAAA,GAAG,EAAES,MAAAA;AACT,KAAA;GACH;AACDC,EAAAA,QAAQ,EAAE;AACNnN,IAAAA,IAAI,EAAE,GAAG;AACTD,IAAAA,IAAI,EAAE,SAAA;AACV,GAAA;AACJ;;;;"}
@@ -1,7 +1,41 @@
1
- import { objectSpread2 as _objectSpread2, extends as _extends } from '../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectSpread2 as _objectSpread2, extends as _extends, toConsumableArray as _toConsumableArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React from 'react';
3
3
  import { _component } from './linaria.js';
4
4
 
5
+ //
6
+ // Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange
7
+ //
8
+
9
+ var getStaticVariants = function getStaticVariants(config) {
10
+ if (!config.variations) {
11
+ return [];
12
+ }
13
+ var res = [];
14
+ var variations = config.variations;
15
+
16
+ // eslint-disable-next-line guard-for-in
17
+ for (var key in variations) {
18
+ var css = variations[key].css;
19
+ css && res.push(css);
20
+ }
21
+ return res;
22
+ };
23
+ var getDynamicVariants = function getDynamicVariants(config) {
24
+ return function (props) {
25
+ var res = [];
26
+
27
+ // eslint-disable-next-line guard-for-in
28
+ for (var key in config.variations) {
29
+ if (key in props) {
30
+ var variant = config.variations[key];
31
+ var css = variant[props[key]];
32
+ // no css for { modifier: true }
33
+ css && Array.isArray(css) ? res.push.apply(res, _toConsumableArray(css)) : res.push(css);
34
+ }
35
+ }
36
+ return res;
37
+ };
38
+ };
5
39
  var mergeConfig = function mergeConfig(baseConfig, userConfig) {
6
40
  var res = _objectSpread2(_objectSpread2({}, baseConfig), userConfig);
7
41
  if (res.variations) {
@@ -38,5 +72,5 @@ function component(config) {
38
72
  });
39
73
  }
40
74
 
41
- export { component, mergeConfig };
75
+ export { component, getDynamicVariants, getStaticVariants, mergeConfig };
42
76
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sources":["../../src/engines/common.tsx"],"sourcesContent":["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["mergeConfig","baseConfig","userConfig","res","_objectSpread","variations","key","variant","css","attrs","defaults","component","config","Comp","layout","_component","React","forwardRef","props","ref","createElement","_extends"],"mappings":";;;;AAYO,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAcpBC,UAAwF,EACxFC,UAAuF,EACtF;EACD,IAAMC,GAAG,GAAAC,cAAA,CAAAA,cAAA,CAAQH,EAAAA,EAAAA,UAAU,CAAKC,EAAAA,UAAU,CAAE,CAAA;EAE5C,IAAIC,GAAG,CAACE,UAAU,EAAE;AAChB;AACA;AACA,IAAA,KAAK,IAAMC,GAAG,IAAIH,GAAG,CAACE,UAAU,EAAE;AAC9B,MAAA,IAAME,OAAO,GAAGN,UAAU,CAACI,UAAU,CAACC,GAAG,CAAC,CAAA;AAE1CH,MAAAA,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAACE,GAAG,GAAGD,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,OAAO,CAAEC,GAAG,CAAA;AACtC;AACA,MAAA,IAAI,CAACL,GAAG,CAACE,UAAU,CAACC,GAAG,CAAC,CAAK,MAAA,CAAA,IAAIC,OAAO,KAAPA,IAAAA,IAAAA,OAAO,KAAPA,KAAAA,CAAAA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["import React from 'react';\n\nimport { _component } from './linaria';\nimport type {\n ComponentConfig,\n HTMLAnyAttributes,\n HTMLTagList,\n PropsType,\n Variants,\n HTMLAttributesWithoutOnChange,\n HTMLAttributesWithoutOnChangeAndDefaultValue,\n} from './types';\n\n//\n// Тип HTMLAttributesOmitOnChange требуется чтобы использовать компонент с кастомным пропсом onChange\n//\n\nexport const getStaticVariants = (config: ComponentConfig) => {\n if (!config.variations) {\n return [];\n }\n const res = [];\n const { variations } = config;\n\n // eslint-disable-next-line guard-for-in\n for (const key in variations) {\n const { css } = variations[key];\n css && res.push(css);\n }\n\n return res;\n};\n\nexport const getDynamicVariants = (config: ComponentConfig) => {\n return (props: HTMLAnyAttributes) => {\n const res = [];\n\n // eslint-disable-next-line guard-for-in\n for (const key in config.variations) {\n if (key in props) {\n const variant = config.variations[key];\n\n const css = variant[props[key]];\n // no css for { modifier: true }\n css && Array.isArray(css) ? res.push(...css) : res.push(css);\n }\n }\n\n return res;\n };\n};\n\nexport const mergeConfig = <\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutPropsBase extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>,\n LayoutPropsUser extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n | undefined = undefined\n>(\n baseConfig: ComponentConfig<Tag, Variants, PropsType & LayoutPropsBase, LayoutPropsBase>,\n userConfig?: Partial<ComponentConfig<Tag, VariantList, VariantsProps, LayoutPropsUser>>,\n) => {\n const res = { ...baseConfig, ...userConfig };\n\n if (res.variations) {\n // copy variations base css\n // eslint-disable-next-line guard-for-in\n for (const key in res.variations) {\n const variant = baseConfig.variations[key];\n\n res.variations[key].css = variant?.css;\n /* start of bad decision */\n if (!res.variations[key].true && variant?.true) {\n res.variations[key].true = variant.true;\n }\n /* end of bad decision */\n if (variant?.attrs) {\n res.variations[key].attrs = variant.attrs;\n }\n }\n }\n\n // eslint-disable-next-line guard-for-in\n for (const key in baseConfig.defaults || {}) {\n if (!(key in res.defaults)) {\n res.defaults[key] = baseConfig.defaults[key];\n }\n }\n\n return res as ComponentConfig<\n Tag,\n VariantList,\n PropsType<VariantList>,\n LayoutPropsUser extends undefined ? LayoutPropsBase : LayoutPropsUser\n >;\n};\n\nexport function component<\n Tag extends HTMLTagList,\n VariantList extends Variants,\n VariantsProps extends PropsType<VariantList>,\n LayoutProps extends\n | React.HTMLAttributes<HTMLElement>\n | HTMLAttributesWithoutOnChange<HTMLElement>\n | HTMLAttributesWithoutOnChangeAndDefaultValue<HTMLElement>\n>(\n config: ComponentConfig<Tag, VariantList, VariantsProps, LayoutProps>,\n): React.FunctionComponent<VariantsProps & LayoutProps> {\n const Comp = config.layout(_component((config as unknown) as ComponentConfig));\n\n return React.forwardRef<VariantsProps & LayoutProps, any>((props, ref) => (\n <Comp {...config?.defaults} {...props} ref={ref} />\n ));\n}\n"],"names":["getStaticVariants","config","variations","res","key","css","push","getDynamicVariants","props","variant","Array","isArray","apply","_toConsumableArray","mergeConfig","baseConfig","userConfig","_objectSpread","attrs","defaults","component","Comp","layout","_component","React","forwardRef","ref","createElement","_extends"],"mappings":";;;;AAaA;AACA;AACA;;IAEaA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,MAAuB,EAAK;AAC1D,EAAA,IAAI,CAACA,MAAM,CAACC,UAAU,EAAE;AACpB,IAAA,OAAO,EAAE,CAAA;AACb,GAAA;EACA,IAAMC,GAAG,GAAG,EAAE,CAAA;AACd,EAAA,IAAQD,UAAU,GAAKD,MAAM,CAArBC,UAAU,CAAA;;AAElB;AACA,EAAA,KAAK,IAAME,GAAG,IAAIF,UAAU,EAAE;AAC1B,IAAA,IAAQG,GAAG,GAAKH,UAAU,CAACE,GAAG,CAAC,CAAvBC,GAAG,CAAA;AAC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,KAANA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,MAAM,CAAEkB,QAAQ,EAAMX,KAAK,EAAA;AAAEkB,MAAAA,GAAG,EAAEA,GAAAA;AAAI,KAAA,CAAE,CAAC,CAAA;AAAA,GACtD,CAAC,CAAA;AACN;;;;"}
@@ -2,7 +2,7 @@ import { objectWithoutProperties as _objectWithoutProperties, toConsumableArray
2
2
  import React, { forwardRef } from 'react';
3
3
  import { cx } from '@linaria/core';
4
4
  import 'focus-visible';
5
- import { getStaticVariants, getDynamicVariants } from './utils.js';
5
+ import { getStaticVariants, getDynamicVariants } from './common.js';
6
6
 
7
7
  var _excluded = ["className"];
8
8
  /* eslint-disable no-underscore-dangle */
@@ -1 +1 @@
1
- {"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants } from './utils';\nimport type { ComponentConfig, HTMLAnyAttributes } from './types';\n\n/* eslint-disable no-underscore-dangle */\nexport const _component = (componentConfig: ComponentConfig) => {\n const { tag, base, name } = componentConfig;\n const staticVariants = getStaticVariants(componentConfig);\n const dynamicVariants = getDynamicVariants(componentConfig);\n const Root = tag as React.ElementType;\n\n const component = forwardRef<HTMLElement, HTMLAnyAttributes>((props, ref) => {\n const { className, ...rest } = props;\n const variants = dynamicVariants(rest);\n const cls = cx(className, base as string, ...(staticVariants as string[]), ...variants);\n\n // styled-components do it inside\n // filter props\n const baseProps: HTMLAnyAttributes = {};\n for (const key in rest) {\n if (!(key in componentConfig.variations)) {\n baseProps[key] = rest[key];\n }\n }\n\n baseProps.ref = ref;\n\n // styled-components do it inside\n // add props that should be attr( disabled for example)\n const htmlAttrs: HTMLAnyAttributes = {};\n for (const key in componentConfig.variations || {}) {\n if (key in rest) {\n const variant = componentConfig.variations[key];\n\n const { attrs } = variant;\n if (typeof attrs === 'boolean') {\n htmlAttrs[key] = rest[key];\n }\n }\n }\n\n return <Root className={cls} {...htmlAttrs} {...baseProps} />;\n });\n if (name) {\n component.displayName = name;\n }\n return component;\n};\n"],"names":["_component","componentConfig","tag","base","name","staticVariants","getStaticVariants","dynamicVariants","getDynamicVariants","Root","component","forwardRef","props","ref","className","rest","_objectWithoutProperties","_excluded","variants","cls","cx","apply","concat","_toConsumableArray","baseProps","key","variations","htmlAttrs","variant","attrs","React","createElement","_extends","displayName"],"mappings":";;;;;;;AAQA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,eAAgC,EAAK;AAC5D,EAAA,IAAQC,GAAG,GAAiBD,eAAe,CAAnCC,GAAG;IAAEC,IAAI,GAAWF,eAAe,CAA9BE,IAAI;IAAEC,IAAI,GAAKH,eAAe,CAAxBG,IAAI,CAAA;AACvB,EAAA,IAAMC,cAAc,GAAGC,iBAAiB,CAACL,eAAe,CAAC,CAAA;AACzD,EAAA,IAAMM,eAAe,GAAGC,kBAAkB,CAACP,eAAe,CAAC,CAAA;EAC3D,IAAMQ,IAAI,GAAGP,GAAwB,CAAA;EAErC,IAAMQ,SAAS,gBAAGC,UAAU,CAAiC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACzE,IAAA,IAAQC,SAAS,GAAcF,KAAK,CAA5BE,SAAS;AAAKC,MAAAA,IAAI,GAAAC,wBAAA,CAAKJ,KAAK,EAAAK,SAAA,CAAA,CAAA;AACpC,IAAA,IAAMC,QAAQ,GAAGX,eAAe,CAACQ,IAAI,CAAC,CAAA;AACtC,IAAA,IAAMI,GAAG,GAAGC,EAAE,CAAAC,KAAA,CAAA,KAAA,CAAA,EAAA,CAACP,SAAS,EAAEX,IAAI,EAAAmB,MAAA,CAAAC,kBAAA,CAAgBlB,cAAc,GAAAkB,kBAAA,CAAkBL,QAAQ,CAAC,CAAA,CAAA,CAAA;;AAEvF;AACA;IACA,IAAMM,SAA4B,GAAG,EAAE,CAAA;AACvC,IAAA,KAAK,IAAMC,GAAG,IAAIV,IAAI,EAAE;AACpB,MAAA,IAAI,EAAEU,GAAG,IAAIxB,eAAe,CAACyB,UAAU,CAAC,EAAE;AACtCF,QAAAA,SAAS,CAACC,GAAG,CAAC,GAAGV,IAAI,CAACU,GAAG,CAAC,CAAA;AAC9B,OAAA;AACJ,KAAA;IAEAD,SAAS,CAACX,GAAG,GAAGA,GAAG,CAAA;;AAEnB;AACA;IACA,IAAMc,SAA4B,GAAG,EAAE,CAAA;IACvC,KAAK,IAAMF,IAAG,IAAIxB,eAAe,CAACyB,UAAU,IAAI,EAAE,EAAE;MAChD,IAAID,IAAG,IAAIV,IAAI,EAAE;AACb,QAAA,IAAMa,OAAO,GAAG3B,eAAe,CAACyB,UAAU,CAACD,IAAG,CAAC,CAAA;AAE/C,QAAA,IAAQI,KAAK,GAAKD,OAAO,CAAjBC,KAAK,CAAA;AACb,QAAA,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;AAC5BF,UAAAA,SAAS,CAACF,IAAG,CAAC,GAAGV,IAAI,CAACU,IAAG,CAAC,CAAA;AAC9B,SAAA;AACJ,OAAA;AACJ,KAAA;AAEA,IAAA,oBAAOK,KAAA,CAAAC,aAAA,CAACtB,IAAI,EAAAuB,QAAA,CAAA;AAAClB,MAAAA,SAAS,EAAEK,GAAAA;AAAI,KAAA,EAAKQ,SAAS,EAAMH,SAAS,CAAG,CAAC,CAAA;AACjE,GAAC,CAAC,CAAA;AACF,EAAA,IAAIpB,IAAI,EAAE;IACNM,SAAS,CAACuB,WAAW,GAAG7B,IAAI,CAAA;AAChC,GAAA;AACA,EAAA,OAAOM,SAAS,CAAA;AACpB;;;;"}
1
+ {"version":3,"file":"linaria.js","sources":["../../src/engines/linaria.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { cx } from '@linaria/core';\n\n// TODO: #1008 Избавиться от импортов и переделать addFocus\nimport 'focus-visible';\nimport { getStaticVariants, getDynamicVariants } from './common';\nimport type { ComponentConfig, HTMLAnyAttributes } from './types';\n\n/* eslint-disable no-underscore-dangle */\nexport const _component = (componentConfig: ComponentConfig) => {\n const { tag, base, name } = componentConfig;\n const staticVariants = getStaticVariants(componentConfig);\n const dynamicVariants = getDynamicVariants(componentConfig);\n const Root = tag as React.ElementType;\n\n const component = forwardRef<HTMLElement, HTMLAnyAttributes>((props, ref) => {\n const { className, ...rest } = props;\n const variants = dynamicVariants(rest);\n const cls = cx(className, base as string, ...(staticVariants as string[]), ...variants);\n\n // styled-components do it inside\n // filter props\n const baseProps: HTMLAnyAttributes = {};\n for (const key in rest) {\n if (!(key in componentConfig.variations)) {\n baseProps[key] = rest[key];\n }\n }\n\n baseProps.ref = ref;\n\n // styled-components do it inside\n // add props that should be attr( disabled for example)\n const htmlAttrs: HTMLAnyAttributes = {};\n for (const key in componentConfig.variations || {}) {\n if (key in rest) {\n const variant = componentConfig.variations[key];\n\n const { attrs } = variant;\n if (typeof attrs === 'boolean') {\n htmlAttrs[key] = rest[key];\n }\n }\n }\n\n return <Root className={cls} {...htmlAttrs} {...baseProps} />;\n });\n if (name) {\n component.displayName = name;\n }\n return component;\n};\n"],"names":["_component","componentConfig","tag","base","name","staticVariants","getStaticVariants","dynamicVariants","getDynamicVariants","Root","component","forwardRef","props","ref","className","rest","_objectWithoutProperties","_excluded","variants","cls","cx","apply","concat","_toConsumableArray","baseProps","key","variations","htmlAttrs","variant","attrs","React","createElement","_extends","displayName"],"mappings":";;;;;;;AAQA;IACaA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,eAAgC,EAAK;AAC5D,EAAA,IAAQC,GAAG,GAAiBD,eAAe,CAAnCC,GAAG;IAAEC,IAAI,GAAWF,eAAe,CAA9BE,IAAI;IAAEC,IAAI,GAAKH,eAAe,CAAxBG,IAAI,CAAA;AACvB,EAAA,IAAMC,cAAc,GAAGC,iBAAiB,CAACL,eAAe,CAAC,CAAA;AACzD,EAAA,IAAMM,eAAe,GAAGC,kBAAkB,CAACP,eAAe,CAAC,CAAA;EA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