carbon-react 104.40.0 → 104.43.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 (23) hide show
  1. package/esm/components/grid/grid-container/grid-container.component.js +3 -4
  2. package/esm/components/grid/grid-container/grid-container.d.ts +2 -4
  3. package/esm/components/grid/grid-container/grid-container.style.js +2 -5
  4. package/esm/components/grid/grid-item/grid-item.component.d.ts +3 -0
  5. package/esm/components/grid/grid-item/grid-item.component.js +6 -0
  6. package/esm/components/grid/grid-item/grid-item.d.ts +14 -5
  7. package/esm/components/grid/grid-item/grid-item.style.js +21 -22
  8. package/esm/components/help/help.style.js +8 -11
  9. package/esm/components/link-preview/__internal__/placeholder.component.js +6 -22
  10. package/esm/components/link-preview/link-preview.style.js +6 -16
  11. package/esm/components/preview/preview.style.js +1 -6
  12. package/lib/components/grid/grid-container/grid-container.component.js +3 -5
  13. package/lib/components/grid/grid-container/grid-container.d.ts +2 -4
  14. package/lib/components/grid/grid-container/grid-container.style.js +2 -5
  15. package/lib/components/grid/grid-item/grid-item.component.d.ts +3 -0
  16. package/lib/components/grid/grid-item/grid-item.component.js +6 -0
  17. package/lib/components/grid/grid-item/grid-item.d.ts +14 -5
  18. package/lib/components/grid/grid-item/grid-item.style.js +21 -22
  19. package/lib/components/help/help.style.js +8 -11
  20. package/lib/components/link-preview/__internal__/placeholder.component.js +6 -24
  21. package/lib/components/link-preview/link-preview.style.js +7 -18
  22. package/lib/components/preview/preview.style.js +1 -6
  23. package/package.json +1 -1
@@ -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;
@@ -4,9 +4,6 @@ import baseTheme from "../../style/themes/base";
4
4
  import StyledIcon from "../icon/icon.style";
5
5
  const StyledHelp = styled.div`
6
6
  background: none;
7
- color: ${({
8
- theme
9
- }) => theme.help.color};
10
7
  cursor: default;
11
8
  border: none;
12
9
  outline: none;
@@ -18,24 +15,24 @@ const StyledHelp = styled.div`
18
15
  margin-top: 0;
19
16
  text-decoration: none;
20
17
 
18
+ ${StyledIcon} {
19
+ color: var(--colorsUtilityYin065);
20
+ }
21
+
21
22
  ${({
22
23
  href
23
24
  }) => href && css`
24
25
  cursor: pointer;
25
26
  `}
26
27
 
27
- &:focus,
28
- &:hover {
29
- color: ${({
30
- theme
31
- }) => theme.help.hover};
28
+ &:focus ${StyledIcon},
29
+ &:hover ${StyledIcon} {
30
+ color: var(--colorsUtilityYin090);
32
31
  text-decoration: none;
33
32
  }
34
33
 
35
34
  &:focus ${StyledIcon} {
36
- outline: ${({
37
- theme
38
- }) => `2px solid ${theme.colors.focus}`};
35
+ outline: 2px solid var(--colorsSemanticFocus500);
39
36
  }
40
37
 
41
38
  ${margin}
@@ -1,23 +1,17 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components";
3
- import { toColor } from "../../../style/utils/color";
4
- import { baseTheme } from "../../../style/themes";
5
3
  const StyledPlaceHolder = styled.div`
6
4
  overflow: hidden;
7
5
  position: relative;
8
6
  height: 152px;
9
7
  min-width: 152px;
10
- background-color: ${({
11
- theme
12
- }) => theme.editorLinkPreview.background};
8
+ background-color: var(--colorsUtilityMajor025);
13
9
  `;
14
10
  const Circle = styled.div`
15
11
  height: 22px;
16
12
  width: 22px;
17
13
  border-radius: 50%;
18
- background-color: ${({
19
- theme
20
- }) => theme.editorLinkPreview.hoverBackground};
14
+ background-color: var(--colorsUtilityMajor100);
21
15
  position: absolute;
22
16
  left: 22px;
23
17
  top: 30px;
@@ -27,9 +21,8 @@ const Square = styled.div`
27
21
  width: 200px;
28
22
  transform: rotate(45deg);
29
23
  background-color: ${({
30
- color,
31
- theme
32
- }) => toColor(theme, color)};
24
+ color
25
+ }) => color};
33
26
  position: absolute;
34
27
  border-radius: 2%;
35
28
  top: ${({
@@ -39,24 +32,15 @@ const Square = styled.div`
39
32
  left
40
33
  }) => left};
41
34
  `;
42
- StyledPlaceHolder.defaultProps = {
43
- theme: baseTheme
44
- };
45
- Circle.defaultProps = {
46
- theme: baseTheme
47
- };
48
- Square.defaultProps = {
49
- theme: baseTheme
50
- };
51
35
 
52
36
  const Placeholder = () => /*#__PURE__*/React.createElement(StyledPlaceHolder, {
53
37
  "data-component": "link preview image placeholder"
54
38
  }, /*#__PURE__*/React.createElement(Circle, null), /*#__PURE__*/React.createElement(Square, {
55
- color: "slateTint90",
39
+ color: "var(--colorsUtilityMajor050)",
56
40
  top: "120px",
57
41
  left: "-64px"
58
42
  }), /*#__PURE__*/React.createElement(Square, {
59
- color: "slateTint75",
43
+ color: "var(--colorsUtilityMajor150)",
60
44
  top: "96px",
61
45
  left: "16px"
62
46
  }));
@@ -1,5 +1,4 @@
1
1
  import styled, { css } from "styled-components";
2
- import { baseTheme } from "../../style/themes";
3
2
  import PreviewBars, { StyledPreview } from "../preview/preview.style";
4
3
  const StyledLinkPreview = styled.a`
5
4
  display: flex;
@@ -8,22 +7,21 @@ const StyledLinkPreview = styled.a`
8
7
  outline: none;
9
8
 
10
9
  ${({
11
- theme,
12
10
  as
13
11
  }) => css`
14
- border: 1px solid ${theme.editorLinkPreview.border};
15
- background-color: ${theme.editorLinkPreview.background};
16
- color: ${theme.text.color};
12
+ border: 1px solid var(--colorsUtilityMajor050);
13
+ background-color: var(--colorsUtilityMajor025);
14
+ color: var(--colorsUtilityYin090);
17
15
 
18
16
  ${as !== "div" && css`
19
17
  :focus {
20
- outline: 2px solid ${theme.colors.focus};
18
+ outline: 2px solid var(--colorsSemanticFocus500);
21
19
  outline-offset: -1px;
22
20
  }
23
21
 
24
22
  :hover {
25
23
  cursor: pointer;
26
- background-color: ${theme.editorLinkPreview.hoverBackground};
24
+ background-color: var(--colorsUtilityMajor100);
27
25
  }
28
26
  `}
29
27
  `}
@@ -81,14 +79,6 @@ const StyledUrl = styled.div`
81
79
  font-weight: 400;
82
80
  font-size: 14px;
83
81
  line-height: 21px;
84
- color: ${({
85
- theme
86
- }) => theme.editorLinkPreview.url};
82
+ color: var(--colorsUtilityMajor400);
87
83
  `;
88
- StyledLinkPreview.defaultProps = {
89
- theme: baseTheme
90
- };
91
- StyledUrl.defaultProps = {
92
- theme: baseTheme
93
- };
94
84
  export { StyledLinkPreview, StyledCloseIconWrapper, StyledPreviewWrapper, StyledTitle, StyledDescription, StyledUrl };
@@ -8,9 +8,7 @@ const shimmer = keyframes`
8
8
  `;
9
9
  const PreviewStyle = styled.span`
10
10
  animation: ${shimmer} 2s ease infinite;
11
- background: ${({
12
- theme
13
- }) => theme.colors.previewBackground};
11
+ background: var(--colorsUtilityMajor150);
14
12
  display: block;
15
13
  height: 15px;
16
14
  opacity: 0.6;
@@ -26,7 +24,4 @@ export const StyledPreview = styled.div`
26
24
  StyledPreview.defaultProps = {
27
25
  theme: baseTheme
28
26
  };
29
- PreviewStyle.defaultProps = {
30
- theme: baseTheme
31
- };
32
27
  export default PreviewStyle;
@@ -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;
@@ -21,9 +21,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
21
21
 
22
22
  const StyledHelp = _styledComponents.default.div`
23
23
  background: none;
24
- color: ${({
25
- theme
26
- }) => theme.help.color};
27
24
  cursor: default;
28
25
  border: none;
29
26
  outline: none;
@@ -35,24 +32,24 @@ const StyledHelp = _styledComponents.default.div`
35
32
  margin-top: 0;
36
33
  text-decoration: none;
37
34
 
35
+ ${_icon.default} {
36
+ color: var(--colorsUtilityYin065);
37
+ }
38
+
38
39
  ${({
39
40
  href
40
41
  }) => href && (0, _styledComponents.css)`
41
42
  cursor: pointer;
42
43
  `}
43
44
 
44
- &:focus,
45
- &:hover {
46
- color: ${({
47
- theme
48
- }) => theme.help.hover};
45
+ &:focus ${_icon.default},
46
+ &:hover ${_icon.default} {
47
+ color: var(--colorsUtilityYin090);
49
48
  text-decoration: none;
50
49
  }
51
50
 
52
51
  &:focus ${_icon.default} {
53
- outline: ${({
54
- theme
55
- }) => `2px solid ${theme.colors.focus}`};
52
+ outline: 2px solid var(--colorsSemanticFocus500);
56
53
  }
57
54
 
58
55
  ${_styledSystem.margin}
@@ -9,10 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _styledComponents = _interopRequireDefault(require("styled-components"));
11
11
 
12
- var _color = require("../../../style/utils/color");
13
-
14
- var _themes = require("../../../style/themes");
15
-
16
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
13
 
18
14
  const StyledPlaceHolder = _styledComponents.default.div`
@@ -20,17 +16,13 @@ const StyledPlaceHolder = _styledComponents.default.div`
20
16
  position: relative;
21
17
  height: 152px;
22
18
  min-width: 152px;
23
- background-color: ${({
24
- theme
25
- }) => theme.editorLinkPreview.background};
19
+ background-color: var(--colorsUtilityMajor025);
26
20
  `;
27
21
  const Circle = _styledComponents.default.div`
28
22
  height: 22px;
29
23
  width: 22px;
30
24
  border-radius: 50%;
31
- background-color: ${({
32
- theme
33
- }) => theme.editorLinkPreview.hoverBackground};
25
+ background-color: var(--colorsUtilityMajor100);
34
26
  position: absolute;
35
27
  left: 22px;
36
28
  top: 30px;
@@ -40,9 +32,8 @@ const Square = _styledComponents.default.div`
40
32
  width: 200px;
41
33
  transform: rotate(45deg);
42
34
  background-color: ${({
43
- color,
44
- theme
45
- }) => (0, _color.toColor)(theme, color)};
35
+ color
36
+ }) => color};
46
37
  position: absolute;
47
38
  border-radius: 2%;
48
39
  top: ${({
@@ -52,24 +43,15 @@ const Square = _styledComponents.default.div`
52
43
  left
53
44
  }) => left};
54
45
  `;
55
- StyledPlaceHolder.defaultProps = {
56
- theme: _themes.baseTheme
57
- };
58
- Circle.defaultProps = {
59
- theme: _themes.baseTheme
60
- };
61
- Square.defaultProps = {
62
- theme: _themes.baseTheme
63
- };
64
46
 
65
47
  const Placeholder = () => /*#__PURE__*/_react.default.createElement(StyledPlaceHolder, {
66
48
  "data-component": "link preview image placeholder"
67
49
  }, /*#__PURE__*/_react.default.createElement(Circle, null), /*#__PURE__*/_react.default.createElement(Square, {
68
- color: "slateTint90",
50
+ color: "var(--colorsUtilityMajor050)",
69
51
  top: "120px",
70
52
  left: "-64px"
71
53
  }), /*#__PURE__*/_react.default.createElement(Square, {
72
- color: "slateTint75",
54
+ color: "var(--colorsUtilityMajor150)",
73
55
  top: "96px",
74
56
  left: "16px"
75
57
  }));
@@ -7,8 +7,6 @@ exports.StyledUrl = exports.StyledDescription = exports.StyledTitle = exports.St
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
- var _themes = require("../../style/themes");
11
-
12
10
  var _preview = _interopRequireWildcard(require("../preview/preview.style"));
13
11
 
14
12
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -22,22 +20,21 @@ const StyledLinkPreview = _styledComponents.default.a`
22
20
  outline: none;
23
21
 
24
22
  ${({
25
- theme,
26
23
  as
27
24
  }) => (0, _styledComponents.css)`
28
- border: 1px solid ${theme.editorLinkPreview.border};
29
- background-color: ${theme.editorLinkPreview.background};
30
- color: ${theme.text.color};
25
+ border: 1px solid var(--colorsUtilityMajor050);
26
+ background-color: var(--colorsUtilityMajor025);
27
+ color: var(--colorsUtilityYin090);
31
28
 
32
29
  ${as !== "div" && (0, _styledComponents.css)`
33
30
  :focus {
34
- outline: 2px solid ${theme.colors.focus};
31
+ outline: 2px solid var(--colorsSemanticFocus500);
35
32
  outline-offset: -1px;
36
33
  }
37
34
 
38
35
  :hover {
39
36
  cursor: pointer;
40
- background-color: ${theme.editorLinkPreview.hoverBackground};
37
+ background-color: var(--colorsUtilityMajor100);
41
38
  }
42
39
  `}
43
40
  `}
@@ -100,14 +97,6 @@ const StyledUrl = _styledComponents.default.div`
100
97
  font-weight: 400;
101
98
  font-size: 14px;
102
99
  line-height: 21px;
103
- color: ${({
104
- theme
105
- }) => theme.editorLinkPreview.url};
100
+ color: var(--colorsUtilityMajor400);
106
101
  `;
107
- exports.StyledUrl = StyledUrl;
108
- StyledLinkPreview.defaultProps = {
109
- theme: _themes.baseTheme
110
- };
111
- StyledUrl.defaultProps = {
112
- theme: _themes.baseTheme
113
- };
102
+ exports.StyledUrl = StyledUrl;
@@ -24,9 +24,7 @@ const shimmer = (0, _styledComponents.keyframes)`
24
24
  `;
25
25
  const PreviewStyle = _styledComponents.default.span`
26
26
  animation: ${shimmer} 2s ease infinite;
27
- background: ${({
28
- theme
29
- }) => theme.colors.previewBackground};
27
+ background: var(--colorsUtilityMajor150);
30
28
  display: block;
31
29
  height: 15px;
32
30
  opacity: 0.6;
@@ -43,8 +41,5 @@ exports.StyledPreview = StyledPreview;
43
41
  StyledPreview.defaultProps = {
44
42
  theme: _base.default
45
43
  };
46
- PreviewStyle.defaultProps = {
47
- theme: _base.default
48
- };
49
44
  var _default = PreviewStyle;
50
45
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.40.0",
3
+ "version": "104.43.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {