carbon-react 158.50.0 → 159.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/esm/__internal__/checkable-input/__next__/checkable-input.component.js +1 -1
  2. package/esm/__internal__/checkable-input/__next__/checkable-input.style.js +1 -1
  3. package/esm/__internal__/checkable-input/checkable-input.style.js +1 -1
  4. package/esm/__internal__/error-border/error-border.style.d.ts +4 -0
  5. package/esm/__internal__/error-border/error-border.style.js +1 -0
  6. package/esm/__internal__/fieldset/__next__/fieldset.component.js +1 -1
  7. package/esm/__internal__/fieldset/fieldset.component.js +1 -1
  8. package/esm/__internal__/fieldset-validation-context/fieldset-validation-context.d.ts +6 -0
  9. package/esm/__internal__/fieldset-validation-context/index.d.ts +1 -0
  10. package/esm/__internal__/fieldset-validation-context/index.js +1 -0
  11. package/esm/__internal__/form-field/form-field.component.d.ts +1 -1
  12. package/esm/__internal__/form-field/form-field.component.js +1 -1
  13. package/esm/__internal__/hint-text/hint-text.component.d.ts +6 -21
  14. package/esm/__internal__/hint-text/hint-text.component.js +1 -1
  15. package/esm/__internal__/hint-text/hint-text.style.d.ts +5 -2
  16. package/esm/__internal__/hint-text/hint-text.style.js +1 -1
  17. package/esm/__internal__/hint-text/index.d.ts +0 -1
  18. package/esm/__internal__/input/index.d.ts +2 -5
  19. package/esm/__internal__/input/index.js +1 -1
  20. package/esm/__internal__/input/input-style-overrides.style.d.ts +8 -0
  21. package/esm/__internal__/input/input-style-overrides.style.js +1 -0
  22. package/esm/__internal__/input/input.component.d.ts +22 -31
  23. package/esm/__internal__/input/input.component.js +1 -1
  24. package/esm/__internal__/input/input.style.d.ts +9 -5
  25. package/esm/__internal__/input/input.style.js +1 -1
  26. package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +9 -3
  27. package/esm/__internal__/input-icon-toggle/input-icon-toggle.component.js +1 -1
  28. package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +7 -9
  29. package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  30. package/esm/__internal__/label/index.d.ts +0 -1
  31. package/esm/__internal__/label/label.component.d.ts +14 -31
  32. package/esm/__internal__/label/label.component.js +1 -1
  33. package/esm/__internal__/label/label.style.d.ts +5 -22
  34. package/esm/__internal__/label/label.style.js +1 -1
  35. package/esm/__internal__/legacy-error-border/error-border.style.js +1 -0
  36. package/esm/__internal__/legacy-hint-text/hint-text.component.d.ts +27 -0
  37. package/esm/__internal__/legacy-hint-text/hint-text.component.js +1 -0
  38. package/esm/__internal__/legacy-hint-text/hint-text.style.d.ts +3 -0
  39. package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -0
  40. package/esm/__internal__/legacy-hint-text/index.d.ts +2 -0
  41. package/esm/__internal__/legacy-hint-text/index.js +1 -0
  42. package/esm/__internal__/legacy-input/index.d.ts +5 -0
  43. package/esm/__internal__/legacy-input/index.js +1 -0
  44. package/{lib/__internal__/input → esm/__internal__/legacy-input}/input-presentation.style.d.ts +1 -1
  45. package/esm/__internal__/{input → legacy-input}/input-presentation.style.js +1 -1
  46. package/esm/__internal__/legacy-input/input.component.d.ts +54 -0
  47. package/esm/__internal__/legacy-input/input.component.js +1 -0
  48. package/esm/__internal__/legacy-input/input.style.d.ts +3 -0
  49. package/esm/__internal__/legacy-input/input.style.js +1 -0
  50. package/esm/__internal__/legacy-label/index.d.ts +2 -0
  51. package/esm/__internal__/legacy-label/index.js +1 -0
  52. package/esm/__internal__/legacy-label/label.component.d.ts +37 -0
  53. package/esm/__internal__/legacy-label/label.component.js +1 -0
  54. package/esm/__internal__/legacy-label/label.style.d.ts +25 -0
  55. package/esm/__internal__/legacy-label/label.style.js +1 -0
  56. package/esm/__internal__/utils/helpers/combine-refs/index.d.ts +3 -0
  57. package/esm/__internal__/utils/helpers/combine-refs/index.js +1 -0
  58. package/esm/__internal__/validation-message/__next__/index.d.ts +1 -0
  59. package/esm/__internal__/validation-message/__next__/index.js +1 -0
  60. package/esm/__internal__/validation-message/__next__/validation-message.component.d.ts +20 -0
  61. package/esm/__internal__/validation-message/__next__/validation-message.component.js +1 -0
  62. package/esm/__internal__/validation-message/__next__/validation-message.style.d.ts +6 -0
  63. package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -0
  64. package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
  65. package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  66. package/esm/components/checkbox/checkbox.style.js +1 -1
  67. package/esm/components/date/date.component.js +1 -1
  68. package/esm/components/date/date.style.js +1 -1
  69. package/esm/components/date-range/date-range.style.js +1 -1
  70. package/esm/components/file-input/file-input.component.d.ts +1 -1
  71. package/esm/components/file-input/file-input.component.js +1 -1
  72. package/esm/components/file-input/file-input.style.d.ts +1 -1
  73. package/esm/components/file-input/file-input.style.js +1 -1
  74. package/esm/components/icon/icon.style.js +1 -1
  75. package/esm/components/inline-inputs/inline-inputs.component.d.ts +5 -1
  76. package/esm/components/inline-inputs/inline-inputs.component.js +1 -1
  77. package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
  78. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  79. package/esm/components/number/number.component.js +1 -1
  80. package/esm/components/numeral-date/numeral-date.component.d.ts +6 -3
  81. package/esm/components/numeral-date/numeral-date.component.js +1 -1
  82. package/esm/components/numeral-date/numeral-date.style.d.ts +2 -14
  83. package/esm/components/numeral-date/numeral-date.style.js +1 -1
  84. package/esm/components/pager/__internal__/pager-navigation.component.js +1 -1
  85. package/esm/components/pager/pager.component.js +1 -1
  86. package/esm/components/pager/pager.style.js +1 -1
  87. package/esm/components/search/search-button.style.js +1 -1
  88. package/esm/components/search/search.component.js +1 -1
  89. package/esm/components/search/search.style.js +1 -1
  90. package/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
  91. package/esm/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
  92. package/esm/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
  93. package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  94. package/esm/components/select/filterable-select/filterable-select.component.js +1 -1
  95. package/esm/components/select/multi-select/multi-select.component.js +1 -1
  96. package/esm/components/select/multi-select/multi-select.style.js +1 -1
  97. package/esm/components/select/select.style.js +1 -1
  98. package/esm/components/select/simple-select/simple-select.component.js +1 -1
  99. package/esm/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
  100. package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  101. package/esm/components/switch/switch.component.js +1 -1
  102. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
  103. package/esm/components/text-editor/text-editor.component.js +1 -1
  104. package/esm/components/textarea/textarea.component.d.ts +4 -2
  105. package/esm/components/textarea/textarea.component.js +1 -1
  106. package/esm/components/textarea/textarea.style.js +1 -1
  107. package/esm/components/textbox/__internal__/__next__/index.d.ts +2 -0
  108. package/esm/components/textbox/__internal__/__next__/index.js +1 -0
  109. package/esm/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
  110. package/esm/components/textbox/__internal__/__next__/text-input.component.js +1 -0
  111. package/esm/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
  112. package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -0
  113. package/esm/components/textbox/__internal__/__next__/utils.d.ts +81 -0
  114. package/esm/components/textbox/__internal__/__next__/utils.js +1 -0
  115. package/esm/components/textbox/textbox.component.d.ts +21 -17
  116. package/esm/components/textbox/textbox.component.js +1 -1
  117. package/esm/components/tile-select/tile-select.style.d.ts +1 -1
  118. package/esm/components/tile-select/tile-select.style.js +1 -1
  119. package/esm/components/time/time.component.d.ts +1 -1
  120. package/esm/components/time/time.component.js +1 -1
  121. package/esm/components/time/time.style.d.ts +1 -1
  122. package/esm/components/time/time.style.js +1 -1
  123. package/esm/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
  124. package/esm/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
  125. package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
  126. package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
  127. package/esm/style/themes/apply-base-theme.d.ts +3 -1
  128. package/esm/style/themes/apply-base-theme.js +1 -1
  129. package/lib/__internal__/checkable-input/__next__/checkable-input.component.js +1 -1
  130. package/lib/__internal__/checkable-input/__next__/checkable-input.style.js +1 -1
  131. package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
  132. package/lib/__internal__/error-border/error-border.style.d.ts +4 -0
  133. package/lib/__internal__/error-border/error-border.style.js +1 -0
  134. package/lib/__internal__/fieldset/__next__/fieldset.component.js +1 -1
  135. package/lib/__internal__/fieldset/fieldset.component.js +1 -1
  136. package/lib/__internal__/fieldset-validation-context/fieldset-validation-context.d.ts +6 -0
  137. package/lib/__internal__/fieldset-validation-context/index.d.ts +1 -0
  138. package/lib/__internal__/fieldset-validation-context/index.js +1 -0
  139. package/lib/__internal__/fieldset-validation-context/package.json +6 -0
  140. package/lib/__internal__/form-field/form-field.component.d.ts +1 -1
  141. package/lib/__internal__/form-field/form-field.component.js +1 -1
  142. package/lib/__internal__/hint-text/hint-text.component.d.ts +6 -21
  143. package/lib/__internal__/hint-text/hint-text.component.js +1 -1
  144. package/lib/__internal__/hint-text/hint-text.style.d.ts +5 -2
  145. package/lib/__internal__/hint-text/hint-text.style.js +1 -1
  146. package/lib/__internal__/hint-text/index.d.ts +0 -1
  147. package/lib/__internal__/input/index.d.ts +2 -5
  148. package/lib/__internal__/input/index.js +1 -1
  149. package/lib/__internal__/input/input-style-overrides.style.d.ts +8 -0
  150. package/lib/__internal__/input/input-style-overrides.style.js +1 -0
  151. package/lib/__internal__/input/input.component.d.ts +22 -31
  152. package/lib/__internal__/input/input.component.js +1 -1
  153. package/lib/__internal__/input/input.style.d.ts +9 -5
  154. package/lib/__internal__/input/input.style.js +1 -1
  155. package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +9 -3
  156. package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.js +1 -1
  157. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +7 -9
  158. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  159. package/lib/__internal__/label/index.d.ts +0 -1
  160. package/lib/__internal__/label/label.component.d.ts +14 -31
  161. package/lib/__internal__/label/label.component.js +1 -1
  162. package/lib/__internal__/label/label.style.d.ts +5 -22
  163. package/lib/__internal__/label/label.style.js +1 -1
  164. package/lib/__internal__/legacy-error-border/error-border.style.js +1 -0
  165. package/lib/__internal__/legacy-hint-text/hint-text.component.d.ts +27 -0
  166. package/lib/__internal__/legacy-hint-text/hint-text.component.js +1 -0
  167. package/lib/__internal__/legacy-hint-text/hint-text.style.d.ts +3 -0
  168. package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -0
  169. package/lib/__internal__/legacy-hint-text/index.d.ts +2 -0
  170. package/lib/__internal__/legacy-hint-text/index.js +1 -0
  171. package/lib/__internal__/legacy-hint-text/package.json +6 -0
  172. package/lib/__internal__/legacy-input/index.d.ts +5 -0
  173. package/lib/__internal__/legacy-input/index.js +1 -0
  174. package/{esm/__internal__/input → lib/__internal__/legacy-input}/input-presentation.style.d.ts +1 -1
  175. package/lib/__internal__/{input → legacy-input}/input-presentation.style.js +1 -1
  176. package/lib/__internal__/legacy-input/input.component.d.ts +54 -0
  177. package/lib/__internal__/legacy-input/input.component.js +1 -0
  178. package/lib/__internal__/legacy-input/input.style.d.ts +3 -0
  179. package/lib/__internal__/legacy-input/input.style.js +1 -0
  180. package/lib/__internal__/legacy-input/package.json +6 -0
  181. package/lib/__internal__/legacy-label/index.d.ts +2 -0
  182. package/lib/__internal__/legacy-label/index.js +1 -0
  183. package/lib/__internal__/legacy-label/label.component.d.ts +37 -0
  184. package/lib/__internal__/legacy-label/label.component.js +1 -0
  185. package/lib/__internal__/legacy-label/label.style.d.ts +25 -0
  186. package/lib/__internal__/legacy-label/label.style.js +1 -0
  187. package/lib/__internal__/legacy-label/package.json +6 -0
  188. package/lib/__internal__/utils/helpers/combine-refs/index.d.ts +3 -0
  189. package/lib/__internal__/utils/helpers/combine-refs/index.js +1 -0
  190. package/lib/__internal__/utils/helpers/combine-refs/package.json +6 -0
  191. package/lib/__internal__/validation-message/__next__/index.d.ts +1 -0
  192. package/lib/__internal__/validation-message/__next__/index.js +1 -0
  193. package/lib/__internal__/validation-message/__next__/package.json +6 -0
  194. package/lib/__internal__/validation-message/__next__/validation-message.component.d.ts +20 -0
  195. package/lib/__internal__/validation-message/__next__/validation-message.component.js +1 -0
  196. package/lib/__internal__/validation-message/__next__/validation-message.style.d.ts +6 -0
  197. package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -0
  198. package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
  199. package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  200. package/lib/components/checkbox/checkbox.style.js +1 -1
  201. package/lib/components/date/date.component.js +1 -1
  202. package/lib/components/date/date.style.js +1 -1
  203. package/lib/components/date-range/date-range.style.js +1 -1
  204. package/lib/components/file-input/file-input.component.d.ts +1 -1
  205. package/lib/components/file-input/file-input.component.js +1 -1
  206. package/lib/components/file-input/file-input.style.d.ts +1 -1
  207. package/lib/components/file-input/file-input.style.js +1 -1
  208. package/lib/components/icon/icon.style.js +1 -1
  209. package/lib/components/inline-inputs/inline-inputs.component.d.ts +5 -1
  210. package/lib/components/inline-inputs/inline-inputs.component.js +1 -1
  211. package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
  212. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  213. package/lib/components/number/number.component.js +1 -1
  214. package/lib/components/numeral-date/numeral-date.component.d.ts +6 -3
  215. package/lib/components/numeral-date/numeral-date.component.js +1 -1
  216. package/lib/components/numeral-date/numeral-date.style.d.ts +2 -14
  217. package/lib/components/numeral-date/numeral-date.style.js +1 -1
  218. package/lib/components/pager/__internal__/pager-navigation.component.js +1 -1
  219. package/lib/components/pager/pager.component.js +1 -1
  220. package/lib/components/pager/pager.style.js +1 -1
  221. package/lib/components/search/search-button.style.js +1 -1
  222. package/lib/components/search/search.component.js +1 -1
  223. package/lib/components/search/search.style.js +1 -1
  224. package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
  225. package/lib/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
  226. package/lib/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
  227. package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  228. package/lib/components/select/filterable-select/filterable-select.component.js +1 -1
  229. package/lib/components/select/multi-select/multi-select.component.js +1 -1
  230. package/lib/components/select/multi-select/multi-select.style.js +1 -1
  231. package/lib/components/select/select.style.js +1 -1
  232. package/lib/components/select/simple-select/simple-select.component.js +1 -1
  233. package/lib/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
  234. package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  235. package/lib/components/switch/switch.component.js +1 -1
  236. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
  237. package/lib/components/text-editor/text-editor.component.js +1 -1
  238. package/lib/components/textarea/textarea.component.d.ts +4 -2
  239. package/lib/components/textarea/textarea.component.js +1 -1
  240. package/lib/components/textarea/textarea.style.js +1 -1
  241. package/lib/components/textbox/__internal__/__next__/index.d.ts +2 -0
  242. package/lib/components/textbox/__internal__/__next__/index.js +1 -0
  243. package/lib/components/textbox/__internal__/__next__/package.json +6 -0
  244. package/lib/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
  245. package/lib/components/textbox/__internal__/__next__/text-input.component.js +1 -0
  246. package/lib/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
  247. package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -0
  248. package/lib/components/textbox/__internal__/__next__/utils.d.ts +81 -0
  249. package/lib/components/textbox/__internal__/__next__/utils.js +1 -0
  250. package/lib/components/textbox/textbox.component.d.ts +21 -17
  251. package/lib/components/textbox/textbox.component.js +1 -1
  252. package/lib/components/tile-select/tile-select.style.d.ts +1 -1
  253. package/lib/components/tile-select/tile-select.style.js +1 -1
  254. package/lib/components/time/time.component.d.ts +1 -1
  255. package/lib/components/time/time.component.js +1 -1
  256. package/lib/components/time/time.style.d.ts +1 -1
  257. package/lib/components/time/time.style.js +1 -1
  258. package/lib/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
  259. package/lib/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
  260. package/lib/hooks/__internal__/useRegisterValidationToTabs/package.json +6 -0
  261. package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
  262. package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
  263. package/lib/style/themes/apply-base-theme.d.ts +3 -1
  264. package/lib/style/themes/apply-base-theme.js +1 -1
  265. package/package.json +1 -1
  266. package/esm/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
  267. package/esm/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
  268. package/esm/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
  269. package/esm/components/textbox/__internal__/prefix.style.d.ts +0 -5
  270. package/esm/components/textbox/__internal__/prefix.style.js +0 -1
  271. package/esm/components/textbox/textbox.style.js +0 -1
  272. package/lib/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
  273. package/lib/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
  274. package/lib/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
  275. package/lib/components/textbox/__internal__/prefix.style.d.ts +0 -5
  276. package/lib/components/textbox/__internal__/prefix.style.js +0 -1
  277. package/lib/components/textbox/textbox.style.js +0 -1
  278. /package/esm/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
  279. /package/esm/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
  280. /package/esm/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
  281. /package/esm/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
  282. /package/esm/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
  283. /package/esm/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
  284. /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
  285. /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
  286. /package/lib/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
  287. /package/lib/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
  288. /package/lib/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
  289. /package/lib/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
  290. /package/lib/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
  291. /package/lib/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
  292. /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
  293. /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var l=require("../../../style/utils/filter-styled-system-margin-props.js"),r=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),n=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/with-filter.hoc.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("./multi-select.style.js"),s=require("../../pill/pill.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/is-expected-value.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function m(e){return e&&e.__esModule?e:{default:e}}var y=m(t);function h(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function O(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){h(e,t,l[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const _=u.default(o.default),j=y.default.forwardRef(((u,o)=>{var{"aria-label":m,"aria-labelledby":h,value:j,id:C,label:S,name:x,disabled:k,readOnly:w,children:P,onOpen:q,onFilterChange:E,onChange:M,onClick:R,onFocus:L,onBlur:D,onKeyDown:V,openOnFocus:F=!1,noResultsMessage:I,placeholder:T,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,tooltipPosition:K,size:W="medium","data-element":$,"data-role":G,listPlacement:J="bottom",listMaxHeight:N,flipEnabled:Q=!0,wrapPillText:U=!0,enableVirtualScroll:X,virtualScrollOverscan:Y,required:Z,listWidth:ee}=u,te=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(u,["aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","onOpen","onFilterChange","onChange","onClick","onFocus","onBlur","onKeyDown","openOnFocus","noResultsMessage","placeholder","isLoading","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","size","data-element","data-role","listPlacement","listMaxHeight","flipEnabled","wrapPillText","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const[le,re]=t.useState(""),ne=t.useRef(i.default()),ie=t.useRef(i.default()),ue=t.useRef(null),oe=t.useRef(null),ae=t.useRef(!1),se=t.useRef(!1),ce=t.useRef(!1),de=t.useRef(!1),fe=t.useRef(!1),[pe,be]=t.useState(),[ve,me]=t.useState(!1),[ye,he]=t.useState(""),[Oe,ge]=t.useState(""),[_e,je]=t.useState(""),[Ce,Se]=t.useState(),xe=t.useRef(C||i.default()),{labelId:ke}=b.default({id:xe.current,label:S}),we=t.useRef(null),Pe=t.useCallback((()=>{me((e=>(!e&&q&&q(),!0)))}),[q]),qe=t.useCallback(((e,t)=>({target:g(O({},x&&{name:x},C&&{id:C}),{value:e}),selectionConfirmed:t})),[x,C]),Ee=t.useCallback(((e,t)=>{const l=e(j);l.length!==(null==j?void 0:j.length)&&M(qe(l,t))}),[qe,M,j]),Me=t.useCallback((e=>{const t=e.target.value,l=(r=t,n=P,y.default.Children.toArray(n).find((e=>{const{text:t}=e.props;return-1!==(null==t?void 0:t.toLowerCase().indexOf(null==r?void 0:r.toLowerCase()))})));var r,n;l&&ge(l.props.value),je(t),he(t),Pe()}),[P,Pe]),Re=t.useCallback((e=>{se.current=!0,Ee((t=>{if(!t.length)return t;const l=t.slice();return l.splice(e,1),l}),!0)}),[Ee]),Le=t.useCallback((e=>{const{key:t}=e,l="Backspace"===t||"Delete"===t;V&&V(e),w||(!e.defaultPrevented&&f.default(t)&&(e.preventDefault(),Pe()),!l||""!==_e&&""!==ye||Re(-1))}),[V,w,_e,ye,Pe,Re]),De=t.useMemo((()=>{var e;return j&&j.length?null===(e=y.default.Children.map(P,(e=>!(!y.default.isValidElement(e)||!j.includes(e.props.value))&&e.props.text)))||void 0===e?void 0:e.filter((e=>e)).reduce(((e,t)=>e?`${e}, ${t}`:t),""):null}),[P,j]),Ve=t.useCallback((e=>{if(ce.current=!1,!ve)return;const t=ue.current&&!ue.current.contains(e.target),l=oe.current&&!oe.current.contains(e.target);t&&l&&!se.current&&(he(""),je(""),ge(""),me(!1)),se.current=!1}),[ve]),Fe=t.useMemo((()=>{const t=!k&&!w;let l;return(null==j?void 0:j.length)?j.map(((r,n)=>{const i=y.default.Children.toArray(P).find((e=>y.default.isValidElement(e)&&c.default(e,r)));let u={};if(!i)return null;var o,d;y.default.isValidElement(i)&&(l=void 0!==(null==i||null===(o=i.props.value)||void 0===o?void 0:o.value)?null==i||null===(d=i.props.value)||void 0===d?void 0:d.value:null==i?void 0:i.props.value,u={title:i.props.text,fill:i.props.fill,borderColor:i.props.borderColor});const f=u.title||"",p=f+l||n;return e.jsx(a.StyledSelectPillContainer,{children:e.jsx(s.Pill,g(O({onDelete:t?()=>Re(n):void 0,wrapText:U},u),{children:f}))},p)})):""}),[P,k,w,j]);t.useEffect((()=>{const e=null==j?void 0:j.length;Se(e?" ":T)}),[j,T]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Ve),function(){window.removeEventListener(e,Ve)}}),[Ve]);const Ie=p.default(E),Te=t.useRef(!0);function Ae(e){if(ce.current=!1,R&&R(e),!F||F&&!fe.current){if(ve)return je(""),void me(!1);null==q||q(),me(!0)}else fe.current=!1}function Be(e){ce.current=!1,R&&R(e),me((e=>e?(je(""),!1):(q&&q(),!0)))}function He(e){de.current=!1,ce.current||(ae.current=!1,D&&D(e))}function ze(e){ce.current=!0,"input"===e.target.dataset.element&&(de.current=!0)}function Ke(e){const t=()=>null==L?void 0:L(e);F?(we.current&&clearTimeout(we.current),we.current=setTimeout((()=>{me((e=>!!e||(q&&q(),L&&!ae.current&&(t(),ae.current=!0),ce.current&&!de.current?(fe.current=!1,!1):(de.current&&(fe.current=!0),!0))))}))):L&&!ae.current&&(t(),ae.current=!0)}t.useEffect((()=>{Ie&&!Te.current&&Ie(_e)}),[Ie,_e]),t.useEffect((()=>{Te.current=!1}),[]),v.default((()=>me(!1)));const We=t.useCallback((e=>{const{value:t,selectionType:l,id:r,selectionConfirmed:n}=e;if("navigationKey"===l)return ge(t),void re(r);"click"===l&&(se.current=!0),he("");const i=-1!==(null==j?void 0:j.findIndex((e=>d.default(e,t))));null==pe||pe.focus(),ce.current=!1,Ee((e=>i?e:[...e,t]),n)}),[pe,j,Ee]),$e=t.useCallback((()=>{me(!1),je("")}),[]),Ge=t.useCallback((e=>{e&&(be(e),o&&("function"==typeof o?o(e):o.current=e))}),[o]);function Je(){return g(O({id:xe.current,name:x,disabled:k,label:S,readOnly:w,placeholder:Ce,leftChildren:Fe,formattedValue:ye,selectedValue:j,onClick:Ae,onMouseDown:ze,onFocus:Ke,onBlur:He,iconOnClick:Be,iconOnMouseDown:ze,onKeyDown:Le,onChange:Me,tooltipPosition:K,size:W,required:Z},r.default(te)),{"data-component":void 0})}let Ne;switch(J){case"top":Ne="top-end";break;case"bottom":Ne="bottom-end";break;default:Ne=J}const Qe=e.jsx(_,{ref:oe,id:ne.current,labelId:ke,anchorElement:(null==pe?void 0:pe.parentElement)||void 0,onSelect:We,onSelectListClose:$e,onMouseDown:function(){ce.current=!0},filterText:_e.trim(),highlightedValue:Oe,noResultsMessage:I,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,listPlacement:void 0!==ee?Ne:J,listMaxHeight:N,flipEnabled:Q,multiselectValues:j,isOpen:ve,enableVirtualScroll:X,virtualScrollOverscan:Y,listWidth:ee,children:P}),Ue=l.default(te);return e.jsxs(a.StyledSelectMultiSelect,g(O({disabled:k,readOnly:w,hasTextCursor:!0,size:W,"data-component":"multiselect","data-role":G,"data-element":$,isOpen:ve},Ue),{children:[e.jsxs("div",{ref:ue,children:[e.jsx(a.StyledAccessibilityLabelContainer,{"data-element":"accessibility-label",id:ie.current,children:De}),e.jsx(n.default,O({ref:Ge,accessibilityLabelId:ie.current,activeDescendantId:le,"aria-controls":ne.current,ariaLabel:m,ariaLabelledby:h,hasTextCursor:!0,isOpen:ve,labelId:ke,value:Je().formattedValue},Je()))]}),Qe]}))}));exports.MultiSelect=j,exports.default=j;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var l=require("../../../style/utils/filter-styled-system-margin-props.js"),r=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),n=require("../__internal__/select-textbox/select-textbox.component.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/with-filter.hoc.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("./multi-select.style.js"),s=require("../../pill/pill.component.js"),c=require("../__internal__/utils/is-expected-option.js"),d=require("../__internal__/utils/is-expected-value.js"),f=require("../__internal__/utils/is-navigation-key.js"),p=require("../../../hooks/__internal__/useStableCallback/useStableCallback.js"),b=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),v=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function m(e){return e&&e.__esModule?e:{default:e}}var y=m(t);function h(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function O(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){h(e,t,l[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const _=u.default(o.default),j=y.default.forwardRef(((u,o)=>{var{"aria-label":m,"aria-labelledby":h,value:j,id:C,label:S,name:x,disabled:k,readOnly:w,children:P,onOpen:q,onFilterChange:E,onChange:M,onClick:R,onFocus:D,onBlur:L,onKeyDown:V,openOnFocus:F=!1,noResultsMessage:I,placeholder:T,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,tooltipPosition:K,size:W="medium","data-element":$,"data-role":N,listPlacement:G="bottom",listMaxHeight:J,flipEnabled:Q=!0,wrapPillText:U=!0,enableVirtualScroll:X,virtualScrollOverscan:Y,required:Z,listWidth:ee}=u,te=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(u,["aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","onOpen","onFilterChange","onChange","onClick","onFocus","onBlur","onKeyDown","openOnFocus","noResultsMessage","placeholder","isLoading","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","size","data-element","data-role","listPlacement","listMaxHeight","flipEnabled","wrapPillText","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const[le,re]=t.useState(""),ne=t.useRef(i.default()),ie=t.useRef(i.default()),ue=t.useRef(null),oe=t.useRef(null),ae=t.useRef(!1),se=t.useRef(!1),ce=t.useRef(!1),de=t.useRef(!1),fe=t.useRef(!1),[pe,be]=t.useState(),[ve,me]=t.useState(!1),[ye,he]=t.useState(""),[Oe,ge]=t.useState(""),[_e,je]=t.useState(""),[Ce,Se]=t.useState(),xe=t.useRef(C||i.default()),{labelId:ke}=b.default({id:xe.current,label:S}),we=t.useRef(null),Pe=t.useCallback((()=>{me((e=>(!e&&q&&q(),!0)))}),[q]),qe=t.useCallback(((e,t)=>({target:g(O({},x&&{name:x},C&&{id:C}),{value:e}),selectionConfirmed:t})),[x,C]),Ee=t.useCallback(((e,t)=>{const l=e(j);l.length!==(null==j?void 0:j.length)&&M(qe(l,t))}),[qe,M,j]),Me=t.useCallback((e=>{const t=e.target.value,l=(r=t,n=P,y.default.Children.toArray(n).find((e=>{const{text:t}=e.props;return-1!==(null==t?void 0:t.toLowerCase().indexOf(null==r?void 0:r.toLowerCase()))})));var r,n;l&&ge(l.props.value),je(t),he(t),Pe()}),[P,Pe]),Re=t.useCallback((e=>{se.current=!0,Ee((t=>{if(!t.length)return t;const l=t.slice();return l.splice(e,1),l}),!0)}),[Ee]),De=t.useCallback((e=>{const{key:t}=e,l="Backspace"===t||"Delete"===t;V&&V(e),w||(!e.defaultPrevented&&f.default(t)&&(e.preventDefault(),Pe()),!l||""!==_e&&""!==ye||Re(-1))}),[V,w,_e,ye,Pe,Re]),Le=t.useMemo((()=>{var e;return j&&j.length?null===(e=y.default.Children.map(P,(e=>!(!y.default.isValidElement(e)||!j.includes(e.props.value))&&e.props.text)))||void 0===e?void 0:e.filter((e=>e)).reduce(((e,t)=>e?`${e}, ${t}`:t),""):null}),[P,j]),Ve=t.useCallback((e=>{if(ce.current=!1,!ve)return;const t=ue.current&&!ue.current.contains(e.target),l=oe.current&&!oe.current.contains(e.target);t&&l&&!se.current&&(he(""),je(""),ge(""),me(!1)),se.current=!1}),[ve]),Fe=t.useMemo((()=>{const t=!k&&!w;let l;return(null==j?void 0:j.length)?j.map(((r,n)=>{const i=y.default.Children.toArray(P).find((e=>y.default.isValidElement(e)&&c.default(e,r)));let u={};if(!i)return null;var o,d;y.default.isValidElement(i)&&(l=void 0!==(null==i||null===(o=i.props.value)||void 0===o?void 0:o.value)?null==i||null===(d=i.props.value)||void 0===d?void 0:d.value:null==i?void 0:i.props.value,u={title:i.props.text,fill:i.props.fill,borderColor:i.props.borderColor});const f=u.title||"",p=f+l||n;return e.jsx(a.StyledSelectPillContainer,{children:e.jsx(s.Pill,g(O({onDelete:t?()=>Re(n):void 0,wrapText:U},u),{children:f}))},p)})):""}),[P,k,w,j]);t.useEffect((()=>{const e=null==j?void 0:j.length;Se(e?" ":T)}),[j,T]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Ve),function(){window.removeEventListener(e,Ve)}}),[Ve]);const Ie=p.default(E),Te=t.useRef(!0);function Ae(e){if(ce.current=!1,R&&R(e),!F||F&&!fe.current){if(ve)return je(""),void me(!1);null==q||q(),me(!0)}else fe.current=!1}function Be(e){ce.current=!1,R&&R(e),me((e=>e?(je(""),!1):(q&&q(),!0)))}function He(e){de.current=!1,ce.current||(ae.current=!1,L&&L(e))}function ze(e){var t;ce.current=!0;const l=e.target;"input"!==(null===(t=l.dataset)||void 0===t?void 0:t.element)&&e.preventDefault(),"input"===l.dataset.element&&(de.current=!0)}function Ke(e){const t=()=>null==D?void 0:D(e);F?(we.current&&clearTimeout(we.current),we.current=setTimeout((()=>{me((e=>(e||(q&&q(),D&&!ae.current&&(t(),ae.current=!0),fe.current=de.current),!0)))}))):D&&!ae.current&&(t(),ae.current=!0)}t.useEffect((()=>{Ie&&!Te.current&&Ie(_e)}),[Ie,_e]),t.useEffect((()=>{Te.current=!1}),[]),v.default((()=>me(!1)));const We=t.useCallback((e=>{const{value:t,selectionType:l,id:r,selectionConfirmed:n}=e;if("navigationKey"===l)return ge(t),void re(r);"click"===l&&(se.current=!0),he("");const i=-1!==(null==j?void 0:j.findIndex((e=>d.default(e,t))));null==pe||pe.focus(),ce.current=!1,Ee((e=>i?e:[...e,t]),n)}),[pe,j,Ee]),$e=t.useCallback((()=>{me(!1),je("")}),[]),Ne=t.useCallback((e=>{e&&(be(e),o&&("function"==typeof o?o(e):o.current=e))}),[o]);function Ge(){return g(O({id:xe.current,name:x,disabled:k,label:S,readOnly:w,placeholder:Ce,leftChildren:Fe,formattedValue:ye,selectedValue:j,onClick:Ae,onMouseDown:ze,onFocus:Ke,onBlur:He,iconOnClick:Be,iconOnMouseDown:ze,onKeyDown:De,onChange:Me,tooltipPosition:K,size:W,required:Z},r.default(te)),{"data-component":void 0})}let Je;switch(G){case"top":Je="top-end";break;case"bottom":Je="bottom-end";break;default:Je=G}const Qe=e.jsx(_,{ref:oe,id:ne.current,labelId:ke,anchorElement:(null==pe?void 0:pe.parentElement)||void 0,onSelect:We,onSelectListClose:$e,onMouseDown:function(){ce.current=!0},filterText:_e.trim(),highlightedValue:Oe,noResultsMessage:I,isLoading:A,onListScrollBottom:B,tableHeader:H,multiColumn:z,listPlacement:void 0!==ee?Je:G,listMaxHeight:J,flipEnabled:Q,multiselectValues:j,isOpen:ve,enableVirtualScroll:X,virtualScrollOverscan:Y,listWidth:ee,children:P}),Ue=l.default(te);return e.jsxs(a.StyledSelectMultiSelect,g(O({disabled:k,readOnly:w,hasTextCursor:!0,size:W,"data-component":"multiselect","data-role":N,"data-element":$,isOpen:ve,className:"multi-select"},Ue),{children:[e.jsxs("div",{ref:ue,children:[e.jsx(a.StyledAccessibilityLabelContainer,{"data-element":"accessibility-label",id:ie.current,children:Le}),e.jsx(n.default,O({ref:Ne,accessibilityLabelId:ie.current,activeDescendantId:le,"aria-controls":ne.current,ariaLabel:m,ariaLabelledby:h,isOpen:ve,labelId:ke,value:Ge().formattedValue,selectType:"multi"},Ge()))]}),Qe]}))}));exports.MultiSelect=j,exports.default=j;
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),t=require("../../pill/pill.style.js"),i=require("../../../style/themes/apply-base-theme.js"),l=require("../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),n=require("../select.style.js"),s=require("../../../__internal__/input/input-presentation.style.js"),d=require("../../../__internal__/input/input.style.js"),a=require("../../../__internal__/input/input-sizes.style.js");function r(e){return e&&e.__esModule?e:{default:e}}var u=r(e);const o=u.default.div.attrs(i.default).withConfig({displayName:"multi-select.style__StyledSelectPillContainer",componentId:"sc-79dfc3dd-0"})(["display:flex;flex-direction:column;justify-content:center;margin:3px 2px 3px 0;max-width:100%;&& ","{text-overflow:ellipsis;}"],t.default),p=u.default(n.default).withConfig({displayName:"multi-select.style__StyledSelectMultiSelect",componentId:"sc-79dfc3dd-1"})(["","{position:absolute;right:0;height:100%;}","{padding-right:",";padding-left:",";position:relative;","{padding:0;}}"],l.default,s.default,(({size:e})=>a.default[e].height),(({size:e})=>a.default[e].horizontalPadding),d.default),c=u.default.div.withConfig({displayName:"multi-select.style__StyledAccessibilityLabelContainer",componentId:"sc-79dfc3dd-2"})(["display:none;"]);exports.StyledAccessibilityLabelContainer=c,exports.StyledSelectMultiSelect=p,exports.StyledSelectPillContainer=o;
1
+ "use strict";var e=require("styled-components"),t=require("../../pill/pill.style.js"),l=require("../../../style/themes/apply-base-theme.js"),i=require("../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),s=require("../select.style.js");function n(e){return e&&e.__esModule?e:{default:e}}var d=n(e);const o=d.default.div.attrs(l.default).withConfig({displayName:"multi-select.style__StyledSelectPillContainer",componentId:"sc-4d4e5df5-0"})(["display:flex;flex-direction:column;justify-content:center;margin:3px 2px 3px 0;max-width:100%;&& ","{text-overflow:ellipsis;}"],t.default),a=d.default(s.default).withConfig({displayName:"multi-select.style__StyledSelectMultiSelect",componentId:"sc-4d4e5df5-1"})(["","{position:absolute;right:0;height:100%;}"],i.default),c=d.default.div.withConfig({displayName:"multi-select.style__StyledAccessibilityLabelContainer",componentId:"sc-4d4e5df5-2"})(["display:none;"]);exports.StyledAccessibilityLabelContainer=c,exports.StyledSelectMultiSelect=a,exports.StyledSelectPillContainer=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),r=require("../../__internal__/input/input-presentation.style.js"),s=require("../../__internal__/input/input.style.js"),n=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),o=require("../../style/themes/apply-base-theme.js");function i(e){return e&&e.__esModule?e:{default:e}}const a=i(e).default.div.attrs(o.default).withConfig({displayName:"select.style__StyledSelect",componentId:"sc-4f460270-0"})(["",""],(({hasTextCursor:o,disabled:i,readOnly:a,theme:l,transparent:d,isOpen:u})=>e.css(["margin-bottom:var(--fieldSpacing);"," position:relative;","{cursor:text;"," ","}","{cursor:",";padding-right:0;"," "," ","}","{margin-right:0;}"," ",""],t.margin,s.default,i&&e.css(["cursor:not-allowed;color:var(--colorsUtilityYin030);text-shadow:none;"]),a&&e.css(["cursor:",";color:var(--colorsActionMinorYin090);text-shadow:none;"],o?"text":"default"),r.default,o?"text":"pointer",u&&e.css(["z-index:var(--adaptiveSidebarModalBackdrop,",");"],l.zIndex.aboveAll),i&&e.css(["cursor:not-allowed;"]),a&&e.css(["cursor:",";"],o?"text":"default"),n.default,d&&e.css(["","{background:transparent;border:none;}","{margin-left:0;}"],r.default,n.default),!o&&e.css(["","{position:absolute;width:inherit;opacity:0;padding:0;}"],s.default))));exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),r=require("../../style/themes/apply-base-theme.js");function s(e){return e&&e.__esModule?e:{default:e}}const l=s(e).default.div.attrs(r.default).withConfig({displayName:"select.style__StyledSelect",componentId:"sc-aec7932c-0"})(["margin-bottom:var(--fieldSpacing);"," position:relative;","{margin-right:0;}"],t.margin,i.default);exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var n=require("../../../style/utils/filter-styled-system-margin-props.js"),r=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),l=require("../select.style.js"),i=require("../__internal__/select-textbox/select-textbox.component.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/get-next-child-by-text.js"),s=require("../__internal__/utils/is-expected-option.js"),c=require("../__internal__/utils/is-navigation-key.js"),d=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),f=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function b(e){return e&&e.__esModule?e:{default:e}}var p=b(t);function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){y(e,t,n[t])}))}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const v=p.default.forwardRef(((b,y)=>{var{"aria-describedby":v,"aria-label":g,"aria-labelledby":j,value:w,id:_,label:h,name:S,disabled:x,readOnly:k,children:C,transparent:P,openOnFocus:q=!1,onOpen:E,onChange:D,onClick:L,onFocus:R,onKeyDown:M,onBlur:I,isLoading:T,listMaxHeight:F,onListScrollBottom:V,tableHeader:B,multiColumn:H,tooltipPosition:K,"data-element":A,"data-role":W,listPlacement:z="bottom",flipEnabled:G=!0,enableVirtualScroll:J,virtualScrollOverscan:N,required:Q,listWidth:U}=b,X=function(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(b,["aria-describedby","aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","transparent","openOnFocus","onOpen","onChange","onClick","onFocus","onKeyDown","onBlur","isLoading","listMaxHeight","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","data-element","data-role","listPlacement","flipEnabled","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const Y=t.useRef(a.default()),Z=t.useRef(null),$=t.useRef(null),ee=t.useRef(void 0),te=t.useRef(),ne=t.useRef(),re=t.useRef(),le=t.useRef(),[ie,oe]=t.useState(),[ae,ue]=t.useState(!1),[se,ce]=t.useState(""),[de,fe]=t.useState(""),[be,pe]=t.useState(w),ye=t.useRef(_||a.default()),{labelId:me}=d.default({id:ye.current,label:h}),Oe=t.useRef(void 0),ve=t.useMemo((()=>p.default.Children.toArray(C)),[C]),ge=t.useCallback(((e,t=!1)=>({target:O(m({},S&&{name:S},_&&{id:_}),{value:e}),selectionConfirmed:t})),[S,_]),je=t.useCallback((e=>{const t=ve.findIndex((e=>p.default.isValidElement(e)&&s.default(e,be))),n=u.default(e,ve,t);n&&D(ge(n.props.value))}),[ve,ge,D,be]),we=t.useCallback((e=>{if(ne.current){const t=le.current+e;le.current=t,je(t),window.clearTimeout(ee.current)}else le.current=e,je(e);ne.current=!0,window.clearTimeout(ee.current),ee.current=window.setTimeout((()=>{ne.current=!1,le.current=""}),500)}),[je]),_e=t.useCallback((e=>{const{key:t}=e;null==M||M(e),k||(" "===t||c.default(t)?(e.preventDefault(),ue((e=>(e||null==E||E(),!0)))):1!==t.length||e.metaKey||e.ctrlKey||we(t))}),[we,M,E,k]),he=t.useCallback((e=>{const t=Z.current&&!Z.current.contains(e.target),n=$.current&&!$.current.contains(e.target);te.current=!1,t&&n&&!re.current&&ue(!1),re.current=!1}),[]);function Se(e){te.current=!1,null==L||L(e),ue((e=>!e&&(null==E||E(),!0)))}t.useEffect((()=>{pe(w)}),[w]),t.useEffect((()=>{const e=ve.find((e=>s.default(e,be)));let t="";e&&(t=e.props.text),fe(t)}),[be,ve]),t.useEffect((()=>{const e="click";return window.addEventListener(e,he),function(){window.removeEventListener(e,he)}}),[he]),t.useEffect((()=>function(){window.clearTimeout(ee.current),window.clearTimeout(Oe.current)}),[]),f.default((()=>ue(!1)));const xe=t.useCallback((()=>{ue(!1)}),[]),ke=t.useCallback((e=>{e&&(oe(e),y&&("function"==typeof y?y(e):y.current=e))}),[y]);let Ce;switch(z){case"top":Ce="top-end";break;case"bottom":Ce="bottom-end";break;default:Ce=z}const Pe=e.jsx(o.default,{ref:$,id:Y.current,labelId:me,anchorElement:(null==ie?void 0:ie.parentElement)||void 0,onSelect:e=>{const{text:t,value:n,selectionType:r,id:l,selectionConfirmed:i}=e,o="click"===r;!function(e,t,n){null==D||D(ge(e,n))}(n,0,i),ce(l),"navigationKey"!==r&&ue(!1),o&&(re.current=!0,null==ie||ie.focus())},onMouseDown:function(){te.current=!0},onSelectListClose:xe,highlightedValue:be,listMaxHeight:F,isLoading:T,onListScrollBottom:V,tableHeader:B,multiColumn:H,listPlacement:void 0!==U?Ce:z,flipEnabled:G,isOpen:ae,enableVirtualScroll:J,virtualScrollOverscan:N,listWidth:U,children:C}),qe=n.default(X);return e.jsxs(l.default,O(m({transparent:P,disabled:x,readOnly:k,"data-component":"simple-select","data-role":W,"data-element":A,isOpen:ae},qe),{children:[e.jsx("div",{ref:Z,children:e.jsx(i.default,O(m({ref:ke,ariaLabel:g,"aria-controls":Y.current,activeDescendantId:se,ariaLabelledby:j,"aria-describedby":v,isOpen:ae,value:de},O(m({id:ye.current,name:S,disabled:x,readOnly:k,selectedValue:be,formattedValue:de,onClick:Se,iconOnClick:function(e){Se(e)},label:h,labelId:me,onMouseDown:function(){te.current=!0},onFocus:function(e){re.current||(null==R||R(e),te.current?te.current=!1:q&&(window.clearTimeout(Oe.current),Oe.current=window.setTimeout((()=>{ue((e=>(e||null==E||E(),!0)))}))))},onKeyDown:_e,onBlur:function(e){te.current||null==I||I(e)},tooltipPosition:K,required:Q,transparent:P},r.default(X)),{"data-component":void 0})),{onChange:()=>{}}))}),Pe]}))}));exports.SimpleSelect=v,exports.default=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react");require("../../../style/utils/filter-styled-system-padding-props.js");var r=require("../../../style/utils/filter-styled-system-margin-props.js"),n=require("../../../style/utils/filter-out-styled-system-spacing-props.js"),l=require("../select.style.js"),i=require("../__internal__/select-textbox/select-textbox.component.js"),o=require("../__internal__/select-list/select-list.component.js"),a=require("../../../__internal__/utils/helpers/guid/index.js"),u=require("../__internal__/utils/get-next-child-by-text.js"),s=require("../__internal__/utils/is-expected-option.js"),c=require("../__internal__/utils/is-navigation-key.js"),d=require("../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),f=require("../../../hooks/__internal__/useAdaptiveSidebarModalFocus/useAdaptiveSidebarModalFocus.js");function b(e){return e&&e.__esModule?e:{default:e}}var p=b(t);function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const v=p.default.forwardRef(((b,y)=>{var{"aria-describedby":v,"aria-label":g,"aria-labelledby":j,value:w,id:_,label:h,name:S,disabled:x,readOnly:k,children:C,transparent:P,openOnFocus:q=!1,onOpen:E,onChange:R,onClick:D,onFocus:L,onKeyDown:M,onBlur:T,isLoading:I,listMaxHeight:F,onListScrollBottom:V,tableHeader:B,multiColumn:H,tooltipPosition:K,"data-element":A,"data-role":W,listPlacement:z="bottom",flipEnabled:G=!0,enableVirtualScroll:J,virtualScrollOverscan:N,required:Q,listWidth:U}=b,X=function(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(b,["aria-describedby","aria-label","aria-labelledby","value","id","label","name","disabled","readOnly","children","transparent","openOnFocus","onOpen","onChange","onClick","onFocus","onKeyDown","onBlur","isLoading","listMaxHeight","onListScrollBottom","tableHeader","multiColumn","tooltipPosition","data-element","data-role","listPlacement","flipEnabled","enableVirtualScroll","virtualScrollOverscan","required","listWidth"]);const Y=t.useRef(a.default()),Z=t.useRef(null),$=t.useRef(null),ee=t.useRef(void 0),te=t.useRef(),re=t.useRef(),ne=t.useRef(),le=t.useRef(),[ie,oe]=t.useState(),[ae,ue]=t.useState(!1),[se,ce]=t.useState(""),[de,fe]=t.useState(""),[be,pe]=t.useState(w),ye=t.useRef(_||a.default()),{labelId:me}=d.default({id:ye.current,label:h}),Oe=t.useRef(void 0),ve=t.useRef(!1),ge=t.useMemo((()=>p.default.Children.toArray(C)),[C]),je=t.useCallback(((e,t=!1)=>({target:O(m({},S&&{name:S},_&&{id:_}),{value:e}),selectionConfirmed:t})),[S,_]),we=t.useCallback((e=>{const t=ge.findIndex((e=>p.default.isValidElement(e)&&s.default(e,be))),r=u.default(e,ge,t);r&&R(je(r.props.value))}),[ge,je,R,be]),_e=t.useCallback((e=>{if(re.current){const t=le.current+e;le.current=t,we(t),window.clearTimeout(ee.current)}else le.current=e,we(e);re.current=!0,window.clearTimeout(ee.current),ee.current=window.setTimeout((()=>{re.current=!1,le.current=""}),500)}),[we]),he=t.useCallback((e=>{const{key:t}=e;null==M||M(e),k||(" "===t||c.default(t)?(e.preventDefault(),ue((e=>(e||null==E||E(),!0)))):1!==t.length||e.metaKey||e.ctrlKey||_e(t))}),[_e,M,E,k]),Se=t.useCallback((e=>{const t=Z.current&&!Z.current.contains(e.target),r=$.current&&!$.current.contains(e.target);te.current=!1,t&&r&&!ne.current&&ue(!1),ne.current=!1}),[]);function xe(e){te.current=!1,null==D||D(e),ue((e=>(ve.current=e,!e&&(null==E||E(),!0))))}t.useEffect((()=>{pe(w)}),[w]),t.useEffect((()=>{const e=ge.find((e=>s.default(e,be)));let t="";e&&(t=e.props.text),fe(t)}),[be,ge]),t.useEffect((()=>{const e="click";return window.addEventListener(e,Se),function(){window.removeEventListener(e,Se)}}),[Se]),t.useEffect((()=>function(){window.clearTimeout(ee.current),window.clearTimeout(Oe.current)}),[]),f.default((()=>ue(!1)));const ke=t.useCallback((()=>{ue(!1)}),[]),Ce=t.useCallback((e=>{e&&(oe(e),y&&("function"==typeof y?y(e):y.current=e))}),[y]);let Pe;switch(z){case"top":Pe="top-end";break;case"bottom":Pe="bottom-end";break;default:Pe=z}const qe=e.jsx(o.default,{ref:$,id:Y.current,labelId:me,anchorElement:(null==ie?void 0:ie.parentElement)||void 0,onSelect:e=>{const{text:t,value:r,selectionType:n,id:l,selectionConfirmed:i}=e,o="click"===n;!function(e,t,r){null==R||R(je(e,r))}(r,0,i),ce(l),"navigationKey"!==n&&ue(!1),o&&(ne.current=!0,null==ie||ie.focus())},onMouseDown:function(){te.current=!0},onSelectListClose:ke,highlightedValue:be,listMaxHeight:F,isLoading:I,onListScrollBottom:V,tableHeader:B,multiColumn:H,listPlacement:void 0!==U?Pe:z,flipEnabled:G,isOpen:ae,enableVirtualScroll:J,virtualScrollOverscan:N,listWidth:U,children:C}),Ee=r.default(X);return e.jsxs(l.default,O(m({transparent:P,disabled:x,readOnly:k,"data-component":"simple-select","data-role":W,"data-element":A,isOpen:ae},Ee),{children:[e.jsx("div",{ref:Z,children:e.jsx(i.default,O(m({ref:Ce,ariaLabel:g,"aria-controls":Y.current,activeDescendantId:se,ariaLabelledby:j,"aria-describedby":v,isOpen:ae,value:de,selectType:"simple"},O(m({id:ye.current,name:S,disabled:x,readOnly:k,selectedValue:be,formattedValue:de,onClick:xe,iconOnClick:function(e){xe(e)},label:h,labelId:me,onMouseDown:function(){te.current=!0},onFocus:function(e){if(!ne.current)if(null==L||L(e),te.current)te.current=!1;else if(q){if(window.clearTimeout(Oe.current),ve.current)return void(ve.current=!1);Oe.current=window.setTimeout((()=>{ue((e=>(e||null==E||E(),!0)))}))}},onKeyDown:he,onBlur:function(e){te.current||null==T||T(e)},tooltipPosition:K,required:Q,transparent:P},n.default(X)),{"data-component":void 0})),{onChange:()=>{}}))}),qe]}))}));exports.SimpleSelect=v,exports.default=v;
@@ -2,7 +2,7 @@ export declare const StyledSimpleColor: import("styled-components").StyledCompon
2
2
  export declare const StyledColorSampleBox: import("styled-components").StyledComponent<"div", any, {
3
3
  color: string;
4
4
  }, never>;
5
- export declare const StyledSimpleColorInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../__internal__/input").InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>, any, {}, never>;
5
+ export declare const StyledSimpleColorInput: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../__internal__/legacy-input").InputProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>, any, {}, never>;
6
6
  export declare const StyledTickIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {
7
7
  color: string;
8
8
  }, never>;
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),o=require("../../../__internal__/input/input.component.js");require("react/jsx-runtime"),require("react"),require("../../../__internal__/input/input-presentation.style.js"),require("../../carbon-provider/__internal__/new-validation.context.js");var t=require("./checker-board.svg"),r=require("../../icon/icon.component.js"),i=require("../../../style/utils/get-rgb-values.js"),n=require("../../../style/utils/add-focus-styling.js");function l(e){return e&&e.__esModule?e:{default:e}}var s=l(e),a=l(t);const c=s.default.div.withConfig({displayName:"simple-color.style__StyledSimpleColor",componentId:"sc-b2f24669-0"})(["width:var(--sizing700);height:var(--sizing700);margin-right:2px;margin-bottom:2px;&:hover{cursor:pointer;}"]),d=s.default.div.withConfig({displayName:"simple-color.style__StyledColorSampleBox",componentId:"sc-b2f24669-1"})(["height:100%;width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;"," ",""],(({color:o})=>"transparent"!==o&&e.css(["background-color:",";"],o)),(({color:o})=>"transparent"===o&&e.css(['background-color:#eeeeee;background-image:url("','");background-size:14px 14px;background-position:-2px -2px;'],a.default))),p=s.default(o.default).withConfig({displayName:"simple-color.style__StyledSimpleColorInput",componentId:"sc-b2f24669-2"})(["position:absolute;opacity:0;height:var(--sizing700);width:var(--sizing700);margin:0;&:hover{cursor:pointer;}&:disabled:hover{cursor:not-allowed;}&:focus + ","{","}"],d,n.default(!0)),u=s.default(r.default).withConfig({displayName:"simple-color.style__StyledTickIcon",componentId:"sc-b2f24669-3"})(["height:20px;width:20px;pointer-events:none;display:block;&::before{font-size:20px;color:",";}"],(({color:e})=>(e=>{const o=i.default(e),[t,r,n]=o;return(Math.round(299*t)+Math.round(587*r)+Math.round(114*n))/1e3<128?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)"})(e)));exports.StyledColorSampleBox=d,exports.StyledSimpleColor=c,exports.StyledSimpleColorInput=p,exports.StyledTickIcon=u;
1
+ "use strict";var e=require("styled-components"),o=require("../../../__internal__/legacy-input/input.component.js");require("react/jsx-runtime"),require("react"),require("../../../__internal__/legacy-input/input-presentation.style.js"),require("../../carbon-provider/__internal__/new-validation.context.js");var t=require("./checker-board.svg"),r=require("../../icon/icon.component.js"),i=require("../../../style/utils/get-rgb-values.js"),n=require("../../../style/utils/add-focus-styling.js");function l(e){return e&&e.__esModule?e:{default:e}}var s=l(e),a=l(t);const c=s.default.div.withConfig({displayName:"simple-color.style__StyledSimpleColor",componentId:"sc-303f1be7-0"})(["width:var(--sizing700);height:var(--sizing700);margin-right:2px;margin-bottom:2px;&:hover{cursor:pointer;}"]),d=s.default.div.withConfig({displayName:"simple-color.style__StyledColorSampleBox",componentId:"sc-303f1be7-1"})(["height:100%;width:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;"," ",""],(({color:o})=>"transparent"!==o&&e.css(["background-color:",";"],o)),(({color:o})=>"transparent"===o&&e.css(['background-color:#eeeeee;background-image:url("','");background-size:14px 14px;background-position:-2px -2px;'],a.default))),p=s.default(o.default).withConfig({displayName:"simple-color.style__StyledSimpleColorInput",componentId:"sc-303f1be7-2"})(["position:absolute;opacity:0;height:var(--sizing700);width:var(--sizing700);margin:0;&:hover{cursor:pointer;}&:disabled:hover{cursor:not-allowed;}&:focus + ","{","}"],d,n.default(!0)),u=s.default(r.default).withConfig({displayName:"simple-color.style__StyledTickIcon",componentId:"sc-303f1be7-3"})(["height:20px;width:20px;pointer-events:none;display:block;&::before{font-size:20px;color:",";}"],(({color:e})=>(e=>{const o=i.default(e),[t,r,n]=o;return(Math.round(299*t)+Math.round(587*r)+Math.round(114*n))/1e3<128?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)"})(e)));exports.StyledColorSampleBox=d,exports.StyledSimpleColor=c,exports.StyledSimpleColorInput=p,exports.StyledTickIcon=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../__internal__/utils/helpers/guid/index.js");require("../../style/utils/filter-styled-system-padding-props.js");var i=require("../../style/utils/filter-styled-system-margin-props.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../hooks/useMediaQuery/useMediaQuery.js"),a=require("../loader/__next__/loader.component.js"),o=require("./switch.style.js"),s=require("../../__internal__/hint-text/hint-text.component.js");function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=c(t).default.forwardRef(((c,u)=>{var{checked:p,onChange:b,onBlur:h,onFocus:f,autoFocus:w,id:y,name:g,value:j,label:S,disabled:m,loading:x,processingLabel:O,processingLabelBelowSwitch:$=!1,size:v="small",labelInline:P=!1,labelSpacing:_,labelWidth:k,"data-element":L,"data-role":q,inputHint:T,required:H,labelHelp:z,fieldHelp:I,isDarkBackground:B,reverse:F,error:D,warning:M,info:R,validationOnLabel:W,fieldHelpInline:C,tooltipPosition:E,helpAriaLabel:A,validationMessagePositionTop:Q}=c,N=function(e,t){if(null==e)return{};var r,i,l=function(e,t){if(null==e)return{};var r,i,l={},n=Object.keys(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(c,["checked","onChange","onBlur","onFocus","autoFocus","id","name","value","label","disabled","loading","processingLabel","processingLabelBelowSwitch","size","labelInline","labelSpacing","labelWidth","data-element","data-role","inputHint","required","labelHelp","fieldHelp","isDarkBackground","reverse","error","warning","info","validationOnLabel","fieldHelpInline","tooltipPosition","helpAriaLabel","validationMessagePositionTop"]);const G=n.default("(prefers-reduced-motion: reduce)"),J=l.default(),K=J.switch.on(),U=J.switch.off(),V=null!=O?O:J.switch.processingLabel(),X=t.useRef(r.default()),Y=y||X.current,Z=t.useRef(`${r.default()}-label`),ee=t.useRef(`${r.default()}-hint`),te=null!=T?T:z,re=i.default(N);return e.jsxs(o.StyledSwitch,(ie=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){d(e,t,r[t])}))}return e}({"data-component":"switch","data-element":L,"data-role":q,$labelInline:P},re),le=null!=(le={children:[(S||te)&&e.jsxs(o.StyledSwitchLabelWrapper,{"data-role":"switch-label-wrapper",$labelInline:P,$labelWidth:P?k:void 0,children:[S&&e.jsx(o.StyledSwitchLabel,{htmlFor:Y,$disabled:m,$inputHint:!!te,$labelInline:P,$labelSpacing:P?_:void 0,$required:H,$size:v,id:Z.current,children:S}),te&&e.jsx(s.HintText,{"data-element":"input-hint",id:ee.current,isLarge:"large"===v,marginTop:"2px",children:te})]}),e.jsxs(o.StyledSwitchRow,{$size:v,$processingLabelBelowSwitch:x&&$,children:[e.jsxs(o.StyledSwitchTrack,{"data-role":"switch-track",$checked:p,$disabled:m,$size:v,$loading:x,$disableTransitions:!!G,children:[e.jsx(o.StyledSwitchInput,{ref:u,type:"checkbox",role:"switch",id:Y,name:g,value:j,checked:p,disabled:m||x,autoFocus:w,"aria-checked":p,onChange:b,onBlur:h,onFocus:f,"aria-describedby":te?ee.current:void 0,required:H}),x?e.jsx(o.StyledSwitchLoaderWrapper,{"data-role":"switch-loader-wrapper",$checked:p,$size:v,$disableTransitions:!!G,children:e.jsx(a.Loader,{"data-role":"switch-loader",loaderType:"ring",size:"large"===v?"small":"extra-small",showLabel:!1,inverse:p})}):e.jsx(o.StyledSwitchThumb,{"data-role":"switch-thumb",$checked:p,$disabled:m,$size:v,$disableTransitions:!!G})]}),x?e.jsx(o.StyledSwitchProcessingRow,{$below:$,"data-role":"switch-processing-row",children:e.jsx(o.StyledSwitchProcessingText,{$size:v,children:V})}):e.jsx(o.StyledSwitchStateText,{"aria-hidden":!0,$disabled:m,$size:v,children:p?K:U})]}),I&&e.jsx(s.HintText,{marginTop:"8px","data-element":"field-help",isLarge:"large"===v,children:I})]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le}));u.displayName="Switch",exports.Switch=u,exports.SwitchComponent=u,exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../__internal__/utils/helpers/guid/index.js");require("../../style/utils/filter-styled-system-padding-props.js");var i=require("../../style/utils/filter-styled-system-margin-props.js"),l=require("../../hooks/__internal__/useLocale/useLocale.js"),n=require("../../hooks/useMediaQuery/useMediaQuery.js"),a=require("../loader/__next__/loader.component.js"),o=require("./switch.style.js"),s=require("../../__internal__/legacy-hint-text/hint-text.component.js");function c(e){return e&&e.__esModule?e:{default:e}}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const u=c(t).default.forwardRef(((c,u)=>{var{checked:p,onChange:b,onBlur:h,onFocus:f,autoFocus:w,id:y,name:g,value:j,label:S,disabled:m,loading:x,processingLabel:O,processingLabelBelowSwitch:$=!1,size:v="small",labelInline:P=!1,labelSpacing:_,labelWidth:k,"data-element":L,"data-role":q,inputHint:T,required:H,labelHelp:z,fieldHelp:I,isDarkBackground:B,reverse:F,error:D,warning:M,info:R,validationOnLabel:W,fieldHelpInline:C,tooltipPosition:E,helpAriaLabel:A,validationMessagePositionTop:Q}=c,N=function(e,t){if(null==e)return{};var r,i,l=function(e,t){if(null==e)return{};var r,i,l={},n=Object.keys(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i<n.length;i++)r=n[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}(c,["checked","onChange","onBlur","onFocus","autoFocus","id","name","value","label","disabled","loading","processingLabel","processingLabelBelowSwitch","size","labelInline","labelSpacing","labelWidth","data-element","data-role","inputHint","required","labelHelp","fieldHelp","isDarkBackground","reverse","error","warning","info","validationOnLabel","fieldHelpInline","tooltipPosition","helpAriaLabel","validationMessagePositionTop"]);const G=n.default("(prefers-reduced-motion: reduce)"),J=l.default(),K=J.switch.on(),U=J.switch.off(),V=null!=O?O:J.switch.processingLabel(),X=t.useRef(r.default()),Y=y||X.current,Z=t.useRef(`${r.default()}-label`),ee=t.useRef(`${r.default()}-hint`),te=null!=T?T:z,re=i.default(N);return e.jsxs(o.StyledSwitch,(ie=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),i.forEach((function(t){d(e,t,r[t])}))}return e}({"data-component":"switch","data-element":L,"data-role":q,$labelInline:P},re),le=null!=(le={children:[(S||te)&&e.jsxs(o.StyledSwitchLabelWrapper,{"data-role":"switch-label-wrapper",$labelInline:P,$labelWidth:P?k:void 0,children:[S&&e.jsx(o.StyledSwitchLabel,{htmlFor:Y,$disabled:m,$inputHint:!!te,$labelInline:P,$labelSpacing:P?_:void 0,$required:H,$size:v,id:Z.current,children:S}),te&&e.jsx(s.HintText,{"data-element":"input-hint",id:ee.current,isLarge:"large"===v,marginTop:"2px",children:te})]}),e.jsxs(o.StyledSwitchRow,{$size:v,$processingLabelBelowSwitch:x&&$,children:[e.jsxs(o.StyledSwitchTrack,{"data-role":"switch-track",$checked:p,$disabled:m,$size:v,$loading:x,$disableTransitions:!!G,children:[e.jsx(o.StyledSwitchInput,{ref:u,type:"checkbox",role:"switch",id:Y,name:g,value:j,checked:p,disabled:m||x,autoFocus:w,"aria-checked":p,onChange:b,onBlur:h,onFocus:f,"aria-describedby":te?ee.current:void 0,required:H}),x?e.jsx(o.StyledSwitchLoaderWrapper,{"data-role":"switch-loader-wrapper",$checked:p,$size:v,$disableTransitions:!!G,children:e.jsx(a.Loader,{"data-role":"switch-loader",loaderType:"ring",size:"large"===v?"small":"extra-small",showLabel:!1,inverse:p})}):e.jsx(o.StyledSwitchThumb,{"data-role":"switch-thumb",$checked:p,$disabled:m,$size:v,$disableTransitions:!!G})]}),x?e.jsx(o.StyledSwitchProcessingRow,{$below:$,"data-role":"switch-processing-row",children:e.jsx(o.StyledSwitchProcessingText,{$size:v,children:V})}):e.jsx(o.StyledSwitchStateText,{"aria-hidden":!0,$disabled:m,$size:v,children:p?K:U})]}),I&&e.jsx(s.HintText,{marginTop:"8px","data-element":"field-help",isLarge:"large"===v,children:I})]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le}));u.displayName="Switch",exports.Switch=u,exports.SwitchComponent=u,exports.default=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalContentEditable"),i=require("react"),t=require("./content-editor.style.js");require("../../__plugins__/AutoLinker/auto-link.component.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/link"),require("@lexical/headless"),require("@lexical/html"),require("lexical"),require("@lexical/code"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("../../../text-editor.context.js");var n=require("../../__plugins__/useCursorAtEnd/index.js");require("../CharacterCounter/character-counter.style.js"),require("lodash/debounce"),require("../../../../../__internal__/i18n-context/index.js");var o=require("../LinkPreviewer/link-previewer.component.js");require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("../Mentions/constants.js"),require("../Mentions/mentions.style.js"),require("../../../../tooltip/tooltip.component.js"),require("../../../../portrait/portrait.style.js"),require("../../../../../style/utils/filter-styled-system-padding-props.js"),require("../Placeholder/placeholder.style.js"),require("@lexical/utils"),require("../Toolbar/toolbar.style.js"),require("../../../../button/button.component.js"),require("../../../../box/box.component.js"),require("../Toolbar/buttons/typography-dropdown/dropdown.style.js"),require("../../../../icon/icon.component.js"),require("../Toolbar/button-group/button-group.style.js"),require("../../../../../__internal__/form-field/form-field.component.js"),require("../../../../../__internal__/hint-text/hint-text.style.js"),require("../../../../carbon-provider/__internal__/new-validation.context.js"),require("../../../../../__internal__/input/input.component.js"),require("../../../../../__internal__/input/input-presentation.style.js"),require("../../../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),require("invariant"),require("../../../../../__internal__/validations/validation-icon.style.js"),require("../../../../../__internal__/validation-message/validation-message.style.js"),require("../../../../numeral-date/__internal__/numeral-date.context.js"),require("../../../../../__internal__/character-count/character-count.style.js"),require("../../../../textbox/textbox.style.js"),require("../../../../textbox/__internal__/prefix.style.js"),require("../../../../dialog/dialog.style.js"),require("../../../../heading/heading.style.js"),require("../../../../icon-button/icon-button.component.js"),require("../../../../typography/typography.component.js"),require("react-transition-group"),require("../../../../../hooks/__internal__/useScrollBlock/useScrollBlock.js"),require("../../../../portal/portal.js"),require("../../../../../__internal__/modal/modal-manager.js"),require("../../../../../__internal__/modal/modal.style.js"),require("../../../../../__internal__/modal/modal.context.js"),require("../../../../carbon-provider/__internal__/top-modal.context.js"),require("../../../../../__internal__/full-screen-heading/full-screen-heading.component.js"),require("../../../../form/form.component.js"),require("../../../../form/required-fields-indicator/required-fields-indicator.component.js");const a=i.forwardRef((({inputHint:i,namespace:a,previews:l=[],rows:s,readOnly:u,required:c,error:d,warning:_,validationMessagePositionTop:q,size:p="medium",id:j},m)=>{const x=n.default(),y=d||_?`${a}-validation-message`:"",b=i?`${a}-input-hint`:"",g=(q?`${y} ${b}`:`${b} ${y}`).trim();return e.jsxs(t.default,{"data-role":`${a}-content-editable`,error:d,warning:_,namespace:a,rows:s,readOnly:u,size:p,children:[e.jsx(r.ContentEditable,{id:j,ref:m,"aria-describedby":g,"aria-labelledby":`${a}-label`,"aria-required":c,"aria-invalid":d,className:`${a}-editable`,"data-role":`${a}-editable`,onBlur:e=>{var r;if(null===(r=e.relatedTarget)||void 0===r?void 0:r.classList.contains("toolbar-button")){var i;const r=null===(i=e.relatedTarget)||void 0===i?void 0:i.id;if(r){const e=document.querySelector(`[id="${r}"]`);e&&e.focus()}}},onFocus:e=>{e.relatedTarget&&e.relatedTarget.classList.contains("toolbar-button")||x(e)},"aria-autocomplete":void 0,"aria-readonly":void 0}),e.jsx(o.default,{previews:l})]})}));exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalContentEditable"),t=require("react"),i=require("./content-editor.style.js");require("../../__plugins__/AutoLinker/auto-link.component.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/link"),require("@lexical/headless"),require("@lexical/html"),require("lexical"),require("@lexical/code"),require("@lexical/list"),require("@lexical/react/LexicalHorizontalRuleNode"),require("@lexical/rich-text"),require("../../../text-editor.context.js");var o=require("../../__plugins__/useCursorAtEnd/index.js");require("../CharacterCounter/character-counter.style.js"),require("lodash/debounce"),require("../../../../../__internal__/i18n-context/index.js");var n=require("../LinkPreviewer/link-previewer.component.js");require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("../Mentions/constants.js"),require("../Mentions/mentions.style.js"),require("../../../../tooltip/tooltip.component.js"),require("../../../../portrait/portrait.style.js"),require("../../../../../style/utils/filter-styled-system-padding-props.js"),require("../Placeholder/placeholder.style.js"),require("@lexical/utils"),require("../Toolbar/toolbar.style.js"),require("../../../../button/button.component.js"),require("../../../../box/box.component.js"),require("../Toolbar/buttons/typography-dropdown/dropdown.style.js"),require("../../../../icon/icon.component.js"),require("../Toolbar/button-group/button-group.style.js"),require("../../../../../__internal__/input/input.style.js"),require("../../../../../__internal__/validation-message/__next__/validation-message.style.js"),require("../../../../../__internal__/error-border/error-border.style.js"),require("../../../../textbox/__internal__/__next__/text-input.style.js"),require("../../../../../__internal__/hint-text/hint-text.style.js"),require("../../../../../__internal__/label/label.style.js"),require("../../../../tabs/__next__/tabs.style.js"),require("../../../../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),require("invariant"),require("../../../../../__internal__/validations/validation-icon.style.js"),require("../../../../../__internal__/character-count/character-count.style.js"),require("../../../../dialog/dialog.style.js"),require("../../../../heading/heading.style.js"),require("../../../../icon-button/icon-button.component.js"),require("../../../../typography/typography.component.js"),require("react-transition-group"),require("../../../../../hooks/__internal__/useScrollBlock/useScrollBlock.js"),require("../../../../portal/portal.js"),require("../../../../../__internal__/modal/modal-manager.js"),require("../../../../../__internal__/modal/modal.style.js"),require("../../../../../__internal__/modal/modal.context.js"),require("../../../../carbon-provider/__internal__/top-modal.context.js"),require("../../../../../__internal__/full-screen-heading/full-screen-heading.component.js"),require("../../../../form/form.component.js"),require("../../../../form/required-fields-indicator/required-fields-indicator.component.js");const a=t.forwardRef((({inputHint:t,namespace:a,previews:l=[],rows:s,readOnly:u,required:c,error:d,warning:_,validationMessagePositionTop:q,size:p="medium",id:j},x)=>{const m=o.default(),y=d||_?`${a}-validation-message`:"",b=t?`${a}-input-hint`:"",g=(q?`${y} ${b}`:`${b} ${y}`).trim();return e.jsxs(i.default,{"data-role":`${a}-content-editable`,error:d,warning:_,namespace:a,rows:s,readOnly:u,size:p,children:[e.jsx(r.ContentEditable,{id:j,ref:x,"aria-describedby":g,"aria-labelledby":`${a}-label`,"aria-required":c,"aria-invalid":d,className:`${a}-editable`,"data-role":`${a}-editable`,onBlur:e=>{var r;if(null===(r=e.relatedTarget)||void 0===r?void 0:r.classList.contains("toolbar-button")){var t;const r=null===(t=e.relatedTarget)||void 0===t?void 0:t.id;if(r){const e=document.querySelector(`[id="${r}"]`);e&&e.focus()}}},onFocus:e=>{e.relatedTarget&&e.relatedTarget.classList.contains("toolbar-button")||m(e)},"aria-autocomplete":void 0,"aria-readonly":void 0}),e.jsx(n.default,{previews:l})]})}));exports.default=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalComposer"),t=require("@lexical/react/LexicalClickableLinkPlugin"),n=require("@lexical/react/LexicalErrorBoundary"),i=require("@lexical/react/LexicalHistoryPlugin"),a=require("@lexical/react/LexicalMarkdownShortcutPlugin"),l=require("@lexical/react/LexicalRichTextPlugin"),o=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalOnChangePlugin"),d=require("./__internal__/__providers__/plugin-provider.js"),c=require("lexical"),_=require("react"),p=require("../../__internal__/label/label.component.js"),g=require("../../hooks/__internal__/useLocale/useLocale.js"),x=require("../../__internal__/utils/logger/index.js"),m=require("./__internal__/__utils__/constants.js"),j=require("./__internal__/__plugins__/AutoLinker/auto-link.component.js"),f=require("./__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js"),v=require("./__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js");require("./__internal__/__plugins__/useCursorAtEnd/index.js");var h=require("./__internal__/__plugins__/FormSubmission/form-submission.plugin.js"),b=require("./text-editor.context.js"),y=require("./text-editor.style.js"),q=require("./__internal__/__utils__/helpers.js"),P=require("../../__internal__/hint-text/hint-text.component.js"),w=require("../../__internal__/validation-message/validation-message.component.js"),O=require("../textbox/textbox.style.js");require("../../style/utils/filter-styled-system-padding-props.js");var E=require("../../style/utils/filter-styled-system-margin-props.js"),L=require("../../__internal__/utils/helpers/tags/tags.js"),S=require("./__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.js"),C=require("./__internal__/__utils__/theme.js"),T=require("./__internal__/__ui__/CharacterCounter/character-counter.component.js"),k=require("./__internal__/__ui__/ContentEditor/content-editor.component.js");require("./__internal__/__ui__/LinkPreviewer/link-previewer.style.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("./__internal__/__ui__/Mentions/constants.js"),require("./__internal__/__ui__/Mentions/mentions.style.js"),require("../tooltip/tooltip.component.js"),require("../portrait/portrait.style.js");var M=require("./__internal__/__ui__/Placeholder/placeholder.component.js"),F=require("./__internal__/__ui__/Toolbar/toolbar.component.js");function $(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function R(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){$(e,r,t[r])}))}return e}let H=!1,B=!1,z=!1;const A=_.forwardRef((($,A)=>{var D,I,W,{characterLimit:N=3e3,error:V,footer:U,header:K,inputHint:X,labelText:G,namespace:J=m.COMPONENT_PREFIX,id:Q,onBlur:Y,onCancel:Z,onChange:ee,onFocus:re,onLinkAdded:te,onSave:ne,onFormSubmission:ie,placeholder:ae,previews:le=[],readOnly:oe=!1,required:se=!1,rows:ue,size:de="medium",warning:ce,customPlugins:_e,validationMessagePositionTop:pe=!1,toolbarControls:ge}=$,xe=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}($,["characterLimit","error","footer","header","inputHint","labelText","namespace","id","onBlur","onCancel","onChange","onFocus","onLinkAdded","onSave","onFormSubmission","placeholder","previews","readOnly","required","rows","size","warning","customPlugins","validationMessagePositionTop","toolbarControls"]);!H&&xe.value&&(H=!0,x.default.deprecate("`value` is deprecated in TextEditor and support will soon be removed. Please use `initialValue` instead.")),!B&&Z&&(B=!0,x.default.deprecate("`onCancel` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the cancel functionality.")),!z&&ne&&(z=!0,x.default.deprecate("`onSave` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the save functionality."));const me=_.useRef(null!==(W=null!==(I=xe.initialValue)&&void 0!==I?I:xe.value)&&void 0!==W?W:q.createEmpty()),je=g.default(),[fe,ve]=_.useState(void 0),he=_.useRef(null),[be,ye]=_.useState(null),[qe,Pe]=_.useState(!1);_.useImperativeHandle(A,(()=>({focus(){var e;null===(e=he.current)||void 0===e||e.focus()}})),[]),_.useEffect((()=>{const e=null==he?void 0:he.current,r=()=>{Pe(!0)},t=()=>{Pe(!1)};return null==e||e.addEventListener("focus",r),null==e||e.addEventListener("blur",t),()=>{null==e||e.removeEventListener("focus",r),null==e||e.removeEventListener("blur",t)}}),[he]);const we=_.useMemo((()=>({namespace:J,nodes:m.MARKDOWN_NODES,onError:e=>x.default.error(e.message),theme:C.getTheme(),editorState:me.current,editable:!oe})),[J,oe]),Oe=_.useCallback(((e,r)=>{const t=e.read((()=>c.$getRoot().getChildren().map((e=>e.getTextContent())).join("\n\n")));if(ee){const e=q.SerializeLexical(r);null==ee||ee(t,e)}if(N>0){const e=N-t.length;ve(e<0?je.textEditor.characterLimit(Math.abs(e)):void 0)}}),[N,je.textEditor,ee]),Ee=_.useCallback((e=>{if(!e.isEditable())return;if(!Z)return;const r=e.parseEditorState(me.current);e.setEditorState(r),Z()}),[Z]),Le=_.useMemo((()=>({namespace:J,onCancel:Z?Ee:void 0,onSave:ne,toolbarControls:ge})),[Ee,J,Z,ne,ge]),Se=ce||fe,Ce=()=>{switch(de){case"large":return"var(--spacing150)";case"small":return"var(--spacing050)";default:return"var(--spacing100)"}};return e.jsx(y.StyledTextEditorWrapper,(Te=R({"data-role":`${J}-editor-wrapper`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||null==Y||Y(e)},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||null==re||re(e)}},E.default(xe),L.default("text-editor",xe)),ke={children:e.jsxs(b.default.Provider,{value:{onLinkAdded:te},children:[e.jsx(p.default,{onClick:()=>{var e;return null===(e=he.current)||void 0===e?void 0:e.focus()},isRequired:se,labelId:`${J}-label`,children:G}),X&&!oe&&e.jsx(P.HintText,{id:`${J}-input-hint`,marginBottom:Ce(),children:X}),e.jsx(r.LexicalComposer,{initialConfig:we,children:e.jsxs(y.StyledWrapper,{"data-role":`${J}-wrapper`,ref:ye,children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),e.jsxs(y.StyledEditorToolbarWrapper,{"data-role":`${J}-editor-toolbar-wrapper`,error:!!V,id:`${J}-editor-toolbar-wrapper`,children:[K&&e.jsx(y.StyledHeaderWrapper,{"data-role":`${J}-header-wrapper`,children:K}),oe?e.jsx(S.default,{"aria-label":G,initialValue:(null===(D=he.current)||void 0===D?void 0:D.innerHTML)||me.current,size:de}):e.jsxs(e.Fragment,{children:[e.jsx(F.default,R({contentEditorRef:he,hasHeader:Boolean(K),size:de},Le)),e.jsxs(y.StyledTextEditor,{"data-role":`${J}-editor`,error:!!V,children:[e.jsx(l.RichTextPlugin,{contentEditable:e.jsx(k.default,{id:Q,ref:he,inputHint:X,isFocused:qe,namespace:J,previews:le,rows:ue,readOnly:oe,required:se,error:!!V,warning:!!ce||!!fe,validationMessagePositionTop:pe,size:de}),placeholder:e.jsx(M.default,{namespace:J,text:ae}),ErrorBoundary:n.LexicalErrorBoundary}),e.jsx(s.ListPlugin,{}),e.jsx(i.HistoryPlugin,{}),e.jsx(a.MarkdownShortcutPlugin,{}),e.jsx(u.OnChangePlugin,{onChange:Oe,ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0}),e.jsx(o.LinkPlugin,{validateUrl:q.validateUrl}),e.jsx(t.ClickableLinkPlugin,{newTab:!0}),e.jsx(j.default,{}),e.jsx(v.default,{}),e.jsx(h.FormSubmissionPlugin,{onFormSubmission:ie}),e.jsx(d.PluginProvider,{parentRef:be,children:_e})]})]}),U&&e.jsx(y.StyledFooterWrapper,{"data-role":`${J}-footer-wrapper`,size:de,children:U}),e.jsx(f.default,{})]}),!pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),N>0&&!oe&&e.jsx(T.default,{isFocused:qe,maxChars:N,namespace:J,marginTop:Ce()})]})})]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Te,Object.getOwnPropertyDescriptors(ke)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(ke)).forEach((function(e){Object.defineProperty(Te,e,Object.getOwnPropertyDescriptor(ke,e))})),Te));var Te,ke}));exports.TextEditor=A,exports.default=A;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@lexical/react/LexicalComposer"),t=require("@lexical/react/LexicalClickableLinkPlugin"),n=require("@lexical/react/LexicalErrorBoundary"),i=require("@lexical/react/LexicalHistoryPlugin"),a=require("@lexical/react/LexicalMarkdownShortcutPlugin"),l=require("@lexical/react/LexicalRichTextPlugin"),o=require("@lexical/react/LexicalLinkPlugin"),s=require("@lexical/react/LexicalListPlugin"),u=require("@lexical/react/LexicalOnChangePlugin"),d=require("./__internal__/__providers__/plugin-provider.js"),c=require("lexical"),_=require("react"),p=require("../../__internal__/legacy-label/label.component.js"),g=require("../../hooks/__internal__/useLocale/useLocale.js"),x=require("../../__internal__/utils/logger/index.js"),m=require("./__internal__/__utils__/constants.js"),j=require("./__internal__/__plugins__/AutoLinker/auto-link.component.js"),f=require("./__internal__/__plugins__/LinkMonitor/link-monitor.plugin.js"),v=require("./__internal__/__plugins__/StyledSpanEnter/styled-span-enter.plugin.js");require("./__internal__/__plugins__/useCursorAtEnd/index.js");var h=require("./__internal__/__plugins__/FormSubmission/form-submission.plugin.js"),b=require("./text-editor.context.js"),y=require("./text-editor.style.js"),q=require("./__internal__/__utils__/helpers.js"),P=require("../../__internal__/legacy-hint-text/hint-text.component.js"),w=require("../../__internal__/validation-message/validation-message.component.js"),O=require("../../__internal__/legacy-error-border/error-border.style.js");require("../../style/utils/filter-styled-system-padding-props.js");var E=require("../../style/utils/filter-styled-system-margin-props.js"),L=require("../../__internal__/utils/helpers/tags/tags.js"),S=require("./__internal__/__ui__/ReadOnlyEditor/read-only-rte.component.js"),C=require("./__internal__/__utils__/theme.js"),T=require("./__internal__/__ui__/CharacterCounter/character-counter.component.js"),k=require("./__internal__/__ui__/ContentEditor/content-editor.component.js");require("./__internal__/__ui__/LinkPreviewer/link-previewer.style.js"),require("@lexical/react/LexicalComposerContext"),require("@lexical/react/LexicalTypeaheadMenuPlugin"),require("react-dom"),require("./__internal__/__ui__/Mentions/constants.js"),require("./__internal__/__ui__/Mentions/mentions.style.js"),require("../tooltip/tooltip.component.js"),require("../portrait/portrait.style.js");var M=require("./__internal__/__ui__/Placeholder/placeholder.component.js"),F=require("./__internal__/__ui__/Toolbar/toolbar.component.js");function $(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function R(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){$(e,r,t[r])}))}return e}let H=!1,B=!1,z=!1;const A=_.forwardRef((($,A)=>{var D,I,W,{characterLimit:N=3e3,error:V,footer:U,header:K,inputHint:X,labelText:G,namespace:J=m.COMPONENT_PREFIX,id:Q,onBlur:Y,onCancel:Z,onChange:ee,onFocus:re,onLinkAdded:te,onSave:ne,onFormSubmission:ie,placeholder:ae,previews:le=[],readOnly:oe=!1,required:se=!1,rows:ue,size:de="medium",warning:ce,customPlugins:_e,validationMessagePositionTop:pe=!1,toolbarControls:ge}=$,xe=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}($,["characterLimit","error","footer","header","inputHint","labelText","namespace","id","onBlur","onCancel","onChange","onFocus","onLinkAdded","onSave","onFormSubmission","placeholder","previews","readOnly","required","rows","size","warning","customPlugins","validationMessagePositionTop","toolbarControls"]);!H&&xe.value&&(H=!0,x.default.deprecate("`value` is deprecated in TextEditor and support will soon be removed. Please use `initialValue` instead.")),!B&&Z&&(B=!0,x.default.deprecate("`onCancel` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the cancel functionality.")),!z&&ne&&(z=!0,x.default.deprecate("`onSave` is deprecated in TextEditor and support will soon be removed. Please ensure that `TextEditor` is used as a part of a `Form` component, which will handle the save functionality."));const me=_.useRef(null!==(W=null!==(I=xe.initialValue)&&void 0!==I?I:xe.value)&&void 0!==W?W:q.createEmpty()),je=g.default(),[fe,ve]=_.useState(void 0),he=_.useRef(null),[be,ye]=_.useState(null),[qe,Pe]=_.useState(!1);_.useImperativeHandle(A,(()=>({focus(){var e;null===(e=he.current)||void 0===e||e.focus()}})),[]),_.useEffect((()=>{const e=null==he?void 0:he.current,r=()=>{Pe(!0)},t=()=>{Pe(!1)};return null==e||e.addEventListener("focus",r),null==e||e.addEventListener("blur",t),()=>{null==e||e.removeEventListener("focus",r),null==e||e.removeEventListener("blur",t)}}),[he]);const we=_.useMemo((()=>({namespace:J,nodes:m.MARKDOWN_NODES,onError:e=>x.default.error(e.message),theme:C.getTheme(),editorState:me.current,editable:!oe})),[J,oe]),Oe=_.useCallback(((e,r)=>{const t=e.read((()=>c.$getRoot().getChildren().map((e=>e.getTextContent())).join("\n\n")));if(ee){const e=q.SerializeLexical(r);null==ee||ee(t,e)}if(N>0){const e=N-t.length;ve(e<0?je.textEditor.characterLimit(Math.abs(e)):void 0)}}),[N,je.textEditor,ee]),Ee=_.useCallback((e=>{if(!e.isEditable())return;if(!Z)return;const r=e.parseEditorState(me.current);e.setEditorState(r),Z()}),[Z]),Le=_.useMemo((()=>({namespace:J,onCancel:Z?Ee:void 0,onSave:ne,toolbarControls:ge})),[Ee,J,Z,ne,ge]),Se=ce||fe,Ce=()=>{switch(de){case"large":return"var(--spacing150)";case"small":return"var(--spacing050)";default:return"var(--spacing100)"}};return e.jsx(y.StyledTextEditorWrapper,(Te=R({"data-role":`${J}-editor-wrapper`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||null==Y||Y(e)},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||null==re||re(e)}},E.default(xe),L.default("text-editor",xe)),ke={children:e.jsxs(b.default.Provider,{value:{onLinkAdded:te},children:[e.jsx(p.default,{onClick:()=>{var e;return null===(e=he.current)||void 0===e?void 0:e.focus()},isRequired:se,labelId:`${J}-label`,children:G}),X&&!oe&&e.jsx(P.HintText,{id:`${J}-input-hint`,marginBottom:Ce(),children:X}),e.jsx(r.LexicalComposer,{initialConfig:we,children:e.jsxs(y.StyledWrapper,{"data-role":`${J}-wrapper`,ref:ye,children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),e.jsxs(y.StyledEditorToolbarWrapper,{"data-role":`${J}-editor-toolbar-wrapper`,error:!!V,id:`${J}-editor-toolbar-wrapper`,children:[K&&e.jsx(y.StyledHeaderWrapper,{"data-role":`${J}-header-wrapper`,children:K}),oe?e.jsx(S.default,{"aria-label":G,initialValue:(null===(D=he.current)||void 0===D?void 0:D.innerHTML)||me.current,size:de}):e.jsxs(e.Fragment,{children:[e.jsx(F.default,R({contentEditorRef:he,hasHeader:Boolean(K),size:de},Le)),e.jsxs(y.StyledTextEditor,{"data-role":`${J}-editor`,error:!!V,children:[e.jsx(l.RichTextPlugin,{contentEditable:e.jsx(k.default,{id:Q,ref:he,inputHint:X,isFocused:qe,namespace:J,previews:le,rows:ue,readOnly:oe,required:se,error:!!V,warning:!!ce||!!fe,validationMessagePositionTop:pe,size:de}),placeholder:e.jsx(M.default,{namespace:J,text:ae}),ErrorBoundary:n.LexicalErrorBoundary}),e.jsx(s.ListPlugin,{}),e.jsx(i.HistoryPlugin,{}),e.jsx(a.MarkdownShortcutPlugin,{}),e.jsx(u.OnChangePlugin,{onChange:Oe,ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0}),e.jsx(o.LinkPlugin,{validateUrl:q.validateUrl}),e.jsx(t.ClickableLinkPlugin,{newTab:!0}),e.jsx(j.default,{}),e.jsx(v.default,{}),e.jsx(h.FormSubmissionPlugin,{onFormSubmission:ie}),e.jsx(d.PluginProvider,{parentRef:be,children:_e})]})]}),U&&e.jsx(y.StyledFooterWrapper,{"data-role":`${J}-footer-wrapper`,size:de,children:U}),e.jsx(f.default,{})]}),!pe&&e.jsxs(e.Fragment,{children:[e.jsx(w.default,{error:V,warning:Se,validationId:`${J}-validation-message`,"data-role":`${J}-validation-message`,validationMessagePositionTop:pe}),(V||Se)&&e.jsx(O.default,{warning:!(V||!Se)})]}),N>0&&!oe&&e.jsx(T.default,{isFocused:qe,maxChars:N,namespace:J,marginTop:Ce()})]})})]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Te,Object.getOwnPropertyDescriptors(ke)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(ke)).forEach((function(e){Object.defineProperty(Te,e,Object.getOwnPropertyDescriptor(ke,e))})),Te));var Te,ke}));exports.TextEditor=A,exports.default=A;
@@ -3,14 +3,16 @@ import { MarginProps } from "styled-system";
3
3
  import { IconType } from "../icon";
4
4
  import { ValidationProps } from "../../__internal__/validations";
5
5
  import { TagProps } from "../../__internal__/utils/helpers/tags";
6
- import { CommonInputProps } from "../../__internal__/input";
6
+ import { CommonInputProps } from "../../__internal__/legacy-input";
7
7
  import { BorderRadiusType } from "../box/box.component";
8
8
  export interface TextareaProps extends ValidationProps, MarginProps, Omit<CommonInputProps, "size">, TagProps {
9
9
  /** Prop to specify the aria-labelledby property of the component */
10
10
  "aria-labelledby"?: string;
11
11
  /** id of the input */
12
12
  id?: string;
13
- /** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
13
+ /**
14
+ * Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set
15
+ **/
14
16
  adaptiveLabelBreakpoint?: number;
15
17
  /** Automatically focus the input on component mount */
16
18
  autoFocus?: boolean;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../__internal__/utils/helpers/tags/tags.js"),n=require("../../__internal__/input/input.component.js"),r=require("../../__internal__/input/input-presentation.component.js"),l=require("../../__internal__/form-field/form-field.component.js"),a=require("../../hooks/useCharacterCount/useCharacterCount.js"),o=require("../../__internal__/input-behaviour/input-behaviour.component.js"),d=require("../../__internal__/input-icon-toggle/input-icon-toggle.component.js"),s=require("../../__internal__/utils/helpers/guid/index.js"),u=require("./textarea.style.js"),c=require("../../__internal__/tooltip-provider/index.js"),p=require("../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),b=require("../carbon-provider/__internal__/new-validation.context.js"),f=require("../textbox/textbox.style.js"),h=require("../../__internal__/validation-message/validation-message.component.js"),v=require("../box/box.component.js"),g=require("../../__internal__/utils/logger/index.js"),_=require("../../__internal__/hint-text/hint-text.component.js");require("../../style/utils/filter-styled-system-padding-props.js");var y=require("../../style/utils/filter-styled-system-margin-props.js");function j(e){return e&&e.__esModule?e:{default:e}}function m(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable})))),n.forEach((function(t){m(e,t,i[t])}))}return e}let O=!1,I=!1;const w=j(t).default.forwardRef(((j,m)=>{var{"aria-labelledby":w,"aria-describedby":H,autoFocus:q,inputHint:T,fieldHelp:P,label:E,children:L,characterLimit:A,onChange:B,onFocus:R,onBlur:F,disabled:M=!1,labelInline:S,labelAlign:k,labelHelp:C,labelSpacing:D,inputIcon:W,id:N,error:G,warning:U,info:z,name:V,readOnly:$=!1,placeholder:J,expandable:K=!1,rows:Q,validationOnLabel:X=!1,adaptiveLabelBreakpoint:Y,inputWidth:Z,maxWidth:ee,labelWidth:te=30,tooltipPosition:ie,value:ne,"data-element":re,"data-role":le,helpAriaLabel:ae,borderRadius:oe,hideBorders:de=!1,required:se,isOptional:ue,minHeight:ce=u.DEFAULT_MIN_HEIGHT,validationMessagePositionTop:pe=!0}=j,be=function(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},l=Object.keys(e);for(n=0;n<l.length;n++)i=l[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)i=l[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}(j,["aria-labelledby","aria-describedby","autoFocus","inputHint","fieldHelp","label","children","characterLimit","onChange","onFocus","onBlur","disabled","labelInline","labelAlign","labelHelp","labelSpacing","inputIcon","id","error","warning","info","name","readOnly","placeholder","expandable","rows","validationOnLabel","adaptiveLabelBreakpoint","inputWidth","maxWidth","labelWidth","tooltipPosition","value","data-element","data-role","helpAriaLabel","borderRadius","hideBorders","required","isOptional","minHeight","validationMessagePositionTop"]);!O&&ue&&(O=!0,g.default.deprecate("`isOptional` is deprecated in TextArea and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead."));const{validationRedesignOptIn:fe}=t.useContext(b.default),he=!fe&&S,[ve,ge]=t.useState(u.DEFAULT_MIN_HEIGHT),_e=e=>fe?void 0:e,{current:ye}=t.useRef(N||s.default()),je=t.useRef(null),me=t.useCallback((e=>{je.current=e,m&&("current"in m?m.current=e:m(e))}),[m]),[xe,Oe]=t.useState("off");Array.isArray(oe)&&oe.length>4&&!I&&(g.default.warn("The `borderRadius` prop in `Textarea` component only supports up to 4 values."),I=!0);const Ie=t.useCallback((()=>{const e=je.current;if((null==e?void 0:e.scrollHeight)&&(null==e?void 0:e.scrollHeight)>ve){let t=e;for(;t&&!(null==t?void 0:t.scrollTop);)t=(null==t?void 0:t.parentElement)||null;const i=null==t?void 0:t.scrollTop;e.style.height="auto",e.style.height=`${Math.max(e.scrollHeight,ve)}px`,t&&i&&(t.scrollTop=i)}}),[ve]),{labelId:we,validationId:He,fieldHelpId:qe,ariaDescribedBy:Te}=p.default({id:ye,validationRedesignOptIn:fe,error:G,warning:U,info:z,label:E,fieldHelp:P}),[Pe,Ee]=a.default(ne,A,xe);t.useEffect((()=>{var e;ge(Q?(null==je||null===(e=je.current)||void 0===e?void 0:e.scrollHeight)||0:ce>u.DEFAULT_MIN_HEIGHT?ce:u.DEFAULT_MIN_HEIGHT)}),[ce,Q]),t.useEffect((()=>{K&&Ie()})),t.useEffect((()=>{var e,t;return K&&(window.addEventListener("resize",Ie),ge((null==je||null===(e=je.current)||void 0===e?void 0:e.clientHeight)||0),null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",Ie)),()=>{var e;K&&(window.removeEventListener("resize",Ie),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",Ie))}}),[Ie,K]);const Le=!!(W||He&&!X),Ae=t.useRef(s.default()),Be=T?Ae.current:void 0,Re=[...fe&&pe?[Te,Be]:[Be,Te],Ee,H].filter(Boolean).join(" "),Fe=e.jsxs(r.default,{disabled:M,readOnly:$,inputWidth:"number"==typeof Z?Z:100-te,maxWidth:ee,error:G,warning:U,info:z,borderRadius:oe,hideBorders:de,children:[e.jsx(n.default,x({"aria-invalid":!!G,"aria-labelledby":w,"aria-describedby":Re,autoFocus:q,name:V,value:ne,ref:me,onChange:B,onFocus:e=>{A&&Oe("polite"),null==R||R(e)},onBlur:e=>{A&&Oe("off"),null==F||F(e)},disabled:M,readOnly:$,placeholder:M?"":J,rows:Q,id:ye,as:"textarea",validationIconId:fe?void 0:He,inputBorderRadius:oe,required:se},be)),L,e.jsx(d.default,{disabled:M,readOnly:$,inputIcon:W,error:G,warning:U,info:z,validationIconId:fe?void 0:He,useValidationIcon:!(fe||X)})]}),Me=y.default(be);return e.jsx(c.TooltipProvider,{tooltipPosition:ie,helpAriaLabel:ae,children:e.jsx(o.InputBehaviour,{children:e.jsx(u.default,(Se=x({labelInline:he,hasIcon:Le,minHeight:ve},Me,i.default("textarea",{"data-element":re,"data-role":le})),ke={children:e.jsxs(l.default,{fieldHelp:_e(P),fieldHelpId:qe,error:G,warning:U,info:z,label:E,labelId:we,disabled:M,id:ye,labelInline:_e(he),labelAlign:k,labelWidth:_e(te),labelHelp:_e(C),labelSpacing:D,isRequired:se,useValidationIcon:_e(X),adaptiveLabelBreakpoint:Y,validationRedesignOptIn:fe,my:0,children:[(T||C&&fe)&&e.jsx(_.HintText,{align:k,id:Be,"data-element":"input-hint",children:T||C}),fe?e.jsxs(v.Box,{position:"relative",children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(h.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]}),Fe,!pe&&e.jsxs(e.Fragment,{children:[e.jsx(h.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]})]}):Fe,Pe]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Se,Object.getOwnPropertyDescriptors(ke)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t}(Object(ke)).forEach((function(e){Object.defineProperty(Se,e,Object.getOwnPropertyDescriptor(ke,e))})),Se))})});var Se,ke}));w.displayName="Textarea",exports.OriginalTextarea=w,exports.Textarea=w,exports.default=w;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),i=require("../../__internal__/legacy-input/input.component.js"),n=require("../../__internal__/legacy-input/input-presentation.component.js"),l=require("../../__internal__/form-field/form-field.component.js"),a=require("../../hooks/useCharacterCount/useCharacterCount.js"),o=require("../../__internal__/input-behaviour/input-behaviour.component.js"),d=require("../../__internal__/input-icon-toggle/input-icon-toggle.component.js"),s=require("../../__internal__/utils/helpers/guid/index.js"),u=require("./textarea.style.js"),c=require("../../__internal__/tooltip-provider/index.js"),p=require("../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),b=require("../carbon-provider/__internal__/new-validation.context.js"),f=require("../../__internal__/legacy-error-border/error-border.style.js"),g=require("../../__internal__/validation-message/validation-message.component.js"),h=require("../box/box.component.js"),v=require("../../__internal__/utils/logger/index.js"),_=require("../../__internal__/legacy-hint-text/hint-text.component.js");require("../../style/utils/filter-styled-system-padding-props.js");var y=require("../../style/utils/filter-styled-system-margin-props.js");function j(e){return e&&e.__esModule?e:{default:e}}function m(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function x(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),i.forEach((function(r){m(e,r,t[r])}))}return e}let O=!1,I=!1;const w=j(r).default.forwardRef(((j,m)=>{var{"aria-labelledby":w,"aria-describedby":H,autoFocus:q,inputHint:T,fieldHelp:P,label:E,children:L,characterLimit:A,onChange:B,onFocus:R,onBlur:F,disabled:M=!1,labelInline:S,labelAlign:k,labelHelp:C,labelSpacing:D,inputIcon:W,id:N,error:G,warning:U,info:z,name:V,readOnly:$=!1,placeholder:J,expandable:K=!1,rows:Q,validationOnLabel:X=!1,adaptiveLabelBreakpoint:Y,inputWidth:Z,maxWidth:ee,labelWidth:re=30,tooltipPosition:te,value:ie,"data-element":ne,"data-role":le,helpAriaLabel:ae,borderRadius:oe,hideBorders:de=!1,required:se,isOptional:ue,minHeight:ce=u.DEFAULT_MIN_HEIGHT,validationMessagePositionTop:pe=!0}=j,be=function(e,r){if(null==e)return{};var t,i,n=function(e,r){if(null==e)return{};var t,i,n={},l=Object.keys(e);for(i=0;i<l.length;i++)t=l[i],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(i=0;i<l.length;i++)t=l[i],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(j,["aria-labelledby","aria-describedby","autoFocus","inputHint","fieldHelp","label","children","characterLimit","onChange","onFocus","onBlur","disabled","labelInline","labelAlign","labelHelp","labelSpacing","inputIcon","id","error","warning","info","name","readOnly","placeholder","expandable","rows","validationOnLabel","adaptiveLabelBreakpoint","inputWidth","maxWidth","labelWidth","tooltipPosition","value","data-element","data-role","helpAriaLabel","borderRadius","hideBorders","required","isOptional","minHeight","validationMessagePositionTop"]);!O&&ue&&(O=!0,v.default.deprecate("`isOptional` is deprecated in TextArea and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead."));const{validationRedesignOptIn:fe}=r.useContext(b.default),ge=!fe&&S,[he,ve]=r.useState(u.DEFAULT_MIN_HEIGHT),_e=e=>fe?void 0:e,{current:ye}=r.useRef(N||s.default()),je=r.useRef(null),me=r.useCallback((e=>{je.current=e,m&&("current"in m?m.current=e:m(e))}),[m]),[xe,Oe]=r.useState("off");Array.isArray(oe)&&oe.length>4&&!I&&(v.default.warn("The `borderRadius` prop in `Textarea` component only supports up to 4 values."),I=!0);const Ie=r.useCallback((()=>{const e=je.current;if((null==e?void 0:e.scrollHeight)&&(null==e?void 0:e.scrollHeight)>he){let r=e;for(;r&&!(null==r?void 0:r.scrollTop);)r=(null==r?void 0:r.parentElement)||null;const t=null==r?void 0:r.scrollTop;e.style.height="auto",e.style.height=`${Math.max(e.scrollHeight,he)}px`,r&&t&&(r.scrollTop=t)}}),[he]),{labelId:we,validationId:He,fieldHelpId:qe,ariaDescribedBy:Te}=p.default({id:ye,validationRedesignOptIn:fe,error:G,warning:U,info:z,label:E,fieldHelp:P}),[Pe,Ee]=a.default(ie,A,xe);r.useEffect((()=>{var e;ve(Q?(null==je||null===(e=je.current)||void 0===e?void 0:e.scrollHeight)||0:ce>u.DEFAULT_MIN_HEIGHT?ce:u.DEFAULT_MIN_HEIGHT)}),[ce,Q]),r.useEffect((()=>{K&&Ie()})),r.useEffect((()=>{var e,r;return K&&(window.addEventListener("resize",Ie),ve((null==je||null===(e=je.current)||void 0===e?void 0:e.clientHeight)||0),null===(r=document.fonts)||void 0===r||r.addEventListener("loadingdone",Ie)),()=>{var e;K&&(window.removeEventListener("resize",Ie),null===(e=document.fonts)||void 0===e||e.removeEventListener("loadingdone",Ie))}}),[Ie,K]);const Le=!!(W||He&&!X),Ae=r.useRef(s.default()),Be=T?Ae.current:void 0,Re=[...fe&&pe?[Te,Be]:[Be,Te],Ee,H].filter(Boolean).join(" "),Fe=e.jsxs(n.default,{disabled:M,readOnly:$,inputWidth:"number"==typeof Z?Z:100-re,maxWidth:ee,error:G,warning:U,info:z,borderRadius:oe,hideBorders:de,children:[e.jsx(i.default,x({"aria-invalid":!!G,"aria-labelledby":w,"aria-describedby":Re,autoFocus:q,name:V,value:ie,ref:me,onChange:B,onFocus:e=>{A&&Oe("polite"),null==R||R(e)},onBlur:e=>{A&&Oe("off"),null==F||F(e)},disabled:M,readOnly:$,placeholder:M?"":J,rows:Q,id:ye,as:"textarea",validationIconId:fe?void 0:He,inputBorderRadius:oe,required:se},be)),L,e.jsx(d.default,{disabled:M,readOnly:$,inputIcon:W,error:G,warning:U,info:z,validationIconId:fe?void 0:He,useValidationIcon:!(fe||X)})]}),Me=y.default(be);return e.jsx(c.TooltipProvider,{tooltipPosition:te,helpAriaLabel:ae,children:e.jsx(o.InputBehaviour,{children:e.jsx(u.default,(Se=x({labelInline:ge,hasIcon:Le,minHeight:he},Me,t.default("textarea",{"data-element":ne,"data-role":le})),ke={children:e.jsxs(l.default,{fieldHelp:_e(P),fieldHelpId:qe,error:G,warning:U,info:z,label:E,labelId:we,disabled:M,id:ye,labelInline:_e(ge),labelAlign:k,labelWidth:_e(re),labelHelp:_e(C),labelSpacing:D,isRequired:se,useValidationIcon:_e(X),adaptiveLabelBreakpoint:Y,validationRedesignOptIn:fe,my:0,children:[(T||C&&fe)&&e.jsx(_.HintText,{align:k,id:Be,"data-element":"input-hint",children:T||C}),fe?e.jsxs(h.Box,{position:"relative",children:[pe&&e.jsxs(e.Fragment,{children:[e.jsx(g.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]}),Fe,!pe&&e.jsxs(e.Fragment,{children:[e.jsx(g.default,{error:G,validationId:He,warning:U,validationMessagePositionTop:pe}),(G||U)&&e.jsx(f.default,{warning:!(G||!U)})]})]}):Fe,Pe]})},ke=null!=ke?ke:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Se,Object.getOwnPropertyDescriptors(ke)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(ke)).forEach((function(e){Object.defineProperty(Se,e,Object.getOwnPropertyDescriptor(ke,e))})),Se))})});var Se,ke}));w.displayName="Textarea",exports.OriginalTextarea=w,exports.Textarea=w,exports.default=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/input/input.style.js"),n=require("../../__internal__/label/label.style.js"),a=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),r=require("../../style/themes/apply-base-theme.js");function s(e){return e&&e.__esModule?e:{default:e}}const l=s(e).default.div.attrs(r.default).withConfig({displayName:"textarea.style__StyledTextarea",componentId:"sc-6686e23c-0"})(["margin-bottom:var(--fieldSpacing);",";","{box-sizing:border-box;resize:none;"," padding:var(--spacing150) var(--spacing200);","}"," ","{height:40px;position:absolute;height:100%;top:0px;right:4px;}"],t.margin,i.default,(({minHeight:e})=>`min-height: ${e||64}px;`),(({hasIcon:e})=>e&&"padding-right: var(--spacing500);"),(({labelInline:t})=>t&&e.css(["","{align-items:flex-start;padding-top:6px;}"],n.StyledLabelContainer)),a.default);exports.DEFAULT_MIN_HEIGHT=64,exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),i=require("../../__internal__/legacy-input/input.style.js"),a=require("../../__internal__/legacy-label/label.style.js"),n=require("../../__internal__/input-icon-toggle/input-icon-toggle.style.js"),r=require("../../style/themes/apply-base-theme.js");function l(e){return e&&e.__esModule?e:{default:e}}const s=l(e).default.div.attrs(r.default).withConfig({displayName:"textarea.style__StyledTextarea",componentId:"sc-4ae1af1-0"})(["margin-bottom:var(--fieldSpacing);",";","{box-sizing:border-box;resize:none;"," padding:var(--spacing150) var(--spacing200);","}"," ","{height:40px;position:absolute;height:100%;top:0px;right:4px;}"],t.margin,i.default,(({minHeight:e})=>`min-height: ${e||64}px;`),(({hasIcon:e})=>e&&"padding-right: var(--spacing500);"),(({labelInline:t})=>t&&e.css(["","{align-items:flex-start;padding-top:6px;}"],a.StyledLabelContainer)),n.default);exports.DEFAULT_MIN_HEIGHT=64,exports.default=s;
@@ -0,0 +1,2 @@
1
+ export { default } from "./text-input.component";
2
+ export type { TextInput, TextInputProps } from "./text-input.component";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./text-input.component.js");exports.default=e.TextInput;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/components/textbox/__internal__/__next__/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,91 @@
1
+ import React from "react";
2
+ import { MarginProps } from "styled-system";
3
+ import { InputProps } from "../../../../__internal__/input";
4
+ import { ValidationProps } from "../../../../__internal__/validations";
5
+ import { TagProps } from "../../../../__internal__/utils/helpers/tags";
6
+ export interface TextInputProps extends Omit<ValidationProps, "info">, MarginProps, Omit<InputProps, "size" | "error">, TagProps {
7
+ /**
8
+ * @private @internal @ignore
9
+ * Sets the input's text alignment. Does not affect the position of the input's prefix or suffix icons.
10
+ */
11
+ align?: "left" | "right";
12
+ /**
13
+ * The ID of the element(s) that describe the input, typically used to reference the hint and/or
14
+ * validation message(s) associated with the input. Can be a space-separated list of IDs if there
15
+ * are multiple descriptive elements.
16
+ */
17
+ "aria-describedby"?: string;
18
+ /**
19
+ * The ID of the element that labels the input, typically used to reference the input's label when
20
+ * the label is not properly associated with the input via the htmlFor attribute.
21
+ */
22
+ "aria-labelledby"?: string;
23
+ /**
24
+ * If true, the input will automatically receive focus when the component is mounted.
25
+ */
26
+ autoFocus?: boolean;
27
+ /**
28
+ * Unique identifier for the input.
29
+ * Label id will be based on it, using following pattern: [id]-label.
30
+ * Will use a randomly generated GUID if none is provided
31
+ */
32
+ /**
33
+ * @private @internal @ignore
34
+ * `data-component` attribute to be added to the component's root element for testing and tracking purposes.
35
+ */
36
+ "data-component"?: string;
37
+ /**
38
+ * @private @internal @ignore
39
+ * `data-is-open` attribute to be added to the component's root element when rendered as part of Select.
40
+ */
41
+ "data-is-open"?: boolean;
42
+ /**
43
+ * Sets the input's id attribute, is not set a unique id will be generated and used.
44
+ * The label's htmlFor attribute will be set to match the input's id to ensure they are properly associated.
45
+ */
46
+ id?: string;
47
+ /** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input */
48
+ inputHint?: string;
49
+ /**
50
+ * @internal @private @ignore
51
+ * An Icon to be rendered next to the input
52
+ * */
53
+ inputIcon?: React.ReactNode;
54
+ /** The width of the input as a percentage (e.g., 50 for 50%) */
55
+ inputWidth?: number;
56
+ /** Label content */
57
+ label: string;
58
+ /** When true label is inline */
59
+ labelInline?: boolean;
60
+ /**
61
+ * Slot to render additional content to the left of the input, such as a prefix.
62
+ */
63
+ leftChildren?: React.ReactNode;
64
+ /** The maximum width of the component container */
65
+ maxWidth?: string;
66
+ /**
67
+ * @param ev - React's mouse event for the input element
68
+ * Callback called when mouse is clicked down on the input, but before it receives focus.
69
+ */
70
+ onMouseDown?: (ev: React.MouseEvent<HTMLElement>) => void;
71
+ /**
72
+ * @param ev - React's mouse event for the input element
73
+ * Callback called when the input is clicked.
74
+ */
75
+ onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
76
+ /** Size of an input */
77
+ size?: "small" | "medium" | "large";
78
+ /**
79
+ * The type of the input, e.g., "text", "email", "password". This prop is passed directly
80
+ * to the underlying input element, so any valid HTML input type is accepted.
81
+ * The default value is "text".
82
+ */
83
+ type?: string;
84
+ /**
85
+ * @private @internal @ignore
86
+ * If true, the validation message will be rendered above the input, otherwise it will be rendered below.
87
+ */
88
+ validationMessagePositionTop?: boolean;
89
+ }
90
+ export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
91
+ export default TextInput;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../../../__internal__/input/input.component.js"),n=require("../../../../__internal__/validation-message/__next__/validation-message.component.js");require("../../../../style/utils/filter-styled-system-padding-props.js");var i=require("../../../../style/utils/filter-styled-system-margin-props.js"),l=require("../../../../style/utils/filter-out-styled-system-spacing-props.js"),a=require("../../../../hooks/__internal__/useUniqueId/index.js"),o=require("../../../../__internal__/utils/helpers/guid/index.js"),s=require("../../../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js"),u=require("../../../../__internal__/error-border/error-border.style.js"),d=require("./text-input.style.js"),c=require("../../../../__internal__/hint-text/hint-text.component.js"),p=require("../../../../__internal__/label/label.component.js"),b=require("../../../../hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js"),f=require("../../../../__internal__/utils/helpers/combine-refs/index.js"),y=require("../../../../__internal__/fieldset-validation-context/fieldset-validation-context.js");function _(e){return e&&e.__esModule?e:{default:e}}function j(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){j(e,r,t[r])}))}return e}function m(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const x=_(r).default.forwardRef(((_,j)=>{var{autoFocus:x,"aria-describedby":O,"aria-labelledby":g,children:v,"data-component":q="text-input","data-element":w,"data-is-open":I,"data-role":P,disabled:C,error:k,id:W,inputHint:$,inputIcon:z,inputWidth:T,label:D,labelInline:M=!1,leftChildren:R,maxWidth:S,name:E,onChange:F,onClick:B,onMouseDown:H,placeholder:V,prefix:A,readOnly:L,required:U,size:G="medium",type:J="text",validationMessagePositionTop:K,value:N,warning:Q}=_,X=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},l=Object.keys(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(_,["autoFocus","aria-describedby","aria-labelledby","children","data-component","data-element","data-is-open","data-role","disabled","error","id","inputHint","inputIcon","inputWidth","label","labelInline","leftChildren","maxWidth","name","onChange","onClick","onMouseDown","placeholder","prefix","readOnly","required","size","type","validationMessagePositionTop","value","warning"]);const Y=r.useRef(null),Z=f.default(j,Y),{disableErrorBorder:ee}=r.useContext(y.default),re={disabled:C,readOnly:L},[te,ne]=a.default(W,E),{labelId:ie,validationId:le,ariaDescribedBy:ae}=s.default({id:te,validationRedesignOptIn:!0,error:k,warning:Q,label:D}),oe=r.useRef(o.default()),se=$?oe.current:void 0,ue=null!=T?T:M?80:100,de=[se,ae,O].filter(Boolean).join(" "),ce=!(!k&&!Q);b.default(!!k,!!Q,te);const pe=ce&&!ee&&e.jsx(n.default,{id:le,size:G,error:k,warning:Q}),be=ce&&!ee&&e.jsx(u.default,{"data-role":"error-border",$warning:!(k||!Q)}),fe=r.useCallback((e=>{C||L||null==H||H(e)}),[H,C,L]),ye=r.useCallback((e=>{C||L||null==B||B(e)}),[B,C,L]);return e.jsxs(d.StyledTextInput,m(h({"data-element":w,"data-role":P,"data-component":q,$size:G,$labelInline:M,$hasValidationFailure:M&&ce},i.default(X)),{children:[D&&e.jsxs(d.LabelWrapper,{"data-role":"label-wrapper",$labelInline:M,$size:G,$labelWrapperWidth:M&&"number"==typeof ue?100-ue:void 0,children:[e.jsx(p.default,m(h({id:ie,htmlFor:te,size:G,isRequired:U},re),{children:D})),$&&e.jsx(c.HintText,m(h({id:se,size:G},re),{children:$}))]}),e.jsxs(d.InputWrapper,{"data-role":"input-wrapper",$size:G,$maxWidth:S,$inputWidth:T,onClick:()=>{var e;C||L||document.activeElement===Y.current||null===(e=Y.current)||void 0===e||e.focus()},"data-is-open":I,children:[K&&pe,e.jsx(t.default,m(h({id:te,name:ne,"aria-invalid":!!k,"aria-describedby":de,"aria-labelledby":g,value:N,placeholder:C||L?void 0:V,required:U,ref:Z,autoFocus:x,onMouseDown:fe,onClick:ye,onChange:F,error:!!k,inputIcon:z,size:G,prefix:A,leftChildren:R,type:J},re,l.default(X)),{children:v})),!K&&pe,be]})]}))}));exports.TextInput=x,exports.default=x;
@@ -0,0 +1,21 @@
1
+ interface StyledTextInputProps {
2
+ $labelInline?: boolean;
3
+ $size: "small" | "medium" | "large";
4
+ $hasValidationFailure?: boolean;
5
+ }
6
+ interface LabelWrapperProps {
7
+ $labelInline?: boolean;
8
+ $labelWrapperWidth?: number;
9
+ $size: "small" | "medium" | "large";
10
+ }
11
+ interface InputWrapperProps {
12
+ $size: "small" | "medium" | "large";
13
+ $maxWidth?: string;
14
+ $inputWidth?: number;
15
+ }
16
+ declare const StyledTextInput: import("styled-components").StyledComponent<"div", any, {
17
+ theme: object;
18
+ } & StyledTextInputProps, "theme">;
19
+ declare const LabelWrapper: import("styled-components").StyledComponent<"div", any, LabelWrapperProps, never>;
20
+ declare const InputWrapper: import("styled-components").StyledComponent<"div", any, InputWrapperProps, never>;
21
+ export { StyledTextInput, LabelWrapper, InputWrapper };
@@ -0,0 +1 @@
1
+ "use strict";var e=require("styled-components"),a=require("styled-system"),t=require("../../../../style/themes/apply-base-theme.js");function l(e){return e&&e.__esModule?e:{default:e}}var i=l(e);const s=i.default.div.attrs(t.default).withConfig({displayName:"text-input.style__StyledTextInput",componentId:"sc-bf599bd2-0"})(['[data-component="inline-inputs"] &,&[data-element="current-page"]{--fieldSpacing:0px;}margin-bottom:var(--fieldSpacing);'," display:flex;align-items:flex-start;flex-direction:",";gap:",";.time &{gap:unset;}.search &{flex:1 1 0%;}"],a.margin,(({$labelInline:e})=>e?"row":"column"),(({$labelInline:e,$size:a,$hasValidationFailure:t})=>{if(!e)switch(a){case"small":return"var(--global-space-comp-xs)";case"large":return"var(--global-space-comp-m)";default:return"var(--global-space-comp-s)"}return"large"===a?t?"var(--global-space-comp-l)":"var(--global-space-comp-m)":t?"var(--global-space-comp-l)":"var(--global-space-comp-s)"})),n=i.default.div.withConfig({displayName:"text-input.style__LabelWrapper",componentId:"sc-bf599bd2-1"})([""," display:flex;flex-direction:column;align-self:stretch;",""],(({$labelWrapperWidth:e})=>e&&`\n --label-spacing: ${e}%;\n\n [data-component="date-range"] & {\n --label-spacing: ${2*e}%;\n }\n `),(({$labelInline:a,$size:t})=>e.css([""," ",""],a&&e.css(["padding-top:var(--global-space-comp-",");justify-content:flex-start;align-items:flex-end;align-self:stretch;width:var(--label-spacing,auto);"],t.charAt(0)),!a&&e.css(["justify-content:flex-end;align-items:flex-start;"])))),p=i.default.div.withConfig({displayName:"text-input.style__InputWrapper",componentId:"sc-bf599bd2-2"})(["display:flex;flex-direction:column;position:relative;width:100%;min-width:0;gap:",";",' &[data-is-open="true"]{z-index:var(--adaptiveSidebarModalBackdrop,9999);}'],(({$size:e})=>"small"===e?"var(--global-space-comp-xs)":"var(--global-space-comp-s)"),(({$maxWidth:a,$inputWidth:t})=>e.css([""," width:",";"],a&&`max-width: ${a};`,t?`${t}%`:"100%")));exports.InputWrapper=p,exports.LabelWrapper=n,exports.StyledTextInput=s;
@@ -0,0 +1,81 @@
1
+ import { IconType } from "../../../icon";
2
+ export interface CommonTextInputArgs {
3
+ label: string;
4
+ placeholder: string;
5
+ inputIcon?: IconType;
6
+ }
7
+ export declare const getCommonTextInputArgsWithSpecialCharacters: (args: CommonTextInputArgs) => {
8
+ label: string;
9
+ placeholder: string;
10
+ inputIcon?: IconType;
11
+ };
12
+ export declare const getCommonTextInputArgs: (labelInlineDefault?: boolean) => {
13
+ disabled: boolean;
14
+ readOnly: boolean;
15
+ prefix: string;
16
+ label: string;
17
+ inputHint: string;
18
+ placeholder: string;
19
+ labelInline: boolean;
20
+ inputWidth: number;
21
+ size: string;
22
+ inputIcon: undefined;
23
+ required: boolean;
24
+ error: string;
25
+ warning: string;
26
+ };
27
+ export declare const commonTextInputArgTypes: () => {
28
+ disabled: {
29
+ control: {
30
+ type: string;
31
+ };
32
+ };
33
+ size: {
34
+ options: string[];
35
+ control: {
36
+ type: string;
37
+ };
38
+ };
39
+ inputIcon: {
40
+ options: string[];
41
+ control: {
42
+ type: string;
43
+ };
44
+ };
45
+ labelInline: {
46
+ control: {
47
+ type: string;
48
+ };
49
+ };
50
+ inputWidth: {
51
+ control: {
52
+ type: string;
53
+ min: number;
54
+ max: number;
55
+ step: number;
56
+ };
57
+ };
58
+ containerWidth: {
59
+ control: {
60
+ type: string;
61
+ min: number;
62
+ max: number;
63
+ step: number;
64
+ };
65
+ };
66
+ required: {
67
+ control: {
68
+ type: string;
69
+ };
70
+ };
71
+ error: {
72
+ control: {
73
+ type: string;
74
+ };
75
+ };
76
+ warning: {
77
+ control: {
78
+ type: string;
79
+ };
80
+ };
81
+ };
@@ -0,0 +1 @@
1
+ "use strict";var e=require("../../../icon/icon-config.js");function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}exports.commonTextInputArgTypes=()=>({disabled:{control:{type:"boolean"}},size:{options:["small","medium","large"],control:{type:"select"}},inputIcon:{options:["",...e.ICONS],control:{type:"select"}},labelInline:{control:{type:"boolean"}},inputWidth:{control:{type:"range",min:0,max:100,step:1}},containerWidth:{control:{type:"range",min:0,max:100,step:1}},required:{control:{type:"boolean"}},error:{control:{type:"text"}},warning:{control:{type:"text"}}}),exports.getCommonTextInputArgs=(e=!1)=>({disabled:!1,readOnly:!1,prefix:"",label:e?"Label - new validation":"Label",inputHint:"",placeholder:"",labelInline:e,inputWidth:50,size:"medium",inputIcon:void 0,required:!1,error:"",warning:""}),exports.getCommonTextInputArgsWithSpecialCharacters=e=>{const{label:r,placeholder:n}=e;return o=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(r){t(e,r,n[r])}))}return e}({},e),l=null!=(l={label:r,placeholder:n})?l:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(l)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(l)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(l,e))})),o;var o,l};