carbon-react 104.7.3 → 104.10.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.
@@ -2,7 +2,7 @@ export const StyledAdvancedColorPickerWrapper: import("styled-components").Style
2
2
  import StyledAdvancedColorPickerCell from "./advanced-color-picker-cell.style";
3
3
  export const StyledAdvancedColorPickerPreview: import("styled-components").StyledComponent<"div", any, {}, never>;
4
4
  export const DialogStyle: import("styled-components").StyledComponent<{
5
- ({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, ...rest }: {
5
+ ({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, contentPadding, ...rest }: {
6
6
  [x: string]: any;
7
7
  className: any;
8
8
  children: any;
@@ -20,6 +20,7 @@ export const DialogStyle: import("styled-components").StyledComponent<{
20
20
  disableClose: any;
21
21
  help: any;
22
22
  role?: string | undefined;
23
+ contentPadding?: {} | undefined;
23
24
  }): JSX.Element;
24
25
  propTypes: {
25
26
  "aria-describedby": import("prop-types").Requireable<string>;
@@ -43,6 +44,11 @@ export const DialogStyle: import("styled-components").StyledComponent<{
43
44
  disableAutoFocus: import("prop-types").Requireable<boolean>;
44
45
  bespokeFocusTrap: import("prop-types").Requireable<(...args: any[]) => any>;
45
46
  role: import("prop-types").Requireable<string>;
47
+ contentPadding: import("prop-types").Requireable<import("prop-types").InferProps<{
48
+ p: import("prop-types").Requireable<number>;
49
+ px: import("prop-types").Requireable<number>;
50
+ py: import("prop-types").Requireable<number>;
51
+ }>>;
46
52
  };
47
53
  defaultProps: {
48
54
  size: string;
@@ -5,14 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
 
10
- var _themes = require("../../../style/themes");
10
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
11
11
 
12
12
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
13
13
 
14
14
  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; }
15
15
 
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
16
18
  const StyledNavigationItem = _styledComponents.default.li`
17
19
  width: 100%;
18
20
 
@@ -20,52 +22,32 @@ const StyledNavigationItem = _styledComponents.default.li`
20
22
  cursor: pointer;
21
23
  display: block;
22
24
  text-decoration: none;
23
- color: ${({
24
- theme
25
- }) => theme.text.color};
25
+ color: var(--colorsUtilityYin090);
26
26
  background-color: transparent;
27
- border-left: 3px solid ${({
28
- theme
29
- }) => theme.disabled.background};
27
+ border-left: var(--sizing050) solid var(--colorsActionMinor100);
30
28
  font-weight: 700;
31
29
  padding: 12px 24px;
32
30
 
33
31
  &:focus {
34
- outline: none;
35
- position: relative;
36
-
37
- &:before {
38
- content: "";
39
- position: absolute;
40
- top: 0;
41
- bottom: 0;
42
- left: -3px;
43
- right: 0;
44
- z-index: 1;
45
- box-shadow: 0 0 6px ${({
46
- theme
47
- }) => theme.colors.focus};
48
- }
32
+ outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
49
33
  }
50
34
 
51
35
  &:hover {
52
36
  background-color: ${({
53
- isSelected,
54
- theme
55
- }) => !isSelected && theme.anchorNavigation.navItemHoverBackground};
37
+ isSelected
38
+ }) => !isSelected && "var(--colorsActionMinor100)"};
56
39
  }
57
40
 
58
41
  ${({
59
- isSelected,
60
- theme
42
+ isSelected
61
43
  }) => isSelected && (0, _styledComponents.css)`
62
- background-color: ${theme.colors.white};
63
- border-left-color: ${theme.colors.primary};
44
+ background-color: var(--colorsActionMinorYang100);
45
+ border-left-color: var(--colorsActionMajor500);
64
46
  `}
65
47
  }
66
48
  `;
67
- StyledNavigationItem.defaultProps = {
68
- theme: _themes.baseTheme
49
+ StyledNavigationItem.propTypes = {
50
+ isSelected: _propTypes.default.bool
69
51
  };
70
52
  var _default = StyledNavigationItem;
71
53
  exports.default = _default;
@@ -7,8 +7,6 @@ exports.StyledContent = exports.StyledNavigation = exports.StyledAnchorNavigatio
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _themes = require("../../style/themes");
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  const StyledAnchorNavigation = _styledComponents.default.div`
@@ -20,9 +18,6 @@ exports.StyledAnchorNavigation = StyledAnchorNavigation;
20
18
  const StyledNavigation = _styledComponents.default.ul`
21
19
  position: sticky;
22
20
  top: 32px;
23
- box-shadow: inset 3px 0px 0px 0px ${({
24
- theme
25
- }) => theme.disabled.background};
26
21
  list-style: none;
27
22
  margin: 0;
28
23
  padding: 0;
@@ -33,13 +28,4 @@ const StyledContent = _styledComponents.default.div`
33
28
  flex: 1;
34
29
  margin-left: 32px;
35
30
  `;
36
- exports.StyledContent = StyledContent;
37
- StyledAnchorNavigation.defaultProps = {
38
- theme: _themes.baseTheme
39
- };
40
- StyledNavigation.defaultProps = {
41
- theme: _themes.baseTheme
42
- };
43
- StyledContent.defaultProps = {
44
- theme: _themes.baseTheme
45
- };
31
+ exports.StyledContent = StyledContent;
@@ -7,20 +7,13 @@ exports.default = void 0;
7
7
 
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
 
10
- var _themes = require("../../../style/themes");
11
-
12
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
11
 
14
12
  const StyledAnchorDivider = _styledComponents.default.div.attrs({
15
13
  "data-element": "anchor-navigation-divider"
16
14
  })`
17
- background-color: ${({
18
- theme
19
- }) => theme.anchorNavigation.divider};
15
+ background-color: var(--colorsActionMinor200);
20
16
  height: 1px;
21
17
  `;
22
- StyledAnchorDivider.defaultProps = {
23
- theme: _themes.baseTheme
24
- };
25
18
  var _default = StyledAnchorDivider;
26
19
  exports.default = _default;
@@ -1,5 +1,5 @@
1
1
  export default Dialog;
2
- declare function Dialog({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, ...rest }: {
2
+ declare function Dialog({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, contentPadding, ...rest }: {
3
3
  [x: string]: any;
4
4
  className: any;
5
5
  children: any;
@@ -17,6 +17,7 @@ declare function Dialog({ className, children, open, height, size, title, disabl
17
17
  disableClose: any;
18
18
  help: any;
19
19
  role?: string | undefined;
20
+ contentPadding?: {} | undefined;
20
21
  }): JSX.Element;
21
22
  declare namespace Dialog {
22
23
  const propTypes: {
@@ -28,7 +29,7 @@ declare namespace Dialog {
28
29
  */
29
30
  "aria-label": PropTypes.Requireable<string>;
30
31
  /**
31
- * Prop to specify the aria-labeledby property of the Dialog component
32
+ * Prop to specify the aria-labelledby property of the Dialog component
32
33
  * To be used when the title prop is a custom React Node,
33
34
  * or the component is labelled by an internal element other than the title.
34
35
  */
@@ -71,6 +72,12 @@ declare namespace Dialog {
71
72
  bespokeFocusTrap: PropTypes.Requireable<(...args: any[]) => any>;
72
73
  /** The ARIA role to be applied to the Dialog container */
73
74
  role: PropTypes.Requireable<string>;
75
+ /** Padding to be set on the Dialog content */
76
+ contentPadding: PropTypes.Requireable<PropTypes.InferProps<{
77
+ p: PropTypes.Requireable<number>;
78
+ px: PropTypes.Requireable<number>;
79
+ py: PropTypes.Requireable<number>;
80
+ }>>;
74
81
  };
75
82
  namespace defaultProps {
76
83
  const size: string;
@@ -29,6 +29,8 @@ var _form = _interopRequireDefault(require("../form"));
29
29
 
30
30
  var _dialog2 = require("./dialog.config");
31
31
 
32
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
33
+
32
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
35
 
34
36
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -54,8 +56,10 @@ const Dialog = ({
54
56
  disableClose,
55
57
  help,
56
58
  role = "dialog",
59
+ contentPadding = {},
57
60
  ...rest
58
61
  }) => {
62
+ const locale = (0, _useLocale.default)();
59
63
  const dialogRef = (0, _react.useRef)();
60
64
  const innerContentRef = (0, _react.useRef)();
61
65
  const titleRef = (0, _react.useRef)();
@@ -124,7 +128,7 @@ const Dialog = ({
124
128
  if (!showCloseIcon || !onCancel) return null;
125
129
  return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
126
130
  "data-element": "close",
127
- "aria-label": "Close button",
131
+ "aria-label": locale.dialog.ariaLabels.close(),
128
132
  onAction: onCancel,
129
133
  disabled: disableClose
130
134
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
@@ -187,9 +191,9 @@ const Dialog = ({
187
191
  "data-element": "dialog",
188
192
  "data-role": rest["data-role"],
189
193
  role: role
190
- }), dialogTitle(), /*#__PURE__*/_react.default.createElement(_dialog.DialogContentStyle, null, /*#__PURE__*/_react.default.createElement(_dialog.DialogInnerContentStyle, {
194
+ }, contentPadding), dialogTitle(), /*#__PURE__*/_react.default.createElement(_dialog.DialogContentStyle, contentPadding, /*#__PURE__*/_react.default.createElement(_dialog.DialogInnerContentStyle, _extends({
191
195
  ref: innerContentRef
192
- }, _react.default.Children.map(children, child => {
196
+ }, contentPadding), _react.default.Children.map(children, child => {
193
197
  if ((child === null || child === void 0 ? void 0 : child.type) === _form.default) {
194
198
  return /*#__PURE__*/_react.default.cloneElement(child, {
195
199
  dialogRef
@@ -211,7 +215,7 @@ Dialog.propTypes = {
211
215
  "aria-label": _propTypes.default.string,
212
216
 
213
217
  /**
214
- * Prop to specify the aria-labeledby property of the Dialog component
218
+ * Prop to specify the aria-labelledby property of the Dialog component
215
219
  * To be used when the title prop is a custom React Node,
216
220
  * or the component is labelled by an internal element other than the title.
217
221
  */
@@ -269,7 +273,14 @@ Dialog.propTypes = {
269
273
  bespokeFocusTrap: _propTypes.default.func,
270
274
 
271
275
  /** The ARIA role to be applied to the Dialog container */
272
- role: _propTypes.default.string
276
+ role: _propTypes.default.string,
277
+
278
+ /** Padding to be set on the Dialog content */
279
+ contentPadding: _propTypes.default.shape({
280
+ p: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
281
+ px: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
282
+ py: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8])
283
+ })
273
284
  };
274
285
  Dialog.defaultProps = {
275
286
  size: "medium",
@@ -1,2 +1,5 @@
1
1
  export const DIALOG_SIZES: string[];
2
2
  export const TOP_MARGIN: 20;
3
+ export const CONTENT_TOP_PADDING: 24;
4
+ export const HORIZONTAL_PADDING: 32;
5
+ export const CONTENT_BOTTOM_PADDING: 30;
@@ -3,8 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.TOP_MARGIN = exports.DIALOG_SIZES = void 0;
6
+ exports.CONTENT_BOTTOM_PADDING = exports.HORIZONTAL_PADDING = exports.CONTENT_TOP_PADDING = exports.TOP_MARGIN = exports.DIALOG_SIZES = void 0;
7
7
  const DIALOG_SIZES = ["extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"];
8
8
  exports.DIALOG_SIZES = DIALOG_SIZES;
9
9
  const TOP_MARGIN = 20;
10
- exports.TOP_MARGIN = TOP_MARGIN;
10
+ exports.TOP_MARGIN = TOP_MARGIN;
11
+ const CONTENT_TOP_PADDING = 24;
12
+ exports.CONTENT_TOP_PADDING = CONTENT_TOP_PADDING;
13
+ const HORIZONTAL_PADDING = 32;
14
+ exports.HORIZONTAL_PADDING = HORIZONTAL_PADDING;
15
+ const CONTENT_BOTTOM_PADDING = 30;
16
+ exports.CONTENT_BOTTOM_PADDING = CONTENT_BOTTOM_PADDING;
@@ -1,6 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { ModalProps } from "../modal/modal";
3
3
 
4
+ type PaddingValues = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
5
+
6
+ interface ContentPaddingInterface {
7
+ p?: PaddingValues;
8
+ py?: PaddingValues;
9
+ px?: PaddingValues;
10
+ }
11
+
4
12
  export type DialogSizes =
5
13
  | "auto"
6
14
  | "extra-small"
@@ -20,7 +28,7 @@ export interface DialogProps extends ModalProps {
20
28
  */
21
29
  "aria-label"?: string;
22
30
  /**
23
- * Prop to specify the aria-labeledby property of the Dialog component
31
+ * Prop to specify the aria-labelledby property of the Dialog component
24
32
  * To be used when the title prop is a custom React Node,
25
33
  * or the component is labelled by an internal element other than the title.
26
34
  */
@@ -49,6 +57,8 @@ export interface DialogProps extends ModalProps {
49
57
  title?: React.ReactNode;
50
58
  /** The ARIA role to be applied to the Dialog container */
51
59
  role?: string;
60
+ /** Padding to be set on the Dialog content */
61
+ contentPadding?: ContentPaddingInterface;
52
62
  }
53
63
 
54
64
  declare function Dialog(props: DialogProps): JSX.Element;
@@ -1,4 +1,7 @@
1
1
  export const DialogStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
2
2
  export const DialogTitleStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
3
3
  export const DialogContentStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export const DialogInnerContentStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export const DialogInnerContentStyle: import("styled-components").StyledComponent<"div", any, {
5
+ py: any;
6
+ p: any;
7
+ }, never>;
@@ -7,12 +7,18 @@ exports.DialogInnerContentStyle = exports.DialogContentStyle = exports.DialogTit
7
7
 
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
 
10
+ var _styledSystem = require("styled-system");
11
+
12
+ var _base = _interopRequireDefault(require("../../style/themes/base"));
13
+
10
14
  var _form = require("../form/form.style");
11
15
 
12
16
  var _heading = require("../heading/heading.style");
13
17
 
14
18
  var _iconButton = _interopRequireDefault(require("../icon-button/icon-button.style"));
15
19
 
20
+ var _dialog = require("./dialog.config");
21
+
16
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
23
 
18
24
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -29,8 +35,51 @@ const dialogSizes = {
29
35
  large: "960px",
30
36
  "extra-large": "1080px"
31
37
  };
32
- const HORIZONTAL_PADDING = 35;
33
- const CONTENT_BOTTOM_PADDING = 30;
38
+
39
+ const calculateWidthValue = props => {
40
+ const {
41
+ paddingLeft,
42
+ paddingRight,
43
+ padding
44
+ } = (0, _styledSystem.padding)(props);
45
+ const paddingValue = paddingLeft ?? paddingRight ?? padding;
46
+ return paddingValue === undefined ? _dialog.HORIZONTAL_PADDING * 2 : paddingValue * 2;
47
+ };
48
+
49
+ const calculateFormSpacingValues = (props, isFormContent) => {
50
+ const {
51
+ paddingTop,
52
+ paddingBottom,
53
+ paddingLeft,
54
+ paddingRight,
55
+ padding
56
+ } = (0, _styledSystem.padding)(props);
57
+ const spacingTopValue = paddingTop ?? padding ?? _dialog.CONTENT_TOP_PADDING;
58
+ const spacingRightValue = paddingRight ?? padding ?? _dialog.HORIZONTAL_PADDING;
59
+ const spacingBottomValue = paddingBottom ?? padding ?? _dialog.CONTENT_BOTTOM_PADDING;
60
+ const spacingLeftValue = paddingLeft ?? padding ?? _dialog.HORIZONTAL_PADDING;
61
+ return {
62
+ "margin-left": spacingLeftValue ? `-${spacingLeftValue}px` : spacingLeftValue,
63
+ "margin-right": spacingRightValue ? `-${spacingRightValue}px` : spacingRightValue,
64
+ ...(isFormContent && {
65
+ "margin-top": spacingTopValue ? `-${spacingTopValue}px` : spacingTopValue,
66
+ "padding-top": spacingTopValue,
67
+ "padding-bottom": spacingBottomValue,
68
+ "padding-left": spacingLeftValue,
69
+ "padding-right": spacingRightValue
70
+ }),
71
+ ...(!isFormContent && {
72
+ "margin-bottom": spacingBottomValue ? `-${spacingBottomValue}px` : spacingBottomValue,
73
+ bottom: spacingBottomValue ? `-${spacingBottomValue}px` : spacingBottomValue
74
+ })
75
+ };
76
+ };
77
+
78
+ const calculatePaddingTopInnerContent = ({
79
+ py,
80
+ p
81
+ }) => [py, p].some(padding => padding !== undefined) ? 0 : `${_dialog.CONTENT_TOP_PADDING}px`;
82
+
34
83
  const DialogStyle = _styledComponents.default.div`
35
84
  background-color: var(--colorsUtilityMajor025);
36
85
  box-shadow: var(--boxShadow300);
@@ -62,7 +111,7 @@ const DialogStyle = _styledComponents.default.div`
62
111
  dialogHeight
63
112
  }) => dialogHeight && (0, _styledComponents.css)`
64
113
  height: ${dialogHeight}px;
65
- `};
114
+ `}
66
115
 
67
116
  ${_form.StyledForm} {
68
117
  padding-bottom: 0px;
@@ -70,21 +119,12 @@ const DialogStyle = _styledComponents.default.div`
70
119
  }
71
120
 
72
121
  ${_form.StyledFormContent}.sticky {
73
- padding-right: ${HORIZONTAL_PADDING}px;
74
- padding-left: ${HORIZONTAL_PADDING}px;
75
- padding-top: 20px;
76
- margin-right: -${HORIZONTAL_PADDING}px;
77
- margin-left: -${HORIZONTAL_PADDING}px;
78
- margin-top: -20px;
122
+ ${props => calculateFormSpacingValues(props, true)}
79
123
  }
80
124
 
81
125
  ${_form.StyledFormFooter}.sticky {
82
- margin-left: -${HORIZONTAL_PADDING}px;
83
- bottom: -${CONTENT_BOTTOM_PADDING}px;
84
- margin-bottom: -${CONTENT_BOTTOM_PADDING}px;
85
- width: calc(100% + ${2 * HORIZONTAL_PADDING}px);
86
- padding-left: ${HORIZONTAL_PADDING}px;
87
- padding-right: ${HORIZONTAL_PADDING}px;
126
+ width: calc(100% + ${calculateWidthValue}px);
127
+ ${props => calculateFormSpacingValues(props, false)}
88
128
  }
89
129
 
90
130
  > ${_iconButton.default} {
@@ -101,7 +141,7 @@ const DialogStyle = _styledComponents.default.div`
101
141
  `;
102
142
  exports.DialogStyle = DialogStyle;
103
143
  const DialogTitleStyle = _styledComponents.default.div`
104
- padding: 23px ${HORIZONTAL_PADDING}px 0;
144
+ padding: 23px ${_dialog.HORIZONTAL_PADDING}px 0;
105
145
  border-bottom: 1px solid #ccd6db;
106
146
  ${({
107
147
  showCloseIcon
@@ -133,12 +173,19 @@ const DialogContentStyle = _styledComponents.default.div`
133
173
  overflow-y: auto;
134
174
  width: 100%;
135
175
  flex: 1;
136
- padding: 0px ${HORIZONTAL_PADDING}px ${CONTENT_BOTTOM_PADDING}px;
176
+ padding: 0px ${_dialog.HORIZONTAL_PADDING}px ${_dialog.CONTENT_BOTTOM_PADDING}px;
177
+ ${_styledSystem.padding}
137
178
  `;
138
179
  exports.DialogContentStyle = DialogContentStyle;
139
180
  const DialogInnerContentStyle = _styledComponents.default.div`
140
- padding-top: 20px;
141
181
  position: relative;
142
182
  flex: 1;
183
+ padding-top: ${calculatePaddingTopInnerContent};
143
184
  `;
144
- exports.DialogInnerContentStyle = DialogInnerContentStyle;
185
+ exports.DialogInnerContentStyle = DialogInnerContentStyle;
186
+ DialogStyle.defaultProps = {
187
+ theme: _base.default
188
+ };
189
+ DialogContentStyle.defaultProps = {
190
+ theme: _base.default
191
+ };
@@ -27,6 +27,8 @@ var _iconButton = _interopRequireDefault(require("../icon-button"));
27
27
 
28
28
  var _icon = _interopRequireDefault(require("../icon"));
29
29
 
30
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
31
+
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
33
 
32
34
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -56,6 +58,7 @@ const DialogFullScreen = ({
56
58
  role = "dialog",
57
59
  ...rest
58
60
  }) => {
61
+ const locale = (0, _useLocale.default)();
59
62
  const dialogRef = (0, _react.useRef)();
60
63
  const headingRef = (0, _react.useRef)();
61
64
  const {
@@ -69,7 +72,7 @@ const DialogFullScreen = ({
69
72
  if (!showCloseIcon || !onCancel) return null;
70
73
  return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
71
74
  "data-element": "close",
72
- "aria-label": "Close button",
75
+ "aria-label": locale.dialogFullScreen.ariaLabels.close(),
73
76
  onAction: onCancel
74
77
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
75
78
  type: "close"
@@ -121,7 +121,7 @@ const Icon = /*#__PURE__*/_react.default.forwardRef(({
121
121
 
122
122
  if (tooltipMessage) {
123
123
  const showTooltip = tooltipVisibleFromContext !== undefined ? tooltipVisibleFromContext : tooltipVisible;
124
- const visible = disabled ? false : showTooltip;
124
+ const visible = disabled ? undefined : showTooltip;
125
125
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
126
126
  message: tooltipMessage,
127
127
  position: tooltipPositionFromContext || tooltipPosition,
@@ -25,6 +25,8 @@ var _box = _interopRequireDefault(require("../box"));
25
25
 
26
26
  var _sidebar2 = require("./sidebar.config");
27
27
 
28
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
30
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -52,13 +54,14 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
52
54
  role = "dialog",
53
55
  ...rest
54
56
  }, ref) => {
57
+ const locale = (0, _useLocale.default)();
55
58
  let sidebarRef = (0, _react.useRef)();
56
59
  if (ref) sidebarRef = ref;
57
60
 
58
61
  const closeIcon = () => {
59
62
  if (!onCancel) return null;
60
63
  return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
61
- "aria-label": "close",
64
+ "aria-label": locale.sidebar.ariaLabels.close(),
62
65
  onAction: onCancel,
63
66
  "data-element": "close"
64
67
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
@@ -25,6 +25,8 @@ var _modalManager = _interopRequireDefault(require("../modal/__internal__/modal-
25
25
 
26
26
  var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
27
27
 
28
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
29
+
28
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
31
 
30
32
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -47,6 +49,7 @@ const Toast = ({
47
49
  variant,
48
50
  ...restProps
49
51
  }) => {
52
+ const locale = (0, _useLocale.default)();
50
53
  const toastRef = (0, _react.useRef)();
51
54
  const timer = (0, _react.useRef)();
52
55
  const componentClasses = (0, _react.useMemo)(() => {
@@ -85,6 +88,7 @@ const Toast = ({
85
88
  function renderCloseIcon() {
86
89
  if (!onDismiss) return null;
87
90
  return /*#__PURE__*/_react.default.createElement(_iconButton.default, {
91
+ "aria-label": locale.toast.ariaLabels.close(),
88
92
  "data-element": "close",
89
93
  onAction: onDismiss
90
94
  }, /*#__PURE__*/_react.default.createElement(_icon.default, {
@@ -28,6 +28,16 @@ var _default = {
28
28
  date: {
29
29
  dateFnsLocale: () => _dateFnsLocales.enGB
30
30
  },
31
+ dialog: {
32
+ ariaLabels: {
33
+ close: () => "Close"
34
+ }
35
+ },
36
+ dialogFullScreen: {
37
+ ariaLabels: {
38
+ close: () => "Close"
39
+ }
40
+ },
31
41
  errors: {
32
42
  messages: {
33
43
  formSummary:
@@ -85,6 +95,11 @@ var _default = {
85
95
  link: {
86
96
  skipLinkLabel: () => "Skip to main content"
87
97
  },
98
+ sidebar: {
99
+ ariaLabels: {
100
+ close: () => "Close"
101
+ }
102
+ },
88
103
  switch: {
89
104
  on: () => "ON",
90
105
  off: () => "OFF"
@@ -106,6 +121,11 @@ var _default = {
106
121
  tileSelect: {
107
122
  deselect: () => "Deselect"
108
123
  },
124
+ toast: {
125
+ ariaLabels: {
126
+ close: () => "Close"
127
+ }
128
+ },
109
129
  wizards: {
110
130
  multiStep: {
111
131
  buttons: {
@@ -19,6 +19,16 @@ interface Locale {
19
19
  date: {
20
20
  dateFnsLocale: () => DateFnsLocale;
21
21
  };
22
+ dialog: {
23
+ ariaLabels: {
24
+ close: () => string;
25
+ };
26
+ };
27
+ dialogFullScreen: {
28
+ ariaLabels: {
29
+ close: () => string;
30
+ };
31
+ };
22
32
  errors: {
23
33
  messages: {
24
34
  formSummary: (
@@ -53,6 +63,14 @@ interface Locale {
53
63
  placeholder: () => string;
54
64
  noResultsForTerm: (term: string) => string;
55
65
  };
66
+ link: {
67
+ skipLinkLabel: () => string;
68
+ };
69
+ sidebar: {
70
+ ariaLabels: {
71
+ close: () => string;
72
+ };
73
+ };
56
74
  switch: {
57
75
  on: () => string;
58
76
  off: () => string;
@@ -74,6 +92,11 @@ interface Locale {
74
92
  tileSelect: {
75
93
  deselect: () => string;
76
94
  };
95
+ toast: {
96
+ ariaLabels: {
97
+ close: () => string;
98
+ };
99
+ };
77
100
  wizards: {
78
101
  multiStep: {
79
102
  buttons: {
@@ -28,6 +28,16 @@ var _default = {
28
28
  date: {
29
29
  dateFnsLocale: () => _dateFnsLocales.pl
30
30
  },
31
+ dialog: {
32
+ ariaLabels: {
33
+ close: () => "Zamknij"
34
+ }
35
+ },
36
+ dialogFullScreen: {
37
+ ariaLabels: {
38
+ close: () => "Zamknij"
39
+ }
40
+ },
31
41
  errors: {
32
42
  messages: {
33
43
  formSummary:
@@ -83,6 +93,11 @@ var _default = {
83
93
  link: {
84
94
  skipLinkLabel: () => "Przejdź do treści"
85
95
  },
96
+ sidebar: {
97
+ ariaLabels: {
98
+ close: () => "Zamknij"
99
+ }
100
+ },
86
101
  switch: {
87
102
  on: () => "WŁ",
88
103
  off: () => "WYŁ"
@@ -104,6 +119,11 @@ var _default = {
104
119
  tileSelect: {
105
120
  deselect: () => "Odznacz"
106
121
  },
122
+ toast: {
123
+ ariaLabels: {
124
+ close: () => "Zamknij"
125
+ }
126
+ },
107
127
  wizards: {
108
128
  multiStep: {
109
129
  buttons: {
@@ -471,6 +471,7 @@ declare function _default(palette: any): {
471
471
  colorsUtilityMajor500: string;
472
472
  colorsUtilityMajor800: string;
473
473
  colorsUtilityMajor025: string;
474
+ colorsUtilityMajor010: string;
474
475
  colorsUtilityMajor040: string;
475
476
  colorsUtilityMajor050: string;
476
477
  colorsUtilityMajor075: string;
@@ -570,6 +571,7 @@ declare function _default(palette: any): {
570
571
  sizing350: string;
571
572
  sizing375: string;
572
573
  sizing400: string;
574
+ sizing450: string;
573
575
  sizing500: string;
574
576
  sizing600: string;
575
577
  sizing700: string;
@@ -605,6 +607,7 @@ declare function _default(palette: any): {
605
607
  boxShadow200: string;
606
608
  boxShadow300: string;
607
609
  boxShadow400: string;
610
+ boxShadow075: string;
608
611
  boxShadow050: string;
609
612
  fontWeights400: string;
610
613
  fontWeights500: string;
@@ -626,6 +629,9 @@ declare function _default(palette: any): {
626
629
  typographyButtonLabelS: string;
627
630
  typographyButtonLabelM: string;
628
631
  typographyButtonLabelL: string;
632
+ typographyDatePickerCalendarDateM: string;
633
+ typographyDatePickerCalendarDayM: string;
634
+ typographyDatePickerCalendarMonthM: string;
629
635
  typographyDialogTitleXs: string;
630
636
  typographyDialogTitleS: string;
631
637
  typographyDialogTitleMs: string;
@@ -678,6 +684,7 @@ declare function _default(palette: any): {
678
684
  typographyMessageHeadingL: string;
679
685
  typographyMessageTextM: string;
680
686
  typographyMessageTextL: string;
687
+ typographyPaginationLabelM: string;
681
688
  typographyPillLabelS: string;
682
689
  typographyPillLabelM: string;
683
690
  typographyPillLabelL: string;
@@ -88,6 +88,7 @@ declare var _default: {
88
88
  colorsUtilityMajor500: string;
89
89
  colorsUtilityMajor800: string;
90
90
  colorsUtilityMajor025: string;
91
+ colorsUtilityMajor010: string;
91
92
  colorsUtilityMajor040: string;
92
93
  colorsUtilityMajor050: string;
93
94
  colorsUtilityMajor075: string;
@@ -196,6 +197,7 @@ declare var _default: {
196
197
  sizing350: string;
197
198
  sizing375: string;
198
199
  sizing400: string;
200
+ sizing450: string;
199
201
  sizing500: string;
200
202
  sizing600: string;
201
203
  sizing700: string;
@@ -248,6 +250,7 @@ declare var _default: {
248
250
  boxShadow200: string;
249
251
  boxShadow300: string;
250
252
  boxShadow400: string;
253
+ boxShadow075: string;
251
254
  boxShadow050: string;
252
255
  fontWeights400: string;
253
256
  fontWeights500: string;
@@ -269,6 +272,9 @@ declare var _default: {
269
272
  typographyButtonLabelS: string;
270
273
  typographyButtonLabelM: string;
271
274
  typographyButtonLabelL: string;
275
+ typographyDatePickerCalendarDateM: string;
276
+ typographyDatePickerCalendarDayM: string;
277
+ typographyDatePickerCalendarMonthM: string;
272
278
  typographyDialogTitleXs: string;
273
279
  typographyDialogTitleS: string;
274
280
  typographyDialogTitleMs: string;
@@ -321,6 +327,7 @@ declare var _default: {
321
327
  typographyMessageHeadingL: string;
322
328
  typographyMessageTextM: string;
323
329
  typographyMessageTextL: string;
330
+ typographyPaginationLabelM: string;
324
331
  typographyPillLabelS: string;
325
332
  typographyPillLabelM: string;
326
333
  typographyPillLabelL: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.7.3",
3
+ "version": "104.10.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -156,7 +156,7 @@
156
156
  "dependencies": {
157
157
  "@octokit/rest": "^18.12.0",
158
158
  "@popperjs/core": "^2.9.0",
159
- "@sage/design-tokens": "^1.89.0",
159
+ "@sage/design-tokens": "^1.91.0",
160
160
  "@styled-system/prop-types": "^5.1.5",
161
161
  "@tippyjs/react": "^4.2.5",
162
162
  "@types/styled-system": "^5.1.11",