@salutejs/plasma-new-hope 0.72.0-canary.1174.8614735539.0 → 0.73.0-canary.1160.8627071767.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. package/cjs/components/Combobox/Combobox.css +10 -10
  2. package/cjs/components/Combobox/Combobox.styles.js +5 -5
  3. package/cjs/components/Combobox/Combobox.styles.js.map +1 -1
  4. package/cjs/components/Combobox/{Combobox.styles_17ei5vn.css → Combobox.styles_dw6hnk.css} +1 -1
  5. package/cjs/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +4 -4
  6. package/cjs/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +4 -4
  7. package/cjs/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +4 -4
  8. package/cjs/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +4 -4
  9. package/cjs/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -4
  10. package/cjs/components/Dropdown/Dropdown.css +4 -4
  11. package/cjs/components/Dropdown/Dropdown.js +0 -1
  12. package/cjs/components/Dropdown/Dropdown.js.map +1 -1
  13. package/cjs/components/Pagination/Pagination.css +9 -9
  14. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -9
  15. package/cjs/components/Popover/Popover.css +4 -4
  16. package/cjs/components/Popover/Popover.js +33 -43
  17. package/cjs/components/Popover/Popover.js.map +1 -1
  18. package/cjs/components/Popover/Popover.styles.js +1 -1
  19. package/cjs/components/Popover/Popover.styles.js.map +1 -1
  20. package/{es/components/Popover/Popover.styles_1rk9t6z.css → cjs/components/Popover/Popover.styles_1ggb66y.css} +1 -1
  21. package/cjs/components/Select/Select.css +9 -9
  22. package/cjs/components/Select/Select.styles.js +7 -7
  23. package/cjs/components/Select/Select.styles.js.map +1 -1
  24. package/{es/components/Select/Select.styles_ls547o.css → cjs/components/Select/Select.styles_1q3i6gw.css} +1 -1
  25. package/cjs/components/Select/ui/SelectDivider/SelectDivider.css +23 -0
  26. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js +40 -0
  27. package/cjs/components/Select/ui/SelectDivider/SelectDivider.js.map +1 -0
  28. package/cjs/components/Select/ui/SelectDivider/SelectDivider.styles.js +12 -0
  29. package/cjs/components/Select/ui/SelectDivider/SelectDivider.styles.js.map +1 -0
  30. package/cjs/components/Select/ui/SelectDivider/SelectDivider.styles_673hj6.css +1 -0
  31. package/cjs/components/{TextField/_disabled → Select/ui/SelectDivider/variations/_size}/base.js +2 -2
  32. package/cjs/components/Select/ui/SelectDivider/variations/_size/base.js.map +1 -0
  33. package/cjs/components/{TextField/_size → Select/ui/SelectDivider/variations/_view}/base.js +2 -2
  34. package/cjs/components/Select/ui/SelectDivider/variations/_view/base.js.map +1 -0
  35. package/cjs/components/Select/ui/SelectFooter/SelectFooter.css +23 -0
  36. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js +40 -0
  37. package/cjs/components/Select/ui/SelectFooter/SelectFooter.js.map +1 -0
  38. package/cjs/components/Select/ui/SelectFooter/SelectFooter.styles.js +12 -0
  39. package/cjs/components/Select/ui/SelectFooter/SelectFooter.styles.js.map +1 -0
  40. package/cjs/components/Select/ui/SelectFooter/SelectFooter.styles_11hk6tt.css +1 -0
  41. package/cjs/components/Select/ui/SelectFooter/variations/_size/base.js +9 -0
  42. package/cjs/components/Select/ui/SelectFooter/variations/_size/base.js.map +1 -0
  43. package/cjs/components/Select/ui/SelectFooter/variations/_size/base_x642ct.css +1 -0
  44. package/cjs/components/{TextField → Select/ui/SelectFooter/variations}/_view/base.js +2 -2
  45. package/cjs/components/Select/ui/SelectFooter/variations/_view/base.js.map +1 -0
  46. package/cjs/components/Select/ui/SelectFooter/variations/_view/base_x642ct.css +1 -0
  47. package/cjs/components/Select/ui/SelectGroup/SelectGroup.css +23 -0
  48. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js +40 -0
  49. package/cjs/components/Select/ui/SelectGroup/SelectGroup.js.map +1 -0
  50. package/cjs/components/Select/ui/SelectGroup/SelectGroup.styles.js +12 -0
  51. package/cjs/components/Select/ui/SelectGroup/SelectGroup.styles.js.map +1 -0
  52. package/cjs/components/Select/ui/SelectGroup/SelectGroup.styles_mktu7e.css +1 -0
  53. package/cjs/components/Select/ui/SelectGroup/variations/_size/base.js +9 -0
  54. package/cjs/components/Select/ui/SelectGroup/variations/_size/base.js.map +1 -0
  55. package/cjs/components/Select/ui/SelectGroup/variations/_size/base_x642ct.css +1 -0
  56. package/cjs/components/Select/ui/SelectGroup/variations/_view/base.js +9 -0
  57. package/cjs/components/Select/ui/SelectGroup/variations/_view/base.js.map +1 -0
  58. package/cjs/components/Select/ui/SelectGroup/variations/_view/base_x642ct.css +1 -0
  59. package/cjs/components/Select/ui/SelectHeader/SelectHeader.css +23 -0
  60. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js +40 -0
  61. package/cjs/components/Select/ui/SelectHeader/SelectHeader.js.map +1 -0
  62. package/cjs/components/Select/ui/SelectHeader/SelectHeader.styles.js +12 -0
  63. package/cjs/components/Select/ui/SelectHeader/SelectHeader.styles.js.map +1 -0
  64. package/cjs/components/Select/ui/SelectHeader/SelectHeader.styles_24gqog.css +1 -0
  65. package/cjs/components/Select/ui/SelectHeader/variations/_size/base.js +9 -0
  66. package/cjs/components/Select/ui/SelectHeader/variations/_size/base.js.map +1 -0
  67. package/cjs/components/Select/ui/SelectHeader/variations/_size/base_x642ct.css +1 -0
  68. package/cjs/components/Select/ui/SelectHeader/variations/_view/base.js +9 -0
  69. package/cjs/components/Select/ui/SelectHeader/variations/_view/base.js.map +1 -0
  70. package/cjs/components/Select/ui/SelectHeader/variations/_view/base_x642ct.css +1 -0
  71. package/cjs/components/Select/ui/SelectItem/SelectItem.css +4 -4
  72. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -1
  73. package/cjs/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  74. package/cjs/components/TextField/TextField.js +166 -40
  75. package/cjs/components/TextField/TextField.js.map +1 -1
  76. package/cjs/components/TextField/TextField.styles.js +27 -11
  77. package/cjs/components/TextField/TextField.styles.js.map +1 -1
  78. package/cjs/components/TextField/TextField.styles_1b1mddp.css +8 -0
  79. package/cjs/components/TextField/TextField.tokens.js +68 -20
  80. package/cjs/components/TextField/TextField.tokens.js.map +1 -1
  81. package/cjs/components/TextField/TextField_wctd2m.css +1 -0
  82. package/cjs/components/TextField/hooks/useKeyNavigation.js +132 -0
  83. package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -0
  84. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +19 -0
  85. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +38 -0
  86. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -0
  87. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +26 -0
  88. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -0
  89. package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css +1 -0
  90. package/cjs/components/TextField/variations/_disabled/base.js +9 -0
  91. package/cjs/components/TextField/variations/_disabled/base.js.map +1 -0
  92. package/cjs/components/TextField/variations/_disabled/base_1tnjoy9.css +1 -0
  93. package/cjs/components/TextField/{_label-placement → variations/_label-placement}/base.js +1 -1
  94. package/cjs/components/TextField/variations/_label-placement/base.js.map +1 -0
  95. package/cjs/components/TextField/variations/_label-placement/base_x642ct.css +1 -0
  96. package/cjs/components/TextField/{_label-placement → variations/_label-placement}/inner.js +2 -2
  97. package/cjs/components/TextField/variations/_label-placement/inner.js.map +1 -0
  98. package/cjs/components/TextField/variations/_label-placement/inner_gqlcj2.css +1 -0
  99. package/cjs/components/TextField/{_label-placement → variations/_label-placement}/outer.js +2 -2
  100. package/cjs/components/TextField/variations/_label-placement/outer.js.map +1 -0
  101. package/cjs/components/TextField/variations/_label-placement/outer_is41nj.css +1 -0
  102. package/cjs/components/TextField/variations/_read-only/base.js +9 -0
  103. package/cjs/components/TextField/variations/_read-only/base.js.map +1 -0
  104. package/cjs/components/TextField/variations/_read-only/base_134hshp.css +1 -0
  105. package/cjs/components/TextField/variations/_size/base.js +9 -0
  106. package/cjs/components/TextField/variations/_size/base.js.map +1 -0
  107. package/cjs/components/TextField/variations/_size/base_1khzr9t.css +1 -0
  108. package/cjs/components/TextField/variations/_view/base.js +9 -0
  109. package/cjs/components/TextField/variations/_view/base.js.map +1 -0
  110. package/cjs/components/TextField/variations/_view/base_1qd77x6.css +1 -0
  111. package/cjs/index.css +49 -42
  112. package/cjs/index.js +41 -6
  113. package/cjs/index.js.map +1 -1
  114. package/cjs/utils/index.js +13 -1
  115. package/cjs/utils/index.js.map +1 -1
  116. package/cjs/utils/react.js +12 -2
  117. package/cjs/utils/react.js.map +1 -1
  118. package/es/components/Combobox/Combobox.css +10 -10
  119. package/es/components/Combobox/Combobox.styles.js +5 -5
  120. package/es/components/Combobox/Combobox.styles.js.map +1 -1
  121. package/es/components/Combobox/{Combobox.styles_17ei5vn.css → Combobox.styles_dw6hnk.css} +1 -1
  122. package/es/components/Combobox/ui/ComboboxDivider/ComboboxDivider.css +4 -4
  123. package/es/components/Combobox/ui/ComboboxFooter/ComboboxFooter.css +4 -4
  124. package/es/components/Combobox/ui/ComboboxGroup/ComboboxGroup.css +4 -4
  125. package/es/components/Combobox/ui/ComboboxHeader/ComboboxHeader.css +4 -4
  126. package/es/components/Combobox/ui/ComboboxItem/ComboboxItem.css +4 -4
  127. package/es/components/Dropdown/Dropdown.css +4 -4
  128. package/es/components/Dropdown/Dropdown.js +0 -1
  129. package/es/components/Dropdown/Dropdown.js.map +1 -1
  130. package/es/components/Pagination/Pagination.css +9 -9
  131. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +9 -9
  132. package/es/components/Popover/Popover.css +4 -4
  133. package/es/components/Popover/Popover.js +33 -43
  134. package/es/components/Popover/Popover.js.map +1 -1
  135. package/es/components/Popover/Popover.styles.js +1 -1
  136. package/es/components/Popover/Popover.styles.js.map +1 -1
  137. package/{cjs/components/Popover/Popover.styles_1rk9t6z.css → es/components/Popover/Popover.styles_1ggb66y.css} +1 -1
  138. package/es/components/Select/Select.css +9 -9
  139. package/es/components/Select/Select.styles.js +7 -7
  140. package/es/components/Select/Select.styles.js.map +1 -1
  141. package/{cjs/components/Select/Select.styles_ls547o.css → es/components/Select/Select.styles_1q3i6gw.css} +1 -1
  142. package/es/components/Select/ui/SelectDivider/SelectDivider.css +23 -0
  143. package/es/components/Select/ui/SelectDivider/SelectDivider.js +35 -0
  144. package/es/components/Select/ui/SelectDivider/SelectDivider.js.map +1 -0
  145. package/es/components/Select/ui/SelectDivider/SelectDivider.styles.js +7 -0
  146. package/es/components/Select/ui/SelectDivider/SelectDivider.styles.js.map +1 -0
  147. package/es/components/Select/ui/SelectDivider/SelectDivider.styles_673hj6.css +1 -0
  148. package/es/components/{TextField/_disabled → Select/ui/SelectDivider/variations/_size}/base.js +2 -2
  149. package/es/components/Select/ui/SelectDivider/variations/_size/base.js.map +1 -0
  150. package/es/components/Select/ui/SelectDivider/variations/_size/base_x642ct.css +1 -0
  151. package/es/components/{TextField/_size → Select/ui/SelectDivider/variations/_view}/base.js +2 -2
  152. package/es/components/Select/ui/SelectDivider/variations/_view/base.js.map +1 -0
  153. package/es/components/Select/ui/SelectDivider/variations/_view/base_x642ct.css +1 -0
  154. package/es/components/Select/ui/SelectFooter/SelectFooter.css +23 -0
  155. package/es/components/Select/ui/SelectFooter/SelectFooter.js +35 -0
  156. package/es/components/Select/ui/SelectFooter/SelectFooter.js.map +1 -0
  157. package/es/components/Select/ui/SelectFooter/SelectFooter.styles.js +7 -0
  158. package/es/components/Select/ui/SelectFooter/SelectFooter.styles.js.map +1 -0
  159. package/es/components/Select/ui/SelectFooter/SelectFooter.styles_11hk6tt.css +1 -0
  160. package/es/components/Select/ui/SelectFooter/variations/_size/base.js +5 -0
  161. package/es/components/Select/ui/SelectFooter/variations/_size/base.js.map +1 -0
  162. package/es/components/Select/ui/SelectFooter/variations/_size/base_x642ct.css +1 -0
  163. package/es/components/{TextField → Select/ui/SelectFooter/variations}/_view/base.js +2 -2
  164. package/es/components/Select/ui/SelectFooter/variations/_view/base.js.map +1 -0
  165. package/es/components/Select/ui/SelectFooter/variations/_view/base_x642ct.css +1 -0
  166. package/es/components/Select/ui/SelectGroup/SelectGroup.css +23 -0
  167. package/es/components/Select/ui/SelectGroup/SelectGroup.js +35 -0
  168. package/es/components/Select/ui/SelectGroup/SelectGroup.js.map +1 -0
  169. package/es/components/Select/ui/SelectGroup/SelectGroup.styles.js +7 -0
  170. package/es/components/Select/ui/SelectGroup/SelectGroup.styles.js.map +1 -0
  171. package/es/components/Select/ui/SelectGroup/SelectGroup.styles_mktu7e.css +1 -0
  172. package/es/components/Select/ui/SelectGroup/variations/_size/base.js +5 -0
  173. package/es/components/Select/ui/SelectGroup/variations/_size/base.js.map +1 -0
  174. package/es/components/Select/ui/SelectGroup/variations/_size/base_x642ct.css +1 -0
  175. package/es/components/Select/ui/SelectGroup/variations/_view/base.js +5 -0
  176. package/es/components/Select/ui/SelectGroup/variations/_view/base.js.map +1 -0
  177. package/es/components/Select/ui/SelectGroup/variations/_view/base_x642ct.css +1 -0
  178. package/es/components/Select/ui/SelectHeader/SelectHeader.css +23 -0
  179. package/es/components/Select/ui/SelectHeader/SelectHeader.js +35 -0
  180. package/es/components/Select/ui/SelectHeader/SelectHeader.js.map +1 -0
  181. package/es/components/Select/ui/SelectHeader/SelectHeader.styles.js +7 -0
  182. package/es/components/Select/ui/SelectHeader/SelectHeader.styles.js.map +1 -0
  183. package/es/components/Select/ui/SelectHeader/SelectHeader.styles_24gqog.css +1 -0
  184. package/es/components/Select/ui/SelectHeader/variations/_size/base.js +5 -0
  185. package/es/components/Select/ui/SelectHeader/variations/_size/base.js.map +1 -0
  186. package/es/components/Select/ui/SelectHeader/variations/_size/base_x642ct.css +1 -0
  187. package/es/components/Select/ui/SelectHeader/variations/_view/base.js +5 -0
  188. package/es/components/Select/ui/SelectHeader/variations/_view/base.js.map +1 -0
  189. package/es/components/Select/ui/SelectHeader/variations/_view/base_x642ct.css +1 -0
  190. package/es/components/Select/ui/SelectItem/SelectItem.css +4 -4
  191. package/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -1
  192. package/es/components/Select/ui/SelectTarget/SelectTarget.js.map +1 -1
  193. package/es/components/TextField/TextField.js +169 -44
  194. package/es/components/TextField/TextField.js.map +1 -1
  195. package/es/components/TextField/TextField.styles.js +25 -12
  196. package/es/components/TextField/TextField.styles.js.map +1 -1
  197. package/es/components/TextField/TextField.styles_1b1mddp.css +8 -0
  198. package/es/components/TextField/TextField.tokens.js +68 -21
  199. package/es/components/TextField/TextField.tokens.js.map +1 -1
  200. package/es/components/TextField/TextField_wctd2m.css +1 -0
  201. package/es/components/TextField/hooks/useKeyNavigation.js +127 -0
  202. package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -0
  203. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +19 -0
  204. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +34 -0
  205. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -0
  206. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +22 -0
  207. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -0
  208. package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css +1 -0
  209. package/es/components/TextField/variations/_disabled/base.js +5 -0
  210. package/es/components/TextField/variations/_disabled/base.js.map +1 -0
  211. package/es/components/TextField/variations/_disabled/base_1tnjoy9.css +1 -0
  212. package/es/components/TextField/{_label-placement → variations/_label-placement}/base.js +1 -1
  213. package/es/components/TextField/variations/_label-placement/base.js.map +1 -0
  214. package/es/components/TextField/variations/_label-placement/base_x642ct.css +1 -0
  215. package/es/components/TextField/variations/_label-placement/inner.js +5 -0
  216. package/es/components/TextField/variations/_label-placement/inner.js.map +1 -0
  217. package/es/components/TextField/variations/_label-placement/inner_gqlcj2.css +1 -0
  218. package/es/components/TextField/variations/_label-placement/outer.js +5 -0
  219. package/es/components/TextField/variations/_label-placement/outer.js.map +1 -0
  220. package/es/components/TextField/variations/_label-placement/outer_is41nj.css +1 -0
  221. package/es/components/TextField/variations/_read-only/base.js +5 -0
  222. package/es/components/TextField/variations/_read-only/base.js.map +1 -0
  223. package/es/components/TextField/variations/_read-only/base_134hshp.css +1 -0
  224. package/es/components/TextField/variations/_size/base.js +5 -0
  225. package/es/components/TextField/variations/_size/base.js.map +1 -0
  226. package/es/components/TextField/variations/_size/base_1khzr9t.css +1 -0
  227. package/es/components/TextField/variations/_view/base.js +5 -0
  228. package/es/components/TextField/variations/_view/base.js.map +1 -0
  229. package/es/components/TextField/variations/_view/base_1qd77x6.css +1 -0
  230. package/es/index.css +49 -42
  231. package/es/index.js +15 -2
  232. package/es/index.js.map +1 -1
  233. package/es/utils/index.js +11 -2
  234. package/es/utils/index.js.map +1 -1
  235. package/es/utils/react.js +9 -2
  236. package/es/utils/react.js.map +1 -1
  237. package/package.json +2 -2
  238. package/styled-components/cjs/components/Combobox/Combobox.styles.js +1 -1
  239. package/styled-components/cjs/components/Dropdown/Dropdown.js +0 -1
  240. package/styled-components/cjs/components/Popover/Popover.js +33 -43
  241. package/styled-components/cjs/components/Popover/Popover.styles.js +1 -1
  242. package/styled-components/cjs/components/Select/Select.styles.js +1 -1
  243. package/styled-components/cjs/components/Select/ui/SelectTarget/SelectTarget.js +2 -1
  244. package/styled-components/cjs/components/TextField/TextField.js +173 -43
  245. package/styled-components/cjs/components/TextField/TextField.styles.js +18 -10
  246. package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +24 -0
  247. package/styled-components/cjs/components/TextField/TextField.tokens.js +68 -21
  248. package/styled-components/cjs/components/TextField/hooks/index.js +12 -0
  249. package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +138 -0
  250. package/styled-components/cjs/components/TextField/index.js +2 -2
  251. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +39 -0
  252. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +25 -0
  253. package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.types.js +5 -0
  254. package/styled-components/cjs/components/TextField/ui/index.js +12 -0
  255. package/styled-components/cjs/components/TextField/variations/_disabled/base.js +10 -0
  256. package/styled-components/cjs/components/TextField/variations/_label-placement/inner.js +10 -0
  257. package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/outer.js +3 -3
  258. package/styled-components/cjs/components/TextField/variations/_read-only/base.js +10 -0
  259. package/styled-components/cjs/components/TextField/variations/_read-only/tokens.json +1 -0
  260. package/styled-components/cjs/components/TextField/variations/_size/base.js +10 -0
  261. package/styled-components/cjs/components/TextField/variations/_view/base.js +10 -0
  262. package/styled-components/cjs/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
  263. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +43 -0
  264. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.js +11 -0
  265. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +181 -0
  266. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +40 -0
  267. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.js +11 -0
  268. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +181 -0
  269. package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.config.js +43 -0
  270. package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.js +11 -0
  271. package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.stories.tsx +181 -0
  272. package/styled-components/cjs/index.js +22 -0
  273. package/styled-components/es/components/Combobox/Combobox.styles.js +1 -1
  274. package/styled-components/es/components/Dropdown/Dropdown.js +0 -1
  275. package/styled-components/es/components/Popover/Popover.js +33 -43
  276. package/styled-components/es/components/Popover/Popover.styles.js +1 -1
  277. package/styled-components/es/components/Select/Select.styles.js +1 -1
  278. package/styled-components/es/components/Select/ui/SelectTarget/SelectTarget.js +2 -1
  279. package/styled-components/es/components/TextField/TextField.js +177 -47
  280. package/styled-components/es/components/TextField/TextField.styles.js +17 -9
  281. package/styled-components/es/components/TextField/TextField.template-doc.mdx +24 -0
  282. package/styled-components/es/components/TextField/TextField.tokens.js +67 -20
  283. package/styled-components/es/components/TextField/hooks/index.js +1 -0
  284. package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +132 -0
  285. package/styled-components/es/components/TextField/index.js +2 -2
  286. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +30 -0
  287. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +19 -0
  288. package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.types.js +1 -0
  289. package/styled-components/es/components/TextField/ui/index.js +1 -0
  290. package/styled-components/es/components/TextField/variations/_disabled/base.js +4 -0
  291. package/styled-components/es/components/TextField/variations/_label-placement/inner.js +4 -0
  292. package/styled-components/es/components/TextField/variations/_label-placement/outer.js +4 -0
  293. package/styled-components/es/components/TextField/variations/_read-only/base.js +4 -0
  294. package/styled-components/es/components/TextField/variations/_read-only/tokens.json +1 -0
  295. package/styled-components/es/components/TextField/variations/_size/base.js +4 -0
  296. package/styled-components/es/components/TextField/variations/_view/base.js +4 -0
  297. package/styled-components/es/examples/plasma_b2c/components/Popover/Popover.stories.tsx +0 -7
  298. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +37 -0
  299. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.js +5 -0
  300. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +181 -0
  301. package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +34 -0
  302. package/styled-components/es/examples/plasma_web/components/TextField/TextField.js +5 -0
  303. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +181 -0
  304. package/styled-components/es/examples/sds_engineer/components/TextField/TextField.config.js +37 -0
  305. package/styled-components/es/examples/sds_engineer/components/TextField/TextField.js +5 -0
  306. package/styled-components/es/examples/sds_engineer/components/TextField/TextField.stories.tsx +181 -0
  307. package/styled-components/es/index.js +2 -0
  308. package/types/components/Combobox/Combobox.styles.d.ts +2 -8
  309. package/types/components/Combobox/Combobox.styles.d.ts.map +1 -1
  310. package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
  311. package/types/components/Dropdown/Dropdown.styles.d.ts +1 -7
  312. package/types/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  313. package/types/components/Popover/Popover.d.ts +2 -2
  314. package/types/components/Popover/Popover.d.ts.map +1 -1
  315. package/types/components/Popover/Popover.styles.d.ts.map +1 -1
  316. package/types/components/Popover/Popover.types.d.ts +12 -19
  317. package/types/components/Popover/Popover.types.d.ts.map +1 -1
  318. package/types/components/Select/Select.styles.d.ts +2 -8
  319. package/types/components/Select/Select.styles.d.ts.map +1 -1
  320. package/types/components/Select/ui/SelectTarget/SelectTarget.d.ts.map +1 -1
  321. package/types/components/TextField/TextField.d.ts +8 -3
  322. package/types/components/TextField/TextField.d.ts.map +1 -1
  323. package/types/components/TextField/TextField.styles.d.ts +6 -3
  324. package/types/components/TextField/TextField.styles.d.ts.map +1 -1
  325. package/types/components/TextField/TextField.tokens.d.ts +57 -8
  326. package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
  327. package/types/components/TextField/TextField.types.d.ts +71 -6
  328. package/types/components/TextField/TextField.types.d.ts.map +1 -1
  329. package/types/components/TextField/hooks/index.d.ts +2 -0
  330. package/types/components/TextField/hooks/index.d.ts.map +1 -0
  331. package/types/components/TextField/hooks/useKeyNavigation.d.ts +17 -0
  332. package/types/components/TextField/hooks/useKeyNavigation.d.ts.map +1 -0
  333. package/types/components/TextField/index.d.ts +3 -2
  334. package/types/components/TextField/index.d.ts.map +1 -1
  335. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts +7 -0
  336. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts.map +1 -0
  337. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts +3 -0
  338. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts.map +1 -0
  339. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts +37 -0
  340. package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts.map +1 -0
  341. package/types/components/TextField/ui/index.d.ts +2 -0
  342. package/types/components/TextField/ui/index.d.ts.map +1 -0
  343. package/types/components/TextField/variations/_disabled/base.d.ts.map +1 -0
  344. package/types/components/TextField/variations/_label-placement/base.d.ts.map +1 -0
  345. package/types/components/TextField/variations/_label-placement/index.d.ts.map +1 -0
  346. package/types/components/TextField/variations/_label-placement/inner.d.ts.map +1 -0
  347. package/types/components/TextField/variations/_label-placement/outer.d.ts.map +1 -0
  348. package/types/components/TextField/variations/_read-only/base.d.ts.map +1 -0
  349. package/types/components/TextField/variations/_size/base.d.ts.map +1 -0
  350. package/types/components/TextField/variations/_view/base.d.ts +2 -0
  351. package/types/components/TextField/variations/_view/base.d.ts.map +1 -0
  352. package/types/examples/plasma_b2c/components/Popover/Popover.d.ts +1 -7
  353. package/types/examples/plasma_b2c/components/Popover/Popover.d.ts.map +1 -1
  354. package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts +32 -0
  355. package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -0
  356. package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +60 -0
  357. package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -0
  358. package/types/examples/plasma_web/components/Popover/Popover.d.ts +1 -7
  359. package/types/examples/plasma_web/components/Popover/Popover.d.ts.map +1 -1
  360. package/types/examples/plasma_web/components/TextField/TextField.config.d.ts +32 -0
  361. package/types/examples/plasma_web/components/TextField/TextField.config.d.ts.map +1 -0
  362. package/types/examples/plasma_web/components/TextField/TextField.d.ts +60 -0
  363. package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -0
  364. package/types/examples/sds_engineer/components/Popover/Popover.d.ts +1 -7
  365. package/types/examples/sds_engineer/components/Popover/Popover.d.ts.map +1 -1
  366. package/types/examples/sds_engineer/components/TextField/TextField.config.d.ts +32 -0
  367. package/types/examples/sds_engineer/components/TextField/TextField.config.d.ts.map +1 -0
  368. package/types/examples/sds_engineer/components/TextField/TextField.d.ts +60 -0
  369. package/types/examples/sds_engineer/components/TextField/TextField.d.ts.map +1 -0
  370. package/types/index.d.ts +2 -0
  371. package/types/index.d.ts.map +1 -1
  372. package/cjs/components/TextField/TextField.styles_2qw1n8.css +0 -5
  373. package/cjs/components/TextField/TextField_1lzb2r1.css +0 -1
  374. package/cjs/components/TextField/_disabled/base.js.map +0 -1
  375. package/cjs/components/TextField/_disabled/base_so3w81.css +0 -1
  376. package/cjs/components/TextField/_label-placement/base.js.map +0 -1
  377. package/cjs/components/TextField/_label-placement/inner.js.map +0 -1
  378. package/cjs/components/TextField/_label-placement/inner_1tyuicp.css +0 -1
  379. package/cjs/components/TextField/_label-placement/outer.js.map +0 -1
  380. package/cjs/components/TextField/_label-placement/outer_19ekaek.css +0 -1
  381. package/cjs/components/TextField/_size/base.js.map +0 -1
  382. package/cjs/components/TextField/_size/base_b5smyu.css +0 -1
  383. package/cjs/components/TextField/_view/base.js.map +0 -1
  384. package/cjs/components/TextField/_view/base_5bqzed.css +0 -1
  385. package/es/components/TextField/TextField.styles_2qw1n8.css +0 -5
  386. package/es/components/TextField/TextField_1lzb2r1.css +0 -1
  387. package/es/components/TextField/_disabled/base.js.map +0 -1
  388. package/es/components/TextField/_disabled/base_so3w81.css +0 -1
  389. package/es/components/TextField/_label-placement/base.js.map +0 -1
  390. package/es/components/TextField/_label-placement/inner.js +0 -5
  391. package/es/components/TextField/_label-placement/inner.js.map +0 -1
  392. package/es/components/TextField/_label-placement/inner_1tyuicp.css +0 -1
  393. package/es/components/TextField/_label-placement/outer.js +0 -5
  394. package/es/components/TextField/_label-placement/outer.js.map +0 -1
  395. package/es/components/TextField/_label-placement/outer_19ekaek.css +0 -1
  396. package/es/components/TextField/_size/base.js.map +0 -1
  397. package/es/components/TextField/_size/base_b5smyu.css +0 -1
  398. package/es/components/TextField/_view/base.js.map +0 -1
  399. package/es/components/TextField/_view/base_5bqzed.css +0 -1
  400. package/styled-components/cjs/components/TextField/_disabled/base.js +0 -9
  401. package/styled-components/cjs/components/TextField/_label-placement/inner.js +0 -10
  402. package/styled-components/cjs/components/TextField/_size/base.js +0 -10
  403. package/styled-components/cjs/components/TextField/_view/base.js +0 -10
  404. package/styled-components/es/components/TextField/_disabled/base.js +0 -3
  405. package/styled-components/es/components/TextField/_label-placement/inner.js +0 -4
  406. package/styled-components/es/components/TextField/_label-placement/outer.js +0 -4
  407. package/styled-components/es/components/TextField/_size/base.js +0 -4
  408. package/styled-components/es/components/TextField/_view/base.js +0 -4
  409. package/types/components/TextField/_disabled/base.d.ts.map +0 -1
  410. package/types/components/TextField/_label-placement/base.d.ts.map +0 -1
  411. package/types/components/TextField/_label-placement/index.d.ts.map +0 -1
  412. package/types/components/TextField/_label-placement/inner.d.ts.map +0 -1
  413. package/types/components/TextField/_label-placement/outer.d.ts.map +0 -1
  414. package/types/components/TextField/_size/base.d.ts.map +0 -1
  415. package/types/components/TextField/_view/base.d.ts.map +0 -1
  416. /package/cjs/components/{TextField/_label-placement → Select/ui/SelectDivider/variations/_size}/base_x642ct.css +0 -0
  417. /package/{es/components/TextField/_label-placement → cjs/components/Select/ui/SelectDivider/variations/_view}/base_x642ct.css +0 -0
  418. /package/styled-components/cjs/components/TextField/{_disabled → variations/_disabled}/tokens.json +0 -0
  419. /package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/base.js +0 -0
  420. /package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/index.js +0 -0
  421. /package/styled-components/cjs/components/TextField/{_size → variations/_size}/tokens.json +0 -0
  422. /package/styled-components/cjs/components/TextField/{_view → variations/_view}/tokens.json +0 -0
  423. /package/styled-components/es/components/TextField/{_disabled → variations/_disabled}/tokens.json +0 -0
  424. /package/styled-components/es/components/TextField/{_label-placement → variations/_label-placement}/base.js +0 -0
  425. /package/styled-components/es/components/TextField/{_label-placement → variations/_label-placement}/index.js +0 -0
  426. /package/styled-components/es/components/TextField/{_size → variations/_size}/tokens.json +0 -0
  427. /package/styled-components/es/components/TextField/{_view → variations/_view}/tokens.json +0 -0
  428. /package/types/components/TextField/{_disabled → variations/_disabled}/base.d.ts +0 -0
  429. /package/types/components/TextField/{_label-placement → variations/_label-placement}/base.d.ts +0 -0
  430. /package/types/components/TextField/{_label-placement → variations/_label-placement}/index.d.ts +0 -0
  431. /package/types/components/TextField/{_label-placement → variations/_label-placement}/inner.d.ts +0 -0
  432. /package/types/components/TextField/{_label-placement → variations/_label-placement}/outer.d.ts +0 -0
  433. /package/types/components/TextField/{_size → variations/_read-only}/base.d.ts +0 -0
  434. /package/types/components/TextField/{_view → variations/_size}/base.d.ts +0 -0
@@ -120,7 +120,8 @@ var SelectTarget = exports.SelectTarget = /*#__PURE__*/(0, _react.forwardRef)(fu
120
120
  "aria-label": label,
121
121
  className: (0, _utils.cx)(withInnerLabelUp, withHasChips, withNoFocus, selectTarget),
122
122
  onWheel: onWheel,
123
- onKeyDown: onKeyDown
123
+ onKeyDown: onKeyDown,
124
+ stretching: "filled"
124
125
  }), hasText && (enumerationType === 'comma' || target === 'button-like' ? /*#__PURE__*/_react["default"].createElement(_SelectTarget.StyledText, {
125
126
  className: selectTargeText
126
127
  }, textContent) : /*#__PURE__*/_react["default"].createElement(_SelectTarget.StyledChipsWrapper, {
@@ -4,79 +4,204 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.textFieldRoot = exports.textFieldConfig = void 0;
7
+ exports.textFieldRoot = exports.textFieldConfig = exports.base = void 0;
8
8
  var _react = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("react"));
9
- var _styledComponents = /*#__PURE__*/require("styled-components");
10
9
  var _plasmaCore = /*#__PURE__*/require("@salutejs/plasma-core");
11
- var _base = /*#__PURE__*/require("./_size/base");
12
- var _base2 = /*#__PURE__*/require("./_view/base");
13
- var _base3 = /*#__PURE__*/require("./_disabled/base");
14
- var _base4 = /*#__PURE__*/require("./_label-placement/base");
10
+ var _styledComponents = /*#__PURE__*/require("styled-components");
11
+ var _utils = /*#__PURE__*/require("../../utils");
12
+ var _base = /*#__PURE__*/require("./variations/_size/base");
13
+ var _base2 = /*#__PURE__*/require("./variations/_view/base");
14
+ var _base3 = /*#__PURE__*/require("./variations/_disabled/base");
15
+ var _base4 = /*#__PURE__*/require("./variations/_read-only/base");
16
+ var _base5 = /*#__PURE__*/require("./variations/_label-placement/base");
15
17
  var _TextField = /*#__PURE__*/require("./TextField.styles");
16
- var _excluded = ["contentLeft", "contentRight", "children", "label", "labelPlacement", "placeholder", "leftHelper", "view", "size", "disabled", "onChange", "onSearch"];
18
+ var _TextField2 = /*#__PURE__*/require("./TextField.tokens");
19
+ var _ui = /*#__PURE__*/require("./ui");
20
+ var _useKeyNavigation2 = /*#__PURE__*/require("./hooks/useKeyNavigation");
21
+ var _excluded = ["id", "contentLeft", "contentRight", "label", "labelPlacement", "placeholder", "leftHelper", "enumerationType", "view", "size", "readOnly", "disabled", "chips", "onChange", "onChangeChips", "onSearch"];
17
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
19
24
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
26
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
27
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
28
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
29
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
30
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
31
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
32
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
- var base = /*#__PURE__*/(0, _styledComponents.css)(["display:block;"]);
33
+ var base = exports.base = /*#__PURE__*/(0, _styledComponents.css)(["display:block;overflow:hidden;"]);
23
34
  var textFieldRoot = exports.textFieldRoot = function textFieldRoot(Root) {
24
- return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
25
- var contentLeft = props.contentLeft,
26
- contentRight = props.contentRight,
27
- children = props.children,
28
- label = props.label,
29
- labelPlacement = props.labelPlacement,
30
- placeholder = props.placeholder,
31
- leftHelper = props.leftHelper,
32
- view = props.view,
33
- size = props.size,
34
- disabled = props.disabled,
35
- onChange = props.onChange,
36
- onSearch = props.onSearch,
37
- rest = _objectWithoutProperties(props, _excluded);
35
+ return /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
36
+ var id = _ref.id,
37
+ contentLeft = _ref.contentLeft,
38
+ contentRight = _ref.contentRight,
39
+ label = _ref.label,
40
+ labelPlacement = _ref.labelPlacement,
41
+ placeholder = _ref.placeholder,
42
+ leftHelper = _ref.leftHelper,
43
+ _ref$enumerationType = _ref.enumerationType,
44
+ enumerationType = _ref$enumerationType === void 0 ? 'plain' : _ref$enumerationType,
45
+ view = _ref.view,
46
+ size = _ref.size,
47
+ _ref$readOnly = _ref.readOnly,
48
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
49
+ _ref$disabled = _ref.disabled,
50
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
51
+ values = _ref.chips,
52
+ onChange = _ref.onChange,
53
+ onChangeChips = _ref.onChangeChips,
54
+ onSearch = _ref.onSearch,
55
+ rest = _objectWithoutProperties(_ref, _excluded);
56
+ var contentRef = (0, _react.useRef)(null);
57
+ var inputRef = (0, _react.useRef)(null);
58
+ var chipsRefs = (0, _react.useRef)([]);
59
+ var controlledRefs = {
60
+ contentRef: contentRef,
61
+ inputRef: inputRef,
62
+ chipsRefs: chipsRefs
63
+ };
64
+ var _useState = (0, _react.useState)([]),
65
+ _useState2 = _slicedToArray(_useState, 2),
66
+ chips = _useState2[0],
67
+ setChips = _useState2[1];
68
+ var uniqId = (0, _plasmaCore.safeUseId)();
69
+ var innerId = id || uniqId;
70
+ var labelId = (0, _plasmaCore.safeUseId)();
71
+ var helperTextId = (0, _plasmaCore.safeUseId)();
72
+ var isChipEnumeration = enumerationType === 'chip';
73
+ var hideLabel = (size === 'xs' || isChipEnumeration) && labelPlacement === 'inner';
74
+ var labelInside = size !== 'xs' && labelPlacement === 'inner';
75
+ var innerLabelPlacementValue = hideLabel ? 'outer' : labelPlacement;
76
+ var innerPlaceholderValue = hideLabel ? label : placeholder;
77
+ var innerLabelValue = hideLabel ? undefined : label;
78
+ var isChipsVisible = isChipEnumeration && (chips === null || chips === void 0 ? void 0 : chips.length);
79
+ var withHasChips = isChipsVisible ? _TextField2.classes.hasChips : undefined;
80
+ var wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? _TextField2.classes.hasEmptyContentLeft : undefined;
81
+ var wrapperWithoutRightContent = !contentRight && isChipsVisible ? _TextField2.classes.hasEmptyContentRight : undefined;
38
82
  var handleChange = function handleChange(event) {
83
+ if (disabled || readOnly) {
84
+ return;
85
+ }
39
86
  var _event$target = event.target,
40
87
  maxLength = _event$target.maxLength,
41
88
  value = _event$target.value;
42
- if (!onChange || maxLength !== -1 && value.length > maxLength) {
89
+ if (maxLength !== -1 && value.length > maxLength) {
90
+ return;
91
+ }
92
+ onChange === null || onChange === void 0 ? void 0 : onChange(event);
93
+ };
94
+ var updateChips = function updateChips(newChips, newValues) {
95
+ setChips(newChips);
96
+ onChangeChips === null || onChangeChips === void 0 ? void 0 : onChangeChips(newValues);
97
+ };
98
+ var _useKeyNavigation = (0, _useKeyNavigation2.useKeyNavigation)({
99
+ controlledRefs: controlledRefs,
100
+ disabled: disabled,
101
+ readOnly: readOnly,
102
+ chips: chips,
103
+ enumerationType: enumerationType,
104
+ updateChips: updateChips,
105
+ onSearch: onSearch,
106
+ onChange: onChange
107
+ }),
108
+ handleInputKeydown = _useKeyNavigation.handleInputKeydown,
109
+ handleChipKeyDown = _useKeyNavigation.handleChipKeyDown,
110
+ onChipClear = _useKeyNavigation.onChipClear,
111
+ handleContentKeyDown = _useKeyNavigation.handleContentKeyDown;
112
+ var onChipClick = function onChipClick(event) {
113
+ return event.stopPropagation();
114
+ };
115
+ var handleInputFocus = function handleInputFocus() {
116
+ if (readOnly || disabled || !(inputRef !== null && inputRef !== void 0 && inputRef.current)) {
43
117
  return;
44
118
  }
45
- onChange(event);
119
+ inputRef.current.scrollIntoView({
120
+ behavior: 'smooth',
121
+ block: 'center',
122
+ inline: 'center'
123
+ });
124
+ inputRef.current.focus({
125
+ preventScroll: true
126
+ });
46
127
  };
47
- var handleKeyUp = function handleKeyUp(event) {
48
- if (event.key === 'Enter' && onSearch) {
49
- onSearch(event.target.value, event);
128
+ var getRef = function getRef(element, index) {
129
+ if (element && chipsRefs !== null && chipsRefs !== void 0 && chipsRefs.current) {
130
+ chipsRefs.current[index] = element;
50
131
  }
51
132
  };
52
- var labelInside = labelPlacement === 'inner';
53
- var lableId = (0, _plasmaCore.safeUseId)();
54
- var helperTextId = (0, _plasmaCore.safeUseId)();
133
+ (0, _react.useEffect)(function () {
134
+ if (!isChipEnumeration && !(values !== null && values !== void 0 && values.length)) {
135
+ return;
136
+ }
137
+ var newChips = (values === null || values === void 0 ? void 0 : values.map(function (value, index) {
138
+ return {
139
+ id: "".concat(index, "_").concat(value),
140
+ text: value
141
+ };
142
+ })) || [];
143
+ setChips(newChips);
144
+ }, [isChipEnumeration, values]);
55
145
  return /*#__PURE__*/_react["default"].createElement(Root, {
146
+ ref: ref,
56
147
  view: view,
57
148
  size: size,
58
149
  disabled: disabled,
59
- labelPlacement: labelPlacement
60
- }, labelInside || label && /*#__PURE__*/_react["default"].createElement(_TextField.Label, {
61
- id: lableId
62
- }, label), /*#__PURE__*/_react["default"].createElement(_TextField.InputWrapper, null, contentLeft, /*#__PURE__*/_react["default"].createElement(_TextField.InputLabelWrapper, null, /*#__PURE__*/_react["default"].createElement(_TextField.Input, _extends({}, rest, {
63
- ref: ref,
64
- "aria-labelledby": lableId,
150
+ readOnly: !disabled && readOnly,
151
+ labelPlacement: innerLabelPlacementValue,
152
+ onClick: handleInputFocus
153
+ }, labelInside || innerLabelValue && /*#__PURE__*/_react["default"].createElement(_TextField.Label, {
154
+ id: labelId,
155
+ htmlFor: id
156
+ }, innerLabelValue), /*#__PURE__*/_react["default"].createElement(_TextField.InputWrapper, {
157
+ className: (0, _utils.cx)(withHasChips, wrapperWithoutLeftContent, wrapperWithoutRightContent)
158
+ }, contentLeft && /*#__PURE__*/_react["default"].createElement(_TextField.StyledContentLeft, null, contentLeft), /*#__PURE__*/_react["default"].createElement(_TextField.InputLabelWrapper, {
159
+ tabIndex: -1,
160
+ ref: contentRef,
161
+ onKeyDown: handleContentKeyDown,
162
+ className: withHasChips
163
+ }, isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/_react["default"].createElement(_TextField.StyledChips, null, chips === null || chips === void 0 ? void 0 : chips.map(function (_ref2, index) {
164
+ var chipId = _ref2.id,
165
+ text = _ref2.text;
166
+ return /*#__PURE__*/_react["default"].createElement(_ui.TextFieldChip, {
167
+ id: chipId,
168
+ ref: function ref(element) {
169
+ return getRef(element, index);
170
+ },
171
+ key: "".concat(chipId, "_").concat(index),
172
+ disabled: disabled,
173
+ readOnly: readOnly,
174
+ value: text,
175
+ text: text,
176
+ onKeyDown: function onKeyDown(event) {
177
+ return handleChipKeyDown(event, chipId, index);
178
+ },
179
+ onClear: function onClear() {
180
+ return onChipClear(chipId, index);
181
+ },
182
+ onClick: onChipClick
183
+ });
184
+ })), /*#__PURE__*/_react["default"].createElement(_TextField.Input, _extends({}, rest, {
185
+ ref: inputRef,
186
+ id: innerId,
187
+ "aria-labelledby": labelId,
65
188
  "aria-describedby": helperTextId,
66
- placeholder: placeholder,
189
+ placeholder: innerPlaceholderValue,
67
190
  disabled: disabled,
191
+ readOnly: !disabled && readOnly,
68
192
  onChange: handleChange,
69
- onKeyUp: handleKeyUp
193
+ onKeyDown: handleInputKeydown
70
194
  })), labelInside && /*#__PURE__*/_react["default"].createElement(_TextField.Label, {
71
- id: lableId
72
- }, label)), contentRight), leftHelper && /*#__PURE__*/_react["default"].createElement(_TextField.LeftHelper, {
195
+ id: labelId,
196
+ htmlFor: innerId
197
+ }, innerLabelValue)), contentRight && /*#__PURE__*/_react["default"].createElement(_TextField.StyledContentRight, null, contentRight)), leftHelper && /*#__PURE__*/_react["default"].createElement(_TextField.LeftHelper, {
73
198
  id: helperTextId
74
199
  }, leftHelper));
75
200
  });
76
201
  };
77
202
  var textFieldConfig = exports.textFieldConfig = {
78
203
  name: 'TextField',
79
- tag: 'label',
204
+ tag: 'div',
80
205
  layout: textFieldRoot,
81
206
  base: base,
82
207
  variations: {
@@ -90,11 +215,16 @@ var textFieldConfig = exports.textFieldConfig = {
90
215
  css: _base3.base,
91
216
  attrs: true
92
217
  },
218
+ readOnly: {
219
+ css: _base4.base,
220
+ attrs: true
221
+ },
93
222
  labelPlacement: {
94
- css: _base4.base
223
+ css: _base5.base
95
224
  }
96
225
  },
97
226
  defaults: {
98
- size: 'm'
227
+ size: 'm',
228
+ view: 'default'
99
229
  }
100
230
  };
@@ -3,23 +3,31 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.LeftHelper = exports.Label = exports.InputWrapper = exports.InputLabelWrapper = exports.Input = void 0;
6
+ exports.StyledContentRight = exports.StyledContentLeft = exports.StyledChips = exports.LeftHelper = exports.Label = exports.InputWrapper = exports.InputLabelWrapper = exports.Input = void 0;
7
7
  var _styledComponents = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("styled-components"));
8
+ var _TextField = /*#__PURE__*/require("./TextField.tokens");
8
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
- var Input = exports.Input = /*#__PURE__*/_styledComponents["default"].input.withConfig({
10
+ var InputWrapper = exports.InputWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
10
11
  componentId: "plasma-new-hope__sc-g4vxbb-0"
11
- })(["box-sizing:border-box;appearance:none;border:0;padding:0;background-color:transparent;outline:none;"]);
12
+ })(["position:relative;display:flex;align-items:center;box-sizing:border-box;"]);
12
13
  var InputLabelWrapper = exports.InputLabelWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
13
14
  componentId: "plasma-new-hope__sc-g4vxbb-1"
14
- })(["", "{width:100%;}"], Input);
15
-
16
- // NOTE: border-width is used in size border-color is used in view
17
- var InputWrapper = exports.InputWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
15
+ })(["flex:1;overflow:scroll;position:relative;width:100%;display:inline-flex;align-items:center;::-webkit-scrollbar{display:none;}scrollbar-width:none;overscroll-behavior:contain;&.", "{height:var(", ");border-radius:var(", ");}"], /*#__PURE__*/String(_TextField.classes.hasChips), _TextField.tokens.chipHeight, _TextField.tokens.chipBorderRadius);
16
+ var StyledChips = exports.StyledChips = /*#__PURE__*/_styledComponents["default"].div.withConfig({
18
17
  componentId: "plasma-new-hope__sc-g4vxbb-2"
19
- })(["position:relative;display:flex;align-items:center;box-shadow:inset 0 0 0 var(--plasma_private-textfield-border-width) var(--plasma_private-textfield-border-color);", "{flex-grow:1;}"], InputLabelWrapper);
20
- var Label = exports.Label = /*#__PURE__*/_styledComponents["default"].div.withConfig({
18
+ })(["display:flex;gap:var(", ");margin-right:var(", ");user-select:none;"], _TextField.tokens.chipGap, _TextField.tokens.chipGap);
19
+ var Input = exports.Input = /*#__PURE__*/_styledComponents["default"].input.withConfig({
21
20
  componentId: "plasma-new-hope__sc-g4vxbb-3"
21
+ })(["box-sizing:border-box;appearance:none;border:0;padding:0;background-color:transparent;outline:none;flex:1;min-width:60%;"]);
22
+ var Label = exports.Label = /*#__PURE__*/_styledComponents["default"].label.withConfig({
23
+ componentId: "plasma-new-hope__sc-g4vxbb-4"
22
24
  })([""]);
25
+ var StyledContentLeft = exports.StyledContentLeft = /*#__PURE__*/_styledComponents["default"].div.withConfig({
26
+ componentId: "plasma-new-hope__sc-g4vxbb-5"
27
+ })(["margin:var(", ");"], _TextField.tokens.leftContentMargin);
28
+ var StyledContentRight = exports.StyledContentRight = /*#__PURE__*/_styledComponents["default"].div.withConfig({
29
+ componentId: "plasma-new-hope__sc-g4vxbb-6"
30
+ })(["margin:var(", ");"], _TextField.tokens.rightContentMargin);
23
31
  var LeftHelper = exports.LeftHelper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
24
- componentId: "plasma-new-hope__sc-g4vxbb-4"
32
+ componentId: "plasma-new-hope__sc-g4vxbb-7"
25
33
  })([""]);
@@ -110,3 +110,27 @@ export function App() {
110
110
  );
111
111
  }
112
112
  ```
113
+
114
+ ### Режим ввода
115
+ С помощью свойства `enumarationType` можно вводить элементы как теги.
116
+ По нажатию Enter, после ввода нужного текста, он преобразуется в Chip:
117
+
118
+ ```tsx live
119
+ import React from 'react';
120
+ import { TextField } from '@salutejs/{{ package }};
121
+
122
+ export function App() {
123
+ return (
124
+ <div>
125
+ <TextField
126
+ placeholder="Введите значение"
127
+ defaultValue="Значение"
128
+ size="l"
129
+ enumerationType="chip"
130
+ helperText="Подсказка снизу"
131
+ values={["Значение 1"]}
132
+ />
133
+ </div>
134
+ );
135
+ }
136
+ ```
@@ -3,35 +3,46 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tokens = void 0;
6
+ exports.tokens = exports.classes = void 0;
7
+ var classes = exports.classes = {
8
+ hasChips: 'has-chips',
9
+ hasEmptyContentLeft: 'has-empty-content-left',
10
+ hasEmptyContentRight: 'has-empty-content-right'
11
+ };
7
12
  var tokens = exports.tokens = {
8
13
  color: '--plasma-textfield-color',
9
14
  backgroundColor: '--plasma-textfield-bg-color',
10
15
  backgroundColorHover: '--plasma-textfield-bg-color-hover',
11
16
  backgroundColorFocus: '--plasma-textfield-bg-color-focus',
12
- /** Цвет каретки */
13
- caretColor: '--plasma-textfield__caret-color',
14
- placeholderColor: '--plasma-textfield__placeholder-color',
15
17
  borderColor: '--plasma-textfield-border-color',
16
18
  borderColorHover: '--plasma-textfield-border-color-hover',
17
19
  borderColorFocus: '--plasma-textfield-border-color-focus',
20
+ /** Цвета для read-only состояния */
21
+ colorReadOnly: '--plasma-textfield-color-readonly',
22
+ backgroundColorReadOnly: '--plasma-textfield-bg-color-readonly',
23
+ borderColorReadOnly: '--plasma-textfield-border-color-readonly',
24
+ placeholderColorReadOnly: '--plasma-textfield__placeholder-color-readonly',
25
+ /** Цвет каретки */
26
+ caretColor: '--plasma-textfield__caret-color',
27
+ placeholderColor: '--plasma-textfield__placeholder-color',
18
28
  height: '--plasma-textfield-height',
19
29
  borderWidth: '--plasmas-textfield-border-width',
20
30
  borderRadius: '--plasma-textfield-border-radius',
21
- /** отступ от границы ТextField */
31
+ /** Отступ от границы ТextField */
22
32
  padding: '--plasma-textfield-padding',
23
- paddingWithContent: '--plasma-textfield-padding-with-content',
24
- /* Отступ между Иконками и текстом Инпута */
25
- /* Отступ при отсутствии Иконок сохраняется */
26
- contentOffset: '--plasma-textfield__content-offset',
33
+ paddingWithChips: '--plasma-textfield-padding-with-chips',
34
+ /* Токены для инпута */
35
+ leftContentMargin: '--plasma-textfield__left-content-margin',
36
+ rightContentMargin: '--plasma-textfield__right-content-margin',
27
37
  fontFamily: '--plasma-textfield-font-family',
28
38
  fontStyle: '--plasma-textfield-font-style',
29
39
  fontSize: '--plasma-textfield-font-size',
30
40
  fontWeight: '--plasma-textfield-font-weight',
31
41
  letterSpacing: '--plasma-textfield-letter-spacing',
32
42
  lineHeight: '--plasma-textfield-line-height',
33
- /** Цвет подписи */
43
+ /** Токены лейбла */
34
44
  labelColor: '--plasma-textfield__label-color',
45
+ labelColorReadOnly: '--plasma-textfield__label-color-readonly',
35
46
  labelOffset: '--plasma-textfield__label-offset',
36
47
  labelFontFamily: '--plasma-textfield__label-font-family',
37
48
  labelFontStyle: '--plasma-textfield__label-font-style',
@@ -46,16 +57,52 @@ var tokens = exports.tokens = {
46
57
  labelInnerFontWeight: '--plasma-textfield-placement_inner__label-font-weight',
47
58
  labelInnerLetterSpacing: '--plasma-textfield-placement_inner__label-letter-spacing',
48
59
  labelInnerLineHeight: '--plasma-textfield-placement_inner__label-line-height',
49
- leftHelperColor: '--plasma-textfield__leftHelper-color',
50
- leftHelperOffset: '--plasma-textfield__leftHelper-offset',
51
- leftHelperFontFamily: '--plasma-textfield__leftHelper-font-family',
52
- leftHelperFontStyle: '--plasma-textfield__leftHelper-font-style',
53
- leftHelperFontSize: '--plasma-textfield__leftHelper-font-size',
54
- leftHelperFontWeight: '--plasma-textfield__leftHelper-font-weight',
55
- leftHelperLetterSpacing: '--plasma-textfield__leftHelper-letter-spacing',
56
- leftHelperLineHeight: '--plasma-textfield__leftHelper-line-height',
57
- /* Дополнительный цвет который можно использовать в <Icon color="inheit" /> */
58
- contentColor: '--plasma-textfield__content-color',
60
+ labelInnerPadding: '--plasma-textfield-placement_inner__label-padding',
61
+ contentLabelInnerPadding: '--plasma-textfield-placement_inner__content-padding',
62
+ leftHelperColor: '--plasma-textfield__left-helper-color',
63
+ leftHelperColorReadOnly: '--plasma-textfield__left-helper-color-readonly',
64
+ leftHelperOffset: '--plasma-textfield__left-helper-offset',
65
+ leftHelperFontFamily: '--plasma-textfield__left-helper-font-family',
66
+ leftHelperFontStyle: '--plasma-textfield__left-helper-font-style',
67
+ leftHelperFontSize: '--plasma-textfield__left-helper-font-size',
68
+ leftHelperFontWeight: '--plasma-textfield__left-helper-font-weight',
69
+ leftHelperLetterSpacing: '--plasma-textfield__left-helper-letter-spacing',
70
+ leftHelperLineHeight: '--plasma-textfield__left-helper-line-height',
59
71
  /** Прозрачность для всего компонента в состоянии disabled */
60
- disabledOpacity: '--plasma-textfield-disabled-opacity'
72
+ disabledOpacity: '--plasma-textfield-disabled-opacity',
73
+ /** Токены чипа */
74
+ chipHeight: '--plasma-textfield__chip-height',
75
+ chipBorderRadius: '--plasma-textfield__chip-border-radius',
76
+ chipGap: '--plasma-textfield__chip-gap',
77
+ chipBackground: '--plasma-textfield__chip-background',
78
+ chipColor: '--plasma-textfield__chip-color',
79
+ chipBackgroundHover: '--plasma-textfield__chip-background-hover',
80
+ chipColorHover: '--plasma-textfield__chip-color-hover',
81
+ chipScaleHover: '--plasma-textfield__chip-scale-hover',
82
+ chipBackgroundReadOnly: '--plasma-textfield__chip-background-readonly',
83
+ chipColorReadOnly: '--plasma-textfield__chip-color-readonly',
84
+ chipBackgroundReadOnlyHover: '--plasma-textfield__chip-background-readonly-hover',
85
+ chipColorReadOnlyHover: '--plasma-textfield__chip-color-readonly-hover',
86
+ chipBackgroundActive: '--plasma-textfield__chip-background-active',
87
+ chipColorActive: '--plasma-textfield__chip-color-active',
88
+ chipScaleActive: '--plasma-textfield__chip-scale-active',
89
+ chipFocusColor: '--plasma-textfield__chip-focus-color',
90
+ chipCloseIconColor: '--plasma-textfield__chip-close-icon-color',
91
+ chipOutlineSize: '--plasma-textfield__chip-outline-size',
92
+ chipWidth: '--plasma-textfield__chip-width',
93
+ chipPaddingTop: '--plasma-textfield__chip-padding-top',
94
+ chipPaddingRight: '--plasma-textfield__chip-padding-right',
95
+ chipPaddingBottom: '--plasma-textfield__chip-padding-bottom',
96
+ chipPaddingLeft: '--plasma-textfield__chip-padding-left',
97
+ chipCloseIconSize: '--plasma-textfield__chip-close-icon-size',
98
+ chipFontFamily: '--plasma-textfield__chip-font-family',
99
+ chipFontSize: '--plasma-textfield__chip-font-size',
100
+ chipFontStyle: '--plasma-textfield__chip-font-style',
101
+ chipFontWeight: '--plasma-textfield__chip-font-weight',
102
+ chipLetterSpacing: '--plasma-textfield__chip-letter-spacing',
103
+ chipLineHeight: '--plasma-textfield__chip-line-height',
104
+ chipClearContentMarginLeft: '--plasma-textfield__chip-clear-content-margin-left',
105
+ chipClearContentMarginRight: '--plasma-textfield__chip-clear-content-margin-right',
106
+ chipOpacityReadonly: '--plasma-textfield__chip-opacity-readonly',
107
+ focusColor: '--plasma-textfield-focus-color'
61
108
  };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "useKeyNavigation", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _useKeyNavigation.useKeyNavigation;
10
+ }
11
+ });
12
+ var _useKeyNavigation = /*#__PURE__*/require("./useKeyNavigation");
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useKeyNavigation = exports.Keys = void 0;
7
+ var _react = /*#__PURE__*/require("react");
8
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
15
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
16
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ var Keys = exports.Keys = {
19
+ Enter: 'Enter',
20
+ Tab: 'Tab',
21
+ Escape: 'Escape',
22
+ ArrowLeft: 'ArrowLeft',
23
+ ArrowRight: 'ArrowRight',
24
+ Backspace: 'Backspace'
25
+ };
26
+ var useKeyNavigation = exports.useKeyNavigation = function useKeyNavigation(_ref) {
27
+ var _ref$controlledRefs = _ref.controlledRefs,
28
+ chipsRefs = _ref$controlledRefs.chipsRefs,
29
+ contentRef = _ref$controlledRefs.contentRef,
30
+ inputRef = _ref$controlledRefs.inputRef,
31
+ disabled = _ref.disabled,
32
+ readOnly = _ref.readOnly,
33
+ chips = _ref.chips,
34
+ enumerationType = _ref.enumerationType,
35
+ updateChips = _ref.updateChips,
36
+ onChange = _ref.onChange,
37
+ onSearch = _ref.onSearch;
38
+ var _useState = (0, _react.useState)(-1),
39
+ _useState2 = _slicedToArray(_useState, 2),
40
+ activeChipIndex = _useState2[0],
41
+ setActiveChipIndex = _useState2[1];
42
+ var handleInputKeydown = function handleInputKeydown(event) {
43
+ var _inputRef$current;
44
+ var _ref2 = event.target,
45
+ value = _ref2.value;
46
+ if (disabled || readOnly) {
47
+ return;
48
+ }
49
+ if (event.key === Keys.Enter && enumerationType === 'chip' && value) {
50
+ var nextIndex = (chips === null || chips === void 0 ? void 0 : chips.length) || 0;
51
+ var newChips = [].concat(_toConsumableArray(chips), [{
52
+ id: "".concat(nextIndex, "_").concat(value),
53
+ text: value
54
+ }]);
55
+ var newValues = newChips.map(function (_ref3) {
56
+ var text = _ref3.text;
57
+ return text;
58
+ });
59
+ updateChips(newChips, newValues);
60
+ event.target.value = '';
61
+ onChange === null || onChange === void 0 ? void 0 : onChange(event);
62
+ }
63
+ if (event.key === Keys.Enter && onSearch) {
64
+ onSearch(value, event);
65
+ }
66
+ if (event.key === Keys.Backspace && chips.length && (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.selectionStart) === 0) {
67
+ var _newChips = _toConsumableArray(chips);
68
+ _newChips === null || _newChips === void 0 ? void 0 : _newChips.pop();
69
+ chipsRefs === null || chipsRefs === void 0 ? void 0 : chipsRefs.current.pop();
70
+ var _newValues = _newChips.map(function (_ref4) {
71
+ var text = _ref4.text;
72
+ return text;
73
+ });
74
+ updateChips(_newChips, _newValues);
75
+ }
76
+ };
77
+ var onChipClear = function onChipClear(clearId, index) {
78
+ if (!chips.length) {
79
+ return;
80
+ }
81
+ var newChips = (chips === null || chips === void 0 ? void 0 : chips.filter(function (_ref5) {
82
+ var chipId = _ref5.id;
83
+ return chipId !== clearId;
84
+ })) || [];
85
+ var newValues = newChips.map(function (_ref6) {
86
+ var text = _ref6.text;
87
+ return text;
88
+ });
89
+ chipsRefs === null || chipsRefs === void 0 ? void 0 : chipsRefs.current.splice(index, 1);
90
+ updateChips(newChips, newValues);
91
+ };
92
+ var handleChipKeyDown = function handleChipKeyDown(event, chipId, chipIndex) {
93
+ if (event.key === Keys.Tab) {
94
+ event.preventDefault();
95
+ }
96
+ if (event.key === Keys.Backspace) {
97
+ onChipClear(chipId, chipIndex);
98
+ }
99
+ };
100
+ var handleContentKeyDown = function handleContentKeyDown(event) {
101
+ var _inputRef$current2, _focusedItem, _focusedItem2;
102
+ var chipsRefsCount = chipsRefs.current.length;
103
+ var currentCaretPosition = (inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.selectionStart) || 0;
104
+ var newActiveChipIndex = activeChipIndex;
105
+ var focusedItem = null;
106
+ if (event.key === Keys.ArrowLeft && enumerationType === 'chip' && currentCaretPosition <= 0) {
107
+ var _chipsRefs$current;
108
+ var index = activeChipIndex - 1 <= 0 ? 0 : activeChipIndex - 1;
109
+ newActiveChipIndex = document.activeElement === (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) ? chipsRefsCount - 1 : index;
110
+ focusedItem = (_chipsRefs$current = chipsRefs.current) === null || _chipsRefs$current === void 0 ? void 0 : _chipsRefs$current[newActiveChipIndex];
111
+ }
112
+ if (event.key === Keys.ArrowRight && enumerationType === 'chip' && document.activeElement !== (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) {
113
+ var _chipsRefs$current2;
114
+ var _index = activeChipIndex + 1 >= chipsRefsCount ? activeChipIndex : activeChipIndex + 1;
115
+ newActiveChipIndex = document.activeElement === (contentRef === null || contentRef === void 0 ? void 0 : contentRef.current) ? 0 : _index;
116
+ focusedItem = _index === activeChipIndex ? inputRef === null || inputRef === void 0 ? void 0 : inputRef.current : (_chipsRefs$current2 = chipsRefs.current) === null || _chipsRefs$current2 === void 0 ? void 0 : _chipsRefs$current2[newActiveChipIndex];
117
+ }
118
+ if (event.key === Keys.Backspace && document.activeElement !== (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current)) {
119
+ var _chipsRefs$current3;
120
+ var _index2 = activeChipIndex - 1 <= 0 ? 0 : activeChipIndex - 1;
121
+ newActiveChipIndex = chipsRefsCount === 0 ? -1 : _index2;
122
+ focusedItem = chipsRefsCount === 0 ? inputRef === null || inputRef === void 0 ? void 0 : inputRef.current : chipsRefs === null || chipsRefs === void 0 ? void 0 : (_chipsRefs$current3 = chipsRefs.current) === null || _chipsRefs$current3 === void 0 ? void 0 : _chipsRefs$current3[newActiveChipIndex];
123
+ }
124
+ (_focusedItem = focusedItem) === null || _focusedItem === void 0 ? void 0 : _focusedItem.focus();
125
+ (_focusedItem2 = focusedItem) === null || _focusedItem2 === void 0 ? void 0 : _focusedItem2.scrollIntoView({
126
+ behavior: 'smooth',
127
+ block: 'center',
128
+ inline: 'center'
129
+ });
130
+ setActiveChipIndex(newActiveChipIndex);
131
+ };
132
+ return {
133
+ handleInputKeydown: handleInputKeydown,
134
+ handleChipKeyDown: handleChipKeyDown,
135
+ onChipClear: onChipClear,
136
+ handleContentKeyDown: handleContentKeyDown
137
+ };
138
+ };
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "textField_labelPlacement_outer", {
33
33
  return _outer.labelPlacement_outer;
34
34
  }
35
35
  });
36
- var _inner = /*#__PURE__*/require("./_label-placement/inner");
37
- var _outer = /*#__PURE__*/require("./_label-placement/outer");
36
+ var _inner = /*#__PURE__*/require("./variations/_label-placement/inner");
37
+ var _outer = /*#__PURE__*/require("./variations/_label-placement/outer");
38
38
  var _TextField = /*#__PURE__*/require("./TextField");
39
39
  var _TextField2 = /*#__PURE__*/require("./TextField.tokens");