@atlaskit/flag 14.3.4 → 14.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/__perf__/withFlagGroup.tsx +7 -1
- package/dist/cjs/auto-dismiss-flag.js +1 -1
- package/dist/cjs/flag-group.js +1 -1
- package/dist/cjs/flag-provider.js +1 -1
- package/dist/cjs/flag.js +32 -35
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/theme.js +84 -60
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/auto-dismiss-flag.js +1 -1
- package/dist/es2019/flag.js +74 -56
- package/dist/es2019/theme.js +78 -53
- package/dist/es2019/version.json +1 -1
- package/dist/esm/auto-dismiss-flag.js +1 -1
- package/dist/esm/flag.js +33 -35
- 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.d.ts +1 -0
- package/dist/types/theme.d.ts +2 -1
- package/package.json +12 -11
- package/dist/cjs/utils.js +0 -24
- package/dist/es2019/utils.js +0 -15
- package/dist/esm/utils.js +0 -15
- package/dist/types/utils.d.ts +0 -2
- package/utils/package.json +0 -7
package/dist/es2019/flag.js
CHANGED
|
@@ -10,18 +10,17 @@ 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';
|
|
17
|
-
import { onMouseDownBlur } from './utils';
|
|
18
17
|
|
|
19
18
|
function noop() {}
|
|
20
19
|
|
|
21
20
|
const analyticsAttributes = {
|
|
22
21
|
componentName: 'flag',
|
|
23
22
|
packageName: "@atlaskit/flag",
|
|
24
|
-
packageVersion: "14.
|
|
23
|
+
packageVersion: "14.5.0"
|
|
25
24
|
};
|
|
26
25
|
const gridSize = getGridSize();
|
|
27
26
|
const doubleGridSize = gridSize * 2;
|
|
@@ -153,76 +152,95 @@ const Flag = props => {
|
|
|
153
152
|
onBlur: onBlurAnalytics
|
|
154
153
|
};
|
|
155
154
|
const OptionalDismissButton = renderToggleOrDismissButton;
|
|
156
|
-
let boxShadow = `0 20px 32px -8px ${flagShadowColor}`;
|
|
155
|
+
let boxShadow = `var(--ds-overlay, ${`0 20px 32px -8px ${flagShadowColor}`})`;
|
|
157
156
|
|
|
158
157
|
if (!isBold) {
|
|
159
|
-
boxShadow = `0 0 1px ${flagBorderColor}, ${boxShadow}`;
|
|
158
|
+
boxShadow = `var(--ds-overlay, ${`0 0 1px ${flagBorderColor}, ${boxShadow}`})`;
|
|
160
159
|
}
|
|
161
160
|
|
|
162
161
|
return jsx(GlobalTheme.Consumer, null, tokens => {
|
|
163
162
|
const mode = tokens.mode;
|
|
164
163
|
const textColour = getFlagTextColor(appearance, mode);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
css: css`
|
|
164
|
+
const iconColour = getFlagIconColor(appearance, mode);
|
|
165
|
+
return jsx("div", _extends({
|
|
166
|
+
css: css`
|
|
169
167
|
background-color: ${getFlagBackgroundColor(appearance, mode)};
|
|
170
168
|
border-radius: ${borderRadius()}px;
|
|
171
|
-
box-sizing: border-box;
|
|
172
169
|
box-shadow: ${boxShadow};
|
|
173
170
|
color: ${textColour};
|
|
174
|
-
padding: ${doubleGridSize}px;
|
|
175
171
|
transition: background-color 200ms;
|
|
176
172
|
width: 100%;
|
|
177
173
|
z-index: ${layers.flag()};
|
|
178
|
-
|
|
179
|
-
&:focus {
|
|
180
|
-
outline: none;
|
|
181
|
-
box-shadow: 0 0 0 2px ${getFlagFocusRingColor(appearance, mode)};
|
|
182
|
-
}
|
|
183
174
|
`,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
175
|
+
role: "alert",
|
|
176
|
+
"data-testid": testId
|
|
177
|
+
}, autoDismissProps), jsx("div", {
|
|
178
|
+
css: css`
|
|
179
|
+
width: 100%;
|
|
180
|
+
padding: ${doubleGridSize}px;
|
|
181
|
+
box-sizing: border-box;
|
|
182
|
+
border-radius: ${borderRadius()}px;
|
|
183
|
+
|
|
184
|
+
&:focus-visible {
|
|
185
|
+
outline: none;
|
|
186
|
+
box-shadow: 0 0 0 2px
|
|
187
|
+
${getFlagFocusRingColor(appearance, mode)};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@supports not selector(*:focus-visible) {
|
|
191
|
+
&:focus {
|
|
192
|
+
outline: none;
|
|
193
|
+
box-shadow: 0 0 0 2px
|
|
194
|
+
${getFlagFocusRingColor(appearance, mode)};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@media screen and (forced-colors: active),
|
|
199
|
+
screen and (-ms-high-contrast: active) {
|
|
200
|
+
&:focus-visible {
|
|
201
|
+
outline: 1px solid;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
` // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
205
|
+
,
|
|
206
|
+
tabIndex: 0
|
|
207
|
+
}, jsx("div", {
|
|
208
|
+
css: css`
|
|
209
|
+
color: ${iconColour};
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
height: ${headerHeight}px;
|
|
204
213
|
`
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
})), jsx(Expander, {
|
|
208
|
-
isExpanded: !isBold || isExpanded,
|
|
209
|
-
testId: testId
|
|
210
|
-
}, description && jsx("div", {
|
|
211
|
-
css: css`
|
|
214
|
+
}, icon, jsx("span", {
|
|
215
|
+
css: css`
|
|
212
216
|
color: ${textColour};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
217
|
+
font-weight: 600;
|
|
218
|
+
flex: 1;
|
|
219
|
+
overflow: hidden;
|
|
220
|
+
text-overflow: ellipsis;
|
|
221
|
+
white-space: nowrap;
|
|
222
|
+
padding: 0 0 0 ${doubleGridSize}px;
|
|
223
|
+
`
|
|
224
|
+
}, title), jsx(OptionalDismissButton, {
|
|
225
|
+
mode: mode
|
|
226
|
+
})), jsx(Expander, {
|
|
227
|
+
isExpanded: !isBold || isExpanded,
|
|
228
|
+
testId: testId
|
|
229
|
+
}, description && jsx("div", {
|
|
230
|
+
css: css`
|
|
231
|
+
color: ${textColour};
|
|
232
|
+
word-wrap: break-word;
|
|
233
|
+
overflow: auto;
|
|
234
|
+
max-height: 100px; /* height is defined as 5 lines maximum by design */
|
|
235
|
+
`,
|
|
236
|
+
"data-testid": testId && `${testId}-description`
|
|
237
|
+
}, description), jsx(Actions, {
|
|
238
|
+
actions: actions,
|
|
239
|
+
appearance: appearance,
|
|
240
|
+
linkComponent: linkComponent,
|
|
241
|
+
testId: testId,
|
|
242
|
+
mode: mode
|
|
243
|
+
}))));
|
|
226
244
|
});
|
|
227
245
|
};
|
|
228
246
|
|
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-background-overlay, ${R400})`,
|
|
5
|
+
dark: `var(--ds-background-overlay, ${R300})`
|
|
6
6
|
},
|
|
7
7
|
info: {
|
|
8
|
-
light:
|
|
9
|
-
dark:
|
|
8
|
+
light: `var(--ds-background-overlay, ${N500})`,
|
|
9
|
+
dark: `var(--ds-background-overlay, ${N500})`
|
|
10
10
|
},
|
|
11
11
|
normal: {
|
|
12
|
-
light:
|
|
13
|
-
dark:
|
|
12
|
+
light: `var(--ds-background-overlay, ${N0})`,
|
|
13
|
+
dark: `var(--ds-background-overlay, ${DN50})`
|
|
14
14
|
},
|
|
15
15
|
success: {
|
|
16
|
-
light:
|
|
17
|
-
dark:
|
|
16
|
+
light: `var(--ds-background-overlay, ${G400})`,
|
|
17
|
+
dark: `var(--ds-background-overlay, ${G300})`
|
|
18
18
|
},
|
|
19
19
|
warning: {
|
|
20
|
-
light:
|
|
21
|
-
dark:
|
|
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 =
|
|
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:
|
|
29
|
-
dark:
|
|
50
|
+
light: `var(--ds-text-highEmphasis, ${N0})`,
|
|
51
|
+
dark: `var(--ds-text-highEmphasis, ${DN40})`
|
|
30
52
|
},
|
|
31
53
|
info: {
|
|
32
|
-
light:
|
|
33
|
-
dark:
|
|
54
|
+
light: `var(--ds-text-highEmphasis, ${N0})`,
|
|
55
|
+
dark: `var(--ds-text-highEmphasis, ${DN600})`
|
|
34
56
|
},
|
|
35
57
|
normal: {
|
|
36
|
-
light:
|
|
37
|
-
dark:
|
|
58
|
+
light: `var(--ds-text-highEmphasis, ${N500})`,
|
|
59
|
+
dark: `var(--ds-text-highEmphasis, ${DN600})`
|
|
38
60
|
},
|
|
39
61
|
success: {
|
|
40
|
-
light:
|
|
41
|
-
dark:
|
|
62
|
+
light: `var(--ds-text-highEmphasis, ${N0})`,
|
|
63
|
+
dark: `var(--ds-text-highEmphasis, ${DN40})`
|
|
42
64
|
},
|
|
43
65
|
warning: {
|
|
44
|
-
light:
|
|
45
|
-
dark:
|
|
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
|
|
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-focus, ${N40})`,
|
|
78
|
+
dark: `var(--ds-border-focus, ${N40})`
|
|
54
79
|
},
|
|
55
80
|
info: {
|
|
56
|
-
light:
|
|
57
|
-
dark:
|
|
81
|
+
light: `var(--ds-border-focus, ${N40})`,
|
|
82
|
+
dark: `var(--ds-border-focus, ${N40})`
|
|
58
83
|
},
|
|
59
84
|
normal: {
|
|
60
|
-
light:
|
|
61
|
-
dark:
|
|
85
|
+
light: `var(--ds-border-focus, ${B100})`,
|
|
86
|
+
dark: `var(--ds-border-focus, ${B100})`
|
|
62
87
|
},
|
|
63
88
|
success: {
|
|
64
|
-
light:
|
|
65
|
-
dark:
|
|
89
|
+
light: `var(--ds-border-focus, ${N40})`,
|
|
90
|
+
dark: `var(--ds-border-focus, ${N40})`
|
|
66
91
|
},
|
|
67
92
|
warning: {
|
|
68
|
-
light:
|
|
69
|
-
dark:
|
|
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:
|
|
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:
|
|
109
|
+
light: `var(--ds-background-subtleNeutral-resting, ${lightButtonBackground})`,
|
|
110
|
+
dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
|
|
86
111
|
},
|
|
87
112
|
warning: {
|
|
88
|
-
light:
|
|
89
|
-
dark:
|
|
113
|
+
light: `var(--ds-background-subtleNeutral-resting, ${N30A})`,
|
|
114
|
+
dark: `var(--ds-background-subtleNeutral-resting, ${N30A})`
|
|
90
115
|
},
|
|
91
116
|
normal: {
|
|
92
|
-
light:
|
|
93
|
-
dark:
|
|
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:
|
|
99
|
-
dark:
|
|
123
|
+
light: `var(--ds-text-mediumEmphasis, ${N0})`,
|
|
124
|
+
dark: `var(--ds-text-mediumEmphasis, ${DN40})`
|
|
100
125
|
},
|
|
101
126
|
info: {
|
|
102
|
-
light:
|
|
103
|
-
dark:
|
|
127
|
+
light: `var(--ds-text-mediumEmphasis, ${N0})`,
|
|
128
|
+
dark: `var(--ds-text-mediumEmphasis, ${DN600})`
|
|
104
129
|
},
|
|
105
130
|
error: {
|
|
106
|
-
light:
|
|
107
|
-
dark:
|
|
131
|
+
light: `var(--ds-text-mediumEmphasis, ${N0})`,
|
|
132
|
+
dark: `var(--ds-text-mediumEmphasis, ${DN600})`
|
|
108
133
|
},
|
|
109
134
|
warning: {
|
|
110
|
-
light:
|
|
111
|
-
dark:
|
|
135
|
+
light: `var(--ds-text-mediumEmphasis, ${N700})`,
|
|
136
|
+
dark: `var(--ds-text-mediumEmphasis, ${DN40})`
|
|
112
137
|
},
|
|
113
138
|
normal: {
|
|
114
|
-
light:
|
|
115
|
-
dark:
|
|
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];
|
package/dist/es2019/version.json
CHANGED
|
@@ -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.
|
|
7
|
+
var packageVersion = "14.5.0";
|
|
8
8
|
export var AUTO_DISMISS_SECONDS = 8;
|
|
9
9
|
|
|
10
10
|
function noop() {}
|
package/dist/esm/flag.js
CHANGED
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
|
|
6
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
6
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
7
7
|
|
|
8
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
9
|
|
|
@@ -19,18 +19,17 @@ 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';
|
|
26
|
-
import { onMouseDownBlur } from './utils';
|
|
27
26
|
|
|
28
27
|
function noop() {}
|
|
29
28
|
|
|
30
29
|
var analyticsAttributes = {
|
|
31
30
|
componentName: 'flag',
|
|
32
31
|
packageName: "@atlaskit/flag",
|
|
33
|
-
packageVersion: "14.
|
|
32
|
+
packageVersion: "14.5.0"
|
|
34
33
|
};
|
|
35
34
|
var gridSize = getGridSize();
|
|
36
35
|
var doubleGridSize = gridSize * 2;
|
|
@@ -154,44 +153,43 @@ var Flag = function Flag(props) {
|
|
|
154
153
|
onBlur: onBlurAnalytics
|
|
155
154
|
};
|
|
156
155
|
var OptionalDismissButton = renderToggleOrDismissButton;
|
|
157
|
-
var boxShadow = "0 20px 32px -8px ".concat(flagShadowColor);
|
|
156
|
+
var boxShadow = "var(--ds-overlay, ".concat("0 20px 32px -8px ".concat(flagShadowColor), ")");
|
|
158
157
|
|
|
159
158
|
if (!isBold) {
|
|
160
|
-
boxShadow = "0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow);
|
|
159
|
+
boxShadow = "var(--ds-overlay, ".concat("0 0 1px ".concat(flagBorderColor, ", ").concat(boxShadow), ")");
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
return jsx(GlobalTheme.Consumer, null, function (tokens) {
|
|
164
163
|
var mode = tokens.mode;
|
|
165
164
|
var textColour = getFlagTextColor(appearance, mode);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
);
|
|
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
|
+
}))));
|
|
195
193
|
});
|
|
196
194
|
};
|
|
197
195
|
|