carbon-react 102.5.0 → 102.7.1

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.
@@ -9,11 +9,9 @@ var _react = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _row = require("../row");
13
-
14
12
  var _label = _interopRequireDefault(require("../../__internal__/label"));
15
13
 
16
- var _inlineInputs = _interopRequireDefault(require("./inline-inputs.style"));
14
+ var _inlineInputs = _interopRequireWildcard(require("./inline-inputs.style"));
17
15
 
18
16
  var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
19
17
 
@@ -23,9 +21,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
23
21
 
24
22
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
23
 
26
- 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); }
27
-
28
- const columnWrapper = children => {
24
+ const columnWrapper = (children, gutter) => {
29
25
  let inputs = children;
30
26
 
31
27
  if (!Array.isArray(inputs)) {
@@ -36,8 +32,10 @@ const columnWrapper = children => {
36
32
  // Input is never going to be re-ordered so we don't require a defined key
37
33
 
38
34
  /* eslint-disable react/no-array-index-key */
39
- return /*#__PURE__*/_react.default.createElement(_row.Column, {
40
- key: index
35
+ return /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledInlineInput, {
36
+ key: index,
37
+ gutter: gutter,
38
+ "data-element": "inline-input"
41
39
  }, input);
42
40
  });
43
41
  };
@@ -53,14 +51,6 @@ const InlineInputs = props => {
53
51
  labelWidth
54
52
  } = props;
55
53
  const labelId = (0, _react.useRef)((0, _guid.default)());
56
- const widthProps = {
57
- inputWidth
58
- };
59
-
60
- if (labelWidth) {
61
- widthProps.labelWidth = labelWidth;
62
- widthProps.inputWidth = inputWidth || 100 - labelWidth;
63
- }
64
54
 
65
55
  function renderLabel() {
66
56
  if (!label) return null;
@@ -78,13 +68,16 @@ const InlineInputs = props => {
78
68
  }));
79
69
  }
80
70
 
81
- return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, _extends({
71
+ return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, {
82
72
  gutter: gutter,
83
73
  "data-component": "inline-inputs",
84
- className: className
85
- }, widthProps), renderLabel(), /*#__PURE__*/_react.default.createElement(_row.Row, {
86
- gutter: gutter
87
- }, columnWrapper(renderChildren())));
74
+ className: className,
75
+ labelWidth: labelWidth
76
+ }, renderLabel(), /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledContentContainer, {
77
+ gutter: gutter,
78
+ "data-element": "inline-inputs-container",
79
+ inputWidth: inputWidth
80
+ }, columnWrapper(renderChildren(), gutter)));
88
81
  }; // Assign props over for demo site
89
82
 
90
83
 
@@ -3,14 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.StyledInlineInput = exports.StyledContentContainer = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
- var _row = _interopRequireDefault(require("../row/row.style"));
11
-
12
- var _column = _interopRequireDefault(require("../row/column/column.style"));
13
-
14
10
  var _inputPresentation = _interopRequireDefault(require("../../__internal__/input/input-presentation.style"));
15
11
 
16
12
  var _label = require("../../__internal__/label/label.style");
@@ -33,20 +29,46 @@ const spacings = {
33
29
  large: 32,
34
30
  "extra-large": 40
35
31
  };
36
- const StyledInlineInputs = _styledComponents.default.div`
37
- display: flex;
38
- align-items: center;
32
+ const StyledInlineInput = _styledComponents.default.div`
33
+ flex: 1;
39
34
 
40
35
  ${({
36
+ gutter
37
+ }) => (0, _styledComponents.css)`
38
+ margin-bottom: 0;
39
+ padding-left: ${spacings[gutter]}px;
40
+ `}
41
+ `;
42
+ exports.StyledInlineInput = StyledInlineInput;
43
+ const StyledContentContainer = _styledComponents.default.div`
44
+ display: flex;
45
+ flex: ${({
41
46
  inputWidth
42
- }) => inputWidth && `
43
- flex: 0 0 ${inputWidth}%;
44
- `}
47
+ }) => inputWidth ? `0 0 ${inputWidth}%` : 1};
48
+
49
+ ${({
50
+ gutter
51
+ }) => (0, _styledComponents.css)`
52
+ margin-bottom: 0;
53
+ margin-left: -${spacings[gutter]}px;
54
+
55
+ ${gutter === "none" && (0, _styledComponents.css)`
56
+ ${StyledInlineInput} + ${StyledInlineInput} ${_inputPresentation.default} {
57
+ border-left: none;
58
+ }
59
+ `}
60
+ `}
61
+ `;
62
+ exports.StyledContentContainer = StyledContentContainer;
63
+ const StyledInlineInputs = _styledComponents.default.div`
64
+ display: flex;
65
+ align-items: center;
45
66
 
46
67
  ${_label.StyledLabelContainer} {
68
+ width: auto;
47
69
  margin-bottom: 0;
48
70
  padding-right: 16px;
49
- width: ${({
71
+ flex: 0 0 ${({
50
72
  labelWidth
51
73
  }) => labelWidth ? `${labelWidth}%` : "auto"};
52
74
  }
@@ -58,30 +80,6 @@ const StyledInlineInputs = _styledComponents.default.div`
58
80
  [data-component="carbon-select"] input {
59
81
  width: 30px;
60
82
  }
61
-
62
- ${_row.default} {
63
- flex-grow: 1;
64
- }
65
-
66
- ${({
67
- gutter
68
- }) => (0, _styledComponents.css)`
69
- ${_row.default} {
70
- margin-bottom: 0;
71
- margin-left: -${spacings[gutter]}px;
72
-
73
- > ${_column.default} {
74
- margin-bottom: 0;
75
- padding-left: ${spacings[gutter]}px;
76
- }
77
- }
78
-
79
- ${gutter === "none" && (0, _styledComponents.css)`
80
- ${_column.default} + ${_column.default} ${_inputPresentation.default} {
81
- border-left: none;
82
- }
83
- `}
84
- `}
85
83
  `;
86
84
  StyledInlineInputs.defaultProps = {
87
85
  theme: _base.default
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _base = _interopRequireDefault(require("../../style/themes/base"));
13
-
14
12
  var _loader = require("./loader.config");
15
13
 
16
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -59,18 +57,17 @@ const getDimentions = size => {
59
57
 
60
58
  const StyledLoaderSquare = _styledComponents.default.div`
61
59
  ${({
62
- theme,
63
60
  size,
64
61
  isInsideButton,
65
62
  isActive
66
63
  }) => (0, _styledComponents.css)`
67
64
  animation: ${loaderAnimation} 1s infinite ease-in-out both;
68
- background-color: ${theme.colors.primary};
65
+ background-color: var(--colorsActionMajor500);
69
66
  display: inline-block;
70
67
  ${getDimentions(size)}
71
68
 
72
69
  ${isInsideButton && (0, _styledComponents.css)`
73
- background-color: ${isActive ? theme.colors.white : theme.colors.border};
70
+ background-color: ${isActive ? "var(--colorsYang100)" : "var(--colorsSemanticNeutral500)"};
74
71
  `}
75
72
 
76
73
  &:nth-of-type(1) {
@@ -88,7 +85,6 @@ const StyledLoaderSquare = _styledComponents.default.div`
88
85
  `}
89
86
  `;
90
87
  StyledLoaderSquare.defaultProps = {
91
- theme: _base.default,
92
88
  size: "small",
93
89
  isInsideButton: false,
94
90
  isActive: true
@@ -40,24 +40,22 @@ const innerBarAnimation = (0, _styledComponents.keyframes)`
40
40
  `;
41
41
  const StyledLoaderBar = _styledComponents.default.div`
42
42
  ${({
43
- size,
44
- theme
43
+ size
45
44
  }) => (0, _styledComponents.css)`
46
45
  display: inline-block;
47
46
  height: ${getHeight(size)};
48
47
  width: 100%;
49
- background-color: ${theme.colors.loadingBarBackground};
48
+ background-color: var(--colorsActionMajor150);
50
49
  overflow: hidden;
51
50
  position: relative;
52
51
  `}
53
52
  `;
54
53
  const InnerBar = _styledComponents.default.div`
55
54
  ${({
56
- theme,
57
55
  size
58
56
  }) => (0, _styledComponents.css)`
59
57
  position: absolute;
60
- background-color: ${theme.colors.primary};
58
+ background-color: var(--colorsActionMajor500);
61
59
  width: ${INNER_BAR_LENGTH};
62
60
  height: ${getHeight(size)};
63
61
  animation: 2s ${innerBarAnimation} linear 0s infinite normal none running;
@@ -82,11 +80,9 @@ StyledLoader.defaultProps = {
82
80
  theme: _base.default
83
81
  };
84
82
  StyledLoaderBar.defaultProps = {
85
- theme: _base.default,
86
83
  size: "medium"
87
84
  };
88
85
  InnerBar.defaultProps = {
89
- theme: _base.default,
90
86
  size: "medium"
91
87
  };
92
88
  StyledLoaderBar.propTypes = {
@@ -17,7 +17,7 @@ const StyledPage = _styledComponents.default.article`
17
17
  `;
18
18
  exports.StyledPage = StyledPage;
19
19
  const StyledPageContent = _styledComponents.default.div`
20
- box-sizing: content-box;
20
+ box-sizing: border-box;
21
21
  padding: 30px 40px;
22
22
  width: 100%;
23
23
  height: 100%;
@@ -194,6 +194,7 @@ const Textarea = ({
194
194
  "aria-describedby": ariaDescribedBy,
195
195
  autoFocus: autoFocus,
196
196
  name: name,
197
+ value: value,
197
198
  ref: inputRef,
198
199
  maxLength: enforceCharacterLimit && characterLimit ? characterLimit : undefined,
199
200
  onChange: onChange,
@@ -31,7 +31,8 @@ var _default = palette => {
31
31
  get compatibility() {
32
32
  return {
33
33
  colorsActionMajor500: this.colors.primary,
34
- colorsActionMajor600: this.colors.secondary
34
+ colorsActionMajor600: this.colors.secondary,
35
+ colorsActionMajor150: this.colors.loadingBarBackground
35
36
  };
36
37
  }
37
38
 
@@ -343,6 +343,7 @@ var _default = palette => {
343
343
 
344
344
  get compatibility() {
345
345
  return { ..._common.default,
346
+ colorsActionMajor150: this.colors.loadingBarBackground,
346
347
  colorsActionMajor500: this.colors.primary,
347
348
  colorsActionMajor600: this.colors.secondary,
348
349
  colorsActionDisabled500: this.disabled.background,
@@ -25,7 +25,8 @@ var _default = palette => {
25
25
  get compatibility() {
26
26
  return {
27
27
  colorsActionMajor500: this.colors.primary,
28
- colorsActionMajor600: this.colors.secondary
28
+ colorsActionMajor600: this.colors.secondary,
29
+ colorsActionMajor150: this.colors.loadingBarBackground
29
30
  };
30
31
  }
31
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "102.5.0",
3
+ "version": "102.7.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {