carbon-react 158.50.0-beta.1 → 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 (305) 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/__spec_helper__/mock-match-media.d.ts +0 -2
  65. package/esm/__spec_helper__/mock-match-media.js +1 -1
  66. package/esm/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
  67. package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  68. package/esm/components/checkbox/checkbox.style.js +1 -1
  69. package/esm/components/date/date.component.js +1 -1
  70. package/esm/components/date/date.style.js +1 -1
  71. package/esm/components/date-range/date-range.style.js +1 -1
  72. package/esm/components/file-input/file-input.component.d.ts +1 -1
  73. package/esm/components/file-input/file-input.component.js +1 -1
  74. package/esm/components/file-input/file-input.style.d.ts +1 -1
  75. package/esm/components/file-input/file-input.style.js +1 -1
  76. package/esm/components/icon/icon.style.js +1 -1
  77. package/esm/components/inline-inputs/inline-inputs.component.d.ts +5 -1
  78. package/esm/components/inline-inputs/inline-inputs.component.js +1 -1
  79. package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
  80. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  81. package/esm/components/number/number.component.js +1 -1
  82. package/esm/components/numeral-date/numeral-date.component.d.ts +6 -3
  83. package/esm/components/numeral-date/numeral-date.component.js +1 -1
  84. package/esm/components/numeral-date/numeral-date.style.d.ts +2 -14
  85. package/esm/components/numeral-date/numeral-date.style.js +1 -1
  86. package/esm/components/pager/__internal__/pager-navigation.component.js +1 -1
  87. package/esm/components/pager/pager.component.js +1 -1
  88. package/esm/components/pager/pager.style.js +1 -1
  89. package/esm/components/search/search-button.style.js +1 -1
  90. package/esm/components/search/search.component.js +1 -1
  91. package/esm/components/search/search.style.js +1 -1
  92. package/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
  93. package/esm/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
  94. package/esm/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
  95. package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  96. package/esm/components/select/filterable-select/filterable-select.component.js +1 -1
  97. package/esm/components/select/multi-select/multi-select.component.js +1 -1
  98. package/esm/components/select/multi-select/multi-select.style.js +1 -1
  99. package/esm/components/select/select.style.js +1 -1
  100. package/esm/components/select/simple-select/simple-select.component.js +1 -1
  101. package/esm/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
  102. package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  103. package/esm/components/switch/switch.component.js +1 -1
  104. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
  105. package/esm/components/text-editor/text-editor.component.js +1 -1
  106. package/esm/components/textarea/textarea.component.d.ts +4 -2
  107. package/esm/components/textarea/textarea.component.js +1 -1
  108. package/esm/components/textarea/textarea.style.js +1 -1
  109. package/esm/components/textbox/__internal__/__next__/index.d.ts +2 -0
  110. package/esm/components/textbox/__internal__/__next__/index.js +1 -0
  111. package/esm/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
  112. package/esm/components/textbox/__internal__/__next__/text-input.component.js +1 -0
  113. package/esm/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
  114. package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -0
  115. package/esm/components/textbox/__internal__/__next__/utils.d.ts +81 -0
  116. package/esm/components/textbox/__internal__/__next__/utils.js +1 -0
  117. package/esm/components/textbox/textbox.component.d.ts +21 -17
  118. package/esm/components/textbox/textbox.component.js +1 -1
  119. package/esm/components/tile-select/tile-select.style.d.ts +1 -1
  120. package/esm/components/tile-select/tile-select.style.js +1 -1
  121. package/esm/components/time/time.component.d.ts +1 -1
  122. package/esm/components/time/time.component.js +1 -1
  123. package/esm/components/time/time.style.d.ts +1 -1
  124. package/esm/components/time/time.style.js +1 -1
  125. package/esm/global.d.ts +0 -2
  126. package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +1 -1
  127. package/esm/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
  128. package/esm/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
  129. package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
  130. package/esm/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
  131. package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -9
  132. package/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
  133. package/esm/style/themes/apply-base-theme.d.ts +3 -1
  134. package/esm/style/themes/apply-base-theme.js +1 -1
  135. package/lib/__internal__/checkable-input/__next__/checkable-input.component.js +1 -1
  136. package/lib/__internal__/checkable-input/__next__/checkable-input.style.js +1 -1
  137. package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
  138. package/lib/__internal__/error-border/error-border.style.d.ts +4 -0
  139. package/lib/__internal__/error-border/error-border.style.js +1 -0
  140. package/lib/__internal__/fieldset/__next__/fieldset.component.js +1 -1
  141. package/lib/__internal__/fieldset/fieldset.component.js +1 -1
  142. package/lib/__internal__/fieldset-validation-context/fieldset-validation-context.d.ts +6 -0
  143. package/lib/__internal__/fieldset-validation-context/index.d.ts +1 -0
  144. package/lib/__internal__/fieldset-validation-context/index.js +1 -0
  145. package/lib/__internal__/fieldset-validation-context/package.json +6 -0
  146. package/lib/__internal__/form-field/form-field.component.d.ts +1 -1
  147. package/lib/__internal__/form-field/form-field.component.js +1 -1
  148. package/lib/__internal__/hint-text/hint-text.component.d.ts +6 -21
  149. package/lib/__internal__/hint-text/hint-text.component.js +1 -1
  150. package/lib/__internal__/hint-text/hint-text.style.d.ts +5 -2
  151. package/lib/__internal__/hint-text/hint-text.style.js +1 -1
  152. package/lib/__internal__/hint-text/index.d.ts +0 -1
  153. package/lib/__internal__/input/index.d.ts +2 -5
  154. package/lib/__internal__/input/index.js +1 -1
  155. package/lib/__internal__/input/input-style-overrides.style.d.ts +8 -0
  156. package/lib/__internal__/input/input-style-overrides.style.js +1 -0
  157. package/lib/__internal__/input/input.component.d.ts +22 -31
  158. package/lib/__internal__/input/input.component.js +1 -1
  159. package/lib/__internal__/input/input.style.d.ts +9 -5
  160. package/lib/__internal__/input/input.style.js +1 -1
  161. package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.d.ts +9 -3
  162. package/lib/__internal__/input-icon-toggle/input-icon-toggle.component.js +1 -1
  163. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.d.ts +7 -9
  164. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  165. package/lib/__internal__/label/index.d.ts +0 -1
  166. package/lib/__internal__/label/label.component.d.ts +14 -31
  167. package/lib/__internal__/label/label.component.js +1 -1
  168. package/lib/__internal__/label/label.style.d.ts +5 -22
  169. package/lib/__internal__/label/label.style.js +1 -1
  170. package/lib/__internal__/legacy-error-border/error-border.style.js +1 -0
  171. package/lib/__internal__/legacy-hint-text/hint-text.component.d.ts +27 -0
  172. package/lib/__internal__/legacy-hint-text/hint-text.component.js +1 -0
  173. package/lib/__internal__/legacy-hint-text/hint-text.style.d.ts +3 -0
  174. package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -0
  175. package/lib/__internal__/legacy-hint-text/index.d.ts +2 -0
  176. package/lib/__internal__/legacy-hint-text/index.js +1 -0
  177. package/lib/__internal__/legacy-hint-text/package.json +6 -0
  178. package/lib/__internal__/legacy-input/index.d.ts +5 -0
  179. package/lib/__internal__/legacy-input/index.js +1 -0
  180. package/{esm/__internal__/input → lib/__internal__/legacy-input}/input-presentation.style.d.ts +1 -1
  181. package/lib/__internal__/{input → legacy-input}/input-presentation.style.js +1 -1
  182. package/lib/__internal__/legacy-input/input.component.d.ts +54 -0
  183. package/lib/__internal__/legacy-input/input.component.js +1 -0
  184. package/lib/__internal__/legacy-input/input.style.d.ts +3 -0
  185. package/lib/__internal__/legacy-input/input.style.js +1 -0
  186. package/lib/__internal__/legacy-input/package.json +6 -0
  187. package/lib/__internal__/legacy-label/index.d.ts +2 -0
  188. package/lib/__internal__/legacy-label/index.js +1 -0
  189. package/lib/__internal__/legacy-label/label.component.d.ts +37 -0
  190. package/lib/__internal__/legacy-label/label.component.js +1 -0
  191. package/lib/__internal__/legacy-label/label.style.d.ts +25 -0
  192. package/lib/__internal__/legacy-label/label.style.js +1 -0
  193. package/lib/__internal__/legacy-label/package.json +6 -0
  194. package/lib/__internal__/utils/helpers/combine-refs/index.d.ts +3 -0
  195. package/lib/__internal__/utils/helpers/combine-refs/index.js +1 -0
  196. package/lib/__internal__/utils/helpers/combine-refs/package.json +6 -0
  197. package/lib/__internal__/validation-message/__next__/index.d.ts +1 -0
  198. package/lib/__internal__/validation-message/__next__/index.js +1 -0
  199. package/lib/__internal__/validation-message/__next__/package.json +6 -0
  200. package/lib/__internal__/validation-message/__next__/validation-message.component.d.ts +20 -0
  201. package/lib/__internal__/validation-message/__next__/validation-message.component.js +1 -0
  202. package/lib/__internal__/validation-message/__next__/validation-message.style.d.ts +6 -0
  203. package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -0
  204. package/lib/__spec_helper__/mock-match-media.d.ts +0 -2
  205. package/lib/__spec_helper__/mock-match-media.js +1 -1
  206. package/lib/components/button-toggle/button-toggle-group/button-toggle-group.component.js +1 -1
  207. package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  208. package/lib/components/checkbox/checkbox.style.js +1 -1
  209. package/lib/components/date/date.component.js +1 -1
  210. package/lib/components/date/date.style.js +1 -1
  211. package/lib/components/date-range/date-range.style.js +1 -1
  212. package/lib/components/file-input/file-input.component.d.ts +1 -1
  213. package/lib/components/file-input/file-input.component.js +1 -1
  214. package/lib/components/file-input/file-input.style.d.ts +1 -1
  215. package/lib/components/file-input/file-input.style.js +1 -1
  216. package/lib/components/icon/icon.style.js +1 -1
  217. package/lib/components/inline-inputs/inline-inputs.component.d.ts +5 -1
  218. package/lib/components/inline-inputs/inline-inputs.component.js +1 -1
  219. package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
  220. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  221. package/lib/components/number/number.component.js +1 -1
  222. package/lib/components/numeral-date/numeral-date.component.d.ts +6 -3
  223. package/lib/components/numeral-date/numeral-date.component.js +1 -1
  224. package/lib/components/numeral-date/numeral-date.style.d.ts +2 -14
  225. package/lib/components/numeral-date/numeral-date.style.js +1 -1
  226. package/lib/components/pager/__internal__/pager-navigation.component.js +1 -1
  227. package/lib/components/pager/pager.component.js +1 -1
  228. package/lib/components/pager/pager.style.js +1 -1
  229. package/lib/components/search/search-button.style.js +1 -1
  230. package/lib/components/search/search.component.js +1 -1
  231. package/lib/components/search/search.style.js +1 -1
  232. package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +12 -3
  233. package/lib/components/select/__internal__/select-textbox/select-textbox.component.js +1 -1
  234. package/lib/components/select/__internal__/select-textbox/select-textbox.style.d.ts +10 -3
  235. package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  236. package/lib/components/select/filterable-select/filterable-select.component.js +1 -1
  237. package/lib/components/select/multi-select/multi-select.component.js +1 -1
  238. package/lib/components/select/multi-select/multi-select.style.js +1 -1
  239. package/lib/components/select/select.style.js +1 -1
  240. package/lib/components/select/simple-select/simple-select.component.js +1 -1
  241. package/lib/components/simple-color-picker/simple-color/simple-color.style.d.ts +1 -1
  242. package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  243. package/lib/components/switch/switch.component.js +1 -1
  244. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.component.js +1 -1
  245. package/lib/components/text-editor/text-editor.component.js +1 -1
  246. package/lib/components/textarea/textarea.component.d.ts +4 -2
  247. package/lib/components/textarea/textarea.component.js +1 -1
  248. package/lib/components/textarea/textarea.style.js +1 -1
  249. package/lib/components/textbox/__internal__/__next__/index.d.ts +2 -0
  250. package/lib/components/textbox/__internal__/__next__/index.js +1 -0
  251. package/lib/components/textbox/__internal__/__next__/package.json +6 -0
  252. package/lib/components/textbox/__internal__/__next__/text-input.component.d.ts +91 -0
  253. package/lib/components/textbox/__internal__/__next__/text-input.component.js +1 -0
  254. package/lib/components/textbox/__internal__/__next__/text-input.style.d.ts +21 -0
  255. package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -0
  256. package/lib/components/textbox/__internal__/__next__/utils.d.ts +81 -0
  257. package/lib/components/textbox/__internal__/__next__/utils.js +1 -0
  258. package/lib/components/textbox/textbox.component.d.ts +21 -17
  259. package/lib/components/textbox/textbox.component.js +1 -1
  260. package/lib/components/tile-select/tile-select.style.d.ts +1 -1
  261. package/lib/components/tile-select/tile-select.style.js +1 -1
  262. package/lib/components/time/time.component.d.ts +1 -1
  263. package/lib/components/time/time.component.js +1 -1
  264. package/lib/components/time/time.style.d.ts +1 -1
  265. package/lib/components/time/time.style.js +1 -1
  266. package/lib/global.d.ts +0 -2
  267. package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +1 -1
  268. package/lib/hooks/__internal__/useRegisterValidationToTabs/index.d.ts +0 -0
  269. package/lib/hooks/__internal__/useRegisterValidationToTabs/index.js +1 -0
  270. package/lib/hooks/__internal__/useRegisterValidationToTabs/package.json +6 -0
  271. package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.d.ts +2 -0
  272. package/lib/hooks/__internal__/useRegisterValidationToTabs/useRegisterValidationToTabs.js +1 -0
  273. package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -9
  274. package/lib/hooks/useMediaQuery/useMediaQuery.js +1 -1
  275. package/lib/style/themes/apply-base-theme.d.ts +3 -1
  276. package/lib/style/themes/apply-base-theme.js +1 -1
  277. package/package.json +1 -1
  278. package/esm/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
  279. package/esm/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
  280. package/esm/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
  281. package/esm/components/textbox/__internal__/prefix.style.d.ts +0 -5
  282. package/esm/components/textbox/__internal__/prefix.style.js +0 -1
  283. package/esm/components/textbox/textbox.style.js +0 -1
  284. package/lib/components/numeral-date/__internal__/numeral-date.context.d.ts +0 -6
  285. package/lib/components/select/__internal__/select-textbox/select-textbox.context.d.ts +0 -5
  286. package/lib/components/select/__internal__/select-textbox/select-textbox.context.js +0 -1
  287. package/lib/components/textbox/__internal__/prefix.style.d.ts +0 -5
  288. package/lib/components/textbox/__internal__/prefix.style.js +0 -1
  289. package/lib/components/textbox/textbox.style.js +0 -1
  290. /package/esm/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
  291. /package/esm/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
  292. /package/esm/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
  293. /package/esm/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
  294. /package/esm/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
  295. /package/esm/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
  296. /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
  297. /package/esm/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
  298. /package/lib/{components/numeral-date/__internal__/numeral-date.context.js → __internal__/fieldset-validation-context/fieldset-validation-context.js} +0 -0
  299. /package/lib/{components/textbox/textbox.style.d.ts → __internal__/legacy-error-border/error-border.style.d.ts} +0 -0
  300. /package/lib/__internal__/{input → legacy-input}/input-presentation.component.d.ts +0 -0
  301. /package/lib/__internal__/{input → legacy-input}/input-presentation.component.js +0 -0
  302. /package/lib/__internal__/{input → legacy-input}/input-sizes.style.d.ts +0 -0
  303. /package/lib/__internal__/{input → legacy-input}/input-sizes.style.js +0 -0
  304. /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.d.ts +0 -0
  305. /package/lib/__internal__/{label → legacy-label}/icon-wrapper.style.js +0 -0
@@ -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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react/jsx-runtime");require("react");var e=require("../../components/icon/icon.component.js"),o=require("./input-icon-toggle.style.js"),i=require("../validations/validation-icon.component.js");exports.default=({disabled:r,readOnly:t,size:a,inputIcon:l,onClick:s,onFocus:d,onBlur:u,onMouseDown:c,error:p,warning:g,info:f,useValidationIcon:x,align:I,iconTabIndex:j,validationIconId:b})=>x&&!r&&(({error:n,warning:e,info:o})=>"string"==typeof(n||e||o||null))({error:p,warning:g,info:f})?n.jsx(o.default,{size:a,children:n.jsx(i.ValidationIcon,{error:p,warning:g,info:f,size:a,onClick:s,onFocus:d,onBlur:u,isPartOfInput:!0,tabIndex:j,tooltipId:b,tooltipPosition:"right"===I?"left":"right"})}):l?n.jsx(o.default,{size:a,onClick:s,onFocus:d,onBlur:u,onMouseDown:c,"data-element":"input-icon-toggle",disabled:r,readOnly:t,"data-role":"input-icon-toggle","aria-hidden":"true",tabIndex:-1,children:n.jsx(e.default,{disabled:r||t,type:l})}):null;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react/jsx-runtime"),e=require("react"),o=require("../../components/icon/icon.component.js"),i=require("./input-icon-toggle.style.js"),t=require("../validations/validation-icon.component.js");exports.default=({disabled:r,readOnly:l,size:a,inputIcon:u,onClick:s,onFocus:c,onBlur:d,onMouseDown:g,error:p,warning:f,info:y,useValidationIcon:b,align:x,iconTabIndex:I,validationIconId:j,blockFocusStyling:k})=>{const v=e.useCallback((n=>{if(" "===n.key||"Enter"===n.key)return n.preventDefault(),null==s?void 0:s(n)}),[s]);return b&&!r&&(({error:n,warning:e,info:o})=>"string"==typeof(n||e||o||null))({error:p,warning:f,info:y})?n.jsx(i.default,{$size:a,children:n.jsx(t.ValidationIcon,{error:p,warning:f,info:y,size:a,onClick:s,onFocus:c,onBlur:d,isPartOfInput:!0,tabIndex:I,tooltipId:j,tooltipPosition:"right"===x?"left":"right"})}):u?n.jsx(i.default,{$size:a,onClick:s,onFocus:c,onBlur:d,onMouseDown:g,onKeyDown:s&&v,"data-element":"input-icon-toggle",$disabled:r,$readOnly:l,"data-role":"input-icon-toggle","aria-hidden":"true",tabIndex:k?void 0:-1,$blockFocusStyling:k,children:n.jsx(o.default,{disabled:r||l,type:u})}):null};
@@ -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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../input/input-sizes.style.js"),s=require("../../style/utils/add-focus-styling.js");function n(e){return e&&e.__esModule?e:{default:e}}const l=n(e).default.span.attrs((({onClick:e})=>({onKeyDown:t=>!e||" "!==t.key&&"Enter"!==t.key?t:(t.preventDefault(),e(t))}))).withConfig({displayName:"input-icon-toggle.style__InputIconToggleStyle",componentId:"sc-9d7ce65f-0"})(["align-items:center;cursor:pointer;display:flex;justify-content:center;"," "," "," &:focus{","}"],(({size:s="medium"})=>e.css(["width:",";"],t.default[s].height)),(({disabled:t})=>t&&e.css(["cursor:not-allowed;"])),(({readOnly:t})=>t&&e.css(["cursor:default;"])),s.default());exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../legacy-input/input-sizes.style.js"),s=require("../../style/utils/add-focus-styling.js");function l(e){return e&&e.__esModule?e:{default:e}}const i=l(e).default.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:s="medium"})=>e.css(["width:",";"],t.default[s].height)),(({$disabled:t})=>t&&e.css(["cursor:not-allowed;"])),(({$readOnly:t})=>t&&e.css(["cursor:default;"])),(({$blockFocusStyling:t})=>!t&&e.css(["&:focus{","}"],s.default())));exports.default=i;
@@ -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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../components/help/help.component.js"),n=require("./label.style.js"),o=require("../validations/validation-icon.component.js"),i=require("./icon-wrapper.style.js"),l=require("../input-behaviour/input-behaviour.component.js"),a=require("../input-behaviour/input-group-behaviour.component.js"),u=require("../utils/helpers/guid/index.js");function s(e){return e&&e.__esModule?e:{default:e}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function p(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){c(e,r,t[r])}))}return e}function d(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const b=({align:s,as:c="label",children:b,disabled:f,error:j,help:g,helpIcon:h,htmlFor:y,info:O,inline:m,isDarkBackground:v=!1,isRequired:w,labelId:x,pr:P,pl:q,tooltipId:I,useValidationIcon:k=!0,validationIconId:M,warning:C,width:L=30,className:D,onClick:S,"aria-label":E,isLarge:F})=>{const[_,B]=r.useState(!1),{onMouseEnter:R,onMouseLeave:N}=r.useContext(l.InputContext),{onMouseEnter:V,onMouseLeave:G}=r.useContext(a.InputGroupContext),H=r.useRef(u.default());let $;return $=m&&!s?"right":s||"left",e.jsxs(n.StyledLabelContainer,{"data-role":"label-container",id:`label-container-${null!=x?x:H.current}`,align:$,inline:m,width:L,pr:P,pl:q,className:D,onClick:S,children:[e.jsx(n.default,d(p({"data-element":"label",disabled:f,id:x},"label"===c?{htmlFor:y}:{}),{onMouseEnter:()=>{R&&R(),V&&V()},onMouseLeave:()=>{N&&N(),G&&G()},isRequired:w,as:c,"aria-label":E,isDarkBackground:v,isLarge:F,children:b})),(()=>{const r={onFocus:()=>B(!0),onBlur:()=>B(!1)};if(k&&(({error:e,warning:r,info:t,disabled:n})=>!n&&"string"==typeof(e||r||t))({error:j,warning:C,info:O,disabled:f})){const r=(({error:e,warning:r,info:t,inline:n})=>(e||r||t)&&n?"top":"right")({error:j,warning:C,info:O,inline:m});return e.jsx(i.default,{children:e.jsx(o.ValidationIcon,{tooltipId:M,error:j,warning:C,info:O,tooltipPosition:r,tooltipFlipOverrides:["top","bottom"]})})}return g&&e.jsx(i.default,d(p({},r),{children:e.jsx(t.Help,{tooltipId:I,type:h,isFocused:_,children:g})}))})()]})};var f=s(r).default.memo(b);exports.Label=b,exports.default=f;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),l=require("./label.style.js");function t(e){return e&&e.__esModule?e:{default:e}}const a=({children:r,id:t,htmlFor:a,size:d,isRequired:i,disabled:s,readOnly:u})=>e.jsx(l.default,{id:t,htmlFor:a,$size:d,$isRequired:i,$disabled:s,$readOnly:u,"data-component":"label","data-element":"label",children:r});var d=t(r).default.memo(a);exports.Label=a,exports.default=d;
@@ -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
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}var i=t(e);const s=i.default.label.withConfig({displayName:"label.style__StyledLabel",componentId:"sc-16363be4-0"})([""," display:block;font-weight:var(--fontWeights500);&:hover{cursor:pointer;}"," "," ",""],(({isDarkBackground:t})=>e.css(["color:",";"],t?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)")),(({isLarge:t})=>t&&e.css(["font-size:var(--fontSizes200);"])),(({isRequired:t})=>t&&e.css(['::after{content:"*";color:var(--colorsSemanticNegative500);font-weight:var(--fontWeights500);margin-left:var(--spacing050);}'])),(({disabled:t})=>t&&e.css(["color:var(--colorsUtilityYin030);&:hover{cursor:not-allowed;}"]))),o=i.default.div.withConfig({displayName:"label.style__StyledLabelContainer",componentId:"sc-16363be4-1"})(["display:flex;align-items:center;margin-bottom:8px;"," ",""],(({align:t})=>e.css(["justify-content:",";"],"right"!==t?"flex-start":"flex-end")),(({inline:t,pr:i,pl:s,width:o})=>t&&e.css(["box-sizing:border-box;margin-bottom:0;",";",";width:","%;"],i&&e.css(["padding-right:var(",");"],1===i?"--spacing100":"--spacing200"),s&&e.css(["padding-left:var(",");"],1===s?"--spacing100":"--spacing200"),o)));exports.StyledLabelContainer=o,exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function l(e){return e&&e.__esModule?e:{default:e}}const t=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)"}},a=l(e).default.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})=>t(e)),(({$isRequired:l,$size:a,$disabled:r})=>l&&e.css(['display:inline-flex;align-items:center;::after{content:"*";color:',";font:",";margin-left:4px;}"],r?"var(--input-labelset-label-disabled)":"var(--input-labelset-label-required)",t(a))));exports.default=a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function o(e){return e&&e.__esModule?e:{default:e}}const t=o(e).default.span.withConfig({displayName:"error-border.style__ErrorBorder",componentId:"sc-16eee200-0"})(["",""],(({warning:o})=>e.css(["position:absolute;z-index:6;width:2px;background-color:",";left:-12px;bottom:0px;top:0px;"],o?"var(--colorsSemanticCaution500)":"var(--colorsSemanticNegative500)")));exports.default=t;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ export interface HintTextProps {
3
+ /** The alignment of the hint text */
4
+ align?: "left" | "right";
5
+ /** Children elements */
6
+ children?: React.ReactNode;
7
+ /** Sets the font weight for the hint text */
8
+ fontWeight?: string;
9
+ /** Sets the id for the component. */
10
+ 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;
25
+ }
26
+ export declare const HintText: ({ align, children, fontWeight, id, isComponentInline, isDarkBackground, isDisabled, marginBottom, marginTop, maxWidth, isLarge, }: HintTextProps) => React.JSX.Element | null;
27
+ export default HintText;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("./hint-text.style.js"),n=require("../../components/carbon-provider/__internal__/new-validation.context.js");const r=({align:r,children:a,fontWeight:o,id:s,isComponentInline:d=!1,isDarkBackground:l=!1,isDisabled:u=!1,marginBottom:c="var(--spacing100)",marginTop:g="var(--spacing000)",maxWidth:p,isLarge:m})=>{const{validationRedesignOptIn:x}=t.useContext(n.default);return d&&!x?null:e.jsx(i.default,{align:r,"data-element":"input-hint","data-role":"hint-text",fontWeight:o,id:s,isDarkBackground:l,isDisabled:u,marginBottom:c,marginTop:g,maxWidth:p,isLarge:m,children:a})};exports.HintText=r,exports.default=r;
@@ -0,0 +1,3 @@
1
+ import { HintTextProps } from "./hint-text.component";
2
+ declare const StyledHintText: import("styled-components").StyledComponent<"div", any, HintTextProps, never>;
3
+ export default StyledHintText;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("styled-components");function e(t){return t&&t.__esModule?t:{default:t}}const i=e(t).default.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:e})=>e&&t.css(["font-size:var(--fontSizes200);"])),(({align:e})=>t.css(["justify-content:",";"],"right"!==e?"flex-start":"flex-end")),(({marginBottom:t})=>t),(({marginTop:t})=>t),(({isDarkBackground:e,isDisabled:i})=>t.css(["color:",";"],((t,e)=>t?"var(--colorsUtilityYang080)":e?"var(--colorsUtilityYin030)":"var(--colorsUtilityYin055)")(e,i))),(({fontWeight:e})=>e&&t.css(["font-weight:",";"],e)),(({maxWidth:e})=>e&&t.css(["max-width:",";"],e)));exports.default=i;
@@ -0,0 +1,2 @@
1
+ export { default } from "./hint-text.component";
2
+ export type { HintTextProps } from "./hint-text.component";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./hint-text.component.js");exports.default=e.HintText;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/__internal__/legacy-hint-text/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./input.component.js"),t=require("./input-presentation.component.js");exports.Input=e.default,exports.default=e.default,exports.InputPresentation=t.default;
@@ -2,5 +2,5 @@ import { CommonInputPresentationProps } from "./input-presentation.component";
2
2
  import { InputContextProps } from "../input-behaviour";
3
3
  import { CarbonProviderProps } from "../../components/carbon-provider";
4
4
  export declare const StyledInputPresentationContainer: import("styled-components").StyledComponent<"div", any, Pick<CommonInputPresentationProps, "maxWidth" | "inputWidth">, never>;
5
- declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "prefix" | "readOnly" | "size" | "align" | "borderRadius" | "hasIcon" | "hideBorders"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
5
+ declare const InputPresentationStyle: import("styled-components").StyledComponent<"div", any, Pick<InputContextProps, "hasFocus"> & Pick<CommonInputPresentationProps, "disabled" | "error" | "info" | "warning" | "readOnly" | "size" | "align" | "borderRadius" | "hasIcon" | "hideBorders"> & Pick<CarbonProviderProps, "validationRedesignOptIn">, never>;
6
6
  export default InputPresentationStyle;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("./input-sizes.style.js"),t=require("./input.style.js"),i=require("../../style/utils/add-focus-styling.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=o(e);const a=n.default.div.withConfig({displayName:"input-presentation.style__StyledInputPresentationContainer",componentId:"sc-5369fb17-0"})(["flex:0 0 ","%;display:flex;position:relative;max-width:",";"],(({inputWidth:e})=>e),(({maxWidth:e})=>e?`${e}`:"100%")),s=n.default.div.withConfig({displayName:"input-presentation.style__InputPresentationStyle",componentId:"sc-5369fb17-1"})(["align-items:stretch;background:var(--colorsUtilityYang100);"," box-sizing:border-box;cursor:text;display:flex;flex-wrap:wrap;width:100%;margin:0;"," "," "," "," "," "," "," input::-ms-clear{display:none;}input::-webkit-contacts-auto-fill-button{display:none !important;}"],(({hideBorders:e})=>e?"border: 1px solid transparent;":"border: 1px solid var(--colorsUtilityMajor300);"),(({borderRadius:e})=>Array.isArray(e)?`border-radius: ${e.map((e=>`var(--${e})`)).join(" ")};`:`border-radius: var(--${e});`),(({size:i,hasIcon:o,align:n})=>i&&e.css(["min-height:",";","{padding:0 ",";"," ","}"],r.default[i].height,t.default,r.default[i].horizontalPadding,o&&"right"===n&&"padding-left: 0;",o&&"left"===n&&"padding-right: 0;")),(({disabled:r,hideBorders:t})=>r&&e.css(["background:var(--colorsUtilityDisabled400);border-color:",";cursor:not-allowed;"],t?"transparent":"var(--colorsUtilityDisabled600)")),(({hasFocus:r})=>r&&e.css(["&{"," z-index:2;}"],i.default())),(function({error:r,warning:t,info:i,disabled:o,validationRedesignOptIn:n}){let a;if(o)return"";if(r)a="var(--colorsSemanticNegative500)";else if(t)a=n?"var(--colorsUtilityMajor300)":"var(--colorsSemanticCaution500)";else{if(!i)return"";a="var(--colorsSemanticInfo500)"}return e.css(["border-color:"," !important;z-index:1;",""],a,r&&`box-shadow: inset 1px 1px 0 ${a}, inset -1px -1px 0 ${a};`)}),(({readOnly:r,hideBorders:t})=>r&&e.css(["background-color:var(--colorsUtilityReadOnly400);border-color:",";"],t?"transparent":"var(--colorsUtilityReadOnly600)")),(({align:e,prefix:r})=>"right"===e&&`flex-direction: ${r?"row":"row-reverse"};\n `));exports.StyledInputPresentationContainer=a,exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("./input-sizes.style.js"),t=require("./input.style.js"),i=require("../../style/utils/add-focus-styling.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=o(e);const a=n.default.div.withConfig({displayName:"input-presentation.style__StyledInputPresentationContainer",componentId:"sc-83661d80-0"})(["flex:0 0 ","%;display:flex;position:relative;max-width:",";"],(({inputWidth:e})=>e),(({maxWidth:e})=>e?`${e}`:"100%")),s=n.default.div.withConfig({displayName:"input-presentation.style__InputPresentationStyle",componentId:"sc-83661d80-1"})(["align-items:stretch;background:var(--colorsUtilityYang100);"," box-sizing:border-box;cursor:text;display:flex;flex-wrap:wrap;width:100%;margin:0;"," "," "," "," "," "," "," input::-ms-clear{display:none;}input::-webkit-contacts-auto-fill-button{display:none !important;}"],(({hideBorders:e})=>e?"border: 1px solid transparent;":"border: 1px solid var(--colorsUtilityMajor300);"),(({borderRadius:e})=>Array.isArray(e)?`border-radius: ${e.map((e=>`var(--${e})`)).join(" ")};`:`border-radius: var(--${e});`),(({size:i,hasIcon:o,align:n})=>i&&e.css(["min-height:",";","{padding:0 ",";"," ","}"],r.default[i].height,t.default,r.default[i].horizontalPadding,o&&"right"===n&&"padding-left: 0;",o&&"left"===n&&"padding-right: 0;")),(({disabled:r,hideBorders:t})=>r&&e.css(["background:var(--colorsUtilityDisabled400);border-color:",";cursor:not-allowed;"],t?"transparent":"var(--colorsUtilityDisabled600)")),(({hasFocus:r})=>r&&e.css(["&{"," z-index:2;}"],i.default())),(function({error:r,warning:t,info:i,disabled:o,validationRedesignOptIn:n}){let a;if(o)return"";if(r)a="var(--colorsSemanticNegative500)";else if(t)a=n?"var(--colorsUtilityMajor300)":"var(--colorsSemanticCaution500)";else{if(!i)return"";a="var(--colorsSemanticInfo500)"}return e.css(["border-color:"," !important;z-index:1;",""],a,r&&`box-shadow: inset 1px 1px 0 ${a}, inset -1px -1px 0 ${a};`)}),(({readOnly:r})=>r&&e.css(["background-color:var(--colorsUtilityReadOnly400);border-color:transparent;"])),(({align:e})=>"right"===e&&"flex-direction: row-reverse;\n "));exports.StyledInputPresentationContainer=a,exports.default=s;
@@ -0,0 +1,54 @@
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";
6
+ /** The ID of the input's description, is set along with hint text and error message. */
7
+ "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
+ /** If true, the component will be disabled */
13
+ disabled?: boolean;
14
+ /** HTML id attribute of the input */
15
+ 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
+ /** Name of the input */
19
+ name?: string;
20
+ /** Specify a callback triggered on blur */
21
+ onBlur?: (ev: React.FocusEvent<HTMLInputElement>) => void;
22
+ /** 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;
26
+ /** Specify a callback triggered on focus */
27
+ onFocus?: (ev: React.FocusEvent<HTMLInputElement>) => void;
28
+ /** Specify a callback triggered on keyDown */
29
+ onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
30
+ /** Placeholder string to be displayed in input */
31
+ placeholder?: string;
32
+ /** If true, the component will be read-only */
33
+ readOnly?: boolean;
34
+ /** Flag to configure component as mandatory */
35
+ required?: boolean;
36
+ /** Id of the validation icon */
37
+ validationIconId?: string;
38
+ /** The value of the input */
39
+ value: string | readonly string[] | number | undefined;
40
+ }
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>>;
54
+ export default Input;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./input.style.js"),n=require("../input-behaviour/input-behaviour.component.js"),o=require("../input-behaviour/input-group-behaviour.component.js");function u(e){return e&&e.__esModule?e:{default:e}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a=u(t).default.forwardRef(((u,a)=>{var{align:l,"aria-labelledby":c,"aria-describedby":s,placeholder:d,disabled:f,readOnly:p,autoFocus:b,onClick:y,onChangeDeferred:O,onChange:v,onBlur:h,onFocus:g,deferTimeout:j,type:m="text",id:P,name:B,validationIconId:C,inputBorderRadius:w="borderRadius050",enterKeyHint:x}=u,F=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}(u,["align","aria-labelledby","aria-describedby","placeholder","disabled","readOnly","autoFocus","onClick","onChangeDeferred","onChange","onBlur","onFocus","deferTimeout","type","id","name","validationIconId","inputBorderRadius","enterKeyHint"]);const R=t.useContext(n.InputContext),k=t.useContext(o.InputGroupContext),I=t.useRef(null);let S=t.useRef(null);a&&"current"in a&&(S=a);const E=t.useCallback((e=>{S.current=e,"function"==typeof a&&a(e),b&&e&&e.focus(),x&&e&&e.setAttribute("enterkeyhint",x)}),[b,a,x]);t.useEffect((()=>{R.inputRef&&R.inputRef(S)}),[R,S]),t.useEffect((()=>{f&&R.onBlur&&R.onBlur()}),[f,R]);const D=s?[s]:[];(R.hasFocus||k.hasFocus||R.hasMouseOver||k.hasMouseOver)&&C&&D.push(C);const q=D.length?D.filter(Boolean).join(" "):void 0;return e.jsx(r.default,(T=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){i(e,t,r[t])}))}return e}({},F),M={"data-has-autofocus":!!b||void 0,"aria-describedby":q,"aria-labelledby":c,align:l,placeholder:d,disabled:f,readOnly:p,name:B,type:m,id:P||B,ref:E,"data-element":"input",onFocus:e=>{g&&g(e),R.onFocus&&R.onFocus(),k.onFocus&&k.onFocus(),"text"===m&&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)}}))}(S)},onBlur:e=>{h&&h(e),R.onBlur&&R.onBlur(),k.onBlur&&k.onBlur()},onClick:f||p?void 0:e=>{var t;y&&y(e),null==S||null===(t=S.current)||void 0===t||t.focus()},onChange:e=>{v&&v(e),(e=>{O&&(I.current&&clearTimeout(I.current),I.current=setTimeout((()=>{O(e)}),j||750))})(e)},inputBorderRadius:w},M=null!=M?M:{},Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(M)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(M)).forEach((function(e){Object.defineProperty(T,e,Object.getOwnPropertyDescriptor(M,e))})),T));var T,M}));a.displayName="Input",exports.default=a;
@@ -0,0 +1,3 @@
1
+ import { CommonInputProps } from "./input.component";
2
+ declare const StyledInput: import("styled-components").StyledComponent<"input", any, Pick<CommonInputProps, "disabled" | "align" | "inputBorderRadius">, never>;
3
+ export default StyledInput;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("styled-components");function e(r){return r&&r.__esModule?r:{default:r}}const t=e(r).default.input.withConfig({displayName:"input.style__StyledInput",componentId:"sc-745cf632-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);}"," ",""],(({inputBorderRadius:r})=>Array.isArray(r)?`border-radius: ${r.map((r=>`var(--${r})`)).join(" ")};`:`border-radius: var(--${r});`),(({align:e})=>e&&r.css(["text-align:",";"],e)),(({disabled:e})=>e&&r.css(["color:var(--colorsUtilityYin030);cursor:not-allowed;"])));exports.default=t;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/__internal__/legacy-input/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from "./label.component";
2
+ export type { LabelProps } from "./label.component";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./label.component.js");exports.default=e.default;
@@ -0,0 +1,37 @@
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";
7
+ /** Children elements */
8
+ 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 */
14
+ 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;
34
+ }
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>;
37
+ export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../components/help/help.component.js"),n=require("./label.style.js"),o=require("../validations/validation-icon.component.js"),i=require("./icon-wrapper.style.js"),l=require("../input-behaviour/input-behaviour.component.js"),a=require("../input-behaviour/input-group-behaviour.component.js"),u=require("../utils/helpers/guid/index.js");function s(e){return e&&e.__esModule?e:{default:e}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function p(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){c(e,r,t[r])}))}return e}function d(e,r){return r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})),e}const b=({align:s,as:c="label",children:b,disabled:f,error:j,help:g,helpIcon:h,htmlFor:y,info:O,inline:m,isDarkBackground:v=!1,isRequired:w,labelId:x,pr:P,pl:q,tooltipId:I,useValidationIcon:k=!0,validationIconId:M,warning:C,width:L=30,className:D,onClick:S,"aria-label":E,isLarge:F})=>{const[_,B]=r.useState(!1),{onMouseEnter:R,onMouseLeave:N}=r.useContext(l.InputContext),{onMouseEnter:V,onMouseLeave:G}=r.useContext(a.InputGroupContext),H=r.useRef(u.default());let $;return $=m&&!s?"right":s||"left",e.jsxs(n.StyledLabelContainer,{"data-role":"label-container",id:`label-container-${null!=x?x:H.current}`,align:$,inline:m,width:L,pr:P,pl:q,className:D,onClick:S,children:[e.jsx(n.default,d(p({"data-element":"label",disabled:f,id:x},"label"===c?{htmlFor:y}:{}),{onMouseEnter:()=>{R&&R(),V&&V()},onMouseLeave:()=>{N&&N(),G&&G()},isRequired:w,as:c,"aria-label":E,isDarkBackground:v,isLarge:F,children:b})),(()=>{const r={onFocus:()=>B(!0),onBlur:()=>B(!1)};if(k&&(({error:e,warning:r,info:t,disabled:n})=>!n&&"string"==typeof(e||r||t))({error:j,warning:C,info:O,disabled:f})){const r=(({error:e,warning:r,info:t,inline:n})=>(e||r||t)&&n?"top":"right")({error:j,warning:C,info:O,inline:m});return e.jsx(i.default,{children:e.jsx(o.ValidationIcon,{tooltipId:M,error:j,warning:C,info:O,tooltipPosition:r,tooltipFlipOverrides:["top","bottom"]})})}return g&&e.jsx(i.default,d(p({},r),{children:e.jsx(t.Help,{tooltipId:I,type:h,isFocused:_,children:g})}))})()]})};var f=s(r).default.memo(b);exports.Label=b,exports.default=f;
@@ -0,0 +1,25 @@
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;
10
+ }
11
+ 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
+ export default StyledLabel;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}var i=t(e);const s=i.default.label.withConfig({displayName:"label.style__StyledLabel",componentId:"sc-e75e7420-0"})([""," display:block;font-weight:var(--fontWeights500);"," "," ",""],(({isDarkBackground:t})=>e.css(["color:",";"],t?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)")),(({isLarge:t})=>t&&e.css(["font-size:var(--fontSizes200);"])),(({isRequired:t})=>t&&e.css(['::after{content:"*";color:var(--colorsSemanticNegative500);font-weight:var(--fontWeights500);margin-left:var(--spacing050);}'])),(({disabled:t})=>t&&e.css(["color:var(--colorsUtilityYin030);"]))),a=i.default.div.withConfig({displayName:"label.style__StyledLabelContainer",componentId:"sc-e75e7420-1"})(["display:flex;align-items:center;margin-bottom:8px;"," ",""],(({align:t})=>e.css(["justify-content:",";"],"right"!==t?"flex-start":"flex-end")),(({inline:t,pr:i,pl:s,width:a})=>t&&e.css(["box-sizing:border-box;margin-bottom:0;",";",";width:","%;"],i&&e.css(["padding-right:var(",");"],1===i?"--spacing100":"--spacing200"),s&&e.css(["padding-left:var(",");"],1===s?"--spacing100":"--spacing200"),a)));exports.StyledLabelContainer=a,exports.default=s;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/__internal__/legacy-label/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,3 @@
1
+ import { MutableRefObject, RefCallback } from "react";
2
+ declare const _default: <T = unknown>(...refs: (MutableRefObject<T | null> | RefCallback<T> | null | undefined)[]) => RefCallback<T>;
3
+ export default _default;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=(...e)=>t=>{e.forEach((e=>{e&&("function"!=typeof e?"current"in e&&(e.current=t):e(t))}))};
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/__internal__/utils/helpers/combine-refs/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1 @@
1
+ export { default } from "./validation-message.component";
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./validation-message.component.js");exports.default=e.default;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.js",
4
+ "module": "../../../esm/__internal__/validation-message/__next__/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { TagProps } from "../../../__internal__/utils/helpers/tags";
3
+ export interface ValidationMessageProps extends TagProps {
4
+ /**
5
+ * If true, displays error styling. If passed as a valid string, displays error styling
6
+ * and the message as children.
7
+ */
8
+ error?: boolean | string;
9
+ /** Id of the component, to be used for accessibility purposes */
10
+ id?: string;
11
+ /**
12
+ * If true, displays warning styling. If passed as a valid string, displays warning styling
13
+ * and the message as children.
14
+ */
15
+ warning?: boolean | string;
16
+ /** Size of the validation message font */
17
+ size?: "small" | "medium" | "large";
18
+ }
19
+ declare const ValidationMessage: ({ error, id, warning, "data-element": dataElement, "data-role": dataRole, size, }: ValidationMessageProps) => React.JSX.Element | null;
20
+ export default ValidationMessage;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("./validation-message.style.js"),t=require("../../utils/helpers/tags/tags.js");function n(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}exports.default=({error:o,id:a,warning:i,"data-element":s,"data-role":c="validation-message",size:l})=>{const u=o||i;return"string"==typeof u?e.jsx(r.default,(p=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},o=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),o.forEach((function(r){n(e,r,t[r])}))}return e}({id:a,$isError:Boolean(o)},t.default("validation-message",{"data-element":s,"data-role":c})),b=null!=(b={$size:l,children:u})?b:{},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(b)).forEach((function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(b,e))})),p)):null;var p,b};
@@ -0,0 +1,6 @@
1
+ interface StyledValidationMessageProps {
2
+ $isError?: boolean;
3
+ $size?: "small" | "medium" | "large";
4
+ }
5
+ declare const StyledValidationMessage: import("styled-components").StyledComponent<"span", any, StyledValidationMessageProps, never>;
6
+ export default StyledValidationMessage;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var a=require("styled-components");function t(a){return a&&a.__esModule?a:{default:a}}const e=t(a).default.span.withConfig({displayName:"validation-message.style__StyledValidationMessage",componentId:"sc-554aba6-0"})(["",""],(({$isError:t,$size:e})=>a.css(["display:flex;align-items:center;align-content:center;align-self:stretch;flex-wrap:wrap;margin:0px;color:",";"," "," ",""],t?"var(--input-validation-label-error)":"var(--input-validation-label-warn)","large"===e&&a.css(["font:",";"],t?"var(--global-font-static-comp-medium-l)":"var(--global-font-static-comp-regular-l)"),"medium"===e&&a.css(["font:",";"],t?"var(--global-font-static-comp-medium-m)":"var(--global-font-static-comp-regular-m)"),"small"===e&&a.css(["font:",";"],t?"var(--global-font-static-comp-medium-s)":"var(--global-font-static-comp-regular-s)"))));exports.default=e;
@@ -2,5 +2,3 @@ export declare const setupMatchMediaMock: () => void;
2
2
  export declare const mockMatchMedia: (matches: boolean) => {
3
3
  removeEventListener: jest.Mock<any, any, any>;
4
4
  };
5
- /** Simulate a media query change — updates `matches` and fires captured listeners */
6
- export declare const simulateMediaQueryChange: (matches: boolean) => void;
@@ -1 +1 @@
1
- "use strict";let e=!1,t=!1;const n=jest.fn();let a=new Set;exports.mockMatchMedia=r=>{if(!e)throw new Error("window.matchMedia has not been mocked. Did you call setupMatchMediaMock()?");return t=r,a=new Set,{removeEventListener:n}},exports.setupMatchMediaMock=()=>{if("undefined"==typeof window)return;const r=()=>{};Object.defineProperty(global.window,"matchMedia",{writable:!0,value:e=>({get matches(){return t},media:e,onchange:null,addEventListener:(e,t)=>{a.add(t)},removeEventListener:(e,t)=>{a.delete(t),n()},dispatchEvent:r})}),e=!0},exports.simulateMediaQueryChange=e=>{t=e,a.forEach((e=>e()))};
1
+ "use strict";let e=!1,t=!1;const n=jest.fn();exports.mockMatchMedia=o=>{if(!e)throw new Error("window.matchMedia has not been mocked. Did you call setupMatchMediaMock()?");return t=o,{removeEventListener:n}},exports.setupMatchMediaMock=()=>{if("undefined"==typeof window)return;const o=()=>{};Object.defineProperty(global.window,"matchMedia",{writable:!0,value:e=>({matches:t,media:e,onchange:null,addEventListener:o,removeEventListener:n,dispatchEvent:o})}),e=!0};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("invariant"),r=require("../../../__internal__/form-field/form-field.component.js"),n=require("../../../__internal__/utils/helpers/tags/tags.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),o=require("./button-toggle-group.style.js"),a=require("../button-toggle.component.js");require("../../../style/utils/filter-styled-system-padding-props.js");var u=require("../../../style/utils/filter-styled-system-margin-props.js"),s=require("../../../__internal__/tooltip-provider/index.js"),d=require("../../../__internal__/input-behaviour/input-group-behaviour.component.js"),c=require("../../../__internal__/utils/helpers/events/events.js"),p=require("../../carbon-provider/__internal__/new-validation.context.js"),f=require("./__internal__/button-toggle-group.context.js"),b=require("../../../__internal__/hint-text/hint-text.component.js");function g(e){return e&&e.__esModule?e:{default:e}}var y=g(t),h=g(l);function _(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function j(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){_(e,t,l[t])}))}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const m=l=>{var{children:g,fieldHelp:_,fieldHelpInline:m,"aria-label":O,label:x,labelHelp:q,labelSpacing:w,inputHint:P,inputWidth:H,fullWidth:I,labelInline:B,labelWidth:S,onChange:D,value:T,helpAriaLabel:W,id:A,allowDeselect:C=!1,disabled:E=!1}=l,R=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(l,["children","fieldHelp","fieldHelpInline","aria-label","label","labelHelp","labelSpacing","inputHint","inputWidth","fullWidth","labelInline","labelWidth","onChange","value","helpAriaLabel","id","allowDeselect","disabled"]);const k=t.useMemo((()=>!y.default.Children.toArray(g).find((e=>!y.default.isValidElement(e)||"ButtonToggle"!==e.type.displayName))),[g]);h.default(k,`\`ButtonToggleGroup\` only accepts children of type \`${a.ButtonToggle.displayName}\``);const G=t.useRef(i.default()),L=t.useRef(i.default()),M=t.useRef(null),{validationRedesignOptIn:K}=t.useContext(p.default),N=e=>K?void 0:e,V=()=>{var e;return null===(e=M.current)||void 0===e?void 0:e.querySelectorAll('[data-element="button-toggle-button"]')},[$,z]=t.useState();var F;return e.jsx(s.TooltipProvider,{helpAriaLabel:W,children:e.jsx(d.InputGroupBehaviour,{children:e.jsx(r.default,v(j({label:x,labelHelp:N(q),labelSpacing:N(w),fieldHelp:N(_),fieldHelpInline:N(m),labelInline:N(B),labelWidth:N(S),labelId:G.current,id:A,labelAs:"span",disabled:E},u.default(R),n.default(null!==(F=R["data-component"])&&void 0!==F?F:"button-toggle-group",R)),{children:e.jsxs(f.ButtonToggleGroupProvider,{value:{onButtonClick:()=>{},handleKeyDown:e=>{const t=V();if(!t||!document.activeElement)return;const l=Array.from(t).indexOf(document.activeElement);let r;c.default.isLeftKey(e)?r=t[0===l?t.length-1:l-1]:c.default.isRightKey(e)&&(r=t[(l+1)%t.length]),r instanceof HTMLButtonElement&&r.focus()},pressedButtonValue:T,onChange:D,allowDeselect:C,isInGroup:!0,isDisabled:E,firstButton:$,childButtonCallbackRef:e=>{setTimeout((()=>{if(e){const t=V();t?e===t[0]&&z(e):z(void 0)}}),0)},hintTextId:P?L.current:void 0},children:[P&&e.jsx(b.HintText,{id:L.current,isDisabled:E,marginBottom:"var(--spacing150)",children:P}),e.jsx(o.default,v(j({ref:M},x?{"aria-labelledby":G.current}:{"aria-label":O}),{labelInline:B,inputWidth:H,fullWidth:I,role:"group",id:A,disabled:E,children:g}))]})}))})})};m.displayName="ButtonToggleGroup",exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("invariant"),r=require("../../../__internal__/form-field/form-field.component.js"),n=require("../../../__internal__/utils/helpers/tags/tags.js"),i=require("../../../__internal__/utils/helpers/guid/index.js"),o=require("./button-toggle-group.style.js"),a=require("../button-toggle.component.js");require("../../../style/utils/filter-styled-system-padding-props.js");var u=require("../../../style/utils/filter-styled-system-margin-props.js"),s=require("../../../__internal__/tooltip-provider/index.js"),d=require("../../../__internal__/input-behaviour/input-group-behaviour.component.js"),c=require("../../../__internal__/utils/helpers/events/events.js"),p=require("../../carbon-provider/__internal__/new-validation.context.js"),f=require("./__internal__/button-toggle-group.context.js"),b=require("../../../__internal__/legacy-hint-text/hint-text.component.js");function g(e){return e&&e.__esModule?e:{default:e}}var y=g(t),h=g(l);function _(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function j(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},r=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),r.forEach((function(t){_(e,t,l[t])}))}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const m=l=>{var{children:g,fieldHelp:_,fieldHelpInline:m,"aria-label":O,label:x,labelHelp:q,labelSpacing:w,inputHint:P,inputWidth:H,fullWidth:I,labelInline:B,labelWidth:S,onChange:D,value:T,helpAriaLabel:W,id:A,allowDeselect:C=!1,disabled:E=!1}=l,R=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||(n[l]=e[l]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)l=i[r],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(l,["children","fieldHelp","fieldHelpInline","aria-label","label","labelHelp","labelSpacing","inputHint","inputWidth","fullWidth","labelInline","labelWidth","onChange","value","helpAriaLabel","id","allowDeselect","disabled"]);const k=t.useMemo((()=>!y.default.Children.toArray(g).find((e=>!y.default.isValidElement(e)||"ButtonToggle"!==e.type.displayName))),[g]);h.default(k,`\`ButtonToggleGroup\` only accepts children of type \`${a.ButtonToggle.displayName}\``);const G=t.useRef(i.default()),L=t.useRef(i.default()),M=t.useRef(null),{validationRedesignOptIn:K}=t.useContext(p.default),N=e=>K?void 0:e,V=()=>{var e;return null===(e=M.current)||void 0===e?void 0:e.querySelectorAll('[data-element="button-toggle-button"]')},[$,z]=t.useState();var F;return e.jsx(s.TooltipProvider,{helpAriaLabel:W,children:e.jsx(d.InputGroupBehaviour,{children:e.jsx(r.default,v(j({label:x,labelHelp:N(q),labelSpacing:N(w),fieldHelp:N(_),fieldHelpInline:N(m),labelInline:N(B),labelWidth:N(S),labelId:G.current,id:A,labelAs:"span",disabled:E},u.default(R),n.default(null!==(F=R["data-component"])&&void 0!==F?F:"button-toggle-group",R)),{children:e.jsxs(f.ButtonToggleGroupProvider,{value:{onButtonClick:()=>{},handleKeyDown:e=>{const t=V();if(!t||!document.activeElement)return;const l=Array.from(t).indexOf(document.activeElement);let r;c.default.isLeftKey(e)?r=t[0===l?t.length-1:l-1]:c.default.isRightKey(e)&&(r=t[(l+1)%t.length]),r instanceof HTMLButtonElement&&r.focus()},pressedButtonValue:T,onChange:D,allowDeselect:C,isInGroup:!0,isDisabled:E,firstButton:$,childButtonCallbackRef:e=>{setTimeout((()=>{if(e){const t=V();t?e===t[0]&&z(e):z(void 0)}}),0)},hintTextId:P?L.current:void 0},children:[P&&e.jsx(b.HintText,{id:L.current,isDisabled:E,marginBottom:"var(--spacing150)",children:P}),e.jsx(o.default,v(j({ref:M},x?{"aria-labelledby":G.current}:{"aria-label":O}),{labelInline:B,inputWidth:H,fullWidth:I,role:"group",id:A,disabled:E,children:g}))]})}))})})};m.displayName="ButtonToggleGroup",exports.default=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../../__internal__/form-field/form-field.style.js"),i=require("../../icon/icon.style.js"),l=require("../checkbox.style.js"),n=require("../../../__internal__/label/label.style.js"),o=require("../../../__internal__/validations/validation-icon.style.js");function r(e){return e&&e.__esModule?e:{default:e}}const a=r(e).default.div.withConfig({displayName:"checkbox-group.style__StyledCheckboxGroup",componentId:"sc-e51b1b6e-0"})(["display:flex;flex-direction:column;","::before{font-size:16px;}&& ","{margin:0;}& ","{margin-bottom:var(--spacing150);:last-of-type{margin-bottom:0;}}& > ","{& > ","{margin-bottom:4px;vertical-align:middle;","{display:inline-block;}}}"," ",""],i.default,t.default,l.default,t.default,n.StyledLabelContainer,o.default,(({legendInline:t})=>t&&e.css(["",":first-child{padding-top:4px;}"],l.default)),(({inline:t})=>t&&e.css(["flex-direction:row;","{margin:0;:not(:first-of-type){margin-left:32px;}}"],l.default)));exports.default=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("../../../__internal__/form-field/form-field.style.js"),l=require("../../icon/icon.style.js"),i=require("../checkbox.style.js"),n=require("../../../__internal__/legacy-label/label.style.js"),o=require("../../../__internal__/validations/validation-icon.style.js");function r(e){return e&&e.__esModule?e:{default:e}}const a=r(e).default.div.withConfig({displayName:"checkbox-group.style__StyledCheckboxGroup",componentId:"sc-ffa9ebbb-0"})(["display:flex;flex-direction:column;","::before{font-size:16px;}&& ","{margin:0;}& ","{margin-bottom:var(--spacing150);:last-of-type{margin-bottom:0;}}& > ","{& > ","{margin-bottom:4px;vertical-align:middle;","{display:inline-block;}}}"," ",""],l.default,t.default,i.default,t.default,n.StyledLabelContainer,o.default,(({legendInline:t})=>t&&e.css(["",":first-child{padding-top:4px;}"],i.default)),(({inline:t})=>t&&e.css(["flex-direction:row;","{margin:0;:not(:first-of-type){margin-left:32px;}}"],i.default)));exports.default=a;