@atlaskit/lozenge 11.0.0 → 11.1.3
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/CHANGELOG.md +29 -0
- package/dist/cjs/Lozenge/index.js +80 -16
- package/dist/cjs/theme.js +20 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/Lozenge/index.js +89 -28
- package/dist/es2019/theme.js +19 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/Lozenge/index.js +79 -16
- package/dist/esm/theme.js +19 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/Lozenge/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/theme.d.ts +13 -3
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/lozenge
|
|
2
2
|
|
|
3
|
+
## 11.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 11.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 11.1.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 11.1.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [`d7caf75e732`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d7caf75e732) - - [ux] Colors are now sourced through tokens.
|
|
26
|
+
- Deprecate `@atlaskit/lozenge/theme` entry-point.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 11.0.0
|
|
4
33
|
|
|
5
34
|
### Major Changes
|
|
@@ -9,11 +9,87 @@ var _react = require("react");
|
|
|
9
9
|
|
|
10
10
|
var _core = require("@emotion/core");
|
|
11
11
|
|
|
12
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
13
|
+
|
|
12
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
var _tokens = require("@atlaskit/tokens");
|
|
15
17
|
|
|
16
18
|
/** @jsx jsx */
|
|
19
|
+
var defaultAppearanceStyles = (0, _core.css)({
|
|
20
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleNeutral.resting', _colors.N40),
|
|
21
|
+
color: (0, _tokens.token)('color.text.highEmphasis', _colors.N500)
|
|
22
|
+
});
|
|
23
|
+
var inprogressAppearanceStyles = (0, _core.css)({
|
|
24
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleBrand.resting', _colors.B50),
|
|
25
|
+
color: (0, _tokens.token)('color.text.brand', _colors.B500)
|
|
26
|
+
});
|
|
27
|
+
var movedAppearanceStyles = (0, _core.css)({
|
|
28
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleWarning.resting', _colors.Y75),
|
|
29
|
+
color: (0, _tokens.token)('color.text.warning', _colors.N800)
|
|
30
|
+
});
|
|
31
|
+
var newAppearanceStyles = (0, _core.css)({
|
|
32
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleDiscovery.resting', _colors.P50),
|
|
33
|
+
color: (0, _tokens.token)('color.text.discovery', _colors.P500)
|
|
34
|
+
});
|
|
35
|
+
var removedAppearanceStyles = (0, _core.css)({
|
|
36
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleDanger.resting', _colors.R50),
|
|
37
|
+
color: (0, _tokens.token)('color.text.danger', _colors.R500)
|
|
38
|
+
});
|
|
39
|
+
var successAppearanceStyles = (0, _core.css)({
|
|
40
|
+
backgroundColor: (0, _tokens.token)('color.background.subtleSuccess.resting', _colors.G50),
|
|
41
|
+
color: (0, _tokens.token)('color.text.success', _colors.G500)
|
|
42
|
+
});
|
|
43
|
+
var defaultBoldAppearanceStyles = (0, _core.css)({
|
|
44
|
+
backgroundColor: (0, _tokens.token)('color.background.boldNeutral.resting', _colors.N500),
|
|
45
|
+
color: (0, _tokens.token)('color.text.onBold', _colors.N0)
|
|
46
|
+
});
|
|
47
|
+
var inprogressBoldAppearanceStyles = (0, _core.css)({
|
|
48
|
+
backgroundColor: (0, _tokens.token)('color.background.boldBrand.resting', _colors.B400),
|
|
49
|
+
color: (0, _tokens.token)('color.text.onBold', _colors.N0)
|
|
50
|
+
});
|
|
51
|
+
var movedBoldAppearanceStyles = (0, _core.css)({
|
|
52
|
+
backgroundColor: (0, _tokens.token)('color.background.boldWarning.resting', _colors.Y500),
|
|
53
|
+
color: (0, _tokens.token)('color.text.onBoldWarning', _colors.N800)
|
|
54
|
+
});
|
|
55
|
+
var newBoldAppearanceStyles = (0, _core.css)({
|
|
56
|
+
backgroundColor: (0, _tokens.token)('color.background.boldDiscovery.resting', _colors.P400),
|
|
57
|
+
color: (0, _tokens.token)('color.text.onBold', _colors.N0)
|
|
58
|
+
});
|
|
59
|
+
var removedBoldAppearanceStyles = (0, _core.css)({
|
|
60
|
+
backgroundColor: (0, _tokens.token)('color.background.boldDanger.resting', _colors.R400),
|
|
61
|
+
color: (0, _tokens.token)('color.text.onBold', _colors.N0)
|
|
62
|
+
});
|
|
63
|
+
var successBoldAppearanceStyles = (0, _core.css)({
|
|
64
|
+
backgroundColor: (0, _tokens.token)('color.background.boldSuccess.resting', _colors.G400),
|
|
65
|
+
color: (0, _tokens.token)('color.text.onBold', _colors.N0)
|
|
66
|
+
});
|
|
67
|
+
var subtleAppearances = {
|
|
68
|
+
default: defaultAppearanceStyles,
|
|
69
|
+
inprogress: inprogressAppearanceStyles,
|
|
70
|
+
moved: movedAppearanceStyles,
|
|
71
|
+
new: newAppearanceStyles,
|
|
72
|
+
removed: removedAppearanceStyles,
|
|
73
|
+
success: successAppearanceStyles
|
|
74
|
+
};
|
|
75
|
+
var boldAppearances = {
|
|
76
|
+
default: defaultBoldAppearanceStyles,
|
|
77
|
+
inprogress: inprogressBoldAppearanceStyles,
|
|
78
|
+
moved: movedBoldAppearanceStyles,
|
|
79
|
+
new: newBoldAppearanceStyles,
|
|
80
|
+
removed: removedBoldAppearanceStyles,
|
|
81
|
+
success: successBoldAppearanceStyles
|
|
82
|
+
};
|
|
83
|
+
var contentStyles = (0, _core.css)({
|
|
84
|
+
display: 'inline-block',
|
|
85
|
+
boxSizing: 'border-box',
|
|
86
|
+
width: '100%',
|
|
87
|
+
padding: "0 ".concat((0, _constants.gridSize)() / 2, "px"),
|
|
88
|
+
overflow: 'hidden',
|
|
89
|
+
textOverflow: 'ellipsis',
|
|
90
|
+
verticalAlign: 'top',
|
|
91
|
+
whiteSpace: 'nowrap'
|
|
92
|
+
});
|
|
17
93
|
var containerStyles = (0, _core.css)({
|
|
18
94
|
display: 'inline-block',
|
|
19
95
|
boxSizing: 'border-box',
|
|
@@ -26,16 +102,6 @@ var containerStyles = (0, _core.css)({
|
|
|
26
102
|
textTransform: 'uppercase',
|
|
27
103
|
verticalAlign: 'baseline'
|
|
28
104
|
});
|
|
29
|
-
var contentStyles = (0, _core.css)({
|
|
30
|
-
display: 'inline-block',
|
|
31
|
-
boxSizing: 'border-box',
|
|
32
|
-
width: '100%',
|
|
33
|
-
padding: "0 ".concat((0, _constants.gridSize)() / 2, "px"),
|
|
34
|
-
overflow: 'hidden',
|
|
35
|
-
textOverflow: 'ellipsis',
|
|
36
|
-
verticalAlign: 'top',
|
|
37
|
-
whiteSpace: 'nowrap'
|
|
38
|
-
});
|
|
39
105
|
/**
|
|
40
106
|
* __Lozenge__
|
|
41
107
|
*
|
|
@@ -57,14 +123,12 @@ var Lozenge = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
57
123
|
maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
|
|
58
124
|
_ref$style = _ref.style,
|
|
59
125
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
60
|
-
var backgroundColor = style.backgroundColor || (isBold ? _theme.boldBackgroundColor[appearance] : _theme.defaultBackgroundColor[appearance]).light;
|
|
61
|
-
var color = style.color || (isBold ? _theme.boldTextColor[appearance] : _theme.defaultTextColor[appearance]).light;
|
|
62
126
|
return (0, _core.jsx)("span", {
|
|
63
127
|
style: {
|
|
64
|
-
backgroundColor: backgroundColor,
|
|
65
|
-
color: color
|
|
128
|
+
backgroundColor: style.backgroundColor,
|
|
129
|
+
color: style.color
|
|
66
130
|
},
|
|
67
|
-
css: containerStyles,
|
|
131
|
+
css: [isBold ? boldAppearances[appearance] : subtleAppearances[appearance], containerStyles],
|
|
68
132
|
"data-testid": testId
|
|
69
133
|
}, (0, _core.jsx)("span", {
|
|
70
134
|
style: {
|
package/dist/cjs/theme.js
CHANGED
|
@@ -7,10 +7,11 @@ exports.boldTextColor = exports.boldBackgroundColor = exports.defaultTextColor =
|
|
|
7
7
|
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
|
|
10
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
11
|
+
// TODO: DSP-1392 this file will be removed, don't import anything from this file elsewhere.
|
|
12
|
+
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Lozenge does not support dark mode at the moment.
|
|
13
|
-
* Hence, color values are the same.
|
|
14
|
+
* @deprecated
|
|
14
15
|
*/
|
|
15
16
|
var defaultBackgroundColor = {
|
|
16
17
|
default: {
|
|
@@ -38,6 +39,10 @@ var defaultBackgroundColor = {
|
|
|
38
39
|
dark: _colors.G50
|
|
39
40
|
}
|
|
40
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
|
|
41
46
|
exports.defaultBackgroundColor = defaultBackgroundColor;
|
|
42
47
|
var defaultTextColor = {
|
|
43
48
|
default: {
|
|
@@ -65,6 +70,10 @@ var defaultTextColor = {
|
|
|
65
70
|
dark: _colors.G500
|
|
66
71
|
}
|
|
67
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated
|
|
75
|
+
*/
|
|
76
|
+
|
|
68
77
|
exports.defaultTextColor = defaultTextColor;
|
|
69
78
|
var boldBackgroundColor = {
|
|
70
79
|
default: {
|
|
@@ -92,6 +101,10 @@ var boldBackgroundColor = {
|
|
|
92
101
|
dark: _colors.G400
|
|
93
102
|
}
|
|
94
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* @deprecated
|
|
106
|
+
*/
|
|
107
|
+
|
|
95
108
|
exports.boldBackgroundColor = boldBackgroundColor;
|
|
96
109
|
var boldTextColor = {
|
|
97
110
|
default: {
|
|
@@ -119,4 +132,8 @@ var boldTextColor = {
|
|
|
119
132
|
dark: _colors.N0
|
|
120
133
|
}
|
|
121
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* @deprecated
|
|
137
|
+
*/
|
|
138
|
+
|
|
122
139
|
exports.boldTextColor = boldTextColor;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,8 +1,83 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import { B400, B50, B500, G400, G50, G500, N0, N40, N500, N800, P400, P50, P500, R400, R50, R500, Y500, Y75 } from '@atlaskit/theme/colors';
|
|
4
5
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
import {
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
|
+
const defaultAppearanceStyles = css({
|
|
8
|
+
backgroundColor: token('color.background.subtleNeutral.resting', N40),
|
|
9
|
+
color: token('color.text.highEmphasis', N500)
|
|
10
|
+
});
|
|
11
|
+
const inprogressAppearanceStyles = css({
|
|
12
|
+
backgroundColor: token('color.background.subtleBrand.resting', B50),
|
|
13
|
+
color: token('color.text.brand', B500)
|
|
14
|
+
});
|
|
15
|
+
const movedAppearanceStyles = css({
|
|
16
|
+
backgroundColor: token('color.background.subtleWarning.resting', Y75),
|
|
17
|
+
color: token('color.text.warning', N800)
|
|
18
|
+
});
|
|
19
|
+
const newAppearanceStyles = css({
|
|
20
|
+
backgroundColor: token('color.background.subtleDiscovery.resting', P50),
|
|
21
|
+
color: token('color.text.discovery', P500)
|
|
22
|
+
});
|
|
23
|
+
const removedAppearanceStyles = css({
|
|
24
|
+
backgroundColor: token('color.background.subtleDanger.resting', R50),
|
|
25
|
+
color: token('color.text.danger', R500)
|
|
26
|
+
});
|
|
27
|
+
const successAppearanceStyles = css({
|
|
28
|
+
backgroundColor: token('color.background.subtleSuccess.resting', G50),
|
|
29
|
+
color: token('color.text.success', G500)
|
|
30
|
+
});
|
|
31
|
+
const defaultBoldAppearanceStyles = css({
|
|
32
|
+
backgroundColor: token('color.background.boldNeutral.resting', N500),
|
|
33
|
+
color: token('color.text.onBold', N0)
|
|
34
|
+
});
|
|
35
|
+
const inprogressBoldAppearanceStyles = css({
|
|
36
|
+
backgroundColor: token('color.background.boldBrand.resting', B400),
|
|
37
|
+
color: token('color.text.onBold', N0)
|
|
38
|
+
});
|
|
39
|
+
const movedBoldAppearanceStyles = css({
|
|
40
|
+
backgroundColor: token('color.background.boldWarning.resting', Y500),
|
|
41
|
+
color: token('color.text.onBoldWarning', N800)
|
|
42
|
+
});
|
|
43
|
+
const newBoldAppearanceStyles = css({
|
|
44
|
+
backgroundColor: token('color.background.boldDiscovery.resting', P400),
|
|
45
|
+
color: token('color.text.onBold', N0)
|
|
46
|
+
});
|
|
47
|
+
const removedBoldAppearanceStyles = css({
|
|
48
|
+
backgroundColor: token('color.background.boldDanger.resting', R400),
|
|
49
|
+
color: token('color.text.onBold', N0)
|
|
50
|
+
});
|
|
51
|
+
const successBoldAppearanceStyles = css({
|
|
52
|
+
backgroundColor: token('color.background.boldSuccess.resting', G400),
|
|
53
|
+
color: token('color.text.onBold', N0)
|
|
54
|
+
});
|
|
55
|
+
const subtleAppearances = {
|
|
56
|
+
default: defaultAppearanceStyles,
|
|
57
|
+
inprogress: inprogressAppearanceStyles,
|
|
58
|
+
moved: movedAppearanceStyles,
|
|
59
|
+
new: newAppearanceStyles,
|
|
60
|
+
removed: removedAppearanceStyles,
|
|
61
|
+
success: successAppearanceStyles
|
|
62
|
+
};
|
|
63
|
+
const boldAppearances = {
|
|
64
|
+
default: defaultBoldAppearanceStyles,
|
|
65
|
+
inprogress: inprogressBoldAppearanceStyles,
|
|
66
|
+
moved: movedBoldAppearanceStyles,
|
|
67
|
+
new: newBoldAppearanceStyles,
|
|
68
|
+
removed: removedBoldAppearanceStyles,
|
|
69
|
+
success: successBoldAppearanceStyles
|
|
70
|
+
};
|
|
71
|
+
const contentStyles = css({
|
|
72
|
+
display: 'inline-block',
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
width: '100%',
|
|
75
|
+
padding: `0 ${gridSize() / 2}px`,
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
verticalAlign: 'top',
|
|
79
|
+
whiteSpace: 'nowrap'
|
|
80
|
+
});
|
|
6
81
|
const containerStyles = css({
|
|
7
82
|
display: 'inline-block',
|
|
8
83
|
boxSizing: 'border-box',
|
|
@@ -15,16 +90,6 @@ const containerStyles = css({
|
|
|
15
90
|
textTransform: 'uppercase',
|
|
16
91
|
verticalAlign: 'baseline'
|
|
17
92
|
});
|
|
18
|
-
const contentStyles = css({
|
|
19
|
-
display: 'inline-block',
|
|
20
|
-
boxSizing: 'border-box',
|
|
21
|
-
width: '100%',
|
|
22
|
-
padding: `0 ${gridSize() / 2}px`,
|
|
23
|
-
overflow: 'hidden',
|
|
24
|
-
textOverflow: 'ellipsis',
|
|
25
|
-
verticalAlign: 'top',
|
|
26
|
-
whiteSpace: 'nowrap'
|
|
27
|
-
});
|
|
28
93
|
/**
|
|
29
94
|
* __Lozenge__
|
|
30
95
|
*
|
|
@@ -42,22 +107,18 @@ const Lozenge = /*#__PURE__*/memo(({
|
|
|
42
107
|
appearance = 'default',
|
|
43
108
|
maxWidth = 200,
|
|
44
109
|
style = {}
|
|
45
|
-
}) => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
css: contentStyles
|
|
60
|
-
}, children));
|
|
61
|
-
});
|
|
110
|
+
}) => jsx("span", {
|
|
111
|
+
style: {
|
|
112
|
+
backgroundColor: style.backgroundColor,
|
|
113
|
+
color: style.color
|
|
114
|
+
},
|
|
115
|
+
css: [isBold ? boldAppearances[appearance] : subtleAppearances[appearance], containerStyles],
|
|
116
|
+
"data-testid": testId
|
|
117
|
+
}, jsx("span", {
|
|
118
|
+
style: {
|
|
119
|
+
maxWidth
|
|
120
|
+
},
|
|
121
|
+
css: contentStyles
|
|
122
|
+
}, children)));
|
|
62
123
|
Lozenge.displayName = 'Lozenge';
|
|
63
124
|
export default Lozenge;
|
package/dist/es2019/theme.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
|
+
// TODO: DSP-1392 this file will be removed, don't import anything from this file elsewhere.
|
|
1
3
|
import { B400, B50, B500, G400, G50, G500, N0, N40, N500, N800, P400, P50, P500, R400, R50, R500, Y500, Y75 } from '@atlaskit/theme/colors';
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Lozenge does not support dark mode at the moment.
|
|
5
|
-
* Hence, color values are the same.
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export const defaultBackgroundColor = {
|
|
@@ -31,6 +31,10 @@ export const defaultBackgroundColor = {
|
|
|
31
31
|
dark: G50
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
|
|
34
38
|
export const defaultTextColor = {
|
|
35
39
|
default: {
|
|
36
40
|
light: N500,
|
|
@@ -57,6 +61,10 @@ export const defaultTextColor = {
|
|
|
57
61
|
dark: G500
|
|
58
62
|
}
|
|
59
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*/
|
|
67
|
+
|
|
60
68
|
export const boldBackgroundColor = {
|
|
61
69
|
default: {
|
|
62
70
|
light: N500,
|
|
@@ -83,6 +91,10 @@ export const boldBackgroundColor = {
|
|
|
83
91
|
dark: G400
|
|
84
92
|
}
|
|
85
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated
|
|
96
|
+
*/
|
|
97
|
+
|
|
86
98
|
export const boldTextColor = {
|
|
87
99
|
default: {
|
|
88
100
|
light: N0,
|
|
@@ -108,4 +120,7 @@ export const boldTextColor = {
|
|
|
108
120
|
light: N0,
|
|
109
121
|
dark: N0
|
|
110
122
|
}
|
|
111
|
-
};
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated
|
|
126
|
+
*/
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,8 +1,83 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
|
+
import { B400, B50, B500, G400, G50, G500, N0, N40, N500, N800, P400, P50, P500, R400, R50, R500, Y500, Y75 } from '@atlaskit/theme/colors';
|
|
4
5
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
import {
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
|
+
var defaultAppearanceStyles = css({
|
|
8
|
+
backgroundColor: token('color.background.subtleNeutral.resting', N40),
|
|
9
|
+
color: token('color.text.highEmphasis', N500)
|
|
10
|
+
});
|
|
11
|
+
var inprogressAppearanceStyles = css({
|
|
12
|
+
backgroundColor: token('color.background.subtleBrand.resting', B50),
|
|
13
|
+
color: token('color.text.brand', B500)
|
|
14
|
+
});
|
|
15
|
+
var movedAppearanceStyles = css({
|
|
16
|
+
backgroundColor: token('color.background.subtleWarning.resting', Y75),
|
|
17
|
+
color: token('color.text.warning', N800)
|
|
18
|
+
});
|
|
19
|
+
var newAppearanceStyles = css({
|
|
20
|
+
backgroundColor: token('color.background.subtleDiscovery.resting', P50),
|
|
21
|
+
color: token('color.text.discovery', P500)
|
|
22
|
+
});
|
|
23
|
+
var removedAppearanceStyles = css({
|
|
24
|
+
backgroundColor: token('color.background.subtleDanger.resting', R50),
|
|
25
|
+
color: token('color.text.danger', R500)
|
|
26
|
+
});
|
|
27
|
+
var successAppearanceStyles = css({
|
|
28
|
+
backgroundColor: token('color.background.subtleSuccess.resting', G50),
|
|
29
|
+
color: token('color.text.success', G500)
|
|
30
|
+
});
|
|
31
|
+
var defaultBoldAppearanceStyles = css({
|
|
32
|
+
backgroundColor: token('color.background.boldNeutral.resting', N500),
|
|
33
|
+
color: token('color.text.onBold', N0)
|
|
34
|
+
});
|
|
35
|
+
var inprogressBoldAppearanceStyles = css({
|
|
36
|
+
backgroundColor: token('color.background.boldBrand.resting', B400),
|
|
37
|
+
color: token('color.text.onBold', N0)
|
|
38
|
+
});
|
|
39
|
+
var movedBoldAppearanceStyles = css({
|
|
40
|
+
backgroundColor: token('color.background.boldWarning.resting', Y500),
|
|
41
|
+
color: token('color.text.onBoldWarning', N800)
|
|
42
|
+
});
|
|
43
|
+
var newBoldAppearanceStyles = css({
|
|
44
|
+
backgroundColor: token('color.background.boldDiscovery.resting', P400),
|
|
45
|
+
color: token('color.text.onBold', N0)
|
|
46
|
+
});
|
|
47
|
+
var removedBoldAppearanceStyles = css({
|
|
48
|
+
backgroundColor: token('color.background.boldDanger.resting', R400),
|
|
49
|
+
color: token('color.text.onBold', N0)
|
|
50
|
+
});
|
|
51
|
+
var successBoldAppearanceStyles = css({
|
|
52
|
+
backgroundColor: token('color.background.boldSuccess.resting', G400),
|
|
53
|
+
color: token('color.text.onBold', N0)
|
|
54
|
+
});
|
|
55
|
+
var subtleAppearances = {
|
|
56
|
+
default: defaultAppearanceStyles,
|
|
57
|
+
inprogress: inprogressAppearanceStyles,
|
|
58
|
+
moved: movedAppearanceStyles,
|
|
59
|
+
new: newAppearanceStyles,
|
|
60
|
+
removed: removedAppearanceStyles,
|
|
61
|
+
success: successAppearanceStyles
|
|
62
|
+
};
|
|
63
|
+
var boldAppearances = {
|
|
64
|
+
default: defaultBoldAppearanceStyles,
|
|
65
|
+
inprogress: inprogressBoldAppearanceStyles,
|
|
66
|
+
moved: movedBoldAppearanceStyles,
|
|
67
|
+
new: newBoldAppearanceStyles,
|
|
68
|
+
removed: removedBoldAppearanceStyles,
|
|
69
|
+
success: successBoldAppearanceStyles
|
|
70
|
+
};
|
|
71
|
+
var contentStyles = css({
|
|
72
|
+
display: 'inline-block',
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
width: '100%',
|
|
75
|
+
padding: "0 ".concat(gridSize() / 2, "px"),
|
|
76
|
+
overflow: 'hidden',
|
|
77
|
+
textOverflow: 'ellipsis',
|
|
78
|
+
verticalAlign: 'top',
|
|
79
|
+
whiteSpace: 'nowrap'
|
|
80
|
+
});
|
|
6
81
|
var containerStyles = css({
|
|
7
82
|
display: 'inline-block',
|
|
8
83
|
boxSizing: 'border-box',
|
|
@@ -15,16 +90,6 @@ var containerStyles = css({
|
|
|
15
90
|
textTransform: 'uppercase',
|
|
16
91
|
verticalAlign: 'baseline'
|
|
17
92
|
});
|
|
18
|
-
var contentStyles = css({
|
|
19
|
-
display: 'inline-block',
|
|
20
|
-
boxSizing: 'border-box',
|
|
21
|
-
width: '100%',
|
|
22
|
-
padding: "0 ".concat(gridSize() / 2, "px"),
|
|
23
|
-
overflow: 'hidden',
|
|
24
|
-
textOverflow: 'ellipsis',
|
|
25
|
-
verticalAlign: 'top',
|
|
26
|
-
whiteSpace: 'nowrap'
|
|
27
|
-
});
|
|
28
93
|
/**
|
|
29
94
|
* __Lozenge__
|
|
30
95
|
*
|
|
@@ -46,14 +111,12 @@ var Lozenge = /*#__PURE__*/memo(function (_ref) {
|
|
|
46
111
|
maxWidth = _ref$maxWidth === void 0 ? 200 : _ref$maxWidth,
|
|
47
112
|
_ref$style = _ref.style,
|
|
48
113
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
49
|
-
var backgroundColor = style.backgroundColor || (isBold ? boldBackgroundColor[appearance] : defaultBackgroundColor[appearance]).light;
|
|
50
|
-
var color = style.color || (isBold ? boldTextColor[appearance] : defaultTextColor[appearance]).light;
|
|
51
114
|
return jsx("span", {
|
|
52
115
|
style: {
|
|
53
|
-
backgroundColor: backgroundColor,
|
|
54
|
-
color: color
|
|
116
|
+
backgroundColor: style.backgroundColor,
|
|
117
|
+
color: style.color
|
|
55
118
|
},
|
|
56
|
-
css: containerStyles,
|
|
119
|
+
css: [isBold ? boldAppearances[appearance] : subtleAppearances[appearance], containerStyles],
|
|
57
120
|
"data-testid": testId
|
|
58
121
|
}, jsx("span", {
|
|
59
122
|
style: {
|
package/dist/esm/theme.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
2
|
+
// TODO: DSP-1392 this file will be removed, don't import anything from this file elsewhere.
|
|
1
3
|
import { B400, B50, B500, G400, G50, G500, N0, N40, N500, N800, P400, P50, P500, R400, R50, R500, Y500, Y75 } from '@atlaskit/theme/colors';
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Lozenge does not support dark mode at the moment.
|
|
5
|
-
* Hence, color values are the same.
|
|
5
|
+
* @deprecated
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export var defaultBackgroundColor = {
|
|
@@ -31,6 +31,10 @@ export var defaultBackgroundColor = {
|
|
|
31
31
|
dark: G50
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
|
|
34
38
|
export var defaultTextColor = {
|
|
35
39
|
default: {
|
|
36
40
|
light: N500,
|
|
@@ -57,6 +61,10 @@ export var defaultTextColor = {
|
|
|
57
61
|
dark: G500
|
|
58
62
|
}
|
|
59
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated
|
|
66
|
+
*/
|
|
67
|
+
|
|
60
68
|
export var boldBackgroundColor = {
|
|
61
69
|
default: {
|
|
62
70
|
light: N500,
|
|
@@ -83,6 +91,10 @@ export var boldBackgroundColor = {
|
|
|
83
91
|
dark: G400
|
|
84
92
|
}
|
|
85
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated
|
|
96
|
+
*/
|
|
97
|
+
|
|
86
98
|
export var boldTextColor = {
|
|
87
99
|
default: {
|
|
88
100
|
light: N0,
|
|
@@ -108,4 +120,7 @@ export var boldTextColor = {
|
|
|
108
120
|
light: N0,
|
|
109
121
|
dark: N0
|
|
110
122
|
}
|
|
111
|
-
};
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* @deprecated
|
|
126
|
+
*/
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
-
|
|
3
|
+
export declare type ThemeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
4
4
|
export interface LozengeProps {
|
|
5
5
|
/**
|
|
6
6
|
* The appearance type.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Lozenge';
|
|
2
|
-
export type { ThemeAppearance } from './
|
|
2
|
+
export type { ThemeAppearance } from './Lozenge';
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Lozenge does not support dark mode at the moment.
|
|
4
|
-
* Hence, color values are the same.
|
|
2
|
+
* @deprecated
|
|
5
3
|
*/
|
|
6
4
|
export declare const defaultBackgroundColor: {
|
|
7
5
|
default: {
|
|
@@ -29,6 +27,9 @@ export declare const defaultBackgroundColor: {
|
|
|
29
27
|
dark: string;
|
|
30
28
|
};
|
|
31
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
32
33
|
export declare const defaultTextColor: {
|
|
33
34
|
default: {
|
|
34
35
|
light: string;
|
|
@@ -55,6 +56,9 @@ export declare const defaultTextColor: {
|
|
|
55
56
|
dark: string;
|
|
56
57
|
};
|
|
57
58
|
};
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated
|
|
61
|
+
*/
|
|
58
62
|
export declare const boldBackgroundColor: {
|
|
59
63
|
default: {
|
|
60
64
|
light: string;
|
|
@@ -81,6 +85,9 @@ export declare const boldBackgroundColor: {
|
|
|
81
85
|
dark: string;
|
|
82
86
|
};
|
|
83
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated
|
|
90
|
+
*/
|
|
84
91
|
export declare const boldTextColor: {
|
|
85
92
|
default: {
|
|
86
93
|
light: string;
|
|
@@ -107,4 +114,7 @@ export declare const boldTextColor: {
|
|
|
107
114
|
dark: string;
|
|
108
115
|
};
|
|
109
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated
|
|
119
|
+
*/
|
|
110
120
|
export declare type ThemeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/lozenge",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.3",
|
|
4
4
|
"description": "A lozenge is a visual indicator used to highlight an item's status for quick recognition.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/codemod-utils": "^3.
|
|
28
|
-
"@atlaskit/theme": "^
|
|
27
|
+
"@atlaskit/codemod-utils": "^3.4.0",
|
|
28
|
+
"@atlaskit/theme": "^12.0.0",
|
|
29
|
+
"@atlaskit/tokens": "^0.3.0",
|
|
29
30
|
"@babel/runtime": "^7.0.0",
|
|
30
31
|
"@emotion/core": "^10.0.9"
|
|
31
32
|
},
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"@atlaskit/build-utils": "*",
|
|
37
38
|
"@atlaskit/button": "*",
|
|
38
39
|
"@atlaskit/docs": "*",
|
|
40
|
+
"@atlaskit/section-message": "^6.1.0",
|
|
39
41
|
"@atlaskit/ssr": "*",
|
|
40
42
|
"@atlaskit/visual-regression": "*",
|
|
41
43
|
"@atlaskit/webdriver-runner": "*",
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
"styling": "emotion",
|
|
56
58
|
"ui-components": "lite-mode",
|
|
57
59
|
"analytics": "analytics-next",
|
|
58
|
-
"theming": "
|
|
60
|
+
"theming": "tokens",
|
|
59
61
|
"deprecation": "no-deprecated-imports"
|
|
60
62
|
}
|
|
61
63
|
},
|