@atlaskit/flag 14.4.0 → 14.5.1

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 CHANGED
@@ -1,5 +1,48 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 14.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 14.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`c04528ade6a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c04528ade6a) - **Note**: It is a re-release of the wrongly `patched` version `14.4.2` that should have been a `minor` release.
14
+
15
+ [ux] Instrumented flag with the new theming package, `@atlaskit/tokens`.
16
+
17
+ New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
18
+ These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
24
+ ## 14.4.2
25
+
26
+ ### Minor Changes
27
+
28
+ _WRONG RELEASE TYPE - DON'T USE_
29
+
30
+ - [`4567d73813c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4567d73813c) - Instrumented flag with the new theming package, `@atlaskit/tokens`.
31
+
32
+ New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
33
+ These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
34
+
35
+ ### Patch Changes
36
+
37
+ - [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
38
+ - Updated dependencies
39
+
40
+ ## 14.4.1
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies
45
+
3
46
  ## 14.4.0
4
47
 
5
48
  ### Minor Changes
@@ -2,6 +2,7 @@ import React from 'react';
2
2
 
3
3
  import SuccessIcon from '@atlaskit/icon/glyph/check-circle';
4
4
  import { G400 } from '@atlaskit/theme/colors';
5
+ import { token } from '@atlaskit/tokens';
5
6
 
6
7
  import Flag, { FlagGroup } from '../src';
7
8
 
@@ -9,7 +10,12 @@ export default () => (
9
10
  <FlagGroup>
10
11
  <Flag
11
12
  appearance="success"
12
- icon={<SuccessIcon label="Success" secondaryColor={G400} />}
13
+ icon={
14
+ <SuccessIcon
15
+ label="Success"
16
+ secondaryColor={token('color.iconBorder.success', G400)}
17
+ />
18
+ }
13
19
  id="success"
14
20
  key="success"
15
21
  title="Connected"
@@ -24,7 +24,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
24
24
  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; }
25
25
 
26
26
  var packageName = "@atlaskit/flag";
27
- var packageVersion = "14.4.0";
27
+ var packageVersion = "14.5.1";
28
28
  var AUTO_DISMISS_SECONDS = 8;
29
29
  exports.AUTO_DISMISS_SECONDS = AUTO_DISMISS_SECONDS;
30
30
 
@@ -5,8 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.flagWidth = exports.flagAnimationTime = exports.default = exports.FlagGroupContext = void 0;
8
9
  exports.useFlagGroup = useFlagGroup;
9
- exports.default = exports.FlagGroupContext = exports.flagAnimationTime = exports.flagWidth = void 0;
10
10
 
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
 
@@ -7,8 +7,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.useFlags = useFlags;
11
10
  exports.FlagsProvider = FlagsProvider;
11
+ exports.useFlags = useFlags;
12
12
  exports.withFlagsProvider = void 0;
13
13
 
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
@@ -29,13 +29,15 @@ var _flag = _interopRequireDefault(require("./flag"));
29
29
 
30
30
  var _flagGroup = _interopRequireDefault(require("./flag-group"));
31
31
 
32
+ var _excluded = ["isAutoDismiss"];
33
+
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
35
 
34
36
  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; }
35
37
 
36
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
38
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
37
39
 
38
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
40
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
41
 
40
42
  var FlagContext = /*#__PURE__*/_react.default.createContext(null);
41
43
 
@@ -104,7 +106,7 @@ function FlagsProvider(_ref) {
104
106
  onDismissed: removeFlag
105
107
  }, flags.map(function (flag) {
106
108
  var isAutoDismiss = flag.isAutoDismiss,
107
- restProps = (0, _objectWithoutProperties2.default)(flag, ["isAutoDismiss"]);
109
+ restProps = (0, _objectWithoutProperties2.default)(flag, _excluded);
108
110
  var FlagType = isAutoDismiss ? _autoDismissFlag.default : _flag.default;
109
111
  return /*#__PURE__*/_react.default.createElement(FlagType, (0, _extends2.default)({}, restProps, {
110
112
  key: flag.id
package/dist/cjs/flag.js CHANGED
@@ -43,16 +43,16 @@ var _flagGroup = require("./flag-group");
43
43
 
44
44
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
45
45
 
46
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
46
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
47
47
 
48
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
48
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
49
49
 
50
50
  function noop() {}
51
51
 
52
52
  var analyticsAttributes = {
53
53
  componentName: 'flag',
54
54
  packageName: "@atlaskit/flag",
55
- packageVersion: "14.4.0"
55
+ packageVersion: "14.5.1"
56
56
  };
57
57
  var gridSize = (0, _constants.gridSize)();
58
58
  var doubleGridSize = gridSize * 2;
@@ -176,15 +176,16 @@ var Flag = function Flag(props) {
176
176
  onBlur: onBlurAnalytics
177
177
  };
178
178
  var OptionalDismissButton = renderToggleOrDismissButton;
179
- var boxShadow = "0 20px 32px -8px ".concat(_theme.flagShadowColor);
179
+ var boxShadow = "var(--ds-overlay, ".concat("0 20px 32px -8px ".concat(_theme.flagShadowColor), ")");
180
180
 
181
181
  if (!isBold) {
182
- boxShadow = "0 0 1px ".concat(_theme.flagBorderColor, ", ").concat(boxShadow);
182
+ boxShadow = "var(--ds-overlay, ".concat("0 0 1px ".concat(_theme.flagBorderColor, ", ").concat(boxShadow), ")");
183
183
  }
184
184
 
185
185
  return (0, _core.jsx)(_components.default.Consumer, null, function (tokens) {
186
186
  var mode = tokens.mode;
187
187
  var textColour = (0, _theme.getFlagTextColor)(appearance, mode);
188
+ var iconColour = (0, _theme.getFlagIconColor)(appearance, mode);
188
189
  return (0, _core.jsx)("div", (0, _extends2.default)({
189
190
  css: (0, _core.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n color: ", ";\n transition: background-color 200ms;\n width: 100%;\n z-index: ", ";\n "])), (0, _theme.getFlagBackgroundColor)(appearance, mode), (0, _constants.borderRadius)(), boxShadow, textColour, _constants.layers.flag()),
190
191
  role: "alert",
@@ -194,7 +195,7 @@ var Flag = function Flag(props) {
194
195
  ,
195
196
  tabIndex: 0
196
197
  }, (0, _core.jsx)("div", {
197
- css: (0, _core.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n height: ", "px;\n "])), headerHeight)
198
+ css: (0, _core.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n display: flex;\n align-items: center;\n height: ", "px;\n "])), iconColour, headerHeight)
198
199
  }, icon, (0, _core.jsx)("span", {
199
200
  css: (0, _core.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-weight: 600;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 0 0 ", "px;\n "])), textColour, doubleGridSize)
200
201
  }, title), (0, _core.jsx)(OptionalDismissButton, {
package/dist/cjs/index.js CHANGED
@@ -5,12 +5,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- Object.defineProperty(exports, "default", {
9
- enumerable: true,
10
- get: function get() {
11
- return _flag.default;
12
- }
13
- });
14
8
  Object.defineProperty(exports, "AutoDismissFlag", {
15
9
  enumerable: true,
16
10
  get: function get() {
@@ -23,22 +17,28 @@ Object.defineProperty(exports, "FlagGroup", {
23
17
  return _flagGroup.default;
24
18
  }
25
19
  });
26
- Object.defineProperty(exports, "useFlags", {
20
+ Object.defineProperty(exports, "FlagsProvider", {
27
21
  enumerable: true,
28
22
  get: function get() {
29
- return _flagProvider.useFlags;
23
+ return _flagProvider.FlagsProvider;
30
24
  }
31
25
  });
32
- Object.defineProperty(exports, "withFlagsProvider", {
26
+ Object.defineProperty(exports, "default", {
33
27
  enumerable: true,
34
28
  get: function get() {
35
- return _flagProvider.withFlagsProvider;
29
+ return _flag.default;
36
30
  }
37
31
  });
38
- Object.defineProperty(exports, "FlagsProvider", {
32
+ Object.defineProperty(exports, "useFlags", {
39
33
  enumerable: true,
40
34
  get: function get() {
41
- return _flagProvider.FlagsProvider;
35
+ return _flagProvider.useFlags;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "withFlagsProvider", {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _flagProvider.withFlagsProvider;
42
42
  }
43
43
  });
44
44
 
package/dist/cjs/theme.js CHANGED
@@ -1,38 +1,32 @@
1
1
  "use strict";
2
2
 
3
- var _typeof = require("@babel/runtime/helpers/typeof");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports.getActionColor = exports.getActionBackground = exports.getFlagFocusRingColor = exports.flagShadowColor = exports.getFlagTextColor = exports.flagBorderColor = exports.getFlagBackgroundColor = void 0;
9
-
10
- var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
11
-
12
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
6
+ exports.getFlagTextColor = exports.getFlagIconColor = exports.getFlagFocusRingColor = exports.getFlagBackgroundColor = exports.getActionColor = exports.getActionBackground = exports.flagShadowColor = exports.flagBorderColor = void 0;
13
7
 
14
- 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; }
8
+ var _colors = require("@atlaskit/theme/colors");
15
9
 
16
10
  var flagBackgroundColor = {
17
11
  error: {
18
- light: colors.R400,
19
- dark: colors.R300
12
+ light: "var(--ds-background-overlay, ".concat(_colors.R400, ")"),
13
+ dark: "var(--ds-background-overlay, ".concat(_colors.R300, ")")
20
14
  },
21
15
  info: {
22
- light: colors.N500,
23
- dark: colors.N500
16
+ light: "var(--ds-background-overlay, ".concat(_colors.N500, ")"),
17
+ dark: "var(--ds-background-overlay, ".concat(_colors.N500, ")")
24
18
  },
25
19
  normal: {
26
- light: colors.N0,
27
- dark: colors.DN50
20
+ light: "var(--ds-background-overlay, ".concat(_colors.N0, ")"),
21
+ dark: "var(--ds-background-overlay, ".concat(_colors.DN50, ")")
28
22
  },
29
23
  success: {
30
- light: colors.G400,
31
- dark: colors.G300
24
+ light: "var(--ds-background-overlay, ".concat(_colors.G400, ")"),
25
+ dark: "var(--ds-background-overlay, ".concat(_colors.G300, ")")
32
26
  },
33
27
  warning: {
34
- light: colors.Y200,
35
- dark: colors.Y300
28
+ light: "var(--ds-background-overlay, ".concat(_colors.Y200, ")"),
29
+ dark: "var(--ds-background-overlay, ".concat(_colors.Y300, ")")
36
30
  }
37
31
  };
38
32
 
@@ -41,28 +35,50 @@ var getFlagBackgroundColor = function getFlagBackgroundColor(appearance, mode) {
41
35
  };
42
36
 
43
37
  exports.getFlagBackgroundColor = getFlagBackgroundColor;
44
- var flagBorderColor = colors.N60A;
38
+ var flagBorderColor = "var(--ds-background-overlay, ".concat(_colors.N60A, ")");
45
39
  exports.flagBorderColor = flagBorderColor;
40
+ var flagIconColor = {
41
+ error: {
42
+ light: "var(--ds-iconBorder-danger, ".concat(_colors.N0, ")"),
43
+ dark: "var(--ds-iconBorder-danger, ".concat(_colors.DN40, ")")
44
+ },
45
+ info: {
46
+ light: "var(--ds-iconBorder-discovery, ".concat(_colors.N0, ")"),
47
+ dark: "var(--ds-iconBorder-discovery, ".concat(_colors.DN600, ")")
48
+ },
49
+ normal: {
50
+ light: "var(--ds-iconBorder-brand, ".concat(_colors.N500, ")"),
51
+ dark: "var(--ds-iconBorder-brand, ".concat(_colors.DN600, ")")
52
+ },
53
+ success: {
54
+ light: "var(--ds-iconBorder-success, ".concat(_colors.N0, ")"),
55
+ dark: "var(--ds-iconBorder-success, ".concat(_colors.DN40, ")")
56
+ },
57
+ warning: {
58
+ light: "var(--ds-iconBorder-warning, ".concat(_colors.N700, ")"),
59
+ dark: "var(--ds-iconBorder-warning, ".concat(_colors.DN40, ")")
60
+ }
61
+ };
46
62
  var flagTextColor = {
47
63
  error: {
48
- light: colors.N0,
49
- dark: colors.DN40
64
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N0, ")"),
65
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN40, ")")
50
66
  },
51
67
  info: {
52
- light: colors.N0,
53
- dark: colors.DN600
68
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N0, ")"),
69
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN600, ")")
54
70
  },
55
71
  normal: {
56
- light: colors.N500,
57
- dark: colors.DN600
72
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N500, ")"),
73
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN600, ")")
58
74
  },
59
75
  success: {
60
- light: colors.N0,
61
- dark: colors.DN40
76
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N0, ")"),
77
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN40, ")")
62
78
  },
63
79
  warning: {
64
- light: colors.N700,
65
- dark: colors.DN40
80
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N700, ")"),
81
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN40, ")")
66
82
  }
67
83
  };
68
84
 
@@ -71,28 +87,36 @@ var getFlagTextColor = function getFlagTextColor(appearance, mode) {
71
87
  };
72
88
 
73
89
  exports.getFlagTextColor = getFlagTextColor;
74
- var flagShadowColor = colors.N50A;
90
+
91
+ var getFlagIconColor = function getFlagIconColor(appearance, mode) {
92
+ return flagIconColor[appearance][mode];
93
+ }; // token set in flag.tsx instead
94
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
95
+
96
+
97
+ exports.getFlagIconColor = getFlagIconColor;
98
+ var flagShadowColor = _colors.N50A;
75
99
  exports.flagShadowColor = flagShadowColor;
76
100
  var flagFocusRingColor = {
77
101
  error: {
78
- light: colors.N40,
79
- dark: colors.N40
102
+ light: "var(--ds-border-focus, ".concat(_colors.N40, ")"),
103
+ dark: "var(--ds-border-focus, ".concat(_colors.N40, ")")
80
104
  },
81
105
  info: {
82
- light: colors.N40,
83
- dark: colors.N40
106
+ light: "var(--ds-border-focus, ".concat(_colors.N40, ")"),
107
+ dark: "var(--ds-border-focus, ".concat(_colors.N40, ")")
84
108
  },
85
109
  normal: {
86
- light: colors.B100,
87
- dark: colors.B100
110
+ light: "var(--ds-border-focus, ".concat(_colors.B100, ")"),
111
+ dark: "var(--ds-border-focus, ".concat(_colors.B100, ")")
88
112
  },
89
113
  success: {
90
- light: colors.N40,
91
- dark: colors.N40
114
+ light: "var(--ds-border-focus, ".concat(_colors.N40, ")"),
115
+ dark: "var(--ds-border-focus, ".concat(_colors.N40, ")")
92
116
  },
93
117
  warning: {
94
- light: colors.N200,
95
- dark: colors.N200
118
+ light: "var(--ds-border-focus, ".concat(_colors.N200, ")"),
119
+ dark: "var(--ds-border-focus, ".concat(_colors.N200, ")")
96
120
  }
97
121
  };
98
122
 
@@ -104,46 +128,46 @@ exports.getFlagFocusRingColor = getFlagFocusRingColor;
104
128
  var lightButtonBackground = 'rgba(255, 255, 255, 0.08)';
105
129
  var actionBackground = {
106
130
  success: {
107
- light: lightButtonBackground,
108
- dark: colors.N30A
131
+ light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
132
+ dark: "var(--ds-background-subtleNeutral-resting, ".concat(_colors.N30A, ")")
109
133
  },
110
134
  info: {
111
- light: lightButtonBackground,
112
- dark: lightButtonBackground
135
+ light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
136
+ dark: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")")
113
137
  },
114
138
  error: {
115
- light: lightButtonBackground,
116
- dark: colors.N30A
139
+ light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
140
+ dark: "var(--ds-background-subtleNeutral-resting, ".concat(_colors.N30A, ")")
117
141
  },
118
142
  warning: {
119
- light: colors.N30A,
120
- dark: colors.N30A
143
+ light: "var(--ds-background-subtleNeutral-resting, ".concat(_colors.N30A, ")"),
144
+ dark: "var(--ds-background-subtleNeutral-resting, ".concat(_colors.N30A, ")")
121
145
  },
122
146
  normal: {
123
- light: 'none',
124
- dark: 'none'
147
+ light: "var(--ds-background-subtleNeutral-resting, none)",
148
+ dark: "var(--ds-background-subtleNeutral-resting, none)"
125
149
  }
126
150
  };
127
151
  var actionColor = {
128
152
  success: {
129
- light: colors.N0,
130
- dark: colors.DN40
153
+ light: "var(--ds-text-mediumEmphasis, ".concat(_colors.N0, ")"),
154
+ dark: "var(--ds-text-mediumEmphasis, ".concat(_colors.DN40, ")")
131
155
  },
132
156
  info: {
133
- light: colors.N0,
134
- dark: colors.DN600
157
+ light: "var(--ds-text-mediumEmphasis, ".concat(_colors.N0, ")"),
158
+ dark: "var(--ds-text-mediumEmphasis, ".concat(_colors.DN600, ")")
135
159
  },
136
160
  error: {
137
- light: colors.N0,
138
- dark: colors.DN600
161
+ light: "var(--ds-text-mediumEmphasis, ".concat(_colors.N0, ")"),
162
+ dark: "var(--ds-text-mediumEmphasis, ".concat(_colors.DN600, ")")
139
163
  },
140
164
  warning: {
141
- light: colors.N700,
142
- dark: colors.DN40
165
+ light: "var(--ds-text-mediumEmphasis, ".concat(_colors.N700, ")"),
166
+ dark: "var(--ds-text-mediumEmphasis, ".concat(_colors.DN40, ")")
143
167
  },
144
168
  normal: {
145
- light: colors.B400,
146
- dark: colors.B100
169
+ light: "var(--ds-text-mediumEmphasis, ".concat(_colors.B400, ")"),
170
+ dark: "var(--ds-text-mediumEmphasis, ".concat(_colors.B100, ")")
147
171
  }
148
172
  };
149
173
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.4.0",
3
+ "version": "14.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatfor
4
4
  import Flag from './flag';
5
5
  import { useFlagGroup } from './flag-group';
6
6
  const packageName = "@atlaskit/flag";
7
- const packageVersion = "14.4.0";
7
+ const packageVersion = "14.5.1";
8
8
  export const AUTO_DISMISS_SECONDS = 8;
9
9
 
10
10
  function noop() {}
@@ -10,7 +10,7 @@ import GlobalTheme from '@atlaskit/theme/components';
10
10
  import { borderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
11
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
12
12
  import { DEFAULT_APPEARANCE } from './constants';
13
- import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagFocusRingColor, getFlagTextColor } from './theme';
13
+ import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagFocusRingColor, getFlagTextColor, getFlagIconColor } from './theme';
14
14
  import Expander from './expander';
15
15
  import Actions from './flag-actions';
16
16
  import { useFlagGroup } from './flag-group';
@@ -20,7 +20,7 @@ function noop() {}
20
20
  const analyticsAttributes = {
21
21
  componentName: 'flag',
22
22
  packageName: "@atlaskit/flag",
23
- packageVersion: "14.4.0"
23
+ packageVersion: "14.5.1"
24
24
  };
25
25
  const gridSize = getGridSize();
26
26
  const doubleGridSize = gridSize * 2;
@@ -152,15 +152,16 @@ const Flag = props => {
152
152
  onBlur: onBlurAnalytics
153
153
  };
154
154
  const OptionalDismissButton = renderToggleOrDismissButton;
155
- let boxShadow = `0 20px 32px -8px ${flagShadowColor}`;
155
+ let boxShadow = `var(--ds-overlay, ${`0 20px 32px -8px ${flagShadowColor}`})`;
156
156
 
157
157
  if (!isBold) {
158
- boxShadow = `0 0 1px ${flagBorderColor}, ${boxShadow}`;
158
+ boxShadow = `var(--ds-overlay, ${`0 0 1px ${flagBorderColor}, ${boxShadow}`})`;
159
159
  }
160
160
 
161
161
  return jsx(GlobalTheme.Consumer, null, tokens => {
162
162
  const mode = tokens.mode;
163
163
  const textColour = getFlagTextColor(appearance, mode);
164
+ const iconColour = getFlagIconColor(appearance, mode);
164
165
  return jsx("div", _extends({
165
166
  css: css`
166
167
  background-color: ${getFlagBackgroundColor(appearance, mode)};
@@ -205,6 +206,7 @@ const Flag = props => {
205
206
  tabIndex: 0
206
207
  }, jsx("div", {
207
208
  css: css`
209
+ color: ${iconColour};
208
210
  display: flex;
209
211
  align-items: center;
210
212
  height: ${headerHeight}px;
@@ -1,118 +1,143 @@
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
  const flagBackgroundColor = {
3
3
  error: {
4
- light: colors.R400,
5
- dark: colors.R300
4
+ light: `var(--ds-background-overlay, ${R400})`,
5
+ dark: `var(--ds-background-overlay, ${R300})`
6
6
  },
7
7
  info: {
8
- light: colors.N500,
9
- dark: colors.N500
8
+ light: `var(--ds-background-overlay, ${N500})`,
9
+ dark: `var(--ds-background-overlay, ${N500})`
10
10
  },
11
11
  normal: {
12
- light: colors.N0,
13
- dark: colors.DN50
12
+ light: `var(--ds-background-overlay, ${N0})`,
13
+ dark: `var(--ds-background-overlay, ${DN50})`
14
14
  },
15
15
  success: {
16
- light: colors.G400,
17
- dark: colors.G300
16
+ light: `var(--ds-background-overlay, ${G400})`,
17
+ dark: `var(--ds-background-overlay, ${G300})`
18
18
  },
19
19
  warning: {
20
- light: colors.Y200,
21
- dark: colors.Y300
20
+ light: `var(--ds-background-overlay, ${Y200})`,
21
+ dark: `var(--ds-background-overlay, ${Y300})`
22
22
  }
23
23
  };
24
24
  export const getFlagBackgroundColor = (appearance, mode) => flagBackgroundColor[appearance][mode];
25
- export const flagBorderColor = colors.N60A;
25
+ export const flagBorderColor = `var(--ds-background-overlay, ${N60A})`;
26
+ const flagIconColor = {
27
+ error: {
28
+ light: `var(--ds-iconBorder-danger, ${N0})`,
29
+ dark: `var(--ds-iconBorder-danger, ${DN40})`
30
+ },
31
+ info: {
32
+ light: `var(--ds-iconBorder-discovery, ${N0})`,
33
+ dark: `var(--ds-iconBorder-discovery, ${DN600})`
34
+ },
35
+ normal: {
36
+ light: `var(--ds-iconBorder-brand, ${N500})`,
37
+ dark: `var(--ds-iconBorder-brand, ${DN600})`
38
+ },
39
+ success: {
40
+ light: `var(--ds-iconBorder-success, ${N0})`,
41
+ dark: `var(--ds-iconBorder-success, ${DN40})`
42
+ },
43
+ warning: {
44
+ light: `var(--ds-iconBorder-warning, ${N700})`,
45
+ dark: `var(--ds-iconBorder-warning, ${DN40})`
46
+ }
47
+ };
26
48
  const flagTextColor = {
27
49
  error: {
28
- light: colors.N0,
29
- dark: colors.DN40
50
+ light: `var(--ds-text-highEmphasis, ${N0})`,
51
+ dark: `var(--ds-text-highEmphasis, ${DN40})`
30
52
  },
31
53
  info: {
32
- light: colors.N0,
33
- dark: colors.DN600
54
+ light: `var(--ds-text-highEmphasis, ${N0})`,
55
+ dark: `var(--ds-text-highEmphasis, ${DN600})`
34
56
  },
35
57
  normal: {
36
- light: colors.N500,
37
- dark: colors.DN600
58
+ light: `var(--ds-text-highEmphasis, ${N500})`,
59
+ dark: `var(--ds-text-highEmphasis, ${DN600})`
38
60
  },
39
61
  success: {
40
- light: colors.N0,
41
- dark: colors.DN40
62
+ light: `var(--ds-text-highEmphasis, ${N0})`,
63
+ dark: `var(--ds-text-highEmphasis, ${DN40})`
42
64
  },
43
65
  warning: {
44
- light: colors.N700,
45
- dark: colors.DN40
66
+ light: `var(--ds-text-highEmphasis, ${N700})`,
67
+ dark: `var(--ds-text-highEmphasis, ${DN40})`
46
68
  }
47
69
  };
48
70
  export const getFlagTextColor = (appearance, mode) => flagTextColor[appearance][mode];
49
- export const flagShadowColor = colors.N50A;
71
+ export const getFlagIconColor = (appearance, mode) => flagIconColor[appearance][mode]; // token set in flag.tsx instead
72
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
73
+
74
+ export const flagShadowColor = N50A;
50
75
  const flagFocusRingColor = {
51
76
  error: {
52
- light: colors.N40,
53
- dark: colors.N40
77
+ light: `var(--ds-border-focus, ${N40})`,
78
+ dark: `var(--ds-border-focus, ${N40})`
54
79
  },
55
80
  info: {
56
- light: colors.N40,
57
- dark: colors.N40
81
+ light: `var(--ds-border-focus, ${N40})`,
82
+ dark: `var(--ds-border-focus, ${N40})`
58
83
  },
59
84
  normal: {
60
- light: colors.B100,
61
- dark: colors.B100
85
+ light: `var(--ds-border-focus, ${B100})`,
86
+ dark: `var(--ds-border-focus, ${B100})`
62
87
  },
63
88
  success: {
64
- light: colors.N40,
65
- dark: colors.N40
89
+ light: `var(--ds-border-focus, ${N40})`,
90
+ dark: `var(--ds-border-focus, ${N40})`
66
91
  },
67
92
  warning: {
68
- light: colors.N200,
69
- dark: colors.N200
93
+ light: `var(--ds-border-focus, ${N200})`,
94
+ dark: `var(--ds-border-focus, ${N200})`
70
95
  }
71
96
  };
72
97
  export const getFlagFocusRingColor = (appearance, mode) => flagFocusRingColor[appearance][mode];
73
98
  const lightButtonBackground = 'rgba(255, 255, 255, 0.08)';
74
99
  const actionBackground = {
75
100
  success: {
76
- light: lightButtonBackground,
77
- dark: colors.N30A
101
+ light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
102
+ dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
78
103
  },
79
104
  info: {
80
- light: lightButtonBackground,
81
- dark: lightButtonBackground
105
+ light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
106
+ dark: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`
82
107
  },
83
108
  error: {
84
- light: lightButtonBackground,
85
- dark: colors.N30A
109
+ light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
110
+ dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
86
111
  },
87
112
  warning: {
88
- light: colors.N30A,
89
- dark: colors.N30A
113
+ light: `var(--ds-background-subtleNeutral-resting, ${N30A})`,
114
+ dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
90
115
  },
91
116
  normal: {
92
- light: 'none',
93
- dark: 'none'
117
+ light: "var(--ds-background-subtleNeutral-resting, none)",
118
+ dark: "var(--ds-background-subtleNeutral-resting, none)"
94
119
  }
95
120
  };
96
121
  const actionColor = {
97
122
  success: {
98
- light: colors.N0,
99
- dark: colors.DN40
123
+ light: `var(--ds-text-mediumEmphasis, ${N0})`,
124
+ dark: `var(--ds-text-mediumEmphasis, ${DN40})`
100
125
  },
101
126
  info: {
102
- light: colors.N0,
103
- dark: colors.DN600
127
+ light: `var(--ds-text-mediumEmphasis, ${N0})`,
128
+ dark: `var(--ds-text-mediumEmphasis, ${DN600})`
104
129
  },
105
130
  error: {
106
- light: colors.N0,
107
- dark: colors.DN600
131
+ light: `var(--ds-text-mediumEmphasis, ${N0})`,
132
+ dark: `var(--ds-text-mediumEmphasis, ${DN600})`
108
133
  },
109
134
  warning: {
110
- light: colors.N700,
111
- dark: colors.DN40
135
+ light: `var(--ds-text-mediumEmphasis, ${N700})`,
136
+ dark: `var(--ds-text-mediumEmphasis, ${DN40})`
112
137
  },
113
138
  normal: {
114
- light: colors.B400,
115
- dark: colors.B100
139
+ light: `var(--ds-text-mediumEmphasis, ${B400})`,
140
+ dark: `var(--ds-text-mediumEmphasis, ${B100})`
116
141
  }
117
142
  };
118
143
  export const getActionBackground = (appearance, mode) => actionBackground[appearance][mode];
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.4.0",
3
+ "version": "14.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatfor
4
4
  import Flag from './flag';
5
5
  import { useFlagGroup } from './flag-group';
6
6
  var packageName = "@atlaskit/flag";
7
- var packageVersion = "14.4.0";
7
+ var packageVersion = "14.5.1";
8
8
  export var AUTO_DISMISS_SECONDS = 8;
9
9
 
10
10
  function noop() {}
@@ -3,10 +3,11 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
6
+ var _excluded = ["isAutoDismiss"];
6
7
 
7
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
9
 
9
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
11
 
11
12
  import React, { useCallback, useContext, useMemo, useState } from 'react';
12
13
  import AutoDismissFlag from './auto-dismiss-flag';
@@ -79,7 +80,7 @@ export function FlagsProvider(_ref) {
79
80
  onDismissed: removeFlag
80
81
  }, flags.map(function (flag) {
81
82
  var isAutoDismiss = flag.isAutoDismiss,
82
- restProps = _objectWithoutProperties(flag, ["isAutoDismiss"]);
83
+ restProps = _objectWithoutProperties(flag, _excluded);
83
84
 
84
85
  var FlagType = isAutoDismiss ? AutoDismissFlag : Flag;
85
86
  return /*#__PURE__*/React.createElement(FlagType, _extends({}, restProps, {
package/dist/esm/flag.js CHANGED
@@ -5,9 +5,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
 
6
6
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
7
7
 
8
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
9
 
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
11
 
12
12
  /** @jsx jsx */
13
13
  import { useCallback, useEffect, useState } from 'react';
@@ -19,7 +19,7 @@ import GlobalTheme from '@atlaskit/theme/components';
19
19
  import { borderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
20
20
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
21
21
  import { DEFAULT_APPEARANCE } from './constants';
22
- import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagFocusRingColor, getFlagTextColor } from './theme';
22
+ import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagFocusRingColor, getFlagTextColor, getFlagIconColor } from './theme';
23
23
  import Expander from './expander';
24
24
  import Actions from './flag-actions';
25
25
  import { useFlagGroup } from './flag-group';
@@ -29,7 +29,7 @@ function noop() {}
29
29
  var analyticsAttributes = {
30
30
  componentName: 'flag',
31
31
  packageName: "@atlaskit/flag",
32
- packageVersion: "14.4.0"
32
+ packageVersion: "14.5.1"
33
33
  };
34
34
  var gridSize = getGridSize();
35
35
  var doubleGridSize = gridSize * 2;
@@ -153,15 +153,16 @@ var Flag = function Flag(props) {
153
153
  onBlur: onBlurAnalytics
154
154
  };
155
155
  var OptionalDismissButton = renderToggleOrDismissButton;
156
- var boxShadow = "0 20px 32px -8px ".concat(flagShadowColor);
156
+ var boxShadow = "var(--ds-overlay, ".concat("0 20px 32px -8px ".concat(flagShadowColor), ")");
157
157
 
158
158
  if (!isBold) {
159
- boxShadow = "0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow);
159
+ boxShadow = "var(--ds-overlay, ".concat("0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow), ")");
160
160
  }
161
161
 
162
162
  return jsx(GlobalTheme.Consumer, null, function (tokens) {
163
163
  var mode = tokens.mode;
164
164
  var textColour = getFlagTextColor(appearance, mode);
165
+ var iconColour = getFlagIconColor(appearance, mode);
165
166
  return jsx("div", _extends({
166
167
  css: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n color: ", ";\n transition: background-color 200ms;\n width: 100%;\n z-index: ", ";\n "])), getFlagBackgroundColor(appearance, mode), borderRadius(), boxShadow, textColour, layers.flag()),
167
168
  role: "alert",
@@ -171,7 +172,7 @@ var Flag = function Flag(props) {
171
172
  ,
172
173
  tabIndex: 0
173
174
  }, jsx("div", {
174
- css: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n height: ", "px;\n "])), headerHeight)
175
+ css: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n display: flex;\n align-items: center;\n height: ", "px;\n "])), iconColour, headerHeight)
175
176
  }, icon, jsx("span", {
176
177
  css: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n font-weight: 600;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0 0 0 ", "px;\n "])), textColour, doubleGridSize)
177
178
  }, title), jsx(OptionalDismissButton, {
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.4.0",
3
+ "version": "14.5.1",
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.4.0",
3
+ "version": "14.5.1",
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"
@@ -26,10 +25,11 @@
26
25
  "dependencies": {
27
26
  "@atlaskit/analytics-next": "^8.0.0",
28
27
  "@atlaskit/button": "^16.0.0",
29
- "@atlaskit/icon": "^21.6.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.4.0",
31
+ "@atlaskit/theme": "^12.1.0",
32
+ "@atlaskit/tokens": "^0.5.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.4.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
  },