@atlaskit/flag 14.3.4 → 14.5.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 +47 -0
- package/__perf__/withFlagGroup.tsx +7 -1
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/flag-group.js +1 -1
- package/dist/cjs/flag-provider.js +1 -1
- package/dist/cjs/flag.js +32 -35
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/theme.js +84 -60
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/flag.js +74 -56
- package/dist/es2019/theme.js +78 -53
- package/dist/es2019/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/flag.js +33 -35
- package/dist/esm/theme.js +80 -53
- package/dist/esm/version.json +1 -1
- package/dist/types/auto-dismiss-flag.d.ts +1 -0
- package/dist/types/flag.d.ts +1 -0
- package/dist/types/theme.d.ts +2 -1
- package/package.json +12 -11
- package/dist/cjs/utils.js +0 -24
- package/dist/es2019/utils.js +0 -15
- package/dist/esm/utils.js +0 -15
- package/dist/types/utils.d.ts +0 -2
- package/utils/package.json +0 -7
package/dist/esm/theme.js
CHANGED
|
@@ -1,76 +1,103 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { B100, B400, DN40, DN50, DN600, G300, G400, N0, N200, N30A, N40, N500, N50A, N60A, N700, R300, R400, Y200, Y300 } from '@atlaskit/theme/colors';
|
|
2
2
|
var flagBackgroundColor = {
|
|
3
3
|
error: {
|
|
4
|
-
light:
|
|
5
|
-
dark:
|
|
4
|
+
light: "var(--ds-background-overlay, ".concat(R400, ")"),
|
|
5
|
+
dark: "var(--ds-background-overlay, ".concat(R300, ")")
|
|
6
6
|
},
|
|
7
7
|
info: {
|
|
8
|
-
light:
|
|
9
|
-
dark:
|
|
8
|
+
light: "var(--ds-background-overlay, ".concat(N500, ")"),
|
|
9
|
+
dark: "var(--ds-background-overlay, ".concat(N500, ")")
|
|
10
10
|
},
|
|
11
11
|
normal: {
|
|
12
|
-
light:
|
|
13
|
-
dark:
|
|
12
|
+
light: "var(--ds-background-overlay, ".concat(N0, ")"),
|
|
13
|
+
dark: "var(--ds-background-overlay, ".concat(DN50, ")")
|
|
14
14
|
},
|
|
15
15
|
success: {
|
|
16
|
-
light:
|
|
17
|
-
dark:
|
|
16
|
+
light: "var(--ds-background-overlay, ".concat(G400, ")"),
|
|
17
|
+
dark: "var(--ds-background-overlay, ".concat(G300, ")")
|
|
18
18
|
},
|
|
19
19
|
warning: {
|
|
20
|
-
light:
|
|
21
|
-
dark:
|
|
20
|
+
light: "var(--ds-background-overlay, ".concat(Y200, ")"),
|
|
21
|
+
dark: "var(--ds-background-overlay, ".concat(Y300, ")")
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
export var getFlagBackgroundColor = function getFlagBackgroundColor(appearance, mode) {
|
|
25
25
|
return flagBackgroundColor[appearance][mode];
|
|
26
26
|
};
|
|
27
|
-
export var flagBorderColor =
|
|
27
|
+
export var flagBorderColor = "var(--ds-background-overlay, ".concat(N60A, ")");
|
|
28
|
+
var flagIconColor = {
|
|
29
|
+
error: {
|
|
30
|
+
light: "var(--ds-iconBorder-danger, ".concat(N0, ")"),
|
|
31
|
+
dark: "var(--ds-iconBorder-danger, ".concat(DN40, ")")
|
|
32
|
+
},
|
|
33
|
+
info: {
|
|
34
|
+
light: "var(--ds-iconBorder-discovery, ".concat(N0, ")"),
|
|
35
|
+
dark: "var(--ds-iconBorder-discovery, ".concat(DN600, ")")
|
|
36
|
+
},
|
|
37
|
+
normal: {
|
|
38
|
+
light: "var(--ds-iconBorder-brand, ".concat(N500, ")"),
|
|
39
|
+
dark: "var(--ds-iconBorder-brand, ".concat(DN600, ")")
|
|
40
|
+
},
|
|
41
|
+
success: {
|
|
42
|
+
light: "var(--ds-iconBorder-success, ".concat(N0, ")"),
|
|
43
|
+
dark: "var(--ds-iconBorder-success, ".concat(DN40, ")")
|
|
44
|
+
},
|
|
45
|
+
warning: {
|
|
46
|
+
light: "var(--ds-iconBorder-warning, ".concat(N700, ")"),
|
|
47
|
+
dark: "var(--ds-iconBorder-warning, ".concat(DN40, ")")
|
|
48
|
+
}
|
|
49
|
+
};
|
|
28
50
|
var flagTextColor = {
|
|
29
51
|
error: {
|
|
30
|
-
light:
|
|
31
|
-
dark:
|
|
52
|
+
light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
|
|
53
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
|
|
32
54
|
},
|
|
33
55
|
info: {
|
|
34
|
-
light:
|
|
35
|
-
dark:
|
|
56
|
+
light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
|
|
57
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
|
|
36
58
|
},
|
|
37
59
|
normal: {
|
|
38
|
-
light:
|
|
39
|
-
dark:
|
|
60
|
+
light: "var(--ds-text-highEmphasis, ".concat(N500, ")"),
|
|
61
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
|
|
40
62
|
},
|
|
41
63
|
success: {
|
|
42
|
-
light:
|
|
43
|
-
dark:
|
|
64
|
+
light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
|
|
65
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
|
|
44
66
|
},
|
|
45
67
|
warning: {
|
|
46
|
-
light:
|
|
47
|
-
dark:
|
|
68
|
+
light: "var(--ds-text-highEmphasis, ".concat(N700, ")"),
|
|
69
|
+
dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
|
|
48
70
|
}
|
|
49
71
|
};
|
|
50
72
|
export var getFlagTextColor = function getFlagTextColor(appearance, mode) {
|
|
51
73
|
return flagTextColor[appearance][mode];
|
|
52
74
|
};
|
|
53
|
-
export var
|
|
75
|
+
export var getFlagIconColor = function getFlagIconColor(appearance, mode) {
|
|
76
|
+
return flagIconColor[appearance][mode];
|
|
77
|
+
}; // token set in flag.tsx instead
|
|
78
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
79
|
+
|
|
80
|
+
export var flagShadowColor = N50A;
|
|
54
81
|
var flagFocusRingColor = {
|
|
55
82
|
error: {
|
|
56
|
-
light:
|
|
57
|
-
dark:
|
|
83
|
+
light: "var(--ds-border-focus, ".concat(N40, ")"),
|
|
84
|
+
dark: "var(--ds-border-focus, ".concat(N40, ")")
|
|
58
85
|
},
|
|
59
86
|
info: {
|
|
60
|
-
light:
|
|
61
|
-
dark:
|
|
87
|
+
light: "var(--ds-border-focus, ".concat(N40, ")"),
|
|
88
|
+
dark: "var(--ds-border-focus, ".concat(N40, ")")
|
|
62
89
|
},
|
|
63
90
|
normal: {
|
|
64
|
-
light:
|
|
65
|
-
dark:
|
|
91
|
+
light: "var(--ds-border-focus, ".concat(B100, ")"),
|
|
92
|
+
dark: "var(--ds-border-focus, ".concat(B100, ")")
|
|
66
93
|
},
|
|
67
94
|
success: {
|
|
68
|
-
light:
|
|
69
|
-
dark:
|
|
95
|
+
light: "var(--ds-border-focus, ".concat(N40, ")"),
|
|
96
|
+
dark: "var(--ds-border-focus, ".concat(N40, ")")
|
|
70
97
|
},
|
|
71
98
|
warning: {
|
|
72
|
-
light:
|
|
73
|
-
dark:
|
|
99
|
+
light: "var(--ds-border-focus, ".concat(N200, ")"),
|
|
100
|
+
dark: "var(--ds-border-focus, ".concat(N200, ")")
|
|
74
101
|
}
|
|
75
102
|
};
|
|
76
103
|
export var getFlagFocusRingColor = function getFlagFocusRingColor(appearance, mode) {
|
|
@@ -79,46 +106,46 @@ export var getFlagFocusRingColor = function getFlagFocusRingColor(appearance, mo
|
|
|
79
106
|
var lightButtonBackground = 'rgba(255, 255, 255, 0.08)';
|
|
80
107
|
var actionBackground = {
|
|
81
108
|
success: {
|
|
82
|
-
light: lightButtonBackground,
|
|
83
|
-
dark:
|
|
109
|
+
light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
|
|
110
|
+
dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
|
|
84
111
|
},
|
|
85
112
|
info: {
|
|
86
|
-
light: lightButtonBackground,
|
|
87
|
-
dark: lightButtonBackground
|
|
113
|
+
light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
|
|
114
|
+
dark: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")")
|
|
88
115
|
},
|
|
89
116
|
error: {
|
|
90
|
-
light: lightButtonBackground,
|
|
91
|
-
dark:
|
|
117
|
+
light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
|
|
118
|
+
dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
|
|
92
119
|
},
|
|
93
120
|
warning: {
|
|
94
|
-
light:
|
|
95
|
-
dark:
|
|
121
|
+
light: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")"),
|
|
122
|
+
dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
|
|
96
123
|
},
|
|
97
124
|
normal: {
|
|
98
|
-
light:
|
|
99
|
-
dark:
|
|
125
|
+
light: "var(--ds-background-subtleNeutral-resting, none)",
|
|
126
|
+
dark: "var(--ds-background-subtleNeutral-resting, none)"
|
|
100
127
|
}
|
|
101
128
|
};
|
|
102
129
|
var actionColor = {
|
|
103
130
|
success: {
|
|
104
|
-
light:
|
|
105
|
-
dark:
|
|
131
|
+
light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
|
|
132
|
+
dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
|
|
106
133
|
},
|
|
107
134
|
info: {
|
|
108
|
-
light:
|
|
109
|
-
dark:
|
|
135
|
+
light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
|
|
136
|
+
dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
|
|
110
137
|
},
|
|
111
138
|
error: {
|
|
112
|
-
light:
|
|
113
|
-
dark:
|
|
139
|
+
light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
|
|
140
|
+
dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
|
|
114
141
|
},
|
|
115
142
|
warning: {
|
|
116
|
-
light:
|
|
117
|
-
dark:
|
|
143
|
+
light: "var(--ds-text-mediumEmphasis, ".concat(N700, ")"),
|
|
144
|
+
dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
|
|
118
145
|
},
|
|
119
146
|
normal: {
|
|
120
|
-
light:
|
|
121
|
-
dark:
|
|
147
|
+
light: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
|
|
148
|
+
dark: "var(--ds-text-mediumEmphasis, ".concat(B100, ")")
|
|
122
149
|
}
|
|
123
150
|
};
|
|
124
151
|
export var getActionBackground = function getActionBackground(appearance, mode) {
|
package/dist/esm/version.json
CHANGED
package/dist/types/flag.d.ts
CHANGED
package/dist/types/theme.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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: "var(--ds-background-overlay)";
|
|
5
5
|
export declare const getFlagTextColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
6
|
+
export declare const getFlagIconColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
6
7
|
export declare const flagShadowColor = "rgba(9, 30, 66, 0.25)";
|
|
7
8
|
export declare const getFlagFocusRingColor: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
|
8
9
|
export declare const getActionBackground: (appearance: AppearanceTypes, mode: ThemeModes) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/flag",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.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/"
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"atlassian": {
|
|
18
18
|
"team": "Design System Team",
|
|
19
19
|
"deprecatedAutoEntryPoints": true,
|
|
20
|
-
"inPublicMirror": true,
|
|
21
20
|
"releaseModel": "scheduled",
|
|
22
21
|
"website": {
|
|
23
22
|
"name": "Flag"
|
|
@@ -25,11 +24,12 @@
|
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
26
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
28
|
-
"@atlaskit/button": "^
|
|
29
|
-
"@atlaskit/icon": "^21.
|
|
27
|
+
"@atlaskit/button": "^16.0.0",
|
|
28
|
+
"@atlaskit/icon": "^21.10.0",
|
|
30
29
|
"@atlaskit/motion": "^1.0.0",
|
|
31
30
|
"@atlaskit/portal": "^4.0.0",
|
|
32
|
-
"@atlaskit/theme": "^
|
|
31
|
+
"@atlaskit/theme": "^12.1.0",
|
|
32
|
+
"@atlaskit/tokens": "^0.4.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"@emotion/core": "^10.0.9"
|
|
35
35
|
},
|
|
@@ -37,13 +37,12 @@
|
|
|
37
37
|
"react": "^16.8.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@atlaskit/build-utils": "*",
|
|
41
40
|
"@atlaskit/docs": "*",
|
|
42
|
-
"@atlaskit/field-radio-group": "^8.0.0",
|
|
43
41
|
"@atlaskit/radio": "^5.2.0",
|
|
42
|
+
"@atlaskit/section-message": "^6.0.0",
|
|
44
43
|
"@atlaskit/spinner": "^15.0.0",
|
|
45
44
|
"@atlaskit/ssr": "*",
|
|
46
|
-
"@atlaskit/theme": "^
|
|
45
|
+
"@atlaskit/theme": "^12.1.0",
|
|
47
46
|
"@atlaskit/visual-regression": "*",
|
|
48
47
|
"@atlaskit/webdriver-runner": "*",
|
|
49
48
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -67,10 +66,12 @@
|
|
|
67
66
|
"analytics-next"
|
|
68
67
|
],
|
|
69
68
|
"theming": [
|
|
70
|
-
"
|
|
69
|
+
"tokens",
|
|
70
|
+
"react-context"
|
|
71
71
|
],
|
|
72
|
-
"deprecation":
|
|
73
|
-
|
|
72
|
+
"deprecation": "no-deprecated-imports",
|
|
73
|
+
"styling": [
|
|
74
|
+
"emotion"
|
|
74
75
|
]
|
|
75
76
|
}
|
|
76
77
|
},
|
package/dist/cjs/utils.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.onMouseDownBlur = void 0;
|
|
7
|
-
|
|
8
|
-
// Prevent a focus ring if clicked
|
|
9
|
-
var onMouseDownBlur = function onMouseDownBlur(e) {
|
|
10
|
-
var currentTarget = e.currentTarget;
|
|
11
|
-
var focusedDuringMouseDown = currentTarget === document.activeElement;
|
|
12
|
-
requestAnimationFrame(function () {
|
|
13
|
-
if (focusedDuringMouseDown && currentTarget !== document.activeElement && document.body.contains(currentTarget)) {
|
|
14
|
-
currentTarget.focus();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (!focusedDuringMouseDown && document.activeElement && document.activeElement instanceof HTMLElement) {
|
|
19
|
-
document.activeElement.blur();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
exports.onMouseDownBlur = onMouseDownBlur;
|
package/dist/es2019/utils.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Prevent a focus ring if clicked
|
|
2
|
-
export const onMouseDownBlur = e => {
|
|
3
|
-
const currentTarget = e.currentTarget;
|
|
4
|
-
const focusedDuringMouseDown = currentTarget === document.activeElement;
|
|
5
|
-
requestAnimationFrame(() => {
|
|
6
|
-
if (focusedDuringMouseDown && currentTarget !== document.activeElement && document.body.contains(currentTarget)) {
|
|
7
|
-
currentTarget.focus();
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!focusedDuringMouseDown && document.activeElement && document.activeElement instanceof HTMLElement) {
|
|
12
|
-
document.activeElement.blur();
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
};
|
package/dist/esm/utils.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Prevent a focus ring if clicked
|
|
2
|
-
export var onMouseDownBlur = function onMouseDownBlur(e) {
|
|
3
|
-
var currentTarget = e.currentTarget;
|
|
4
|
-
var focusedDuringMouseDown = currentTarget === document.activeElement;
|
|
5
|
-
requestAnimationFrame(function () {
|
|
6
|
-
if (focusedDuringMouseDown && currentTarget !== document.activeElement && document.body.contains(currentTarget)) {
|
|
7
|
-
currentTarget.focus();
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (!focusedDuringMouseDown && document.activeElement && document.activeElement instanceof HTMLElement) {
|
|
12
|
-
document.activeElement.blur();
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
};
|
package/dist/types/utils.d.ts
DELETED