carbon-react 126.7.0 → 126.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/tile/tile.config.d.ts +1 -0
- package/esm/components/tile/tile.config.js +2 -1
- package/esm/components/tile/tile.style.js +11 -5
- package/lib/components/tile/tile.config.d.ts +1 -0
- package/lib/components/tile/tile.config.js +3 -2
- package/lib/components/tile/tile.style.js +11 -5
- package/package.json +1 -1
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export const TILE_ORIENTATIONS = ["horizontal", "vertical"];
|
|
2
|
-
export const TILE_THEMES = ["tile", "transparent", "active"];
|
|
2
|
+
export const TILE_THEMES = ["tile", "transparent", "active", "grey"];
|
|
3
|
+
export const TILE_BORDER_VARIANTS = ["default", "info", "selected", "negative", "positive", "caution"];
|
|
@@ -2,7 +2,7 @@ import styled, { css } from "styled-components";
|
|
|
2
2
|
import { space } from "styled-system";
|
|
3
3
|
import baseTheme from "../../style/themes/base";
|
|
4
4
|
import computeSizing from "../../style/utils/element-sizing";
|
|
5
|
-
const getBorderColor = borderVariant => {
|
|
5
|
+
const getBorderColor = (borderVariant, variant) => {
|
|
6
6
|
switch (borderVariant) {
|
|
7
7
|
case "selected":
|
|
8
8
|
return "var(--colorsUtilityYin100)";
|
|
@@ -15,7 +15,14 @@ const getBorderColor = borderVariant => {
|
|
|
15
15
|
case "info":
|
|
16
16
|
return "var(--colorsSemanticInfo500)";
|
|
17
17
|
default:
|
|
18
|
-
|
|
18
|
+
switch (variant) {
|
|
19
|
+
case "active":
|
|
20
|
+
return "var(--colorsActionMajor500)";
|
|
21
|
+
case "grey":
|
|
22
|
+
return "var(--colorsUtilityMajor200)";
|
|
23
|
+
default:
|
|
24
|
+
return "var(--colorsUtilityMajor100)";
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
};
|
|
21
28
|
const getBorderRadius = roundness => {
|
|
@@ -41,7 +48,8 @@ const StyledTile = styled.div`
|
|
|
41
48
|
${space}
|
|
42
49
|
|
|
43
50
|
box-sizing: border-box;
|
|
44
|
-
border: var(--${borderWidth}) solid
|
|
51
|
+
border: var(--${borderWidth}) solid
|
|
52
|
+
${getBorderColor(borderVariant, variant)};
|
|
45
53
|
border-radius: ${getBorderRadius(roundness)};
|
|
46
54
|
--tileBorderRadius: ${getBorderRadius(roundness)};
|
|
47
55
|
|
|
@@ -65,12 +73,10 @@ const StyledTile = styled.div`
|
|
|
65
73
|
|
|
66
74
|
${variant === "active" && css`
|
|
67
75
|
background-color: var(--colorsActionMajor025);
|
|
68
|
-
border-color: var(--colorsActionMajor500);
|
|
69
76
|
`}
|
|
70
77
|
|
|
71
78
|
${variant === "grey" && css`
|
|
72
79
|
background-color: var(--colorsUtilityMajor025);
|
|
73
|
-
border-color: var(--colorsUtilityMajor200);
|
|
74
80
|
`}
|
|
75
81
|
|
|
76
82
|
display: flex;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TILE_THEMES = exports.TILE_ORIENTATIONS = void 0;
|
|
6
|
+
exports.TILE_THEMES = exports.TILE_ORIENTATIONS = exports.TILE_BORDER_VARIANTS = void 0;
|
|
7
7
|
const TILE_ORIENTATIONS = exports.TILE_ORIENTATIONS = ["horizontal", "vertical"];
|
|
8
|
-
const TILE_THEMES = exports.TILE_THEMES = ["tile", "transparent", "active"];
|
|
8
|
+
const TILE_THEMES = exports.TILE_THEMES = ["tile", "transparent", "active", "grey"];
|
|
9
|
+
const TILE_BORDER_VARIANTS = exports.TILE_BORDER_VARIANTS = ["default", "info", "selected", "negative", "positive", "caution"];
|
|
@@ -11,7 +11,7 @@ var _elementSizing = _interopRequireDefault(require("../../style/utils/element-s
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
const getBorderColor = borderVariant => {
|
|
14
|
+
const getBorderColor = (borderVariant, variant) => {
|
|
15
15
|
switch (borderVariant) {
|
|
16
16
|
case "selected":
|
|
17
17
|
return "var(--colorsUtilityYin100)";
|
|
@@ -24,7 +24,14 @@ const getBorderColor = borderVariant => {
|
|
|
24
24
|
case "info":
|
|
25
25
|
return "var(--colorsSemanticInfo500)";
|
|
26
26
|
default:
|
|
27
|
-
|
|
27
|
+
switch (variant) {
|
|
28
|
+
case "active":
|
|
29
|
+
return "var(--colorsActionMajor500)";
|
|
30
|
+
case "grey":
|
|
31
|
+
return "var(--colorsUtilityMajor200)";
|
|
32
|
+
default:
|
|
33
|
+
return "var(--colorsUtilityMajor100)";
|
|
34
|
+
}
|
|
28
35
|
}
|
|
29
36
|
};
|
|
30
37
|
const getBorderRadius = roundness => {
|
|
@@ -50,7 +57,8 @@ const StyledTile = _styledComponents.default.div`
|
|
|
50
57
|
${_styledSystem.space}
|
|
51
58
|
|
|
52
59
|
box-sizing: border-box;
|
|
53
|
-
border: var(--${borderWidth}) solid
|
|
60
|
+
border: var(--${borderWidth}) solid
|
|
61
|
+
${getBorderColor(borderVariant, variant)};
|
|
54
62
|
border-radius: ${getBorderRadius(roundness)};
|
|
55
63
|
--tileBorderRadius: ${getBorderRadius(roundness)};
|
|
56
64
|
|
|
@@ -74,12 +82,10 @@ const StyledTile = _styledComponents.default.div`
|
|
|
74
82
|
|
|
75
83
|
${variant === "active" && (0, _styledComponents.css)`
|
|
76
84
|
background-color: var(--colorsActionMajor025);
|
|
77
|
-
border-color: var(--colorsActionMajor500);
|
|
78
85
|
`}
|
|
79
86
|
|
|
80
87
|
${variant === "grey" && (0, _styledComponents.css)`
|
|
81
88
|
background-color: var(--colorsUtilityMajor025);
|
|
82
|
-
border-color: var(--colorsUtilityMajor200);
|
|
83
89
|
`}
|
|
84
90
|
|
|
85
91
|
display: flex;
|