carbon-react 104.58.8 → 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.
- package/package.json +1 -1
- package/esm/components/row/column/column.component.d.ts +0 -30
- package/esm/components/row/column/column.component.js +0 -72
- package/esm/components/row/column/column.d.ts +0 -22
- package/esm/components/row/column/column.style.d.ts +0 -2
- package/esm/components/row/column/column.style.js +0 -32
- package/esm/components/row/index.d.ts +0 -2
- package/esm/components/row/index.js +0 -2
- package/esm/components/row/row.component.d.ts +0 -24
- package/esm/components/row/row.component.js +0 -59
- package/esm/components/row/row.config.d.ts +0 -11
- package/esm/components/row/row.config.js +0 -12
- package/esm/components/row/row.d.ts +0 -27
- package/esm/components/row/row.style.d.ts +0 -2
- package/esm/components/row/row.style.js +0 -53
- package/lib/components/row/column/column.component.d.ts +0 -30
- package/lib/components/row/column/column.component.js +0 -87
- package/lib/components/row/column/column.d.ts +0 -22
- package/lib/components/row/column/column.style.d.ts +0 -2
- package/lib/components/row/column/column.style.js +0 -45
- package/lib/components/row/index.d.ts +0 -2
- package/lib/components/row/index.js +0 -23
- package/lib/components/row/package.json +0 -6
- package/lib/components/row/row.component.d.ts +0 -24
- package/lib/components/row/row.component.js +0 -73
- package/lib/components/row/row.config.d.ts +0 -11
- package/lib/components/row/row.config.js +0 -20
- package/lib/components/row/row.d.ts +0 -27
- package/lib/components/row/row.style.d.ts +0 -2
- package/lib/components/row/row.style.js +0 -71
package/package.json
CHANGED
|
@@ -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,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,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,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,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,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,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,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,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,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;
|