carbon-react 104.42.0 → 104.44.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 (33) hide show
  1. package/esm/__internal__/tooltip-provider/index.js +1 -1
  2. package/esm/components/advanced-color-picker/advanced-color-picker.style.js +2 -2
  3. package/esm/components/grid/grid-container/grid-container.component.js +3 -4
  4. package/esm/components/grid/grid-container/grid-container.d.ts +2 -4
  5. package/esm/components/grid/grid-container/grid-container.style.js +2 -5
  6. package/esm/components/grid/grid-item/grid-item.component.d.ts +3 -0
  7. package/esm/components/grid/grid-item/grid-item.component.js +6 -0
  8. package/esm/components/grid/grid-item/grid-item.d.ts +14 -5
  9. package/esm/components/grid/grid-item/grid-item.style.js +21 -22
  10. package/esm/components/help/help.component.d.ts +1 -1
  11. package/esm/components/help/help.component.js +10 -10
  12. package/esm/components/icon/icon.component.js +3 -3
  13. package/esm/components/settings-row/settings-row.style.js +3 -9
  14. package/esm/components/simple-color-picker/simple-color-input/simple-color-input.style.js +1 -1
  15. package/esm/components/simple-color-picker/tick-icon/tick-icon.style.js +2 -2
  16. package/esm/components/tooltip/tooltip.component.js +1 -1
  17. package/lib/__internal__/tooltip-provider/index.js +1 -1
  18. package/lib/components/advanced-color-picker/advanced-color-picker.style.js +2 -2
  19. package/lib/components/grid/grid-container/grid-container.component.js +3 -5
  20. package/lib/components/grid/grid-container/grid-container.d.ts +2 -4
  21. package/lib/components/grid/grid-container/grid-container.style.js +2 -5
  22. package/lib/components/grid/grid-item/grid-item.component.d.ts +3 -0
  23. package/lib/components/grid/grid-item/grid-item.component.js +6 -0
  24. package/lib/components/grid/grid-item/grid-item.d.ts +14 -5
  25. package/lib/components/grid/grid-item/grid-item.style.js +21 -22
  26. package/lib/components/help/help.component.d.ts +1 -1
  27. package/lib/components/help/help.component.js +11 -10
  28. package/lib/components/icon/icon.component.js +3 -3
  29. package/lib/components/settings-row/settings-row.style.js +3 -9
  30. package/lib/components/simple-color-picker/simple-color-input/simple-color-input.style.js +1 -1
  31. package/lib/components/simple-color-picker/tick-icon/tick-icon.style.js +2 -2
  32. package/lib/components/tooltip/tooltip.component.js +1 -1
  33. package/package.json +1 -1
@@ -6,7 +6,7 @@ export const TooltipProvider = ({
6
6
  children,
7
7
  tooltipPosition,
8
8
  helpAriaLabel,
9
- focusable = true,
9
+ focusable,
10
10
  tooltipVisible,
11
11
  disabled,
12
12
  target
@@ -41,7 +41,7 @@ const StyledAdvancedColorPickerPreview = styled.div`
41
41
  `;
42
42
  const DialogStyle = styled(Dialog)`
43
43
  ${DialogContentStyle} {
44
- padding: 18px 18px 18px 17px;
44
+ padding: var(--spacing200);
45
45
  }
46
46
 
47
47
  ${DialogInnerContentStyle} {
@@ -72,7 +72,7 @@ const DialogStyle = styled(Dialog)`
72
72
  }
73
73
 
74
74
  [data-component="icon"] {
75
- color: var(--colorsActionMinorYin065);
75
+ color: var(--colorsActionMinor500);
76
76
  }
77
77
  `;
78
78
  export { StyledAdvancedColorPickerWrapper, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle };
@@ -1,8 +1,7 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  import React from "react";
4
- import PropTypes from "prop-types";
5
- import propTypes from "@styled-system/prop-types";
4
+ import styledSystemPropTypes from "@styled-system/prop-types";
6
5
  import GridContainerStyle from "./grid-container.style";
7
6
  import GridItem from "../grid-item";
8
7
 
@@ -32,7 +31,7 @@ GridContainer.propTypes = {
32
31
  });
33
32
  return error;
34
33
  },
35
- ...propTypes.space,
36
- gridGap: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
34
+ ...styledSystemPropTypes.space,
35
+ ...styledSystemPropTypes.grid
37
36
  };
38
37
  export default GridContainer;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { SpaceProps } from "styled-system";
2
+ import { SpaceProps, GridProps } from "styled-system";
3
3
  import { GridItemProps } from "../grid-item/grid-item";
4
4
 
5
5
  type GridContainerChild =
@@ -8,11 +8,9 @@ type GridContainerChild =
8
8
  | null
9
9
  | undefined;
10
10
 
11
- export interface GridContainerProps extends SpaceProps {
11
+ export interface GridContainerProps extends SpaceProps, GridProps {
12
12
  /** Defines the Components to be rendered within the GridContainer. Requires GridItemProps */
13
13
  children?: GridContainerChild | GridContainerChild[];
14
- /** Any valid CSS value to override default grid-gap */
15
- gridGap?: string;
16
14
  }
17
15
 
18
16
  declare function GridContainer(props: GridContainerProps): JSX.Element;
@@ -27,10 +27,7 @@ const GridContainerStyle = styled.div`
27
27
 
28
28
  @media screen {
29
29
  ${space}
30
- ${({
31
- gridGap
32
- }) => grid({
33
- gridGap
34
- })}
30
+ ${grid}
31
+ }
35
32
  `;
36
33
  export default GridContainerStyle;
@@ -5,6 +5,8 @@ declare namespace GridItem {
5
5
  const responsiveSettings: PropTypes.Requireable<(PropTypes.InferProps<{
6
6
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
7
7
  alignSelf: PropTypes.Requireable<string>;
8
+ /** Shorthand property for gridColumn and gridRow */
9
+ gridArea: PropTypes.Requireable<string | number>;
8
10
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
9
11
  gridColumn: PropTypes.Requireable<string | number>;
10
12
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
@@ -16,6 +18,7 @@ declare namespace GridItem {
16
18
  }> | null | undefined)[]>;
17
19
  const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
18
20
  const alignSelf: PropTypes.Requireable<string>;
21
+ const gridArea: PropTypes.Requireable<string | number>;
19
22
  const gridColumn: PropTypes.Requireable<string | number>;
20
23
  const gridRow: PropTypes.Requireable<string | number>;
21
24
  const justifySelf: PropTypes.Requireable<string>;
@@ -26,6 +26,9 @@ GridItem.propTypes = {
26
26
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
27
27
  alignSelf: PropTypes.string,
28
28
 
29
+ /** Shorthand property for gridColumn and gridRow */
30
+ gridArea: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
31
+
29
32
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
30
33
  gridColumn: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
31
34
 
@@ -39,6 +42,9 @@ GridItem.propTypes = {
39
42
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
40
43
  alignSelf: PropTypes.string,
41
44
 
45
+ /** Shorthand property for gridColumn and gridRow */
46
+ gridArea: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
47
+
42
48
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
43
49
  gridColumn: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
44
50
 
@@ -1,5 +1,10 @@
1
1
  import * as React from "react";
2
- import { PaddingProps } from "styled-system";
2
+ import {
3
+ PaddingProps,
4
+ GridAreaProps,
5
+ GridRowProps,
6
+ GridColumnProps,
7
+ } from "styled-system";
3
8
 
4
9
  interface ResponsiveSettingsShape extends PaddingProps {
5
10
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
@@ -8,10 +13,12 @@ interface ResponsiveSettingsShape extends PaddingProps {
8
13
  justifySelf?: string;
9
14
  /** Maximum width of the item */
10
15
  maxWidth?: string;
16
+ /** Shorthand property for gridColumn and gridRow */
17
+ gridArea?: GridAreaProps;
11
18
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
12
- gridColumn?: string | number;
19
+ gridColumn?: GridColumnProps;
13
20
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
14
- gridRow?: string | number;
21
+ gridRow?: GridRowProps;
15
22
  }
16
23
 
17
24
  export interface GridItemProps extends PaddingProps {
@@ -21,10 +28,12 @@ export interface GridItemProps extends PaddingProps {
21
28
  justifySelf?: string;
22
29
  /** Defines the Component(s) to be rendered within the GridItem */
23
30
  children?: React.ReactNode;
31
+ /** Shorthand property for gridColumn and gridRow */
32
+ gridArea?: GridAreaProps;
24
33
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
25
- gridColumn?: string | number;
34
+ gridColumn?: GridColumnProps;
26
35
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
27
- gridRow?: string | number;
36
+ gridRow?: GridRowProps;
28
37
  responsiveSettings?: ResponsiveSettingsShape[];
29
38
  }
30
39
 
@@ -9,6 +9,7 @@ function responsiveGridItem(responsiveSettings) {
9
9
  return responsiveSettings.map(setting => {
10
10
  const {
11
11
  alignSelf,
12
+ gridArea,
12
13
  gridColumn,
13
14
  gridRow,
14
15
  maxWidth,
@@ -23,6 +24,7 @@ function responsiveGridItem(responsiveSettings) {
23
24
  @media screen and (max-width: ${maxWidth}) {
24
25
  align-self: ${alignSelf || "stretch"};
25
26
  justify-self: ${justifySelf || "stretch"};
27
+ grid-area: ${gridArea};
26
28
  grid-column: ${gridColumn};
27
29
  grid-row: ${gridRow};
28
30
  padding: ${getSpacing(p)};
@@ -81,33 +83,30 @@ export function getSpacing(prop) {
81
83
  const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
82
84
  const GridItemStyle = styled.div`
83
85
  margin: 0;
86
+ ${padding}
84
87
 
85
88
  ${({
86
- justifySelf
87
- }) => flexbox({
89
+ alignSelf,
90
+ justifySelf,
91
+ gridArea,
92
+ gridColumn,
93
+ gridRow,
94
+ responsiveSettings
95
+ }) => css`
96
+ ${flexbox({
97
+ alignSelf,
88
98
  justifySelf
89
99
  })}
90
- ${({
91
- alignSelf
92
- }) => flexbox({
93
- alignSelf
94
- })}
95
- ${padding}
96
- ${({
100
+ ${grid({
101
+ gridArea,
102
+ gridColumn,
97
103
  gridRow
98
- }) => grid({
99
- gridRow
100
- })}
101
- ${({
102
- gridColumn
103
- }) => grid({
104
- gridColumn
105
- })}
106
- ${({
107
- responsiveSettings
108
- }) => responsiveSettings && css`
104
+ })};
105
+
106
+ ${responsiveSettings && css`
109
107
  ${responsiveGridItem(responsiveSettings)};
110
108
  `}
109
+ `}
111
110
  `;
112
111
  GridItemStyle.propTypes = {
113
112
  alignSelf: PropTypes.string,
@@ -117,6 +116,7 @@ GridItemStyle.propTypes = {
117
116
  ...paddingPropTypes,
118
117
  responsiveSettings: PropTypes.arrayOf(PropTypes.shape({
119
118
  alignSelf: PropTypes.string,
119
+ gridArea: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
120
120
  gridColumn: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
121
121
  gridRow: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
122
122
  justifySelf: PropTypes.string,
@@ -125,7 +125,6 @@ GridItemStyle.propTypes = {
125
125
  }))
126
126
  };
127
127
  GridItemStyle.defaultProps = {
128
- gridColumn: "1 / 13",
129
- gridRow: "auto"
128
+ gridArea: "auto / 1 / auto / 13"
130
129
  };
131
130
  export default GridItemStyle;
@@ -14,7 +14,7 @@ declare function Help({ className, href, helpId, children, tabIndex, as, tooltip
14
14
  tooltipBgColor: any;
15
15
  tooltipFontColor: any;
16
16
  tooltipFlipOverrides: any;
17
- ariaLabel: any;
17
+ ariaLabel?: string | undefined;
18
18
  }): JSX.Element;
19
19
  declare namespace Help {
20
20
  namespace propTypes {
@@ -10,6 +10,7 @@ import Events from "../../__internal__/utils/helpers/events";
10
10
  import { TooltipContext } from "../../__internal__/tooltip-provider";
11
11
  import { filterStyledSystemMarginProps } from "../../style/utils";
12
12
  import { HELP_POSITIONS } from "./help.config";
13
+ import guid from "../../__internal__/utils/helpers/guid";
13
14
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
14
15
 
15
16
  const Help = ({
@@ -26,9 +27,10 @@ const Help = ({
26
27
  tooltipBgColor,
27
28
  tooltipFontColor,
28
29
  tooltipFlipOverrides,
29
- ariaLabel,
30
+ ariaLabel = "help",
30
31
  ...rest
31
32
  }) => {
33
+ const defaultTooltipId = useRef(guid());
32
34
  const helpElement = useRef(null);
33
35
  const [isTooltipVisible, updateTooltipVisible] = useState(false);
34
36
  const {
@@ -56,6 +58,7 @@ const Help = ({
56
58
  }
57
59
 
58
60
  return /*#__PURE__*/React.createElement(StyledHelp, _extends({
61
+ "aria-describedby": isFocused || isTooltipVisible ? tooltipId || defaultTooltipId.current : undefined,
59
62
  className: className,
60
63
  as: tagType,
61
64
  href: href,
@@ -74,9 +77,10 @@ const Help = ({
74
77
  target: "_blank",
75
78
  rel: "noopener noreferrer"
76
79
  } : {
77
- role: "tooltip",
78
- "aria-label": ariaLabel || helpAriaLabel
79
- }, filterStyledSystemMarginProps(rest), rest), /*#__PURE__*/React.createElement(Icon, _extends({
80
+ role: "button",
81
+ "aria-label": helpAriaLabel || ariaLabel
82
+ }, filterStyledSystemMarginProps(rest), rest), /*#__PURE__*/React.createElement(Icon, {
83
+ "aria-hidden": true,
80
84
  type: type,
81
85
  tooltipMessage: children,
82
86
  tooltipPosition: tooltipPosition,
@@ -85,12 +89,8 @@ const Help = ({
85
89
  tooltipFontColor: tooltipFontColor,
86
90
  tooltipFlipOverrides: tooltipFlipOverrides,
87
91
  focusable: false,
88
- tooltipId: tooltipId,
89
- "aria-hidden": "true"
90
- }, href && {
91
- role: "tooltip",
92
- ariaLabel: ariaLabel || helpAriaLabel
93
- })));
92
+ tooltipId: tooltipId || defaultTooltipId.current
93
+ }));
94
94
  };
95
95
 
96
96
  Help.propTypes = { ...marginPropTypes,
@@ -11,6 +11,7 @@ import { ICON_TOOLTIP_POSITIONS } from "./icon-config";
11
11
  import { TooltipContext } from "../../__internal__/tooltip-provider";
12
12
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
13
13
  const Icon = /*#__PURE__*/React.forwardRef(({
14
+ "aria-hidden": ariaHidden,
14
15
  bg,
15
16
  bgShape,
16
17
  bgSize,
@@ -31,7 +32,6 @@ const Icon = /*#__PURE__*/React.forwardRef(({
31
32
  inputSize,
32
33
  role,
33
34
  ariaLabel,
34
- "aria-hidden": ariaHidden,
35
35
  focusable = true,
36
36
  ...rest
37
37
  }, ref) => {
@@ -84,6 +84,7 @@ const Icon = /*#__PURE__*/React.forwardRef(({
84
84
  ...filterStyledSystemMarginProps(rest)
85
85
  };
86
86
  const icon = /*#__PURE__*/React.createElement(StyledIcon, _extends({
87
+ "aria-hidden": ariaHidden,
87
88
  ref: ref,
88
89
  key: "icon",
89
90
  className: className || null,
@@ -91,8 +92,7 @@ const Icon = /*#__PURE__*/React.forwardRef(({
91
92
  }, tagComponent("icon", rest), styleProps, {
92
93
  hasTooltip: hasTooltip,
93
94
  "aria-label": ariaLabel,
94
- "aria-hidden": ariaHidden,
95
- role: hasTooltip && role === undefined ? "tooltip" : role
95
+ role: role
96
96
  }));
97
97
 
98
98
  if (tooltipMessage) {
@@ -6,9 +6,7 @@ export const StyledSettingsRow = styled.div`
6
6
  ${margin}
7
7
 
8
8
  clear: both;
9
- color: ${({
10
- theme
11
- }) => theme.palette.slateTint(20)};
9
+ color: var(--colorsUtilityYin055);
12
10
  display: flex;
13
11
  font-size: 14px;
14
12
  justify-content: space-between;
@@ -18,9 +16,7 @@ export const StyledSettingsRow = styled.div`
18
16
  ${({
19
17
  hasDivider
20
18
  }) => hasDivider && css`
21
- border-bottom: 1px solid ${({
22
- theme
23
- }) => theme.palette.slateTint(90)};
19
+ border-bottom: 1px solid var(--colorsUtilityMajor050);
24
20
  padding-bottom: 30px;
25
21
  `}
26
22
 
@@ -29,9 +25,7 @@ export const StyledSettingsRow = styled.div`
29
25
  }
30
26
 
31
27
  ${StyledHeadingTitle} {
32
- color: ${({
33
- theme
34
- }) => theme.palette.slate};
28
+ color: var(--colorsUtilityYin090);
35
29
  font-size: 15px;
36
30
  font-weight: bold;
37
31
  line-height: 18px;
@@ -18,7 +18,7 @@ const StyledSimpleColorInput = styled(SimpleColorInput)`
18
18
 
19
19
  &:focus + ${StyledColorSampleBox} {
20
20
  box-shadow: inset 0px 0px 0px var(--borderWidth200)
21
- var(--colorsActionMajorYang100);
21
+ var(--colorsUtilityYang100);
22
22
  border: 2px solid var(--colorsSemanticFocus500);
23
23
  }
24
24
  `;
@@ -10,8 +10,8 @@ const getIconColor = color => {
10
10
  greenMultiplier = 587,
11
11
  blueMultiplier = 114;
12
12
  const contrast = (Math.round(r * redMultiplier) + Math.round(g * greenMultiplier) + Math.round(b * blueMultiplier)) / 1000;
13
- if (contrast < 128) return "var(--colorsActionMajorYang100)";
14
- return "var(--colorsActionMajorYin090)";
13
+ if (contrast < 128) return "var(--colorsUtilityYang100)";
14
+ return "var(--colorsUtilityYin090)";
15
15
  };
16
16
 
17
17
  const StyledTickIcon = styled(Icon)`
@@ -51,7 +51,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
51
51
  "data-popper-arrow": "",
52
52
  "data-element": "tooltip-pointer",
53
53
  bgColor: bgColor
54
- })), /*#__PURE__*/React.createElement("div", null, content)));
54
+ })), content));
55
55
  };
56
56
 
57
57
  return /*#__PURE__*/React.createElement(Tippy, _extends({
@@ -25,7 +25,7 @@ const TooltipProvider = ({
25
25
  children,
26
26
  tooltipPosition,
27
27
  helpAriaLabel,
28
- focusable = true,
28
+ focusable,
29
29
  tooltipVisible,
30
30
  disabled,
31
31
  target
@@ -72,7 +72,7 @@ const StyledAdvancedColorPickerPreview = _styledComponents.default.div`
72
72
  exports.StyledAdvancedColorPickerPreview = StyledAdvancedColorPickerPreview;
73
73
  const DialogStyle = (0, _styledComponents.default)(_dialog2.default)`
74
74
  ${_dialog.DialogContentStyle} {
75
- padding: 18px 18px 18px 17px;
75
+ padding: var(--spacing200);
76
76
  }
77
77
 
78
78
  ${_dialog.DialogInnerContentStyle} {
@@ -103,7 +103,7 @@ const DialogStyle = (0, _styledComponents.default)(_dialog2.default)`
103
103
  }
104
104
 
105
105
  [data-component="icon"] {
106
- color: var(--colorsActionMinorYin065);
106
+ color: var(--colorsActionMinor500);
107
107
  }
108
108
  `;
109
109
  exports.DialogStyle = DialogStyle;
@@ -7,9 +7,7 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _propTypes2 = _interopRequireDefault(require("@styled-system/prop-types"));
10
+ var _propTypes = _interopRequireDefault(require("@styled-system/prop-types"));
13
11
 
14
12
  var _gridContainer = _interopRequireDefault(require("./grid-container.style"));
15
13
 
@@ -47,8 +45,8 @@ GridContainer.propTypes = {
47
45
 
48
46
  return error;
49
47
  },
50
- ..._propTypes2.default.space,
51
- gridGap: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
48
+ ..._propTypes.default.space,
49
+ ..._propTypes.default.grid
52
50
  };
53
51
  var _default = GridContainer;
54
52
  exports.default = _default;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { SpaceProps } from "styled-system";
2
+ import { SpaceProps, GridProps } from "styled-system";
3
3
  import { GridItemProps } from "../grid-item/grid-item";
4
4
 
5
5
  type GridContainerChild =
@@ -8,11 +8,9 @@ type GridContainerChild =
8
8
  | null
9
9
  | undefined;
10
10
 
11
- export interface GridContainerProps extends SpaceProps {
11
+ export interface GridContainerProps extends SpaceProps, GridProps {
12
12
  /** Defines the Components to be rendered within the GridContainer. Requires GridItemProps */
13
13
  children?: GridContainerChild | GridContainerChild[];
14
- /** Any valid CSS value to override default grid-gap */
15
- gridGap?: string;
16
14
  }
17
15
 
18
16
  declare function GridContainer(props: GridContainerProps): JSX.Element;
@@ -38,11 +38,8 @@ const GridContainerStyle = _styledComponents.default.div`
38
38
 
39
39
  @media screen {
40
40
  ${_styledSystem.space}
41
- ${({
42
- gridGap
43
- }) => (0, _styledSystem.grid)({
44
- gridGap
45
- })}
41
+ ${_styledSystem.grid}
42
+ }
46
43
  `;
47
44
  var _default = GridContainerStyle;
48
45
  exports.default = _default;
@@ -5,6 +5,8 @@ declare namespace GridItem {
5
5
  const responsiveSettings: PropTypes.Requireable<(PropTypes.InferProps<{
6
6
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
7
7
  alignSelf: PropTypes.Requireable<string>;
8
+ /** Shorthand property for gridColumn and gridRow */
9
+ gridArea: PropTypes.Requireable<string | number>;
8
10
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
9
11
  gridColumn: PropTypes.Requireable<string | number>;
10
12
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
@@ -16,6 +18,7 @@ declare namespace GridItem {
16
18
  }> | null | undefined)[]>;
17
19
  const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
18
20
  const alignSelf: PropTypes.Requireable<string>;
21
+ const gridArea: PropTypes.Requireable<string | number>;
19
22
  const gridColumn: PropTypes.Requireable<string | number>;
20
23
  const gridRow: PropTypes.Requireable<string | number>;
21
24
  const justifySelf: PropTypes.Requireable<string>;
@@ -38,6 +38,9 @@ GridItem.propTypes = {
38
38
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
39
39
  alignSelf: _propTypes.default.string,
40
40
 
41
+ /** Shorthand property for gridColumn and gridRow */
42
+ gridArea: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
43
+
41
44
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
42
45
  gridColumn: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
43
46
 
@@ -51,6 +54,9 @@ GridItem.propTypes = {
51
54
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
52
55
  alignSelf: _propTypes.default.string,
53
56
 
57
+ /** Shorthand property for gridColumn and gridRow */
58
+ gridArea: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
59
+
54
60
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
55
61
  gridColumn: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
56
62
 
@@ -1,5 +1,10 @@
1
1
  import * as React from "react";
2
- import { PaddingProps } from "styled-system";
2
+ import {
3
+ PaddingProps,
4
+ GridAreaProps,
5
+ GridRowProps,
6
+ GridColumnProps,
7
+ } from "styled-system";
3
8
 
4
9
  interface ResponsiveSettingsShape extends PaddingProps {
5
10
  /** How the grid item is aligned along the block (column) axis. Values: start, end, center, stretch */
@@ -8,10 +13,12 @@ interface ResponsiveSettingsShape extends PaddingProps {
8
13
  justifySelf?: string;
9
14
  /** Maximum width of the item */
10
15
  maxWidth?: string;
16
+ /** Shorthand property for gridColumn and gridRow */
17
+ gridArea?: GridAreaProps;
11
18
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
12
- gridColumn?: string | number;
19
+ gridColumn?: GridColumnProps;
13
20
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
14
- gridRow?: string | number;
21
+ gridRow?: GridRowProps;
15
22
  }
16
23
 
17
24
  export interface GridItemProps extends PaddingProps {
@@ -21,10 +28,12 @@ export interface GridItemProps extends PaddingProps {
21
28
  justifySelf?: string;
22
29
  /** Defines the Component(s) to be rendered within the GridItem */
23
30
  children?: React.ReactNode;
31
+ /** Shorthand property for gridColumn and gridRow */
32
+ gridArea?: GridAreaProps;
24
33
  /** Starting and ending column position of the GridItem within the GridContainer separated by "/" */
25
- gridColumn?: string | number;
34
+ gridColumn?: GridColumnProps;
26
35
  /** Starting and ending row position of the GridItem within the GridContainer separated by "/" */
27
- gridRow?: string | number;
36
+ gridRow?: GridRowProps;
28
37
  responsiveSettings?: ResponsiveSettingsShape[];
29
38
  }
30
39
 
@@ -28,6 +28,7 @@ function responsiveGridItem(responsiveSettings) {
28
28
  return responsiveSettings.map(setting => {
29
29
  const {
30
30
  alignSelf,
31
+ gridArea,
31
32
  gridColumn,
32
33
  gridRow,
33
34
  maxWidth,
@@ -42,6 +43,7 @@ function responsiveGridItem(responsiveSettings) {
42
43
  @media screen and (max-width: ${maxWidth}) {
43
44
  align-self: ${alignSelf || "stretch"};
44
45
  justify-self: ${justifySelf || "stretch"};
46
+ grid-area: ${gridArea};
45
47
  grid-column: ${gridColumn};
46
48
  grid-row: ${gridRow};
47
49
  padding: ${getSpacing(p)};
@@ -101,33 +103,30 @@ function getSpacing(prop) {
101
103
  const paddingPropTypes = (0, _utils.filterStyledSystemPaddingProps)(_propTypes.default.space);
102
104
  const GridItemStyle = _styledComponents.default.div`
103
105
  margin: 0;
106
+ ${_space.padding}
104
107
 
105
108
  ${({
106
- justifySelf
107
- }) => (0, _styledSystem.flexbox)({
109
+ alignSelf,
110
+ justifySelf,
111
+ gridArea,
112
+ gridColumn,
113
+ gridRow,
114
+ responsiveSettings
115
+ }) => (0, _styledComponents.css)`
116
+ ${(0, _styledSystem.flexbox)({
117
+ alignSelf,
108
118
  justifySelf
109
119
  })}
110
- ${({
111
- alignSelf
112
- }) => (0, _styledSystem.flexbox)({
113
- alignSelf
114
- })}
115
- ${_space.padding}
116
- ${({
120
+ ${(0, _styledSystem.grid)({
121
+ gridArea,
122
+ gridColumn,
117
123
  gridRow
118
- }) => (0, _styledSystem.grid)({
119
- gridRow
120
- })}
121
- ${({
122
- gridColumn
123
- }) => (0, _styledSystem.grid)({
124
- gridColumn
125
- })}
126
- ${({
127
- responsiveSettings
128
- }) => responsiveSettings && (0, _styledComponents.css)`
124
+ })};
125
+
126
+ ${responsiveSettings && (0, _styledComponents.css)`
129
127
  ${responsiveGridItem(responsiveSettings)};
130
128
  `}
129
+ `}
131
130
  `;
132
131
  GridItemStyle.propTypes = {
133
132
  alignSelf: _propTypes2.default.string,
@@ -137,6 +136,7 @@ GridItemStyle.propTypes = {
137
136
  ...paddingPropTypes,
138
137
  responsiveSettings: _propTypes2.default.arrayOf(_propTypes2.default.shape({
139
138
  alignSelf: _propTypes2.default.string,
139
+ gridArea: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
140
140
  gridColumn: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
141
141
  gridRow: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
142
142
  justifySelf: _propTypes2.default.string,
@@ -145,8 +145,7 @@ GridItemStyle.propTypes = {
145
145
  }))
146
146
  };
147
147
  GridItemStyle.defaultProps = {
148
- gridColumn: "1 / 13",
149
- gridRow: "auto"
148
+ gridArea: "auto / 1 / auto / 13"
150
149
  };
151
150
  var _default = GridItemStyle;
152
151
  exports.default = _default;
@@ -14,7 +14,7 @@ declare function Help({ className, href, helpId, children, tabIndex, as, tooltip
14
14
  tooltipBgColor: any;
15
15
  tooltipFontColor: any;
16
16
  tooltipFlipOverrides: any;
17
- ariaLabel: any;
17
+ ariaLabel?: string | undefined;
18
18
  }): JSX.Element;
19
19
  declare namespace Help {
20
20
  namespace propTypes {
@@ -25,6 +25,8 @@ var _utils = require("../../style/utils");
25
25
 
26
26
  var _help2 = require("./help.config");
27
27
 
28
+ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
30
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -49,9 +51,10 @@ const Help = ({
49
51
  tooltipBgColor,
50
52
  tooltipFontColor,
51
53
  tooltipFlipOverrides,
52
- ariaLabel,
54
+ ariaLabel = "help",
53
55
  ...rest
54
56
  }) => {
57
+ const defaultTooltipId = (0, _react.useRef)((0, _guid.default)());
55
58
  const helpElement = (0, _react.useRef)(null);
56
59
  const [isTooltipVisible, updateTooltipVisible] = (0, _react.useState)(false);
57
60
  const {
@@ -79,6 +82,7 @@ const Help = ({
79
82
  }
80
83
 
81
84
  return /*#__PURE__*/_react.default.createElement(_help.default, _extends({
85
+ "aria-describedby": isFocused || isTooltipVisible ? tooltipId || defaultTooltipId.current : undefined,
82
86
  className: className,
83
87
  as: tagType,
84
88
  href: href,
@@ -97,9 +101,10 @@ const Help = ({
97
101
  target: "_blank",
98
102
  rel: "noopener noreferrer"
99
103
  } : {
100
- role: "tooltip",
101
- "aria-label": ariaLabel || helpAriaLabel
102
- }, (0, _utils.filterStyledSystemMarginProps)(rest), rest), /*#__PURE__*/_react.default.createElement(_icon.default, _extends({
104
+ role: "button",
105
+ "aria-label": helpAriaLabel || ariaLabel
106
+ }, (0, _utils.filterStyledSystemMarginProps)(rest), rest), /*#__PURE__*/_react.default.createElement(_icon.default, {
107
+ "aria-hidden": true,
103
108
  type: type,
104
109
  tooltipMessage: children,
105
110
  tooltipPosition: tooltipPosition,
@@ -108,12 +113,8 @@ const Help = ({
108
113
  tooltipFontColor: tooltipFontColor,
109
114
  tooltipFlipOverrides: tooltipFlipOverrides,
110
115
  focusable: false,
111
- tooltipId: tooltipId,
112
- "aria-hidden": "true"
113
- }, href && {
114
- role: "tooltip",
115
- ariaLabel: ariaLabel || helpAriaLabel
116
- })));
116
+ tooltipId: tooltipId || defaultTooltipId.current
117
+ }));
117
118
  };
118
119
 
119
120
  Help.propTypes = { ...marginPropTypes,
@@ -34,6 +34,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
34
34
  const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
35
35
 
36
36
  const Icon = /*#__PURE__*/_react.default.forwardRef(({
37
+ "aria-hidden": ariaHidden,
37
38
  bg,
38
39
  bgShape,
39
40
  bgSize,
@@ -54,7 +55,6 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
54
55
  inputSize,
55
56
  role,
56
57
  ariaLabel,
57
- "aria-hidden": ariaHidden,
58
58
  focusable = true,
59
59
  ...rest
60
60
  }, ref) => {
@@ -108,6 +108,7 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
108
108
  };
109
109
 
110
110
  const icon = /*#__PURE__*/_react.default.createElement(_icon.default, _extends({
111
+ "aria-hidden": ariaHidden,
111
112
  ref: ref,
112
113
  key: "icon",
113
114
  className: className || null,
@@ -115,8 +116,7 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
115
116
  }, (0, _tags.default)("icon", rest), styleProps, {
116
117
  hasTooltip: hasTooltip,
117
118
  "aria-label": ariaLabel,
118
- "aria-hidden": ariaHidden,
119
- role: hasTooltip && role === undefined ? "tooltip" : role
119
+ role: role
120
120
  }));
121
121
 
122
122
  if (tooltipMessage) {
@@ -23,9 +23,7 @@ const StyledSettingsRow = _styledComponents.default.div`
23
23
  ${_styledSystem.margin}
24
24
 
25
25
  clear: both;
26
- color: ${({
27
- theme
28
- }) => theme.palette.slateTint(20)};
26
+ color: var(--colorsUtilityYin055);
29
27
  display: flex;
30
28
  font-size: 14px;
31
29
  justify-content: space-between;
@@ -35,9 +33,7 @@ const StyledSettingsRow = _styledComponents.default.div`
35
33
  ${({
36
34
  hasDivider
37
35
  }) => hasDivider && (0, _styledComponents.css)`
38
- border-bottom: 1px solid ${({
39
- theme
40
- }) => theme.palette.slateTint(90)};
36
+ border-bottom: 1px solid var(--colorsUtilityMajor050);
41
37
  padding-bottom: 30px;
42
38
  `}
43
39
 
@@ -46,9 +42,7 @@ const StyledSettingsRow = _styledComponents.default.div`
46
42
  }
47
43
 
48
44
  ${_heading.StyledHeadingTitle} {
49
- color: ${({
50
- theme
51
- }) => theme.palette.slate};
45
+ color: var(--colorsUtilityYin090);
52
46
  font-size: 15px;
53
47
  font-weight: bold;
54
48
  line-height: 18px;
@@ -30,7 +30,7 @@ const StyledSimpleColorInput = (0, _styledComponents.default)(_input.Input)`
30
30
 
31
31
  &:focus + ${_colorSampleBox.default} {
32
32
  box-shadow: inset 0px 0px 0px var(--borderWidth200)
33
- var(--colorsActionMajorYang100);
33
+ var(--colorsUtilityYang100);
34
34
  border: 2px solid var(--colorsSemanticFocus500);
35
35
  }
36
36
  `;
@@ -25,8 +25,8 @@ const getIconColor = color => {
25
25
  greenMultiplier = 587,
26
26
  blueMultiplier = 114;
27
27
  const contrast = (Math.round(r * redMultiplier) + Math.round(g * greenMultiplier) + Math.round(b * blueMultiplier)) / 1000;
28
- if (contrast < 128) return "var(--colorsActionMajorYang100)";
29
- return "var(--colorsActionMajorYin090)";
28
+ if (contrast < 128) return "var(--colorsUtilityYang100)";
29
+ return "var(--colorsUtilityYin090)";
30
30
  };
31
31
 
32
32
  const StyledTickIcon = (0, _styledComponents.default)(_icon.default)`
@@ -72,7 +72,7 @@ const Tooltip = /*#__PURE__*/_react.default.forwardRef(({
72
72
  "data-popper-arrow": "",
73
73
  "data-element": "tooltip-pointer",
74
74
  bgColor: bgColor
75
- })), /*#__PURE__*/_react.default.createElement("div", null, content)));
75
+ })), content));
76
76
  };
77
77
 
78
78
  return /*#__PURE__*/_react.default.createElement(_headless.default, _extends({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.42.0",
3
+ "version": "104.44.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {