@atlaskit/flag 14.5.7 → 14.6.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/CHANGELOG.md +23 -0
- package/auto-dismiss-flag/package.json +1 -0
- package/constants/package.json +1 -0
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/flag.js +19 -10
- package/dist/cjs/internal/description.js +4 -3
- package/dist/cjs/internal/dismiss-button.js +4 -1
- package/dist/cjs/internal/expander.js +2 -1
- package/dist/cjs/internal/title.js +2 -5
- package/dist/cjs/theme.js +10 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/flag.js +18 -10
- package/dist/es2019/internal/description.js +4 -3
- package/dist/es2019/internal/dismiss-button.js +4 -1
- package/dist/es2019/internal/expander.js +3 -2
- package/dist/es2019/internal/title.js +2 -5
- package/dist/es2019/theme.js +9 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/flag.js +19 -10
- package/dist/esm/internal/description.js +4 -3
- package/dist/esm/internal/dismiss-button.js +4 -1
- package/dist/esm/internal/expander.js +3 -2
- package/dist/esm/internal/title.js +2 -5
- package/dist/esm/theme.js +9 -6
- package/dist/esm/version.json +1 -1
- package/dist/types/internal/description.d.ts +1 -0
- package/dist/types/theme.d.ts +2 -2
- package/flag/package.json +1 -0
- package/flag-actions/package.json +1 -0
- package/flag-group/package.json +1 -0
- package/flag-provider/package.json +1 -0
- package/package.json +8 -6
- package/theme/package.json +1 -0
- package/types/package.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/flag
|
|
2
2
|
|
|
3
|
+
## 14.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`379b0a864df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/379b0a864df) - [ux] Remove truncation of titles and wrap text instead. Very slightly changed title text positioning.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`f16146d83ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f16146d83ff) - [ux] Fix cross icon positioning
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 14.5.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`2329b0e8cc0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2329b0e8cc0) - [ux] DSP-4541 Update wrongly used tokens
|
|
19
|
+
|
|
20
|
+
## 14.5.8
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 14.5.7
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/constants/package.json
CHANGED
|
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
27
27
|
|
|
28
28
|
var packageName = "@atlaskit/flag";
|
|
29
|
-
var packageVersion = "14.
|
|
29
|
+
var packageVersion = "14.6.0";
|
|
30
30
|
var AUTO_DISMISS_SECONDS = 8;
|
|
31
31
|
exports.AUTO_DISMISS_SECONDS = AUTO_DISMISS_SECONDS;
|
|
32
32
|
|
package/dist/cjs/flag.js
CHANGED
|
@@ -44,15 +44,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
44
44
|
var analyticsAttributes = {
|
|
45
45
|
componentName: 'flag',
|
|
46
46
|
packageName: "@atlaskit/flag",
|
|
47
|
-
packageVersion: "14.
|
|
47
|
+
packageVersion: "14.6.0"
|
|
48
48
|
};
|
|
49
49
|
var gridSize = (0, _constants.gridSize)();
|
|
50
50
|
var doubleGridSize = gridSize * 2;
|
|
51
|
-
var
|
|
52
|
-
var iconStyles = (0, _core.css)({
|
|
51
|
+
var titleGroupStyles = (0, _core.css)({
|
|
53
52
|
display: 'flex',
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
alignItems: 'start'
|
|
54
|
+
});
|
|
55
|
+
var iconTitleStyles = (0, _core.css)({
|
|
56
|
+
display: 'flex',
|
|
57
|
+
paddingTop: "".concat(gridSize / 2, "px"),
|
|
58
|
+
alignItems: 'start',
|
|
59
|
+
flex: 1
|
|
56
60
|
});
|
|
57
61
|
var flagHeaderStyles = (0, _core.css)({
|
|
58
62
|
boxSizing: 'border-box',
|
|
@@ -140,12 +144,14 @@ var Flag = function Flag(props) {
|
|
|
140
144
|
onMouseOut: onMouseOut,
|
|
141
145
|
onBlur: onBlurAnalytics
|
|
142
146
|
};
|
|
143
|
-
var
|
|
147
|
+
var boxShadowValue = "0 20px 32px -8px ".concat(_theme.flagShadowColor);
|
|
144
148
|
|
|
145
149
|
if (!isBold) {
|
|
146
|
-
|
|
150
|
+
boxShadowValue = "0 0 1px ".concat(_theme.flagBorderColor, ", ").concat(boxShadowValue);
|
|
147
151
|
}
|
|
148
152
|
|
|
153
|
+
var boxShadow = "var(--ds-shadow-overlay, ".concat(boxShadowValue, ")");
|
|
154
|
+
|
|
149
155
|
var _useGlobalTheme = (0, _components.useGlobalTheme)(),
|
|
150
156
|
mode = _useGlobalTheme.mode;
|
|
151
157
|
|
|
@@ -169,10 +175,12 @@ var Flag = function Flag(props) {
|
|
|
169
175
|
style: {
|
|
170
176
|
color: iconColor
|
|
171
177
|
},
|
|
172
|
-
css:
|
|
178
|
+
css: titleGroupStyles
|
|
179
|
+
}, (0, _core.jsx)("div", {
|
|
180
|
+
css: iconTitleStyles
|
|
173
181
|
}, icon, (0, _core.jsx)(_internal.Title, {
|
|
174
182
|
color: textColor
|
|
175
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && (0, _core.jsx)(_internal.DismissButton, {
|
|
183
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && (0, _core.jsx)(_internal.DismissButton, {
|
|
176
184
|
testId: testId,
|
|
177
185
|
appearance: appearance,
|
|
178
186
|
isBold: isBold,
|
|
@@ -183,7 +191,8 @@ var Flag = function Flag(props) {
|
|
|
183
191
|
testId: testId
|
|
184
192
|
}, description && (0, _core.jsx)(_internal.Description, {
|
|
185
193
|
testId: testId && "".concat(testId, "-description"),
|
|
186
|
-
color: textColor
|
|
194
|
+
color: textColor,
|
|
195
|
+
isBold: isBold
|
|
187
196
|
}, description), (0, _core.jsx)(_flagActions.default, {
|
|
188
197
|
actions: actions,
|
|
189
198
|
appearance: appearance,
|
|
@@ -9,8 +9,8 @@ var _core = require("@emotion/core");
|
|
|
9
9
|
|
|
10
10
|
/** @jsx jsx */
|
|
11
11
|
var descriptionStyles = (0, _core.css)({
|
|
12
|
-
/* height is defined as 5 lines maximum by design */
|
|
13
12
|
maxHeight: 100,
|
|
13
|
+
// height is defined as 5 lines maximum by design
|
|
14
14
|
overflow: 'auto',
|
|
15
15
|
wordWrap: 'break-word'
|
|
16
16
|
});
|
|
@@ -18,12 +18,13 @@ var descriptionStyles = (0, _core.css)({
|
|
|
18
18
|
var Description = function Description(_ref) {
|
|
19
19
|
var color = _ref.color,
|
|
20
20
|
testId = _ref.testId,
|
|
21
|
-
children = _ref.children
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
isBold = _ref.isBold;
|
|
22
23
|
return (0, _core.jsx)("div", {
|
|
23
24
|
style: {
|
|
24
25
|
color: color
|
|
25
26
|
},
|
|
26
|
-
css: descriptionStyles,
|
|
27
|
+
css: [descriptionStyles],
|
|
27
28
|
"data-testid": testId
|
|
28
29
|
}, children);
|
|
29
30
|
};
|
|
@@ -40,6 +40,9 @@ var dismissButtonStyles = (0, _core.css)({
|
|
|
40
40
|
lineHeight: '1',
|
|
41
41
|
whiteSpace: 'nowrap'
|
|
42
42
|
});
|
|
43
|
+
var crossIconStyles = (0, _core.css)({
|
|
44
|
+
paddingTop: "".concat(gridSize, "px")
|
|
45
|
+
});
|
|
43
46
|
|
|
44
47
|
var DismissButton = function DismissButton(_ref) {
|
|
45
48
|
var appearance = _ref.appearance,
|
|
@@ -67,7 +70,7 @@ var DismissButton = function DismissButton(_ref) {
|
|
|
67
70
|
style: {
|
|
68
71
|
color: (0, _theme.getFlagTextColor)(appearance, mode)
|
|
69
72
|
},
|
|
70
|
-
css: dismissButtonStyles,
|
|
73
|
+
css: [dismissButtonStyles, !isBold && crossIconStyles],
|
|
71
74
|
onClick: onClick,
|
|
72
75
|
"data-testid": buttonTestId,
|
|
73
76
|
type: "button",
|
|
@@ -12,7 +12,8 @@ var _motion = require("@atlaskit/motion");
|
|
|
12
12
|
var _constants = require("@atlaskit/theme/constants");
|
|
13
13
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
|
-
var
|
|
15
|
+
var gridSize = (0, _constants.gridSize)();
|
|
16
|
+
var paddingLeft = gridSize * 5;
|
|
16
17
|
var expanderStyles = (0, _core.css)({
|
|
17
18
|
display: 'flex',
|
|
18
19
|
minWidth: 0,
|
|
@@ -9,12 +9,9 @@ var _core = require("@emotion/core");
|
|
|
9
9
|
|
|
10
10
|
/** @jsx jsx */
|
|
11
11
|
var titleStyles = (0, _core.css)({
|
|
12
|
-
padding: "
|
|
12
|
+
padding: "2px 0 6px 16px",
|
|
13
13
|
flex: 1,
|
|
14
|
-
fontWeight: 600
|
|
15
|
-
overflow: 'hidden',
|
|
16
|
-
textOverflow: 'ellipsis',
|
|
17
|
-
whiteSpace: 'nowrap'
|
|
14
|
+
fontWeight: 600
|
|
18
15
|
});
|
|
19
16
|
|
|
20
17
|
var Title = function Title(_ref) {
|
package/dist/cjs/theme.js
CHANGED
|
@@ -32,11 +32,18 @@ var flagBackgroundColor = {
|
|
|
32
32
|
|
|
33
33
|
var getFlagBackgroundColor = function getFlagBackgroundColor(appearance, mode) {
|
|
34
34
|
return flagBackgroundColor[appearance][mode];
|
|
35
|
-
};
|
|
35
|
+
}; // token set in flag.tsx instead
|
|
36
|
+
|
|
37
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
38
|
+
|
|
36
39
|
|
|
37
40
|
exports.getFlagBackgroundColor = getFlagBackgroundColor;
|
|
38
|
-
var flagBorderColor =
|
|
41
|
+
var flagBorderColor = _colors.N60A;
|
|
39
42
|
exports.flagBorderColor = flagBorderColor;
|
|
43
|
+
var flagShadowColor = _colors.N50A;
|
|
44
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
45
|
+
|
|
46
|
+
exports.flagShadowColor = flagShadowColor;
|
|
40
47
|
var flagIconColor = {
|
|
41
48
|
error: {
|
|
42
49
|
light: "var(--ds-icon-inverse, ".concat(_colors.N0, ")"),
|
|
@@ -90,13 +97,9 @@ exports.getFlagTextColor = getFlagTextColor;
|
|
|
90
97
|
|
|
91
98
|
var getFlagIconColor = function getFlagIconColor(appearance, mode) {
|
|
92
99
|
return flagIconColor[appearance][mode];
|
|
93
|
-
};
|
|
94
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
95
|
-
|
|
100
|
+
};
|
|
96
101
|
|
|
97
102
|
exports.getFlagIconColor = getFlagIconColor;
|
|
98
|
-
var flagShadowColor = _colors.N50A;
|
|
99
|
-
exports.flagShadowColor = flagShadowColor;
|
|
100
103
|
var flagFocusRingColor = {
|
|
101
104
|
error: {
|
|
102
105
|
light: "var(--ds-border-focused, ".concat(_colors.N40, ")"),
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
5
5
|
import Flag from './flag';
|
|
6
6
|
import { useFlagGroup } from './flag-group';
|
|
7
7
|
const packageName = "@atlaskit/flag";
|
|
8
|
-
const packageVersion = "14.
|
|
8
|
+
const packageVersion = "14.6.0";
|
|
9
9
|
export const AUTO_DISMISS_SECONDS = 8;
|
|
10
10
|
|
|
11
11
|
const AutoDismissFlag = props => {
|
package/dist/es2019/flag.js
CHANGED
|
@@ -16,15 +16,19 @@ import { Title, Description, Expander, DismissButton } from './internal';
|
|
|
16
16
|
const analyticsAttributes = {
|
|
17
17
|
componentName: 'flag',
|
|
18
18
|
packageName: "@atlaskit/flag",
|
|
19
|
-
packageVersion: "14.
|
|
19
|
+
packageVersion: "14.6.0"
|
|
20
20
|
};
|
|
21
21
|
const gridSize = getGridSize();
|
|
22
22
|
const doubleGridSize = gridSize * 2;
|
|
23
|
-
const
|
|
24
|
-
const iconStyles = css({
|
|
23
|
+
const titleGroupStyles = css({
|
|
25
24
|
display: 'flex',
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
alignItems: 'start'
|
|
26
|
+
});
|
|
27
|
+
const iconTitleStyles = css({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
paddingTop: `${gridSize / 2}px`,
|
|
30
|
+
alignItems: 'start',
|
|
31
|
+
flex: 1
|
|
28
32
|
});
|
|
29
33
|
const flagHeaderStyles = css({
|
|
30
34
|
boxSizing: 'border-box',
|
|
@@ -104,12 +108,13 @@ const Flag = props => {
|
|
|
104
108
|
onMouseOut,
|
|
105
109
|
onBlur: onBlurAnalytics
|
|
106
110
|
};
|
|
107
|
-
let
|
|
111
|
+
let boxShadowValue = `0 20px 32px -8px ${flagShadowColor}`;
|
|
108
112
|
|
|
109
113
|
if (!isBold) {
|
|
110
|
-
|
|
114
|
+
boxShadowValue = `0 0 1px ${flagBorderColor}, ${boxShadowValue}`;
|
|
111
115
|
}
|
|
112
116
|
|
|
117
|
+
const boxShadow = `var(--ds-shadow-overlay, ${boxShadowValue})`;
|
|
113
118
|
const {
|
|
114
119
|
mode
|
|
115
120
|
} = useGlobalTheme();
|
|
@@ -133,10 +138,12 @@ const Flag = props => {
|
|
|
133
138
|
style: {
|
|
134
139
|
color: iconColor
|
|
135
140
|
},
|
|
136
|
-
css:
|
|
141
|
+
css: titleGroupStyles
|
|
142
|
+
}, jsx("div", {
|
|
143
|
+
css: iconTitleStyles
|
|
137
144
|
}, icon, jsx(Title, {
|
|
138
145
|
color: textColor
|
|
139
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
146
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
140
147
|
testId: testId,
|
|
141
148
|
appearance: appearance,
|
|
142
149
|
isBold: isBold,
|
|
@@ -147,7 +154,8 @@ const Flag = props => {
|
|
|
147
154
|
testId: testId
|
|
148
155
|
}, description && jsx(Description, {
|
|
149
156
|
testId: testId && `${testId}-description`,
|
|
150
|
-
color: textColor
|
|
157
|
+
color: textColor,
|
|
158
|
+
isBold: isBold
|
|
151
159
|
}, description), jsx(Actions, {
|
|
152
160
|
actions: actions,
|
|
153
161
|
appearance: appearance,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, css } from '@emotion/core';
|
|
3
3
|
const descriptionStyles = css({
|
|
4
|
-
/* height is defined as 5 lines maximum by design */
|
|
5
4
|
maxHeight: 100,
|
|
5
|
+
// height is defined as 5 lines maximum by design
|
|
6
6
|
overflow: 'auto',
|
|
7
7
|
wordWrap: 'break-word'
|
|
8
8
|
});
|
|
@@ -10,12 +10,13 @@ const descriptionStyles = css({
|
|
|
10
10
|
const Description = ({
|
|
11
11
|
color,
|
|
12
12
|
testId,
|
|
13
|
-
children
|
|
13
|
+
children,
|
|
14
|
+
isBold
|
|
14
15
|
}) => jsx("div", {
|
|
15
16
|
style: {
|
|
16
17
|
color
|
|
17
18
|
},
|
|
18
|
-
css: descriptionStyles,
|
|
19
|
+
css: [descriptionStyles],
|
|
19
20
|
"data-testid": testId
|
|
20
21
|
}, children);
|
|
21
22
|
|
|
@@ -22,6 +22,9 @@ const dismissButtonStyles = css({
|
|
|
22
22
|
lineHeight: '1',
|
|
23
23
|
whiteSpace: 'nowrap'
|
|
24
24
|
});
|
|
25
|
+
const crossIconStyles = css({
|
|
26
|
+
paddingTop: `${gridSize}px`
|
|
27
|
+
});
|
|
25
28
|
|
|
26
29
|
const DismissButton = ({
|
|
27
30
|
appearance,
|
|
@@ -49,7 +52,7 @@ const DismissButton = ({
|
|
|
49
52
|
style: {
|
|
50
53
|
color: getFlagTextColor(appearance, mode)
|
|
51
54
|
},
|
|
52
|
-
css: dismissButtonStyles,
|
|
55
|
+
css: [dismissButtonStyles, !isBold && crossIconStyles],
|
|
53
56
|
onClick: onClick,
|
|
54
57
|
"data-testid": buttonTestId,
|
|
55
58
|
type: "button",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/core';
|
|
3
3
|
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
const
|
|
4
|
+
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
|
+
const gridSize = getGridSize();
|
|
6
|
+
const paddingLeft = gridSize * 5;
|
|
6
7
|
const expanderStyles = css({
|
|
7
8
|
display: 'flex',
|
|
8
9
|
minWidth: 0,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, css } from '@emotion/core';
|
|
3
3
|
const titleStyles = css({
|
|
4
|
-
padding: `
|
|
4
|
+
padding: `2px 0 6px 16px`,
|
|
5
5
|
flex: 1,
|
|
6
|
-
fontWeight: 600
|
|
7
|
-
overflow: 'hidden',
|
|
8
|
-
textOverflow: 'ellipsis',
|
|
9
|
-
whiteSpace: 'nowrap'
|
|
6
|
+
fontWeight: 600
|
|
10
7
|
});
|
|
11
8
|
|
|
12
9
|
const Title = ({
|
package/dist/es2019/theme.js
CHANGED
|
@@ -21,8 +21,14 @@ const flagBackgroundColor = {
|
|
|
21
21
|
dark: `var(--ds-background-warning-bold, ${Y300})`
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
export const getFlagBackgroundColor = (appearance, mode) => flagBackgroundColor[appearance][mode];
|
|
25
|
-
|
|
24
|
+
export const getFlagBackgroundColor = (appearance, mode) => flagBackgroundColor[appearance][mode]; // token set in flag.tsx instead
|
|
25
|
+
|
|
26
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
27
|
+
|
|
28
|
+
export const flagBorderColor = N60A;
|
|
29
|
+
export const flagShadowColor = N50A;
|
|
30
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
31
|
+
|
|
26
32
|
const flagIconColor = {
|
|
27
33
|
error: {
|
|
28
34
|
light: `var(--ds-icon-inverse, ${N0})`,
|
|
@@ -68,10 +74,7 @@ const flagTextColor = {
|
|
|
68
74
|
}
|
|
69
75
|
};
|
|
70
76
|
export const getFlagTextColor = (appearance, mode) => flagTextColor[appearance][mode];
|
|
71
|
-
export const getFlagIconColor = (appearance, mode) => flagIconColor[appearance][mode];
|
|
72
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
73
|
-
|
|
74
|
-
export const flagShadowColor = N50A;
|
|
77
|
+
export const getFlagIconColor = (appearance, mode) => flagIconColor[appearance][mode];
|
|
75
78
|
const flagFocusRingColor = {
|
|
76
79
|
error: {
|
|
77
80
|
light: `var(--ds-border-focused, ${N40})`,
|
package/dist/es2019/version.json
CHANGED
|
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
|
|
|
5
5
|
import Flag from './flag';
|
|
6
6
|
import { useFlagGroup } from './flag-group';
|
|
7
7
|
var packageName = "@atlaskit/flag";
|
|
8
|
-
var packageVersion = "14.
|
|
8
|
+
var packageVersion = "14.6.0";
|
|
9
9
|
export var AUTO_DISMISS_SECONDS = 8;
|
|
10
10
|
|
|
11
11
|
var AutoDismissFlag = function AutoDismissFlag(props) {
|
package/dist/esm/flag.js
CHANGED
|
@@ -22,15 +22,19 @@ import { Title, Description, Expander, DismissButton } from './internal';
|
|
|
22
22
|
var analyticsAttributes = {
|
|
23
23
|
componentName: 'flag',
|
|
24
24
|
packageName: "@atlaskit/flag",
|
|
25
|
-
packageVersion: "14.
|
|
25
|
+
packageVersion: "14.6.0"
|
|
26
26
|
};
|
|
27
27
|
var gridSize = getGridSize();
|
|
28
28
|
var doubleGridSize = gridSize * 2;
|
|
29
|
-
var
|
|
30
|
-
var iconStyles = css({
|
|
29
|
+
var titleGroupStyles = css({
|
|
31
30
|
display: 'flex',
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
alignItems: 'start'
|
|
32
|
+
});
|
|
33
|
+
var iconTitleStyles = css({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
paddingTop: "".concat(gridSize / 2, "px"),
|
|
36
|
+
alignItems: 'start',
|
|
37
|
+
flex: 1
|
|
34
38
|
});
|
|
35
39
|
var flagHeaderStyles = css({
|
|
36
40
|
boxSizing: 'border-box',
|
|
@@ -118,12 +122,14 @@ var Flag = function Flag(props) {
|
|
|
118
122
|
onMouseOut: onMouseOut,
|
|
119
123
|
onBlur: onBlurAnalytics
|
|
120
124
|
};
|
|
121
|
-
var
|
|
125
|
+
var boxShadowValue = "0 20px 32px -8px ".concat(flagShadowColor);
|
|
122
126
|
|
|
123
127
|
if (!isBold) {
|
|
124
|
-
|
|
128
|
+
boxShadowValue = "0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadowValue);
|
|
125
129
|
}
|
|
126
130
|
|
|
131
|
+
var boxShadow = "var(--ds-shadow-overlay, ".concat(boxShadowValue, ")");
|
|
132
|
+
|
|
127
133
|
var _useGlobalTheme = useGlobalTheme(),
|
|
128
134
|
mode = _useGlobalTheme.mode;
|
|
129
135
|
|
|
@@ -147,10 +153,12 @@ var Flag = function Flag(props) {
|
|
|
147
153
|
style: {
|
|
148
154
|
color: iconColor
|
|
149
155
|
},
|
|
150
|
-
css:
|
|
156
|
+
css: titleGroupStyles
|
|
157
|
+
}, jsx("div", {
|
|
158
|
+
css: iconTitleStyles
|
|
151
159
|
}, icon, jsx(Title, {
|
|
152
160
|
color: textColor
|
|
153
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
161
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
154
162
|
testId: testId,
|
|
155
163
|
appearance: appearance,
|
|
156
164
|
isBold: isBold,
|
|
@@ -161,7 +169,8 @@ var Flag = function Flag(props) {
|
|
|
161
169
|
testId: testId
|
|
162
170
|
}, description && jsx(Description, {
|
|
163
171
|
testId: testId && "".concat(testId, "-description"),
|
|
164
|
-
color: textColor
|
|
172
|
+
color: textColor,
|
|
173
|
+
isBold: isBold
|
|
165
174
|
}, description), jsx(Actions, {
|
|
166
175
|
actions: actions,
|
|
167
176
|
appearance: appearance,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, css } from '@emotion/core';
|
|
3
3
|
var descriptionStyles = css({
|
|
4
|
-
/* height is defined as 5 lines maximum by design */
|
|
5
4
|
maxHeight: 100,
|
|
5
|
+
// height is defined as 5 lines maximum by design
|
|
6
6
|
overflow: 'auto',
|
|
7
7
|
wordWrap: 'break-word'
|
|
8
8
|
});
|
|
@@ -10,12 +10,13 @@ var descriptionStyles = css({
|
|
|
10
10
|
var Description = function Description(_ref) {
|
|
11
11
|
var color = _ref.color,
|
|
12
12
|
testId = _ref.testId,
|
|
13
|
-
children = _ref.children
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
isBold = _ref.isBold;
|
|
14
15
|
return jsx("div", {
|
|
15
16
|
style: {
|
|
16
17
|
color: color
|
|
17
18
|
},
|
|
18
|
-
css: descriptionStyles,
|
|
19
|
+
css: [descriptionStyles],
|
|
19
20
|
"data-testid": testId
|
|
20
21
|
}, children);
|
|
21
22
|
};
|
|
@@ -22,6 +22,9 @@ var dismissButtonStyles = css({
|
|
|
22
22
|
lineHeight: '1',
|
|
23
23
|
whiteSpace: 'nowrap'
|
|
24
24
|
});
|
|
25
|
+
var crossIconStyles = css({
|
|
26
|
+
paddingTop: "".concat(gridSize, "px")
|
|
27
|
+
});
|
|
25
28
|
|
|
26
29
|
var DismissButton = function DismissButton(_ref) {
|
|
27
30
|
var appearance = _ref.appearance,
|
|
@@ -49,7 +52,7 @@ var DismissButton = function DismissButton(_ref) {
|
|
|
49
52
|
style: {
|
|
50
53
|
color: getFlagTextColor(appearance, mode)
|
|
51
54
|
},
|
|
52
|
-
css: dismissButtonStyles,
|
|
55
|
+
css: [dismissButtonStyles, !isBold && crossIconStyles],
|
|
53
56
|
onClick: onClick,
|
|
54
57
|
"data-testid": buttonTestId,
|
|
55
58
|
type: "button",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/core';
|
|
3
3
|
import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
var
|
|
4
|
+
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
5
|
+
var gridSize = getGridSize();
|
|
6
|
+
var paddingLeft = gridSize * 5;
|
|
6
7
|
var expanderStyles = css({
|
|
7
8
|
display: 'flex',
|
|
8
9
|
minWidth: 0,
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx, css } from '@emotion/core';
|
|
3
3
|
var titleStyles = css({
|
|
4
|
-
padding: "
|
|
4
|
+
padding: "2px 0 6px 16px",
|
|
5
5
|
flex: 1,
|
|
6
|
-
fontWeight: 600
|
|
7
|
-
overflow: 'hidden',
|
|
8
|
-
textOverflow: 'ellipsis',
|
|
9
|
-
whiteSpace: 'nowrap'
|
|
6
|
+
fontWeight: 600
|
|
10
7
|
});
|
|
11
8
|
|
|
12
9
|
var Title = function Title(_ref) {
|
package/dist/esm/theme.js
CHANGED
|
@@ -23,8 +23,14 @@ var flagBackgroundColor = {
|
|
|
23
23
|
};
|
|
24
24
|
export var getFlagBackgroundColor = function getFlagBackgroundColor(appearance, mode) {
|
|
25
25
|
return flagBackgroundColor[appearance][mode];
|
|
26
|
-
};
|
|
27
|
-
|
|
26
|
+
}; // token set in flag.tsx instead
|
|
27
|
+
|
|
28
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
29
|
+
|
|
30
|
+
export var flagBorderColor = N60A;
|
|
31
|
+
export var flagShadowColor = N50A;
|
|
32
|
+
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
33
|
+
|
|
28
34
|
var flagIconColor = {
|
|
29
35
|
error: {
|
|
30
36
|
light: "var(--ds-icon-inverse, ".concat(N0, ")"),
|
|
@@ -74,10 +80,7 @@ export var getFlagTextColor = function getFlagTextColor(appearance, mode) {
|
|
|
74
80
|
};
|
|
75
81
|
export var getFlagIconColor = function getFlagIconColor(appearance, mode) {
|
|
76
82
|
return flagIconColor[appearance][mode];
|
|
77
|
-
};
|
|
78
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
79
|
-
|
|
80
|
-
export var flagShadowColor = N50A;
|
|
83
|
+
};
|
|
81
84
|
var flagFocusRingColor = {
|
|
82
85
|
error: {
|
|
83
86
|
light: "var(--ds-border-focused, ".concat(N40, ")"),
|
package/dist/esm/version.json
CHANGED
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ThemeModes } from '@atlaskit/theme/types';
|
|
2
2
|
import { AppearanceTypes } from './types';
|
|
3
3
|
export declare const getFlagBackgroundColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
4
|
-
export declare const flagBorderColor
|
|
4
|
+
export declare const flagBorderColor = "rgba(9, 30, 66, 0.31)";
|
|
5
|
+
export declare const flagShadowColor = "rgba(9, 30, 66, 0.25)";
|
|
5
6
|
export declare const getFlagTextColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
6
7
|
export declare const getFlagIconColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
7
|
-
export declare const flagShadowColor = "rgba(9, 30, 66, 0.25)";
|
|
8
8
|
export declare const getFlagFocusRingColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
9
9
|
export declare const getActionBackground: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
10
10
|
export declare const getActionColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
package/flag/package.json
CHANGED
package/flag-group/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/flag",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.6.0",
|
|
4
4
|
"description": "A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -19,19 +19,20 @@
|
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
20
|
"releaseModel": "scheduled",
|
|
21
21
|
"website": {
|
|
22
|
-
"name": "Flag"
|
|
22
|
+
"name": "Flag",
|
|
23
|
+
"category": "Components"
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
27
28
|
"@atlaskit/button": "^16.3.0",
|
|
28
|
-
"@atlaskit/ds-lib": "^
|
|
29
|
+
"@atlaskit/ds-lib": "^2.0.0",
|
|
29
30
|
"@atlaskit/focus-ring": "^1.0.0",
|
|
30
31
|
"@atlaskit/icon": "^21.10.0",
|
|
31
|
-
"@atlaskit/motion": "^1.
|
|
32
|
+
"@atlaskit/motion": "^1.1.0",
|
|
32
33
|
"@atlaskit/portal": "^4.0.0",
|
|
33
34
|
"@atlaskit/theme": "^12.1.0",
|
|
34
|
-
"@atlaskit/tokens": "^0.
|
|
35
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
35
36
|
"@atlaskit/visually-hidden": "^1.0.0",
|
|
36
37
|
"@babel/runtime": "^7.0.0",
|
|
37
38
|
"@emotion/core": "^10.0.9"
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
],
|
|
63
64
|
"techstack": {
|
|
64
65
|
"@repo/internal": {
|
|
66
|
+
"dom-events": "use-bind-event-listener",
|
|
65
67
|
"ui-components": [
|
|
66
68
|
"lite-mode"
|
|
67
69
|
],
|
package/theme/package.json
CHANGED