carbon-react 106.1.3 → 106.1.6

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 (250) hide show
  1. package/esm/__internal__/checkable-input/checkable-input.d.ts +2 -2
  2. package/esm/__internal__/fieldset/fieldset.component.d.ts +45 -15
  3. package/esm/__internal__/form-field/form-field.component.d.ts +14 -0
  4. package/esm/__internal__/form-field/form-field.d.ts +2 -4
  5. package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
  6. package/esm/__internal__/label/label.d.ts +2 -2
  7. package/esm/__internal__/validations/validation-icon.component.d.ts +2 -5
  8. package/esm/__spec_helper__/test-utils.d.ts +1 -1
  9. package/esm/components/accordion/accordion-group/accordion-group.component.d.ts +17 -3
  10. package/esm/components/accordion/accordion.component.js +1 -1
  11. package/esm/components/action-popover/action-popover.component.d.ts +35 -18
  12. package/esm/components/advanced-color-picker/advanced-color-picker.component.d.ts +14 -0
  13. package/esm/components/box/box.component.d.ts +1 -6
  14. package/esm/components/button-toggle-group/button-toggle-group.component.d.ts +14 -0
  15. package/esm/components/button-toggle-group/button-toggle-group.d.ts +2 -4
  16. package/esm/components/carbon-provider/carbon-provider.component.d.ts +1 -1
  17. package/esm/components/carbon-provider/carbon-provider.component.js +40 -38
  18. package/esm/components/card/card-row/card-row.component.d.ts +19 -4
  19. package/esm/components/card/card.component.d.ts +28 -10
  20. package/esm/components/checkbox/checkbox-group.component.d.ts +48 -15
  21. package/esm/components/checkbox/checkbox-group.d.ts +2 -2
  22. package/esm/components/checkbox/checkbox.component.d.ts +14 -0
  23. package/esm/components/content/content.component.d.ts +31 -9
  24. package/esm/components/date/__internal__/date-formats/index.js +88 -20
  25. package/esm/components/date/__internal__/utils.js +13 -3
  26. package/esm/components/date/date.component.js +13 -5
  27. package/esm/components/date-range/date-range.component.d.ts +68 -20
  28. package/esm/components/decimal/decimal.component.d.ts +14 -0
  29. package/esm/components/detail/detail.component.d.ts +34 -6
  30. package/esm/components/draggable/draggable-container.component.d.ts +24 -4
  31. package/esm/components/draggable/draggable-item.component.d.ts +34 -6
  32. package/esm/components/duelling-picklist/duelling-picklist.component.d.ts +27 -8
  33. package/esm/components/fieldset/fieldset.component.d.ts +23 -7
  34. package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +66 -17
  35. package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +48 -14
  36. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +44 -12
  37. package/esm/components/flat-table/flat-table.component.d.ts +46 -20
  38. package/esm/components/grid/grid-item/grid-item.component.d.ts +29 -22
  39. package/esm/components/grouped-character/grouped-character.component.d.ts +32 -10
  40. package/esm/components/heading/heading.component.d.ts +66 -18
  41. package/esm/components/help/help.component.d.ts +51 -22
  42. package/esm/components/loader/loader.component.d.ts +14 -0
  43. package/esm/components/loader-bar/loader-bar.component.d.ts +18 -3
  44. package/esm/components/message/message.component.d.ts +36 -12
  45. package/esm/components/multi-action-button/multi-action-button.component.d.ts +14 -0
  46. package/esm/components/note/note.component.d.ts +34 -11
  47. package/esm/components/numeral-date/numeral-date.component.d.ts +14 -0
  48. package/esm/components/numeral-date/numeral-date.d.ts +2 -2
  49. package/esm/components/pill/pill.component.d.ts +37 -22
  50. package/esm/components/pill/pill.style.js +1 -1
  51. package/esm/components/popover-container/popover-container.component.d.ts +54 -23
  52. package/esm/components/portrait/portrait.component.d.ts +55 -29
  53. package/esm/components/preview/preview.component.d.ts +26 -9
  54. package/esm/components/profile/profile.component.d.ts +28 -8
  55. package/esm/components/progress-tracker/progress-tracker.component.d.ts +14 -0
  56. package/esm/components/radio-button/radio-button-group.component.d.ts +60 -21
  57. package/esm/components/radio-button/radio-button-group.d.ts +2 -4
  58. package/esm/components/search/search.component.d.ts +14 -0
  59. package/esm/components/select/select-textbox/select-textbox.d.ts +2 -2
  60. package/esm/components/settings-row/settings-row.component.d.ts +26 -7
  61. package/esm/components/show-edit-pod/show-edit-pod.component.d.ts +58 -23
  62. package/esm/components/simple-color-picker/simple-color-picker.component.d.ts +52 -17
  63. package/esm/components/simple-color-picker/simple-color-picker.d.ts +2 -4
  64. package/esm/components/split-button/split-button.component.d.ts +14 -0
  65. package/esm/components/step-sequence/step-sequence.component.d.ts +21 -6
  66. package/esm/components/switch/switch.component.d.ts +14 -0
  67. package/esm/components/tabs/tab/tab.component.d.ts +51 -20
  68. package/esm/components/tabs/tabs.component.d.ts +46 -15
  69. package/esm/components/textarea/textarea.component.d.ts +14 -0
  70. package/esm/components/textarea/textarea.d.ts +2 -2
  71. package/esm/components/textbox/textbox.component.d.ts +14 -0
  72. package/esm/components/textbox/textbox.d.ts +2 -2
  73. package/esm/components/tile/tile-footer/tile-footer.component.d.ts +19 -4
  74. package/esm/components/tile-select/tile-select-group.component.d.ts +35 -12
  75. package/esm/components/tile-select/tile-select.component.d.ts +63 -26
  76. package/esm/components/typography/list.component.d.ts +1 -2
  77. package/esm/components/typography/typography.component.d.ts +1 -6
  78. package/esm/global.d.ts +1 -0
  79. package/esm/style/color-config/index.d.ts +2 -3
  80. package/esm/style/color-config/index.js +3 -2
  81. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +3 -2
  82. package/esm/style/design-tokens/debug-theme.util.d.ts +449 -1
  83. package/esm/style/design-tokens/debug-theme.util.js +1 -1
  84. package/esm/style/design-tokens/generate-css-variables.util.d.ts +10 -1
  85. package/esm/style/global-style.d.ts +1 -8
  86. package/esm/style/palette/index.d.ts +19 -7
  87. package/esm/style/themes/aegean/aegean-theme.config.d.ts +3 -25
  88. package/esm/style/themes/aegean/aegean-theme.config.js +16 -14
  89. package/esm/style/themes/aegean/index.d.ts +2 -5
  90. package/esm/style/themes/base/base-theme.config.d.ts +31 -468
  91. package/esm/style/themes/base/base-theme.config.js +3 -1
  92. package/esm/style/themes/base/index.d.ts +3 -62
  93. package/esm/style/themes/base/index.js +2 -2
  94. package/esm/style/themes/index.d.ts +1 -5
  95. package/esm/style/themes/medium/index.d.ts +1 -1
  96. package/esm/style/themes/mint/index.d.ts +2 -5
  97. package/esm/style/themes/mint/mint-theme.config.d.ts +3 -25
  98. package/esm/style/themes/mint/mint-theme.config.js +16 -14
  99. package/esm/style/themes/none/index.d.ts +2 -5
  100. package/esm/style/themes/none/none-theme.config.d.ts +2 -3
  101. package/esm/style/themes/sage/index.d.ts +8 -11
  102. package/esm/style/themes/small/index.d.ts +1 -1
  103. package/esm/style/themes/test-utils.d.ts +1 -1
  104. package/esm/style/utils/add-hex-symbols.d.ts +1 -1
  105. package/esm/style/utils/at-opacity.d.ts +6 -1
  106. package/esm/style/utils/at-opacity.js +4 -2
  107. package/esm/style/utils/color.d.ts +3 -7
  108. package/esm/style/utils/color.js +10 -10
  109. package/esm/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -3
  110. package/esm/style/utils/filter-styled-system-margin-props.d.ts +3 -1
  111. package/esm/style/utils/filter-styled-system-margin-props.js +1 -1
  112. package/esm/style/utils/filter-styled-system-padding-props.d.ts +3 -1
  113. package/esm/style/utils/filter-styled-system-padding-props.js +1 -1
  114. package/esm/style/utils/get-rgb-values.d.ts +2 -2
  115. package/esm/style/utils/get-rgb-values.js +1 -1
  116. package/esm/style/utils/index.d.ts +1 -1
  117. package/esm/style/utils/merge-deep.d.ts +2 -6
  118. package/esm/style/utils/merge-deep.js +19 -22
  119. package/esm/style/utils/mix.d.ts +4 -1
  120. package/esm/style/utils/mix.js +10 -5
  121. package/esm/style/utils/shade.d.ts +1 -1
  122. package/esm/style/utils/tint.d.ts +1 -1
  123. package/esm/style/utils/width.d.ts +2 -3
  124. package/lib/__internal__/checkable-input/checkable-input.d.ts +2 -2
  125. package/lib/__internal__/fieldset/fieldset.component.d.ts +45 -15
  126. package/lib/__internal__/form-field/form-field.component.d.ts +14 -0
  127. package/lib/__internal__/form-field/form-field.d.ts +2 -4
  128. package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
  129. package/lib/__internal__/label/label.d.ts +2 -2
  130. package/lib/__internal__/validations/validation-icon.component.d.ts +2 -5
  131. package/lib/__spec_helper__/test-utils.d.ts +1 -1
  132. package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +17 -3
  133. package/lib/components/accordion/accordion.component.js +1 -1
  134. package/lib/components/action-popover/action-popover.component.d.ts +35 -18
  135. package/lib/components/advanced-color-picker/advanced-color-picker.component.d.ts +14 -0
  136. package/lib/components/box/box.component.d.ts +1 -6
  137. package/lib/components/button-toggle-group/button-toggle-group.component.d.ts +14 -0
  138. package/lib/components/button-toggle-group/button-toggle-group.d.ts +2 -4
  139. package/lib/components/carbon-provider/carbon-provider.component.d.ts +1 -1
  140. package/lib/components/carbon-provider/carbon-provider.component.js +20 -19
  141. package/lib/components/card/card-row/card-row.component.d.ts +19 -4
  142. package/lib/components/card/card.component.d.ts +28 -10
  143. package/lib/components/checkbox/checkbox-group.component.d.ts +48 -15
  144. package/lib/components/checkbox/checkbox-group.d.ts +2 -2
  145. package/lib/components/checkbox/checkbox.component.d.ts +14 -0
  146. package/lib/components/content/content.component.d.ts +31 -9
  147. package/lib/components/date/__internal__/date-formats/index.js +88 -20
  148. package/lib/components/date/__internal__/utils.js +14 -3
  149. package/lib/components/date/date.component.js +13 -5
  150. package/lib/components/date-range/date-range.component.d.ts +68 -20
  151. package/lib/components/decimal/decimal.component.d.ts +14 -0
  152. package/lib/components/detail/detail.component.d.ts +34 -6
  153. package/lib/components/draggable/draggable-container.component.d.ts +24 -4
  154. package/lib/components/draggable/draggable-item.component.d.ts +34 -6
  155. package/lib/components/duelling-picklist/duelling-picklist.component.d.ts +27 -8
  156. package/lib/components/fieldset/fieldset.component.d.ts +23 -7
  157. package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +66 -17
  158. package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +48 -14
  159. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +44 -12
  160. package/lib/components/flat-table/flat-table.component.d.ts +46 -20
  161. package/lib/components/grid/grid-item/grid-item.component.d.ts +29 -22
  162. package/lib/components/grouped-character/grouped-character.component.d.ts +32 -10
  163. package/lib/components/heading/heading.component.d.ts +66 -18
  164. package/lib/components/help/help.component.d.ts +51 -22
  165. package/lib/components/loader/loader.component.d.ts +14 -0
  166. package/lib/components/loader-bar/loader-bar.component.d.ts +18 -3
  167. package/lib/components/message/message.component.d.ts +36 -12
  168. package/lib/components/multi-action-button/multi-action-button.component.d.ts +14 -0
  169. package/lib/components/note/note.component.d.ts +34 -11
  170. package/lib/components/numeral-date/numeral-date.component.d.ts +14 -0
  171. package/lib/components/numeral-date/numeral-date.d.ts +2 -2
  172. package/lib/components/pill/pill.component.d.ts +37 -22
  173. package/lib/components/pill/pill.style.js +1 -1
  174. package/lib/components/popover-container/popover-container.component.d.ts +54 -23
  175. package/lib/components/portrait/portrait.component.d.ts +55 -29
  176. package/lib/components/preview/preview.component.d.ts +26 -9
  177. package/lib/components/profile/profile.component.d.ts +28 -8
  178. package/lib/components/progress-tracker/progress-tracker.component.d.ts +14 -0
  179. package/lib/components/radio-button/radio-button-group.component.d.ts +60 -21
  180. package/lib/components/radio-button/radio-button-group.d.ts +2 -4
  181. package/lib/components/search/search.component.d.ts +14 -0
  182. package/lib/components/select/select-textbox/select-textbox.d.ts +2 -2
  183. package/lib/components/settings-row/settings-row.component.d.ts +26 -7
  184. package/lib/components/show-edit-pod/show-edit-pod.component.d.ts +58 -23
  185. package/lib/components/simple-color-picker/simple-color-picker.component.d.ts +52 -17
  186. package/lib/components/simple-color-picker/simple-color-picker.d.ts +2 -4
  187. package/lib/components/split-button/split-button.component.d.ts +14 -0
  188. package/lib/components/step-sequence/step-sequence.component.d.ts +21 -6
  189. package/lib/components/switch/switch.component.d.ts +14 -0
  190. package/lib/components/tabs/tab/tab.component.d.ts +51 -20
  191. package/lib/components/tabs/tabs.component.d.ts +46 -15
  192. package/lib/components/textarea/textarea.component.d.ts +14 -0
  193. package/lib/components/textarea/textarea.d.ts +2 -2
  194. package/lib/components/textbox/textbox.component.d.ts +14 -0
  195. package/lib/components/textbox/textbox.d.ts +2 -2
  196. package/lib/components/tile/tile-footer/tile-footer.component.d.ts +19 -4
  197. package/lib/components/tile-select/tile-select-group.component.d.ts +35 -12
  198. package/lib/components/tile-select/tile-select.component.d.ts +63 -26
  199. package/lib/components/typography/list.component.d.ts +1 -2
  200. package/lib/components/typography/typography.component.d.ts +1 -6
  201. package/lib/global.d.ts +1 -0
  202. package/lib/style/color-config/index.d.ts +2 -3
  203. package/lib/style/color-config/index.js +2 -1
  204. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +3 -2
  205. package/lib/style/design-tokens/debug-theme.util.d.ts +449 -1
  206. package/lib/style/design-tokens/generate-css-variables.util.d.ts +10 -1
  207. package/lib/style/global-style.d.ts +1 -8
  208. package/lib/style/palette/index.d.ts +19 -7
  209. package/lib/style/themes/aegean/aegean-theme.config.d.ts +3 -25
  210. package/lib/style/themes/aegean/aegean-theme.config.js +16 -14
  211. package/lib/style/themes/aegean/index.d.ts +2 -5
  212. package/lib/style/themes/base/base-theme.config.d.ts +31 -468
  213. package/lib/style/themes/base/base-theme.config.js +3 -1
  214. package/lib/style/themes/base/index.d.ts +3 -62
  215. package/lib/style/themes/base/index.js +2 -2
  216. package/lib/style/themes/index.d.ts +1 -5
  217. package/lib/style/themes/medium/index.d.ts +1 -1
  218. package/lib/style/themes/mint/index.d.ts +2 -5
  219. package/lib/style/themes/mint/mint-theme.config.d.ts +3 -25
  220. package/lib/style/themes/mint/mint-theme.config.js +16 -14
  221. package/lib/style/themes/none/index.d.ts +2 -5
  222. package/lib/style/themes/none/none-theme.config.d.ts +2 -3
  223. package/lib/style/themes/sage/index.d.ts +8 -11
  224. package/lib/style/themes/small/index.d.ts +1 -1
  225. package/lib/style/themes/test-utils.d.ts +1 -1
  226. package/lib/style/utils/add-hex-symbols.d.ts +1 -1
  227. package/lib/style/utils/at-opacity.d.ts +6 -1
  228. package/lib/style/utils/at-opacity.js +4 -2
  229. package/lib/style/utils/color.d.ts +3 -7
  230. package/lib/style/utils/color.js +9 -9
  231. package/lib/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -3
  232. package/lib/style/utils/filter-styled-system-margin-props.d.ts +3 -1
  233. package/lib/style/utils/filter-styled-system-margin-props.js +2 -0
  234. package/lib/style/utils/filter-styled-system-padding-props.d.ts +3 -1
  235. package/lib/style/utils/filter-styled-system-padding-props.js +2 -0
  236. package/lib/style/utils/get-rgb-values.d.ts +2 -2
  237. package/lib/style/utils/get-rgb-values.js +1 -1
  238. package/lib/style/utils/index.d.ts +1 -1
  239. package/lib/style/utils/merge-deep.d.ts +2 -6
  240. package/lib/style/utils/merge-deep.js +20 -24
  241. package/lib/style/utils/mix.d.ts +4 -1
  242. package/lib/style/utils/mix.js +10 -5
  243. package/lib/style/utils/shade.d.ts +1 -1
  244. package/lib/style/utils/tint.d.ts +1 -1
  245. package/lib/style/utils/width.d.ts +2 -3
  246. package/package.json +1 -1
  247. package/esm/style/__spec__.d.ts +0 -1
  248. package/esm/style/__spec__.js +0 -76
  249. package/lib/style/__spec__.d.ts +0 -1
  250. package/lib/style/__spec__.js +0 -82
@@ -16,21 +16,23 @@ var _default = palette => {
16
16
  },
17
17
 
18
18
  get compatibility() {
19
+ var _this$colors, _this$colors2, _this$colors3, _this$colors4, _this$colors5, _this$colors6, _this$colors7, _this$colors8, _this$colors9, _this$colors10, _this$colors11, _this$colors12, _this$colors13, _this$colors14;
20
+
19
21
  return {
20
- colorsActionMajor150: this.colors.loadingBarBackground,
21
- colorsActionMajor500: this.colors.primary,
22
- colorsActionMajor600: this.colors.secondary,
23
- colorsActionMajor700: this.colors.tertiary,
24
- colorsComponentsMenuAutumnStandard600: this.colors.primary,
25
- colorsComponentsMenuSpringChild600: this.colors.primary,
26
- colorsComponentsMenuAutumnChild600: this.colors.primary,
27
- colorsComponentsMenuSummerChild600: this.colors.primary,
28
- colorsComponentsMenuWinterChild600: this.colors.primary,
29
- colorsComponentsMenuSpringChildAlt600: this.colors.primary,
30
- colorsComponentsMenuAutumnChildAlt600: this.colors.primary,
31
- colorsComponentsMenuWinterChildAlt600: this.colors.primary,
32
- colorsComponentsMenuSummerChildAlt600: this.colors.primary,
33
- colorsBaseTheme: this.colors.primary
22
+ colorsActionMajor150: this === null || this === void 0 ? void 0 : (_this$colors = this.colors) === null || _this$colors === void 0 ? void 0 : _this$colors.loadingBarBackground,
23
+ colorsActionMajor500: this === null || this === void 0 ? void 0 : (_this$colors2 = this.colors) === null || _this$colors2 === void 0 ? void 0 : _this$colors2.primary,
24
+ colorsActionMajor600: this === null || this === void 0 ? void 0 : (_this$colors3 = this.colors) === null || _this$colors3 === void 0 ? void 0 : _this$colors3.secondary,
25
+ colorsActionMajor700: this === null || this === void 0 ? void 0 : (_this$colors4 = this.colors) === null || _this$colors4 === void 0 ? void 0 : _this$colors4.tertiary,
26
+ colorsComponentsMenuAutumnStandard600: this === null || this === void 0 ? void 0 : (_this$colors5 = this.colors) === null || _this$colors5 === void 0 ? void 0 : _this$colors5.primary,
27
+ colorsComponentsMenuSpringChild600: this === null || this === void 0 ? void 0 : (_this$colors6 = this.colors) === null || _this$colors6 === void 0 ? void 0 : _this$colors6.primary,
28
+ colorsComponentsMenuAutumnChild600: this === null || this === void 0 ? void 0 : (_this$colors7 = this.colors) === null || _this$colors7 === void 0 ? void 0 : _this$colors7.primary,
29
+ colorsComponentsMenuSummerChild600: this === null || this === void 0 ? void 0 : (_this$colors8 = this.colors) === null || _this$colors8 === void 0 ? void 0 : _this$colors8.primary,
30
+ colorsComponentsMenuWinterChild600: this === null || this === void 0 ? void 0 : (_this$colors9 = this.colors) === null || _this$colors9 === void 0 ? void 0 : _this$colors9.primary,
31
+ colorsComponentsMenuSpringChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors10 = this.colors) === null || _this$colors10 === void 0 ? void 0 : _this$colors10.primary,
32
+ colorsComponentsMenuAutumnChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors11 = this.colors) === null || _this$colors11 === void 0 ? void 0 : _this$colors11.primary,
33
+ colorsComponentsMenuWinterChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors12 = this.colors) === null || _this$colors12 === void 0 ? void 0 : _this$colors12.primary,
34
+ colorsComponentsMenuSummerChildAlt600: this === null || this === void 0 ? void 0 : (_this$colors13 = this.colors) === null || _this$colors13 === void 0 ? void 0 : _this$colors13.primary,
35
+ colorsBaseTheme: this === null || this === void 0 ? void 0 : (_this$colors14 = this.colors) === null || _this$colors14 === void 0 ? void 0 : _this$colors14.primary
34
36
  };
35
37
  }
36
38
 
@@ -1,5 +1,2 @@
1
- import { ThemeObject } from "../base";
2
-
3
- declare const noneTheme: ThemeObject;
4
-
5
- export default noneTheme;
1
+ declare const _default: Partial<import("../base").ThemeObject>;
2
+ export default _default;
@@ -1,4 +1,3 @@
1
- declare function _default(): {
2
- name: string;
3
- };
1
+ import { ThemeObject } from "../base";
2
+ declare const _default: () => Partial<ThemeObject>;
4
3
  export default _default;
@@ -446,17 +446,14 @@ declare var _default: {
446
446
  opacity800: string;
447
447
  };
448
448
  name: string;
449
- palette: import("../../palette").Palette & import("../base").ColorsWithHex & {
450
- blackOpacity: (opacity: number) => string;
451
- whiteOpacity: (opacity: number) => string;
452
- };
453
- spacing: number;
454
- space: string[];
455
- colors: import("../base").Colors;
456
- disabled: {
449
+ palette?: import("../base/base-theme.config").BasePalette | undefined;
450
+ spacing?: number | undefined;
451
+ space?: string[] | undefined;
452
+ colors?: Partial<import("../base/base-theme.config").Colors> | undefined;
453
+ disabled?: {
457
454
  background: string;
458
- };
459
- zIndex: {
455
+ } | undefined;
456
+ zIndex?: {
460
457
  smallOverlay: number;
461
458
  overlay: number;
462
459
  popover: number;
@@ -466,6 +463,6 @@ declare var _default: {
466
463
  fullScreenModal: number;
467
464
  notification: number;
468
465
  aboveAll: number;
469
- };
466
+ } | undefined;
470
467
  };
471
468
  export default _default;
@@ -1,2 +1,2 @@
1
- declare var _default: import("../base").ThemeObject;
1
+ declare const _default: Partial<import("../base").ThemeObject>;
2
2
  export default _default;
@@ -1 +1 @@
1
- export function assertIsSubset(obj: any, comparison: any): void;
1
+ export declare const assertIsSubset: (obj: Record<string, unknown>, comparison: Record<string, unknown>) => void;
@@ -1,2 +1,2 @@
1
- declare function _default(configObject: any): any;
1
+ declare const _default: (configObject: Record<string, string>) => Record<string, string>;
2
2
  export default _default;
@@ -1,2 +1,7 @@
1
- declare function _default(base: any): (opacity: any) => string;
1
+ declare const _default: (base: string) => (opacity: number | string) => string;
2
+ /**
3
+ * Given a base color hex will return a function that expects
4
+ * some given opactiy and returns the base color at that
5
+ * opacity.
6
+ */
2
7
  export default _default;
@@ -11,8 +11,10 @@ exports.default = void 0;
11
11
  * opacity.
12
12
  */
13
13
  var _default = base => {
14
- const rgb = base.match(/[^#]{2}/g).map(pair => parseInt(pair, 16));
15
- return opacity => `rgba(${rgb.join(",")},${opacity})`;
14
+ var _base$match;
15
+
16
+ const rgb = base === null || base === void 0 ? void 0 : (_base$match = base.match(/[^#]{2}/g)) === null || _base$match === void 0 ? void 0 : _base$match.map(pair => parseInt(pair, 16));
17
+ return opacity => `rgba(${rgb === null || rgb === void 0 ? void 0 : rgb.join(",")},${opacity})`;
16
18
  };
17
19
 
18
20
  exports.default = _default;
@@ -1,8 +1,4 @@
1
- export function toColor(theme: any, color: any): any;
2
- declare function _default({ color, bg, backgroundColor, ...rest }: {
3
- [x: string]: any;
4
- color: any;
5
- bg: any;
6
- backgroundColor: any;
7
- }): any;
1
+ import { ThemeObject } from "style/themes/base";
2
+ export declare const toColor: (theme: ThemeObject, color: string) => string;
3
+ declare const _default: ({ color, bg, backgroundColor, ...rest }: Record<string, unknown>) => any;
8
4
  export default _default;
@@ -33,6 +33,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
33
33
  * This allows us to keep our themes as plain objects.
34
34
  */
35
35
  const toColor = (theme, color) => {
36
+ var _color$match;
37
+
36
38
  if (color.startsWith("--") && color.slice(2) in _common.default) {
37
39
  return `var(${color})`;
38
40
  }
@@ -41,13 +43,13 @@ const toColor = (theme, color) => {
41
43
  palette
42
44
  } = theme;
43
45
  const percentage = color.match(/\d+/);
44
- const method = color.match(/[a-zA-Z]+/);
46
+ const method = (_color$match = color.match(/[a-zA-Z]+/)) === null || _color$match === void 0 ? void 0 : _color$match.toString();
45
47
 
46
- if (method in palette) {
48
+ if (method && method in palette) {
47
49
  const match = palette[method];
48
50
 
49
51
  if (typeof match === "function") {
50
- const arg = ["blackOpacity", "whiteOpacity"].includes(method.toString()) ? `0.${percentage}` : percentage;
52
+ const arg = ["blackOpacity", "whiteOpacity"].includes(method) ? `0.${percentage}` : percentage;
51
53
  return match(arg);
52
54
  }
53
55
 
@@ -65,13 +67,11 @@ var _default = ({
65
67
  backgroundColor,
66
68
  ...rest
67
69
  }) => {
70
+ const obj = {};
71
+ obj.color = color ? toColor(rest.theme, color) : undefined;
72
+ obj.bg = bg || backgroundColor ? toColor(rest.theme, bg || backgroundColor) : undefined;
68
73
  return (0, _styledSystem.color)({ ...rest,
69
- ...(color && {
70
- color: toColor(rest.theme, color)
71
- }),
72
- ...((bg || backgroundColor) && {
73
- bg: toColor(rest.theme, bg || backgroundColor)
74
- })
74
+ ...obj
75
75
  });
76
76
  };
77
77
 
@@ -1,4 +1,2 @@
1
+ declare const filterOutStyledSystemSpacingProps: (obj: Record<string, unknown>) => Record<string, unknown>;
1
2
  export default filterOutStyledSystemSpacingProps;
2
- declare function filterOutStyledSystemSpacingProps(obj: any): {
3
- [k: string]: any;
4
- };
@@ -1 +1,3 @@
1
- export default function filterStyledSystemMarginProps(originalObject: any): {};
1
+ import { MarginProps } from "styled-system";
2
+ export declare const marginPropertyNames: string[];
3
+ export default function filterStyledSystemMarginProps(originalObject: Record<string, unknown> | MarginProps): MarginProps;
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = filterStyledSystemMarginProps;
7
+ exports.marginPropertyNames = void 0;
7
8
 
8
9
  var _filterObjectProperties = _interopRequireDefault(require("../../__internal__/filter-object-properties"));
9
10
 
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
 
12
13
  const marginPropertyNames = ["margin", "m", "marginLeft", "ml", "marginRight", "mr", "marginTop", "mt", "marginBottom", "mb", "marginX", "mx", "marginY", "my"];
14
+ exports.marginPropertyNames = marginPropertyNames;
13
15
 
14
16
  function filterStyledSystemMarginProps(originalObject) {
15
17
  return (0, _filterObjectProperties.default)(originalObject, marginPropertyNames);
@@ -1 +1,3 @@
1
- export default function filterStyledSystemPaddingProps(originalObject: any): {};
1
+ import { PaddingProps } from "styled-system";
2
+ export declare const paddingPropertyNames: string[];
3
+ export default function filterStyledSystemPaddingProps(originalObject: Record<string, unknown>): PaddingProps;
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = filterStyledSystemPaddingProps;
7
+ exports.paddingPropertyNames = void 0;
7
8
 
8
9
  var _filterObjectProperties = _interopRequireDefault(require("../../__internal__/filter-object-properties"));
9
10
 
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
 
12
13
  const paddingPropertyNames = ["padding", "p", "paddingLeft", "pl", "paddingRight", "pr", "paddingTop", "pt", "paddingBottom", "pb", "paddingX", "px", "paddingY", "py"];
14
+ exports.paddingPropertyNames = paddingPropertyNames;
13
15
 
14
16
  function filterStyledSystemPaddingProps(originalObject) {
15
17
  return (0, _filterObjectProperties.default)(originalObject, paddingPropertyNames);
@@ -1,3 +1,3 @@
1
- export default getRgbValues;
2
1
  /** Given a base color in hex will return its rgb values. */
3
- declare function getRgbValues(baseColor: any): number[];
2
+ declare const getRgbValues: (baseColor: string) => number[];
3
+ export default getRgbValues;
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  /** Given a base color in hex will return its rgb values. */
9
9
  const getRgbValues = baseColor => {
10
- return [parseInt(baseColor.substr(1, 2), 16), parseInt(baseColor.substr(3, 2), 16), parseInt(baseColor.substr(5, 2), 16)];
10
+ return [parseInt(baseColor.substring(1, 3), 16), parseInt(baseColor.substring(3, 5), 16), parseInt(baseColor.substring(5, 6), 16)];
11
11
  };
12
12
 
13
13
  var _default = getRgbValues;
@@ -1,4 +1,4 @@
1
1
  import filterStyledSystemPaddingProps from "./filter-styled-system-padding-props";
2
2
  import filterStyledSystemMarginProps from "./filter-styled-system-margin-props";
3
3
  import filterOutStyledSystemSpacingProps from "./filter-out-styled-system-spacing-props";
4
- export { filterStyledSystemPaddingProps, filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps };
4
+ export { filterStyledSystemPaddingProps, filterStyledSystemMarginProps, filterOutStyledSystemSpacingProps, };
@@ -1,12 +1,8 @@
1
1
  /**
2
2
  * Simple object check.
3
- * @param item
4
- * @returns {boolean}
5
3
  */
6
- export function isObject(item: any): boolean;
4
+ export declare function isObject(item: unknown): unknown;
7
5
  /**
8
6
  * Deep merge two objects.
9
- * @param target
10
- * @param ...sources
11
7
  */
12
- export function mergeDeep(target: any, ...sources: any[]): any;
8
+ export declare function mergeDeep(target: Record<string, unknown>, ...sources: Record<string, unknown>[]): Record<string, unknown>;
@@ -8,41 +8,37 @@ exports.mergeDeep = mergeDeep;
8
8
 
9
9
  /**
10
10
  * Simple object check.
11
- * @param item
12
- * @returns {boolean}
13
11
  */
14
12
  function isObject(item) {
15
13
  return item && typeof item === "object" && !Array.isArray(item);
16
14
  }
17
- /**
18
- * Deep merge two objects.
19
- * @param target
20
- * @param ...sources
21
- */
22
15
 
16
+ function merge(_target, ..._sources) {
17
+ if (!_sources.length) return _target;
23
18
 
24
- function mergeDeep(target, ...sources) {
25
- const merge = (_target, ..._sources) => {
26
- if (!_sources.length) return _target;
27
-
28
- const source = _sources.shift();
29
-
30
- if (isObject(_target) && isObject(source)) {
31
- for (const key in source) {
32
- if (isObject(source[key])) {
33
- merge(_target[key], source[key]);
34
- } else {
35
- Object.assign(_target, {
36
- [key]: source[key]
37
- });
38
- }
19
+ const source = _sources.shift();
20
+
21
+ if (isObject(_target) && isObject(source)) {
22
+ for (const key in source) {
23
+ if (isObject(source[key])) {
24
+ merge(_target[key], source[key]);
25
+ } else {
26
+ Object.assign(_target, {
27
+ [key]: source[key]
28
+ });
39
29
  }
40
30
  }
31
+ }
41
32
 
42
- return merge(_target, ..._sources);
43
- }; // ensure function is not mutative
33
+ return merge(_target, ..._sources);
34
+ }
35
+ /**
36
+ * Deep merge two objects.
37
+ */
44
38
 
45
39
 
40
+ function mergeDeep(target, ...sources) {
41
+ // ensure function is not mutative
46
42
  const newTarget = JSON.parse(JSON.stringify(target));
47
43
  return merge(newTarget, ...sources);
48
44
  }
@@ -1,2 +1,5 @@
1
- declare function _default(inputColorA: any, inputColorB: any, weight?: number): string;
1
+ declare const _default: (inputColorA: string, inputColorB: string, weight?: number) => string;
2
+ /**
3
+ * A Javascript implementation of the Sass `mix` mixin.
4
+ */
2
5
  export default _default;
@@ -23,11 +23,16 @@ const processHexes = (...hexes) => {
23
23
 
24
24
  var _default = (inputColorA, inputColorB, weight = 50) => {
25
25
  const [colorA, colorB] = processHexes(inputColorA, inputColorB);
26
- const colorAPairs = colorA.match(/.{1,2}/g),
27
- colorBPairs = colorB.match(/.{1,2}/g);
28
- const hex = colorAPairs.reduce((acc, pair, i) => {
29
- const val1 = hexToDec(pair),
30
- val2 = hexToDec(colorBPairs[i]);
26
+ const colorAPairs = colorA.match(/.{1,2}/g);
27
+ const colorBPairs = colorB.match(/.{1,2}/g);
28
+
29
+ if (!colorBPairs) {
30
+ return "";
31
+ }
32
+
33
+ const hex = colorAPairs === null || colorAPairs === void 0 ? void 0 : colorAPairs.reduce((acc, pair, i) => {
34
+ const val1 = hexToDec(pair);
35
+ const val2 = hexToDec(colorBPairs[i]);
31
36
  const combination = decToHex(Math.round(val2 + (val1 - val2) * (weight / 100.0)));
32
37
  return acc + combination.padStart(2, "0");
33
38
  }, "").toUpperCase();
@@ -1,2 +1,2 @@
1
- declare function _default(color: any): (weight: any) => string;
1
+ declare const _default: (color: string) => (weight: number | string) => string;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare function _default(color: any): (weight: any) => string;
1
+ declare const _default: (color: string) => (weight: number | string) => string;
2
2
  export default _default;
@@ -1,4 +1,3 @@
1
- declare function _default({ width }: {
2
- width: any;
3
- }): any;
1
+ import { styleFn } from "styled-system";
2
+ declare const _default: ({ width }: Record<string, string>) => styleFn;
4
3
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "106.1.3",
3
+ "version": "106.1.6",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -1 +0,0 @@
1
- export {};
@@ -1,76 +0,0 @@
1
- import config from "./color-config";
2
- import mix from "./utils/mix";
3
- import generatePalette from "./palette";
4
-
5
- const assertCorrectColorMix = (config, paletteObject) => {
6
- Object.keys(config).forEach(col => {
7
- const match = col.match(/([a-z]+)([\d]{0,2})/i);
8
- const func = match[1],
9
- weight = Number(match[2]);
10
- expect(paletteObject[func](weight)).toEqual("#" + config[col]);
11
- });
12
- };
13
-
14
- describe("style", () => {
15
- let colorConfig = {
16
- brilliantGreenShade20: "00B000",
17
- brilliantGreenTint50: "80EE80",
18
- goldTint50: "FFDA80",
19
- errorRedShade20: "9F2D3F",
20
- genericGreenTint50: "80CC80",
21
- genericGreenTint30: "4DB84D",
22
- genericGreenShade15: "008200",
23
- genericGreenShade35: "006300",
24
- genericGreenShade55: "004500",
25
- productGreenTint50: "80D1BB",
26
- productGreenTint30: "4DBF9F",
27
- productGreenShade21: "00815D",
28
- productGreenShade41: "006046",
29
- productGreenShade61: "00402E",
30
- productBlueTint50: "80BBE4",
31
- productBlueTint30: "4DA0D9",
32
- productBlueShade3: "0073C2",
33
- productBlueShade23: "005C9A",
34
- productBlueShade43: "004472",
35
- amethystTint50: "AC96C1",
36
- amethystTint30: "8A6BA8",
37
- amethystTint10: "69418F",
38
- amethystShade10: "4F2876",
39
- amethystShade30: "3E1F5C",
40
- slateTint95: "F2F5F6",
41
- slateTint90: "E6EBED",
42
- slateTint80: "CCD6DB",
43
- slateTint60: "99ADB6",
44
- slateTint40: "668592",
45
- slateTint20: "335C6D",
46
- slateShade60: "00141D"
47
- };
48
- describe("palette", () => {
49
- let palette;
50
- beforeEach(() => {
51
- palette = generatePalette(config);
52
- });
53
- it("produces the correct color mix", () => {
54
- assertCorrectColorMix(colorConfig, palette);
55
- });
56
- });
57
- describe("mix", () => {
58
- it("defaults to a weight of 50", () => {
59
- expect(mix(config.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
60
- });
61
- it("accepts colors without a hash symbol", () => {
62
- expect(mix(config.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
63
- });
64
- it("accepts colors with a hash symbol", () => {
65
- expect(mix("#" + config.genericGreen, "#FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
66
- });
67
- it("accepts three-digit hashes", () => {
68
- expect(mix(config.genericGreen, "FFF")).toEqual("#" + colorConfig.genericGreenTint50);
69
- expect(mix("FFF", config.genericGreen)).toEqual("#" + colorConfig.genericGreenTint50);
70
- });
71
- it("accepts colors with combinations of with and without hash symbols", () => {
72
- expect(mix("#" + config.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
73
- expect(mix(config.genericGreen, "#FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
74
- });
75
- });
76
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- var _colorConfig = _interopRequireDefault(require("./color-config"));
4
-
5
- var _mix = _interopRequireDefault(require("./utils/mix"));
6
-
7
- var _palette = _interopRequireDefault(require("./palette"));
8
-
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
-
11
- const assertCorrectColorMix = (config, paletteObject) => {
12
- Object.keys(config).forEach(col => {
13
- const match = col.match(/([a-z]+)([\d]{0,2})/i);
14
- const func = match[1],
15
- weight = Number(match[2]);
16
- expect(paletteObject[func](weight)).toEqual("#" + config[col]);
17
- });
18
- };
19
-
20
- describe("style", () => {
21
- let colorConfig = {
22
- brilliantGreenShade20: "00B000",
23
- brilliantGreenTint50: "80EE80",
24
- goldTint50: "FFDA80",
25
- errorRedShade20: "9F2D3F",
26
- genericGreenTint50: "80CC80",
27
- genericGreenTint30: "4DB84D",
28
- genericGreenShade15: "008200",
29
- genericGreenShade35: "006300",
30
- genericGreenShade55: "004500",
31
- productGreenTint50: "80D1BB",
32
- productGreenTint30: "4DBF9F",
33
- productGreenShade21: "00815D",
34
- productGreenShade41: "006046",
35
- productGreenShade61: "00402E",
36
- productBlueTint50: "80BBE4",
37
- productBlueTint30: "4DA0D9",
38
- productBlueShade3: "0073C2",
39
- productBlueShade23: "005C9A",
40
- productBlueShade43: "004472",
41
- amethystTint50: "AC96C1",
42
- amethystTint30: "8A6BA8",
43
- amethystTint10: "69418F",
44
- amethystShade10: "4F2876",
45
- amethystShade30: "3E1F5C",
46
- slateTint95: "F2F5F6",
47
- slateTint90: "E6EBED",
48
- slateTint80: "CCD6DB",
49
- slateTint60: "99ADB6",
50
- slateTint40: "668592",
51
- slateTint20: "335C6D",
52
- slateShade60: "00141D"
53
- };
54
- describe("palette", () => {
55
- let palette;
56
- beforeEach(() => {
57
- palette = (0, _palette.default)(_colorConfig.default);
58
- });
59
- it("produces the correct color mix", () => {
60
- assertCorrectColorMix(colorConfig, palette);
61
- });
62
- });
63
- describe("mix", () => {
64
- it("defaults to a weight of 50", () => {
65
- expect((0, _mix.default)(_colorConfig.default.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
66
- });
67
- it("accepts colors without a hash symbol", () => {
68
- expect((0, _mix.default)(_colorConfig.default.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
69
- });
70
- it("accepts colors with a hash symbol", () => {
71
- expect((0, _mix.default)("#" + _colorConfig.default.genericGreen, "#FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
72
- });
73
- it("accepts three-digit hashes", () => {
74
- expect((0, _mix.default)(_colorConfig.default.genericGreen, "FFF")).toEqual("#" + colorConfig.genericGreenTint50);
75
- expect((0, _mix.default)("FFF", _colorConfig.default.genericGreen)).toEqual("#" + colorConfig.genericGreenTint50);
76
- });
77
- it("accepts colors with combinations of with and without hash symbols", () => {
78
- expect((0, _mix.default)("#" + _colorConfig.default.genericGreen, "FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
79
- expect((0, _mix.default)(_colorConfig.default.genericGreen, "#FFFFFF")).toEqual("#" + colorConfig.genericGreenTint50);
80
- });
81
- });
82
- });