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
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import n,{useRef as i,useContext as o,useLayoutEffect as c,useEffect as l}from"react";import{StyledCheckableInput as s,StyledCheckableInputWrapper as a,StyledAccordion as d,StyledLineContainer as u,StyledAccordionLine as m,StyledAccordionContent as p}from"./checkable-input.style.js";import f from"../hidden-checkable-input.component.js";import b from"../../utils/helpers/guid/index.js";import h from"../../label/label.component.js";import{HintText as g}from"../../hint-text/hint-text.component.js";import y from"../../../hooks/useMediaQuery/useMediaQuery.js";import{TabsContext as j}from"../../../components/tabs/__next__/tabs.context.js";import{TabContext as O}from"../../../components/tabs/__next__/tab.context.js";function v(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]:{},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){v(e,r,t[r])}))}return e}const w=n.forwardRef(((n,v)=>{var{children:w,disabled:k,id:_,name:$,type:P,value:z,label:D,inputHint:S,checked:H,progressiveDisclosure:E,size:I="medium",error:B,warning:L}=n,M=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(n,["children","disabled","id","name","type","value","label","inputHint","checked","progressiveDisclosure","size","error","warning"]);const{current:Q}=i(_||b()),A=S?`${Q}-hint`:void 0,C=i(null),F=y("screen and (prefers-reduced-motion: no-preference)"),{scrollHeight:N}=C.current||{},R=H&&N?String(N):"0",{setErrors:W,setWarnings:q}=o(j),{tabId:G}=o(O),J=i(!1);return c((()=>(J.current=!0,()=>{J.current=!1})),[]),l((()=>(W&&W(Q,G||"",!!B),q&&q(Q,G||"",!!L),()=>{J.current||(W&&W(Q,G||"",!1),q&&q(Q,G||"",!1))})),[Q,W,q,B,L,G]),e(r,{children:[e(s,{$size:I,children:[e(a,{children:[t(f,x({id:Q,type:P,name:$,value:z,disabled:k,checked:H,ref:v,ariaDescribedBy:A},M)),w]}),D&&t(h,{htmlFor:Q,disabled:k,isLarge:"large"===I,children:D}),S&&t(g,{id:A,marginBottom:"0",isDisabled:k,isLarge:"large"===I,children:S})]}),E&&e(d,{"data-role":"progressive-disclosure-accordion",ref:C,$expanded:H,$contentHeight:R,$allowAnimation:F,children:[t(u,{$size:I,children:t(m,{$size:I})}),t(p,{children:E})]})]})}));w.displayName="CheckableInput";export{w as default};
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import n,{useRef as i,useContext as o,useLayoutEffect as c,useEffect as l}from"react";import{StyledCheckableInput as a,StyledCheckableInputWrapper as s,StyledAccordion as d,StyledLineContainer as u,StyledAccordionLine as m,StyledAccordionContent as p}from"./checkable-input.style.js";import f from"../hidden-checkable-input.component.js";import b from"../../utils/helpers/guid/index.js";import h from"../../legacy-label/label.component.js";import{HintText as g}from"../../legacy-hint-text/hint-text.component.js";import y from"../../../hooks/useMediaQuery/useMediaQuery.js";import{TabsContext as j}from"../../../components/tabs/__next__/tabs.context.js";import{TabContext as O}from"../../../components/tabs/__next__/tab.context.js";function v(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]:{},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){v(e,r,t[r])}))}return e}const w=n.forwardRef(((n,v)=>{var{children:w,disabled:k,id:_,name:$,type:P,value:z,label:D,inputHint:S,checked:H,progressiveDisclosure:E,size:I="medium",error:B,warning:L}=n,M=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(n,["children","disabled","id","name","type","value","label","inputHint","checked","progressiveDisclosure","size","error","warning"]);const{current:Q}=i(_||b()),A=S?`${Q}-hint`:void 0,C=i(null),F=y("screen and (prefers-reduced-motion: no-preference)"),{scrollHeight:N}=C.current||{},R=H&&N?String(N):"0",{setErrors:W,setWarnings:q}=o(j),{tabId:G}=o(O),J=i(!1);return c((()=>(J.current=!0,()=>{J.current=!1})),[]),l((()=>(W&&W(Q,G||"",!!B),q&&q(Q,G||"",!!L),()=>{J.current||(W&&W(Q,G||"",!1),q&&q(Q,G||"",!1))})),[Q,W,q,B,L,G]),e(r,{children:[e(a,{$size:I,children:[e(s,{children:[t(f,x({id:Q,type:P,name:$,value:z,disabled:k,checked:H,ref:v,ariaDescribedBy:A},M)),w]}),D&&t(h,{htmlFor:Q,disabled:k,isLarge:"large"===I,children:D}),S&&t(g,{id:A,marginBottom:"0",isDisabled:k,isLarge:"large"===I,children:S})]}),E&&e(d,{"data-role":"progressive-disclosure-accordion",ref:C,$expanded:H,$contentHeight:R,$allowAnimation:F,children:[t(u,{$size:I,children:t(m,{$size:I})}),t(p,{children:E})]})]})}));w.displayName="CheckableInput";export{w as default};
@@ -1 +1 @@
1
- import i,{css as e}from"styled-components";import t,{StyledLabelContainer as a}from"../../label/label.style.js";import l from"../../hint-text/hint-text.style.js";const o={small:"var(--global-font-static-comp-regular-s)",medium:"var(--global-font-static-comp-regular-m)",large:"var(--global-font-static-comp-regular-l)"},n=i.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-8b8f7038-0"})(["display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);","{padding:0;margin:0;}","{","}","{grid-area:2 / 2;}"],a,t,(({$size:i})=>i&&e(["font:",";"],o[i])),l),s=i.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-8b8f7038-1"})(["display:flex;align-items:center;min-height:var(--global-size-xs);"]),p=i.div.withConfig({displayName:"checkable-input.style__StyledAccordion",componentId:"sc-8b8f7038-2"})(["overflow-y:hidden;visibility:hidden;max-height:0;position:relative;display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);"," ",""],(({$allowAnimation:i})=>i&&e(["transition:all 0.4s;"])),(({$expanded:i,$contentHeight:t})=>e(["",""],i&&e(["visibility:visible;max-height:","px;"],t)))),c={small:{top:"var(--global-space-comp-xs)",width:"var(--global-size-3-xs)"},medium:{top:"var(--global-space-comp-s)",width:"var(--global-size-xs)"},large:{top:"var(--global-space-comp-m)",width:"var(--global-size-s)"}},d="var(--global-space-comp-m)",r=i.div.withConfig({displayName:"checkable-input.style__StyledLineContainer",componentId:"sc-8b8f7038-3"})(["display:flex;justify-content:center;",""],(({$size:i})=>i&&e(["width:",";"],c[i].width))),m=i.div.withConfig({displayName:"checkable-input.style__StyledAccordionLine",componentId:"sc-8b8f7038-4"})(["position:absolute;width:2px;background-color:var(--input-typical-border-alt);border-radius:2px;",""],(({$size:i})=>i&&e(["top:",";height:calc( 100% - ("," + ",") );"],c[i].top,c[i].top,d))),g=i.div.withConfig({displayName:"checkable-input.style__StyledAccordionContent",componentId:"sc-8b8f7038-5"})(["padding:"," 0;"],d);export{p as StyledAccordion,g as StyledAccordionContent,m as StyledAccordionLine,n as StyledCheckableInput,s as StyledCheckableInputWrapper,r as StyledLineContainer};
1
+ import e,{css as i}from"styled-components";import t,{StyledLabelContainer as a}from"../../legacy-label/label.style.js";import l from"../../legacy-hint-text/hint-text.style.js";const o={small:"var(--global-font-static-comp-regular-s)",medium:"var(--global-font-static-comp-regular-m)",large:"var(--global-font-static-comp-regular-l)"},n=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-49f7bf7-0"})(["display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);","{padding:0;margin:0;}","{","}","{grid-area:2 / 2;}"],a,t,(({$size:e})=>e&&i(["font:",";"],o[e])),l),s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-49f7bf7-1"})(["display:flex;align-items:center;min-height:var(--global-size-xs);"]),c=e.div.withConfig({displayName:"checkable-input.style__StyledAccordion",componentId:"sc-49f7bf7-2"})(["overflow-y:hidden;visibility:hidden;max-height:0;position:relative;display:grid;grid-template-columns:auto 1fr;grid-column-gap:var(--global-space-comp-s);"," ",""],(({$allowAnimation:e})=>e&&i(["transition:all 0.4s;"])),(({$expanded:e,$contentHeight:t})=>i(["",""],e&&i(["visibility:visible;max-height:","px;"],t)))),p={small:{top:"var(--global-space-comp-xs)",width:"var(--global-size-3-xs)"},medium:{top:"var(--global-space-comp-s)",width:"var(--global-size-xs)"},large:{top:"var(--global-space-comp-m)",width:"var(--global-size-s)"}},d="var(--global-space-comp-m)",r=e.div.withConfig({displayName:"checkable-input.style__StyledLineContainer",componentId:"sc-49f7bf7-3"})(["display:flex;justify-content:center;",""],(({$size:e})=>e&&i(["width:",";"],p[e].width))),m=e.div.withConfig({displayName:"checkable-input.style__StyledAccordionLine",componentId:"sc-49f7bf7-4"})(["position:absolute;width:2px;background-color:var(--input-typical-border-alt);border-radius:2px;",""],(({$size:e})=>e&&i(["top:",";height:calc( 100% - ("," + ",") );"],p[e].top,p[e].top,d))),g=e.div.withConfig({displayName:"checkable-input.style__StyledAccordionContent",componentId:"sc-49f7bf7-5"})(["padding:"," 0;"],d);export{c as StyledAccordion,g as StyledAccordionContent,m as StyledAccordionLine,n as StyledCheckableInput,s as StyledCheckableInputWrapper,r as StyledLineContainer};
@@ -1 +1 @@
1
- import e,{css as i}from"styled-components";import l from"../field-help/field-help.style.js";import{FieldLineStyle as t}from"../form-field/form-field.style.js";import o,{StyledLabelContainer as n}from"../label/label.style.js";import r from"../validations/validation-icon.style.js";import a from"../../components/help/help.style.js";import d from"./hidden-checkable-input.style.js";const s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-9944fee6-0"})(["display:inline-block;position:relative;"]),p=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-9944fee6-1"})(["",""],(({disabled:e,fieldHelpInline:p,inputWidth:f,labelWidth:m,labelInline:c,reverse:h,isDarkBackground:y})=>i(["width:100% !important;","{display:flex;}","{"," padding-top:0;width:auto;& ",",& ","{color:var(--colorsUtilityYin065);vertical-align:middle;&:hover,&:focus{color:var(--colorsUtilityYin090);}}}","{"," flex-basis:100%;}"," "," "," "," ",""],t,n,c&&i(["justify-content:",";"],h?"flex-start":"flex-end"),a,r,l,y&&i(["color:var(--colorsUtilityYang080);"]),e&&i(["",",","{&:hover,&:focus{outline:none;cursor:not-allowed;}}"],d,o),p&&i(["","{flex-wrap:nowrap;}","{margin-right:0;margin-left:8px;}","{flex-grow:0;flex-basis:auto;padding-left:0;width:auto;}"],t,s,l),h&&p&&i(["","{margin-left:0;}","{flex-grow:1;}"],s,l),void 0!==f&&0!==f&&i(["","{width:","% !important;min-width:67px;}"],s,f),void 0!==m&&0!==m&&`\n ${n} {\n width: ${m}% !important;\n }\n `)));export{s as StyledCheckableInput,p as StyledCheckableInputWrapper};
1
+ import e,{css as i}from"styled-components";import l from"../field-help/field-help.style.js";import{FieldLineStyle as t}from"../form-field/form-field.style.js";import o,{StyledLabelContainer as n}from"../legacy-label/label.style.js";import r from"../validations/validation-icon.style.js";import a from"../../components/help/help.style.js";import d from"./hidden-checkable-input.style.js";const s=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInput",componentId:"sc-e1e587cd-0"})(["display:inline-block;position:relative;"]),p=e.div.withConfig({displayName:"checkable-input.style__StyledCheckableInputWrapper",componentId:"sc-e1e587cd-1"})(["",""],(({disabled:e,fieldHelpInline:p,inputWidth:c,labelWidth:f,labelInline:m,reverse:h,isDarkBackground:y})=>i(["width:100% !important;","{display:flex;}","{"," padding-top:0;width:auto;& ",",& ","{color:var(--colorsUtilityYin065);vertical-align:middle;&:hover,&:focus{color:var(--colorsUtilityYin090);}}}","{"," flex-basis:100%;}"," "," "," "," ",""],t,n,m&&i(["justify-content:",";"],h?"flex-start":"flex-end"),a,r,l,y&&i(["color:var(--colorsUtilityYang080);"]),e&&i(["",",","{&:hover,&:focus{outline:none;cursor:not-allowed;}}"],d,o),p&&i(["","{flex-wrap:nowrap;}","{margin-right:0;margin-left:8px;}","{flex-grow:0;flex-basis:auto;padding-left:0;width:auto;}"],t,s,l),h&&p&&i(["","{margin-left:0;}","{flex-grow:1;}"],s,l),void 0!==c&&0!==c&&i(["","{width:","% !important;min-width:67px;}"],s,c),void 0!==f&&0!==f&&`\n ${n} {\n width: ${f}% !important;\n }\n `)));export{s as StyledCheckableInput,p as StyledCheckableInputWrapper};
@@ -0,0 +1,4 @@
1
+ declare const ErrorBorder: import("styled-components").StyledComponent<"span", any, {
2
+ $warning: boolean;
3
+ }, never>;
4
+ export default ErrorBorder;
@@ -0,0 +1 @@
1
+ import r,{css as o}from"styled-components";const t=r.span.withConfig({displayName:"error-border.style__ErrorBorder",componentId:"sc-f2eef804-0"})([""," transform:translateZ(0);.numeral-date-wrapper &{display:none;}"],(({$warning:r})=>o(["width:2px;position:absolute;left:-10px;top:0px;bottom:0px;z-index:6;background-color:",";"],r?"var(--input-validation-bar-warn)":"var(--input-validation-border-error)")));export{t as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{useRef as i}from"react";import{StyledFieldset as n,StyledLegend as o,StyledFieldsetContentWrapper as s}from"./fieldset.style.js";import l from"../../../components/textbox/textbox.style.js";import a from"../../validation-message/validation-message.component.js";import{HintText as c}from"../../hint-text/hint-text.component.js";import d from"../../utils/helpers/guid/index.js";import"../../../style/utils/filter-styled-system-padding-props.js";import p from"../../../style/utils/filter-styled-system-margin-props.js";function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const m=m=>{var{children:f,name:u,id:b,legend:y,legendAlign:O,legendHint:j,error:v,warning:h,isRequired:P,isDisabled:w,validationMessagePositionTop:x,size:$="medium"}=m,D=function(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(m,["children","name","id","legend","legendAlign","legendHint","error","warning","isRequired","isDisabled","validationMessagePositionTop","size"]);const S=i(d()),z=b||S.current,k=j?`${z}-hint`:void 0,q=(v||h)&&`${z}-validation-message`,E=[k,q].filter(Boolean).join(" "),L=()=>v||h?e(r,{children:[t(a,{error:v,warning:h,validationId:q,isLarge:"large"===$}),t(l,{warning:!(v||!h)})]}):null;return e(n,(M=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){g(e,t,r[t])}))}return e}({"data-component":"fieldset",id:z,name:u,"aria-describedby":E,$validationMessagePositionTop:x,$size:$},p(D),D),R=null!=(R={children:[y&&t(o,{"data-element":"legend",$align:O,$isRequired:P,$isDisabled:w,$isLarge:"large"===$,children:y}),j&&t(c,{id:k,isDisabled:w,align:O,isLarge:"large"===$,marginBottom:"0",children:j}),e(s,{$size:$,children:[x&&L(),f,!x&&L()]})]})?R:{},Object.getOwnPropertyDescriptors?Object.defineProperties(M,Object.getOwnPropertyDescriptors(R)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(R)).forEach((function(e){Object.defineProperty(M,e,Object.getOwnPropertyDescriptor(R,e))})),M));var M,R};export{m as default};
1
+ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useRef as i}from"react";import{StyledFieldset as n,StyledLegend as o,StyledFieldsetContentWrapper as l}from"./fieldset.style.js";import s from"../../legacy-error-border/error-border.style.js";import a from"../../validation-message/validation-message.component.js";import{HintText as c}from"../../legacy-hint-text/hint-text.component.js";import d from"../../utils/helpers/guid/index.js";import"../../../style/utils/filter-styled-system-padding-props.js";import g from"../../../style/utils/filter-styled-system-margin-props.js";function p(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const m=m=>{var{children:f,name:u,id:b,legend:y,legendAlign:O,legendHint:j,error:v,warning:h,isRequired:P,isDisabled:w,validationMessagePositionTop:$,size:D="medium"}=m,x=function(e,r){if(null==e)return{};var t,i,n=function(e,r){if(null==e)return{};var t,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t=o[i],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)t=o[i],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}(m,["children","name","id","legend","legendAlign","legendHint","error","warning","isRequired","isDisabled","validationMessagePositionTop","size"]);const S=i(d()),z=b||S.current,k=j?`${z}-hint`:void 0,q=(v||h)&&`${z}-validation-message`,E=[k,q].filter(Boolean).join(" "),L=()=>v||h?e(t,{children:[r(a,{error:v,warning:h,validationId:q,isLarge:"large"===D}),r(s,{warning:!(v||!h)})]}):null;return e(n,(M=function(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){p(e,r,t[r])}))}return e}({"data-component":"fieldset",id:z,name:u,"aria-describedby":E,$validationMessagePositionTop:$,$size:D},g(x),x),R=null!=(R={children:[y&&r(o,{"data-element":"legend",$align:O,$isRequired:P,$isDisabled:w,$isLarge:"large"===D,children:y}),j&&r(c,{id:k,isDisabled:w,align:O,isLarge:"large"===D,marginBottom:"0",children:j}),e(l,{$size:D,children:[$&&L(),f,!$&&L()]})]})?R:{},Object.getOwnPropertyDescriptors?Object.defineProperties(M,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(e){Object.defineProperty(M,e,Object.getOwnPropertyDescriptor(R,e))})),M));var M,R};export{m as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{useContext as r,useState as t,useRef as o,useEffect as l}from"react";import{StyledFieldset as a,StyledLegend as s,StyledIconWrapper as d}from"./fieldset.style.js";import{ValidationIcon as p}from"../validations/validation-icon.component.js";import c from"../../components/carbon-provider/__internal__/new-validation.context.js";import{InputGroupBehaviour as u,InputGroupContext as m}from"../input-behaviour/input-group-behaviour.component.js";import{Help as f}from"../../components/help/help.component.js";import{Typography as g}from"../../components/typography/typography.component.js";import{Box as b}from"../../components/box/box.component.js";import y from"../../components/textbox/textbox.style.js";import h from"../validation-message/validation-message.component.js";import{HintText as j}from"../hint-text/hint-text.component.js";import{FieldHelp as v}from"../field-help/field-help.component.js";import O from"../utils/helpers/guid/index.js";import w from"../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js";import"../../style/utils/filter-styled-system-padding-props.js";import P from"../../style/utils/filter-styled-system-margin-props.js";function x(e,i,n){return i in e?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n,e}function D(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{},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(i){x(e,i,n[i])}))}return e}function M(e,i){return i=null!=i?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):function(e){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);i.push.apply(i,n)}return i}(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))})),e}const S=x=>{var{legend:S,children:H,inline:I=!1,legendWidth:_,legendAlign:k,legendSpacing:A=2,error:R,warning:q,info:B,isRequired:E,blockGroupBehaviour:L,legendMargin:F={},isDisabled:G,labelHelp:T,fieldHelp:z,inputHint:N,validationMessagePositionTop:V,applyNewValidation:W=!1,id:C,size:$}=x,J=function(e,i){if(null==e)return{};var n,r,t=function(e,i){if(null==e)return{};var n,r,t={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],i.indexOf(n)>=0||(t[n]=e[n]);return t}(e,i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],i.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}(x,["legend","children","inline","legendWidth","legendAlign","legendSpacing","error","warning","info","isRequired","blockGroupBehaviour","legendMargin","isDisabled","labelHelp","fieldHelp","inputHint","validationMessagePositionTop","applyNewValidation","id","size"]);const{validationRedesignOptIn:K}=r(c),Q=P(J),[U,X]=t(null),[Y,Z]=t(!1),ee=o(O()),ie=C||ee.current,ne=N?`${ie}-hint`:void 0;l((()=>{U&&E&&Array.from(U.querySelectorAll("input")||[]).forEach((e=>{e.setAttribute("required","")}))}),[U,E]);let re;re=I&&!k?"right":k||"left";const{validationId:te,fieldHelpId:oe,ariaDescribedBy:le}=w({id:ie,validationRedesignOptIn:!0,error:R,warning:q,info:B,fieldHelp:z}),ae=(V?[le,ne]:[ne,le]).filter(Boolean).join(" "),se=()=>R||q?e(n,{children:[i(h,{error:R,warning:q,validationId:te,validationMessagePositionTop:V,isLarge:"large"===$}),i(y,{warning:!(R||!q)})]}):null;return W?e(a,M(D({ref:X,"data-component":"fieldset",id:ie,"aria-describedby":ae||void 0},J,Q),{children:[S&&i(s,{align:re,isRequired:E,isDisabled:G,"data-element":"legend","data-role":"legend",isLarge:"large"===$,children:S}),N&&i(j,{id:ne,isDisabled:G,align:re,isLarge:"large"===$,children:N}),e(b,{position:"relative",mt:1,children:[V&&se(),H,!V&&se()]})]})):i(u,{blockGroupBehaviour:L,children:e(a,M(D({ref:X,"data-component":"fieldset",id:ie,"aria-describedby":le||void 0},J,Q),{children:[S&&i(m.Consumer,{children:({onMouseEnter:n,onMouseLeave:r})=>e(s,M(D({onMouseEnter:n,onMouseLeave:r,inline:I,width:_,align:re,rightPadding:A},F),{"data-element":"legend","data-role":"legend",isRequired:E,isDisabled:G,children:[S,!K&&(R||q||B?i(d,{"aria-hidden":"true",children:i(p,{error:R,warning:q,info:B,tooltipFlipOverrides:["top","bottom"]})}):T?i(d,M(D({},{onFocus:()=>Z(!0),onBlur:()=>Z(!1)}),{children:i(f,{isFocused:Y,children:T})})):null)]}))}),!K&&i(g,{screenReaderOnly:!0,id:te,children:R||q||B}),e(b,{display:"flex",flexDirection:"column",mt:I?0:1,children:[H,z&&i(v,{id:oe,children:z})]})]}))})};export{S as default};
1
+ import{jsxs as e,jsx as r,Fragment as i}from"react/jsx-runtime";import{useContext as n,useState as t,useRef as o,useEffect as l}from"react";import{StyledFieldset as a,StyledLegend as s,StyledIconWrapper as d}from"./fieldset.style.js";import{ValidationIcon as p}from"../validations/validation-icon.component.js";import c from"../../components/carbon-provider/__internal__/new-validation.context.js";import{InputGroupBehaviour as u,InputGroupContext as m}from"../input-behaviour/input-group-behaviour.component.js";import{Help as f}from"../../components/help/help.component.js";import{Typography as g}from"../../components/typography/typography.component.js";import{Box as b}from"../../components/box/box.component.js";import y from"../legacy-error-border/error-border.style.js";import h from"../validation-message/validation-message.component.js";import{HintText as j}from"../legacy-hint-text/hint-text.component.js";import{FieldHelp as v}from"../field-help/field-help.component.js";import O from"../utils/helpers/guid/index.js";import w from"../../hooks/__internal__/useInputAccessibility/useInputAccessibility.js";import"../../style/utils/filter-styled-system-padding-props.js";import P from"../../style/utils/filter-styled-system-margin-props.js";function x(e,r,i){return r in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e}function D(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{},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(r){x(e,r,i[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 i=Object.getOwnPropertySymbols(e);r.push.apply(r,i)}return r}(Object(r)).forEach((function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})),e}const S=x=>{var{legend:S,children:H,inline:I=!1,legendWidth:_,legendAlign:k,legendSpacing:A=2,error:R,warning:q,info:B,isRequired:E,blockGroupBehaviour:L,legendMargin:F={},isDisabled:G,labelHelp:T,fieldHelp:z,inputHint:N,validationMessagePositionTop:V,applyNewValidation:W=!1,id:C,size:$}=x,J=function(e,r){if(null==e)return{};var i,n,t=function(e,r){if(null==e)return{};var i,n,t={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],r.indexOf(i)>=0||(t[i]=e[i]);return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],r.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(t[i]=e[i])}return t}(x,["legend","children","inline","legendWidth","legendAlign","legendSpacing","error","warning","info","isRequired","blockGroupBehaviour","legendMargin","isDisabled","labelHelp","fieldHelp","inputHint","validationMessagePositionTop","applyNewValidation","id","size"]);const{validationRedesignOptIn:K}=n(c),Q=P(J),[U,X]=t(null),[Y,Z]=t(!1),ee=o(O()),re=C||ee.current,ie=N?`${re}-hint`:void 0;l((()=>{U&&E&&Array.from(U.querySelectorAll("input")||[]).forEach((e=>{e.setAttribute("required","")}))}),[U,E]);let ne;ne=I&&!k?"right":k||"left";const{validationId:te,fieldHelpId:oe,ariaDescribedBy:le}=w({id:re,validationRedesignOptIn:!0,error:R,warning:q,info:B,fieldHelp:z}),ae=(V?[le,ie]:[ie,le]).filter(Boolean).join(" "),se=()=>R||q?e(i,{children:[r(h,{error:R,warning:q,validationId:te,validationMessagePositionTop:V,isLarge:"large"===$}),r(y,{warning:!(R||!q)})]}):null;return W?e(a,M(D({ref:X,"data-component":"fieldset",id:re,"aria-describedby":ae||void 0},J,Q),{children:[S&&r(s,{align:ne,isRequired:E,isDisabled:G,"data-element":"legend","data-role":"legend",isLarge:"large"===$,children:S}),N&&r(j,{id:ie,isDisabled:G,align:ne,isLarge:"large"===$,children:N}),e(b,{position:"relative",mt:1,children:[V&&se(),H,!V&&se()]})]})):r(u,{blockGroupBehaviour:L,children:e(a,M(D({ref:X,"data-component":"fieldset",id:re,"aria-describedby":le||void 0},J,Q),{children:[S&&r(m.Consumer,{children:({onMouseEnter:i,onMouseLeave:n})=>e(s,M(D({onMouseEnter:i,onMouseLeave:n,inline:I,width:_,align:ne,rightPadding:A},F),{"data-element":"legend","data-role":"legend",isRequired:E,isDisabled:G,children:[S,!K&&(R||q||B?r(d,{"aria-hidden":"true",children:r(p,{error:R,warning:q,info:B,tooltipFlipOverrides:["top","bottom"]})}):T?r(d,M(D({},{onFocus:()=>Z(!0),onBlur:()=>Z(!1)}),{children:r(f,{isFocused:Y,children:T})})):null)]}))}),!K&&r(g,{screenReaderOnly:!0,id:te,children:R||q||B}),e(b,{display:"flex",flexDirection:"column",mt:I?0:1,children:[H,z&&r(v,{id:oe,children:z})]})]}))})};export{S as default};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ type FieldsetValidationContextType = {
3
+ disableErrorBorder?: boolean;
4
+ };
5
+ declare const _default: React.Context<FieldsetValidationContextType>;
6
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from "./fieldset-validation-context";
@@ -0,0 +1 @@
1
+ export{default}from"./fieldset-validation-context.js";
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { ValidationProps } from "../validations";
4
- import { LabelProps } from "../label";
4
+ import { LabelProps } from "../legacy-label";
5
5
  import { TagProps } from "../utils/helpers/tags/tags";
6
6
  import { IconType } from "../../components/icon";
7
7
  interface CommonFormFieldProps extends MarginProps, ValidationProps {
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as i,useLayoutEffect as l,useEffect as o}from"react";import a from"invariant";import s,{FieldLineStyle as d}from"./form-field.style.js";import p from"../label/label.component.js";import{FieldHelp as c}from"../field-help/field-help.component.js";import b from"../utils/helpers/tags/tags.js";import f from"../../hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js";import"../../style/utils/filter-styled-system-padding-props.js";import u from"../../style/utils/filter-styled-system-margin-props.js";import{TabsContext as m}from"../../components/tabs/__next__/tabs.context.js";import{TabContext as y}from"../../components/tabs/__next__/tab.context.js";function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=g=>{var{maxWidth:I,children:j,"data-component":h,disabled:v,loading:w,fieldHelp:P,fieldHelpInline:_,error:x,warning:H,info:k,tooltipId:S,fieldHelpId:W,label:A,labelId:R,labelAlign:q,labelHelp:B,labelHelpIcon:D,labelInline:E,labelSpacing:F=2,labelWidth:V,labelAs:L,id:N,reverse:U,useValidationIcon:$,adaptiveLabelBreakpoint:z,isRequired:C,validationIconId:G,validationRedesignOptIn:J}=g,K=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(g,["maxWidth","children","data-component","disabled","loading","fieldHelp","fieldHelpInline","error","warning","info","tooltipId","fieldHelpId","label","labelId","labelAlign","labelHelp","labelHelpIcon","labelInline","labelSpacing","labelWidth","labelAs","id","reverse","useValidationIcon","adaptiveLabelBreakpoint","isRequired","validationIconId","validationRedesignOptIn"]);const M=n((()=>{const e={error:!!x,warning:!!H,info:!!k};if(v&&!w)return Object.keys(e).find((t=>e[t]))}),[x,H,k,v,w]);a(void 0===M,`Prop \`${M}\` cannot be used in conjunction with \`disabled\`. Use \`readOnly\` if you require users to see validations with a non-interactive field`);const Q=f(z);let T=E;z&&(T=Q);const{setErrors:X,setWarnings:Y,setInfos:Z}=r(m),{tabId:ee}=r(y),te=u(K),ne=i(!1);l((()=>(ne.current=!0,()=>{ne.current=!1})),[]),o((()=>(X&&X(N,ee||"",x||!1),Y&&Y(N,ee||"",H||!1),Z&&Z(N,ee||"",k||!1),()=>{ne.current||(X&&X(N,ee||"",!1),Y&&Y(N,ee||"",!1),Z&&Z(N,ee||"",!1))})),[N,X,Y,x,H,k,ee,Z]);const re=P?t(c,{labelInline:T,labelWidth:V,id:W,children:P}):null;return e(s,(ie=function(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){O(e,t,n[t])}))}return e}({},b(h,K),te),le=null!=(le={children:[e(d,{"data-role":"field-line",inline:T,maxWidth:I,children:[U&&j,A&&t(p,{labelId:R,align:q,disabled:v,error:!J&&x,warning:!J&&H,info:!J&&k,help:B,tooltipId:S,htmlFor:N,helpIcon:D,inline:T,width:V,useValidationIcon:$,pr:U?void 0:F,pl:U?F:void 0,isRequired:C,validationIconId:G,as:L,children:A}),_&&re,!U&&j]}),!_&&re]})?le:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(le)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(le)).forEach((function(e){Object.defineProperty(ie,e,Object.getOwnPropertyDescriptor(le,e))})),ie));var ie,le};g.displayName="FormField";export{g as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useMemo as n,useContext as r,useRef as l,useLayoutEffect as i,useEffect as o}from"react";import a from"invariant";import s,{FieldLineStyle as d}from"./form-field.style.js";import p from"../legacy-label/label.component.js";import{FieldHelp as c}from"../field-help/field-help.component.js";import b from"../utils/helpers/tags/tags.js";import f from"../../hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js";import"../../style/utils/filter-styled-system-padding-props.js";import u from"../../style/utils/filter-styled-system-margin-props.js";import{TabsContext as m}from"../../components/tabs/__next__/tabs.context.js";import{TabContext as y}from"../../components/tabs/__next__/tab.context.js";function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g=g=>{var{maxWidth:I,children:j,"data-component":h,disabled:v,loading:w,fieldHelp:P,fieldHelpInline:_,error:x,warning:H,info:k,tooltipId:S,fieldHelpId:W,label:A,labelId:R,labelAlign:q,labelHelp:B,labelHelpIcon:D,labelInline:E,labelSpacing:F=2,labelWidth:V,labelAs:L,id:N,reverse:U,useValidationIcon:$,adaptiveLabelBreakpoint:z,isRequired:C,validationIconId:G,validationRedesignOptIn:J}=g,K=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}(g,["maxWidth","children","data-component","disabled","loading","fieldHelp","fieldHelpInline","error","warning","info","tooltipId","fieldHelpId","label","labelId","labelAlign","labelHelp","labelHelpIcon","labelInline","labelSpacing","labelWidth","labelAs","id","reverse","useValidationIcon","adaptiveLabelBreakpoint","isRequired","validationIconId","validationRedesignOptIn"]);const M=n((()=>{const e={error:!!x,warning:!!H,info:!!k};if(v&&!w)return Object.keys(e).find((t=>e[t]))}),[x,H,k,v,w]);a(void 0===M,`Prop \`${M}\` cannot be used in conjunction with \`disabled\`. Use \`readOnly\` if you require users to see validations with a non-interactive field`);const Q=f(z);let T=E;z&&(T=Q);const{setErrors:X,setWarnings:Y,setInfos:Z}=r(m),{tabId:ee}=r(y),te=u(K),ne=l(!1);i((()=>(ne.current=!0,()=>{ne.current=!1})),[]),o((()=>(X&&X(N,ee||"",x||!1),Y&&Y(N,ee||"",H||!1),Z&&Z(N,ee||"",k||!1),()=>{ne.current||(X&&X(N,ee||"",!1),Y&&Y(N,ee||"",!1),Z&&Z(N,ee||"",!1))})),[N,X,Y,x,H,k,ee,Z]);const re=P?t(c,{labelInline:T,labelWidth:V,id:W,children:P}):null;return e(s,(le=function(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){O(e,t,n[t])}))}return e}({},b(h,K),te),ie=null!=(ie={children:[e(d,{"data-role":"field-line",inline:T,maxWidth:I,children:[U&&j,A&&t(p,{labelId:R,align:q,disabled:v,error:!J&&x,warning:!J&&H,info:!J&&k,help:B,tooltipId:S,htmlFor:N,helpIcon:D,inline:T,width:V,useValidationIcon:$,pr:U?void 0:F,pl:U?F:void 0,isRequired:C,validationIconId:G,as:L,children:A}),_&&re,!U&&j]}),!_&&re]})?ie:{},Object.getOwnPropertyDescriptors?Object.defineProperties(le,Object.getOwnPropertyDescriptors(ie)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(ie)).forEach((function(e){Object.defineProperty(le,e,Object.getOwnPropertyDescriptor(ie,e))})),le));var le,ie};g.displayName="FormField";export{g as default};
@@ -1,27 +1,12 @@
1
1
  import React from "react";
2
2
  export interface HintTextProps {
3
- /** The alignment of the hint text */
4
- align?: "left" | "right";
5
- /** Children elements */
3
+ /** Child elements */
6
4
  children?: React.ReactNode;
7
- /** Sets the font weight for the hint text */
8
- fontWeight?: string;
9
- /** Sets the id for the component. */
5
+ /** Sets the id for the component */
10
6
  id?: string;
11
- /** Indicates whether the parent component is inline. */
12
- isComponentInline?: boolean;
13
- /** Indicates whether the parent component has a dark background. */
14
- isDarkBackground?: boolean;
15
- /** Indicates whether the parent component is disabled. */
16
- isDisabled?: boolean;
17
- /** Margin bottom for the hint text */
18
- marginBottom?: string;
19
- /** Margin top for the hint text */
20
- marginTop?: string;
21
- /** Max width for the hint text */
22
- maxWidth?: string;
23
- /** Set large font-size */
24
- isLarge?: boolean;
7
+ size: "small" | "medium" | "large";
8
+ /** If true, the hint text will display in disabled styling */
9
+ disabled?: boolean;
25
10
  }
26
- export declare const HintText: ({ align, children, fontWeight, id, isComponentInline, isDarkBackground, isDisabled, marginBottom, marginTop, maxWidth, isLarge, }: HintTextProps) => React.JSX.Element | null;
11
+ export declare const HintText: ({ children, id, size, disabled }: HintTextProps) => React.JSX.Element;
27
12
  export default HintText;
@@ -1 +1 @@
1
- import{jsx as i}from"react/jsx-runtime";import{useContext as t}from"react";import n from"./hint-text.style.js";import a from"../../components/carbon-provider/__internal__/new-validation.context.js";const r=({align:r,children:o,fontWeight:e,id:m,isComponentInline:s=!1,isDarkBackground:d=!1,isDisabled:l=!1,marginBottom:g="var(--spacing100)",marginTop:p="var(--spacing000)",maxWidth:c,isLarge:h})=>{const{validationRedesignOptIn:f}=t(a);return s&&!f?null:i(n,{align:r,"data-element":"input-hint","data-role":"hint-text",fontWeight:e,id:m,isDarkBackground:d,isDisabled:l,marginBottom:g,marginTop:p,maxWidth:c,isLarge:h,children:o})};export{r as HintText,r as default};
1
+ import{jsx as t}from"react/jsx-runtime";import"react";import e from"./hint-text.style.js";const i=({children:i,id:r,size:d,disabled:a})=>t(e,{"data-element":"input-hint","data-role":"hint-text",id:r,$size:d,$disabled:a,children:i});export{i as HintText,i as default};
@@ -1,3 +1,6 @@
1
- import { HintTextProps } from "./hint-text.component";
2
- declare const StyledHintText: import("styled-components").StyledComponent<"div", any, HintTextProps, never>;
1
+ interface StyledHintTextProps {
2
+ $size: "small" | "medium" | "large";
3
+ $disabled?: boolean;
4
+ }
5
+ declare const StyledHintText: import("styled-components").StyledComponent<"span", any, StyledHintTextProps, never>;
3
6
  export default StyledHintText;
@@ -1 +1 @@
1
- import t,{css as i}from"styled-components";const o=t.div.withConfig({displayName:"hint-text.style__StyledHintText",componentId:"sc-92b90b9-0"})(["display:flex;align-items:center;font-size:14px;"," "," margin-bottom:",";margin-top:",";"," "," ",' ::after{content:" ";}'],(({isLarge:t})=>t&&i(["font-size:var(--fontSizes200);"])),(({align:t})=>i(["justify-content:",";"],"right"!==t?"flex-start":"flex-end")),(({marginBottom:t})=>t),(({marginTop:t})=>t),(({isDarkBackground:t,isDisabled:o})=>i(["color:",";"],((t,i)=>t?"var(--colorsUtilityYang080)":i?"var(--colorsUtilityYin030)":"var(--colorsUtilityYin055)")(t,o))),(({fontWeight:t})=>t&&i(["font-weight:",";"],t)),(({maxWidth:t})=>t&&i(["max-width:",";"],t)));export{o as default};
1
+ import t from"styled-components";const a=t.span.withConfig({displayName:"hint-text.style__StyledHintText",componentId:"sc-8ce52069-0"})(["color:",";font:",";"],(({$disabled:t})=>t?"var(--input-labelset-label-disabled)":"var(--input-labelset-label-alt)"),(({$size:t})=>(t=>{switch(t){case"small":return"var(--global-font-static-comp-regular-s)";case"large":return"var(--global-font-static-comp-regular-l)";default:return"var(--global-font-static-comp-regular-m)"}})(t)));export{a as default};
@@ -1,2 +1 @@
1
1
  export { default } from "./hint-text.component";
2
- export type { HintTextProps } from "./hint-text.component";
@@ -1,5 +1,2 @@
1
- import Input from "./input.component";
2
- import InputPresentation from "./input-presentation.component";
3
- export type { InputProps, CommonInputProps, EnterKeyHintTypes, } from "./input.component";
4
- export { Input, InputPresentation };
5
- export default Input;
1
+ export { default } from "./input.component";
2
+ export type { InputProps } from "./input.component";
@@ -1 +1 @@
1
- import t from"./input.component.js";export{default as InputPresentation}from"./input-presentation.component.js";export{t as Input,t as default};
1
+ export{default}from"./input.component.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Overrides for input when part of Date component
3
+ */
4
+ export declare const dateStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
5
+ export declare const searchStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
6
+ export declare const selectStyleOverrides: ($size?: string, $isDisabled?: boolean, $isReadOnly?: boolean) => import("styled-components").FlattenSimpleInterpolation;
7
+ export declare const pagerStyleOverrides: import("styled-components").FlattenSimpleInterpolation;
8
+ export declare const numeralDateStyles: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1 @@
1
+ import{css as t}from"styled-components";const a=t([".date &{.input-text-container input{padding:0 0 0 12px;margin-right:-12px;}}"]),n=t([".search &{height:40px;box-sizing:border-box;.input-text-container{flex-wrap:wrap;}input{width:30px;}}"]),e=t([".search:not(.with-button):not(.has-value) &:not(:focus-within){border-color:transparent;background:transparent;}"]),o=t([".search.with-button &{border-top-right-radius:0;border-bottom-right-radius:0;}"]),r=t([".search.dark-background &{input{::-moz-placeholder{color:var(--colorsUtilityYang080);opacity:1;}::placeholder{color:var(--colorsUtilityYang080);}}}"]),i=t([".search.dark-background:not(.with-button) &{input{color:var(--input-typical-inverse-txt-default);}}.search.dark-background.has-value:not(.with-button) &{.input-text-container,input{color:var(--colorsUtilityYang080);}.input-text-container:hover{input{color:var(--colorsUtilityYang100);}}}"]),p=t([".search.dark-background.with-button:not(.has-value) &{input{color:var(--colorsUtilityYang100);}}"]),l=t([".search.dark-background:not(.with-button) &{background-color:transparent;border-color:var(--colorsUtilityYang080);}"]),c=t([""," "," "," "," "," "," ",""],n,e,o,r,i,p,l),s=t(['[data-role="select-textbox"] &[data-is-transparent="false"]{.input-text-container{position:relative;.select-text:not(.disabled):not(.read-only){position:absolute;top:0;left:0;width:calc(100% - 48px);height:100%;padding:var(--global-space-none) var(--global-space-none) var(--global-space-none) var(--global-space-comp-m);cursor:pointer;}}}']),d=t([".multi-select &,.filterable-select &{.input-text-container:not(.disabled):not(.read-only){cursor:text;input{cursor:text;}}}"]),g=t(['[data-element="simple-select-input"] &{input{opacity:0;}input{cursor:pointer;}}']),u=(a,n,e)=>t([""," "," "," "," ",""],g,((a,n)=>t(['&[data-is-transparent="true"]{&&&{background:transparent;border:none;}'," input{text-align:right;position:absolute;padding:var(--global-space-none);&::placeholder{color:var(--colorsUtilityYin100);}}}"],!a&&!n&&t(["cursor:pointer;*{cursor:pointer;}"])))(n,e),s,d,(a=>t([".multi-select &{input{padding:var(--global-space-none);width:30px;}.input-text-container{"," "," ","}}"],"small"===a&&t(["padding:var(--global-space-none) var(--global-space-comp-2-xl) var(--global-space-none) var(--global-space-comp-s);"]),"medium"===a&&t(["padding:var(--global-space-none) 40px var(--global-space-none) var(--global-space-comp-m);"]),"large"===a&&t(["padding:var(--global-space-none) 48px var(--global-space-none) var(--global-space-comp-l);"])))(a)),h=t([".pager-navigation &{margin:4px 8px;height:26px;min-height:unset;.input-text-container{padding:0px;line-height:26px;min-height:24px;input{text-align:center;padding:0;}}}"]),b=t(["&&&{.pager-size-options &{min-height:unset;.input-text-container{width:64px;height:26px;min-height:26px;min-width:10px;margin:0px;.select-text:not(.disabled):not(.read-only){width:calc(100% - 28px);}}}}"]),x=t([""," ",""],h,b),v=t([".numeral-date-wrapper &{.input-text-container input{text-align:center;}}"]);export{a as dateStyleOverrides,v as numeralDateStyles,x as pagerStyleOverrides,c as searchStyleOverrides,u as selectStyleOverrides};
@@ -1,54 +1,45 @@
1
1
  import React from "react";
2
- import { BorderRadiusType } from "../../components/box/box.component";
3
- export type EnterKeyHintTypes = "enter" | "done" | "go" | "next" | "previous" | "search" | "send";
4
- export interface CommonInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value"> {
5
- align?: "right" | "left";
2
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "size"> {
6
3
  /** The ID of the input's description, is set along with hint text and error message. */
7
4
  "aria-describedby"?: string;
8
- /** Override the variant component */
9
- as?: React.ElementType;
10
- /** If true the Component will be focused when rendered */
11
- autoFocus?: boolean;
12
5
  /** If true, the component will be disabled */
13
6
  disabled?: boolean;
14
7
  /** HTML id attribute of the input */
15
8
  id?: string;
16
- /** Specify a custom border radius for the input. Any valid border-radius design token, or an array of border-radius design tokens. */
17
- inputBorderRadius?: BorderRadiusType | BorderRadiusType[];
18
9
  /** Name of the input */
19
10
  name?: string;
20
11
  /** Specify a callback triggered on blur */
21
12
  onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
22
13
  /** Specify a callback triggered on change */
23
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
24
- /** Specify a callback triggered on click */
25
- onClick?: (ev: React.MouseEvent<HTMLInputElement>) => void;
14
+ onChange: (ev: React.ChangeEvent<HTMLInputElement>) => void;
26
15
  /** Specify a callback triggered on focus */
27
16
  onFocus?: (ev: React.FocusEvent<HTMLInputElement>) => void;
28
- /** Specify a callback triggered on keyDown */
29
- onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
30
17
  /** Placeholder string to be displayed in input */
31
18
  placeholder?: string;
32
19
  /** If true, the component will be read-only */
33
20
  readOnly?: boolean;
34
21
  /** Flag to configure component as mandatory */
35
22
  required?: boolean;
36
- /** Id of the validation icon */
37
- validationIconId?: string;
38
23
  /** The value of the input */
39
- value: string | readonly string[] | number | undefined;
24
+ value: string | readonly string[] | number;
25
+ /** If true, the input will display error styling */
26
+ error?: boolean;
27
+ /** The width of the input as a percentage (e.g., 50 for 50%) */
28
+ inputWidth?: number;
29
+ /** Type of the icon that will be rendered next to the input */
30
+ inputIcon?: React.ReactNode;
31
+ /** Size of the input */
32
+ size?: "small" | "medium" | "large";
33
+ /** Emphasised text to be displayed before the input */
34
+ prefix?: string;
35
+ /** Additional children to be rendered before the input */
36
+ leftChildren?: React.ReactNode;
37
+ /** Text alignment within the input */
38
+ align?: "left" | "right";
39
+ /**
40
+ * @private @internal @ignore
41
+ */
42
+ "data-is-transparent"?: boolean;
40
43
  }
41
- export interface InputProps extends CommonInputProps {
42
- /** The visible width of the text control, in average character widths */
43
- cols?: number;
44
- /** Integer to determine a timeout for the deferred callback */
45
- deferTimeout?: number;
46
- /** Deferred callback to be called after the onChange event */
47
- onChangeDeferred?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
48
- /** The number of visible text lines for the control */
49
- rows?: number;
50
- /** HTML type attribute of the input */
51
- type?: string;
52
- }
53
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
44
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
54
45
  export default Input;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import t,{useContext as r,useRef as n,useCallback as o,useEffect as u}from"react";import i from"./input.style.js";import{InputContext as c}from"../input-behaviour/input-behaviour.component.js";import{InputGroupContext as l}from"../input-behaviour/input-group-behaviour.component.js";import{SelectTextboxContext as a}from"../../components/select/__internal__/select-textbox/select-textbox.context.js";function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p=t.forwardRef(((t,p)=>{var{align:d,"aria-labelledby":b,"aria-describedby":f,placeholder:y,disabled:m,readOnly:O,autoFocus:h,onClick:g,onChangeDeferred:v,onChange:j,onBlur:B,onFocus:P,deferTimeout:w,type:x="text",id:F,name:I,validationIconId:S,inputBorderRadius:C="borderRadius050",enterKeyHint:R}=t,k=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["align","aria-labelledby","aria-describedby","placeholder","disabled","readOnly","autoFocus","onClick","onChangeDeferred","onChange","onBlur","onFocus","deferTimeout","type","id","name","validationIconId","inputBorderRadius","enterKeyHint"]);const D=r(c),E=r(l),{isInputInSelect:T}=r(a),_=n(null);let H=n(null);p&&"current"in p&&(H=p);const K=o((e=>{H.current=e,"function"==typeof p&&p(e),h&&e&&e.focus(),R&&e&&e.setAttribute("enterkeyhint",R)}),[h,p,R]);u((()=>{D.inputRef&&D.inputRef(H)}),[D,H]),u((()=>{m&&D.onBlur&&D.onBlur()}),[m,D]);const M=f?[f]:[];(D.hasFocus||E.hasFocus||D.hasMouseOver||E.hasMouseOver)&&S&&M.push(S);const A=M.length?M.filter(Boolean).join(" "):void 0;return e(i,(N=function(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){s(e,t,r[t])}))}return e}({},k),q={isInputInSelect:T,"data-has-autofocus":!!h||void 0,"aria-describedby":A,"aria-labelledby":b,align:d,placeholder:y,disabled:m,readOnly:O,name:I,type:x,id:F||I,ref:K,"data-element":"input",onFocus:e=>{P&&P(e),D.onFocus&&D.onFocus(),E.onFocus&&E.onFocus(),"text"===x&&function(e){setTimeout((()=>{if(null==e?void 0:e.current){const{selectionStart:t,selectionEnd:r,value:n}=e.current,{length:o}=n;(0===t&&0===r||t===o&&r===o)&&document.activeElement===e.current&&e.current.setSelectionRange(0,o)}}))}(H)},onBlur:e=>{B&&B(e),D.onBlur&&D.onBlur(),E.onBlur&&E.onBlur()},onClick:m||O?void 0:e=>{var t;g&&g(e),null==H||null===(t=H.current)||void 0===t||t.focus()},onChange:e=>{j&&j(e),(e=>{v&&(_.current&&clearTimeout(_.current),_.current=setTimeout((()=>{v(e)}),w||750))})(e)},inputBorderRadius:C},q=null!=q?q:{},Object.getOwnPropertyDescriptors?Object.defineProperties(N,Object.getOwnPropertyDescriptors(q)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(q)).forEach((function(e){Object.defineProperty(N,e,Object.getOwnPropertyDescriptor(q,e))})),N));var N,q}));p.displayName="Input";export{p as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useEffect as i,useCallback as a}from"react";import o from"./input.style.js";import l from"../utils/helpers/combine-refs/index.js";function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(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){c(e,t,r[t])}))}return e}const d=r.forwardRef(((r,c)=>{var{align:d="left","aria-describedby":s,"aria-labelledby":p,autoFocus:f,error:b,"data-is-transparent":y,children:m,disabled:O,id:h,inputIcon:v,inputWidth:x,leftChildren:g,name:j,onFocus:$,prefix:w,readOnly:P,size:S,type:F="text"}=r,E=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["align","aria-describedby","aria-labelledby","autoFocus","error","data-is-transparent","children","disabled","id","inputIcon","inputWidth","leftChildren","name","onFocus","prefix","readOnly","size","type"]);const z=n(null),I=l(c,z),R=w?`${h}-prefix`:void 0;i((()=>{var e;f&&(null===(e=z.current)||void 0===e||e.focus())}),[f]);const k=a((e=>{var t;null==$||$(e),"text"===F&&(t=z,setTimeout((()=>{if(null==t?void 0:t.current){const{selectionStart:e,selectionEnd:r,value:n}=t.current,{length:i}=n;(0===e&&0===r||e===i&&r===i)&&document.activeElement===t.current&&t.current.setSelectionRange(0,i)}})))}),[$,F]),C=R?`${R} ${p||""}`.trim():p;return e(o,{$align:d,"data-role":"input-container",$error:b,$size:S,$isDisabled:O,$isReadOnly:P,"data-is-transparent":y,children:[e("div",{"data-role":"input-text-container",role:"presentation",className:`input-text-container ${O?"disabled":""} ${P?"read-only":""}`,children:[g,w&&t("span",{id:R,"data-element":"textbox-prefix",children:w}),t("input",u({ref:I,"data-element":"input","data-role":"input",disabled:O,readOnly:P,"aria-describedby":s,"aria-labelledby":C,type:F,onFocus:k,id:h,name:j,"data-has-autofocus":!!f||void 0},E)),v]}),m]})}));export{d as default};
@@ -1,5 +1,9 @@
1
- import { CommonInputProps } from "./input.component";
2
- declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<CommonInputProps, "disabled" | "align" | "inputBorderRadius"> & {
3
- isInputInSelect: boolean;
4
- }, never>;
5
- export default StyledInput;
1
+ interface InputContainerProps {
2
+ $align?: "left" | "right";
3
+ $error?: boolean;
4
+ $isDisabled?: boolean;
5
+ $isReadOnly?: boolean;
6
+ $size?: "small" | "medium" | "large";
7
+ }
8
+ declare const InputContainer: import("styled-components").StyledComponent<"div", any, InputContainerProps, never>;
9
+ export default InputContainer;
@@ -1 +1 @@
1
- import o,{css as r}from"styled-components";const t=o.input.withConfig({displayName:"input.style__StyledInput",componentId:"sc-36f7ebca-0"})(["",";background:transparent;border:none;color:var(--colorsUtilityYin090);flex-grow:1;font-size:var(--fontSizes100);outline:none;padding:0;margin:0;width:30px;&:-webkit-autofill{background-clip:text;-webkit-background-clip:text;}"," "," &::placeholder{color:var(--colorsUtilityYin055);}",""],(({isInputInSelect:o})=>o&&"text-overflow: ellipsis"),(({inputBorderRadius:o})=>Array.isArray(o)?`border-radius: ${o.map((o=>`var(--${o})`)).join(" ")};`:`border-radius: var(--${o});`),(({align:o})=>o&&r(["text-align:",";"],o)),(({disabled:o})=>o&&r(["color:var(--colorsUtilityYin030);cursor:not-allowed;"])));export{t as default};
1
+ import a,{css as l}from"styled-components";import t from"../../style/utils/add-focus-styling.js";import{dateStyleOverrides as r,searchStyleOverrides as e,selectStyleOverrides as o,pagerStyleOverrides as i,numeralDateStyles as n}from"./input-style-overrides.style.js";const s=a.div.withConfig({displayName:"input.style__InputContainer",componentId:"sc-c3a17c62-0"})([""," "," "," "," "," ",""],(({$align:a,$error:r,$isDisabled:e,$isReadOnly:o,$size:i})=>l(["display:flex;align-items:center;align-self:stretch;max-width:100%;border-radius:var(--global-radius-action-m);"," "," "," &&&{"," ","}"," "," .input-text-container{display:flex;flex-wrap:wrap;align-items:center;flex:1 0 0;max-width:100%;align-self:stretch;input{align-self:stretch;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;flex:1 0 0;min-width:0;overflow:hidden;border:none;outline:none;background:transparent;text-overflow:ellipsis;text-align:",";"," "," "," "," "," ",'}[data-element="textbox-prefix"]{font-weight:500;margin-left:var(--global-space-comp-m);}}'],"small"===i&&l(["min-height:var(--global-size-s);"]),"medium"===i&&l(["min-height:var(--global-size-m);"]),"large"===i&&l(["min-height:var(--global-size-l);"]),o&&l(["cursor:default;*{cursor:default;}background:var(--input-typical-bg-read-only);border:var(--global-borderwidth-xs) solid var(--input-typical-border-read-only);&:focus-within:has(:focus:not(button)){"," z-index:2;}"],t()),e&&l(["cursor:not-allowed;background:var(--input-typical-bg-disabled);border:var(--global-borderwidth-xs) solid var(--input-typical-border-disabled);*{cursor:not-allowed;}"]),!e&&!o&&l(["cursor:text;&:focus-within:has(:focus:not(button)){"," z-index:2;}"],t()),!e&&!o&&l(["background:var(--input-typical-bg-default);border:",";"],r?"var(--global-borderwidth-s) solid var(--input-validation-border-error)":"var(--global-borderwidth-xs) solid var(--input-typical-border-default)"),a,o&&l(["color:var(--input-typical-txt-read-only);"]),e&&l(["color:var(--input-typical-txt-disabled);"]),!o&&!e&&l(["color:var(--input-typical-txt-default);"]),"small"===i&&l(["font:var(--global-font-static-comp-regular-s);padding:var(--global-space-none) var(--global-space-comp-s);"]),"medium"===i&&l(["font:var(--global-font-static-comp-regular-m);padding:var(--global-space-none) var(--global-space-comp-m);"]),"large"===i&&l(["font:var(--global-font-static-comp-regular-l);padding:var(--global-space-none) var(--global-space-comp-l);"]))),r,e,(({$size:a,$isDisabled:l,$isReadOnly:t})=>o(a,l,t)),i,n);export{s as default};
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
2
  import { IconType } from "../../components/icon";
3
- import { InputIconToggleStyleProps } from "./input-icon-toggle.style";
4
3
  import { ValidationProps } from "../validations/validation-icon.component";
5
- export interface InputIconToggleProps extends InputIconToggleStyleProps, ValidationProps {
4
+ export interface InputIconToggleProps extends ValidationProps {
6
5
  align?: "left" | "right";
7
6
  disabled?: boolean;
8
7
  iconTabIndex?: number;
@@ -14,6 +13,13 @@ export interface InputIconToggleProps extends InputIconToggleStyleProps, Validat
14
13
  useValidationIcon?: boolean;
15
14
  /** Id of the validation icon */
16
15
  validationIconId?: string;
16
+ onClick?: (event: React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent<HTMLSpanElement>) => void;
17
+ size?: "small" | "medium" | "large";
18
+ /**
19
+ * @private @ignore @internal
20
+ * Whether to apply focus styling to input icon
21
+ * */
22
+ blockFocusStyling?: boolean;
17
23
  }
18
- declare const InputIconToggle: ({ disabled, readOnly, size, inputIcon: type, onClick, onFocus, onBlur, onMouseDown, error, warning, info, useValidationIcon, align, iconTabIndex, validationIconId, }: InputIconToggleProps) => React.JSX.Element | null;
24
+ declare const InputIconToggle: ({ disabled, readOnly, size, inputIcon: type, onClick, onFocus, onBlur, onMouseDown, error, warning, info, useValidationIcon, align, iconTabIndex, validationIconId, blockFocusStyling, }: InputIconToggleProps) => React.JSX.Element | null;
19
25
  export default InputIconToggle;
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import"react";import n from"../../components/icon/icon.component.js";import i from"./input-icon-toggle.style.js";import{ValidationIcon as t}from"../validations/validation-icon.component.js";const r=({disabled:r,readOnly:e,size:a,inputIcon:l,onClick:s,onFocus:c,onBlur:d,onMouseDown:u,error:p,warning:g,info:m,useValidationIcon:f,align:I,iconTabIndex:b,validationIconId:w})=>f&&!r&&(({error:o,warning:n,info:i})=>"string"==typeof(o||n||i||null))({error:p,warning:g,info:m})?o(i,{size:a,children:o(t,{error:p,warning:g,info:m,size:a,onClick:s,onFocus:c,onBlur:d,isPartOfInput:!0,tabIndex:b,tooltipId:w,tooltipPosition:"right"===I?"left":"right"})}):l?o(i,{size:a,onClick:s,onFocus:c,onBlur:d,onMouseDown:u,"data-element":"input-icon-toggle",disabled:r,readOnly:e,"data-role":"input-icon-toggle","aria-hidden":"true",tabIndex:-1,children:o(n,{disabled:r||e,type:l})}):null;export{r as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import i from"../../components/icon/icon.component.js";import t from"./input-icon-toggle.style.js";import{ValidationIcon as e}from"../validations/validation-icon.component.js";const r=({disabled:r,readOnly:l,size:a,inputIcon:c,onClick:s,onFocus:d,onBlur:u,onMouseDown:p,error:g,warning:f,info:m,useValidationIcon:y,align:I,iconTabIndex:b,validationIconId:k,blockFocusStyling:w})=>{const v=n((o=>{if(" "===o.key||"Enter"===o.key)return o.preventDefault(),null==s?void 0:s(o)}),[s]);return y&&!r&&(({error:o,warning:n,info:i})=>"string"==typeof(o||n||i||null))({error:g,warning:f,info:m})?o(t,{$size:a,children:o(e,{error:g,warning:f,info:m,size:a,onClick:s,onFocus:d,onBlur:u,isPartOfInput:!0,tabIndex:b,tooltipId:k,tooltipPosition:"right"===I?"left":"right"})}):c?o(t,{$size:a,onClick:s,onFocus:d,onBlur:u,onMouseDown:p,onKeyDown:s&&v,"data-element":"input-icon-toggle",$disabled:r,$readOnly:l,"data-role":"input-icon-toggle","aria-hidden":"true",tabIndex:w?void 0:-1,$blockFocusStyling:w,children:o(i,{disabled:r||l,type:c})}):null};export{r as default};
@@ -1,13 +1,11 @@
1
1
  import { ValidationProps } from "../validations";
2
- export interface InputIconToggleStyleProps extends ValidationProps {
3
- size?: "small" | "medium" | "large";
4
- disabled?: boolean;
5
- readOnly?: boolean;
6
- onClick?: (event: React.MouseEvent<HTMLSpanElement> | React.KeyboardEvent<HTMLSpanElement>) => void;
2
+ interface InputIconToggleStyleProps extends ValidationProps {
3
+ $size?: "small" | "medium" | "large";
4
+ $disabled?: boolean;
5
+ $readOnly?: boolean;
6
+ $blockFocusStyling?: boolean;
7
7
  }
8
- declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, {
9
- onKeyDown: (event: React.KeyboardEvent<HTMLSpanElement>) => void | import("react").KeyboardEvent<HTMLSpanElement>;
10
- } & InputIconToggleStyleProps & {
8
+ declare const InputIconToggleStyle: import("styled-components").StyledComponent<"span", any, InputIconToggleStyleProps & {
11
9
  tabIndex?: number;
12
- }, "onKeyDown">;
10
+ }, never>;
13
11
  export default InputIconToggleStyle;
@@ -1 +1 @@
1
- import t,{css as e}from"styled-components";import o from"../input/input-sizes.style.js";import n from"../../style/utils/add-focus-styling.js";const s=t.span.attrs((({onClick:t})=>({onKeyDown:e=>!t||" "!==e.key&&"Enter"!==e.key?e:(e.preventDefault(),t(e))}))).withConfig({displayName:"input-icon-toggle.style__InputIconToggleStyle",componentId:"sc-9d7ce65f-0"})(["align-items:center;cursor:pointer;display:flex;justify-content:center;"," "," "," &:focus{","}"],(({size:t="medium"})=>e(["width:",";"],o[t].height)),(({disabled:t})=>t&&e(["cursor:not-allowed;"])),(({readOnly:t})=>t&&e(["cursor:default;"])),n());export{s as default};
1
+ import e,{css as t}from"styled-components";import s from"../legacy-input/input-sizes.style.js";import i from"../../style/utils/add-focus-styling.js";const l=e.span.withConfig({displayName:"input-icon-toggle.style__InputIconToggleStyle",componentId:"sc-d77c1680-0"})(["align-items:center;cursor:pointer;display:flex;justify-content:center;align-self:stretch;"," "," "," "," .pager-size-options &{margin-left:0;width:20px;height:24px;align-self:center;}.multi-select &,.filterable-select &{cursor:pointer;}"],(({$size:e="medium"})=>t(["width:",";"],s[e].height)),(({$disabled:e})=>e&&t(["cursor:not-allowed;"])),(({$readOnly:e})=>e&&t(["cursor:default;"])),(({$blockFocusStyling:e})=>!e&&t(["&:focus{","}"],i())));export{l as default};
@@ -1,2 +1 @@
1
1
  export { default } from "./label.component";
2
- export type { LabelProps } from "./label.component";
@@ -1,37 +1,20 @@
1
1
  import React from "react";
2
- import { StyledLabelProps, StyledLabelContainerProps } from "./label.style";
3
- import { ValidationProps } from "../validations";
4
- import { IconType } from "../../components/icon";
5
- export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLabelContainerProps {
6
- as?: "span" | "label";
2
+ export interface LabelProps {
7
3
  /** Children elements */
8
4
  children?: React.ReactNode;
9
- /** A message that the Help component will display */
10
- help?: React.ReactNode;
11
- /** Icon type */
12
- helpIcon?: IconType;
13
- /** A string that represents the ID of another form element */
5
+ /** HTML for attribute to associate label with input */
14
6
  htmlFor?: string;
15
- /** The unique id of the label element */
16
- labelId?: string;
17
- /** The unique id of the Help component tooltip, used for accessibility */
18
- tooltipId?: string;
19
- /** Whether to show the validation icon */
20
- useValidationIcon?: boolean;
21
- /** Id of the validation icon */
22
- validationIconId?: string;
23
- /**
24
- * @private
25
- * @internal
26
- * Sets className for component. INTERNAL USE ONLY. */
27
- className?: string;
28
- /** Sets aria-label for label element */
29
- "aria-label"?: string;
30
- /** Whether this component is shown against a dark background */
31
- isDarkBackground?: boolean;
32
- /** @internal @private */
33
- onClick?: () => void;
7
+ /** Sets the id for the component */
8
+ id?: string;
9
+ /** If true, uses large font size */
10
+ size: "small" | "medium" | "large";
11
+ /** If true, displays a required indicator (*) */
12
+ isRequired?: boolean;
13
+ /** If true, the label will display in disabled styling */
14
+ disabled?: boolean;
15
+ /** If true, the label will display in read-only styling */
16
+ readOnly?: boolean;
34
17
  }
35
- export declare const Label: ({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, onClick, "aria-label": ariaLabel, isLarge, }: LabelProps) => React.JSX.Element;
36
- declare const _default: React.MemoExoticComponent<({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, onClick, "aria-label": ariaLabel, isLarge, }: LabelProps) => React.JSX.Element>;
18
+ export declare const Label: ({ children, id, htmlFor, size, isRequired, disabled, readOnly, }: LabelProps) => React.JSX.Element;
19
+ declare const _default: React.MemoExoticComponent<({ children, id, htmlFor, size, isRequired, disabled, readOnly, }: LabelProps) => React.JSX.Element>;
37
20
  export default _default;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import o,{useState as n,useContext as t,useRef as i}from"react";import{Help as l}from"../../components/help/help.component.js";import a,{StyledLabelContainer as c}from"./label.style.js";import{ValidationIcon as s}from"../validations/validation-icon.component.js";import p from"./icon-wrapper.style.js";import{InputContext as u}from"../input-behaviour/input-behaviour.component.js";import{InputGroupContext as b}from"../input-behaviour/input-group-behaviour.component.js";import d from"../utils/helpers/guid/index.js";function m(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function f(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),n.forEach((function(r){m(e,r,o[r])}))}return e}function g(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 o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r}(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})),e}const h=({align:o,as:m="label",children:h,disabled:O,error:j,help:y,helpIcon:w,htmlFor:v,info:P,inline:k,isDarkBackground:I=!1,isRequired:D,labelId:L,pr:M,pl:E,tooltipId:F,useValidationIcon:S=!0,validationIconId:x,warning:B,width:q=30,className:C,onClick:N,"aria-label":R,isLarge:V})=>{const[$,z]=n(!1),{onMouseEnter:A,onMouseLeave:G}=t(u),{onMouseEnter:H,onMouseLeave:J}=t(b),K=i(d());let Q;return Q=k&&!o?"right":o||"left",e(c,{"data-role":"label-container",id:`label-container-${null!=L?L:K.current}`,align:Q,inline:k,width:q,pr:M,pl:E,className:C,onClick:N,children:[r(a,g(f({"data-element":"label",disabled:O,id:L},"label"===m?{htmlFor:v}:{}),{onMouseEnter:()=>{A&&A(),H&&H()},onMouseLeave:()=>{G&&G(),J&&J()},isRequired:D,as:m,"aria-label":R,isDarkBackground:I,isLarge:V,children:h})),(()=>{const e={onFocus:()=>z(!0),onBlur:()=>z(!1)};if(S&&(({error:e,warning:r,info:o,disabled:n})=>!n&&"string"==typeof(e||r||o))({error:j,warning:B,info:P,disabled:O})){const e=(({error:e,warning:r,info:o,inline:n})=>(e||r||o)&&n?"top":"right")({error:j,warning:B,info:P,inline:k});return r(p,{children:r(s,{tooltipId:x,error:j,warning:B,info:P,tooltipPosition:e,tooltipFlipOverrides:["top","bottom"]})})}return y&&r(p,g(f({},e),{children:r(l,{tooltipId:F,type:w,isFocused:$,children:y})}))})()]})};var O=o.memo(h);export{h as Label,O as default};
1
+ import{jsx as e}from"react/jsx-runtime";import r from"react";import a from"./label.style.js";const l=({children:r,id:l,htmlFor:i,size:t,isRequired:d,disabled:m,readOnly:o})=>e(a,{id:l,htmlFor:i,$size:t,$isRequired:d,$disabled:m,$readOnly:o,"data-component":"label","data-element":"label",children:r});var i=r.memo(l);export{l as Label,i as default};
@@ -1,25 +1,8 @@
1
- export interface StyledLabelProps {
2
- /** If true, the component will be disabled */
3
- disabled?: boolean;
4
- /** Flag to configure component as mandatory */
5
- isRequired?: boolean;
6
- /** Flag to determine whether to use colours for dark backgrounds */
7
- isDarkBackground?: boolean;
8
- /** Set large font-size */
9
- isLarge?: boolean;
1
+ interface StyledLabelProps {
2
+ $size: "small" | "medium" | "large";
3
+ $isRequired?: boolean;
4
+ $disabled?: boolean;
5
+ $readOnly?: boolean;
10
6
  }
11
7
  declare const StyledLabel: import("styled-components").StyledComponent<"label", any, StyledLabelProps, never>;
12
- export interface StyledLabelContainerProps {
13
- /** Label alignment */
14
- align?: "left" | "right";
15
- /** When true, label is placed in line an input */
16
- inline?: boolean;
17
- /** Padding right, integer multiplied by base spacing constant (8) */
18
- pr?: 1 | 2;
19
- /** Padding left, integer multiplied by base spacing constant (8) */
20
- pl?: 1 | 2;
21
- /** Label width */
22
- width?: number;
23
- }
24
- export declare const StyledLabelContainer: import("styled-components").StyledComponent<"div", any, StyledLabelContainerProps, never>;
25
8
  export default StyledLabel;
@@ -1 +1 @@
1
- import i,{css as t}from"styled-components";const e=i.label.withConfig({displayName:"label.style__StyledLabel",componentId:"sc-16363be4-0"})([""," display:block;font-weight:var(--fontWeights500);&:hover{cursor:pointer;}"," "," ",""],(({isDarkBackground:i})=>t(["color:",";"],i?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)")),(({isLarge:i})=>i&&t(["font-size:var(--fontSizes200);"])),(({isRequired:i})=>i&&t(['::after{content:"*";color:var(--colorsSemanticNegative500);font-weight:var(--fontWeights500);margin-left:var(--spacing050);}'])),(({disabled:i})=>i&&t(["color:var(--colorsUtilityYin030);&:hover{cursor:not-allowed;}"]))),o=i.div.withConfig({displayName:"label.style__StyledLabelContainer",componentId:"sc-16363be4-1"})(["display:flex;align-items:center;margin-bottom:8px;"," ",""],(({align:i})=>t(["justify-content:",";"],"right"!==i?"flex-start":"flex-end")),(({inline:i,pr:e,pl:o,width:a})=>i&&t(["box-sizing:border-box;margin-bottom:0;",";",";width:","%;"],e&&t(["padding-right:var(",");"],1===e?"--spacing100":"--spacing200"),o&&t(["padding-left:var(",");"],1===o?"--spacing100":"--spacing200"),a)));export{o as StyledLabelContainer,e as default};
1
+ import e,{css as l}from"styled-components";const a=e=>{switch(e){case"small":return"var(--global-font-static-comp-medium-s)";case"large":return"var(--global-font-static-comp-medium-l)";default:return"var(--global-font-static-comp-medium-m)"}},t=e.label.withConfig({displayName:"label.style__StyledLabel",componentId:"sc-bf6c67e5-0"})(["",";font:",";"," .numeral-date-wrapper &,.time &{font:var(--global-font-static-comp-regular-m);}"],(({$disabled:e,$readOnly:l})=>e?"\n cursor: not-allowed;\n color: var(--input-labelset-label-disabled);\n ":l?"\n cursor: pointer;\n color: var(--input-labelset-label-readOnly);\n ":"\n cursor: pointer;\n color: var(--input-labelset-label-default);\n "),(({$size:e})=>a(e)),(({$isRequired:e,$size:t,$disabled:r})=>e&&l(['display:inline-flex;align-items:center;::after{content:"*";color:',";font:",";margin-left:4px;}"],r?"var(--input-labelset-label-disabled)":"var(--input-labelset-label-required)",a(t))));export{t as default};
@@ -0,0 +1 @@
1
+ import o,{css as e}from"styled-components";const r=o.span.withConfig({displayName:"error-border.style__ErrorBorder",componentId:"sc-16eee200-0"})(["",""],(({warning:o})=>e(["position:absolute;z-index:6;width:2px;background-color:",";left:-12px;bottom:0px;top:0px;"],o?"var(--colorsSemanticCaution500)":"var(--colorsSemanticNegative500)")));export{r as default};