carbon-react 152.7.0 → 153.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 (273) hide show
  1. package/esm/__internal__/dom/globals.js +1 -1
  2. package/esm/__internal__/fieldset/fieldset.style.d.ts +3 -3
  3. package/esm/__internal__/focus-trap/focus-trap-utils.d.ts +1 -1
  4. package/esm/__internal__/focus-trap/focus-trap.component.d.ts +1 -1
  5. package/esm/__internal__/input/input-presentation.component.d.ts +1 -1
  6. package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
  7. package/esm/__internal__/input/input.component.d.ts +1 -1
  8. package/esm/__internal__/popover/popover.component.d.ts +1 -1
  9. package/esm/__internal__/popover/popover.style.d.ts +1 -1
  10. package/esm/__internal__/utils/helpers/events/events.d.ts +1 -1
  11. package/esm/__internal__/validations/validation-icon.component.d.ts +1 -1
  12. package/esm/__internal__/validations/validation-icon.style.d.ts +1 -1
  13. package/esm/components/accordion/accordion-group/accordion-group.component.d.ts +1 -1
  14. package/esm/components/accordion/accordion.style.js +2 -2
  15. package/esm/components/action-popover/__internal__/action-popover-utils.d.ts +1 -1
  16. package/esm/components/action-popover/__internal__/action-popover.context.d.ts +2 -2
  17. package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +1 -1
  18. package/esm/components/action-popover/action-popover.component.d.ts +1 -1
  19. package/esm/components/action-popover/action-popover.style.d.ts +1 -1
  20. package/esm/components/badge/badge.style.d.ts +1 -1
  21. package/esm/components/batch-selection/__internal__/batch-selection.context.d.ts +1 -1
  22. package/esm/components/box/box.component.d.ts +6 -6
  23. package/esm/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +1 -1
  24. package/esm/components/button/button.component.d.ts +8 -8
  25. package/esm/components/button/button.component.js +1 -1
  26. package/esm/components/button/button.style.js +22 -8
  27. package/esm/components/button-minor/button-minor.style.d.ts +1 -1
  28. package/esm/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +1 -1
  29. package/esm/components/button-toggle/button-toggle-group/button-toggle-group.style.d.ts +1 -1
  30. package/esm/components/button-toggle/button-toggle.style.d.ts +1 -1
  31. package/esm/components/carbon-provider/__internal__/top-modal.context.d.ts +1 -1
  32. package/esm/components/card/card.component.d.ts +2 -2
  33. package/esm/components/card/card.config.d.ts +2 -2
  34. package/esm/components/card/card.style.d.ts +2 -2
  35. package/esm/components/content/content.style.d.ts +2 -2
  36. package/esm/components/date/__internal__/date-picker/date-picker.component.d.ts +1 -1
  37. package/esm/components/date/__internal__/weekday/weekday.style.js +1 -1
  38. package/esm/components/date-range/__internal__/date-range.context.d.ts +4 -4
  39. package/esm/components/definition-list/__internal__/dl.context.d.ts +1 -1
  40. package/esm/components/dialog/dialog.component.d.ts +2 -2
  41. package/esm/components/dialog/dialog.config.d.ts +1 -1
  42. package/esm/components/dialog/dialog.style.d.ts +1 -1
  43. package/esm/components/dialog-full-screen/content.style.d.ts +1 -1
  44. package/esm/components/dialog-full-screen/content.style.js +8 -7
  45. package/esm/components/duelling-picklist/__internal__/duelling-picklist.context.d.ts +1 -1
  46. package/esm/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +1 -1
  47. package/esm/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -1
  48. package/esm/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +1 -1
  49. package/esm/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -1
  50. package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +1 -1
  51. package/esm/components/flat-table/index.d.ts +2 -2
  52. package/esm/components/form/__internal__/form-summary.style.d.ts +2 -2
  53. package/esm/components/form/form.config.d.ts +1 -1
  54. package/esm/components/grouped-character/grouped-character.component.d.ts +2 -2
  55. package/esm/components/heading/heading.component.d.ts +1 -1
  56. package/esm/components/heading/heading.style.d.ts +3 -3
  57. package/esm/components/icon/icon-type.d.ts +1 -1
  58. package/esm/components/icon/icon-unicodes.d.ts +248 -248
  59. package/esm/components/icon/icon.component.d.ts +1 -1
  60. package/esm/components/icon/icon.style.d.ts +3 -3
  61. package/esm/components/icon/icon.style.js +5 -11
  62. package/esm/components/image/image.style.d.ts +2 -2
  63. package/esm/components/inline-inputs/inline-inputs.style.d.ts +1 -1
  64. package/esm/components/link/link.style.d.ts +1 -1
  65. package/esm/components/loader-spinner/loader-spinner.config.d.ts +3 -3
  66. package/esm/components/loader-spinner/loader-spinner.style.js +1 -1
  67. package/esm/components/menu/__internal__/locators.d.ts +3 -3
  68. package/esm/components/menu/__internal__/menu.context.d.ts +1 -1
  69. package/esm/components/menu/menu-item/menu-item.component.d.ts +1 -1
  70. package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  71. package/esm/components/message/message.component.d.ts +1 -1
  72. package/esm/components/message/message.style.d.ts +1 -1
  73. package/esm/components/modal/__internal__/modal-manager.d.ts +2 -2
  74. package/esm/components/modal/modal.style.d.ts +1 -1
  75. package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  76. package/esm/components/multi-action-button/multi-action-button.style.d.ts +1 -1
  77. package/esm/components/multi-action-button/multi-action-button.style.js +6 -5
  78. package/esm/components/navigation-bar/__internal__/fixed-navigation-bar.context.d.ts +1 -1
  79. package/esm/components/navigation-bar/navigation-bar.component.d.ts +3 -3
  80. package/esm/components/navigation-bar/navigation-bar.style.d.ts +1 -1
  81. package/esm/components/numeral-date/__internal__/numeral-date.context.d.ts +1 -1
  82. package/esm/components/numeral-date/numeral-date.component.d.ts +2 -2
  83. package/esm/components/pager/pager.component.d.ts +1 -1
  84. package/esm/components/pod/pod.config.d.ts +3 -3
  85. package/esm/components/popover-container/popover-container.component.d.ts +1 -1
  86. package/esm/components/popover-container/popover-container.style.d.ts +3 -3
  87. package/esm/components/portrait/portrait.component.d.ts +2 -2
  88. package/esm/components/portrait/portrait.config.d.ts +1 -1
  89. package/esm/components/portrait/portrait.style.d.ts +1 -1
  90. package/esm/components/portrait/portrait.style.js +0 -1
  91. package/esm/components/preview/preview.component.d.ts +1 -1
  92. package/esm/components/preview/preview.style.js +3 -3
  93. package/esm/components/profile/profile.config.d.ts +2 -2
  94. package/esm/components/progress-tracker/progress-tracker.style.js +1 -1
  95. package/esm/components/search/search.component.d.ts +1 -1
  96. package/esm/components/select/__internal__/select-list/select-list.component.d.ts +2 -2
  97. package/esm/components/select/__internal__/select-list/select-list.context.d.ts +1 -1
  98. package/esm/components/select/__internal__/select-textbox/select-textbox.context.d.ts +1 -1
  99. package/esm/components/select/option/option.component.d.ts +1 -1
  100. package/esm/components/sidebar/sidebar.component.d.ts +1 -1
  101. package/esm/components/sidebar/sidebar.style.d.ts +1 -1
  102. package/esm/components/simple-color-picker/simple-color-picker.style.d.ts +1 -1
  103. package/esm/components/split-button/split-button-children.style.d.ts +1 -1
  104. package/esm/components/split-button/split-button-toggle.style.d.ts +1 -1
  105. package/esm/components/split-button/split-button.component.d.ts +1 -1
  106. package/esm/components/step-flow/__internal__/step-flow.context.d.ts +1 -1
  107. package/esm/components/step-flow/step-flow.component.d.ts +2 -2
  108. package/esm/components/switch/switch.style.d.ts +6 -1
  109. package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +3 -4
  110. package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +5 -5
  111. package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +5 -2
  112. package/esm/components/tabs/tab/tab.style.d.ts +1 -1
  113. package/esm/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.d.ts +1 -1
  114. package/esm/components/text-editor/text-editor.style.d.ts +1 -1
  115. package/esm/components/textarea/textarea.style.js +1 -1
  116. package/esm/components/tile/tile.component.d.ts +2 -2
  117. package/esm/components/time/time.component.d.ts +3 -3
  118. package/esm/components/toast/toast.component.d.ts +3 -3
  119. package/esm/components/toast/toast.style.d.ts +2 -2
  120. package/esm/components/tooltip/tooltip.component.d.ts +1 -1
  121. package/esm/components/tooltip/tooltip.config.d.ts +1 -1
  122. package/esm/components/typography/typography.component.d.ts +1 -1
  123. package/esm/components/typography/typography.component.js +16 -1
  124. package/esm/components/typography/typography.style.d.ts +1 -10
  125. package/esm/components/typography/typography.style.js +39 -63
  126. package/esm/components/vertical-divider/vertical-divider.component.d.ts +1 -1
  127. package/esm/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.d.ts +1 -1
  128. package/esm/global.d.ts +1 -1
  129. package/esm/hooks/__internal__/useChildButtons/useChildButtons.d.ts +1 -1
  130. package/esm/hooks/__internal__/useDebounce/useDebounce.d.ts +1 -1
  131. package/esm/hooks/__internal__/useFloating/useFloating.d.ts +1 -1
  132. package/esm/hooks/__internal__/useModalManager/useModalManager.d.ts +1 -1
  133. package/esm/hooks/__internal__/useThrottle/useThrottle.d.ts +1 -1
  134. package/esm/style/palette/index.d.ts +1 -1
  135. package/esm/style/themes/base/base-theme.config.d.ts +1 -1
  136. package/esm/style/utils/box-gap.d.ts +2 -2
  137. package/lib/__internal__/dom/globals.js +1 -1
  138. package/lib/__internal__/fieldset/fieldset.style.d.ts +3 -3
  139. package/lib/__internal__/focus-trap/focus-trap-utils.d.ts +1 -1
  140. package/lib/__internal__/focus-trap/focus-trap.component.d.ts +1 -1
  141. package/lib/__internal__/input/input-presentation.component.d.ts +1 -1
  142. package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
  143. package/lib/__internal__/input/input.component.d.ts +1 -1
  144. package/lib/__internal__/popover/popover.component.d.ts +1 -1
  145. package/lib/__internal__/popover/popover.style.d.ts +1 -1
  146. package/lib/__internal__/utils/helpers/events/events.d.ts +1 -1
  147. package/lib/__internal__/validations/validation-icon.component.d.ts +1 -1
  148. package/lib/__internal__/validations/validation-icon.style.d.ts +1 -1
  149. package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +1 -1
  150. package/lib/components/accordion/accordion.style.js +2 -2
  151. package/lib/components/action-popover/__internal__/action-popover-utils.d.ts +1 -1
  152. package/lib/components/action-popover/__internal__/action-popover.context.d.ts +2 -2
  153. package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +1 -1
  154. package/lib/components/action-popover/action-popover.component.d.ts +1 -1
  155. package/lib/components/action-popover/action-popover.style.d.ts +1 -1
  156. package/lib/components/badge/badge.style.d.ts +1 -1
  157. package/lib/components/batch-selection/__internal__/batch-selection.context.d.ts +1 -1
  158. package/lib/components/box/box.component.d.ts +6 -6
  159. package/lib/components/breadcrumbs/__internal__/breadcrumbs.context.d.ts +1 -1
  160. package/lib/components/button/button.component.d.ts +8 -8
  161. package/lib/components/button/button.component.js +1 -1
  162. package/lib/components/button/button.style.js +22 -8
  163. package/lib/components/button-minor/button-minor.style.d.ts +1 -1
  164. package/lib/components/button-toggle/button-toggle-group/__internal__/button-toggle-group.context.d.ts +1 -1
  165. package/lib/components/button-toggle/button-toggle-group/button-toggle-group.style.d.ts +1 -1
  166. package/lib/components/button-toggle/button-toggle.style.d.ts +1 -1
  167. package/lib/components/carbon-provider/__internal__/top-modal.context.d.ts +1 -1
  168. package/lib/components/card/card.component.d.ts +2 -2
  169. package/lib/components/card/card.config.d.ts +2 -2
  170. package/lib/components/card/card.style.d.ts +2 -2
  171. package/lib/components/content/content.style.d.ts +2 -2
  172. package/lib/components/date/__internal__/date-picker/date-picker.component.d.ts +1 -1
  173. package/lib/components/date/__internal__/weekday/weekday.style.js +1 -1
  174. package/lib/components/date-range/__internal__/date-range.context.d.ts +4 -4
  175. package/lib/components/definition-list/__internal__/dl.context.d.ts +1 -1
  176. package/lib/components/dialog/dialog.component.d.ts +2 -2
  177. package/lib/components/dialog/dialog.config.d.ts +1 -1
  178. package/lib/components/dialog/dialog.style.d.ts +1 -1
  179. package/lib/components/dialog-full-screen/content.style.d.ts +1 -1
  180. package/lib/components/dialog-full-screen/content.style.js +8 -7
  181. package/lib/components/duelling-picklist/__internal__/duelling-picklist.context.d.ts +1 -1
  182. package/lib/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +1 -1
  183. package/lib/components/duelling-picklist/picklist-group/picklist-group.style.d.ts +1 -1
  184. package/lib/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +1 -1
  185. package/lib/components/duelling-picklist/picklist-item/picklist-item.style.d.ts +1 -1
  186. package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.component.d.ts +1 -1
  187. package/lib/components/flat-table/index.d.ts +2 -2
  188. package/lib/components/form/__internal__/form-summary.style.d.ts +2 -2
  189. package/lib/components/form/form.config.d.ts +1 -1
  190. package/lib/components/grouped-character/grouped-character.component.d.ts +2 -2
  191. package/lib/components/heading/heading.component.d.ts +1 -1
  192. package/lib/components/heading/heading.style.d.ts +3 -3
  193. package/lib/components/icon/icon-type.d.ts +1 -1
  194. package/lib/components/icon/icon-unicodes.d.ts +248 -248
  195. package/lib/components/icon/icon.component.d.ts +1 -1
  196. package/lib/components/icon/icon.style.d.ts +3 -3
  197. package/lib/components/icon/icon.style.js +5 -11
  198. package/lib/components/image/image.style.d.ts +2 -2
  199. package/lib/components/inline-inputs/inline-inputs.style.d.ts +1 -1
  200. package/lib/components/link/link.style.d.ts +1 -1
  201. package/lib/components/loader-spinner/loader-spinner.config.d.ts +3 -3
  202. package/lib/components/loader-spinner/loader-spinner.style.js +1 -1
  203. package/lib/components/menu/__internal__/locators.d.ts +3 -3
  204. package/lib/components/menu/__internal__/menu.context.d.ts +1 -1
  205. package/lib/components/menu/menu-item/menu-item.component.d.ts +1 -1
  206. package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  207. package/lib/components/message/message.component.d.ts +1 -1
  208. package/lib/components/message/message.style.d.ts +1 -1
  209. package/lib/components/modal/__internal__/modal-manager.d.ts +2 -2
  210. package/lib/components/modal/modal.style.d.ts +1 -1
  211. package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
  212. package/lib/components/multi-action-button/multi-action-button.style.d.ts +1 -1
  213. package/lib/components/multi-action-button/multi-action-button.style.js +6 -5
  214. package/lib/components/navigation-bar/__internal__/fixed-navigation-bar.context.d.ts +1 -1
  215. package/lib/components/navigation-bar/navigation-bar.component.d.ts +3 -3
  216. package/lib/components/navigation-bar/navigation-bar.style.d.ts +1 -1
  217. package/lib/components/numeral-date/__internal__/numeral-date.context.d.ts +1 -1
  218. package/lib/components/numeral-date/numeral-date.component.d.ts +2 -2
  219. package/lib/components/pager/pager.component.d.ts +1 -1
  220. package/lib/components/pod/pod.config.d.ts +3 -3
  221. package/lib/components/popover-container/popover-container.component.d.ts +1 -1
  222. package/lib/components/popover-container/popover-container.style.d.ts +3 -3
  223. package/lib/components/portrait/portrait.component.d.ts +2 -2
  224. package/lib/components/portrait/portrait.config.d.ts +1 -1
  225. package/lib/components/portrait/portrait.style.d.ts +1 -1
  226. package/lib/components/portrait/portrait.style.js +0 -1
  227. package/lib/components/preview/preview.component.d.ts +1 -1
  228. package/lib/components/preview/preview.style.js +3 -3
  229. package/lib/components/profile/profile.config.d.ts +2 -2
  230. package/lib/components/progress-tracker/progress-tracker.style.js +1 -1
  231. package/lib/components/search/search.component.d.ts +1 -1
  232. package/lib/components/select/__internal__/select-list/select-list.component.d.ts +2 -2
  233. package/lib/components/select/__internal__/select-list/select-list.context.d.ts +1 -1
  234. package/lib/components/select/__internal__/select-textbox/select-textbox.context.d.ts +1 -1
  235. package/lib/components/select/option/option.component.d.ts +1 -1
  236. package/lib/components/sidebar/sidebar.component.d.ts +1 -1
  237. package/lib/components/sidebar/sidebar.style.d.ts +1 -1
  238. package/lib/components/simple-color-picker/simple-color-picker.style.d.ts +1 -1
  239. package/lib/components/split-button/split-button-children.style.d.ts +1 -1
  240. package/lib/components/split-button/split-button-toggle.style.d.ts +1 -1
  241. package/lib/components/split-button/split-button.component.d.ts +1 -1
  242. package/lib/components/step-flow/__internal__/step-flow.context.d.ts +1 -1
  243. package/lib/components/step-flow/step-flow.component.d.ts +2 -2
  244. package/lib/components/switch/switch.style.d.ts +6 -1
  245. package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +3 -4
  246. package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.d.ts +5 -5
  247. package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +5 -2
  248. package/lib/components/tabs/tab/tab.style.d.ts +1 -1
  249. package/lib/components/text-editor/__internal__/plugins/Toolbar/toolbar.style.d.ts +1 -1
  250. package/lib/components/text-editor/text-editor.style.d.ts +1 -1
  251. package/lib/components/textarea/textarea.style.js +1 -1
  252. package/lib/components/tile/tile.component.d.ts +2 -2
  253. package/lib/components/time/time.component.d.ts +3 -3
  254. package/lib/components/toast/toast.component.d.ts +3 -3
  255. package/lib/components/toast/toast.style.d.ts +2 -2
  256. package/lib/components/tooltip/tooltip.component.d.ts +1 -1
  257. package/lib/components/tooltip/tooltip.config.d.ts +1 -1
  258. package/lib/components/typography/typography.component.d.ts +1 -1
  259. package/lib/components/typography/typography.component.js +16 -1
  260. package/lib/components/typography/typography.style.d.ts +1 -10
  261. package/lib/components/typography/typography.style.js +39 -63
  262. package/lib/components/vertical-divider/vertical-divider.component.d.ts +1 -1
  263. package/lib/components/vertical-menu/vertical-menu-item/vertical-menu-item.component.d.ts +1 -1
  264. package/lib/global.d.ts +1 -1
  265. package/lib/hooks/__internal__/useChildButtons/useChildButtons.d.ts +1 -1
  266. package/lib/hooks/__internal__/useDebounce/useDebounce.d.ts +1 -1
  267. package/lib/hooks/__internal__/useFloating/useFloating.d.ts +1 -1
  268. package/lib/hooks/__internal__/useModalManager/useModalManager.d.ts +1 -1
  269. package/lib/hooks/__internal__/useThrottle/useThrottle.d.ts +1 -1
  270. package/lib/style/palette/index.d.ts +1 -1
  271. package/lib/style/themes/base/base-theme.config.d.ts +1 -1
  272. package/lib/style/utils/box-gap.d.ts +2 -2
  273. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { TooltipPositions } from "./tooltip.config";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
4
- export declare type InputSizes = "small" | "medium" | "large";
4
+ export type InputSizes = "small" | "medium" | "large";
5
5
  export interface TooltipProps extends TagProps {
6
6
  /** The message to be displayed within the tooltip */
7
7
  message: React.ReactNode;
@@ -1,2 +1,2 @@
1
1
  export declare const TOOLTIP_POSITIONS: string[];
2
- export declare type TooltipPositions = "top" | "bottom" | "left" | "right";
2
+ export type TooltipPositions = "top" | "bottom" | "left" | "right";
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  export declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
5
- export declare type VariantTypes = (typeof VARIANT_TYPES)[number];
5
+ export type VariantTypes = (typeof VARIANT_TYPES)[number];
6
6
  export interface TypographyProps extends SpaceProps, TagProps {
7
7
  /** Override the variant component */
8
8
  as?: React.ElementType;
@@ -11,6 +11,21 @@ var _typography = _interopRequireDefault(require("./typography.style"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
13
  const VARIANT_TYPES = exports.VARIANT_TYPES = ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
14
+ const getAs = variant => {
15
+ switch (variant) {
16
+ case "h1-large":
17
+ return "h1";
18
+ case "segment-header":
19
+ case "segment-header-small":
20
+ case "segment-subheader":
21
+ case "segment-subheader-alt":
22
+ return "h5";
23
+ case "big":
24
+ return "p";
25
+ default:
26
+ return variant;
27
+ }
28
+ };
14
29
  const Typography = ({
15
30
  "data-component": dataComponent,
16
31
  variant = "p",
@@ -42,7 +57,7 @@ const Typography = ({
42
57
  }) => {
43
58
  return /*#__PURE__*/_react.default.createElement(_typography.default, _extends({
44
59
  variant: variant,
45
- as: as,
60
+ as: as || getAs(variant),
46
61
  id: id,
47
62
  fontSize: fontSize,
48
63
  fontWeight: fontWeight,
@@ -1,12 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TypographyProps } from "./typography.component";
3
- declare const StyledTypography: import("styled-components").StyledComponent<"span", any, {
4
- as: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
5
- size: string;
6
- weight: string;
7
- textTransform: string;
8
- textDecoration: string;
9
- lineHeight: string;
10
- defaultMargin: string;
11
- } & TypographyProps, "textDecoration" | "as" | "size" | "weight" | "textTransform" | "lineHeight" | "defaultMargin">;
2
+ declare const StyledTypography: import("styled-components").StyledComponent<"span", any, TypographyProps, never>;
12
3
  export default StyledTypography;
@@ -12,21 +12,6 @@ var _visuallyHidden = _interopRequireDefault(require("../../style/utils/visually
12
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
- const getAs = variant => {
16
- switch (variant) {
17
- case "h1-large":
18
- return "h1";
19
- case "segment-header":
20
- case "segment-header-small":
21
- case "segment-subheader":
22
- case "segment-subheader-alt":
23
- return "h5";
24
- case "big":
25
- return "p";
26
- default:
27
- return variant;
28
- }
29
- };
30
15
  const getSize = variant => {
31
16
  switch (variant) {
32
17
  case "h1-large":
@@ -134,67 +119,57 @@ const getDecoration = variant => {
134
119
  }
135
120
  return "none";
136
121
  };
137
- const StyledTypography = _styledComponents.default.span.attrs(({
138
- variant,
139
- as,
122
+ const StyledTypography = _styledComponents.default.span`
123
+ ${({
140
124
  fontSize,
141
125
  fontWeight,
142
- textTransform,
143
- lineHeight,
144
- textDecoration
145
- }) => {
146
- return {
147
- as: as || getAs(variant),
148
- size: fontSize || getSize(variant),
149
- weight: fontWeight || getWeight(variant),
150
- textTransform: textTransform || getTransform(variant),
151
- textDecoration: textDecoration || getDecoration(variant),
152
- lineHeight: lineHeight || getLineHeight(variant),
153
- defaultMargin: variant === "p" ? "0 0 16px" : "0"
154
- };
155
- })`
156
- ${({
157
- size,
158
- weight,
159
- textTransform,
160
- lineHeight,
161
- defaultMargin,
162
- textDecoration,
163
126
  display,
164
127
  variant,
128
+ lineHeight: lHeight,
165
129
  listStyleType,
166
130
  whiteSpace,
167
131
  wordBreak,
168
132
  wordWrap,
169
133
  textAlign,
134
+ textDecoration: decoration,
170
135
  textOverflow,
136
+ textTransform: transform,
171
137
  truncate,
172
138
  screenReaderOnly
173
- }) => (0, _styledComponents.css)`
174
- font-style: normal;
175
- font-size: ${size};
176
- font-weight: ${weight};
177
- text-transform: ${textTransform};
178
- text-decoration: ${textDecoration};
179
- line-height: ${lineHeight};
180
- margin: ${defaultMargin};
181
- padding: 0;
182
- white-space: ${truncate ? "nowrap" : whiteSpace};
183
- word-break: ${wordBreak};
184
- word-wrap: ${wordWrap};
185
- text-align: ${textAlign};
186
- text-overflow: ${textOverflow || truncate && "ellipsis"};
187
- ${truncate && (0, _styledComponents.css)`
188
- overflow: hidden;
189
- `};
190
- ${screenReaderOnly && _visuallyHidden.default}
191
- ${variant === "sup" && "vertical-align: super;"};
192
- ${variant === "sub" && "vertical-align: sub;"};
193
- ${display && `display: ${display};`};
194
- ${listStyleType && `list-style-type: ${listStyleType};`};
195
- `}
139
+ }) => {
140
+ const size = fontSize || getSize(variant);
141
+ const weight = fontWeight || getWeight(variant);
142
+ const textTransform = transform || getTransform(variant);
143
+ const textDecoration = decoration || getDecoration(variant);
144
+ const lineHeight = lHeight || getLineHeight(variant);
145
+ const defaultMargin = variant === "p" ? "0 0 16px" : "0";
146
+ return (0, _styledComponents.css)`
147
+ font-style: normal;
148
+ font-size: ${size};
149
+ font-weight: ${weight};
150
+ text-transform: ${textTransform};
151
+ text-decoration: ${textDecoration};
152
+ line-height: ${lineHeight};
153
+ margin: ${defaultMargin};
154
+ padding: 0;
155
+ white-space: ${truncate ? "nowrap" : whiteSpace};
156
+ word-break: ${wordBreak};
157
+ word-wrap: ${wordWrap};
158
+ text-align: ${textAlign};
159
+ text-overflow: ${textOverflow || truncate && "ellipsis"};
160
+ ${truncate && `
161
+ overflow: hidden;
162
+ `};
163
+ ${screenReaderOnly && _visuallyHidden.default}
164
+ ${variant === "sup" && "vertical-align: super;"}
165
+ ${variant === "sub" && "vertical-align: sub;"}
166
+ ${display && `display: ${display};`}
167
+ ${listStyleType && `list-style-type: ${listStyleType};`}
168
+ `;
169
+ }}
196
170
  ${_styledSystem.space}
197
- ${({
171
+
172
+ ${({
198
173
  color,
199
174
  bg,
200
175
  backgroundColor,
@@ -205,6 +180,7 @@ const StyledTypography = _styledComponents.default.span.attrs(({
205
180
  backgroundColor,
206
181
  ...rest
207
182
  })}
183
+
208
184
  ${({
209
185
  isDisabled
210
186
  }) => isDisabled && (0, _styledComponents.css)`
@@ -1,6 +1,6 @@
1
1
  import { SpaceProps } from "styled-system";
2
2
  import { TagProps } from "../../__internal__/utils/helpers/tags";
3
- declare type TintRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
3
+ type TintRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
4
4
  export interface VerticalDividerProps extends SpaceProps, TagProps {
5
5
  /** Shorthand for the height attribute */
6
6
  h?: number | string;
@@ -22,6 +22,6 @@ export interface VerticalMenuItemProps<T = React.ElementType> extends PaddingPro
22
22
  /** Optional component to render instead of the default div, useful for rendering router link components */
23
23
  component?: T;
24
24
  }
25
- declare type InferredComponentProps<T extends React.ElementType> = Omit<React.ComponentProps<T>, keyof VerticalMenuItemProps<T>>;
25
+ type InferredComponentProps<T extends React.ElementType> = Omit<React.ComponentProps<T>, keyof VerticalMenuItemProps<T>>;
26
26
  export declare const VerticalMenuItem: <T>({ defaultOpen, title, iconType, adornment, children, component, active, height, href, ...rest }: T extends React.ElementType<any, keyof React.JSX.IntrinsicElements> ? InferredComponentProps<T> & VerticalMenuItemProps<T> : VerticalMenuItemProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>) => React.JSX.Element;
27
27
  export default VerticalMenuItem;
package/lib/global.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ModalList } from "components/modal/__internal__/modal-manager";
1
+ import { ModalList } from "./components/modal/__internal__/modal-manager";
2
2
 
3
3
  declare global {
4
4
  module "*.png";
@@ -4,7 +4,7 @@ declare const useChildButtons: (toggleButtonRef: React.RefObject<HTMLButtonEleme
4
4
  showButtons: () => void;
5
5
  hideButtons: () => void;
6
6
  buttonNode: import("react").RefObject<HTMLDivElement>;
7
- handleToggleButtonKeyDown: (ev: React.KeyboardEvent<HTMLButtonElement>) => void;
7
+ handleToggleButtonKeyDown: (ev: React.KeyboardEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
8
8
  wrapperProps: {
9
9
  "data-element": string;
10
10
  role: string;
@@ -1,4 +1,4 @@
1
1
  import { DebouncedFunc } from "lodash";
2
- declare type Callback = (...args: any[]) => void;
2
+ type Callback = (...args: any[]) => void;
3
3
  declare const useDebounce: <T extends Callback>(callback: T, delay: number) => DebouncedFunc<T>;
4
4
  export default useDebounce;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Strategy, Middleware, Placement } from "@floating-ui/dom";
3
- declare type CustomRefObject<T> = {
3
+ type CustomRefObject<T> = {
4
4
  current?: T | null;
5
5
  };
6
6
  export interface UseFloatingProps {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- declare type UseModalManagerArgs = {
2
+ type UseModalManagerArgs = {
3
3
  open: boolean;
4
4
  closeModal: (e: KeyboardEvent) => void;
5
5
  modalRef: React.RefObject<HTMLElement>;
@@ -1,4 +1,4 @@
1
1
  import { DebouncedFunc } from "lodash";
2
- declare type Callback = (...args: any[]) => void;
2
+ type Callback = (...args: any[]) => void;
3
3
  declare const useThrottle: <T extends Callback>(callback: T, delay: number) => DebouncedFunc<T>;
4
4
  export default useThrottle;
@@ -1,4 +1,4 @@
1
- export declare type PaletteFunction = (weight: number | string) => string;
1
+ export type PaletteFunction = (weight: number | string) => string;
2
2
  /**
3
3
  * Takes a config object of base colors and, for each base, generates functions
4
4
  * to lighten and darken it.
@@ -1,5 +1,5 @@
1
1
  import { PaletteFunction } from "../../palette";
2
- export declare type BasePalette = Record<string, string | PaletteFunction> & {
2
+ export type BasePalette = Record<string, string | PaletteFunction> & {
3
3
  blackOpacity: PaletteFunction;
4
4
  whiteOpacity: PaletteFunction;
5
5
  [key: string]: PaletteFunction;
@@ -1,5 +1,5 @@
1
1
  export declare const GAP_VALUES: number[];
2
- export declare type AllowedNumericalValues = (typeof GAP_VALUES)[number];
3
- export declare type Gap = AllowedNumericalValues | string;
2
+ export type AllowedNumericalValues = (typeof GAP_VALUES)[number];
3
+ export type Gap = AllowedNumericalValues | string;
4
4
  export declare const getGapValue: (gapValue: number | string) => string;
5
5
  export default function gap(gapValue: number | string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "152.7.0",
3
+ "version": "153.0.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -51,7 +51,7 @@
51
51
  "@sage/design-tokens": "^4.17.0",
52
52
  "react": "^17.0.2 || ^18.0.0",
53
53
  "react-dom": "^17.0.2 || ^18.0.0",
54
- "styled-components": "^4.4.1"
54
+ "styled-components": "^5.3.11"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@axe-core/playwright": "~4.10.1",
@@ -104,10 +104,10 @@
104
104
  "@types/react-transition-group": "^4.4.9",
105
105
  "@types/sinon": "^17.0.3",
106
106
  "@types/sprintf-js": "^1.1.4",
107
- "@types/styled-components": "5.1.17",
107
+ "@types/styled-components": "5.1.34",
108
108
  "@types/uuid": "^8.3.4",
109
- "@typescript-eslint/eslint-plugin": "^5.59.5",
110
- "@typescript-eslint/parser": "^5.59.5",
109
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
110
+ "@typescript-eslint/parser": "^6.0.0",
111
111
  "babel-jest": "^29.7.0",
112
112
  "babel-plugin-dev-expression": "^0.2.3",
113
113
  "browserslist": "^4.22.1",
@@ -143,7 +143,7 @@
143
143
  "jest-environment-jsdom": "^29.5.0",
144
144
  "jest-fail-on-console": "^3.3.1",
145
145
  "jest-fetch-mock": "^3.0.3",
146
- "jest-styled-components": "^6.3.4",
146
+ "jest-styled-components": "^7.0.8",
147
147
  "jsdom": "^21.1.0",
148
148
  "jsdom-testing-mocks": "^1.11.0",
149
149
  "lint-staged": "^11.2.6",
@@ -162,8 +162,8 @@
162
162
  "semver": "^7.5.4",
163
163
  "sprintf-js": "^1.1.3",
164
164
  "storybook": "~8.6.7",
165
- "styled-components": "^4.4.1",
166
- "typescript": "~4.7.0",
165
+ "styled-components": "^5.3.11",
166
+ "typescript": "~5.3.0",
167
167
  "url-loader": "^4.1.1",
168
168
  "uuid": "^8.3.2",
169
169
  "webpack-dev-server": "^4.15.1"