carbon-react 111.1.0 → 111.3.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/esm/__internal__/full-screen-heading/full-screen-heading.style.js +1 -0
- package/esm/components/box/box.component.d.ts +9 -0
- package/esm/components/box/box.component.js +21 -0
- package/esm/components/box/box.config.d.ts +1 -0
- package/esm/components/box/box.config.js +8 -0
- package/esm/components/dialog/dialog.style.js +1 -0
- package/esm/components/dismissible-box/dismissible-box.component.js +3 -0
- package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -0
- package/lib/components/box/box.component.d.ts +9 -0
- package/lib/components/box/box.component.js +21 -0
- package/lib/components/box/box.config.d.ts +1 -0
- package/lib/components/box/box.config.js +10 -0
- package/lib/components/dialog/dialog.style.js +1 -0
- package/lib/components/dismissible-box/dismissible-box.component.js +3 -0
- package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ const StyledFullScreenHeading = styled.div`
|
|
|
10
10
|
}) => hasContent && css`
|
|
11
11
|
border-bottom: 1px solid var(--colorsUtilityMajor050);
|
|
12
12
|
`}
|
|
13
|
+
background-color: var(--colorsUtilityYang100);
|
|
13
14
|
display: flex;
|
|
14
15
|
justify-content: space-between;
|
|
15
16
|
align-items: flex-start;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps, LayoutProps, FlexboxProps, ColorProps, PositionProps } from "styled-system";
|
|
3
|
+
declare const GAP_VALUES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
3
4
|
export declare type OverflowWrap = "break-word" | "anywhere";
|
|
4
5
|
export declare type ScrollVariant = "light" | "dark";
|
|
5
6
|
export declare type BoxSizing = "content-box" | "border-box";
|
|
7
|
+
export declare type AllowedNumericalValues = typeof GAP_VALUES[number];
|
|
8
|
+
export declare type Gap = AllowedNumericalValues | string;
|
|
6
9
|
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps, Omit<PositionProps, "zIndex"> {
|
|
7
10
|
as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
8
11
|
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
|
|
@@ -13,6 +16,12 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
|
|
|
13
16
|
boxSizing?: BoxSizing;
|
|
14
17
|
/** Allows a tabindex to be specified */
|
|
15
18
|
tabIndex?: number | string;
|
|
19
|
+
/** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
20
|
+
gap?: Gap;
|
|
21
|
+
/** Column gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
22
|
+
columnGap?: Gap;
|
|
23
|
+
/** Row gap an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
24
|
+
rowGap?: Gap;
|
|
16
25
|
}
|
|
17
26
|
declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
|
18
27
|
export default Box;
|
|
@@ -3,11 +3,13 @@ import { space, layout, flexbox, position } from "styled-system";
|
|
|
3
3
|
import BaseTheme from "../../style/themes/base";
|
|
4
4
|
import styledColor from "../../style/utils/color";
|
|
5
5
|
import boxConfig from "./box.config";
|
|
6
|
+
const GAP_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
6
7
|
const Box = styled.div`
|
|
7
8
|
${space}
|
|
8
9
|
${layout}
|
|
9
10
|
${flexbox}
|
|
10
11
|
${position}
|
|
12
|
+
|
|
11
13
|
${({
|
|
12
14
|
color,
|
|
13
15
|
bg,
|
|
@@ -48,6 +50,25 @@ const Box = styled.div`
|
|
|
48
50
|
}) => boxSizing && css`
|
|
49
51
|
box-sizing: ${boxSizing};
|
|
50
52
|
`}
|
|
53
|
+
|
|
54
|
+
${({
|
|
55
|
+
display,
|
|
56
|
+
gap,
|
|
57
|
+
columnGap,
|
|
58
|
+
rowGap
|
|
59
|
+
}) => (display === "flex" || display === "inline-flex") && css`
|
|
60
|
+
${gap !== undefined && css`
|
|
61
|
+
gap: ${boxConfig.gap(gap)};
|
|
62
|
+
`}
|
|
63
|
+
|
|
64
|
+
${columnGap !== undefined && css`
|
|
65
|
+
column-gap: ${boxConfig.gap(columnGap)};
|
|
66
|
+
`}
|
|
67
|
+
|
|
68
|
+
${rowGap !== undefined && css`
|
|
69
|
+
row-gap: ${boxConfig.gap(rowGap)};
|
|
70
|
+
`}
|
|
71
|
+
`};
|
|
51
72
|
`;
|
|
52
73
|
Box.defaultProps = {
|
|
53
74
|
theme: BaseTheme
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { space } from "../../style/themes/base/base-theme.config";
|
|
1
2
|
export default {
|
|
2
3
|
light: {
|
|
3
4
|
thumb: "var(--colorsUtilityMajor300)",
|
|
@@ -6,5 +7,12 @@ export default {
|
|
|
6
7
|
dark: {
|
|
7
8
|
thumb: "var(--colorsUtilityMajor200)",
|
|
8
9
|
track: "var(--colorsUtilityMajor400)"
|
|
10
|
+
},
|
|
11
|
+
gap: gapValue => {
|
|
12
|
+
if (typeof gapValue === "number") {
|
|
13
|
+
return space[gapValue];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return gapValue;
|
|
9
17
|
}
|
|
10
18
|
};
|
|
@@ -478,6 +478,7 @@ DismissibleBox.propTypes = {
|
|
|
478
478
|
"toString": PropTypes.func.isRequired,
|
|
479
479
|
"valueOf": PropTypes.func.isRequired
|
|
480
480
|
}), PropTypes.string]),
|
|
481
|
+
"columnGap": PropTypes.oneOfType([PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), PropTypes.string]),
|
|
481
482
|
"flex": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
482
483
|
"__@iterator": PropTypes.func.isRequired,
|
|
483
484
|
"anchor": PropTypes.func.isRequired,
|
|
@@ -712,6 +713,7 @@ DismissibleBox.propTypes = {
|
|
|
712
713
|
"valueOf": PropTypes.func.isRequired
|
|
713
714
|
})]),
|
|
714
715
|
"flexWrap": PropTypes.oneOfType([PropTypes.oneOf(["-moz-initial", "inherit", "initial", "nowrap", "revert", "unset", "wrap-reverse", "wrap"]), PropTypes.arrayOf(PropTypes.oneOf(["-moz-initial", "inherit", "initial", "nowrap", "revert", "unset", "wrap-reverse", "wrap", null])), PropTypes.object]),
|
|
716
|
+
"gap": PropTypes.oneOfType([PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), PropTypes.string]),
|
|
715
717
|
"hasBorderLeftHighlight": PropTypes.bool,
|
|
716
718
|
"height": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
717
719
|
"__@iterator": PropTypes.func.isRequired,
|
|
@@ -2152,6 +2154,7 @@ DismissibleBox.propTypes = {
|
|
|
2152
2154
|
"trimStart": PropTypes.func.isRequired,
|
|
2153
2155
|
"valueOf": PropTypes.func.isRequired
|
|
2154
2156
|
}), PropTypes.string]),
|
|
2157
|
+
"rowGap": PropTypes.oneOfType([PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), PropTypes.string]),
|
|
2155
2158
|
"scrollVariant": PropTypes.oneOf(["dark", "light"]),
|
|
2156
2159
|
"size": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
2157
2160
|
"__@iterator": PropTypes.func.isRequired,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
const SidebarHeaderStyle = styled.div`
|
|
3
|
-
background-color: var(--
|
|
3
|
+
background-color: var(--colorsUtilityYang100);
|
|
4
4
|
box-shadow: inset 0 -1px 0 0 var(--colorsUtilityMajor100);
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
width: 100%;
|
|
@@ -24,6 +24,7 @@ const StyledFullScreenHeading = _styledComponents.default.div`
|
|
|
24
24
|
}) => hasContent && (0, _styledComponents.css)`
|
|
25
25
|
border-bottom: 1px solid var(--colorsUtilityMajor050);
|
|
26
26
|
`}
|
|
27
|
+
background-color: var(--colorsUtilityYang100);
|
|
27
28
|
display: flex;
|
|
28
29
|
justify-content: space-between;
|
|
29
30
|
align-items: flex-start;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SpaceProps, LayoutProps, FlexboxProps, ColorProps, PositionProps } from "styled-system";
|
|
3
|
+
declare const GAP_VALUES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
3
4
|
export declare type OverflowWrap = "break-word" | "anywhere";
|
|
4
5
|
export declare type ScrollVariant = "light" | "dark";
|
|
5
6
|
export declare type BoxSizing = "content-box" | "border-box";
|
|
7
|
+
export declare type AllowedNumericalValues = typeof GAP_VALUES[number];
|
|
8
|
+
export declare type Gap = AllowedNumericalValues | string;
|
|
6
9
|
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps, Omit<PositionProps, "zIndex"> {
|
|
7
10
|
as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
8
11
|
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
|
|
@@ -13,6 +16,12 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
|
|
|
13
16
|
boxSizing?: BoxSizing;
|
|
14
17
|
/** Allows a tabindex to be specified */
|
|
15
18
|
tabIndex?: number | string;
|
|
19
|
+
/** Gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
20
|
+
gap?: Gap;
|
|
21
|
+
/** Column gap, an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
22
|
+
columnGap?: Gap;
|
|
23
|
+
/** Row gap an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
|
|
24
|
+
rowGap?: Gap;
|
|
16
25
|
}
|
|
17
26
|
declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
|
18
27
|
export default Box;
|
|
@@ -21,11 +21,13 @@ 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 GAP_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
|
|
24
25
|
const Box = _styledComponents.default.div`
|
|
25
26
|
${_styledSystem.space}
|
|
26
27
|
${_styledSystem.layout}
|
|
27
28
|
${_styledSystem.flexbox}
|
|
28
29
|
${_styledSystem.position}
|
|
30
|
+
|
|
29
31
|
${({
|
|
30
32
|
color,
|
|
31
33
|
bg,
|
|
@@ -66,6 +68,25 @@ const Box = _styledComponents.default.div`
|
|
|
66
68
|
}) => boxSizing && (0, _styledComponents.css)`
|
|
67
69
|
box-sizing: ${boxSizing};
|
|
68
70
|
`}
|
|
71
|
+
|
|
72
|
+
${({
|
|
73
|
+
display,
|
|
74
|
+
gap,
|
|
75
|
+
columnGap,
|
|
76
|
+
rowGap
|
|
77
|
+
}) => (display === "flex" || display === "inline-flex") && (0, _styledComponents.css)`
|
|
78
|
+
${gap !== undefined && (0, _styledComponents.css)`
|
|
79
|
+
gap: ${_box.default.gap(gap)};
|
|
80
|
+
`}
|
|
81
|
+
|
|
82
|
+
${columnGap !== undefined && (0, _styledComponents.css)`
|
|
83
|
+
column-gap: ${_box.default.gap(columnGap)};
|
|
84
|
+
`}
|
|
85
|
+
|
|
86
|
+
${rowGap !== undefined && (0, _styledComponents.css)`
|
|
87
|
+
row-gap: ${_box.default.gap(rowGap)};
|
|
88
|
+
`}
|
|
89
|
+
`};
|
|
69
90
|
`;
|
|
70
91
|
Box.defaultProps = {
|
|
71
92
|
theme: _base.default
|
|
@@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _baseTheme = require("../../style/themes/base/base-theme.config");
|
|
9
|
+
|
|
7
10
|
var _default = {
|
|
8
11
|
light: {
|
|
9
12
|
thumb: "var(--colorsUtilityMajor300)",
|
|
@@ -12,6 +15,13 @@ var _default = {
|
|
|
12
15
|
dark: {
|
|
13
16
|
thumb: "var(--colorsUtilityMajor200)",
|
|
14
17
|
track: "var(--colorsUtilityMajor400)"
|
|
18
|
+
},
|
|
19
|
+
gap: gapValue => {
|
|
20
|
+
if (typeof gapValue === "number") {
|
|
21
|
+
return _baseTheme.space[gapValue];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return gapValue;
|
|
15
25
|
}
|
|
16
26
|
};
|
|
17
27
|
exports.default = _default;
|
|
@@ -141,6 +141,7 @@ const StyledDialog = _styledComponents.default.div`
|
|
|
141
141
|
`;
|
|
142
142
|
exports.StyledDialog = StyledDialog;
|
|
143
143
|
const StyledDialogTitle = _styledComponents.default.div`
|
|
144
|
+
background-color: var(--colorsUtilityYang100);
|
|
144
145
|
padding: 23px ${_dialog.HORIZONTAL_PADDING}px 0;
|
|
145
146
|
border-bottom: 1px solid #ccd6db;
|
|
146
147
|
${({
|
|
@@ -492,6 +492,7 @@ DismissibleBox.propTypes = {
|
|
|
492
492
|
"toString": _propTypes.default.func.isRequired,
|
|
493
493
|
"valueOf": _propTypes.default.func.isRequired
|
|
494
494
|
}), _propTypes.default.string]),
|
|
495
|
+
"columnGap": _propTypes.default.oneOfType([_propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), _propTypes.default.string]),
|
|
495
496
|
"flex": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
496
497
|
"__@iterator": _propTypes.default.func.isRequired,
|
|
497
498
|
"anchor": _propTypes.default.func.isRequired,
|
|
@@ -726,6 +727,7 @@ DismissibleBox.propTypes = {
|
|
|
726
727
|
"valueOf": _propTypes.default.func.isRequired
|
|
727
728
|
})]),
|
|
728
729
|
"flexWrap": _propTypes.default.oneOfType([_propTypes.default.oneOf(["-moz-initial", "inherit", "initial", "nowrap", "revert", "unset", "wrap-reverse", "wrap"]), _propTypes.default.arrayOf(_propTypes.default.oneOf(["-moz-initial", "inherit", "initial", "nowrap", "revert", "unset", "wrap-reverse", "wrap", null])), _propTypes.default.object]),
|
|
730
|
+
"gap": _propTypes.default.oneOfType([_propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), _propTypes.default.string]),
|
|
729
731
|
"hasBorderLeftHighlight": _propTypes.default.bool,
|
|
730
732
|
"height": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
731
733
|
"__@iterator": _propTypes.default.func.isRequired,
|
|
@@ -2166,6 +2168,7 @@ DismissibleBox.propTypes = {
|
|
|
2166
2168
|
"trimStart": _propTypes.default.func.isRequired,
|
|
2167
2169
|
"valueOf": _propTypes.default.func.isRequired
|
|
2168
2170
|
}), _propTypes.default.string]),
|
|
2171
|
+
"rowGap": _propTypes.default.oneOfType([_propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]), _propTypes.default.string]),
|
|
2169
2172
|
"scrollVariant": _propTypes.default.oneOf(["dark", "light"]),
|
|
2170
2173
|
"size": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
2171
2174
|
"__@iterator": _propTypes.default.func.isRequired,
|
|
@@ -10,7 +10,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
12
|
const SidebarHeaderStyle = _styledComponents.default.div`
|
|
13
|
-
background-color: var(--
|
|
13
|
+
background-color: var(--colorsUtilityYang100);
|
|
14
14
|
box-shadow: inset 0 -1px 0 0 var(--colorsUtilityMajor100);
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
width: 100%;
|