carbon-react 104.58.6 → 105.0.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.
Files changed (50) hide show
  1. package/esm/components/message/message-content/message-content.component.d.ts +3 -13
  2. package/esm/components/message/message-content/message-content.component.js +1 -12
  3. package/esm/components/message/message.component.js +1 -3
  4. package/esm/components/message/message.d.ts +1 -9
  5. package/esm/components/message/type-icon/type-icon.component.js +1 -1
  6. package/esm/components/message/type-icon/type-icon.style.js +1 -1
  7. package/esm/components/pager/pager.component.js +1 -2
  8. package/esm/components/toast/toast.component.js +3 -3
  9. package/esm/components/toast/toast.config.js +1 -1
  10. package/esm/components/toast/toast.d.ts +4 -18
  11. package/lib/components/message/message-content/message-content.component.d.ts +3 -13
  12. package/lib/components/message/message-content/message-content.component.js +1 -12
  13. package/lib/components/message/message.component.js +1 -3
  14. package/lib/components/message/message.d.ts +1 -9
  15. package/lib/components/message/type-icon/type-icon.component.js +1 -1
  16. package/lib/components/message/type-icon/type-icon.style.js +1 -1
  17. package/lib/components/pager/pager.component.js +1 -2
  18. package/lib/components/toast/toast.component.js +3 -3
  19. package/lib/components/toast/toast.config.js +1 -1
  20. package/lib/components/toast/toast.d.ts +4 -18
  21. package/package.json +1 -1
  22. package/esm/components/row/column/column.component.d.ts +0 -30
  23. package/esm/components/row/column/column.component.js +0 -72
  24. package/esm/components/row/column/column.d.ts +0 -22
  25. package/esm/components/row/column/column.style.d.ts +0 -2
  26. package/esm/components/row/column/column.style.js +0 -32
  27. package/esm/components/row/index.d.ts +0 -2
  28. package/esm/components/row/index.js +0 -2
  29. package/esm/components/row/row.component.d.ts +0 -24
  30. package/esm/components/row/row.component.js +0 -59
  31. package/esm/components/row/row.config.d.ts +0 -11
  32. package/esm/components/row/row.config.js +0 -12
  33. package/esm/components/row/row.d.ts +0 -27
  34. package/esm/components/row/row.style.d.ts +0 -2
  35. package/esm/components/row/row.style.js +0 -53
  36. package/lib/components/row/column/column.component.d.ts +0 -30
  37. package/lib/components/row/column/column.component.js +0 -87
  38. package/lib/components/row/column/column.d.ts +0 -22
  39. package/lib/components/row/column/column.style.d.ts +0 -2
  40. package/lib/components/row/column/column.style.js +0 -45
  41. package/lib/components/row/index.d.ts +0 -2
  42. package/lib/components/row/index.js +0 -23
  43. package/lib/components/row/package.json +0 -6
  44. package/lib/components/row/row.component.d.ts +0 -24
  45. package/lib/components/row/row.component.js +0 -73
  46. package/lib/components/row/row.config.d.ts +0 -11
  47. package/lib/components/row/row.config.js +0 -20
  48. package/lib/components/row/row.d.ts +0 -27
  49. package/lib/components/row/row.style.d.ts +0 -2
  50. package/lib/components/row/row.style.js +0 -71
@@ -1,22 +1,12 @@
1
1
  export default MessageContent;
2
- declare function MessageContent({ variant, title, transparent, children }: {
3
- variant: any;
2
+ declare function MessageContent({ title, children }: {
4
3
  title: any;
5
- transparent: any;
6
4
  children: any;
7
5
  }): JSX.Element;
8
6
  declare namespace MessageContent {
9
- namespace defaultProps {
10
- const variant: string;
11
- const transparent: boolean;
12
- }
13
7
  namespace propTypes {
14
- const variant_1: PropTypes.Requireable<string>;
15
- export { variant_1 as variant };
16
- export const title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
- const transparent_1: PropTypes.Requireable<boolean>;
18
- export { transparent_1 as transparent };
19
- export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
+ const title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
10
  }
21
11
  }
22
12
  import PropTypes from "prop-types";
@@ -4,28 +4,17 @@ import Content from "../../content/content.component.js";
4
4
  import MessageContentStyle from "./message-content.style";
5
5
 
6
6
  const MessageContent = ({
7
- variant,
8
7
  title,
9
- transparent,
10
8
  children
11
9
  }) => {
12
- return /*#__PURE__*/React.createElement(MessageContentStyle, {
13
- variant: variant,
14
- transparent: transparent
15
- }, /*#__PURE__*/React.createElement(Content, {
10
+ return /*#__PURE__*/React.createElement(MessageContentStyle, null, /*#__PURE__*/React.createElement(Content, {
16
11
  title: title,
17
12
  className: "message-content"
18
13
  }, children));
19
14
  };
20
15
 
21
- MessageContent.defaultProps = {
22
- variant: "info",
23
- transparent: false
24
- };
25
16
  MessageContent.propTypes = {
26
- variant: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
27
17
  title: PropTypes.node,
28
- transparent: PropTypes.bool,
29
18
  children: PropTypes.node
30
19
  };
31
20
  export default MessageContent;
@@ -51,8 +51,6 @@ const Message = ({
51
51
  variant: variant,
52
52
  transparent: transparent
53
53
  }), /*#__PURE__*/React.createElement(MessageContent, {
54
- variant: variant,
55
- transparent: transparent,
56
54
  title: title
57
55
  }, children), renderCloseIcon());
58
56
  };
@@ -60,7 +58,7 @@ const Message = ({
60
58
  Message.propTypes = { ...marginPropTypes,
61
59
 
62
60
  /** set type of message based on new DLS standard */
63
- variant: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
61
+ variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
64
62
 
65
63
  /** set content to component */
66
64
  children: PropTypes.node,
@@ -21,15 +21,7 @@ export interface MessageProps extends MarginProps {
21
21
  /** set background to be invisible */
22
22
  transparent?: boolean;
23
23
  /** set type of message based on new DLS standard */
24
- variant?:
25
- | "default"
26
- | "error"
27
- | "help"
28
- | "info"
29
- | "maintenance"
30
- | "new"
31
- | "success"
32
- | "warning";
24
+ variant?: "error" | "info" | "success" | "warning";
33
25
  }
34
26
 
35
27
  declare function Message(props: MessageProps): JSX.Element;
@@ -20,7 +20,7 @@ TypeIcon.defaultProps = {
20
20
  transparent: false
21
21
  };
22
22
  TypeIcon.propTypes = {
23
- variant: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
23
+ variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
24
24
  transparent: PropTypes.bool
25
25
  };
26
26
  export default TypeIcon;
@@ -39,7 +39,7 @@ TypeIconStyle.defaultProps = {
39
39
  transparent: false
40
40
  };
41
41
  TypeIconStyle.propTypes = {
42
- variant: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
42
+ variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
43
43
  border: PropTypes.bool,
44
44
  transparent: PropTypes.bool
45
45
  };
@@ -110,8 +110,7 @@ const Pager = ({
110
110
  onChange: ev => setValue(ev.target.value),
111
111
  onBlur: () => setValue(currentPageSize),
112
112
  onKeyDown: handleKeyDown,
113
- "data-element": "page-select",
114
- id: "page-select"
113
+ "data-element": "page-select"
115
114
  }, pageSizeSelectionOptions.map(sizeOption => /*#__PURE__*/React.createElement(Option, {
116
115
  key: sizeOption.id,
117
116
  text: sizeOption.id,
@@ -13,7 +13,7 @@ import Events from "../../__internal__/utils/helpers/events";
13
13
  import useLocale from "../../hooks/__internal__/useLocale";
14
14
 
15
15
  const Toast = ({
16
- as = "warning",
16
+ as = "success",
17
17
  children,
18
18
  className,
19
19
  id,
@@ -109,10 +109,10 @@ const Toast = ({
109
109
 
110
110
  Toast.propTypes = {
111
111
  /** Customizes the appearance in the DLS theme */
112
- variant: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
112
+ variant: PropTypes.oneOf(["error", "info", "success", "warning"]),
113
113
 
114
114
  /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
115
- as: PropTypes.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
115
+ as: PropTypes.oneOf(["error", "info", "success", "warning"]),
116
116
 
117
117
  /** Custom className */
118
118
  className: PropTypes.string,
@@ -1,2 +1,2 @@
1
1
  // eslint-disable-next-line import/prefer-default-export
2
- export const TOAST_COLORS = ["default", "error", "help", "info", "maintenance", "new", "success", "warning"];
2
+ export const TOAST_COLORS = ["error", "info", "success", "warning"];
@@ -1,28 +1,14 @@
1
1
  import * as React from "react";
2
2
 
3
+ type ToastVariants = "error" | "info" | "success" | "warning";
4
+
3
5
  export interface ToastPropTypes {
4
6
  /** The rendered children of the component. */
5
7
  children: React.ReactNode;
6
8
  /** Customizes the appearance in the DLS theme */
7
- variant?:
8
- | "default"
9
- | "error"
10
- | "help"
11
- | "info"
12
- | "maintenance"
13
- | "new"
14
- | "success"
15
- | "warning";
9
+ variant?: ToastVariants;
16
10
  /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
17
- as?:
18
- | "default"
19
- | "error"
20
- | "help"
21
- | "info"
22
- | "maintenance"
23
- | "new"
24
- | "success"
25
- | "warning";
11
+ as?: ToastVariants;
26
12
  /** Custom className */
27
13
  className?: string;
28
14
  /** Custom id */
@@ -1,22 +1,12 @@
1
1
  export default MessageContent;
2
- declare function MessageContent({ variant, title, transparent, children }: {
3
- variant: any;
2
+ declare function MessageContent({ title, children }: {
4
3
  title: any;
5
- transparent: any;
6
4
  children: any;
7
5
  }): JSX.Element;
8
6
  declare namespace MessageContent {
9
- namespace defaultProps {
10
- const variant: string;
11
- const transparent: boolean;
12
- }
13
7
  namespace propTypes {
14
- const variant_1: PropTypes.Requireable<string>;
15
- export { variant_1 as variant };
16
- export const title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
- const transparent_1: PropTypes.Requireable<boolean>;
18
- export { transparent_1 as transparent };
19
- export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
+ const title: PropTypes.Requireable<PropTypes.ReactNodeLike>;
9
+ const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
10
  }
21
11
  }
22
12
  import PropTypes from "prop-types";
@@ -16,28 +16,17 @@ var _messageContent = _interopRequireDefault(require("./message-content.style"))
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
18
  const MessageContent = ({
19
- variant,
20
19
  title,
21
- transparent,
22
20
  children
23
21
  }) => {
24
- return /*#__PURE__*/_react.default.createElement(_messageContent.default, {
25
- variant: variant,
26
- transparent: transparent
27
- }, /*#__PURE__*/_react.default.createElement(_contentComponent.default, {
22
+ return /*#__PURE__*/_react.default.createElement(_messageContent.default, null, /*#__PURE__*/_react.default.createElement(_contentComponent.default, {
28
23
  title: title,
29
24
  className: "message-content"
30
25
  }, children));
31
26
  };
32
27
 
33
- MessageContent.defaultProps = {
34
- variant: "info",
35
- transparent: false
36
- };
37
28
  MessageContent.propTypes = {
38
- variant: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
39
29
  title: _propTypes.default.node,
40
- transparent: _propTypes.default.bool,
41
30
  children: _propTypes.default.node
42
31
  };
43
32
  var _default = MessageContent;
@@ -71,8 +71,6 @@ const Message = ({
71
71
  variant: variant,
72
72
  transparent: transparent
73
73
  }), /*#__PURE__*/_react.default.createElement(_messageContent.default, {
74
- variant: variant,
75
- transparent: transparent,
76
74
  title: title
77
75
  }, children), renderCloseIcon());
78
76
  };
@@ -80,7 +78,7 @@ const Message = ({
80
78
  Message.propTypes = { ...marginPropTypes,
81
79
 
82
80
  /** set type of message based on new DLS standard */
83
- variant: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
81
+ variant: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
84
82
 
85
83
  /** set content to component */
86
84
  children: _propTypes.default.node,
@@ -21,15 +21,7 @@ export interface MessageProps extends MarginProps {
21
21
  /** set background to be invisible */
22
22
  transparent?: boolean;
23
23
  /** set type of message based on new DLS standard */
24
- variant?:
25
- | "default"
26
- | "error"
27
- | "help"
28
- | "info"
29
- | "maintenance"
30
- | "new"
31
- | "success"
32
- | "warning";
24
+ variant?: "error" | "info" | "success" | "warning";
33
25
  }
34
26
 
35
27
  declare function Message(props: MessageProps): JSX.Element;
@@ -32,7 +32,7 @@ TypeIcon.defaultProps = {
32
32
  transparent: false
33
33
  };
34
34
  TypeIcon.propTypes = {
35
- variant: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
35
+ variant: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
36
36
  transparent: _propTypes.default.bool
37
37
  };
38
38
  var _default = TypeIcon;
@@ -54,7 +54,7 @@ TypeIconStyle.defaultProps = {
54
54
  transparent: false
55
55
  };
56
56
  TypeIconStyle.propTypes = {
57
- variant: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
57
+ variant: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
58
58
  border: _propTypes.default.bool,
59
59
  transparent: _propTypes.default.bool
60
60
  };
@@ -130,8 +130,7 @@ const Pager = ({
130
130
  onChange: ev => setValue(ev.target.value),
131
131
  onBlur: () => setValue(currentPageSize),
132
132
  onKeyDown: handleKeyDown,
133
- "data-element": "page-select",
134
- id: "page-select"
133
+ "data-element": "page-select"
135
134
  }, pageSizeSelectionOptions.map(sizeOption => /*#__PURE__*/_react.default.createElement(_option.default, {
136
135
  key: sizeOption.id,
137
136
  text: sizeOption.id,
@@ -36,7 +36,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
36
36
  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); }
37
37
 
38
38
  const Toast = ({
39
- as = "warning",
39
+ as = "success",
40
40
  children,
41
41
  className,
42
42
  id,
@@ -135,10 +135,10 @@ const Toast = ({
135
135
 
136
136
  Toast.propTypes = {
137
137
  /** Customizes the appearance in the DLS theme */
138
- variant: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
138
+ variant: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
139
139
 
140
140
  /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
141
- as: _propTypes.default.oneOf(["default", "error", "help", "info", "maintenance", "new", "success", "warning"]),
141
+ as: _propTypes.default.oneOf(["error", "info", "success", "warning"]),
142
142
 
143
143
  /** Custom className */
144
144
  className: _propTypes.default.string,
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.TOAST_COLORS = void 0;
7
7
  // eslint-disable-next-line import/prefer-default-export
8
- const TOAST_COLORS = ["default", "error", "help", "info", "maintenance", "new", "success", "warning"];
8
+ const TOAST_COLORS = ["error", "info", "success", "warning"];
9
9
  exports.TOAST_COLORS = TOAST_COLORS;
@@ -1,28 +1,14 @@
1
1
  import * as React from "react";
2
2
 
3
+ type ToastVariants = "error" | "info" | "success" | "warning";
4
+
3
5
  export interface ToastPropTypes {
4
6
  /** The rendered children of the component. */
5
7
  children: React.ReactNode;
6
8
  /** Customizes the appearance in the DLS theme */
7
- variant?:
8
- | "default"
9
- | "error"
10
- | "help"
11
- | "info"
12
- | "maintenance"
13
- | "new"
14
- | "success"
15
- | "warning";
9
+ variant?: ToastVariants;
16
10
  /** Customizes the appearance in a legacy theme through colour (see the 'iconColorSets' for possible values) */
17
- as?:
18
- | "default"
19
- | "error"
20
- | "help"
21
- | "info"
22
- | "maintenance"
23
- | "new"
24
- | "success"
25
- | "warning";
11
+ as?: ToastVariants;
26
12
  /** Custom className */
27
13
  className?: string;
28
14
  /** Custom id */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "104.58.6",
3
+ "version": "105.0.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -1,30 +0,0 @@
1
- export default Column;
2
- declare function Column({ columnAlign, columns, columnSpan, columnOffset, columnClasses, className, ...props }: {
3
- [x: string]: any;
4
- columnAlign: any;
5
- columns: any;
6
- columnSpan: any;
7
- columnOffset: any;
8
- columnClasses: any;
9
- className: any;
10
- }): JSX.Element;
11
- declare namespace Column {
12
- namespace defaultProps {
13
- const columnOffset: string;
14
- const columnSpan: string;
15
- const columnAlign: string;
16
- }
17
- namespace propTypes {
18
- export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
19
- export const className: PropTypes.Requireable<string>;
20
- export const columns: PropTypes.Requireable<string | number>;
21
- export const columnClasses: PropTypes.Requireable<string>;
22
- const columnAlign_1: PropTypes.Requireable<string>;
23
- export { columnAlign_1 as columnAlign };
24
- const columnOffset_1: PropTypes.Requireable<string | number>;
25
- export { columnOffset_1 as columnOffset };
26
- const columnSpan_1: PropTypes.Requireable<string | number>;
27
- export { columnSpan_1 as columnSpan };
28
- }
29
- }
30
- import PropTypes from "prop-types";
@@ -1,72 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import classNames from "classnames";
4
- import StyledColumn from "./column.style";
5
- import Logger from "../../../__internal__/utils/logger";
6
- let deprecatedWarnTriggered = false;
7
-
8
- const Column = ({
9
- columnAlign,
10
- columns,
11
- columnSpan,
12
- columnOffset,
13
- columnClasses,
14
- className,
15
- ...props
16
- }) => {
17
- if (!deprecatedWarnTriggered) {
18
- deprecatedWarnTriggered = true; // eslint-disable-next-line max-len
19
-
20
- Logger.deprecate("`Column` component is deprecated and will soon be removed.");
21
- }
22
-
23
- return /*#__PURE__*/React.createElement(StyledColumn, {
24
- columnAlign: columnAlign,
25
- className: classNames(className, columnClasses),
26
- columns: columns,
27
- columnSpan: columnSpan,
28
- columnOffset: columnOffset,
29
- "data-component": "column"
30
- }, props.children);
31
- };
32
-
33
- Column.defaultProps = {
34
- columnOffset: "0",
35
- columnSpan: "1",
36
- columnAlign: "left"
37
- };
38
- /* eslint-disable react/no-unused-prop-types */
39
-
40
- Column.propTypes = {
41
- /** Content. */
42
- children: PropTypes.node,
43
-
44
- /** Classes to apply to the component. */
45
- className: PropTypes.string,
46
-
47
- /**
48
- * @private
49
- * @ignore
50
- */
51
-
52
- /** Total column count */
53
- columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
54
-
55
- /**
56
- * @private
57
- * @ignore
58
- */
59
-
60
- /** Classes applied by row component to affect all rows */
61
- columnClasses: PropTypes.string,
62
-
63
- /** Alignment of content within column. */
64
- columnAlign: PropTypes.oneOf(["left", "center", "middle", "right"]),
65
-
66
- /** Offset this column by a certain number of columns. */
67
- columnOffset: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
68
-
69
- /** Span this column by a certain number of columns. */
70
- columnSpan: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
71
- };
72
- export default Column;
@@ -1,22 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ColumnProps {
4
- /** Children. */
5
- children?: React.ReactNode;
6
- /** Classes to apply to the component. */
7
- className?: string;
8
- /** Total column count. */
9
- columns?: number | string;
10
- /** Classes applied by row component to affect all rows */
11
- columnClasses?: string;
12
- /** Alignment of content within column. */
13
- columnAlign?: "left" | "center" | "middle" | "right";
14
- /** Offset this column by a certain number of columns. */
15
- columnOffset?: number | string;
16
- /** Span this column by a certain number of columns. */
17
- columnSpan?: number | string;
18
- }
19
-
20
- declare function Column(props: ColumnProps): JSX.Element;
21
-
22
- export default Column;
@@ -1,2 +0,0 @@
1
- export default StyledColumn;
2
- declare const StyledColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,32 +0,0 @@
1
- import styled, { css } from "styled-components";
2
- const StyledColumn = styled.div`
3
- box-sizing: border-box;
4
- float: left;
5
- min-height: 1px;
6
- width: 100%;
7
- ${({
8
- columnAlign
9
- }) => (columnAlign === "center" || columnAlign === "middle") && "text-align: center"}
10
-
11
- ${({
12
- columnAlign
13
- }) => columnAlign === "right" && "text-align: right"}
14
- ${({
15
- columns
16
- }) => css`
17
- width: ${100 / columns}%;
18
- `}
19
- ${({
20
- columns,
21
- columnSpan
22
- }) => css`
23
- width: ${100 / columns * +columnSpan}%;
24
- `}
25
- ${({
26
- columns,
27
- columnOffset
28
- }) => css`
29
- margin-left: ${100 / columns * +columnOffset}%;
30
- `}
31
- `;
32
- export default StyledColumn;
@@ -1,2 +0,0 @@
1
- export { default as Row } from "./row";
2
- export { default as Column } from "./column/column";
@@ -1,2 +0,0 @@
1
- export { default as Row } from "./row.component";
2
- export { default as Column } from "./column/column.component";
@@ -1,24 +0,0 @@
1
- export default Row;
2
- declare function Row({ columns, children, columnClasses, columnDivide, gutter, className, }: {
3
- columns: any;
4
- children: any;
5
- columnClasses: any;
6
- columnDivide: any;
7
- gutter: any;
8
- className: any;
9
- }): JSX.Element;
10
- declare namespace Row {
11
- namespace propTypes {
12
- const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
13
- const className: PropTypes.Requireable<string>;
14
- const gutter: PropTypes.Requireable<string>;
15
- const columnDivide: PropTypes.Requireable<boolean>;
16
- const columns: PropTypes.Requireable<string | number>;
17
- const columnClasses: PropTypes.Requireable<string>;
18
- }
19
- namespace defaultProps {
20
- const gutter_1: string;
21
- export { gutter_1 as gutter };
22
- }
23
- }
24
- import PropTypes from "prop-types";
@@ -1,59 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import StyledRow from "./row.style";
4
- import Logger from "../../__internal__/utils/logger";
5
- let deprecatedWarnTriggered = false;
6
-
7
- const Row = ({
8
- columns,
9
- children,
10
- columnClasses,
11
- columnDivide,
12
- gutter,
13
- className
14
- }) => {
15
- const columnsCount = columns || React.Children.toArray(children).length;
16
-
17
- if (!deprecatedWarnTriggered) {
18
- deprecatedWarnTriggered = true; // eslint-disable-next-line max-len
19
-
20
- Logger.deprecate("`Row` component is deprecated and will soon be removed.");
21
- }
22
-
23
- const buildColumns = () => React.Children.toArray(children).map(child => /*#__PURE__*/React.cloneElement(child, {
24
- columnClasses,
25
- columns: columnsCount
26
- }, child.props.children));
27
-
28
- return /*#__PURE__*/React.createElement(StyledRow, {
29
- "data-component": "row",
30
- columnDivide: columnDivide,
31
- gutter: gutter,
32
- className: className,
33
- columns: columns || React.Children.toArray(children).length
34
- }, buildColumns());
35
- };
36
-
37
- Row.propTypes = {
38
- /** This component supports children of type Column. */
39
- children: PropTypes.node.isRequired,
40
-
41
- /** Classes to apply to the component. */
42
- className: PropTypes.string,
43
-
44
- /** Define how wide the gutter between the rows and columns should be. */
45
- gutter: PropTypes.oneOf(["none", "extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"]),
46
-
47
- /** Enable a divider between each column. */
48
- columnDivide: PropTypes.bool,
49
-
50
- /** Define a certain amount of columns, instead of basing it on the number of children. */
51
- columns: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
52
-
53
- /** Classes to apply to all column children. */
54
- columnClasses: PropTypes.string
55
- };
56
- Row.defaultProps = {
57
- gutter: "medium"
58
- };
59
- export default Row;
@@ -1,11 +0,0 @@
1
- export const ROW_SIZES: string[];
2
- export const ROW_SIZES_CSS: {
3
- none: number;
4
- "extra-small": number;
5
- small: number;
6
- "medium-small": number;
7
- medium: number;
8
- "medium-large": number;
9
- large: number;
10
- "extra-large": number;
11
- };
@@ -1,12 +0,0 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
- export const ROW_SIZES = ["extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"];
3
- export const ROW_SIZES_CSS = {
4
- none: 0,
5
- "extra-small": 2,
6
- small: 5,
7
- "medium-small": 10,
8
- medium: 15,
9
- "medium-large": 30,
10
- large: 60,
11
- "extra-large": 90
12
- };
@@ -1,27 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface RowProps {
4
- /** This component supports children of type Column. */
5
- children: React.ReactNode;
6
- /** Classes to apply to the component. */
7
- className?: string;
8
- /** Define how wide the gutter between the rows and columns should be. */
9
- gutter?:
10
- | "extra-small"
11
- | "small"
12
- | "medium-small"
13
- | "medium"
14
- | "medium-large"
15
- | "large"
16
- | "extra-large";
17
- /** Enable a divider between each column. */
18
- columnDivide?: boolean;
19
- /** Define a certain amount of columns, instead of basing it on the number of children. */
20
- columns?: number | string;
21
- /** Classes to apply to all column children. */
22
- columnClasses?: string;
23
- }
24
-
25
- declare function Row(props: RowProps): JSX.Element;
26
-
27
- export default Row;
@@ -1,2 +0,0 @@
1
- export default StyledRow;
2
- declare const StyledRow: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,53 +0,0 @@
1
- import styled, { css } from "styled-components";
2
- import baseTheme from "../../style/themes/base";
3
- import StyledColumn from "./column/column.style";
4
- import { ROW_SIZES_CSS } from "./row.config";
5
- const StyledRow = styled.div`
6
- clear: both;
7
- position: relative;
8
-
9
- ${({
10
- gutter,
11
- columnDivide
12
- }) => {
13
- const size = ROW_SIZES_CSS[gutter];
14
- return css`
15
- margin-bottom: -${size}px;
16
- margin-left: -${size}px;
17
-
18
- ${StyledColumn} {
19
- margin-bottom: ${size}px;
20
- padding-left: ${size}px;
21
-
22
- ${columnDivide && css`
23
- position: relative;
24
-
25
- &:before {
26
- content: "";
27
- position: absolute;
28
- width: 1px;
29
- height: 100%;
30
- background-color: ${baseTheme.palette.slateTint(70)};
31
- left: ${size / 2}px;
32
- top: 0;
33
- }
34
-
35
- &:first-child:before {
36
- display: none;
37
- }
38
- `}
39
- }
40
- `;
41
- }}
42
-
43
- /* Clearfix */
44
- &:before,
45
- &:after {
46
- content: "";
47
- display: table;
48
- }
49
- &:after {
50
- clear: both;
51
- }
52
- `;
53
- export default StyledRow;
@@ -1,30 +0,0 @@
1
- export default Column;
2
- declare function Column({ columnAlign, columns, columnSpan, columnOffset, columnClasses, className, ...props }: {
3
- [x: string]: any;
4
- columnAlign: any;
5
- columns: any;
6
- columnSpan: any;
7
- columnOffset: any;
8
- columnClasses: any;
9
- className: any;
10
- }): JSX.Element;
11
- declare namespace Column {
12
- namespace defaultProps {
13
- const columnOffset: string;
14
- const columnSpan: string;
15
- const columnAlign: string;
16
- }
17
- namespace propTypes {
18
- export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
19
- export const className: PropTypes.Requireable<string>;
20
- export const columns: PropTypes.Requireable<string | number>;
21
- export const columnClasses: PropTypes.Requireable<string>;
22
- const columnAlign_1: PropTypes.Requireable<string>;
23
- export { columnAlign_1 as columnAlign };
24
- const columnOffset_1: PropTypes.Requireable<string | number>;
25
- export { columnOffset_1 as columnOffset };
26
- const columnSpan_1: PropTypes.Requireable<string | number>;
27
- export { columnSpan_1 as columnSpan };
28
- }
29
- }
30
- import PropTypes from "prop-types";
@@ -1,87 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _column = _interopRequireDefault(require("./column.style"));
15
-
16
- var _logger = _interopRequireDefault(require("../../../__internal__/utils/logger"));
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- let deprecatedWarnTriggered = false;
21
-
22
- const Column = ({
23
- columnAlign,
24
- columns,
25
- columnSpan,
26
- columnOffset,
27
- columnClasses,
28
- className,
29
- ...props
30
- }) => {
31
- if (!deprecatedWarnTriggered) {
32
- deprecatedWarnTriggered = true; // eslint-disable-next-line max-len
33
-
34
- _logger.default.deprecate("`Column` component is deprecated and will soon be removed.");
35
- }
36
-
37
- return /*#__PURE__*/_react.default.createElement(_column.default, {
38
- columnAlign: columnAlign,
39
- className: (0, _classnames.default)(className, columnClasses),
40
- columns: columns,
41
- columnSpan: columnSpan,
42
- columnOffset: columnOffset,
43
- "data-component": "column"
44
- }, props.children);
45
- };
46
-
47
- Column.defaultProps = {
48
- columnOffset: "0",
49
- columnSpan: "1",
50
- columnAlign: "left"
51
- };
52
- /* eslint-disable react/no-unused-prop-types */
53
-
54
- Column.propTypes = {
55
- /** Content. */
56
- children: _propTypes.default.node,
57
-
58
- /** Classes to apply to the component. */
59
- className: _propTypes.default.string,
60
-
61
- /**
62
- * @private
63
- * @ignore
64
- */
65
-
66
- /** Total column count */
67
- columns: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
68
-
69
- /**
70
- * @private
71
- * @ignore
72
- */
73
-
74
- /** Classes applied by row component to affect all rows */
75
- columnClasses: _propTypes.default.string,
76
-
77
- /** Alignment of content within column. */
78
- columnAlign: _propTypes.default.oneOf(["left", "center", "middle", "right"]),
79
-
80
- /** Offset this column by a certain number of columns. */
81
- columnOffset: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
82
-
83
- /** Span this column by a certain number of columns. */
84
- columnSpan: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
85
- };
86
- var _default = Column;
87
- exports.default = _default;
@@ -1,22 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ColumnProps {
4
- /** Children. */
5
- children?: React.ReactNode;
6
- /** Classes to apply to the component. */
7
- className?: string;
8
- /** Total column count. */
9
- columns?: number | string;
10
- /** Classes applied by row component to affect all rows */
11
- columnClasses?: string;
12
- /** Alignment of content within column. */
13
- columnAlign?: "left" | "center" | "middle" | "right";
14
- /** Offset this column by a certain number of columns. */
15
- columnOffset?: number | string;
16
- /** Span this column by a certain number of columns. */
17
- columnSpan?: number | string;
18
- }
19
-
20
- declare function Column(props: ColumnProps): JSX.Element;
21
-
22
- export default Column;
@@ -1,2 +0,0 @@
1
- export default StyledColumn;
2
- declare const StyledColumn: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
-
10
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
11
-
12
- 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; }
13
-
14
- const StyledColumn = _styledComponents.default.div`
15
- box-sizing: border-box;
16
- float: left;
17
- min-height: 1px;
18
- width: 100%;
19
- ${({
20
- columnAlign
21
- }) => (columnAlign === "center" || columnAlign === "middle") && "text-align: center"}
22
-
23
- ${({
24
- columnAlign
25
- }) => columnAlign === "right" && "text-align: right"}
26
- ${({
27
- columns
28
- }) => (0, _styledComponents.css)`
29
- width: ${100 / columns}%;
30
- `}
31
- ${({
32
- columns,
33
- columnSpan
34
- }) => (0, _styledComponents.css)`
35
- width: ${100 / columns * +columnSpan}%;
36
- `}
37
- ${({
38
- columns,
39
- columnOffset
40
- }) => (0, _styledComponents.css)`
41
- margin-left: ${100 / columns * +columnOffset}%;
42
- `}
43
- `;
44
- var _default = StyledColumn;
45
- exports.default = _default;
@@ -1,2 +0,0 @@
1
- export { default as Row } from "./row";
2
- export { default as Column } from "./column/column";
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Row", {
7
- enumerable: true,
8
- get: function () {
9
- return _row.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "Column", {
13
- enumerable: true,
14
- get: function () {
15
- return _column.default;
16
- }
17
- });
18
-
19
- var _row = _interopRequireDefault(require("./row.component"));
20
-
21
- var _column = _interopRequireDefault(require("./column/column.component"));
22
-
23
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "module": "../../../esm/components/row/index.js",
4
- "main": "./index.js",
5
- "types": "./index.d.ts"
6
- }
@@ -1,24 +0,0 @@
1
- export default Row;
2
- declare function Row({ columns, children, columnClasses, columnDivide, gutter, className, }: {
3
- columns: any;
4
- children: any;
5
- columnClasses: any;
6
- columnDivide: any;
7
- gutter: any;
8
- className: any;
9
- }): JSX.Element;
10
- declare namespace Row {
11
- namespace propTypes {
12
- const children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
13
- const className: PropTypes.Requireable<string>;
14
- const gutter: PropTypes.Requireable<string>;
15
- const columnDivide: PropTypes.Requireable<boolean>;
16
- const columns: PropTypes.Requireable<string | number>;
17
- const columnClasses: PropTypes.Requireable<string>;
18
- }
19
- namespace defaultProps {
20
- const gutter_1: string;
21
- export { gutter_1 as gutter };
22
- }
23
- }
24
- import PropTypes from "prop-types";
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _row = _interopRequireDefault(require("./row.style"));
13
-
14
- var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- let deprecatedWarnTriggered = false;
19
-
20
- const Row = ({
21
- columns,
22
- children,
23
- columnClasses,
24
- columnDivide,
25
- gutter,
26
- className
27
- }) => {
28
- const columnsCount = columns || _react.default.Children.toArray(children).length;
29
-
30
- if (!deprecatedWarnTriggered) {
31
- deprecatedWarnTriggered = true; // eslint-disable-next-line max-len
32
-
33
- _logger.default.deprecate("`Row` component is deprecated and will soon be removed.");
34
- }
35
-
36
- const buildColumns = () => _react.default.Children.toArray(children).map(child => /*#__PURE__*/_react.default.cloneElement(child, {
37
- columnClasses,
38
- columns: columnsCount
39
- }, child.props.children));
40
-
41
- return /*#__PURE__*/_react.default.createElement(_row.default, {
42
- "data-component": "row",
43
- columnDivide: columnDivide,
44
- gutter: gutter,
45
- className: className,
46
- columns: columns || _react.default.Children.toArray(children).length
47
- }, buildColumns());
48
- };
49
-
50
- Row.propTypes = {
51
- /** This component supports children of type Column. */
52
- children: _propTypes.default.node.isRequired,
53
-
54
- /** Classes to apply to the component. */
55
- className: _propTypes.default.string,
56
-
57
- /** Define how wide the gutter between the rows and columns should be. */
58
- gutter: _propTypes.default.oneOf(["none", "extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"]),
59
-
60
- /** Enable a divider between each column. */
61
- columnDivide: _propTypes.default.bool,
62
-
63
- /** Define a certain amount of columns, instead of basing it on the number of children. */
64
- columns: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
65
-
66
- /** Classes to apply to all column children. */
67
- columnClasses: _propTypes.default.string
68
- };
69
- Row.defaultProps = {
70
- gutter: "medium"
71
- };
72
- var _default = Row;
73
- exports.default = _default;
@@ -1,11 +0,0 @@
1
- export const ROW_SIZES: string[];
2
- export const ROW_SIZES_CSS: {
3
- none: number;
4
- "extra-small": number;
5
- small: number;
6
- "medium-small": number;
7
- medium: number;
8
- "medium-large": number;
9
- large: number;
10
- "extra-large": number;
11
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ROW_SIZES_CSS = exports.ROW_SIZES = void 0;
7
- // eslint-disable-next-line import/prefer-default-export
8
- const ROW_SIZES = ["extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"];
9
- exports.ROW_SIZES = ROW_SIZES;
10
- const ROW_SIZES_CSS = {
11
- none: 0,
12
- "extra-small": 2,
13
- small: 5,
14
- "medium-small": 10,
15
- medium: 15,
16
- "medium-large": 30,
17
- large: 60,
18
- "extra-large": 90
19
- };
20
- exports.ROW_SIZES_CSS = ROW_SIZES_CSS;
@@ -1,27 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface RowProps {
4
- /** This component supports children of type Column. */
5
- children: React.ReactNode;
6
- /** Classes to apply to the component. */
7
- className?: string;
8
- /** Define how wide the gutter between the rows and columns should be. */
9
- gutter?:
10
- | "extra-small"
11
- | "small"
12
- | "medium-small"
13
- | "medium"
14
- | "medium-large"
15
- | "large"
16
- | "extra-large";
17
- /** Enable a divider between each column. */
18
- columnDivide?: boolean;
19
- /** Define a certain amount of columns, instead of basing it on the number of children. */
20
- columns?: number | string;
21
- /** Classes to apply to all column children. */
22
- columnClasses?: string;
23
- }
24
-
25
- declare function Row(props: RowProps): JSX.Element;
26
-
27
- export default Row;
@@ -1,2 +0,0 @@
1
- export default StyledRow;
2
- declare const StyledRow: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
-
10
- var _base = _interopRequireDefault(require("../../style/themes/base"));
11
-
12
- var _column = _interopRequireDefault(require("./column/column.style"));
13
-
14
- var _row = require("./row.config");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
19
-
20
- 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; }
21
-
22
- const StyledRow = _styledComponents.default.div`
23
- clear: both;
24
- position: relative;
25
-
26
- ${({
27
- gutter,
28
- columnDivide
29
- }) => {
30
- const size = _row.ROW_SIZES_CSS[gutter];
31
- return (0, _styledComponents.css)`
32
- margin-bottom: -${size}px;
33
- margin-left: -${size}px;
34
-
35
- ${_column.default} {
36
- margin-bottom: ${size}px;
37
- padding-left: ${size}px;
38
-
39
- ${columnDivide && (0, _styledComponents.css)`
40
- position: relative;
41
-
42
- &:before {
43
- content: "";
44
- position: absolute;
45
- width: 1px;
46
- height: 100%;
47
- background-color: ${_base.default.palette.slateTint(70)};
48
- left: ${size / 2}px;
49
- top: 0;
50
- }
51
-
52
- &:first-child:before {
53
- display: none;
54
- }
55
- `}
56
- }
57
- `;
58
- }}
59
-
60
- /* Clearfix */
61
- &:before,
62
- &:after {
63
- content: "";
64
- display: table;
65
- }
66
- &:after {
67
- clear: both;
68
- }
69
- `;
70
- var _default = StyledRow;
71
- exports.default = _default;