@elastic/eui 101.4.0 → 102.0.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/dist/eui_theme_amsterdam_dark.json +20 -15
- package/dist/eui_theme_amsterdam_dark.json.d.ts +20 -15
- package/dist/eui_theme_amsterdam_light.json +20 -15
- package/dist/eui_theme_amsterdam_light.json.d.ts +20 -15
- package/dist/eui_theme_borealis_dark.json +20 -15
- package/dist/eui_theme_borealis_dark.json.d.ts +20 -15
- package/dist/eui_theme_borealis_light.json +20 -15
- package/dist/eui_theme_borealis_light.json.d.ts +20 -15
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/badge.styles.js +3 -1
- package/es/components/badge/color_utils.js +2 -0
- package/es/components/datagrid/body/header/column_sorting.js +10 -9
- package/es/components/datagrid/body/header/data_grid_header_cell.js +1 -2
- package/es/components/empty_prompt/empty_prompt.styles.js +3 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.styles.js +4 -2
- package/es/components/icon/icon.styles.js +5 -3
- package/es/components/icon/named_colors.js +1 -1
- package/es/global_styling/mixins/_button.js +2 -2
- package/es/global_styling/mixins/_color.js +1 -1
- package/es/themes/amsterdam/global_styling/variables/_buttons.js +189 -142
- package/es/themes/amsterdam/global_styling/variables/_colors.js +218 -176
- package/es/themes/amsterdam/global_styling/variables/_colors_severity.js +20 -0
- package/es/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -15
- package/eui.d.ts +58 -20
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/badge.styles.js +3 -1
- package/lib/components/badge/color_utils.js +2 -0
- package/lib/components/datagrid/body/header/column_sorting.js +10 -9
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +1 -2
- package/lib/components/empty_prompt/empty_prompt.styles.js +3 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +4 -2
- package/lib/components/icon/icon.styles.js +5 -3
- package/lib/components/icon/named_colors.js +1 -1
- package/lib/global_styling/mixins/_button.js +2 -2
- package/lib/global_styling/mixins/_color.js +1 -1
- package/lib/themes/amsterdam/global_styling/variables/_buttons.js +189 -142
- package/lib/themes/amsterdam/global_styling/variables/_colors.js +218 -176
- package/lib/themes/amsterdam/global_styling/variables/_colors_severity.js +26 -0
- package/lib/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -15
- package/optimize/es/components/badge/badge.js +1 -1
- package/optimize/es/components/badge/badge.styles.js +3 -1
- package/optimize/es/components/badge/color_utils.js +2 -0
- package/optimize/es/components/datagrid/body/header/column_sorting.js +10 -9
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +1 -2
- package/optimize/es/components/empty_prompt/empty_prompt.styles.js +3 -1
- package/optimize/es/components/form/form_control_layout/form_control_layout_icons.styles.js +4 -2
- package/optimize/es/components/icon/icon.styles.js +5 -3
- package/optimize/es/components/icon/named_colors.js +1 -1
- package/optimize/es/global_styling/mixins/_button.js +2 -2
- package/optimize/es/global_styling/mixins/_color.js +1 -1
- package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +189 -142
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +218 -176
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors_severity.js +20 -0
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -15
- package/optimize/lib/components/badge/badge.js +1 -1
- package/optimize/lib/components/badge/badge.styles.js +3 -1
- package/optimize/lib/components/badge/color_utils.js +2 -0
- package/optimize/lib/components/datagrid/body/header/column_sorting.js +10 -9
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +1 -2
- package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +3 -1
- package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.styles.js +4 -2
- package/optimize/lib/components/icon/icon.styles.js +5 -3
- package/optimize/lib/components/icon/named_colors.js +1 -1
- package/optimize/lib/global_styling/mixins/_button.js +2 -2
- package/optimize/lib/global_styling/mixins/_color.js +1 -1
- package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +189 -142
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +218 -176
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors_severity.js +26 -0
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -15
- package/package.json +4 -4
- package/src/themes/amsterdam/_colors_dark.scss +13 -0
- package/src/themes/amsterdam/_colors_light.scss +13 -0
- package/src/themes/amsterdam/global_styling/variables/_colors_severity.scss +9 -0
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/badge.styles.js +3 -1
- package/test-env/components/badge/color_utils.js +2 -0
- package/test-env/components/datagrid/body/header/column_sorting.js +10 -9
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +1 -2
- package/test-env/components/empty_prompt/empty_prompt.styles.js +3 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.styles.js +4 -2
- package/test-env/components/icon/icon.styles.js +5 -3
- package/test-env/components/icon/named_colors.js +1 -1
- package/test-env/global_styling/mixins/_button.js +2 -2
- package/test-env/global_styling/mixins/_color.js +1 -1
- package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +189 -142
- package/test-env/themes/amsterdam/global_styling/variables/_colors.js +218 -176
- package/test-env/themes/amsterdam/global_styling/variables/_colors_severity.js +26 -0
- package/test-env/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -15
|
@@ -39,8 +39,10 @@
|
|
|
39
39
|
"primary": "#0B64DD",
|
|
40
40
|
"accent": "#BC1E70",
|
|
41
41
|
"accentSecondary": "#008B87",
|
|
42
|
+
"neutral": "#1C8CB5",
|
|
42
43
|
"success": "#008A5E",
|
|
43
44
|
"warning": "#FACB3D",
|
|
45
|
+
"risk": "#ED6723",
|
|
44
46
|
"danger": "#C61E25",
|
|
45
47
|
"ghost": "#ffffff",
|
|
46
48
|
"text": "#5A6D8C"
|
|
@@ -300,21 +302,6 @@
|
|
|
300
302
|
"euiColorVisDanger0": "#F6726A",
|
|
301
303
|
"euiColorVisDanger1": "#FFC9C2",
|
|
302
304
|
"euiColorVisNeutral0": "#F6F9FC",
|
|
303
|
-
"euiColorSeverity0": "#E3E6EB",
|
|
304
|
-
"euiColorSeverity1": "#5A6D8C",
|
|
305
|
-
"euiColorSeverity2": "#7186A8",
|
|
306
|
-
"euiColorSeverity3": "#8E9FBC",
|
|
307
|
-
"euiColorSeverity4": "#ABB9D0",
|
|
308
|
-
"euiColorSeverity5": "#CAD3E2",
|
|
309
|
-
"euiColorSeverity6": "#FDE9B5",
|
|
310
|
-
"euiColorSeverity7": "#FCD883",
|
|
311
|
-
"euiColorSeverity8": "#FFC9C2",
|
|
312
|
-
"euiColorSeverity9": "#FFB5AD",
|
|
313
|
-
"euiColorSeverity10": "#FC9188",
|
|
314
|
-
"euiColorSeverity11": "#F6726A",
|
|
315
|
-
"euiColorSeverity12": "#EE4C48",
|
|
316
|
-
"euiColorSeverity13": "#DA3737",
|
|
317
|
-
"euiColorSeverity14": "#C61E25",
|
|
318
305
|
"euiColorVisGrey0": "#CAD3E2",
|
|
319
306
|
"euiColorVisGrey1": "#8E9FBC",
|
|
320
307
|
"euiColorVisGrey2": "#5A6D8C",
|
|
@@ -327,6 +314,12 @@
|
|
|
327
314
|
"euiColorVisCool2": "#61A2FF",
|
|
328
315
|
"euiColorVisComplementary0": "#61A2FF",
|
|
329
316
|
"euiColorVisComplementary1": "#EAAE01",
|
|
317
|
+
"euiColorSeverityUnknown": "#E3E8F2",
|
|
318
|
+
"euiColorSeverityNeutral": "#B5E5F2",
|
|
319
|
+
"euiColorSeveritySuccess": "#24C292",
|
|
320
|
+
"euiColorSeverityWarning": "#FCD883",
|
|
321
|
+
"euiColorSeverityRisk": "#FF995E",
|
|
322
|
+
"euiColorSeverityDanger": "#EE4C48",
|
|
330
323
|
"euiColorChartLines": "#CAD3E2",
|
|
331
324
|
"euiColorChartBand": "#F6F9FC",
|
|
332
325
|
"euiColorGhost": "#FFFFFF",
|
|
@@ -362,8 +355,10 @@
|
|
|
362
355
|
"euiColorTextPrimary": "#1750BA",
|
|
363
356
|
"euiColorTextAccent": "#A11262",
|
|
364
357
|
"euiColorTextAccentSecondary": "#047471",
|
|
358
|
+
"euiColorTextNeutral": "#0F658A",
|
|
365
359
|
"euiColorTextSuccess": "#09724D",
|
|
366
360
|
"euiColorTextWarning": "#6A4906",
|
|
361
|
+
"euiColorTextRisk": "#9E3A16",
|
|
367
362
|
"euiColorTextDanger": "#A71627",
|
|
368
363
|
"euiColorTextParagraph": "#1D2A3E",
|
|
369
364
|
"euiColorTextHeading": "#111C2C",
|
|
@@ -373,8 +368,10 @@
|
|
|
373
368
|
"euiColorBackgroundBasePrimary": "#E8F1FF",
|
|
374
369
|
"euiColorBackgroundBaseAccent": "#FFEBF5",
|
|
375
370
|
"euiColorBackgroundBaseAccentSecondary": "#E2F9F7",
|
|
371
|
+
"euiColorBackgroundBaseNeutral": "#E5F6FA",
|
|
376
372
|
"euiColorBackgroundBaseSuccess": "#E2F8F0",
|
|
377
373
|
"euiColorBackgroundBaseWarning": "#FDF3D8",
|
|
374
|
+
"euiColorBackgroundBaseRisk": "#FFEDD6",
|
|
378
375
|
"euiColorBackgroundBaseDanger": "#FFE8E5",
|
|
379
376
|
"euiColorBackgroundBaseSubdued": "#F6F9FC",
|
|
380
377
|
"euiColorBackgroundBasePlain": "#FFFFFF",
|
|
@@ -390,22 +387,28 @@
|
|
|
390
387
|
"euiColorBackgroundLightPrimary": "#D9E8FF",
|
|
391
388
|
"euiColorBackgroundLightAccent": "#FDDDE9",
|
|
392
389
|
"euiColorBackgroundLightAccentSecondary": "#C9F3F0",
|
|
390
|
+
"euiColorBackgroundLightNeutral": "#CFEEF7",
|
|
393
391
|
"euiColorBackgroundLightSuccess": "#C9F3E3",
|
|
394
392
|
"euiColorBackgroundLightWarning": "#FDE9B5",
|
|
393
|
+
"euiColorBackgroundLightRisk": "#FFDEBF",
|
|
395
394
|
"euiColorBackgroundLightDanger": "#FDDDD8",
|
|
396
395
|
"euiColorBackgroundLightText": "#E3E8F2",
|
|
397
396
|
"euiColorBackgroundFilledPrimary": "#0B64DD",
|
|
398
397
|
"euiColorBackgroundFilledAccent": "#BC1E70",
|
|
399
398
|
"euiColorBackgroundFilledAccentSecondary": "#008B87",
|
|
399
|
+
"euiColorBackgroundFilledNeutral": "#1C8CB5",
|
|
400
400
|
"euiColorBackgroundFilledSuccess": "#008A5E",
|
|
401
401
|
"euiColorBackgroundFilledWarning": "#FACB3D",
|
|
402
|
+
"euiColorBackgroundFilledRisk": "#ED6723",
|
|
402
403
|
"euiColorBackgroundFilledDanger": "#C61E25",
|
|
403
404
|
"euiColorBackgroundFilledText": "#5A6D8C",
|
|
404
405
|
"euiColorBorderBasePrimary": "#BFDBFF",
|
|
405
406
|
"euiColorBorderBaseAccent": "#FFC7DB",
|
|
406
407
|
"euiColorBorderBaseAccentSecondary": "#A6EDEA",
|
|
408
|
+
"euiColorBorderBaseNeutral": "#B5E5F2",
|
|
407
409
|
"euiColorBorderBaseSuccess": "#AEE8D2",
|
|
408
410
|
"euiColorBorderBaseWarning": "#FCD883",
|
|
411
|
+
"euiColorBorderBaseRisk": "#FFCDA1",
|
|
409
412
|
"euiColorBorderBaseDanger": "#FFC9C2",
|
|
410
413
|
"euiColorBorderBasePlain": "#CAD3E2",
|
|
411
414
|
"euiColorBorderBaseSubdued": "#E3E8F2",
|
|
@@ -416,7 +419,9 @@
|
|
|
416
419
|
"euiColorBorderStrongPrimary": "#1750BA",
|
|
417
420
|
"euiColorBorderStrongAccent": "#A11262",
|
|
418
421
|
"euiColorBorderStrongAccentSecondary": "#047471",
|
|
422
|
+
"euiColorBorderStrongNeutral": "#0F658A",
|
|
419
423
|
"euiColorBorderStrongSuccess": "#09724D",
|
|
420
424
|
"euiColorBorderStrongWarning": "#825803",
|
|
425
|
+
"euiColorBorderStrongRisk": "#9E3A16",
|
|
421
426
|
"euiColorBorderStrongDanger": "#A71627"
|
|
422
427
|
}
|
|
@@ -40,8 +40,10 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
40
40
|
primary: string;
|
|
41
41
|
accent: string;
|
|
42
42
|
accentSecondary: string;
|
|
43
|
+
neutral: string;
|
|
43
44
|
success: string;
|
|
44
45
|
warning: string;
|
|
46
|
+
risk: string;
|
|
45
47
|
danger: string;
|
|
46
48
|
ghost: string;
|
|
47
49
|
text: string;
|
|
@@ -313,21 +315,12 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
313
315
|
euiColorVisCool2: string;
|
|
314
316
|
euiColorVisComplementary0: string;
|
|
315
317
|
euiColorVisComplementary1: string;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
euiColorSeverity6: string;
|
|
323
|
-
euiColorSeverity7: string;
|
|
324
|
-
euiColorSeverity8: string;
|
|
325
|
-
euiColorSeverity9: string;
|
|
326
|
-
euiColorSeverity10: string;
|
|
327
|
-
euiColorSeverity11: string;
|
|
328
|
-
euiColorSeverity12: string;
|
|
329
|
-
euiColorSeverity13: string;
|
|
330
|
-
euiColorSeverity14: string;
|
|
318
|
+
euiColorSeverityUnknown: string;
|
|
319
|
+
euiColorSeverityNeutral: string;
|
|
320
|
+
euiColorSeveritySuccess: string;
|
|
321
|
+
euiColorSeverityWarning: string;
|
|
322
|
+
euiColorSeverityRisk: string;
|
|
323
|
+
euiColorSeverityDanger: string;
|
|
331
324
|
euiColorChartLines: string;
|
|
332
325
|
euiColorChartBand: string;
|
|
333
326
|
euiColorGhost: string;
|
|
@@ -363,8 +356,10 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
363
356
|
euiColorTextPrimary: string;
|
|
364
357
|
euiColorTextAccent: string;
|
|
365
358
|
euiColorTextAccentSecondary: string;
|
|
359
|
+
euiColorTextNeutral: string;
|
|
366
360
|
euiColorTextSuccess: string;
|
|
367
361
|
euiColorTextWarning: string;
|
|
362
|
+
euiColorTextRisk: string;
|
|
368
363
|
euiColorTextDanger: string;
|
|
369
364
|
euiColorTextParagraph: string;
|
|
370
365
|
euiColorTextHeading: string;
|
|
@@ -374,8 +369,10 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
374
369
|
euiColorBackgroundBasePrimary: string;
|
|
375
370
|
euiColorBackgroundBaseAccent: string;
|
|
376
371
|
euiColorBackgroundBaseAccentSecondary: string;
|
|
372
|
+
euiColorBackgroundBaseNeutral: string;
|
|
377
373
|
euiColorBackgroundBaseSuccess: string;
|
|
378
374
|
euiColorBackgroundBaseWarning: string;
|
|
375
|
+
euiColorBackgroundBaseRisk: string;
|
|
379
376
|
euiColorBackgroundBaseDanger: string;
|
|
380
377
|
euiColorBackgroundBaseSubdued: string;
|
|
381
378
|
euiColorBackgroundBasePlain: string;
|
|
@@ -391,22 +388,28 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
391
388
|
euiColorBackgroundLightPrimary: string;
|
|
392
389
|
euiColorBackgroundLightAccent: string;
|
|
393
390
|
euiColorBackgroundLightAccentSecondary: string;
|
|
391
|
+
euiColorBackgroundLightNeutral: string;
|
|
394
392
|
euiColorBackgroundLightSuccess: string;
|
|
395
393
|
euiColorBackgroundLightWarning: string;
|
|
394
|
+
euiColorBackgroundLightRisk: string;
|
|
396
395
|
euiColorBackgroundLightDanger: string;
|
|
397
396
|
euiColorBackgroundLightText: string;
|
|
398
397
|
euiColorBackgroundFilledPrimary: string;
|
|
399
398
|
euiColorBackgroundFilledAccent: string;
|
|
400
399
|
euiColorBackgroundFilledAccentSecondary: string;
|
|
400
|
+
euiColorBackgroundFilledNeutral: string;
|
|
401
401
|
euiColorBackgroundFilledSuccess: string;
|
|
402
402
|
euiColorBackgroundFilledWarning: string;
|
|
403
|
+
euiColorBackgroundFilledRisk: string;
|
|
403
404
|
euiColorBackgroundFilledDanger: string;
|
|
404
405
|
euiColorBackgroundFilledText: string;
|
|
405
406
|
euiColorBorderBasePrimary: string;
|
|
406
407
|
euiColorBorderBaseAccent: string;
|
|
407
408
|
euiColorBorderBaseAccentSecondary: string;
|
|
409
|
+
euiColorBorderBaseNeutral: string;
|
|
408
410
|
euiColorBorderBaseSuccess: string;
|
|
409
411
|
euiColorBorderBaseWarning: string;
|
|
412
|
+
euiColorBorderBaseRisk: string;
|
|
410
413
|
euiColorBorderBaseDanger: string;
|
|
411
414
|
euiColorBorderBasePlain: string;
|
|
412
415
|
euiColorBorderBaseSubdued: string;
|
|
@@ -417,8 +420,10 @@ declare module '@elastic/eui/dist/eui_theme_borealis_light.json' {
|
|
|
417
420
|
euiColorBorderStrongPrimary: string;
|
|
418
421
|
euiColorBorderStrongAccent: string;
|
|
419
422
|
euiColorBorderStrongAccentSecondary: string;
|
|
423
|
+
euiColorBorderStrongNeutral: string;
|
|
420
424
|
euiColorBorderStrongSuccess: string;
|
|
421
425
|
euiColorBorderStrongWarning: string;
|
|
426
|
+
euiColorBorderStrongRisk: string;
|
|
422
427
|
euiColorBorderStrongDanger: string;
|
|
423
428
|
};
|
|
424
429
|
export default sassVariables;
|
|
@@ -33,7 +33,7 @@ import { getTextColor, getColorContrast, getIsValidColor } from './color_utils';
|
|
|
33
33
|
import { euiBadgeStyles } from './badge.styles';
|
|
34
34
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
35
35
|
export var ICON_SIDES = ['left', 'right'];
|
|
36
|
-
export var COLORS = ['default', 'hollow', 'primary', '
|
|
36
|
+
export var COLORS = ['default', 'hollow', 'primary', 'accent', 'neutral', 'success', 'warning', 'risk', 'danger'];
|
|
37
37
|
export var EuiBadge = function EuiBadge(_ref) {
|
|
38
38
|
var children = _ref.children,
|
|
39
39
|
_ref$color = _ref.color,
|
|
@@ -38,9 +38,11 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
38
38
|
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
39
39
|
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
40
40
|
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
41
|
+
neutral: /*#__PURE__*/css(setBadgeColorVars(badgeColors.neutral), ";label:neutral;"),
|
|
42
|
+
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
41
43
|
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
44
|
+
risk: /*#__PURE__*/css(setBadgeColorVars(badgeColors.risk), ";label:risk;"),
|
|
42
45
|
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
43
|
-
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
44
46
|
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), " border-color:", badgeColors.disabled.borderColor, ";*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
45
47
|
// Content wrapper
|
|
46
48
|
euiBadge__content: /*#__PURE__*/css(logicalCSS(
|
|
@@ -29,8 +29,10 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
29
29
|
return {
|
|
30
30
|
// Colors shared between buttons and badges
|
|
31
31
|
primary: euiButtonFillColor(euiThemeContext, 'primary'),
|
|
32
|
+
neutral: euiButtonFillColor(euiThemeContext, 'neutral'),
|
|
32
33
|
success: euiButtonFillColor(euiThemeContext, 'success'),
|
|
33
34
|
warning: euiButtonFillColor(euiThemeContext, 'warning'),
|
|
35
|
+
risk: euiButtonFillColor(euiThemeContext, 'risk'),
|
|
34
36
|
danger: euiButtonFillColor(euiThemeContext, 'danger'),
|
|
35
37
|
accent: euiButtonFillColor(euiThemeContext, 'accent'),
|
|
36
38
|
accentSecondary: euiButtonFillColor(euiThemeContext, 'accentSecondary'),
|
|
@@ -19,8 +19,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
19
19
|
export var useColumnSorting = function useColumnSorting(_ref) {
|
|
20
20
|
var _sorting$columns;
|
|
21
21
|
var sorting = _ref.sorting,
|
|
22
|
-
id = _ref.id
|
|
23
|
-
hasColumnActions = _ref.hasColumnActions;
|
|
22
|
+
id = _ref.id;
|
|
24
23
|
var sortedColumn = useMemo(function () {
|
|
25
24
|
return sorting === null || sorting === void 0 ? void 0 : sorting.columns.find(function (col) {
|
|
26
25
|
return col.id === id;
|
|
@@ -42,26 +41,28 @@ export var useColumnSorting = function useColumnSorting(_ref) {
|
|
|
42
41
|
}, [id, isColumnSorted, sortedColumn]);
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
|
-
* aria-sort attribute - should only be used when a single column is being sorted
|
|
44
|
+
* `aria-sort` attribute - should only be used when a single column is being sorted
|
|
46
45
|
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-sort
|
|
47
46
|
* @see https://www.w3.org/WAI/ARIA/apg/example-index/table/sortable-table.html
|
|
48
47
|
* @see https://github.com/w3c/aria/issues/283 for potential future multi-column usage
|
|
49
48
|
*/
|
|
50
|
-
var
|
|
49
|
+
var hasAriaSortOnly = isColumnSorted && hasOnlyOneSort;
|
|
50
|
+
var ariaSort = hasAriaSortOnly ? sorting.columns[0].direction === 'asc' ? 'ascending' : 'descending' : undefined;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* `aria-describedby` ID for when `aria-sort` cannot be used
|
|
54
|
+
*/
|
|
53
55
|
var sortingAriaId = useGeneratedHtmlId({
|
|
54
56
|
prefix: 'euiDataGridCellHeader',
|
|
55
57
|
suffix: 'sorting'
|
|
56
58
|
});
|
|
57
59
|
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
61
|
+
* Screen-reader-only sorting status, an alternative to `aria-sort` for multi-column sorting
|
|
60
62
|
*/
|
|
61
63
|
var sortingScreenReaderText = useMemo(function () {
|
|
62
64
|
var _sorting$columns2;
|
|
63
|
-
if (!isColumnSorted) return null;
|
|
64
|
-
if (!hasColumnActions && hasOnlyOneSort) return null; // in this scenario, the `aria-sort` attribute will be used by screen readers
|
|
65
|
+
if (!isColumnSorted || hasAriaSortOnly) return null;
|
|
65
66
|
return ___EmotionJSX("p", {
|
|
66
67
|
id: sortingAriaId,
|
|
67
68
|
hidden: true
|
|
@@ -124,7 +125,7 @@ export var useColumnSorting = function useColumnSorting(_ref) {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}), ".");
|
|
127
|
-
}, [isColumnSorted,
|
|
128
|
+
}, [isColumnSorted, hasAriaSortOnly, sortingAriaId, sorting === null || sorting === void 0 ? void 0 : sorting.columns, hasOnlyOneSort]);
|
|
128
129
|
return {
|
|
129
130
|
sortingArrow: sortingArrow,
|
|
130
131
|
ariaSort: ariaSort,
|
|
@@ -66,8 +66,7 @@ export var EuiDataGridHeaderCell = /*#__PURE__*/memo(function (_ref) {
|
|
|
66
66
|
var actionsButtonRef = useRef(null);
|
|
67
67
|
var _useColumnSorting = useColumnSorting({
|
|
68
68
|
sorting: sorting,
|
|
69
|
-
id: id
|
|
70
|
-
hasColumnActions: hasColumnActions
|
|
69
|
+
id: id
|
|
71
70
|
}),
|
|
72
71
|
sortingArrow = _useColumnSorting.sortingArrow,
|
|
73
72
|
ariaSort = _useColumnSorting.ariaSort,
|
|
@@ -117,8 +117,10 @@ export var euiEmptyPromptStyles = function euiEmptyPromptStyles(euiThemeContext)
|
|
|
117
117
|
accent: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('accent')), ";;label:accent;"),
|
|
118
118
|
accentSecondary: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('accentSecondary')), ";;label:accentSecondary;"),
|
|
119
119
|
danger: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('danger')), ";;label:danger;"),
|
|
120
|
+
risk: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('risk')), ";;label:risk;"),
|
|
120
121
|
warning: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('warning')), ";;label:warning;"),
|
|
121
|
-
success: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('success')), ";;label:success;")
|
|
122
|
+
success: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('success')), ";;label:success;"),
|
|
123
|
+
neutral: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('neutral')), ";;label:neutral;")
|
|
122
124
|
}, generatePaddingStyles())
|
|
123
125
|
};
|
|
124
126
|
};
|
|
@@ -20,6 +20,8 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
20
20
|
};
|
|
21
21
|
export var euiFormControlLayoutIconsStyles = function euiFormControlLayoutIconsStyles(euiThemeContext) {
|
|
22
22
|
var _euiFormVariables = euiFormVariables(euiThemeContext),
|
|
23
|
+
controlHeight = _euiFormVariables.controlHeight,
|
|
24
|
+
controlCompressedHeight = _euiFormVariables.controlCompressedHeight,
|
|
23
25
|
controlPadding = _euiFormVariables.controlPadding,
|
|
24
26
|
controlCompressedPadding = _euiFormVariables.controlCompressedPadding,
|
|
25
27
|
controlDisabledColor = _euiFormVariables.controlDisabledColor;
|
|
@@ -27,10 +29,10 @@ export var euiFormControlLayoutIconsStyles = function euiFormControlLayoutIconsS
|
|
|
27
29
|
euiFormControlLayoutIcons: _ref,
|
|
28
30
|
uncompressed: "\n gap: ".concat(mathWithUnits(controlPadding, function (x) {
|
|
29
31
|
return x / 2;
|
|
30
|
-
}), ";\n "),
|
|
32
|
+
}), ";\n max-block-size: ").concat(controlHeight, ";\n "),
|
|
31
33
|
compressed: /*#__PURE__*/css("gap:", mathWithUnits(controlCompressedPadding, function (x) {
|
|
32
34
|
return x / 2;
|
|
33
|
-
}), ";;label:compressed;"),
|
|
35
|
+
}), ";max-block-size:", controlCompressedHeight, ";;label:compressed;"),
|
|
34
36
|
disabled: /*#__PURE__*/css("cursor:not-allowed;color:", controlDisabledColor, ";;label:disabled;"),
|
|
35
37
|
position: {
|
|
36
38
|
absolute: {
|
|
@@ -35,15 +35,17 @@ export var euiIconStyles = function euiIconStyles(_ref3) {
|
|
|
35
35
|
// Base
|
|
36
36
|
euiIcon: /*#__PURE__*/css("flex-shrink:0;display:inline-block;vertical-align:middle;fill:currentColor;transform:translate(0, 0);.euiIcon__fillNegative{fill:", euiTheme.colors.darkestShade, ";};label:euiIcon;"),
|
|
37
37
|
// Colors
|
|
38
|
+
primary: /*#__PURE__*/css("color:", euiTheme.colors.textPrimary, ";;label:primary;"),
|
|
38
39
|
accent: /*#__PURE__*/css("color:", euiTheme.colors.textAccent, ";;label:accent;"),
|
|
39
40
|
accentSecondary: /*#__PURE__*/css("color:", euiTheme.colors.textAccentSecondary, ";;label:accentSecondary;"),
|
|
40
|
-
danger: /*#__PURE__*/css("color:", euiTheme.colors.textDanger, ";;label:danger;"),
|
|
41
41
|
ghost: /*#__PURE__*/css("color:", euiTheme.colors.ghost, ";*[fill],.euiIcon__fillNegative{fill:currentColor!important;};label:ghost;"),
|
|
42
|
-
primary: /*#__PURE__*/css("color:", euiTheme.colors.textPrimary, ";;label:primary;"),
|
|
43
|
-
success: /*#__PURE__*/css("color:", euiTheme.colors.textSuccess, ";;label:success;"),
|
|
44
42
|
subdued: /*#__PURE__*/css("color:", euiTheme.colors.textSubdued, ";;label:subdued;"),
|
|
45
43
|
text: /*#__PURE__*/css("color:", euiTheme.colors.textHeading, ";*[fill],.euiIcon__fillNegative{fill:currentColor!important;};label:text;"),
|
|
44
|
+
neutral: /*#__PURE__*/css("color:", euiTheme.colors.textNeutral, ";;label:neutral;"),
|
|
45
|
+
success: /*#__PURE__*/css("color:", euiTheme.colors.textSuccess, ";;label:success;"),
|
|
46
46
|
warning: /*#__PURE__*/css("color:", euiTheme.colors.textWarning, ";;label:warning;"),
|
|
47
|
+
risk: /*#__PURE__*/css("color:", euiTheme.colors.textRisk, ";;label:risk;"),
|
|
48
|
+
danger: /*#__PURE__*/css("color:", euiTheme.colors.textDanger, ";;label:danger;"),
|
|
47
49
|
inherit: _ref2,
|
|
48
50
|
default: /*#__PURE__*/css(";label:default;"),
|
|
49
51
|
customColor: /*#__PURE__*/css(";label:customColor;"),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export var COLORS = ['default', 'primary', 'success', 'accent', 'accentSecondary', 'warning', 'danger', 'text', 'subdued', 'ghost', 'inherit'];
|
|
9
|
+
export var COLORS = ['default', 'primary', 'neutral', 'success', 'accent', 'accentSecondary', 'warning', 'risk', 'danger', 'text', 'subdued', 'ghost', 'inherit'];
|
|
10
10
|
export function isNamedColor(name) {
|
|
11
11
|
return COLORS.includes(name);
|
|
12
12
|
}
|
|
@@ -17,7 +17,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
17
17
|
import { css, keyframes } from '@emotion/react';
|
|
18
18
|
import { getTokenName, euiCanAnimate } from '@elastic/eui-theme-common';
|
|
19
19
|
import { makeHighContrastColor, useEuiMemoizedStyles } from '../../services';
|
|
20
|
-
export var BUTTON_COLORS = ['text', 'accent', 'accentSecondary', 'primary', 'success', 'warning', 'danger'];
|
|
20
|
+
export var BUTTON_COLORS = ['text', 'accent', 'accentSecondary', 'primary', 'neutral', 'success', 'warning', 'risk', 'danger'];
|
|
21
21
|
export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
22
22
|
/**
|
|
23
23
|
* Creates the `base` version of button styles with proper text contrast.
|
|
@@ -48,7 +48,7 @@ export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, col
|
|
|
48
48
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
49
49
|
var backgroundTokenName = getTokenName('backgroundFilled', color);
|
|
50
50
|
var textColorTokenName = getTokenName('textColorFilled', color);
|
|
51
|
-
var highContrastForeground =
|
|
51
|
+
var highContrastForeground = ['warning', 'neutral', 'risk'].includes(color) ? euiTheme.colors.ink : color === 'disabled' ? euiTheme.components.buttons[textColorTokenName] : euiTheme.colors.textInverse;
|
|
52
52
|
var foreground = highContrastMode ? highContrastForeground : euiTheme.components.buttons[textColorTokenName];
|
|
53
53
|
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
54
54
|
return _objectSpread({
|
|
@@ -15,7 +15,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
import { css } from '@emotion/react';
|
|
16
16
|
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { getTokenName } from '@elastic/eui-theme-common';
|
|
18
|
-
export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'highlighted', 'accent', 'accentSecondary', 'primary', 'success', 'warning', 'danger'];
|
|
18
|
+
export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'highlighted', 'accent', 'accentSecondary', 'primary', 'neutral', 'success', 'warning', 'risk', 'danger'];
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated - use background tokens directly
|
|
21
21
|
* @returns A single background color with optional alpha transparency
|