carbon-react 102.2.0 → 102.4.2

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.
@@ -40,7 +40,7 @@ Alert.propTypes = {
40
40
  height: _propTypes.default.string,
41
41
 
42
42
  /** Title displayed at top of Alert */
43
- title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
43
+ title: _propTypes.default.node,
44
44
 
45
45
  /** Subtitle displayed at top of Alert */
46
46
  subtitle: _propTypes.default.string,
@@ -200,7 +200,7 @@ Dialog.propTypes = {
200
200
  /** Dialog content */
201
201
  children: _propTypes.default.node,
202
202
 
203
- /** Custom classname */
203
+ /** Custom class name */
204
204
  className: _propTypes.default.string,
205
205
 
206
206
  /** Controls the open state of the component */
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import Modal, { ModalProps } from "../modal/modal";
2
+ import { ModalProps } from "../modal/modal";
3
3
 
4
4
  export interface DialogProps extends ModalProps {
5
5
  /* Disables auto focus functionality on child elements */
@@ -24,6 +24,6 @@ export interface DialogProps extends ModalProps {
24
24
  title?: React.ReactNode;
25
25
  }
26
26
 
27
- declare class Dialog extends Modal<DialogProps> {}
27
+ declare function Dialog(props: DialogProps): JSX.Element;
28
28
 
29
29
  export default Dialog;
@@ -41,7 +41,6 @@ const DismissibleBox = ({
41
41
  p: "20px 24px 20px 20px",
42
42
  hasBorderLeftHighlight: hasBorderLeftHighlight
43
43
  }, rest, {
44
- minWidth: "600px",
45
44
  display: "flex",
46
45
  justifyContent: "space-between"
47
46
  }), children, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
@@ -1,9 +1,8 @@
1
1
  import * as React from "react";
2
- import { SpaceProps } from "styled-system";
2
+ import { BoxProps } from "components/box/box";
3
3
 
4
- type BorderOptions = "top" | "bottom" | "right" | "none";
5
-
6
- export interface DismissibleBoxProps extends SpaceProps {
4
+ export interface DismissibleBoxProps
5
+ extends Omit<BoxProps, "display" | "justifyContent"> {
7
6
  /** Flag to control whether the thicker left border highlight should be rendered */
8
7
  hasBorderLeftHighlight?: boolean;
9
8
  /** The content to render in the component */
@@ -37,8 +37,8 @@ const StyledLink = _styledComponents.default.span`
37
37
  line-height: 36px;
38
38
  left: -999em;
39
39
  z-index: ${theme.zIndex.aboveAll};
40
- box-shadow: inset 0 0 0 2px ${theme.colors.primary};
41
- border: 2px solid ${theme.colors.white};
40
+ box-shadow: inset 0 0 0 2px var(--colorsActionMajor500);
41
+ border: 2px solid var(--colorsYang100);
42
42
  }
43
43
 
44
44
  a:focus {
@@ -51,38 +51,38 @@ const StyledLink = _styledComponents.default.span`
51
51
  button {
52
52
  font-size: ${isSkipLink ? "16px" : "14px"};
53
53
  text-decoration: underline;
54
- color: ${isSkipLink ? theme.text.color : theme.colors.primary};
54
+ color: ${isSkipLink ? "var(--colorsYin090)" : "var(--colorsActionMajor500)"};
55
55
  display: inline-block;
56
56
  ${_icon.default} {
57
57
  display: inline-block;
58
58
  position: relative;
59
59
  vertical-align: middle;
60
60
  ${iconAlign === "left" && (0, _styledComponents.css)`
61
- margin-right: ${hasContent ? "5px" : 0};
61
+ margin-right: ${hasContent ? "var(--spacing100)" : 0};
62
62
  `}
63
63
  ${iconAlign === "right" && (0, _styledComponents.css)`
64
64
  margin-right: 0;
65
- margin-left: ${hasContent ? "5px" : 0};
65
+ margin-left: ${hasContent ? "var(--spacing100)" : 0};
66
66
  `}
67
67
  }
68
68
 
69
69
  &:hover {
70
70
  cursor: pointer;
71
- color: ${isSkipLink ? theme.text.color : theme.colors.secondary};
71
+ color: ${isSkipLink ? "var(--colorsYin090)" : "var(--colorsActionMajor600)"};
72
72
  }
73
73
 
74
74
  &:focus {
75
- color: ${theme.text.color};
76
- background-color: ${isSkipLink ? theme.colors.white : theme.colors.focusedLinkBackground};
75
+ color: var(--colorsYin090);
76
+ background-color: ${isSkipLink ? "var(--colorsYang100)" : "var(--colorsSemanticFocus250)"};
77
77
  outline: none;
78
78
  }
79
79
 
80
80
  ${disabled && (0, _styledComponents.css)`
81
- color: ${theme.disabled.text};
81
+ color: var(--colorsYin065);
82
82
  &:hover,
83
83
  &:focus {
84
84
  cursor: not-allowed;
85
- color: ${theme.disabled.text};
85
+ color: var(--colorsYin065);
86
86
  }
87
87
  `}
88
88
  }
@@ -21,18 +21,21 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
21
21
 
22
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; }
23
23
 
24
+ const messageVariants = {
25
+ error: "var(--colorsSemanticNegative500)",
26
+ info: "var(--colorsSemanticNeutral500)",
27
+ success: "var(--colorsSemanticPositive500)",
28
+ warning: "var(--colorsSemanticCaution500)"
29
+ };
24
30
  const MessageStyle = _styledComponents.default.div`
25
31
  position: relative;
26
32
  display: flex;
27
33
  justify-content: flex-start;
28
34
  align-content: center;
29
35
  border: 1px solid ${({
30
- theme,
31
36
  variant
32
- }) => theme.colors[variant]};
33
- background-color: ${({
34
- theme
35
- }) => theme.colors.white};
37
+ }) => messageVariants[variant]};
38
+ background-color: var(--colorsUtilityYang100);
36
39
  min-height: 38px;
37
40
 
38
41
  ${({
@@ -9,20 +9,23 @@ 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
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
13
 
16
14
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
17
15
 
18
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; }
19
17
 
18
+ const messageVariants = {
19
+ error: "var(--colorsSemanticNegative500)",
20
+ info: "var(--colorsSemanticNeutral500)",
21
+ success: "var(--colorsSemanticPositive500)",
22
+ warning: "var(--colorsSemanticCaution500)"
23
+ };
20
24
  const TypeIconStyle = _styledComponents.default.div`
21
25
  align-items: center;
22
26
  background-color: ${({
23
- theme,
24
27
  variant
25
- }) => theme.colors[variant]};
28
+ }) => messageVariants[variant]};
26
29
  display: flex;
27
30
  justify-content: center;
28
31
  line-height: 100%;
@@ -30,28 +33,24 @@ const TypeIconStyle = _styledComponents.default.div`
30
33
  text-align: center;
31
34
  span {
32
35
  &:before {
33
- color: ${({
34
- theme
35
- }) => theme.colors.white};
36
+ color: var(--colorsUtilityYang100);
36
37
  }
37
38
  }
38
39
 
39
40
  ${({
40
- theme,
41
41
  transparent,
42
42
  variant
43
43
  }) => transparent && (0, _styledComponents.css)`
44
44
  background-color: transparent;
45
45
  span {
46
46
  &:before {
47
- color: ${theme.colors[variant]};
47
+ color: ${messageVariants[variant]};
48
48
  }
49
49
  }
50
50
  `}
51
51
  `;
52
52
  TypeIconStyle.defaultProps = {
53
53
  variant: "info",
54
- theme: _base.default,
55
54
  transparent: false
56
55
  };
57
56
  TypeIconStyle.propTypes = {
@@ -1,21 +1,24 @@
1
1
  import * as React from "react";
2
2
 
3
3
  export interface ModalProps {
4
+ /** Modal content */
5
+ children?: React.ReactNode;
4
6
  /** The ARIA role to be applied to the modal */
5
7
  ariaRole?: string;
6
8
  /** Determines if the Esc Key closes the modal */
7
9
  disableEscKey?: boolean;
10
+ /** Determines if the Dialog can be closed */
11
+ disableClose?: boolean;
8
12
  /** Determines if the background is disabled when the modal is open */
9
13
  enableBackgroundUI?: boolean;
10
14
  /** A custom close event handler */
11
15
  onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
12
16
  /** Sets the open state of the modal */
13
17
  open: boolean;
18
+ /** Transition time */
19
+ timeout?: number;
14
20
  }
15
21
 
16
- declare class Modal<T extends ModalProps> extends React.Component<
17
- T,
18
- Record<string, unknown>
19
- > {}
22
+ declare function Modal(props: ModalProps): JSX.Element;
20
23
 
21
24
  export default Modal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "102.2.0",
3
+ "version": "102.4.2",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {