@atlaskit/flag 14.4.1 → 14.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/__perf__/withFlagGroup.tsx +7 -1
- package/dist/cjs/auto-dismiss-flag.js +4 -4
- package/dist/cjs/flag-actions.js +50 -6
- package/dist/cjs/flag-group.js +57 -19
- package/dist/cjs/flag-provider.js +6 -4
- package/dist/cjs/flag.js +85 -107
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/internal/description.js +32 -0
- package/dist/cjs/internal/dismiss-button.js +83 -0
- package/dist/cjs/{expander.js → internal/expander.js} +15 -7
- package/dist/cjs/internal/index.js +39 -0
- package/dist/cjs/internal/title.js +32 -0
- package/dist/cjs/theme.js +84 -60
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +2 -3
- package/dist/es2019/flag-actions.js +50 -32
- package/dist/es2019/flag-group.js +48 -65
- package/dist/es2019/flag.js +77 -162
- package/dist/es2019/internal/description.js +22 -0
- package/dist/es2019/internal/dismiss-button.js +63 -0
- package/dist/es2019/{expander.js → internal/expander.js} +14 -10
- package/dist/es2019/internal/index.js +4 -0
- package/dist/es2019/internal/title.js +22 -0
- package/dist/es2019/theme.js +78 -53
- package/dist/es2019/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +2 -3
- package/dist/esm/flag-actions.js +49 -6
- package/dist/esm/flag-group.js +52 -16
- package/dist/esm/flag-provider.js +4 -3
- package/dist/esm/flag.js +81 -102
- package/dist/esm/internal/description.js +23 -0
- package/dist/esm/internal/dismiss-button.js +63 -0
- package/dist/esm/{expander.js → internal/expander.js} +14 -5
- package/dist/esm/internal/index.js +4 -0
- package/dist/esm/internal/title.js +23 -0
- package/dist/esm/theme.js +80 -53
- package/dist/esm/version.json +1 -1
- package/dist/types/auto-dismiss-flag.d.ts +1 -0
- package/dist/types/flag-actions.d.ts +4 -4
- package/dist/types/flag-group.d.ts +2 -2
- package/dist/types/flag.d.ts +2 -1
- package/dist/types/internal/description.d.ts +7 -0
- package/dist/types/internal/dismiss-button.d.ts +11 -0
- package/dist/types/internal/expander.d.ts +8 -0
- package/dist/types/internal/index.d.ts +4 -0
- package/dist/types/internal/title.d.ts +6 -0
- package/dist/types/theme.d.ts +2 -1
- package/package.json +14 -10
- package/dist/types/expander.d.ts +0 -9
- package/expander/package.json +0 -7
package/dist/es2019/theme.js
CHANGED
|
@@ -1,118 +1,143 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { B100, B400, DN40, DN50, DN600, G300, G400, N0, N200, N30A, N40, N500, N50A, N60A, N700, R300, R400, Y200, Y300 } from '@atlaskit/theme/colors';
|
|
2
2
|
const flagBackgroundColor = {
|
|
3
3
|
error: {
|
|
4
|
-
light:
|
|
5
|
-
dark:
|
|
4
|
+
light: `var(--ds-surface-overlay, ${R400})`,
|
|
5
|
+
dark: `var(--ds-surface-overlay, ${R300})`
|
|
6
6
|
},
|
|
7
7
|
info: {
|
|
8
|
-
light:
|
|
9
|
-
dark:
|
|
8
|
+
light: `var(--ds-surface-overlay, ${N500})`,
|
|
9
|
+
dark: `var(--ds-surface-overlay, ${N500})`
|
|
10
10
|
},
|
|
11
11
|
normal: {
|
|
12
|
-
light:
|
|
13
|
-
dark:
|
|
12
|
+
light: `var(--ds-surface-overlay, ${N0})`,
|
|
13
|
+
dark: `var(--ds-surface-overlay, ${DN50})`
|
|
14
14
|
},
|
|
15
15
|
success: {
|
|
16
|
-
light:
|
|
17
|
-
dark:
|
|
16
|
+
light: `var(--ds-surface-overlay, ${G400})`,
|
|
17
|
+
dark: `var(--ds-surface-overlay, ${G300})`
|
|
18
18
|
},
|
|
19
19
|
warning: {
|
|
20
|
-
light:
|
|
21
|
-
dark:
|
|
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 =
|
|
25
|
+
export const flagBorderColor = `var(--ds-surface-overlay, ${N60A})`;
|
|
26
|
+
const flagIconColor = {
|
|
27
|
+
error: {
|
|
28
|
+
light: `var(--ds-icon-danger, ${N0})`,
|
|
29
|
+
dark: `var(--ds-icon-danger, ${DN40})`
|
|
30
|
+
},
|
|
31
|
+
info: {
|
|
32
|
+
light: `var(--ds-icon-discovery, ${N0})`,
|
|
33
|
+
dark: `var(--ds-icon-discovery, ${DN600})`
|
|
34
|
+
},
|
|
35
|
+
normal: {
|
|
36
|
+
light: `var(--ds-icon-brand, ${N500})`,
|
|
37
|
+
dark: `var(--ds-icon-brand, ${DN600})`
|
|
38
|
+
},
|
|
39
|
+
success: {
|
|
40
|
+
light: `var(--ds-icon-success, ${N0})`,
|
|
41
|
+
dark: `var(--ds-icon-success, ${DN40})`
|
|
42
|
+
},
|
|
43
|
+
warning: {
|
|
44
|
+
light: `var(--ds-icon-warning, ${N700})`,
|
|
45
|
+
dark: `var(--ds-icon-warning, ${DN40})`
|
|
46
|
+
}
|
|
47
|
+
};
|
|
26
48
|
const flagTextColor = {
|
|
27
49
|
error: {
|
|
28
|
-
light:
|
|
29
|
-
dark:
|
|
50
|
+
light: `var(--ds-text, ${N0})`,
|
|
51
|
+
dark: `var(--ds-text, ${DN40})`
|
|
30
52
|
},
|
|
31
53
|
info: {
|
|
32
|
-
light:
|
|
33
|
-
dark:
|
|
54
|
+
light: `var(--ds-text, ${N0})`,
|
|
55
|
+
dark: `var(--ds-text, ${DN600})`
|
|
34
56
|
},
|
|
35
57
|
normal: {
|
|
36
|
-
light:
|
|
37
|
-
dark:
|
|
58
|
+
light: `var(--ds-text, ${N500})`,
|
|
59
|
+
dark: `var(--ds-text, ${DN600})`
|
|
38
60
|
},
|
|
39
61
|
success: {
|
|
40
|
-
light:
|
|
41
|
-
dark:
|
|
62
|
+
light: `var(--ds-text, ${N0})`,
|
|
63
|
+
dark: `var(--ds-text, ${DN40})`
|
|
42
64
|
},
|
|
43
65
|
warning: {
|
|
44
|
-
light:
|
|
45
|
-
dark:
|
|
66
|
+
light: `var(--ds-text, ${N700})`,
|
|
67
|
+
dark: `var(--ds-text, ${DN40})`
|
|
46
68
|
}
|
|
47
69
|
};
|
|
48
70
|
export const getFlagTextColor = (appearance, mode) => flagTextColor[appearance][mode];
|
|
49
|
-
export const
|
|
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:
|
|
53
|
-
dark:
|
|
77
|
+
light: `var(--ds-border-focused, ${N40})`,
|
|
78
|
+
dark: `var(--ds-border-focused, ${N40})`
|
|
54
79
|
},
|
|
55
80
|
info: {
|
|
56
|
-
light:
|
|
57
|
-
dark:
|
|
81
|
+
light: `var(--ds-border-focused, ${N40})`,
|
|
82
|
+
dark: `var(--ds-border-focused, ${N40})`
|
|
58
83
|
},
|
|
59
84
|
normal: {
|
|
60
|
-
light:
|
|
61
|
-
dark:
|
|
85
|
+
light: `var(--ds-border-focused, ${B100})`,
|
|
86
|
+
dark: `var(--ds-border-focused, ${B100})`
|
|
62
87
|
},
|
|
63
88
|
success: {
|
|
64
|
-
light:
|
|
65
|
-
dark:
|
|
89
|
+
light: `var(--ds-border-focused, ${N40})`,
|
|
90
|
+
dark: `var(--ds-border-focused, ${N40})`
|
|
66
91
|
},
|
|
67
92
|
warning: {
|
|
68
|
-
light:
|
|
69
|
-
dark:
|
|
93
|
+
light: `var(--ds-border-focused, ${N200})`,
|
|
94
|
+
dark: `var(--ds-border-focused, ${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:
|
|
101
|
+
light: `var(--ds-background-neutral, ${lightButtonBackground})`,
|
|
102
|
+
dark: `var(--ds-background-neutral, ${N30A})`
|
|
78
103
|
},
|
|
79
104
|
info: {
|
|
80
|
-
light: lightButtonBackground
|
|
81
|
-
dark: lightButtonBackground
|
|
105
|
+
light: `var(--ds-background-neutral, ${lightButtonBackground})`,
|
|
106
|
+
dark: `var(--ds-background-neutral, ${lightButtonBackground})`
|
|
82
107
|
},
|
|
83
108
|
error: {
|
|
84
|
-
light: lightButtonBackground
|
|
85
|
-
dark:
|
|
109
|
+
light: `var(--ds-background-neutral, ${lightButtonBackground})`,
|
|
110
|
+
dark: `var(--ds-background-neutral, ${N30A})`
|
|
86
111
|
},
|
|
87
112
|
warning: {
|
|
88
|
-
light:
|
|
89
|
-
dark:
|
|
113
|
+
light: `var(--ds-background-neutral, ${N30A})`,
|
|
114
|
+
dark: `var(--ds-background-neutral, ${N30A})`
|
|
90
115
|
},
|
|
91
116
|
normal: {
|
|
92
|
-
light:
|
|
93
|
-
dark:
|
|
117
|
+
light: "var(--ds-background-neutral, none)",
|
|
118
|
+
dark: "var(--ds-background-neutral, none)"
|
|
94
119
|
}
|
|
95
120
|
};
|
|
96
121
|
const actionColor = {
|
|
97
122
|
success: {
|
|
98
|
-
light:
|
|
99
|
-
dark:
|
|
123
|
+
light: `var(--ds-text-subtle, ${N0})`,
|
|
124
|
+
dark: `var(--ds-text-subtle, ${DN40})`
|
|
100
125
|
},
|
|
101
126
|
info: {
|
|
102
|
-
light:
|
|
103
|
-
dark:
|
|
127
|
+
light: `var(--ds-text-subtle, ${N0})`,
|
|
128
|
+
dark: `var(--ds-text-subtle, ${DN600})`
|
|
104
129
|
},
|
|
105
130
|
error: {
|
|
106
|
-
light:
|
|
107
|
-
dark:
|
|
131
|
+
light: `var(--ds-text-subtle, ${N0})`,
|
|
132
|
+
dark: `var(--ds-text-subtle, ${DN600})`
|
|
108
133
|
},
|
|
109
134
|
warning: {
|
|
110
|
-
light:
|
|
111
|
-
dark:
|
|
135
|
+
light: `var(--ds-text-subtle, ${N700})`,
|
|
136
|
+
dark: `var(--ds-text-subtle, ${DN40})`
|
|
112
137
|
},
|
|
113
138
|
normal: {
|
|
114
|
-
light:
|
|
115
|
-
dark:
|
|
139
|
+
light: `var(--ds-text-subtle, ${B400})`,
|
|
140
|
+
dark: `var(--ds-text-subtle, ${B100})`
|
|
116
141
|
}
|
|
117
142
|
};
|
|
118
143
|
export const getActionBackground = (appearance, mode) => actionBackground[appearance][mode];
|
package/dist/es2019/version.json
CHANGED
|
@@ -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.
|
|
8
|
+
var packageVersion = "14.5.2";
|
|
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,
|
package/dist/esm/flag-actions.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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
|
};
|
package/dist/esm/flag-group.js
CHANGED
|
@@ -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 =
|
|
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:
|
|
55
|
-
fade:
|
|
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:
|
|
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:
|
|
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);
|
|
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]
|
|
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,
|
|
83
|
+
restProps = _objectWithoutProperties(flag, _excluded);
|
|
83
84
|
|
|
84
85
|
var FlagType = isAutoDismiss ? AutoDismissFlag : Flag;
|
|
85
86
|
return /*#__PURE__*/React.createElement(FlagType, _extends({}, restProps, {
|