carbon-react 118.3.3 → 118.4.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.
Files changed (37) hide show
  1. package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +30 -24
  2. package/esm/components/action-popover/action-popover.style.d.ts +2 -1
  3. package/esm/components/action-popover/action-popover.style.js +9 -2
  4. package/esm/components/box/box.component.d.ts +1 -1
  5. package/esm/components/box/box.component.js +4 -1
  6. package/esm/components/carbon-provider/carbon-provider.component.d.ts +3 -2
  7. package/esm/components/carbon-provider/carbon-provider.component.js +20 -9
  8. package/esm/components/loader/loader-square.style.js +8 -9
  9. package/esm/components/pill/pill.style.js +42 -8
  10. package/esm/components/portrait/portrait.component.js +11 -6
  11. package/esm/components/progress-tracker/progress-tracker.config.d.ts +1 -0
  12. package/esm/components/progress-tracker/progress-tracker.style.js +12 -4
  13. package/esm/components/switch/__internal__/switch-slider.style.d.ts +1 -5
  14. package/esm/components/switch/__internal__/switch-slider.style.js +8 -2
  15. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +2 -1
  16. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +2 -2
  17. package/esm/style/design-tokens/generate-css-variables.util.d.ts +1 -1
  18. package/esm/style/design-tokens/generate-css-variables.util.js +7 -1
  19. package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +29 -23
  20. package/lib/components/action-popover/action-popover.style.d.ts +2 -1
  21. package/lib/components/action-popover/action-popover.style.js +10 -2
  22. package/lib/components/box/box.component.d.ts +1 -1
  23. package/lib/components/box/box.component.js +4 -1
  24. package/lib/components/carbon-provider/carbon-provider.component.d.ts +3 -2
  25. package/lib/components/carbon-provider/carbon-provider.component.js +19 -8
  26. package/lib/components/loader/loader-square.style.js +11 -9
  27. package/lib/components/pill/pill.style.js +42 -8
  28. package/lib/components/portrait/portrait.component.js +11 -5
  29. package/lib/components/progress-tracker/progress-tracker.config.d.ts +1 -0
  30. package/lib/components/progress-tracker/progress-tracker.style.js +12 -4
  31. package/lib/components/switch/__internal__/switch-slider.style.d.ts +1 -5
  32. package/lib/components/switch/__internal__/switch-slider.style.js +9 -2
  33. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +2 -1
  34. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
  35. package/lib/style/design-tokens/generate-css-variables.util.d.ts +1 -1
  36. package/lib/style/design-tokens/generate-css-variables.util.js +7 -1
  37. package/package.json +1 -1
@@ -194,7 +194,8 @@ const ActionPopoverItem = ({
194
194
  (_ref$current5 = ref.current) === null || _ref$current5 === void 0 ? void 0 : _ref$current5.click();
195
195
  }
196
196
 
197
- e.preventDefault();
197
+ e.preventDefault(); // this type assertion should be safe as the onclick handler is designed to catch events propagating from the inner buttons
198
+
198
199
  onClick(e);
199
200
  }
200
201
  } else if (_events.default.isEnterKey(e)) {
@@ -202,6 +203,21 @@ const ActionPopoverItem = ({
202
203
  }
203
204
  }, [disabled, download, isHref, isLeftAligned, onClick, submenu]);
204
205
  const itemSubmenuProps = { ...(!disabled && {
206
+ onClick: e => {
207
+ var _ref$current6;
208
+
209
+ setOpen(true);
210
+ (_ref$current6 = ref.current) === null || _ref$current6 === void 0 ? void 0 : _ref$current6.focus();
211
+ e.preventDefault();
212
+ e.stopPropagation();
213
+ }
214
+ }),
215
+ "aria-haspopup": "true",
216
+ "aria-label": l.actionPopover.ariaLabel(),
217
+ "aria-controls": `ActionPopoverMenu_${guid}`,
218
+ "aria-expanded": isOpen
219
+ };
220
+ const wrapperDivProps = { ...(!disabled && {
205
221
  onMouseEnter: e => {
206
222
  if (mouseEnterTimer.current) clearTimeout(mouseEnterTimer.current);
207
223
  setFocusIndex(-1);
@@ -216,20 +232,8 @@ const ActionPopoverItem = ({
216
232
  setOpen(false);
217
233
  }, INTERVAL);
218
234
  e.stopPropagation();
219
- },
220
- onClick: e => {
221
- var _ref$current6;
222
-
223
- setOpen(true);
224
- (_ref$current6 = ref.current) === null || _ref$current6 === void 0 ? void 0 : _ref$current6.focus();
225
- e.preventDefault();
226
- e.stopPropagation();
227
235
  }
228
- }),
229
- "aria-haspopup": "true",
230
- "aria-label": l.actionPopover.ariaLabel(),
231
- "aria-controls": `ActionPopoverMenu_${guid}`,
232
- "aria-expanded": isOpen
236
+ })
233
237
  };
234
238
 
235
239
  const renderMenuItemIcon = () => {
@@ -239,13 +243,15 @@ const ActionPopoverItem = ({
239
243
  });
240
244
  };
241
245
 
242
- return /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItem, _extends({}, rest, {
246
+ return /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItemWrapper, submenu && wrapperDivProps, /*#__PURE__*/_react.default.createElement("div", {
247
+ onKeyDown: onKeyDown,
248
+ role: "presentation"
249
+ }, /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItem, _extends({}, rest, {
243
250
  ref: ref,
244
251
  onClick: onClick,
245
- onKeyDown: onKeyDown,
246
252
  type: "button",
247
- tabIndex: 0,
248
253
  role: "menuitem",
254
+ tabIndex: 0,
249
255
  isDisabled: disabled,
250
256
  horizontalAlignment: horizontalAlignment
251
257
  }, disabled && {
@@ -254,7 +260,11 @@ const ActionPopoverItem = ({
254
260
  as: "a",
255
261
  download,
256
262
  href
257
- }, submenu && itemSubmenuProps), /*#__PURE__*/_react.default.isValidElement(submenu) ? /*#__PURE__*/_react.default.cloneElement(submenu, {
263
+ }, submenu && itemSubmenuProps), submenu && checkRef(ref) && isLeftAligned ? /*#__PURE__*/_react.default.createElement(_actionPopover.SubMenuItemIcon, {
264
+ type: "chevron_left"
265
+ }) : null, horizontalAlignment === "left" ? renderMenuItemIcon() : null, children, horizontalAlignment === "right" ? renderMenuItemIcon() : null, submenu && checkRef(ref) && !isLeftAligned ? /*#__PURE__*/_react.default.createElement(_actionPopover.SubMenuItemIcon, {
266
+ type: "chevron_right"
267
+ }) : null), /*#__PURE__*/_react.default.isValidElement(submenu) ? /*#__PURE__*/_react.default.cloneElement(submenu, {
258
268
  parentID: `ActionPopoverItem_${guid}`,
259
269
  menuID: `ActionPopoverMenu_${guid}`,
260
270
  "data-element": "action-popover-submenu",
@@ -264,11 +274,7 @@ const ActionPopoverItem = ({
264
274
  setOpen,
265
275
  setFocusIndex,
266
276
  focusIndex
267
- }) : null, submenu && checkRef(ref) && isLeftAligned ? /*#__PURE__*/_react.default.createElement(_actionPopover.SubMenuItemIcon, {
268
- type: "chevron_left"
269
- }) : null, horizontalAlignment === "left" ? renderMenuItemIcon() : null, children, horizontalAlignment === "right" ? renderMenuItemIcon() : null, submenu && checkRef(ref) && !isLeftAligned ? /*#__PURE__*/_react.default.createElement(_actionPopover.SubMenuItemIcon, {
270
- type: "chevron_right"
271
- }) : null);
277
+ }) : null));
272
278
  };
273
279
 
274
280
  exports.ActionPopoverItem = ActionPopoverItem;
@@ -7,6 +7,7 @@ declare type StyledMenuItemProps = {
7
7
  horizontalAlignment: "left" | "right";
8
8
  };
9
9
  declare const StyledMenuItem: import("styled-components").StyledComponent<"button", any, StyledMenuItemProps, never>;
10
+ declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
10
11
  declare const MenuItemDivider: import("styled-components").StyledComponent<"div", any, {
11
12
  "data-element": string;
12
13
  }, "data-element">;
@@ -16,4 +17,4 @@ declare const StyledButtonIcon: import("styled-components").StyledComponent<"div
16
17
  declare const MenuItemIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
17
18
  declare const SubMenuItemIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
18
19
  declare const MenuButtonOverrideWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- export { Menu, MenuButton, ButtonIcon, StyledButtonIcon, MenuItemIcon, MenuItemDivider, SubMenuItemIcon, MenuButtonOverrideWrapper, StyledMenuItem, };
20
+ export { Menu, MenuButton, ButtonIcon, StyledButtonIcon, MenuItemIcon, MenuItemDivider, SubMenuItemIcon, MenuButtonOverrideWrapper, StyledMenuItem, StyledMenuItemWrapper, };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.StyledMenuItem = exports.MenuButtonOverrideWrapper = exports.SubMenuItemIcon = exports.MenuItemDivider = exports.MenuItemIcon = exports.StyledButtonIcon = exports.ButtonIcon = exports.MenuButton = exports.Menu = void 0;
6
+ exports.StyledMenuItemWrapper = exports.StyledMenuItem = exports.MenuButtonOverrideWrapper = exports.SubMenuItemIcon = exports.MenuItemDivider = exports.MenuItemIcon = exports.StyledButtonIcon = exports.ButtonIcon = exports.MenuButton = exports.Menu = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
@@ -35,7 +35,11 @@ const Menu = _styledComponents.default.div`
35
35
  background-color: var(--colorsUtilityYang100);
36
36
  z-index: ${({
37
37
  theme
38
- }) => `${theme.zIndex.popover}`}; // TODO (tokens): implement elevation tokens - FE-4437
38
+ }) => {
39
+ var _theme$zIndex;
40
+
41
+ return `${(_theme$zIndex = theme.zIndex) === null || _theme$zIndex === void 0 ? void 0 : _theme$zIndex.popover}`;
42
+ }}; // TODO (tokens): implement elevation tokens - FE-4437
39
43
  `;
40
44
  exports.Menu = Menu;
41
45
  const StyledMenuItem = _styledComponents.default.button`
@@ -90,6 +94,10 @@ const StyledMenuItem = _styledComponents.default.button`
90
94
  `}
91
95
  `;
92
96
  exports.StyledMenuItem = StyledMenuItem;
97
+ const StyledMenuItemWrapper = _styledComponents.default.div`
98
+ position: relative;
99
+ `;
100
+ exports.StyledMenuItemWrapper = StyledMenuItemWrapper;
93
101
  const MenuItemDivider = _styledComponents.default.div.attrs({
94
102
  "data-element": "action-popover-divider"
95
103
  })`
@@ -28,7 +28,7 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
28
28
  rowGap?: Gap;
29
29
  /** Design Token for Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Box component. */
30
30
  boxShadow?: BoxShadowsType;
31
- /** Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component. */
31
+ /** Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component. **This prop will not do anything if you have the roundedCornerOptOut flag set in the CarbonProvider** */
32
32
  borderRadius?: BorderRadiusType;
33
33
  }
34
34
  export declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
@@ -55,8 +55,11 @@ const Box = _styledComponents.default.div`
55
55
  ${calculatePosition}
56
56
 
57
57
  ${({
58
+ theme,
58
59
  borderRadius = "borderRadius000"
59
- }) => `border-radius: var(--${borderRadius});`}
60
+ }) => !theme.roundedCornersOptOut && (0, _styledComponents.css)`
61
+ border-radius: var(--${borderRadius});
62
+ `}
60
63
 
61
64
  ${({
62
65
  color,
@@ -4,7 +4,8 @@ export interface CarbonProviderProps {
4
4
  theme?: Partial<ThemeObject>;
5
5
  children: React.ReactNode;
6
6
  validationRedesignOptIn?: boolean;
7
+ roundedCornersOptOut?: boolean;
7
8
  }
8
- export declare const NewValidationContext: React.Context<Pick<CarbonProviderProps, "validationRedesignOptIn">>;
9
- export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, }: CarbonProviderProps) => JSX.Element;
9
+ export declare const NewValidationContext: React.Context<Pick<CarbonProviderProps, "validationRedesignOptIn" | "roundedCornersOptOut">>;
10
+ export declare const CarbonProvider: ({ children, theme, validationRedesignOptIn, roundedCornersOptOut, }: CarbonProviderProps) => JSX.Element;
10
11
  export default CarbonProvider;
@@ -29,18 +29,29 @@ exports.NewValidationContext = NewValidationContext;
29
29
  const CarbonProvider = ({
30
30
  children,
31
31
  theme = _mint.default,
32
- validationRedesignOptIn = false
33
- }) => /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
34
- theme: theme
35
- }, /*#__PURE__*/_react.default.createElement(_carbonScopedTokensProvider.default, null, /*#__PURE__*/_react.default.createElement(NewValidationContext.Provider, {
36
- value: {
37
- validationRedesignOptIn
38
- }
39
- }, /*#__PURE__*/_react.default.createElement(_topModalContext.TopModalContextProvider, null, children))));
32
+ validationRedesignOptIn = false,
33
+ roundedCornersOptOut = false
34
+ }) => {
35
+ const {
36
+ roundedCornersOptOut: existingRoundedCornersOptOut
37
+ } = (0, _react.useContext)(NewValidationContext);
38
+ const roundedCornersOptOutValue = existingRoundedCornersOptOut || roundedCornersOptOut;
39
+ return /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
40
+ theme: { ...theme,
41
+ roundedCornersOptOut: roundedCornersOptOutValue
42
+ }
43
+ }, /*#__PURE__*/_react.default.createElement(_carbonScopedTokensProvider.default, null, /*#__PURE__*/_react.default.createElement(NewValidationContext.Provider, {
44
+ value: {
45
+ validationRedesignOptIn,
46
+ roundedCornersOptOut: roundedCornersOptOutValue
47
+ }
48
+ }, /*#__PURE__*/_react.default.createElement(_topModalContext.TopModalContextProvider, null, children))));
49
+ };
40
50
 
41
51
  exports.CarbonProvider = CarbonProvider;
42
52
  CarbonProvider.propTypes = {
43
53
  "children": _propTypes.default.node,
54
+ "roundedCornersOptOut": _propTypes.default.bool,
44
55
  "theme": _propTypes.default.shape({
45
56
  "colors": _propTypes.default.shape({
46
57
  "destructive": _propTypes.default.shape({
@@ -7,6 +7,10 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
+ var _base = _interopRequireDefault(require("../../style/themes/base"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
15
 
12
16
  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; }
@@ -22,35 +26,31 @@ const loaderAnimation = (0, _styledComponents.keyframes)`
22
26
  }
23
27
  `;
24
28
 
25
- const getDimentions = size => {
29
+ const getDimentions = (size, roundedCornersOptOut) => {
26
30
  let width;
27
31
  let marginRight;
28
- let borderRadius;
29
32
 
30
33
  switch (size) {
31
34
  case "medium":
32
35
  width = "16px";
33
36
  marginRight = "8px";
34
- borderRadius = "var(--borderRadiusCircle)";
35
37
  break;
36
38
 
37
39
  case "large":
38
40
  width = "20px";
39
41
  marginRight = "8px";
40
- borderRadius = "var(--borderRadiusCircle)";
41
42
  break;
42
43
 
43
44
  default:
44
45
  width = "12px";
45
46
  marginRight = "6px";
46
- borderRadius = "var(--borderRadiusCircle)";
47
47
  }
48
48
 
49
49
  return (0, _styledComponents.css)`
50
50
  width: ${width};
51
51
  height: ${width};
52
52
  margin-right: ${marginRight};
53
- border-radius: ${borderRadius};
53
+ ${!roundedCornersOptOut && "border-radius: var(--borderRadiusCircle);"}
54
54
  `;
55
55
  };
56
56
 
@@ -58,12 +58,13 @@ const StyledLoaderSquare = _styledComponents.default.div`
58
58
  ${({
59
59
  size,
60
60
  isInsideButton,
61
- isActive
61
+ isActive,
62
+ theme
62
63
  }) => (0, _styledComponents.css)`
63
64
  animation: ${loaderAnimation} 1s infinite ease-in-out both;
64
65
  background-color: var(--colorsActionMajor500);
65
66
  display: inline-block;
66
- ${getDimentions(size)}
67
+ ${getDimentions(size, theme.roundedCornersOptOut)}
67
68
 
68
69
  ${isInsideButton && (0, _styledComponents.css)`
69
70
  background-color: ${isActive ? "var(--colorsUtilityYang100)" : "var(--colorsSemanticNeutral500)"};
@@ -86,7 +87,8 @@ const StyledLoaderSquare = _styledComponents.default.div`
86
87
  StyledLoaderSquare.defaultProps = {
87
88
  size: "small",
88
89
  isInsideButton: false,
89
- isActive: true
90
+ isActive: true,
91
+ theme: _base.default
90
92
  };
91
93
  var _default = StyledLoaderSquare;
92
94
  exports.default = _default;
@@ -89,7 +89,9 @@ const StyledPill = _styledComponents.default.span`
89
89
  align-items: center;
90
90
  justify-content: center;
91
91
  border: 2px solid ${pillColor};
92
- border-radius: var(--borderRadius025);
92
+ ${!theme.roundedCornersOptOut && (0, _styledComponents.css)`
93
+ border-radius: var(--borderRadius025);
94
+ `}
93
95
  height: auto;
94
96
  ${!wrapText && (0, _styledComponents.css)`
95
97
  white-space: nowrap;
@@ -112,30 +114,64 @@ const StyledPill = _styledComponents.default.span`
112
114
  min-height: 16px;
113
115
  line-height: 16px;
114
116
  font-size: 10px;
117
+
118
+ ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
119
+ border-radius: 12px;
120
+
121
+ button {
122
+ border-radius: 0 10px 10px 0;
123
+ }
124
+ `}
115
125
  `}
116
126
 
117
127
  ${size === "M" && (0, _styledComponents.css)`
118
128
  min-height: 20px;
119
129
  line-height: 20px;
120
130
  font-size: 12px;
131
+
132
+ ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
133
+ border-radius: 12px;
134
+
135
+ button {
136
+ border-radius: 0 10px 10px 0;
137
+ }
138
+ `}
121
139
  `}
122
140
 
123
141
  ${size === "L" && (0, _styledComponents.css)`
124
142
  min-height: 24px;
125
143
  line-height: 24px;
126
144
  font-size: 14px;
145
+
146
+ ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
147
+ border-radius: 13px;
148
+
149
+ button {
150
+ border-radius: 0 11px 11px 0;
151
+ }
152
+ `}
127
153
  `}
128
154
 
129
155
  ${size === "XL" && (0, _styledComponents.css)`
130
156
  min-height: 26px;
131
157
  line-height: 26px;
132
158
  font-size: 16px;
159
+
160
+ ${theme.roundedCornersOptOut && (0, _styledComponents.css)`
161
+ border-radius: 15px;
162
+
163
+ button {
164
+ border-radius: 0 12px 12px 0;
165
+ }
166
+ `}
133
167
  `}
134
168
 
135
169
  ${isDeletable && (0, _styledComponents.css)`
136
170
  button {
137
171
  -webkit-appearance: none;
138
- border-radius: var(--borderRadius000);
172
+ ${!theme.roundedCornersOptOut && (0, _styledComponents.css)`
173
+ border-radius: var(--borderRadius000);
174
+ `}
139
175
  border: none;
140
176
  bottom: 0;
141
177
  font-size: 100%;
@@ -150,8 +186,10 @@ const StyledPill = _styledComponents.default.span`
150
186
  outline: none;
151
187
  box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
152
188
  background-color: ${buttonFocusColor};
153
- border-radius: var(--borderRadius000) var(--borderRadius025)
154
- var(--borderRadius025) var(--borderRadius000);
189
+ ${!theme.roundedCornersOptOut && (0, _styledComponents.css)`
190
+ border-radius: var(--borderRadius000) var(--borderRadius025)
191
+ var(--borderRadius025) var(--borderRadius000);
192
+ `}
155
193
 
156
194
  & {
157
195
  color: ${contentColor};
@@ -199,7 +237,6 @@ const StyledPill = _styledComponents.default.span`
199
237
  button {
200
238
  padding: 0;
201
239
  line-height: 14px;
202
-
203
240
  ${addStyleToPillIcon("7px")}
204
241
  }
205
242
  `}
@@ -211,7 +248,6 @@ const StyledPill = _styledComponents.default.span`
211
248
  width: 24px;
212
249
  padding: 0;
213
250
  line-height: 15px;
214
-
215
251
  ${addStyleToPillIcon("10px")}
216
252
  }
217
253
  `}
@@ -223,7 +259,6 @@ const StyledPill = _styledComponents.default.span`
223
259
  width: 28px;
224
260
  padding: 0;
225
261
  line-height: 16px;
226
-
227
262
  ${addStyleToPillIcon("12px")}
228
263
  }
229
264
  `}
@@ -235,7 +270,6 @@ const StyledPill = _styledComponents.default.span`
235
270
  width: 32px;
236
271
  padding: 0;
237
272
  line-height: 18px;
238
-
239
273
  ${addStyleToPillIcon("13px")}
240
274
  }
241
275
  `}
@@ -21,6 +21,8 @@ var _portrait = require("./portrait.style");
21
21
 
22
22
  var _utils = require("../../style/utils");
23
23
 
24
+ var _carbonProvider = require("../carbon-provider/carbon-provider.component");
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
26
28
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -35,7 +37,7 @@ const Portrait = ({
35
37
  gravatar,
36
38
  iconType = "individual",
37
39
  initials,
38
- shape = "circle",
40
+ shape,
39
41
  size = "M",
40
42
  src,
41
43
  onClick,
@@ -50,6 +52,10 @@ const Portrait = ({
50
52
  ...rest
51
53
  }) => {
52
54
  const [externalError, setExternalError] = (0, _react.useState)(false);
55
+ const {
56
+ roundedCornersOptOut
57
+ } = (0, _react.useContext)(_carbonProvider.NewValidationContext);
58
+ const defaultShape = roundedCornersOptOut ? "square" : "circle";
53
59
  (0, _react.useEffect)(() => {
54
60
  setExternalError(false);
55
61
  }, [gravatar, src]);
@@ -59,14 +65,14 @@ const Portrait = ({
59
65
  let portrait = /*#__PURE__*/_react.default.createElement(_portrait.StyledIcon, {
60
66
  type: iconType,
61
67
  size: size,
62
- shape: shape,
68
+ shape: shape || defaultShape,
63
69
  darkBackground: darkBackground
64
70
  });
65
71
 
66
72
  if (initials) {
67
73
  portrait = /*#__PURE__*/_react.default.createElement(_portraitInitials.default, {
68
74
  size: size,
69
- shape: shape,
75
+ shape: shape || defaultShape,
70
76
  initials: initials,
71
77
  darkBackground: darkBackground,
72
78
  alt: alt
@@ -78,7 +84,7 @@ const Portrait = ({
78
84
  src: src,
79
85
  alt: alt,
80
86
  size: size,
81
- shape: shape,
87
+ shape: shape || defaultShape,
82
88
  "data-element": "user-image",
83
89
  onError: () => setExternalError(true)
84
90
  });
@@ -87,7 +93,7 @@ const Portrait = ({
87
93
  if (gravatar && !externalError) {
88
94
  portrait = /*#__PURE__*/_react.default.createElement(_portraitGravatar.default, {
89
95
  gravatarEmail: gravatar,
90
- shape: shape,
96
+ shape: shape || defaultShape,
91
97
  size: size,
92
98
  alt: alt,
93
99
  errorCallback: () => setExternalError(true)
@@ -0,0 +1 @@
1
+ export declare const PROGRESS_TRACKER_SIZES: string[];
@@ -64,7 +64,8 @@ const StyledProgressBar = _styledComponents.default.span`
64
64
  ${({
65
65
  size,
66
66
  progress,
67
- error
67
+ error,
68
+ theme
68
69
  }) => (0, _styledComponents.css)`
69
70
  display: flex;
70
71
  position: relative;
@@ -73,7 +74,7 @@ const StyledProgressBar = _styledComponents.default.span`
73
74
  progress,
74
75
  error
75
76
  })};
76
- border-radius: var(--borderRadius400);
77
+ border-radius: ${theme.roundedCornersOptOut ? "25px" : "var(--borderRadius400)"};
77
78
  overflow-x: hidden;
78
79
  height: ${getHeight(size)};
79
80
  width: 100%;
@@ -116,7 +117,8 @@ const InnerBar = _styledComponents.default.span`
116
117
  progress,
117
118
  size = "medium",
118
119
  length,
119
- error
120
+ error,
121
+ theme
120
122
  }) => (0, _styledComponents.css)`
121
123
  position: relative;
122
124
  left: 0;
@@ -124,13 +126,19 @@ const InnerBar = _styledComponents.default.span`
124
126
  progress,
125
127
  error
126
128
  })};
127
- border-radius: var(--borderRadius400);
129
+ border-radius: ${theme.roundedCornersOptOut ? "25px" : "var(--borderRadius400)"};
128
130
  width: calc(${length} * ${progress && progress / 100});
129
131
  min-width: 2px;
130
132
  height: ${getHeight(size)};
131
133
  `}
132
134
  `;
133
135
  exports.InnerBar = InnerBar;
136
+ InnerBar.defaultProps = {
137
+ theme: _base.default
138
+ };
139
+ StyledProgressBar.defaultProps = {
140
+ theme: _base.default
141
+ };
134
142
  StyledProgressTracker.defaultProps = {
135
143
  theme: _base.default
136
144
  };
@@ -1,6 +1,2 @@
1
- import { SwitchSliderProps } from "./switch-slider.component";
2
- interface StyledSwitchSliderProps extends Pick<SwitchSliderProps, "checked" | "disabled" | "size" | "error" | "warning"> {
3
- isLoading?: boolean;
4
- }
5
- declare const StyledSwitchSlider: import("styled-components").StyledComponent<"span", any, StyledSwitchSliderProps, never>;
1
+ declare const StyledSwitchSlider: import("styled-components").StyledComponent<"span", any, {}, never>;
6
2
  export default StyledSwitchSlider;
@@ -11,6 +11,8 @@ var _switchSliderPanel = _interopRequireDefault(require("./switch-slider-panel.s
11
11
 
12
12
  var _validationIcon = _interopRequireDefault(require("../../../__internal__/validations/validation-icon.style"));
13
13
 
14
+ var _base = _interopRequireDefault(require("../../../style/themes/base"));
15
+
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
18
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -24,7 +26,8 @@ const StyledSwitchSlider = _styledComponents.default.span`
24
26
  disabled,
25
27
  size,
26
28
  error,
27
- warning
29
+ warning,
30
+ theme
28
31
  }) => (0, _styledComponents.css)`
29
32
  display: flex;
30
33
  font-size: 12px;
@@ -38,7 +41,7 @@ const StyledSwitchSlider = _styledComponents.default.span`
38
41
  width: 64px;
39
42
  min-width: fit-content;
40
43
  z-index: 2;
41
- border-radius: var(--borderRadius400);
44
+ border-radius: ${theme !== null && theme !== void 0 && theme.roundedCornersOptOut ? "90px" : "var(--borderRadius400)"};
42
45
  border-style: solid;
43
46
  border-color: var(--colorsActionMinor400);
44
47
  border-width: var(--borderWidth200);
@@ -92,6 +95,7 @@ const StyledSwitchSlider = _styledComponents.default.span`
92
95
  `}
93
96
 
94
97
  ${size === "large" && (0, _styledComponents.css)`
98
+ ${theme !== null && theme !== void 0 && theme.roundedCornersOptOut ? "border-radius: 30px;" : ""}
95
99
  &::before {
96
100
  height: 32px;
97
101
  width: 32px;
@@ -123,5 +127,8 @@ const StyledSwitchSlider = _styledComponents.default.span`
123
127
  }
124
128
  `}
125
129
  `;
130
+ StyledSwitchSlider.defaultProps = {
131
+ theme: _base.default
132
+ };
126
133
  var _default = StyledSwitchSlider;
127
134
  exports.default = _default;
@@ -1,9 +1,10 @@
1
1
  import { ThemeObject } from "../../themes/base";
2
+ import { CarbonProviderProps } from "../../../components/carbon-provider";
2
3
  /**
3
4
  *
4
5
  * Converts theme properties to css variables form and set them locally for
5
6
  * given scope
6
7
  *
7
8
  */
8
- declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject, never>;
9
+ declare const CarbonScopedTokensProvider: import("styled-components").StyledComponent<"div", any, ThemeObject & Pick<CarbonProviderProps, "roundedCornersOptOut">, never>;
9
10
  export default CarbonScopedTokensProvider;
@@ -27,7 +27,7 @@ const CarbonScopedTokensProvider = _styledComponents.default.div`
27
27
 
28
28
  ${({
29
29
  theme
30
- }) => (0, _generateCssVariables.default)(theme.compatibility)}
30
+ }) => (0, _generateCssVariables.default)(theme.compatibility, theme.roundedCornersOptOut)}
31
31
  `;
32
32
  CarbonScopedTokensProvider.defaultProps = {
33
33
  theme: _themes.baseTheme
@@ -1,5 +1,5 @@
1
1
  import { ThemeObject } from "../themes/base";
2
- declare const _default: (theme: ThemeObject | Record<string, string>) => string;
2
+ declare const _default: (theme: ThemeObject | Record<string, string>, roundedCornersOptOupt?: boolean | undefined) => string;
3
3
  /**
4
4
  *
5
5
  * Converts theme properties to the string in form of css variable definitions.
@@ -13,6 +13,12 @@ exports.default = void 0;
13
13
  * form of CSS variables along with styled-components ThemeProvider.
14
14
  *
15
15
  */
16
- var _default = theme => Object.entries(theme).map(([key, value]) => `--${key}: ${value};`).join("\r\n");
16
+ var _default = (theme, roundedCornersOptOupt) => Object.entries(theme).map(([key, value]) => {
17
+ if (roundedCornersOptOupt && key.startsWith("borderRadius") && key !== "borderRadiusCircle") {
18
+ return `--${key}: 0px;`;
19
+ }
20
+
21
+ return `--${key}: ${value};`;
22
+ }).join("\r\n");
17
23
 
18
24
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "118.3.3",
3
+ "version": "118.4.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",