@atlaskit/flag 14.4.2 → 14.5.3

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/__perf__/withFlagGroup.tsx +1 -1
  3. package/dist/cjs/auto-dismiss-flag.js +4 -4
  4. package/dist/cjs/flag-actions.js +50 -6
  5. package/dist/cjs/flag-group.js +57 -19
  6. package/dist/cjs/flag-provider.js +6 -4
  7. package/dist/cjs/flag.js +85 -108
  8. package/dist/cjs/index.js +12 -12
  9. package/dist/cjs/internal/description.js +32 -0
  10. package/dist/cjs/internal/dismiss-button.js +83 -0
  11. package/dist/cjs/{expander.js → internal/expander.js} +15 -7
  12. package/dist/cjs/internal/index.js +39 -0
  13. package/dist/cjs/internal/title.js +32 -0
  14. package/dist/cjs/theme.js +62 -62
  15. package/dist/cjs/version.json +1 -1
  16. package/dist/es2019/auto-dismiss-flag.js +2 -3
  17. package/dist/es2019/flag-actions.js +50 -32
  18. package/dist/es2019/flag-group.js +48 -65
  19. package/dist/es2019/flag.js +77 -164
  20. package/dist/es2019/internal/description.js +22 -0
  21. package/dist/es2019/internal/dismiss-button.js +63 -0
  22. package/dist/es2019/{expander.js → internal/expander.js} +14 -10
  23. package/dist/es2019/internal/index.js +4 -0
  24. package/dist/es2019/internal/title.js +22 -0
  25. package/dist/es2019/theme.js +61 -61
  26. package/dist/es2019/version.json +1 -1
  27. package/dist/esm/auto-dismiss-flag.js +2 -3
  28. package/dist/esm/flag-actions.js +49 -6
  29. package/dist/esm/flag-group.js +52 -16
  30. package/dist/esm/flag-provider.js +4 -3
  31. package/dist/esm/flag.js +81 -103
  32. package/dist/esm/internal/description.js +23 -0
  33. package/dist/esm/internal/dismiss-button.js +63 -0
  34. package/dist/esm/{expander.js → internal/expander.js} +14 -5
  35. package/dist/esm/internal/index.js +4 -0
  36. package/dist/esm/internal/title.js +23 -0
  37. package/dist/esm/theme.js +61 -61
  38. package/dist/esm/version.json +1 -1
  39. package/dist/types/auto-dismiss-flag.d.ts +1 -0
  40. package/dist/types/flag-actions.d.ts +4 -4
  41. package/dist/types/flag-group.d.ts +2 -2
  42. package/dist/types/flag.d.ts +2 -1
  43. package/dist/types/internal/description.d.ts +7 -0
  44. package/dist/types/internal/dismiss-button.d.ts +11 -0
  45. package/dist/types/internal/expander.d.ts +8 -0
  46. package/dist/types/internal/index.d.ts +4 -0
  47. package/dist/types/internal/title.d.ts +6 -0
  48. package/dist/types/theme.d.ts +1 -1
  49. package/package.json +10 -8
  50. package/dist/types/expander.d.ts +0 -9
  51. package/expander/package.json +0 -7
package/dist/esm/flag.js CHANGED
@@ -1,39 +1,49 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
4
 
6
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
5
+ 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; }
7
6
 
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; }
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; }
7
+ 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
8
 
12
9
  /** @jsx jsx */
13
10
  import { useCallback, useEffect, useState } from 'react';
14
11
  import { css, jsx } from '@emotion/core';
15
- import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
16
- import ChevronUpIcon from '@atlaskit/icon/glyph/chevron-up';
17
- import CrossIcon from '@atlaskit/icon/glyph/cross';
18
- import GlobalTheme from '@atlaskit/theme/components';
12
+ import { useGlobalTheme } from '@atlaskit/theme/components';
19
13
  import { borderRadius, gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
20
14
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
15
+ import noop from '@atlaskit/ds-lib/noop';
16
+ import FocusRing from '@atlaskit/focus-ring';
21
17
  import { DEFAULT_APPEARANCE } from './constants';
22
- import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagFocusRingColor, getFlagTextColor, getFlagIconColor } from './theme';
23
- import Expander from './expander';
18
+ import { flagBorderColor, flagShadowColor, getFlagBackgroundColor, getFlagTextColor, getFlagIconColor } from './theme';
24
19
  import Actions from './flag-actions';
25
20
  import { useFlagGroup } from './flag-group';
26
-
27
- function noop() {}
28
-
21
+ import { Title, Description, Expander, DismissButton } from './internal';
29
22
  var analyticsAttributes = {
30
23
  componentName: 'flag',
31
24
  packageName: "@atlaskit/flag",
32
- packageVersion: "14.4.2"
25
+ packageVersion: "14.5.3"
33
26
  };
34
27
  var gridSize = getGridSize();
35
28
  var doubleGridSize = gridSize * 2;
36
29
  var headerHeight = gridSize * 4;
30
+ var iconStyles = css({
31
+ display: 'flex',
32
+ height: headerHeight,
33
+ alignItems: 'center'
34
+ });
35
+ var flagHeaderStyles = css({
36
+ boxSizing: 'border-box',
37
+ width: '100%',
38
+ padding: doubleGridSize,
39
+ borderRadius: borderRadius()
40
+ });
41
+ var flagContainerStyles = css({
42
+ width: '100%',
43
+ zIndex: layers.flag(),
44
+ borderRadius: borderRadius(),
45
+ transition: 'background-color 200ms'
46
+ });
37
47
 
38
48
  var Flag = function Flag(props) {
39
49
  var _props$actions = props.actions,
@@ -76,60 +86,16 @@ var Flag = function Flag(props) {
76
86
  analyticsData: analyticsContext
77
87
  }, analyticsAttributes));
78
88
  var isBold = appearance !== DEFAULT_APPEARANCE;
79
- var renderToggleOrDismissButton = useCallback(function (_ref) {
80
- var mode = _ref.mode;
81
-
82
- // If it is normal appearance a toggle button cannot be rendered
83
- // Ensure onDismissed is defined and isDismissAllowed is true to render
84
- // the dismiss button
85
- if (!isBold && !isDismissAllowed) {
86
- return null;
87
- } // If it is bold then ensure there is a description or actions to render
88
- // the toggle button
89
-
90
-
91
- if (isBold && !description && !actions.length) {
92
- return null;
93
- }
94
-
95
- var ButtonIcon = CrossIcon;
96
- var buttonLabel = 'Dismiss';
97
-
98
- var buttonAction = function buttonAction() {
99
- if (isDismissAllowed) {
100
- onDismissedAnalytics(id);
101
- }
102
- };
103
-
104
- var size = 'small';
105
- var buttonTestId = testId && "".concat(testId, "-dismiss");
106
- var a11yProps = {};
107
-
108
- if (isBold) {
109
- ButtonIcon = isExpanded ? ChevronUpIcon : ChevronDownIcon;
110
- buttonLabel = isExpanded ? 'Collapse' : 'Expand';
111
-
112
- buttonAction = function buttonAction() {
113
- return setIsExpanded(!isExpanded);
114
- };
115
-
116
- size = 'large';
117
- buttonTestId = testId && "".concat(testId, "-toggle");
118
- a11yProps = {
119
- 'aria-expanded': isExpanded
120
- };
89
+ var toggleExpand = useCallback(function () {
90
+ setIsExpanded(function (previous) {
91
+ return !previous;
92
+ });
93
+ }, []);
94
+ var buttonActionCallback = useCallback(function () {
95
+ if (isDismissAllowed) {
96
+ onDismissedAnalytics(id);
121
97
  }
122
-
123
- return jsx("button", _extends({
124
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n appearance: none;\n background: none;\n border: none;\n border-radius: ", "px;\n color: ", ";\n cursor: pointer;\n flex: 0 0 auto;\n line-height: 1;\n margin-left: ", "px;\n padding: 0;\n white-space: nowrap;\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n "])), borderRadius(), getFlagTextColor(appearance, mode), gridSize, getFlagFocusRingColor(appearance, mode)),
125
- onClick: buttonAction,
126
- "data-testid": buttonTestId,
127
- type: "button"
128
- }, a11yProps), jsx(ButtonIcon, {
129
- label: buttonLabel,
130
- size: size
131
- }));
132
- }, [actions.length, appearance, description, id, isBold, isDismissAllowed, isExpanded, onDismissedAnalytics, testId]);
98
+ }, [onDismissedAnalytics, id, isDismissAllowed]);
133
99
  useEffect(function () {
134
100
  // If buttons are removed as a prop, update isExpanded to be false
135
101
  if (isBold && isExpanded && !description && !actions.length) {
@@ -152,45 +118,57 @@ var Flag = function Flag(props) {
152
118
  onMouseOut: onMouseOut,
153
119
  onBlur: onBlurAnalytics
154
120
  };
155
- var OptionalDismissButton = renderToggleOrDismissButton;
156
- var boxShadow = "var(--ds-overlay, ".concat("0 20px 32px -8px ".concat(flagShadowColor), ")");
121
+ var boxShadow = "var(--ds-shadow-overlay, ".concat("0 20px 32px -8px ".concat(flagShadowColor), ")");
157
122
 
158
123
  if (!isBold) {
159
- boxShadow = "var(--ds-overlay, ".concat("0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow), ")");
124
+ boxShadow = "var(--ds-shadow-overlay, ".concat("0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow), ")");
160
125
  }
161
126
 
162
- return jsx(GlobalTheme.Consumer, null, function (tokens) {
163
- var mode = tokens.mode;
164
- var textColour = getFlagTextColor(appearance, mode);
165
- var iconColour = getFlagIconColor(appearance, mode);
166
- return jsx("div", _extends({
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()),
168
- role: "alert",
169
- "data-testid": testId
170
- }, autoDismissProps), jsx("div", {
171
- css: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n padding: ", "px;\n box-sizing: border-box;\n border-radius: ", "px;\n\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n @supports not selector(*:focus-visible) {\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px\n ", ";\n }\n }\n\n @media screen and (forced-colors: active),\n screen and (-ms-high-contrast: active) {\n &:focus-visible {\n outline: 1px solid;\n }\n }\n "])), doubleGridSize, borderRadius(), getFlagFocusRingColor(appearance, mode), getFlagFocusRingColor(appearance, mode)) // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
172
- ,
173
- tabIndex: 0
174
- }, jsx("div", {
175
- css: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n display: flex;\n align-items: center;\n height: ", "px;\n "])), iconColour, headerHeight)
176
- }, icon, jsx("span", {
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)
178
- }, title), jsx(OptionalDismissButton, {
179
- mode: mode
180
- })), jsx(Expander, {
181
- isExpanded: !isBold || isExpanded,
182
- testId: testId
183
- }, description && jsx("div", {
184
- css: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n word-wrap: break-word;\n overflow: auto;\n max-height: 100px; /* height is defined as 5 lines maximum by design */\n "])), textColour),
185
- "data-testid": testId && "".concat(testId, "-description")
186
- }, description), jsx(Actions, {
187
- actions: actions,
188
- appearance: appearance,
189
- linkComponent: linkComponent,
190
- testId: testId,
191
- mode: mode
192
- }))));
193
- });
127
+ var _useGlobalTheme = useGlobalTheme(),
128
+ mode = _useGlobalTheme.mode;
129
+
130
+ var textColor = getFlagTextColor(appearance, mode);
131
+ var iconColor = getFlagIconColor(appearance, mode);
132
+ var isDismissable = isBold || isDismissAllowed;
133
+ return jsx("div", _extends({
134
+ style: {
135
+ color: textColor,
136
+ backgroundColor: getFlagBackgroundColor(appearance, mode),
137
+ boxShadow: boxShadow
138
+ },
139
+ css: flagContainerStyles,
140
+ role: "alert",
141
+ "data-testid": testId
142
+ }, autoDismissProps), jsx(FocusRing, null, jsx("div", {
143
+ css: flagHeaderStyles // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
144
+ ,
145
+ tabIndex: 0
146
+ }, jsx("div", {
147
+ style: {
148
+ color: iconColor
149
+ },
150
+ css: iconStyles
151
+ }, icon, jsx(Title, {
152
+ color: textColor
153
+ }, title), isDismissable ? !(isBold && !description && !actions.length) && jsx(DismissButton, {
154
+ testId: testId,
155
+ appearance: appearance,
156
+ isBold: isBold,
157
+ isExpanded: isExpanded,
158
+ onClick: isBold ? toggleExpand : buttonActionCallback
159
+ }) : null), jsx(Expander, {
160
+ isExpanded: !isBold || isExpanded,
161
+ testId: testId
162
+ }, description && jsx(Description, {
163
+ testId: testId && "".concat(testId, "-description"),
164
+ color: textColor
165
+ }, description), jsx(Actions, {
166
+ actions: actions,
167
+ appearance: appearance,
168
+ linkComponent: linkComponent,
169
+ testId: testId,
170
+ mode: mode
171
+ })))));
194
172
  };
195
173
 
196
174
  export default Flag;
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/core';
3
+ var descriptionStyles = css({
4
+ /* height is defined as 5 lines maximum by design */
5
+ maxHeight: 100,
6
+ overflow: 'auto',
7
+ wordWrap: 'break-word'
8
+ });
9
+
10
+ var Description = function Description(_ref) {
11
+ var color = _ref.color,
12
+ testId = _ref.testId,
13
+ children = _ref.children;
14
+ return jsx("div", {
15
+ style: {
16
+ color: color
17
+ },
18
+ css: descriptionStyles,
19
+ "data-testid": testId
20
+ }, children);
21
+ };
22
+
23
+ export default Description;
@@ -0,0 +1,63 @@
1
+ /** @jsx jsx */
2
+ import { memo } from 'react';
3
+ import { jsx, css } from '@emotion/core';
4
+ import FocusRing from '@atlaskit/focus-ring';
5
+ import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
6
+ import ChevronUpIcon from '@atlaskit/icon/glyph/chevron-up';
7
+ import CrossIcon from '@atlaskit/icon/glyph/cross';
8
+ import { borderRadius as getBorderRadius, gridSize as getGridSize } from '@atlaskit/theme/constants';
9
+ import { useGlobalTheme } from '@atlaskit/theme/components';
10
+ import { getFlagTextColor } from '../theme';
11
+ var gridSize = getGridSize();
12
+ var borderRadius = getBorderRadius();
13
+ var dismissButtonStyles = css({
14
+ marginLeft: gridSize,
15
+ padding: 0,
16
+ flex: '0 0 auto',
17
+ appearance: 'none',
18
+ background: 'none',
19
+ border: 'none',
20
+ borderRadius: borderRadius,
21
+ cursor: 'pointer',
22
+ lineHeight: '1',
23
+ whiteSpace: 'nowrap'
24
+ });
25
+
26
+ var DismissButton = function DismissButton(_ref) {
27
+ var appearance = _ref.appearance,
28
+ onClick = _ref.onClick,
29
+ isBold = _ref.isBold,
30
+ isExpanded = _ref.isExpanded,
31
+ testId = _ref.testId;
32
+
33
+ var _useGlobalTheme = useGlobalTheme(),
34
+ mode = _useGlobalTheme.mode;
35
+
36
+ var ButtonIcon = CrossIcon;
37
+ var buttonLabel = 'Dismiss';
38
+ var size = 'small';
39
+ var buttonTestId = testId && "".concat(testId, "-dismiss");
40
+
41
+ if (isBold) {
42
+ ButtonIcon = isExpanded ? ChevronUpIcon : ChevronDownIcon;
43
+ buttonLabel = isExpanded ? 'Collapse' : 'Expand';
44
+ size = 'large';
45
+ buttonTestId = testId && "".concat(testId, "-toggle");
46
+ }
47
+
48
+ return jsx(FocusRing, null, jsx("button", {
49
+ style: {
50
+ color: getFlagTextColor(appearance, mode)
51
+ },
52
+ css: dismissButtonStyles,
53
+ onClick: onClick,
54
+ "data-testid": buttonTestId,
55
+ type: "button",
56
+ "aria-expanded": isBold ? isExpanded : undefined
57
+ }, jsx(ButtonIcon, {
58
+ label: buttonLabel,
59
+ size: size
60
+ })));
61
+ };
62
+
63
+ export default /*#__PURE__*/memo(DismissButton);
@@ -1,12 +1,21 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject;
4
-
5
1
  /** @jsx jsx */
6
2
  import { css, jsx } from '@emotion/core';
7
3
  import { ExitingPersistence, FadeIn } from '@atlaskit/motion';
8
4
  import { gridSize } from '@atlaskit/theme/constants';
9
5
  var paddingLeft = gridSize() * 5;
6
+ var expanderStyles = css({
7
+ display: 'flex',
8
+ minWidth: 0,
9
+ maxHeight: 0,
10
+ padding: "0 0 0 ".concat(paddingLeft, "px"),
11
+ justifyContent: 'center',
12
+ flex: '1 1 100%',
13
+ flexDirection: 'column',
14
+ transition: "max-height 0.3s"
15
+ });
16
+ var expandedStyles = css({
17
+ maxHeight: 150
18
+ });
10
19
 
11
20
  var Expander = function Expander(_ref) {
12
21
  var children = _ref.children,
@@ -17,7 +26,7 @@ var Expander = function Expander(_ref) {
17
26
  // the the reveal because we don't know the height of the content.
18
27
  return jsx("div", {
19
28
  "aria-hidden": !isExpanded,
20
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-height: ", "px;\n transition: max-height 0.3s;\n display: flex;\n flex: 1 1 100%;\n flex-direction: column;\n justify-content: center;\n min-width: 0;\n padding: 0 0 0 ", "px;\n "])), isExpanded ? 150 : 0, paddingLeft),
29
+ css: [expanderStyles, isExpanded && expandedStyles],
21
30
  "data-testid": testId && "".concat(testId, "-expander")
22
31
  }, jsx(ExitingPersistence, {
23
32
  appear: true
@@ -0,0 +1,4 @@
1
+ export { default as Title } from './title';
2
+ export { default as Description } from './description';
3
+ export { default as Expander } from './expander';
4
+ export { default as DismissButton } from './dismiss-button';
@@ -0,0 +1,23 @@
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/core';
3
+ var titleStyles = css({
4
+ padding: "0 0 0 16px",
5
+ flex: 1,
6
+ fontWeight: 600,
7
+ overflow: 'hidden',
8
+ textOverflow: 'ellipsis',
9
+ whiteSpace: 'nowrap'
10
+ });
11
+
12
+ var Title = function Title(_ref) {
13
+ var color = _ref.color,
14
+ children = _ref.children;
15
+ return jsx("span", {
16
+ style: {
17
+ color: color
18
+ },
19
+ css: titleStyles
20
+ }, children);
21
+ };
22
+
23
+ export default Title;
package/dist/esm/theme.js CHANGED
@@ -1,72 +1,72 @@
1
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: "var(--ds-background-overlay, ".concat(R400, ")"),
5
- dark: "var(--ds-background-overlay, ".concat(R300, ")")
4
+ light: "var(--ds-surface-overlay, ".concat(R400, ")"),
5
+ dark: "var(--ds-surface-overlay, ".concat(R300, ")")
6
6
  },
7
7
  info: {
8
- light: "var(--ds-background-overlay, ".concat(N500, ")"),
9
- dark: "var(--ds-background-overlay, ".concat(N500, ")")
8
+ light: "var(--ds-surface-overlay, ".concat(N500, ")"),
9
+ dark: "var(--ds-surface-overlay, ".concat(N500, ")")
10
10
  },
11
11
  normal: {
12
- light: "var(--ds-background-overlay, ".concat(N0, ")"),
13
- dark: "var(--ds-background-overlay, ".concat(DN50, ")")
12
+ light: "var(--ds-surface-overlay, ".concat(N0, ")"),
13
+ dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
14
14
  },
15
15
  success: {
16
- light: "var(--ds-background-overlay, ".concat(G400, ")"),
17
- dark: "var(--ds-background-overlay, ".concat(G300, ")")
16
+ light: "var(--ds-surface-overlay, ".concat(G400, ")"),
17
+ dark: "var(--ds-surface-overlay, ".concat(G300, ")")
18
18
  },
19
19
  warning: {
20
- light: "var(--ds-background-overlay, ".concat(Y200, ")"),
21
- dark: "var(--ds-background-overlay, ".concat(Y300, ")")
20
+ light: "var(--ds-surface-overlay, ".concat(Y200, ")"),
21
+ dark: "var(--ds-surface-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 = "var(--ds-background-overlay, ".concat(N60A, ")");
27
+ export var flagBorderColor = "var(--ds-surface-overlay, ".concat(N60A, ")");
28
28
  var flagIconColor = {
29
29
  error: {
30
- light: "var(--ds-iconBorder-danger, ".concat(N0, ")"),
31
- dark: "var(--ds-iconBorder-danger, ".concat(DN40, ")")
30
+ light: "var(--ds-icon-danger, ".concat(N0, ")"),
31
+ dark: "var(--ds-icon-danger, ".concat(DN40, ")")
32
32
  },
33
33
  info: {
34
- light: "var(--ds-iconBorder-discovery, ".concat(N0, ")"),
35
- dark: "var(--ds-iconBorder-discovery, ".concat(DN600, ")")
34
+ light: "var(--ds-icon-discovery, ".concat(N0, ")"),
35
+ dark: "var(--ds-icon-discovery, ".concat(DN600, ")")
36
36
  },
37
37
  normal: {
38
- light: "var(--ds-iconBorder-brand, ".concat(N500, ")"),
39
- dark: "var(--ds-iconBorder-brand, ".concat(DN600, ")")
38
+ light: "var(--ds-icon-brand, ".concat(N500, ")"),
39
+ dark: "var(--ds-icon-brand, ".concat(DN600, ")")
40
40
  },
41
41
  success: {
42
- light: "var(--ds-iconBorder-success, ".concat(N0, ")"),
43
- dark: "var(--ds-iconBorder-success, ".concat(DN40, ")")
42
+ light: "var(--ds-icon-success, ".concat(N0, ")"),
43
+ dark: "var(--ds-icon-success, ".concat(DN40, ")")
44
44
  },
45
45
  warning: {
46
- light: "var(--ds-iconBorder-warning, ".concat(N700, ")"),
47
- dark: "var(--ds-iconBorder-warning, ".concat(DN40, ")")
46
+ light: "var(--ds-icon-warning, ".concat(N700, ")"),
47
+ dark: "var(--ds-icon-warning, ".concat(DN40, ")")
48
48
  }
49
49
  };
50
50
  var flagTextColor = {
51
51
  error: {
52
- light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
53
- dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
52
+ light: "var(--ds-text, ".concat(N0, ")"),
53
+ dark: "var(--ds-text, ".concat(DN40, ")")
54
54
  },
55
55
  info: {
56
- light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
57
- dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
56
+ light: "var(--ds-text, ".concat(N0, ")"),
57
+ dark: "var(--ds-text, ".concat(DN600, ")")
58
58
  },
59
59
  normal: {
60
- light: "var(--ds-text-highEmphasis, ".concat(N500, ")"),
61
- dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
60
+ light: "var(--ds-text, ".concat(N500, ")"),
61
+ dark: "var(--ds-text, ".concat(DN600, ")")
62
62
  },
63
63
  success: {
64
- light: "var(--ds-text-highEmphasis, ".concat(N0, ")"),
65
- dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
64
+ light: "var(--ds-text, ".concat(N0, ")"),
65
+ dark: "var(--ds-text, ".concat(DN40, ")")
66
66
  },
67
67
  warning: {
68
- light: "var(--ds-text-highEmphasis, ".concat(N700, ")"),
69
- dark: "var(--ds-text-highEmphasis, ".concat(DN40, ")")
68
+ light: "var(--ds-text, ".concat(N700, ")"),
69
+ dark: "var(--ds-text, ".concat(DN40, ")")
70
70
  }
71
71
  };
72
72
  export var getFlagTextColor = function getFlagTextColor(appearance, mode) {
@@ -80,24 +80,24 @@ export var getFlagIconColor = function getFlagIconColor(appearance, mode) {
80
80
  export var flagShadowColor = N50A;
81
81
  var flagFocusRingColor = {
82
82
  error: {
83
- light: "var(--ds-border-focus, ".concat(N40, ")"),
84
- dark: "var(--ds-border-focus, ".concat(N40, ")")
83
+ light: "var(--ds-border-focused, ".concat(N40, ")"),
84
+ dark: "var(--ds-border-focused, ".concat(N40, ")")
85
85
  },
86
86
  info: {
87
- light: "var(--ds-border-focus, ".concat(N40, ")"),
88
- dark: "var(--ds-border-focus, ".concat(N40, ")")
87
+ light: "var(--ds-border-focused, ".concat(N40, ")"),
88
+ dark: "var(--ds-border-focused, ".concat(N40, ")")
89
89
  },
90
90
  normal: {
91
- light: "var(--ds-border-focus, ".concat(B100, ")"),
92
- dark: "var(--ds-border-focus, ".concat(B100, ")")
91
+ light: "var(--ds-border-focused, ".concat(B100, ")"),
92
+ dark: "var(--ds-border-focused, ".concat(B100, ")")
93
93
  },
94
94
  success: {
95
- light: "var(--ds-border-focus, ".concat(N40, ")"),
96
- dark: "var(--ds-border-focus, ".concat(N40, ")")
95
+ light: "var(--ds-border-focused, ".concat(N40, ")"),
96
+ dark: "var(--ds-border-focused, ".concat(N40, ")")
97
97
  },
98
98
  warning: {
99
- light: "var(--ds-border-focus, ".concat(N200, ")"),
100
- dark: "var(--ds-border-focus, ".concat(N200, ")")
99
+ light: "var(--ds-border-focused, ".concat(N200, ")"),
100
+ dark: "var(--ds-border-focused, ".concat(N200, ")")
101
101
  }
102
102
  };
103
103
  export var getFlagFocusRingColor = function getFlagFocusRingColor(appearance, mode) {
@@ -106,46 +106,46 @@ export var getFlagFocusRingColor = function getFlagFocusRingColor(appearance, mo
106
106
  var lightButtonBackground = 'rgba(255, 255, 255, 0.08)';
107
107
  var actionBackground = {
108
108
  success: {
109
- light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
110
- dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
109
+ light: "var(--ds-background-neutral, ".concat(lightButtonBackground, ")"),
110
+ dark: "var(--ds-background-neutral, ".concat(N30A, ")")
111
111
  },
112
112
  info: {
113
- light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
114
- dark: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")")
113
+ light: "var(--ds-background-neutral, ".concat(lightButtonBackground, ")"),
114
+ dark: "var(--ds-background-neutral, ".concat(lightButtonBackground, ")")
115
115
  },
116
116
  error: {
117
- light: "var(--ds-background-subtleNeutral-resting, ".concat(lightButtonBackground, ")"),
118
- dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
117
+ light: "var(--ds-background-neutral, ".concat(lightButtonBackground, ")"),
118
+ dark: "var(--ds-background-neutral, ".concat(N30A, ")")
119
119
  },
120
120
  warning: {
121
- light: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")"),
122
- dark: "var(--ds-background-subtleNeutral-resting, ".concat(N30A, ")")
121
+ light: "var(--ds-background-neutral, ".concat(N30A, ")"),
122
+ dark: "var(--ds-background-neutral, ".concat(N30A, ")")
123
123
  },
124
124
  normal: {
125
- light: "var(--ds-background-subtleNeutral-resting, none)",
126
- dark: "var(--ds-background-subtleNeutral-resting, none)"
125
+ light: "var(--ds-background-neutral, none)",
126
+ dark: "var(--ds-background-neutral, none)"
127
127
  }
128
128
  };
129
129
  var actionColor = {
130
130
  success: {
131
- light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
132
- dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
131
+ light: "var(--ds-text-subtle, ".concat(N0, ")"),
132
+ dark: "var(--ds-text-subtle, ".concat(DN40, ")")
133
133
  },
134
134
  info: {
135
- light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
136
- dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
135
+ light: "var(--ds-text-subtle, ".concat(N0, ")"),
136
+ dark: "var(--ds-text-subtle, ".concat(DN600, ")")
137
137
  },
138
138
  error: {
139
- light: "var(--ds-text-mediumEmphasis, ".concat(N0, ")"),
140
- dark: "var(--ds-text-mediumEmphasis, ".concat(DN600, ")")
139
+ light: "var(--ds-text-subtle, ".concat(N0, ")"),
140
+ dark: "var(--ds-text-subtle, ".concat(DN600, ")")
141
141
  },
142
142
  warning: {
143
- light: "var(--ds-text-mediumEmphasis, ".concat(N700, ")"),
144
- dark: "var(--ds-text-mediumEmphasis, ".concat(DN40, ")")
143
+ light: "var(--ds-text-subtle, ".concat(N700, ")"),
144
+ dark: "var(--ds-text-subtle, ".concat(DN40, ")")
145
145
  },
146
146
  normal: {
147
- light: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
148
- dark: "var(--ds-text-mediumEmphasis, ".concat(B100, ")")
147
+ light: "var(--ds-text-subtle, ".concat(B400, ")"),
148
+ dark: "var(--ds-text-subtle, ".concat(B100, ")")
149
149
  }
150
150
  };
151
151
  export var getActionBackground = function getActionBackground(appearance, mode) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "14.4.2",
3
+ "version": "14.5.3",
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,8 +1,8 @@
1
1
  /** @jsx jsx */
2
- import { ComponentType } from 'react';
3
- import { CustomThemeButtonProps } from '@atlaskit/button/types';
4
- import { ThemeModes } from '@atlaskit/theme/types';
5
- import { ActionsType, AppearanceTypes } from './types';
2
+ import type { ComponentType } from 'react';
3
+ import type { CustomThemeButtonProps } from '@atlaskit/button/types';
4
+ import type { ThemeModes } from '@atlaskit/theme/types';
5
+ import type { ActionsType, AppearanceTypes } from './types';
6
6
  declare type Props = {
7
7
  appearance: AppearanceTypes;
8
8
  actions: ActionsType;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { ReactElement } from 'react';
3
3
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
- declare type Props = {
4
+ declare type FlagGroupProps = {
5
5
  /** ID attribute used for DOM selection. */
6
6
  id?: string;
7
7
  /** Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`). */
@@ -23,5 +23,5 @@ declare type FlagGroupAPI = {
23
23
  };
24
24
  export declare const FlagGroupContext: import("react").Context<FlagGroupAPI>;
25
25
  export declare function useFlagGroup(): FlagGroupAPI;
26
- declare const FlagGroup: (props: Props) => JSX.Element;
26
+ declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
27
27
  export default FlagGroup;
@@ -1,3 +1,4 @@
1
- import { FlagProps } from './types';
1
+ /// <reference types="react" />
2
+ import type { FlagProps } from './types';
2
3
  declare const Flag: (props: FlagProps) => JSX.Element;
3
4
  export default Flag;