@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
@@ -1,70 +1,70 @@
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
  const flagBackgroundColor = {
3
3
  error: {
4
- light: `var(--ds-background-overlay, ${R400})`,
5
- dark: `var(--ds-background-overlay, ${R300})`
4
+ light: `var(--ds-surface-overlay, ${R400})`,
5
+ dark: `var(--ds-surface-overlay, ${R300})`
6
6
  },
7
7
  info: {
8
- light: `var(--ds-background-overlay, ${N500})`,
9
- dark: `var(--ds-background-overlay, ${N500})`
8
+ light: `var(--ds-surface-overlay, ${N500})`,
9
+ dark: `var(--ds-surface-overlay, ${N500})`
10
10
  },
11
11
  normal: {
12
- light: `var(--ds-background-overlay, ${N0})`,
13
- dark: `var(--ds-background-overlay, ${DN50})`
12
+ light: `var(--ds-surface-overlay, ${N0})`,
13
+ dark: `var(--ds-surface-overlay, ${DN50})`
14
14
  },
15
15
  success: {
16
- light: `var(--ds-background-overlay, ${G400})`,
17
- dark: `var(--ds-background-overlay, ${G300})`
16
+ light: `var(--ds-surface-overlay, ${G400})`,
17
+ dark: `var(--ds-surface-overlay, ${G300})`
18
18
  },
19
19
  warning: {
20
- light: `var(--ds-background-overlay, ${Y200})`,
21
- dark: `var(--ds-background-overlay, ${Y300})`
20
+ light: `var(--ds-surface-overlay, ${Y200})`,
21
+ dark: `var(--ds-surface-overlay, ${Y300})`
22
22
  }
23
23
  };
24
24
  export const getFlagBackgroundColor = (appearance, mode) => flagBackgroundColor[appearance][mode];
25
- export const flagBorderColor = `var(--ds-background-overlay, ${N60A})`;
25
+ export const flagBorderColor = `var(--ds-surface-overlay, ${N60A})`;
26
26
  const flagIconColor = {
27
27
  error: {
28
- light: `var(--ds-iconBorder-danger, ${N0})`,
29
- dark: `var(--ds-iconBorder-danger, ${DN40})`
28
+ light: `var(--ds-icon-danger, ${N0})`,
29
+ dark: `var(--ds-icon-danger, ${DN40})`
30
30
  },
31
31
  info: {
32
- light: `var(--ds-iconBorder-discovery, ${N0})`,
33
- dark: `var(--ds-iconBorder-discovery, ${DN600})`
32
+ light: `var(--ds-icon-discovery, ${N0})`,
33
+ dark: `var(--ds-icon-discovery, ${DN600})`
34
34
  },
35
35
  normal: {
36
- light: `var(--ds-iconBorder-brand, ${N500})`,
37
- dark: `var(--ds-iconBorder-brand, ${DN600})`
36
+ light: `var(--ds-icon-brand, ${N500})`,
37
+ dark: `var(--ds-icon-brand, ${DN600})`
38
38
  },
39
39
  success: {
40
- light: `var(--ds-iconBorder-success, ${N0})`,
41
- dark: `var(--ds-iconBorder-success, ${DN40})`
40
+ light: `var(--ds-icon-success, ${N0})`,
41
+ dark: `var(--ds-icon-success, ${DN40})`
42
42
  },
43
43
  warning: {
44
- light: `var(--ds-iconBorder-warning, ${N700})`,
45
- dark: `var(--ds-iconBorder-warning, ${DN40})`
44
+ light: `var(--ds-icon-warning, ${N700})`,
45
+ dark: `var(--ds-icon-warning, ${DN40})`
46
46
  }
47
47
  };
48
48
  const flagTextColor = {
49
49
  error: {
50
- light: `var(--ds-text-highEmphasis, ${N0})`,
51
- dark: `var(--ds-text-highEmphasis, ${DN40})`
50
+ light: `var(--ds-text, ${N0})`,
51
+ dark: `var(--ds-text, ${DN40})`
52
52
  },
53
53
  info: {
54
- light: `var(--ds-text-highEmphasis, ${N0})`,
55
- dark: `var(--ds-text-highEmphasis, ${DN600})`
54
+ light: `var(--ds-text, ${N0})`,
55
+ dark: `var(--ds-text, ${DN600})`
56
56
  },
57
57
  normal: {
58
- light: `var(--ds-text-highEmphasis, ${N500})`,
59
- dark: `var(--ds-text-highEmphasis, ${DN600})`
58
+ light: `var(--ds-text, ${N500})`,
59
+ dark: `var(--ds-text, ${DN600})`
60
60
  },
61
61
  success: {
62
- light: `var(--ds-text-highEmphasis, ${N0})`,
63
- dark: `var(--ds-text-highEmphasis, ${DN40})`
62
+ light: `var(--ds-text, ${N0})`,
63
+ dark: `var(--ds-text, ${DN40})`
64
64
  },
65
65
  warning: {
66
- light: `var(--ds-text-highEmphasis, ${N700})`,
67
- dark: `var(--ds-text-highEmphasis, ${DN40})`
66
+ light: `var(--ds-text, ${N700})`,
67
+ dark: `var(--ds-text, ${DN40})`
68
68
  }
69
69
  };
70
70
  export const getFlagTextColor = (appearance, mode) => flagTextColor[appearance][mode];
@@ -74,70 +74,70 @@ export const getFlagIconColor = (appearance, mode) => flagIconColor[appearance][
74
74
  export const flagShadowColor = N50A;
75
75
  const flagFocusRingColor = {
76
76
  error: {
77
- light: `var(--ds-border-focus, ${N40})`,
78
- dark: `var(--ds-border-focus, ${N40})`
77
+ light: `var(--ds-border-focused, ${N40})`,
78
+ dark: `var(--ds-border-focused, ${N40})`
79
79
  },
80
80
  info: {
81
- light: `var(--ds-border-focus, ${N40})`,
82
- dark: `var(--ds-border-focus, ${N40})`
81
+ light: `var(--ds-border-focused, ${N40})`,
82
+ dark: `var(--ds-border-focused, ${N40})`
83
83
  },
84
84
  normal: {
85
- light: `var(--ds-border-focus, ${B100})`,
86
- dark: `var(--ds-border-focus, ${B100})`
85
+ light: `var(--ds-border-focused, ${B100})`,
86
+ dark: `var(--ds-border-focused, ${B100})`
87
87
  },
88
88
  success: {
89
- light: `var(--ds-border-focus, ${N40})`,
90
- dark: `var(--ds-border-focus, ${N40})`
89
+ light: `var(--ds-border-focused, ${N40})`,
90
+ dark: `var(--ds-border-focused, ${N40})`
91
91
  },
92
92
  warning: {
93
- light: `var(--ds-border-focus, ${N200})`,
94
- dark: `var(--ds-border-focus, ${N200})`
93
+ light: `var(--ds-border-focused, ${N200})`,
94
+ dark: `var(--ds-border-focused, ${N200})`
95
95
  }
96
96
  };
97
97
  export const getFlagFocusRingColor = (appearance, mode) => flagFocusRingColor[appearance][mode];
98
98
  const lightButtonBackground = 'rgba(255, 255, 255, 0.08)';
99
99
  const actionBackground = {
100
100
  success: {
101
- light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
102
- dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
101
+ light: `var(--ds-background-neutral, ${lightButtonBackground})`,
102
+ dark: `var(--ds-background-neutral, ${N30A})`
103
103
  },
104
104
  info: {
105
- light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
106
- dark: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`
105
+ light: `var(--ds-background-neutral, ${lightButtonBackground})`,
106
+ dark: `var(--ds-background-neutral, ${lightButtonBackground})`
107
107
  },
108
108
  error: {
109
- light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
110
- dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
109
+ light: `var(--ds-background-neutral, ${lightButtonBackground})`,
110
+ dark: `var(--ds-background-neutral, ${N30A})`
111
111
  },
112
112
  warning: {
113
- light: `var(--ds-background-subtleNeutral-resting, ${N30A})`,
114
- dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
113
+ light: `var(--ds-background-neutral, ${N30A})`,
114
+ dark: `var(--ds-background-neutral, ${N30A})`
115
115
  },
116
116
  normal: {
117
- light: "var(--ds-background-subtleNeutral-resting, none)",
118
- dark: "var(--ds-background-subtleNeutral-resting, none)"
117
+ light: "var(--ds-background-neutral, none)",
118
+ dark: "var(--ds-background-neutral, none)"
119
119
  }
120
120
  };
121
121
  const actionColor = {
122
122
  success: {
123
- light: `var(--ds-text-mediumEmphasis, ${N0})`,
124
- dark: `var(--ds-text-mediumEmphasis, ${DN40})`
123
+ light: `var(--ds-text-subtle, ${N0})`,
124
+ dark: `var(--ds-text-subtle, ${DN40})`
125
125
  },
126
126
  info: {
127
- light: `var(--ds-text-mediumEmphasis, ${N0})`,
128
- dark: `var(--ds-text-mediumEmphasis, ${DN600})`
127
+ light: `var(--ds-text-subtle, ${N0})`,
128
+ dark: `var(--ds-text-subtle, ${DN600})`
129
129
  },
130
130
  error: {
131
- light: `var(--ds-text-mediumEmphasis, ${N0})`,
132
- dark: `var(--ds-text-mediumEmphasis, ${DN600})`
131
+ light: `var(--ds-text-subtle, ${N0})`,
132
+ dark: `var(--ds-text-subtle, ${DN600})`
133
133
  },
134
134
  warning: {
135
- light: `var(--ds-text-mediumEmphasis, ${N700})`,
136
- dark: `var(--ds-text-mediumEmphasis, ${DN40})`
135
+ light: `var(--ds-text-subtle, ${N700})`,
136
+ dark: `var(--ds-text-subtle, ${DN40})`
137
137
  },
138
138
  normal: {
139
- light: `var(--ds-text-mediumEmphasis, ${B400})`,
140
- dark: `var(--ds-text-mediumEmphasis, ${B100})`
139
+ light: `var(--ds-text-subtle, ${B400})`,
140
+ dark: `var(--ds-text-subtle, ${B100})`
141
141
  }
142
142
  };
143
143
  export const getActionBackground = (appearance, mode) => actionBackground[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,14 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useEffect, useRef } from 'react';
3
3
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
4
+ import noop from '@atlaskit/ds-lib/noop';
4
5
  import Flag from './flag';
5
6
  import { useFlagGroup } from './flag-group';
6
7
  var packageName = "@atlaskit/flag";
7
- var packageVersion = "14.4.2";
8
+ var packageVersion = "14.5.3";
8
9
  export var AUTO_DISMISS_SECONDS = 8;
9
10
 
10
- function noop() {}
11
-
12
11
  var AutoDismissFlag = function AutoDismissFlag(props) {
13
12
  var id = props.id,
14
13
  analyticsContext = props.analyticsContext,
@@ -1,6 +1,4 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject, _templateObject2, _templateObject3;
1
+ /* eslint-disable @repo/internal/styles/no-nested-styles */
4
2
 
5
3
  /** @jsx jsx */
6
4
  import { css, jsx } from '@emotion/core';
@@ -11,6 +9,46 @@ import { getActionBackground, getActionColor, getFlagFocusRingColor } from './th
11
9
  var gridSize = getGridSize();
12
10
  var separatorWidth = gridSize * 2;
13
11
  var defaultAppearanceTranslate = gridSize / 4;
12
+ var separatorStyles = css({
13
+ display: 'inline-block',
14
+ width: separatorWidth,
15
+ textAlign: 'center'
16
+ });
17
+ var actionContainerStyles = css({
18
+ display: 'flex',
19
+ paddingTop: gridSize,
20
+ alignItems: 'center',
21
+ flexWrap: 'wrap',
22
+ transform: "translateX(-".concat(defaultAppearanceTranslate, "px)")
23
+ });
24
+ var boldActionContainerStyles = css({
25
+ transform: 0
26
+ });
27
+ var buttonStyles = css({
28
+ '&&, a&&': {
29
+ marginLeft: 0,
30
+ padding: "0 ".concat(gridSize, "px !important"),
31
+ background: "var(--bg-color)",
32
+ color: "var(--color) !important",
33
+ fontWeight: 500
34
+ },
35
+ '&&:focus, a&&:focus': {
36
+ boxShadow: "0 0 0 2px var(--focus-color)"
37
+ },
38
+ '&&:hover, &&:active, a&&:hover, a&&:active': {
39
+ textDecoration: 'underline'
40
+ }
41
+ });
42
+ var appeanceNormalButtonStyles = css({
43
+ '&&, a&&': {
44
+ padding: '0 !important'
45
+ }
46
+ });
47
+ var isBoldButtonStyles = css({
48
+ '&&, a&&': {
49
+ marginLeft: gridSize
50
+ }
51
+ });
14
52
 
15
53
  var FlagActions = function FlagActions(props) {
16
54
  var _props$appearance = props.appearance,
@@ -27,11 +65,11 @@ var FlagActions = function FlagActions(props) {
27
65
 
28
66
  var isBold = appearance !== DEFAULT_APPEARANCE;
29
67
  return jsx("div", {
30
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n padding-top: ", "px;\n transform: ", ";\n align-items: center;\n "])), gridSize, appearance === DEFAULT_APPEARANCE ? "translateX(-".concat(defaultAppearanceTranslate, "px)") : 0),
68
+ css: [actionContainerStyles, isBold && boldActionContainerStyles],
31
69
  "data-testid": testId && "".concat(testId, "-actions")
32
70
  }, actions.map(function (action, index) {
33
71
  return [index && !isBold ? jsx("div", {
34
- css: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-align: center;\n display: inline-block;\n width: ", "px;\n "])), separatorWidth),
72
+ css: separatorStyles,
35
73
  key: index + 0.5
36
74
  }, "\xB7") : '', jsx(Button, {
37
75
  onClick: action.onClick,
@@ -42,7 +80,12 @@ var FlagActions = function FlagActions(props) {
42
80
  spacing: "compact",
43
81
  testId: action.testId,
44
82
  key: index,
45
- css: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &&,\n a&& {\n margin-left: ", "px;\n font-weight: 500;\n padding: 0 ", "px !important;\n background: ", ";\n color: ", " !important;\n }\n &&:focus,\n a&&:focus {\n box-shadow: 0 0 0 2px ", ";\n }\n &&:hover,\n &&:active,\n a&&:hover,\n a&&:active {\n text-decoration: underline;\n }\n "])), index && isBold ? gridSize : 0, appearance === 'normal' ? 0 : gridSize, getActionBackground(appearance, mode), getActionColor(appearance, mode), getFlagFocusRingColor(appearance, mode))
83
+ style: {
84
+ '--color': getActionColor(appearance, mode),
85
+ '--bg-color': getActionBackground(appearance, mode),
86
+ '--focus-color': getFlagFocusRingColor(appearance, mode)
87
+ },
88
+ css: [buttonStyles, isBold && isBoldButtonStyles, appearance === 'normal' && appeanceNormalButtonStyles]
46
89
  }, action.content)];
47
90
  }));
48
91
  };
@@ -1,13 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
2
  import _typeof from "@babel/runtime/helpers/typeof";
4
3
 
5
- var _templateObject, _templateObject2, _templateObject3;
6
-
7
4
  /** @jsx jsx */
8
5
  import { Children, createContext, useContext, useMemo } from 'react';
9
6
  import { css, jsx } from '@emotion/core';
10
7
  import { easeIn, ExitingPersistence, SlideIn } from '@atlaskit/motion';
8
+ import VisuallyHidden from '@atlaskit/visually-hidden';
9
+ import noop from '@atlaskit/ds-lib/noop';
11
10
  import Portal from '@atlaskit/portal';
12
11
  import { gridSize as getGridSize, layers } from '@atlaskit/theme/constants';
13
12
  var gridSize = getGridSize();
@@ -15,9 +14,6 @@ export var flagWidth = gridSize * 50;
15
14
  export var flagAnimationTime = 400;
16
15
  var flagBottom = gridSize * 6;
17
16
  var flagLeft = gridSize * 10;
18
-
19
- function noop() {}
20
-
21
17
  var defaultFlagGroupContext = {
22
18
  onDismissed: function onDismissed() {},
23
19
  isDismissAllowed: false
@@ -28,7 +24,51 @@ export function useFlagGroup() {
28
24
  } // transition: none is set on first-of-type to prevent a bug in Firefox
29
25
  // that causes a broken transition
30
26
 
31
- var baseStyles = "\n bottom: 0;\n position: absolute;\n width: ".concat(flagWidth, "px;\n transition: transform ").concat(flagAnimationTime, "ms ease-in-out;\n\n @media (max-width: 560px) {\n width: 100vw;\n }\n\n &:first-of-type {\n transition: none;\n transform: translate(0,0);\n }\n\n &:nth-of-type(n + 2) {\n animation-duration: 0ms;\n transform: translateX(0) translateY(100%) translateY(").concat(2 * gridSize, "px);\n }\n\n /* Layer the 'primary' flag above the 'secondary' flag */\n &:nth-of-type(1) {\n z-index: 5;\n }\n &:nth-of-type(2) {\n z-index: 4;\n }\n\n &:nth-of-type(n + 4) {\n visibility: hidden;\n }\n");
27
+ var baseStyles = css({
28
+ width: flagWidth,
29
+ position: 'absolute',
30
+ bottom: 0,
31
+ transition: "transform ".concat(flagAnimationTime, "ms ease-in-out"),
32
+ '@media (max-width: 560px)': {
33
+ width: '100vw'
34
+ },
35
+ ':first-of-type': {
36
+ transform: "translate(0,0)",
37
+ transition: 'none'
38
+ },
39
+ ':nth-of-type(n + 2)': {
40
+ animationDuration: '0ms',
41
+ transform: "translateX(0) translateY(100%) translateY(".concat(2 * gridSize, "px)")
42
+ },
43
+ ':nth-of-type(1)': {
44
+ zIndex: 5
45
+ },
46
+ ':nth-of-type(2)': {
47
+ zIndex: 4
48
+ },
49
+ '&:nth-of-type(n + 4)': {
50
+ visibility: 'hidden'
51
+ }
52
+ }); // Transform needed to push up while 1st flag is leaving
53
+ // Exiting time should match the exiting time of motion so is halved
54
+
55
+ var dismissAllowedStyles = css({
56
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
57
+ '&& + *': {
58
+ transform: "translate(0, 0)",
59
+ transitionDuration: "".concat(flagAnimationTime / 2, "ms")
60
+ }
61
+ });
62
+ var flagGroupContainerStyles = css({
63
+ position: 'fixed',
64
+ zIndex: layers.flag(),
65
+ bottom: flagBottom,
66
+ left: flagLeft,
67
+ '@media (max-width: 560px)': {
68
+ bottom: 0,
69
+ left: 0
70
+ }
71
+ });
32
72
 
33
73
  var FlagGroup = function FlagGroup(props) {
34
74
  var id = props.id,
@@ -51,17 +91,15 @@ var FlagGroup = function FlagGroup(props) {
51
91
  return children && _typeof(children) === 'object' ? Children.map(children, function (flag, index) {
52
92
  var isDismissAllowed = index === 0;
53
93
  return jsx(SlideIn, {
54
- enterFrom: 'left',
55
- fade: 'inout',
94
+ enterFrom: "left",
95
+ fade: "inout",
56
96
  duration: flagAnimationTime,
57
97
  animationTimingFunction: function animationTimingFunction() {
58
98
  return easeIn;
59
99
  }
60
100
  }, function (props) {
61
101
  return jsx("div", _extends({}, props, {
62
- css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n ", "\n "])), baseStyles, isDismissAllowed ? // Transform needed to push up while 1st flag is leaving
63
- // Exiting time should match the exiting time of motion so is halved
64
- "\n && + * {\n transform: translate(0, 0);\n transition-duration: ".concat(flagAnimationTime / 2, "ms\n }") : '')
102
+ css: [baseStyles, isDismissAllowed && dismissAllowedStyles]
65
103
  }), jsx(FlagGroupContext.Provider, {
66
104
  value: // Only the first flag should be able to be dismissed.
67
105
  isDismissAllowed ? dismissFlagContext : defaultFlagGroupContext
@@ -74,10 +112,8 @@ var FlagGroup = function FlagGroup(props) {
74
112
  zIndex: layers.flag()
75
113
  }, jsx("div", {
76
114
  id: id,
77
- css: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n bottom: ", "px;\n left: ", "px;\n position: fixed;\n z-index: ", ";\n @media (max-width: 560px) {\n bottom: 0;\n left: 0;\n }\n "])), flagBottom, flagLeft, layers.flag())
78
- }, hasFlags ? jsx(LabelTag, {
79
- css: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n "])))
80
- }, label) : null, jsx(ExitingPersistence, {
115
+ css: flagGroupContainerStyles
116
+ }, hasFlags ? jsx(VisuallyHidden, null, jsx(LabelTag, null, label)) : null, jsx(ExitingPersistence, {
81
117
  appear: false
82
118
  }, renderChildren())));
83
119
  };
@@ -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, {