carbon-react 102.7.3 → 102.9.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.
@@ -47,8 +47,7 @@ const CheckboxStyle = _styledComponents.default.div`
47
47
  inputWidth,
48
48
  reverse,
49
49
  size,
50
- adaptiveSpacingSmallScreen,
51
- theme
50
+ adaptiveSpacingSmallScreen
52
51
  }) => (0, _styledComponents.css)`
53
52
  ${adaptiveSpacingSmallScreen && "margin-left: 0;"}
54
53
 
@@ -61,13 +60,13 @@ const CheckboxStyle = _styledComponents.default.div`
61
60
  }
62
61
 
63
62
  svg {
64
- background-color: ${theme.colors.white};
63
+ background-color: var(--colorsUtilityYang100);
65
64
  ${!disabled && (0, _styledComponents.css)`
66
- border: 1px solid ${theme.colors.border};
65
+ border: 1px solid var(--colorsUtilityMajor300);
67
66
 
68
- ${info && `border: 1px solid ${theme.colors.info};`}
69
- ${warning && `border: 1px solid ${theme.colors.warning};`}
70
- ${error && `border: 2px solid ${theme.colors.error};`}
67
+ ${info && `border: 1px solid var(--colorsSemanticInfo500);`}
68
+ ${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
69
+ ${error && `border: 2px solid var(--colorsSemanticNegative500);`}
71
70
  `}
72
71
  }
73
72
 
@@ -91,7 +90,7 @@ const CheckboxStyle = _styledComponents.default.div`
91
90
  ${_hiddenCheckableInput.default}:not([disabled]) {
92
91
  &:focus + ${_checkableInputSvgWrapper.default},
93
92
  &:hover + ${_checkableInputSvgWrapper.default} {
94
- box-shadow: 0 0 0 3px ${theme.colors.focus};
93
+ box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
95
94
  }
96
95
  }
97
96
 
@@ -103,7 +102,7 @@ const CheckboxStyle = _styledComponents.default.div`
103
102
  ${_fieldHelp.default} {
104
103
  margin-left: 16px;
105
104
  margin-top: 0;
106
- padding-left: ${labelSpacing * theme.spacing}px;
105
+ padding-left: ${labelSpacing === 1 ? "var(--spacing100)" : "var(--spacing200)"};
107
106
  }
108
107
 
109
108
  ${_validationIcon.default} {
@@ -126,7 +125,7 @@ const CheckboxStyle = _styledComponents.default.div`
126
125
 
127
126
  ${_fieldHelp.default} {
128
127
  margin-left: 24px;
129
- padding-left: ${labelSpacing * theme.spacing}px;
128
+ padding-left: ${labelSpacing === 1 ? "var(--spacing100)" : "var(--spacing200)"};
130
129
  }
131
130
 
132
131
  ${fieldHelpInline && (0, _styledComponents.css)`
@@ -137,21 +136,21 @@ const CheckboxStyle = _styledComponents.default.div`
137
136
  `}
138
137
 
139
138
  ${_hiddenCheckableInput.default}:checked ~ ${_checkableInputSvgWrapper.default} svg path {
140
- fill: ${theme.checkable.checked};
139
+ fill: var(--colorsUtilityYin090);
141
140
  }
142
141
 
143
142
  ${disabled && (0, _styledComponents.css)`
144
143
  svg {
145
- background-color: ${theme.disabled.input};
146
- border: 1px solid ${theme.disabled.border};
144
+ background-color: var(--colorsUtilityDisabled400);
145
+ border: 1px solid var(--colorsUtilityDisabled600);
147
146
  }
148
147
 
149
148
  svg path {
150
- fill: ${theme.disabled.input};
149
+ fill: var(--colorsUtilityDisabled400);
151
150
  }
152
151
 
153
152
  ${_hiddenCheckableInput.default}:checked ~ ${_checkableInputSvgWrapper.default} svg path {
154
- fill: ${theme.disabled.border};
153
+ fill: var(--colorsUtilityYin030);
155
154
  }
156
155
 
157
156
  ${_checkableInputSvgWrapper.default} {
@@ -211,7 +210,10 @@ CheckboxStyle.propTypes = {
211
210
  info: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
212
211
  fieldHelpInline: _propTypes.default.bool,
213
212
  inputWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
214
- size: _propTypes.default.string
213
+ size: _propTypes.default.string,
214
+ labelSpacing: _propTypes.default.oneOf([1, 2]),
215
+ reverse: _propTypes.default.bool,
216
+ adaptiveSpacingSmallScreen: _propTypes.default.bool
215
217
  };
216
218
  const StyledCheckboxGroup = _styledComponents.default.div`
217
219
  display: flex;
@@ -249,8 +251,8 @@ const StyledCheckboxGroup = _styledComponents.default.div`
249
251
  `}
250
252
  `;
251
253
  exports.StyledCheckboxGroup = StyledCheckboxGroup;
252
- StyledCheckboxGroup.defaultProps = {
253
- theme: _base.default
254
+ StyledCheckboxGroup.propTypes = {
255
+ legendInline: _propTypes.default.bool
254
256
  };
255
257
  var _default = CheckboxStyle;
256
258
  exports.default = _default;
@@ -89,7 +89,7 @@ const DateRange = ({
89
89
  ...localeData
90
90
  }),
91
91
  rawValue: _date2.default.formatValue({
92
- value: getStartDate() || (!isControlled ? today : ""),
92
+ value: getStartDate() || (startDateProps.allowEmptyValue ? "" : today),
93
93
  ...localeData
94
94
  })
95
95
  });
@@ -99,7 +99,7 @@ const DateRange = ({
99
99
  ...localeData
100
100
  }),
101
101
  rawValue: _date2.default.formatValue({
102
- value: getEndDate() || (!isControlled ? today : ""),
102
+ value: getEndDate() || (endDateProps.allowEmptyValue ? "" : today),
103
103
  ...localeData
104
104
  })
105
105
  });
@@ -110,7 +110,7 @@ const DateRange = ({
110
110
  ...localeData
111
111
  }),
112
112
  rawValue: _date2.default.formatValue({
113
- value: getStartDate() || today,
113
+ value: getStartDate() || (startDateProps.allowEmptyValue ? "" : today),
114
114
  ...localeData
115
115
  })
116
116
  });
@@ -120,11 +120,11 @@ const DateRange = ({
120
120
  ...localeData
121
121
  }),
122
122
  rawValue: _date2.default.formatValue({
123
- value: getEndDate() || today,
123
+ value: getEndDate() || (endDateProps.allowEmptyValue ? "" : today),
124
124
  ...localeData
125
125
  })
126
126
  });
127
- }, [getEndDate, getStartDate, localeData, today]);
127
+ }, [getEndDate, getStartDate, endDateProps, startDateProps, localeData, today]);
128
128
 
129
129
  function usePrevious(arg) {
130
130
  const ref = (0, _react.useRef)();
@@ -75,8 +75,8 @@ const StyledIcon = _styledComponents.default.span`
75
75
 
76
76
  try {
77
77
  if (disabled) {
78
- finalColor = theme.icon.disabled;
79
- finalHoverColor = theme.icon.disabled;
78
+ finalColor = "var(--colorsYin030)";
79
+ finalHoverColor = "var(--colorsYin030)";
80
80
  } else if (typeof color === "string" && color.startsWith("var")) {
81
81
  finalColor = color;
82
82
  finalHoverColor = (0, _polished.shade)(0.2, theme.compatibility[color.replace("var(--", "").replace(")", "")]);
@@ -90,8 +90,8 @@ const StyledIcon = _styledComponents.default.span`
90
90
  finalColor = renderedColor;
91
91
  finalHoverColor = (0, _polished.shade)(0.2, renderedColor);
92
92
  } else {
93
- finalColor = theme.icon.default;
94
- finalHoverColor = theme.icon.defaultHover;
93
+ finalColor = "var(--colorsYin065)";
94
+ finalHoverColor = "var(--colorsYin090)";
95
95
  }
96
96
 
97
97
  if (bg) {
@@ -104,8 +104,8 @@ const StyledIcon = _styledComponents.default.span`
104
104
  bgColor = backgroundColor;
105
105
  bgHoverColor = (0, _polished.shade)(0.2, backgroundColor);
106
106
  } else if (disabled) {
107
- bgColor = theme.icon.disabled;
108
- bgHoverColor = theme.icon.disabled;
107
+ bgColor = "var(--colorsYin030)";
108
+ bgHoverColor = "var(--colorsYin030)";
109
109
  } else {
110
110
  bgColor = "transparent";
111
111
  bgHoverColor = "transparent";
@@ -159,7 +159,7 @@ const StyledIcon = _styledComponents.default.span`
159
159
 
160
160
  ${hasTooltip && `
161
161
  :focus {
162
- outline: 2px solid ${theme.colors.focus};
162
+ outline: 2px solid var(--colorsSemanticFocus500);
163
163
  }
164
164
  `}
165
165
 
@@ -183,7 +183,8 @@ const SplitButton = ({
183
183
  "aria-expanded": showAdditionalButtons,
184
184
  "aria-label": "Show more",
185
185
  "data-element": "toggle-button",
186
- key: "toggle-button"
186
+ key: "toggle-button",
187
+ type: "button"
187
188
  }, toggleButtonProps()), /*#__PURE__*/_react.default.createElement(_icon.default, {
188
189
  type: "dropdown",
189
190
  bgSize: "extra-small",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "102.7.3",
3
+ "version": "102.9.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -145,7 +145,7 @@
145
145
  "dependencies": {
146
146
  "@octokit/rest": "^18.12.0",
147
147
  "@popperjs/core": "^2.9.0",
148
- "@sage/design-tokens": "^1.80.0",
148
+ "@sage/design-tokens": "^1.87.0",
149
149
  "@styled-system/prop-types": "^5.1.5",
150
150
  "@tippyjs/react": "^4.2.5",
151
151
  "classnames": "~2.2.6",