carbon-react 106.4.0 → 106.5.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.
@@ -7,7 +7,7 @@ const StyledScrollableBlock = styled.div`
7
7
  variant
8
8
  }) => css`
9
9
  && ${StyledMenuItemWrapper} {
10
- background-color: ${variant === "default" ? menuConfigVariants[menuType].submenuItemBackground : menuConfigVariants[menuType].background};
10
+ background-color: ${variant === "default" ? menuConfigVariants[menuType].submenuItemBackground : menuConfigVariants[menuType].alternate};
11
11
  }
12
12
  `}
13
13
  `;
@@ -58,7 +58,8 @@ const PortraitInitials = ({
58
58
  return /*#__PURE__*/React.createElement(StyledPortraitInitials, _extends({
59
59
  "data-element": "initials",
60
60
  size: size,
61
- shape: shape
61
+ shape: shape,
62
+ initials: initials
62
63
  }, rest), /*#__PURE__*/React.createElement(StyledPortraitInitialsImg, {
63
64
  src: generateDataUrl(),
64
65
  alt: alt
@@ -7,7 +7,8 @@ import Icon from "../icon";
7
7
  import { PORTRAIT_SHAPES, PORTRAIT_SIZES, PORTRAIT_SIZE_PARAMS } from "./portrait.config";
8
8
 
9
9
  function stylingForSize({
10
- size
10
+ size,
11
+ initials
11
12
  }) {
12
13
  const params = PORTRAIT_SIZE_PARAMS[size];
13
14
 
@@ -15,6 +16,14 @@ function stylingForSize({
15
16
  return css``;
16
17
  }
17
18
 
19
+ if (initials) {
20
+ return css`
21
+ width: inherit;
22
+ height: inherit;
23
+ margin: 1px;
24
+ `;
25
+ }
26
+
18
27
  return css`
19
28
  width: ${params.dimensions}px;
20
29
  height: ${params.dimensions}px;
@@ -72,7 +81,16 @@ export const StyledPortraitInitials = styled.div`
72
81
  box-sizing: border-box;
73
82
  ${stylingForSize}
74
83
  ${stylingForShape}
75
- border: 1px solid var(--colorsUtilityMajor200);
84
+ outline: 1px solid var(--colorsUtilityMajor200);
85
+
86
+ /* Styling for safari. This ensures that there is no outline on the component but that a border is still present
87
+ to achieve the same styling as Chrome and Firefox */
88
+ @media not all and (min-resolution: 0.001dpcm) {
89
+ @supports (-webkit-appearance: none) and (stroke-color: transparent) {
90
+ border: 1px solid var(--colorsUtilityMajor200);
91
+ outline: none;
92
+ }
93
+ }
76
94
  `;
77
95
  StyledPortraitInitials.propTypes = {
78
96
  size: PropTypes.oneOf(PORTRAIT_SIZES).isRequired,
@@ -103,7 +103,7 @@ export default {
103
103
  inputWidth: 100,
104
104
  warnOverLimit: false,
105
105
  enforceCharacterLimit: true,
106
- label: "",
106
+ label: "Textarea",
107
107
  labelHelp: "",
108
108
  labelInline: false,
109
109
  labelWidth: 30,
@@ -1,5 +1,6 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import { margin } from "styled-system";
3
+ import InputPresentationStyle from "../../__internal__/input/input-presentation.style";
3
4
  import StyledInput from "../../__internal__/input/input.style";
4
5
  import { StyledLabelContainer } from "../../__internal__/label/label.style";
5
6
  import InputIconToggleStyle from "../../__internal__/input-icon-toggle/input-icon-toggle.style";
@@ -11,8 +12,10 @@ const StyledTextarea = styled.div`
11
12
  ${StyledInput} {
12
13
  resize: none;
13
14
  min-height: ${MIN_HEIGHT}px;
14
- margin-top: 5px;
15
- margin-bottom: 5px;
15
+ }
16
+
17
+ ${InputPresentationStyle} {
18
+ padding: var(--spacing150) var(--spacing200);
16
19
  }
17
20
 
18
21
  ${({
@@ -23,7 +23,7 @@ const StyledScrollableBlock = _styledComponents.default.div`
23
23
  variant
24
24
  }) => (0, _styledComponents.css)`
25
25
  && ${_menuItem.default} {
26
- background-color: ${variant === "default" ? _menu.default[menuType].submenuItemBackground : _menu.default[menuType].background};
26
+ background-color: ${variant === "default" ? _menu.default[menuType].submenuItemBackground : _menu.default[menuType].alternate};
27
27
  }
28
28
  `}
29
29
  `;
@@ -78,7 +78,8 @@ const PortraitInitials = ({
78
78
  return /*#__PURE__*/_react.default.createElement(_portrait.StyledPortraitInitials, _extends({
79
79
  "data-element": "initials",
80
80
  size: size,
81
- shape: shape
81
+ shape: shape,
82
+ initials: initials
82
83
  }, rest), /*#__PURE__*/_react.default.createElement(_portrait.StyledPortraitInitialsImg, {
83
84
  src: generateDataUrl(),
84
85
  alt: alt
@@ -27,7 +27,8 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
27
27
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
28
 
29
29
  function stylingForSize({
30
- size
30
+ size,
31
+ initials
31
32
  }) {
32
33
  const params = _portrait.PORTRAIT_SIZE_PARAMS[size];
33
34
 
@@ -35,6 +36,14 @@ function stylingForSize({
35
36
  return (0, _styledComponents.css)``;
36
37
  }
37
38
 
39
+ if (initials) {
40
+ return (0, _styledComponents.css)`
41
+ width: inherit;
42
+ height: inherit;
43
+ margin: 1px;
44
+ `;
45
+ }
46
+
38
47
  return (0, _styledComponents.css)`
39
48
  width: ${params.dimensions}px;
40
49
  height: ${params.dimensions}px;
@@ -93,7 +102,16 @@ const StyledPortraitInitials = _styledComponents.default.div`
93
102
  box-sizing: border-box;
94
103
  ${stylingForSize}
95
104
  ${stylingForShape}
96
- border: 1px solid var(--colorsUtilityMajor200);
105
+ outline: 1px solid var(--colorsUtilityMajor200);
106
+
107
+ /* Styling for safari. This ensures that there is no outline on the component but that a border is still present
108
+ to achieve the same styling as Chrome and Firefox */
109
+ @media not all and (min-resolution: 0.001dpcm) {
110
+ @supports (-webkit-appearance: none) and (stroke-color: transparent) {
111
+ border: 1px solid var(--colorsUtilityMajor200);
112
+ outline: none;
113
+ }
114
+ }
97
115
  `;
98
116
  exports.StyledPortraitInitials = StyledPortraitInitials;
99
117
  StyledPortraitInitials.propTypes = {
@@ -118,7 +118,7 @@ var _default = {
118
118
  inputWidth: 100,
119
119
  warnOverLimit: false,
120
120
  enforceCharacterLimit: true,
121
- label: "",
121
+ label: "Textarea",
122
122
  labelHelp: "",
123
123
  labelInline: false,
124
124
  labelWidth: 30,
@@ -9,6 +9,8 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _styledSystem = require("styled-system");
11
11
 
12
+ var _inputPresentation = _interopRequireDefault(require("../../__internal__/input/input-presentation.style"));
13
+
12
14
  var _input = _interopRequireDefault(require("../../__internal__/input/input.style"));
13
15
 
14
16
  var _label = require("../../__internal__/label/label.style");
@@ -31,8 +33,10 @@ const StyledTextarea = _styledComponents.default.div`
31
33
  ${_input.default} {
32
34
  resize: none;
33
35
  min-height: ${MIN_HEIGHT}px;
34
- margin-top: 5px;
35
- margin-bottom: 5px;
36
+ }
37
+
38
+ ${_inputPresentation.default} {
39
+ padding: var(--spacing150) var(--spacing200);
36
40
  }
37
41
 
38
42
  ${({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "106.4.0",
3
+ "version": "106.5.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {