carbon-react 105.1.1 → 106.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 (271) hide show
  1. package/esm/__internal__/tooltip-provider/index.d.ts +19 -24
  2. package/esm/__internal__/tooltip-provider/index.js +1 -11
  3. package/esm/__internal__/utils/helpers/browser/index.d.ts +15 -1
  4. package/esm/__internal__/utils/helpers/browser/index.js +33 -1
  5. package/esm/__internal__/utils/helpers/browser-type-check/index.d.ts +7 -1
  6. package/esm/__internal__/utils/helpers/browser-type-check/index.js +8 -1
  7. package/esm/__internal__/utils/helpers/events/composedPath.d.ts +1 -1
  8. package/esm/__internal__/utils/helpers/events/events.d.ts +132 -31
  9. package/esm/__internal__/utils/helpers/events/events.js +10 -125
  10. package/esm/__internal__/utils/helpers/guid/index.d.ts +5 -0
  11. package/esm/__internal__/utils/helpers/guid/{guid.js → index.js} +0 -2
  12. package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +4 -2
  13. package/esm/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +2 -1
  14. package/esm/__internal__/utils/helpers/tags/tags.d.ts +10 -6
  15. package/esm/__internal__/utils/helpers/tags/tags.js +2 -6
  16. package/esm/__internal__/utils/helpers/useUniqueId/index.d.ts +2 -0
  17. package/esm/__internal__/utils/helpers/useUniqueId/index.js +7 -0
  18. package/esm/__internal__/utils/logger/index.d.ts +5 -1
  19. package/esm/__internal__/utils/logger/index.js +25 -1
  20. package/esm/__spec_helper__/mock-match-media.d.ts +3 -1
  21. package/esm/components/app-wrapper/app-wrapper.component.d.ts +4 -0
  22. package/esm/components/app-wrapper/app-wrapper.component.js +5 -3
  23. package/esm/components/badge/badge.style.d.ts +4 -2
  24. package/esm/components/button/button-types.style.d.ts +1 -2
  25. package/esm/components/button/button-types.style.js +3 -1
  26. package/esm/components/button/button.component.d.ts +67 -36
  27. package/esm/components/button/button.component.js +3314 -165
  28. package/esm/components/button/button.config.d.ts +4 -3
  29. package/esm/components/button/button.style.d.ts +6 -8
  30. package/esm/components/button/button.style.js +51 -95
  31. package/esm/components/button/index.d.ts +2 -2
  32. package/esm/components/confirm/confirm.component.js +1 -1
  33. package/esm/components/dialog/dialog.component.js +1 -1
  34. package/esm/components/dialog-full-screen/dialog-full-screen.component.js +1 -1
  35. package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
  36. package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
  37. package/esm/components/fieldset/fieldset.component.d.ts +6 -1
  38. package/esm/components/fieldset/fieldset.component.js +14 -15
  39. package/esm/components/heading/heading.component.d.ts +5 -0
  40. package/esm/components/icon/index.d.ts +1 -0
  41. package/esm/components/multi-action-button/multi-action-button.component.d.ts +3 -1
  42. package/esm/components/multi-action-button/multi-action-button.component.js +7 -5
  43. package/esm/components/multi-action-button/multi-action-button.d.ts +4 -2
  44. package/esm/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
  45. package/esm/components/multi-step-wizard/step/step.d.ts +6 -0
  46. package/esm/components/multi-step-wizard/step/step.style.d.ts +4 -2
  47. package/esm/components/portrait/portrait-initials.component.js +1 -1
  48. package/esm/components/radio-button/radio-button-svg.component.js +29 -16
  49. package/esm/components/scrollable-list/scrollable-list.component.d.ts +8 -0
  50. package/esm/components/select/option/index.d.ts +1 -1
  51. package/esm/components/select/select-list/select-list.component.js +1 -1
  52. package/esm/components/select/select-textbox/select-textbox.component.js +1 -1
  53. package/esm/components/split-button/split-button-toggle.style.d.ts +2 -6
  54. package/esm/components/split-button/split-button.component.d.ts +3 -1
  55. package/esm/components/split-button/split-button.component.js +7 -4
  56. package/esm/components/split-button/split-button.d.ts +5 -2
  57. package/esm/components/textbox/textbox.component.d.ts +1 -2
  58. package/esm/components/textbox/textbox.component.js +7 -6
  59. package/esm/components/tooltip/index.d.ts +2 -1
  60. package/esm/components/tooltip/tooltip-pointer.style.d.ts +10 -1
  61. package/esm/components/tooltip/tooltip-pointer.style.js +5 -12
  62. package/esm/components/tooltip/tooltip.component.d.ts +33 -2
  63. package/esm/components/tooltip/tooltip.component.js +255 -110
  64. package/esm/components/tooltip/tooltip.config.d.ts +2 -1
  65. package/esm/components/tooltip/tooltip.style.d.ts +7 -2
  66. package/esm/components/tooltip/tooltip.style.js +7 -21
  67. package/esm/components/typography/typography.component.d.ts +1 -1
  68. package/esm/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
  69. package/esm/hooks/__internal__/useCharacterCount/index.js +1 -18
  70. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
  71. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.js +24 -0
  72. package/esm/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
  73. package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
  74. package/esm/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
  75. package/esm/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
  76. package/esm/hooks/__internal__/useIsAboveBreakpoint/index.js +1 -6
  77. package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
  78. package/esm/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +6 -0
  79. package/esm/hooks/__internal__/useLocale/index.d.ts +1 -1
  80. package/esm/hooks/__internal__/useLocale/index.js +1 -5
  81. package/esm/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
  82. package/esm/hooks/__internal__/useLocale/useLocale.js +5 -0
  83. package/esm/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
  84. package/esm/hooks/__internal__/useResizeObserver/index.js +1 -23
  85. package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
  86. package/esm/hooks/__internal__/useResizeObserver/useResizeObserver.js +29 -0
  87. package/esm/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
  88. package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
  89. package/esm/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
  90. package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
  91. package/esm/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
  92. package/esm/hooks/useMediaQuery/index.d.ts +1 -1
  93. package/esm/hooks/useMediaQuery/index.js +1 -19
  94. package/esm/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
  95. package/esm/hooks/useMediaQuery/useMediaQuery.js +19 -0
  96. package/esm/locales/en-gb.d.ts +3 -5
  97. package/esm/locales/en-gb.js +5 -4
  98. package/esm/locales/index.d.ts +1 -1
  99. package/esm/locales/index.js +2 -0
  100. package/esm/locales/locale.d.ts +99 -105
  101. package/esm/locales/locale.js +1 -0
  102. package/esm/locales/pl-pl.d.ts +3 -5
  103. package/esm/locales/pl-pl.js +5 -4
  104. package/esm/style/{fonts → assets}/carbon-icons-webfont.woff +0 -0
  105. package/esm/style/fonts.css +30 -0
  106. package/esm/style/global-style.js +1 -1
  107. package/esm/style/themes/base/base-theme.config.d.ts +17 -8
  108. package/esm/style/themes/sage/index.d.ts +17 -8
  109. package/lib/__internal__/tooltip-provider/index.d.ts +19 -24
  110. package/lib/__internal__/tooltip-provider/index.js +2 -13
  111. package/lib/__internal__/utils/helpers/browser/index.d.ts +15 -1
  112. package/lib/__internal__/utils/helpers/browser/index.js +33 -8
  113. package/lib/__internal__/utils/helpers/browser-type-check/index.d.ts +7 -1
  114. package/lib/__internal__/utils/helpers/browser-type-check/index.js +10 -21
  115. package/lib/__internal__/utils/helpers/events/composedPath.d.ts +1 -1
  116. package/lib/__internal__/utils/helpers/events/events.d.ts +132 -31
  117. package/lib/__internal__/utils/helpers/events/events.js +10 -125
  118. package/lib/__internal__/utils/helpers/guid/index.d.ts +5 -0
  119. package/lib/__internal__/utils/helpers/guid/{guid.js → index.js} +0 -2
  120. package/lib/__internal__/utils/helpers/guid/package.json +5 -2
  121. package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.d.ts +4 -2
  122. package/lib/__internal__/utils/helpers/tags/tags-specs/tags-specs.js +2 -1
  123. package/lib/__internal__/utils/helpers/tags/tags.d.ts +10 -6
  124. package/lib/__internal__/utils/helpers/tags/tags.js +2 -6
  125. package/lib/__internal__/utils/helpers/useUniqueId/index.d.ts +2 -0
  126. package/lib/__internal__/utils/helpers/useUniqueId/index.js +20 -0
  127. package/lib/__internal__/utils/helpers/useUniqueId/package.json +6 -0
  128. package/lib/__internal__/utils/logger/index.d.ts +5 -1
  129. package/lib/__internal__/utils/logger/index.js +26 -8
  130. package/lib/__spec_helper__/mock-match-media.d.ts +3 -1
  131. package/lib/components/app-wrapper/app-wrapper.component.d.ts +4 -0
  132. package/lib/components/app-wrapper/app-wrapper.component.js +5 -4
  133. package/lib/components/badge/badge.style.d.ts +4 -2
  134. package/lib/components/button/button-types.style.d.ts +1 -2
  135. package/lib/components/button/button-types.style.js +0 -1
  136. package/lib/components/button/button.component.d.ts +67 -36
  137. package/lib/components/button/button.component.js +3381 -172
  138. package/lib/components/button/button.config.d.ts +4 -3
  139. package/lib/components/button/button.style.d.ts +6 -8
  140. package/lib/components/button/button.style.js +52 -101
  141. package/lib/components/button/index.d.ts +2 -2
  142. package/lib/components/confirm/confirm.component.js +1 -1
  143. package/lib/components/dialog/dialog.component.js +1 -1
  144. package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -1
  145. package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -2
  146. package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -2
  147. package/lib/components/fieldset/fieldset.component.d.ts +6 -1
  148. package/lib/components/fieldset/fieldset.component.js +14 -16
  149. package/lib/components/heading/heading.component.d.ts +5 -0
  150. package/lib/components/icon/index.d.ts +1 -0
  151. package/lib/components/multi-action-button/multi-action-button.component.d.ts +3 -1
  152. package/lib/components/multi-action-button/multi-action-button.component.js +6 -4
  153. package/lib/components/multi-action-button/multi-action-button.d.ts +4 -2
  154. package/lib/components/multi-step-wizard/multi-step-wizard.d.ts +22 -0
  155. package/lib/components/multi-step-wizard/step/step.d.ts +6 -0
  156. package/lib/components/multi-step-wizard/step/step.style.d.ts +4 -2
  157. package/lib/components/portrait/portrait-initials.component.js +1 -1
  158. package/lib/components/radio-button/radio-button-svg.component.js +38 -20
  159. package/lib/components/scrollable-list/scrollable-list.component.d.ts +8 -0
  160. package/lib/components/select/option/index.d.ts +1 -1
  161. package/lib/components/select/select-list/select-list.component.js +1 -1
  162. package/lib/components/select/select-textbox/select-textbox.component.js +1 -1
  163. package/lib/components/split-button/split-button-toggle.style.d.ts +2 -6
  164. package/lib/components/split-button/split-button.component.d.ts +3 -1
  165. package/lib/components/split-button/split-button.component.js +6 -3
  166. package/lib/components/split-button/split-button.d.ts +5 -2
  167. package/lib/components/textbox/textbox.component.d.ts +1 -2
  168. package/lib/components/textbox/textbox.component.js +7 -8
  169. package/lib/components/tooltip/index.d.ts +2 -1
  170. package/lib/components/tooltip/tooltip-pointer.style.d.ts +10 -1
  171. package/lib/components/tooltip/tooltip-pointer.style.js +7 -15
  172. package/lib/components/tooltip/tooltip.component.d.ts +33 -2
  173. package/lib/components/tooltip/tooltip.component.js +221 -130
  174. package/lib/components/tooltip/tooltip.config.d.ts +2 -1
  175. package/lib/components/tooltip/tooltip.style.d.ts +7 -2
  176. package/lib/components/tooltip/tooltip.style.js +7 -22
  177. package/lib/components/typography/typography.component.d.ts +1 -1
  178. package/lib/components/vertical-divider/vertical-divider.component.js +3 -0
  179. package/lib/hooks/__internal__/useCharacterCount/index.d.ts +1 -2
  180. package/lib/hooks/__internal__/useCharacterCount/index.js +8 -27
  181. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +3 -0
  182. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.js +40 -0
  183. package/lib/hooks/__internal__/useInputAccessibility/index.d.ts +1 -24
  184. package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.d.ts +11 -11
  185. package/lib/hooks/__internal__/useInputAccessibility/useInputAccessibility.js +1 -3
  186. package/lib/hooks/__internal__/useIsAboveBreakpoint/index.d.ts +1 -1
  187. package/lib/hooks/__internal__/useIsAboveBreakpoint/index.js +8 -9
  188. package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.d.ts +1 -0
  189. package/lib/hooks/__internal__/useIsAboveBreakpoint/useIsAboveBreakpoint.js +16 -0
  190. package/lib/hooks/__internal__/useLocale/index.d.ts +1 -1
  191. package/lib/hooks/__internal__/useLocale/index.js +8 -9
  192. package/lib/hooks/__internal__/useLocale/useLocale.d.ts +1 -0
  193. package/lib/hooks/__internal__/useLocale/useLocale.js +16 -0
  194. package/lib/hooks/__internal__/useResizeObserver/index.d.ts +1 -10
  195. package/lib/hooks/__internal__/useResizeObserver/index.js +8 -24
  196. package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.d.ts +8 -0
  197. package/lib/hooks/__internal__/useResizeObserver/useResizeObserver.js +37 -0
  198. package/lib/hooks/__internal__/useScrollBlock/index.d.ts +1 -4
  199. package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.d.ts +23 -9
  200. package/lib/hooks/__internal__/useScrollBlock/scroll-block-manager.js +24 -12
  201. package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.d.ts +2 -2
  202. package/lib/hooks/__internal__/useScrollBlock/useScrollBlock.js +3 -5
  203. package/lib/hooks/useMediaQuery/index.d.ts +1 -1
  204. package/lib/hooks/useMediaQuery/index.js +8 -25
  205. package/lib/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
  206. package/lib/hooks/useMediaQuery/useMediaQuery.js +32 -0
  207. package/lib/locales/en-gb.d.ts +3 -5
  208. package/lib/locales/en-gb.js +2 -1
  209. package/lib/locales/index.d.ts +1 -1
  210. package/lib/locales/index.js +23 -0
  211. package/lib/locales/locale.d.ts +99 -105
  212. package/lib/locales/locale.js +5 -0
  213. package/lib/{__internal__/utils/ether → locales}/package.json +1 -1
  214. package/lib/locales/pl-pl.d.ts +3 -5
  215. package/lib/locales/pl-pl.js +2 -1
  216. package/lib/style/{fonts → assets}/carbon-icons-webfont.woff +0 -0
  217. package/lib/style/fonts.css +30 -0
  218. package/lib/style/global-style.js +1 -1
  219. package/lib/style/themes/base/base-theme.config.d.ts +17 -8
  220. package/lib/style/themes/sage/index.d.ts +17 -8
  221. package/package.json +10 -5
  222. package/esm/__internal__/utils/ether/ether.d.ts +0 -19
  223. package/esm/__internal__/utils/ether/ether.js +0 -29
  224. package/esm/__internal__/utils/ether/index.d.ts +0 -1
  225. package/esm/__internal__/utils/ether/index.js +0 -1
  226. package/esm/__internal__/utils/helpers/browser/browser.d.ts +0 -17
  227. package/esm/__internal__/utils/helpers/browser/browser.js +0 -198
  228. package/esm/__internal__/utils/helpers/browser-type-check/browser-type-check.d.ts +0 -7
  229. package/esm/__internal__/utils/helpers/browser-type-check/browser-type-check.js +0 -14
  230. package/esm/__internal__/utils/helpers/guid/__spec__.d.ts +0 -1
  231. package/esm/__internal__/utils/helpers/guid/__spec__.js +0 -10
  232. package/esm/__internal__/utils/helpers/guid/guid.d.ts +0 -2
  233. package/esm/__internal__/utils/helpers/guid/package.json +0 -3
  234. package/esm/__internal__/utils/helpers/immutable/__spec__.d.ts +0 -1
  235. package/esm/__internal__/utils/helpers/immutable/__spec__.js +0 -117
  236. package/esm/__internal__/utils/helpers/immutable/immutable.d.ts +0 -4
  237. package/esm/__internal__/utils/helpers/immutable/immutable.js +0 -36
  238. package/esm/__internal__/utils/helpers/immutable/package.json +0 -4
  239. package/esm/__internal__/utils/helpers/with-unique-id-props/index.d.ts +0 -1
  240. package/esm/__internal__/utils/helpers/with-unique-id-props/index.js +0 -1
  241. package/esm/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.d.ts +0 -7
  242. package/esm/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.js +0 -82
  243. package/esm/__internal__/utils/logger/logger.d.ts +0 -9
  244. package/esm/__internal__/utils/logger/logger.js +0 -71
  245. package/esm/components/button/button.d.ts +0 -85
  246. package/esm/components/tooltip/tooltip.d.ts +0 -40
  247. package/lib/__internal__/utils/ether/ether.d.ts +0 -19
  248. package/lib/__internal__/utils/ether/ether.js +0 -33
  249. package/lib/__internal__/utils/ether/index.d.ts +0 -1
  250. package/lib/__internal__/utils/ether/index.js +0 -18
  251. package/lib/__internal__/utils/helpers/browser/browser.d.ts +0 -17
  252. package/lib/__internal__/utils/helpers/browser/browser.js +0 -213
  253. package/lib/__internal__/utils/helpers/browser-type-check/browser-type-check.d.ts +0 -7
  254. package/lib/__internal__/utils/helpers/browser-type-check/browser-type-check.js +0 -26
  255. package/lib/__internal__/utils/helpers/guid/__spec__.d.ts +0 -1
  256. package/lib/__internal__/utils/helpers/guid/__spec__.js +0 -15
  257. package/lib/__internal__/utils/helpers/guid/guid.d.ts +0 -2
  258. package/lib/__internal__/utils/helpers/immutable/__spec__.d.ts +0 -1
  259. package/lib/__internal__/utils/helpers/immutable/__spec__.js +0 -135
  260. package/lib/__internal__/utils/helpers/immutable/immutable.d.ts +0 -4
  261. package/lib/__internal__/utils/helpers/immutable/immutable.js +0 -46
  262. package/lib/__internal__/utils/helpers/immutable/package.json +0 -4
  263. package/lib/__internal__/utils/helpers/with-unique-id-props/index.d.ts +0 -1
  264. package/lib/__internal__/utils/helpers/with-unique-id-props/index.js +0 -15
  265. package/lib/__internal__/utils/helpers/with-unique-id-props/package.json +0 -6
  266. package/lib/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.d.ts +0 -7
  267. package/lib/__internal__/utils/helpers/with-unique-id-props/with-unique-id-props.hoc.js +0 -96
  268. package/lib/__internal__/utils/logger/logger.d.ts +0 -9
  269. package/lib/__internal__/utils/logger/logger.js +0 -78
  270. package/lib/components/button/button.d.ts +0 -85
  271. package/lib/components/tooltip/tooltip.d.ts +0 -40
@@ -13,8 +13,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
14
  var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
15
15
 
16
- var _ether = require("../../__internal__/utils/ether");
17
-
18
16
  var _appWrapper = _interopRequireDefault(require("./app-wrapper.style"));
19
17
 
20
18
  var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
@@ -89,9 +87,12 @@ let AppWrapper = /*#__PURE__*/function (_React$Component) {
89
87
  }, {
90
88
  key: "render",
91
89
  value: function render() {
92
- return /*#__PURE__*/_react.default.createElement(_appWrapper.default, _extends({}, (0, _ether.validProps)(this), {
90
+ const {
91
+ children
92
+ } = this.props;
93
+ return /*#__PURE__*/_react.default.createElement(_appWrapper.default, _extends({}, this.props, {
93
94
  className: this.classes()
94
- }, (0, _tags.default)("app-wrapper", this.props)), this.props.children);
95
+ }, (0, _tags.default)("app-wrapper", this.props)), children);
95
96
  }
96
97
  }]);
97
98
 
@@ -1,6 +1,8 @@
1
1
  export const StyledBadgeWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export const StyledButton: import("styled-components").StyledComponent<typeof Button, any, {}, never>;
2
+ export const StyledButton: import("styled-components").StyledComponent<{
3
+ ({ size, subtext, as, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: import("../button").ButtonProps): JSX.Element;
4
+ displayName: string;
5
+ }, any, {}, never>;
3
6
  export const StyledCrossIcon: import("styled-components").StyledComponent<typeof Icon, any, {}, never>;
4
7
  export const StyledCounter: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- import Button from "../button";
6
8
  import Icon from "../icon";
@@ -1,5 +1,4 @@
1
- export function makeColors(color: any): string;
2
- declare function _default(isDisabled: any, destructive: any): {
1
+ declare const _default: (isDisabled?: boolean | undefined, destructive?: boolean | undefined) => {
3
2
  primary: string;
4
3
  secondary: string;
5
4
  tertiary: string;
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.makeColors = makeColors;
7
6
  exports.default = void 0;
8
7
 
9
8
  var _icon = _interopRequireDefault(require("../icon/icon.style"));
@@ -1,37 +1,68 @@
1
- export default Button;
2
- export const ButtonWithForwardRef: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
- declare function Button({ size, subtext, as, children, forwardRef, "aria-label": ariaLabel, disabled, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, ...rest }: {
4
- [x: string]: any;
5
- size: any;
6
- subtext: any;
7
- as: any;
8
- children: any;
9
- forwardRef: any;
10
- "aria-label": any;
11
- disabled: any;
12
- buttonType: any;
13
- iconType: any;
14
- iconPosition: any;
15
- href: any;
16
- m?: number | undefined;
17
- px: any;
18
- noWrap: any;
19
- target: any;
20
- rel: any;
21
- iconTooltipMessage: any;
22
- iconTooltipPosition: any;
23
- }): JSX.Element;
24
- declare namespace Button {
25
- const propTypes: any;
26
- namespace defaultProps {
27
- const buttonType: string;
28
- const size: string;
29
- const fullWidth: boolean;
30
- const disabled: boolean;
31
- const destructive: boolean;
32
- const iconPosition: string;
33
- const subtext: string;
34
- }
35
- const displayName: string;
36
- }
37
1
  import React from "react";
2
+ import { SpaceProps } from "styled-system";
3
+ import { IconType, TooltipPositions } from "../icon";
4
+ export declare type ButtonTypes = "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground";
5
+ export declare type SizeOptions = "small" | "medium" | "large";
6
+ export declare type ButtonIconPosition = "before" | "after";
7
+ export interface ButtonProps extends SpaceProps {
8
+ /** Prop to specify the aria-label text.
9
+ * Only to be used in Button when only an icon is rendered.
10
+ * This is required to comply with WCAG 4.1.2 - Buttons must have discernible text
11
+ */
12
+ "aria-label"?: string;
13
+ /** [Legacy] Button types for legacy theme: "primary" | "secondary" */
14
+ as?: ButtonTypes;
15
+ /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "darkBackground" */
16
+ buttonType?: ButtonTypes;
17
+ /** The text the button displays */
18
+ children?: React.ReactNode;
19
+ /** Name attribute */
20
+ name?: string;
21
+ /** Apply disabled state to the button */
22
+ disabled?: boolean;
23
+ /** Apply destructive style to the button */
24
+ destructive?: boolean;
25
+ /** Ref to be forwarded */
26
+ forwardRef?: React.RefCallback<HTMLButtonElement> | React.MutableRefObject<HTMLButtonElement | null> | null;
27
+ /** Apply fullWidth style to the button */
28
+ fullWidth?: boolean;
29
+ /** Used to transform button into anchor */
30
+ href?: string;
31
+ /** Defines an Icon position related to the children: "before" | "after" */
32
+ iconPosition?: ButtonIconPosition;
33
+ /** Provides a tooltip message when the icon is hovered. */
34
+ iconTooltipMessage?: string;
35
+ /** Provides positioning when the tooltip is displayed. */
36
+ iconTooltipPosition?: TooltipPositions;
37
+ /** Defines an Icon type within the button */
38
+ iconType?: IconType;
39
+ /** If provided, the text inside a button will not wrap */
40
+ noWrap?: boolean;
41
+ /** Specify a callback triggered on blur */
42
+ onBlur?: (ev: React.FocusEvent<HTMLButtonElement>) => void;
43
+ /** Specify a callback triggered on change */
44
+ onChange?: (ev: React.ChangeEvent<HTMLButtonElement>) => void;
45
+ /** Specify a callback triggered on focus */
46
+ onFocus?: (ev: React.FocusEvent<HTMLButtonElement>) => void;
47
+ /** Specify a callback triggered on keyDown */
48
+ onKeyDown?: (ev: React.KeyboardEvent<HTMLButtonElement>) => void;
49
+ /** onClick handler */
50
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
51
+ /** Assigns a size to the button: "small" | "medium" | "large" */
52
+ size?: SizeOptions;
53
+ /** Second text child, renders under main text, only when size is "large" */
54
+ subtext?: string;
55
+ /** HTML button type property */
56
+ type?: string;
57
+ /** HTML target attribute */
58
+ target?: string;
59
+ /** HTML rel attribute */
60
+ rel?: string;
61
+ }
62
+ declare const Button: {
63
+ ({ size, subtext, as, children, forwardRef, "aria-label": ariaLabel, disabled, destructive, buttonType: buttonTypeProp, iconType, iconPosition, href, m, px, noWrap, target, rel, iconTooltipMessage, iconTooltipPosition, fullWidth, ...rest }: ButtonProps): JSX.Element;
64
+ displayName: string;
65
+ };
66
+ declare const ButtonWithForwardRef: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
67
+ export { ButtonWithForwardRef };
68
+ export default Button;