@atlaskit/flag 14.5.9 → 14.6.2
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 +24 -0
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/flag-actions.js +1 -1
- package/dist/cjs/flag.js +15 -8
- 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/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/flag-actions.js +1 -1
- package/dist/es2019/flag.js +15 -8
- 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/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/flag-actions.js +1 -1
- package/dist/esm/flag.js +15 -8
- 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/version.json +1 -1
- package/dist/types/internal/description.d.ts +1 -0
- package/package.json +17 -5
- package/report.api.md +179 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/flag
|
|
2
2
|
|
|
3
|
+
## 14.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`982f05dc6b9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/982f05dc6b9) - [ux] Remove left indentation on bold flag's actions section
|
|
8
|
+
|
|
9
|
+
## 14.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`45ebe7af434`](https://bitbucket.org/atlassian/atlassian-frontend/commits/45ebe7af434) - Moved to using declarative entrypoints internally. Public API is unchanged.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 14.6.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [`379b0a864df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/379b0a864df) - [ux] Remove truncation of titles and wrap text instead. Very slightly changed title text positioning.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- [`f16146d83ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f16146d83ff) - [ux] Fix cross icon positioning
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 14.5.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -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.2";
|
|
30
30
|
var AUTO_DISMISS_SECONDS = 8;
|
|
31
31
|
exports.AUTO_DISMISS_SECONDS = AUTO_DISMISS_SECONDS;
|
|
32
32
|
|
package/dist/cjs/flag-actions.js
CHANGED
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.2"
|
|
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',
|
|
@@ -171,10 +175,12 @@ var Flag = function Flag(props) {
|
|
|
171
175
|
style: {
|
|
172
176
|
color: iconColor
|
|
173
177
|
},
|
|
174
|
-
css:
|
|
178
|
+
css: titleGroupStyles
|
|
179
|
+
}, (0, _core.jsx)("div", {
|
|
180
|
+
css: iconTitleStyles
|
|
175
181
|
}, icon, (0, _core.jsx)(_internal.Title, {
|
|
176
182
|
color: textColor
|
|
177
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && (0, _core.jsx)(_internal.DismissButton, {
|
|
183
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && (0, _core.jsx)(_internal.DismissButton, {
|
|
178
184
|
testId: testId,
|
|
179
185
|
appearance: appearance,
|
|
180
186
|
isBold: isBold,
|
|
@@ -185,7 +191,8 @@ var Flag = function Flag(props) {
|
|
|
185
191
|
testId: testId
|
|
186
192
|
}, description && (0, _core.jsx)(_internal.Description, {
|
|
187
193
|
testId: testId && "".concat(testId, "-description"),
|
|
188
|
-
color: textColor
|
|
194
|
+
color: textColor,
|
|
195
|
+
isBold: isBold
|
|
189
196
|
}, description), (0, _core.jsx)(_flagActions.default, {
|
|
190
197
|
actions: actions,
|
|
191
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/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.2";
|
|
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.2"
|
|
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',
|
|
@@ -134,10 +138,12 @@ const Flag = props => {
|
|
|
134
138
|
style: {
|
|
135
139
|
color: iconColor
|
|
136
140
|
},
|
|
137
|
-
css:
|
|
141
|
+
css: titleGroupStyles
|
|
142
|
+
}, jsx("div", {
|
|
143
|
+
css: iconTitleStyles
|
|
138
144
|
}, icon, jsx(Title, {
|
|
139
145
|
color: textColor
|
|
140
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
146
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
141
147
|
testId: testId,
|
|
142
148
|
appearance: appearance,
|
|
143
149
|
isBold: isBold,
|
|
@@ -148,7 +154,8 @@ const Flag = props => {
|
|
|
148
154
|
testId: testId
|
|
149
155
|
}, description && jsx(Description, {
|
|
150
156
|
testId: testId && `${testId}-description`,
|
|
151
|
-
color: textColor
|
|
157
|
+
color: textColor,
|
|
158
|
+
isBold: isBold
|
|
152
159
|
}, description), jsx(Actions, {
|
|
153
160
|
actions: actions,
|
|
154
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/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.2";
|
|
9
9
|
export var AUTO_DISMISS_SECONDS = 8;
|
|
10
10
|
|
|
11
11
|
var AutoDismissFlag = function AutoDismissFlag(props) {
|
package/dist/esm/flag-actions.js
CHANGED
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.2"
|
|
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',
|
|
@@ -149,10 +153,12 @@ var Flag = function Flag(props) {
|
|
|
149
153
|
style: {
|
|
150
154
|
color: iconColor
|
|
151
155
|
},
|
|
152
|
-
css:
|
|
156
|
+
css: titleGroupStyles
|
|
157
|
+
}, jsx("div", {
|
|
158
|
+
css: iconTitleStyles
|
|
153
159
|
}, icon, jsx(Title, {
|
|
154
160
|
color: textColor
|
|
155
|
-
}, title), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
161
|
+
}, title)), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
|
|
156
162
|
testId: testId,
|
|
157
163
|
appearance: appearance,
|
|
158
164
|
isBold: isBold,
|
|
@@ -163,7 +169,8 @@ var Flag = function Flag(props) {
|
|
|
163
169
|
testId: testId
|
|
164
170
|
}, description && jsx(Description, {
|
|
165
171
|
testId: testId && "".concat(testId, "-description"),
|
|
166
|
-
color: textColor
|
|
172
|
+
color: textColor,
|
|
173
|
+
isBold: isBold
|
|
167
174
|
}, description), jsx(Actions, {
|
|
168
175
|
actions: actions,
|
|
169
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/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/flag",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.6.2",
|
|
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/"
|
|
@@ -16,19 +16,30 @@
|
|
|
16
16
|
"atlaskit:src": "src/index.ts",
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
|
-
"deprecatedAutoEntryPoints": true,
|
|
20
19
|
"releaseModel": "scheduled",
|
|
21
20
|
"website": {
|
|
22
|
-
"name": "Flag"
|
|
21
|
+
"name": "Flag",
|
|
22
|
+
"category": "Components"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
+
"af:exports": {
|
|
26
|
+
".": "./src/index.ts",
|
|
27
|
+
"./auto-dismiss-flag": "./src/auto-dismiss-flag.tsx",
|
|
28
|
+
"./constants": "./src/constants.ts",
|
|
29
|
+
"./flag-actions": "./src/flag-actions.tsx",
|
|
30
|
+
"./flag-group": "./src/flag-group.tsx",
|
|
31
|
+
"./flag-provider": "./src/flag-provider.tsx",
|
|
32
|
+
"./flag": "./src/flag.tsx",
|
|
33
|
+
"./theme": "./src/theme.ts",
|
|
34
|
+
"./types": "./src/types.ts"
|
|
35
|
+
},
|
|
25
36
|
"dependencies": {
|
|
26
37
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
27
38
|
"@atlaskit/button": "^16.3.0",
|
|
28
|
-
"@atlaskit/ds-lib": "^
|
|
39
|
+
"@atlaskit/ds-lib": "^2.0.0",
|
|
29
40
|
"@atlaskit/focus-ring": "^1.0.0",
|
|
30
41
|
"@atlaskit/icon": "^21.10.0",
|
|
31
|
-
"@atlaskit/motion": "^1.
|
|
42
|
+
"@atlaskit/motion": "^1.2.0",
|
|
32
43
|
"@atlaskit/portal": "^4.0.0",
|
|
33
44
|
"@atlaskit/theme": "^12.1.0",
|
|
34
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
@@ -62,6 +73,7 @@
|
|
|
62
73
|
],
|
|
63
74
|
"techstack": {
|
|
64
75
|
"@repo/internal": {
|
|
76
|
+
"dom-events": "use-bind-event-listener",
|
|
65
77
|
"ui-components": [
|
|
66
78
|
"lite-mode"
|
|
67
79
|
],
|
package/report.api.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/flag"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
|
|
8
|
+
import { ComponentType } from 'react';
|
|
9
|
+
import { CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
10
|
+
import { MouseEventHandler } from 'react';
|
|
11
|
+
import { default as React_2 } from 'react';
|
|
12
|
+
import { ReactElement } from 'react';
|
|
13
|
+
import { ReactNode } from 'react';
|
|
14
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
15
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
16
|
+
|
|
17
|
+
export declare type ActionsType = Array<ActionType>;
|
|
18
|
+
|
|
19
|
+
declare type ActionType = {
|
|
20
|
+
content: ReactNode;
|
|
21
|
+
onClick?: (
|
|
22
|
+
e: React.MouseEvent<HTMLElement>,
|
|
23
|
+
analyticsEvent: UIAnalyticsEvent,
|
|
24
|
+
) => void;
|
|
25
|
+
href?: string;
|
|
26
|
+
target?: string;
|
|
27
|
+
testId?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export declare type AppearanceTypes =
|
|
31
|
+
| 'error'
|
|
32
|
+
| 'info'
|
|
33
|
+
| 'normal'
|
|
34
|
+
| 'success'
|
|
35
|
+
| 'warning';
|
|
36
|
+
|
|
37
|
+
export declare const AutoDismissFlag: (
|
|
38
|
+
props: AutoDismissFlagProps,
|
|
39
|
+
) => JSX.Element;
|
|
40
|
+
|
|
41
|
+
declare interface AutoDismissFlagProps
|
|
42
|
+
extends AutoDismissFlagPropsWithoutId,
|
|
43
|
+
FlagPropsId {}
|
|
44
|
+
|
|
45
|
+
declare type AutoDismissFlagPropsWithoutId = {
|
|
46
|
+
/** Array of clickable actions to be shown at the bottom of the flag. For flags where appearance
|
|
47
|
+
* is 'normal', actions will be shown as links. For all other appearance values, actions will
|
|
48
|
+
* shown as buttons.
|
|
49
|
+
* If href is passed the action will be shown as a link with the passed href prop.
|
|
50
|
+
*/
|
|
51
|
+
actions?: ActionsType;
|
|
52
|
+
/** Makes the flag appearance bold. Setting this to anything other than 'normal' hides the
|
|
53
|
+
* dismiss button.
|
|
54
|
+
*/
|
|
55
|
+
appearance?: AppearanceTypes;
|
|
56
|
+
/** The secondary content shown below the flag title */
|
|
57
|
+
description?: ReactNode;
|
|
58
|
+
/** The icon displayed in the top-left of the flag. Should be an instance of `@atlaskit/icon`.
|
|
59
|
+
* Your icon will receive the appropriate default color, which you can override by wrapping the
|
|
60
|
+
* icon in a containing element with CSS `color` set to your preferred icon color.
|
|
61
|
+
*/
|
|
62
|
+
icon: ReactNode;
|
|
63
|
+
/** The bold text shown at the top of the flag. */
|
|
64
|
+
title: ReactNode;
|
|
65
|
+
/** Handler which will be called when a Flag's dismiss button is clicked.
|
|
66
|
+
* Receives the id of the dismissed Flag as a parameter.
|
|
67
|
+
*/
|
|
68
|
+
onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
69
|
+
/** A link component that is passed down to the `@atlaskit/button` used by actions,
|
|
70
|
+
to allow custom routers to be used. See the
|
|
71
|
+
[button with router](https://atlaskit.atlassian.com/packages/design-system/button/example/ButtonWithRouter)
|
|
72
|
+
example of what this component should look like. */
|
|
73
|
+
linkComponent?: ComponentType<CustomThemeButtonProps>;
|
|
74
|
+
/**
|
|
75
|
+
* A `testId` prop is provided for specified elements,
|
|
76
|
+
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
|
77
|
+
* serving as a hook for automated tests.
|
|
78
|
+
|
|
79
|
+
* Will set these elements when defined:
|
|
80
|
+
|
|
81
|
+
* - Flag root element - `{testId}`
|
|
82
|
+
* - Close button visible on default flags - `{testId}-dismiss`
|
|
83
|
+
* - Toggle button visible on bold flags - `{testId}-toggle`
|
|
84
|
+
* - Flag content which wraps the description and actions - `{testId}-expander`
|
|
85
|
+
* - Flag description - `{testId}-description`
|
|
86
|
+
* - Flag actions - `{testId}-actions`
|
|
87
|
+
*/
|
|
88
|
+
testId?: string;
|
|
89
|
+
/** Additional information to be included in the `context` of analytics events that come from flag */
|
|
90
|
+
analyticsContext?: Record<string, any>;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
94
|
+
|
|
95
|
+
export declare interface CreateFlagArgs extends FlagPropsWithoutId {
|
|
96
|
+
/** A unique identifier used for rendering and onDismissed callbacks.
|
|
97
|
+
* This will be autogenerated if you don’t supply one.
|
|
98
|
+
* If you don’t want the same flag showing multiple times, provide a unique id.
|
|
99
|
+
*/
|
|
100
|
+
id?: FlagId;
|
|
101
|
+
/** Marks whether the flag should render as an AutoDismissFlag */
|
|
102
|
+
isAutoDismiss?: boolean;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare type DismissFn = () => void;
|
|
106
|
+
|
|
107
|
+
declare const Flag: (props: FlagProps) => JSX.Element;
|
|
108
|
+
export default Flag;
|
|
109
|
+
|
|
110
|
+
export declare type FlagAPI = {
|
|
111
|
+
showFlag: (args: CreateFlagArgs) => DismissFn;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export declare type FlagArgs = Combine<
|
|
115
|
+
CreateFlagArgs,
|
|
116
|
+
{
|
|
117
|
+
id: FlagId;
|
|
118
|
+
}
|
|
119
|
+
>;
|
|
120
|
+
|
|
121
|
+
export declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
|
|
122
|
+
|
|
123
|
+
declare type FlagGroupProps = {
|
|
124
|
+
/** ID attribute used for DOM selection. */
|
|
125
|
+
id?: string;
|
|
126
|
+
/** Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`). */
|
|
127
|
+
label?: string;
|
|
128
|
+
/** Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`). */
|
|
129
|
+
labelTag?: React.ElementType;
|
|
130
|
+
/** Flag elements to be displayed. */
|
|
131
|
+
children?: Array<ReactElement> | ReactElement | null | boolean;
|
|
132
|
+
/** Handler which will be called when a Flag's dismiss button is clicked.
|
|
133
|
+
* Receives the id of the dismissed Flag as a parameter.
|
|
134
|
+
*/
|
|
135
|
+
onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
declare type FlagId = string | number;
|
|
139
|
+
|
|
140
|
+
export declare interface FlagProps extends FlagPropsWithoutId, FlagPropsId {}
|
|
141
|
+
|
|
142
|
+
declare type FlagPropsId = {
|
|
143
|
+
/** A unique identifier used for rendering and onDismissed callbacks. */
|
|
144
|
+
id: number | string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
declare interface FlagPropsWithoutId
|
|
148
|
+
extends AutoDismissFlagPropsWithoutId,
|
|
149
|
+
WithAnalyticsEventsProps {
|
|
150
|
+
/** Standard onBlur event, applied to Flag by AutoDismissFlag */
|
|
151
|
+
onBlur?: (
|
|
152
|
+
e: React.FocusEvent<HTMLElement>,
|
|
153
|
+
analyticsEvent: UIAnalyticsEvent,
|
|
154
|
+
) => void;
|
|
155
|
+
/** Standard onFocus event, applied to Flag by AutoDismissFlag */
|
|
156
|
+
onFocus?: (
|
|
157
|
+
e: React.FocusEvent<HTMLElement>,
|
|
158
|
+
analyticsEvent: UIAnalyticsEvent,
|
|
159
|
+
) => void;
|
|
160
|
+
/** Standard onMouseOut event, applied to Flag by AutoDismissFlag */
|
|
161
|
+
onMouseOut?: MouseEventHandler;
|
|
162
|
+
/** Standard onMouseOver event, applied to Flag by AutoDismissFlag */
|
|
163
|
+
onMouseOver?: MouseEventHandler;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export declare function FlagsProvider({
|
|
167
|
+
children,
|
|
168
|
+
}: {
|
|
169
|
+
children: React_2.ReactNode;
|
|
170
|
+
}): JSX.Element;
|
|
171
|
+
|
|
172
|
+
export declare function useFlags(): FlagAPI;
|
|
173
|
+
|
|
174
|
+
export declare const withFlagsProvider: (
|
|
175
|
+
fn: () => React_2.ReactNode,
|
|
176
|
+
) => React_2.ReactNode;
|
|
177
|
+
|
|
178
|
+
export {};
|
|
179
|
+
```
|