@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/dist/esm/theme.js CHANGED
@@ -1,76 +1,103 @@
1
- import * as colors from '@atlaskit/theme/colors';
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: colors.R400,
5
- dark: colors.R300
4
+ light: "var(--ds-background-overlay, ".concat(R400, ")"),
5
+ dark: "var(--ds-background-overlay, ".concat(R300, ")")
6
6
  },
7
7
  info: {
8
- light: colors.N500,
9
- dark: colors.N500
8
+ light: "var(--ds-background-overlay, ".concat(N500, ")"),
9
+ dark: "var(--ds-background-overlay, ".concat(N500, ")")
10
10
  },
11
11
  normal: {
12
- light: colors.N0,
13
- dark: colors.DN50
12
+ light: "var(--ds-background-overlay, ".concat(N0, ")"),
13
+ dark: "var(--ds-background-overlay, ".concat(DN50, ")")
14
14
  },
15
15
  success: {
16
- light: colors.G400,
17
- dark: colors.G300
16
+ light: "var(--ds-background-overlay, ".concat(G400, ")"),
17
+ dark: "var(--ds-background-overlay, ".concat(G300, ")")
18
18
  },
19
19
  warning: {
20
- light: colors.Y200,
21
- dark: colors.Y300
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 = colors.N60A;
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: colors.N0,
31
- dark: colors.DN40
52
+ light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
53
+ dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
32
54
  },
33
55
  info: {
34
- light: colors.N0,
35
- dark: colors.DN600
56
+ light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
57
+ dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
36
58
  },
37
59
  normal: {
38
- light: colors.N500,
39
- dark: colors.DN600
60
+ light: "var(--ds-text-highEmphasis, ".concat(N500, ")"),
61
+ dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
40
62
  },
41
63
  success: {
42
- light: colors.N0,
43
- dark: colors.DN40
64
+ light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
65
+ dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
44
66
  },
45
67
  warning: {
46
- light: colors.N700,
47
- dark: colors.DN40
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 flagShadowColor = colors.N50A;
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: colors.N40,
57
- dark: colors.N40
83
+ light: "var(--ds-border-focus, ".concat(N40, ")"),
84
+ dark: "var(--ds-border-focus, ".concat(N40, ")")
58
85
  },
59
86
  info: {
60
- light: colors.N40,
61
- dark: colors.N40
87
+ light: "var(--ds-border-focus, ".concat(N40, ")"),
88
+ dark: "var(--ds-border-focus, ".concat(N40, ")")
62
89
  },
63
90
  normal: {
64
- light: colors.B100,
65
- dark: colors.B100
91
+ light: "var(--ds-border-focus, ".concat(B100, ")"),
92
+ dark: "var(--ds-border-focus, ".concat(B100, ")")
66
93
  },
67
94
  success: {
68
- light: colors.N40,
69
- dark: colors.N40
95
+ light: "var(--ds-border-focus, ".concat(N40, ")"),
96
+ dark: "var(--ds-border-focus, ".concat(N40, ")")
70
97
  },
71
98
  warning: {
72
- light: colors.N200,
73
- dark: colors.N200
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: colors.N30A
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: colors.N30A
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: colors.N30A,
95
- dark: colors.N30A
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: 'none',
99
- dark: 'none'
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: colors.N0,
105
- dark: colors.DN40
131
+ light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
132
+ dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
106
133
  },
107
134
  info: {
108
- light: colors.N0,
109
- dark: colors.DN600
135
+ light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
136
+ dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
110
137
  },
111
138
  error: {
112
- light: colors.N0,
113
- dark: colors.DN600
139
+ light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
140
+ dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
114
141
  },
115
142
  warning: {
116
- light: colors.N700,
117
- dark: colors.DN40
143
+ light: "var(--ds-text-mediumEmphasis, ".concat(N700, ")"),
144
+ dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
118
145
  },
119
146
  normal: {
120
- light: colors.B400,
121
- dark: colors.B100
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) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.3.4",
3
+ "version": "14.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AutoDismissFlagProps } from './types';
2
3
  export declare const AUTO_DISMISS_SECONDS = 8;
3
4
  declare const AutoDismissFlag: (props: AutoDismissFlagProps) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { FlagProps } from './types';
2
3
  declare const Flag: (props: FlagProps) => JSX.Element;
3
4
  export default Flag;
@@ -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 = "rgba(9, 30, 66, 0.31)";
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.4",
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": "^15.1.0",
29
- "@atlaskit/icon": "^21.6.0",
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": "^11.3.0",
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": "^11.3.0",
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
- "new-theming-api"
69
+ "tokens",
70
+ "react-context"
71
71
  ],
72
- "deprecation": [
73
- "no-deprecated-imports"
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;
@@ -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
- };
@@ -1,2 +0,0 @@
1
- import { MouseEvent } from 'react';
2
- export declare const onMouseDownBlur: (e: MouseEvent<HTMLElement>) => void;
@@ -1,7 +0,0 @@
1
- {
2
- "name": "@atlaskit/flag/utils",
3
- "main": "../dist/cjs/utils.js",
4
- "module": "../dist/esm/utils.js",
5
- "module:es2019": "../dist/es2019/utils.js",
6
- "types": "../dist/types/utils.d.ts"
7
- }