@elastic/eui 75.0.0 → 75.1.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.
Files changed (125) hide show
  1. package/dist/eui_theme_dark.css +0 -323
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -323
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/code/code_block.js +5 -3
  6. package/es/components/code/code_block_annotations.js +94 -0
  7. package/es/components/code/code_block_annotations.style.js +18 -0
  8. package/es/components/code/code_block_full_screen.js +9 -3
  9. package/es/components/code/code_block_line.styles.js +3 -2
  10. package/es/components/code/utils.js +53 -13
  11. package/es/components/form/range/range_track.js +1 -1
  12. package/es/components/icon/assets/app_agent.js +2 -10
  13. package/es/components/icon/assets/app_fleet.js +10 -2
  14. package/es/components/steps/step.js +19 -12
  15. package/es/components/steps/step.styles.js +73 -0
  16. package/es/components/steps/step_horizontal.js +55 -42
  17. package/es/components/steps/step_horizontal.styles.js +55 -0
  18. package/es/components/steps/step_number.js +82 -73
  19. package/es/components/steps/step_number.styles.js +76 -0
  20. package/es/components/steps/steps_horizontal.js +11 -7
  21. package/es/components/steps/steps_horizontal.styles.js +35 -0
  22. package/es/components/steps/sub_steps.js +7 -1
  23. package/es/components/steps/sub_steps.styles.js +14 -0
  24. package/es/components/tour/tour_step_indicator.js +0 -3
  25. package/es/global_styling/utility/animations.js +4 -3
  26. package/eui.d.ts +115 -4
  27. package/i18ntokens.json +26 -10
  28. package/lib/components/code/code_block.js +5 -3
  29. package/lib/components/code/code_block_annotations.js +113 -0
  30. package/lib/components/code/code_block_annotations.style.js +29 -0
  31. package/lib/components/code/code_block_full_screen.js +9 -3
  32. package/lib/components/code/code_block_line.styles.js +3 -2
  33. package/lib/components/code/utils.js +54 -13
  34. package/lib/components/form/range/range_track.js +1 -1
  35. package/lib/components/icon/assets/app_agent.js +2 -10
  36. package/lib/components/icon/assets/app_fleet.js +10 -2
  37. package/lib/components/icon/svgs/app_agent.svg +2 -4
  38. package/lib/components/icon/svgs/app_fleet.svg +4 -2
  39. package/lib/components/steps/step.js +21 -12
  40. package/lib/components/steps/step.styles.js +93 -0
  41. package/lib/components/steps/step_horizontal.js +56 -41
  42. package/lib/components/steps/step_horizontal.styles.js +66 -0
  43. package/lib/components/steps/step_number.js +86 -75
  44. package/lib/components/steps/step_number.styles.js +84 -0
  45. package/lib/components/steps/steps_horizontal.js +12 -7
  46. package/lib/components/steps/steps_horizontal.styles.js +38 -0
  47. package/lib/components/steps/sub_steps.js +9 -1
  48. package/lib/components/steps/sub_steps.styles.js +24 -0
  49. package/lib/components/tour/tour_step_indicator.js +0 -3
  50. package/lib/global_styling/utility/animations.js +6 -4
  51. package/optimize/es/components/code/code_block_annotations.js +79 -0
  52. package/optimize/es/components/code/code_block_annotations.style.js +18 -0
  53. package/optimize/es/components/code/code_block_full_screen.js +9 -3
  54. package/optimize/es/components/code/code_block_line.styles.js +3 -2
  55. package/optimize/es/components/code/utils.js +53 -13
  56. package/optimize/es/components/form/range/range_track.js +1 -1
  57. package/optimize/es/components/icon/assets/app_agent.js +2 -10
  58. package/optimize/es/components/icon/assets/app_fleet.js +10 -2
  59. package/optimize/es/components/steps/step.js +19 -12
  60. package/optimize/es/components/steps/step.styles.js +73 -0
  61. package/optimize/es/components/steps/step_horizontal.js +54 -41
  62. package/optimize/es/components/steps/step_horizontal.styles.js +55 -0
  63. package/optimize/es/components/steps/step_number.js +82 -73
  64. package/optimize/es/components/steps/step_number.styles.js +76 -0
  65. package/optimize/es/components/steps/steps_horizontal.js +11 -7
  66. package/optimize/es/components/steps/steps_horizontal.styles.js +35 -0
  67. package/optimize/es/components/steps/sub_steps.js +7 -1
  68. package/optimize/es/components/steps/sub_steps.styles.js +14 -0
  69. package/optimize/es/components/tour/tour_step_indicator.js +0 -3
  70. package/optimize/es/global_styling/utility/animations.js +4 -3
  71. package/optimize/lib/components/code/code_block_annotations.js +105 -0
  72. package/optimize/lib/components/code/code_block_annotations.style.js +29 -0
  73. package/optimize/lib/components/code/code_block_full_screen.js +9 -3
  74. package/optimize/lib/components/code/code_block_line.styles.js +3 -2
  75. package/optimize/lib/components/code/utils.js +54 -13
  76. package/optimize/lib/components/form/range/range_track.js +1 -1
  77. package/optimize/lib/components/icon/assets/app_agent.js +2 -10
  78. package/optimize/lib/components/icon/assets/app_fleet.js +10 -2
  79. package/optimize/lib/components/icon/svgs/app_agent.svg +2 -4
  80. package/optimize/lib/components/icon/svgs/app_fleet.svg +4 -2
  81. package/optimize/lib/components/steps/step.js +21 -12
  82. package/optimize/lib/components/steps/step.styles.js +93 -0
  83. package/optimize/lib/components/steps/step_horizontal.js +55 -40
  84. package/optimize/lib/components/steps/step_horizontal.styles.js +66 -0
  85. package/optimize/lib/components/steps/step_number.js +86 -75
  86. package/optimize/lib/components/steps/step_number.styles.js +84 -0
  87. package/optimize/lib/components/steps/steps_horizontal.js +12 -7
  88. package/optimize/lib/components/steps/steps_horizontal.styles.js +38 -0
  89. package/optimize/lib/components/steps/sub_steps.js +9 -1
  90. package/optimize/lib/components/steps/sub_steps.styles.js +24 -0
  91. package/optimize/lib/components/tour/tour_step_indicator.js +0 -3
  92. package/optimize/lib/global_styling/utility/animations.js +6 -4
  93. package/package.json +2 -2
  94. package/src/components/index.scss +0 -1
  95. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  96. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  97. package/test-env/components/code/code_block_annotations.js +110 -0
  98. package/test-env/components/code/code_block_annotations.style.js +29 -0
  99. package/test-env/components/code/code_block_full_screen.js +9 -3
  100. package/test-env/components/code/code_block_line.styles.js +3 -2
  101. package/test-env/components/code/utils.js +54 -13
  102. package/test-env/components/form/range/range_track.js +1 -1
  103. package/test-env/components/icon/assets/app_agent.js +2 -10
  104. package/test-env/components/icon/assets/app_fleet.js +10 -2
  105. package/test-env/components/steps/step.js +21 -12
  106. package/test-env/components/steps/step.styles.js +93 -0
  107. package/test-env/components/steps/step_horizontal.js +56 -41
  108. package/test-env/components/steps/step_horizontal.styles.js +66 -0
  109. package/test-env/components/steps/step_number.js +86 -75
  110. package/test-env/components/steps/step_number.styles.js +84 -0
  111. package/test-env/components/steps/steps_horizontal.js +12 -7
  112. package/test-env/components/steps/steps_horizontal.styles.js +38 -0
  113. package/test-env/components/steps/sub_steps.js +9 -1
  114. package/test-env/components/steps/sub_steps.styles.js +24 -0
  115. package/test-env/components/tour/tour_step_indicator.js +0 -3
  116. package/test-env/global_styling/utility/animations.js +6 -4
  117. package/src/components/steps/_index.scss +0 -7
  118. package/src/components/steps/_mixins.scss +0 -12
  119. package/src/components/steps/_step_number.scss +0 -52
  120. package/src/components/steps/_steps.scss +0 -57
  121. package/src/components/steps/_steps_horizontal.scss +0 -135
  122. package/src/components/steps/_sub_steps.scss +0 -15
  123. package/src/components/steps/_variables.scss +0 -11
  124. package/src/themes/amsterdam/global_styling/variables/_steps.scss +0 -8
  125. package/src/themes/amsterdam/overrides/_steps.scss +0 -101
@@ -17,94 +17,103 @@ import classNames from 'classnames';
17
17
  import PropTypes from "prop-types";
18
18
  import React from 'react';
19
19
  import { EuiScreenReaderOnly } from '../accessibility';
20
- import { keysOf } from '../common';
21
20
  import { EuiIcon } from '../icon';
22
21
  import { useI18nCompleteStep, useI18nDisabledStep, useI18nErrorsStep, useI18nIncompleteStep, useI18nStep, useI18nWarningStep, useI18nLoadingStep, useI18nCurrentStep } from './step_strings';
23
22
  import { EuiLoadingSpinner } from '../loading';
23
+ import { useEuiTheme } from '../../services';
24
+ import { euiStepNumberStyles, euiStepNumberContentStyles } from './step_number.styles';
24
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
- var statusToClassNameMap = {
26
- incomplete: 'euiStepNumber--incomplete',
27
- disabled: 'euiStepNumber--disabled',
28
- loading: 'euiStepNumber--loading',
29
- warning: 'euiStepNumber--warning',
30
- danger: 'euiStepNumber--danger',
31
- complete: 'euiStepNumber--complete',
32
- current: null // Current displays the same as the default (undefined)
33
-
34
- };
35
- export var STATUS = keysOf(statusToClassNameMap);
26
+ export var STATUS = ['incomplete', 'disabled', 'loading', 'warning', 'danger', 'complete', 'current'];
36
27
  export var EuiStepNumber = function EuiStepNumber(_ref) {
37
28
  var className = _ref.className,
38
29
  status = _ref.status,
39
30
  number = _ref.number,
40
- titleSize = _ref.titleSize,
31
+ _ref$titleSize = _ref.titleSize,
32
+ titleSize = _ref$titleSize === void 0 ? 's' : _ref$titleSize,
41
33
  rest = _objectWithoutProperties(_ref, _excluded);
42
34
 
43
- var stepAriaLabel = useI18nStep({
44
- number: number
45
- });
46
- var completeAriaLabel = useI18nCompleteStep({
47
- number: number
48
- });
49
- var warningAriaLabel = useI18nWarningStep({
50
- number: number
51
- });
52
- var errorsAriaLabel = useI18nErrorsStep({
53
- number: number
54
- });
55
- var incompleteAriaLabel = useI18nIncompleteStep({
56
- number: number
57
- });
58
- var disabledAriaLabel = useI18nDisabledStep({
59
- number: number
60
- });
61
- var loadingAriaLabel = useI18nLoadingStep({
62
- number: number
63
- });
64
- var currentAriaLabel = useI18nCurrentStep({
65
- number: number
66
- });
67
- var classes = classNames('euiStepNumber', status ? statusToClassNameMap[status] : undefined, className);
68
- var iconSize = titleSize === 'xs' ? 's' : 'm';
69
- var screenReaderText = stepAriaLabel;
70
- if (status === 'incomplete') screenReaderText = incompleteAriaLabel;else if (status === 'disabled') screenReaderText = disabledAriaLabel;else if (status === 'loading') screenReaderText = loadingAriaLabel;else if (status === 'current') screenReaderText = currentAriaLabel;
35
+ var ariaLabelsMap = {
36
+ step: useI18nStep({
37
+ number: number
38
+ }),
39
+ current: useI18nCurrentStep({
40
+ number: number
41
+ }),
42
+ incomplete: useI18nIncompleteStep({
43
+ number: number
44
+ }),
45
+ complete: useI18nCompleteStep({
46
+ number: number
47
+ }),
48
+ disabled: useI18nDisabledStep({
49
+ number: number
50
+ }),
51
+ warning: useI18nWarningStep({
52
+ number: number
53
+ }),
54
+ danger: useI18nErrorsStep({
55
+ number: number
56
+ }),
57
+ loading: useI18nLoadingStep({
58
+ number: number
59
+ })
60
+ };
61
+ var classes = classNames('euiStepNumber', className);
62
+ var euiTheme = useEuiTheme();
63
+ var styles = euiStepNumberStyles(euiTheme);
64
+ var cssStyles = [styles.euiStepNumber, styles[titleSize], status && styles[status]];
65
+ var contentStyles = euiStepNumberContentStyles(euiTheme);
66
+ var content;
67
+ var screenReaderText;
68
+
69
+ switch (status) {
70
+ // Loading spinner
71
+ case 'loading':
72
+ screenReaderText = ariaLabelsMap.loading;
73
+ content = ___EmotionJSX(EuiLoadingSpinner, {
74
+ className: "euiStepNumber__loader",
75
+ size: titleSize === 'xs' ? 'l' : 'xl'
76
+ });
77
+ break;
78
+ // Statuses with icons
71
79
 
72
- var numberOrIcon = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, screenReaderText)), ___EmotionJSX("span", {
73
- className: "euiStepNumber__number",
74
- "aria-hidden": "true"
75
- }, number));
80
+ case 'danger':
81
+ case 'warning':
82
+ case 'complete':
83
+ var cssIconStyles = [contentStyles.euiStepNumber__icon, contentStyles[status]];
84
+ var iconTypeMap = {
85
+ danger: 'cross',
86
+ warning: 'alert',
87
+ complete: 'check'
88
+ };
89
+ content = ___EmotionJSX(EuiIcon, {
90
+ type: iconTypeMap[status],
91
+ "aria-label": ariaLabelsMap[status],
92
+ size: titleSize === 'xs' ? 's' : 'm',
93
+ className: "euiStepNumber__icon",
94
+ css: cssIconStyles
95
+ });
96
+ break;
97
+ // Statuses with numbers
76
98
 
77
- if (status === 'complete') {
78
- numberOrIcon = ___EmotionJSX(EuiIcon, {
79
- type: "check",
80
- className: "euiStepNumber__icon",
81
- size: iconSize,
82
- "aria-label": completeAriaLabel
83
- });
84
- } else if (status === 'warning') {
85
- numberOrIcon = ___EmotionJSX(EuiIcon, {
86
- type: "alert",
87
- className: "euiStepNumber__icon",
88
- size: iconSize,
89
- "aria-label": warningAriaLabel
90
- });
91
- } else if (status === 'danger') {
92
- numberOrIcon = ___EmotionJSX(EuiIcon, {
93
- type: "cross",
94
- className: "euiStepNumber__icon",
95
- size: iconSize,
96
- "aria-label": errorsAriaLabel
97
- });
98
- } else if (status === 'loading') {
99
- numberOrIcon = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, screenReaderText)), ___EmotionJSX(EuiLoadingSpinner, {
100
- className: "euiStepNumber__loader",
101
- size: iconSize === 's' ? 'l' : 'xl'
102
- }));
99
+ case 'incomplete':
100
+ case 'current':
101
+ case 'disabled':
102
+ default:
103
+ var cssNumberStyles = [contentStyles.euiStepNumber__number, status && contentStyles[status]];
104
+ screenReaderText = ariaLabelsMap[status || 'step'];
105
+ content = ___EmotionJSX("span", {
106
+ "aria-hidden": "true",
107
+ className: "euiStepNumber__number",
108
+ css: cssNumberStyles
109
+ }, number);
110
+ break;
103
111
  }
104
112
 
105
113
  return ___EmotionJSX("span", _extends({
106
- className: classes
107
- }, rest), numberOrIcon);
114
+ className: classes,
115
+ css: cssStyles
116
+ }, rest), screenReaderText && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, screenReaderText)), content);
108
117
  };
109
118
  EuiStepNumber.propTypes = {
110
119
  /**
@@ -0,0 +1,76 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { mathWithUnits, logicalCSS, euiFontSizeFromScale, euiCanAnimate, euiAnimScale } from '../../global_styling';
12
+ import { euiStepVariables } from './step.styles';
13
+ import { euiButtonFillColor } from '../../themes/amsterdam/global_styling/mixins';
14
+
15
+ var _ref = process.env.NODE_ENV === "production" ? {
16
+ name: "76s2de-loading",
17
+ styles: "background:transparent;label:loading;"
18
+ } : {
19
+ name: "76s2de-loading",
20
+ styles: "background:transparent;label:loading;",
21
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
22
+ };
23
+
24
+ var _ref2 = process.env.NODE_ENV === "production" ? {
25
+ name: "1ru1jeq-euiStepNumber",
26
+ styles: "flex-shrink:0;label:euiStepNumber;"
27
+ } : {
28
+ name: "1ru1jeq-euiStepNumber",
29
+ styles: "flex-shrink:0;label:euiStepNumber;",
30
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
31
+ };
32
+
33
+ export var euiStepNumberStyles = function euiStepNumberStyles(euiThemeContext) {
34
+ var euiTheme = euiThemeContext.euiTheme;
35
+ var euiStep = euiStepVariables(euiTheme);
36
+
37
+ var createStepsNumber = function createStepsNumber(size, fontSize) {
38
+ return "\n display: inline-block;\n line-height: ".concat(size, ";\n border-radius: ").concat(size, ";\n ").concat(logicalCSS('width', size), ";\n ").concat(logicalCSS('height', size), ";\n text-align: center;\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.primary, ";\n font-size: ").concat(fontSize, ";\n font-weight: ").concat(euiTheme.font.weight.medium, ";\n ");
39
+ };
40
+
41
+ return {
42
+ euiStepNumber: _ref2,
43
+ // sizes
44
+ m: /*#__PURE__*/css(createStepsNumber(euiStep.numberSize, euiFontSizeFromScale('s', euiTheme)), ";;label:m;"),
45
+ s: /*#__PURE__*/css(createStepsNumber(euiStep.numberSize, euiFontSizeFromScale('s', euiTheme)), ";;label:s;"),
46
+ xs: /*#__PURE__*/css(createStepsNumber(euiStep.numberXSSize, euiFontSizeFromScale('xs', euiTheme)), ";;label:xs;"),
47
+ // status
48
+ incomplete: /*#__PURE__*/css("background-color:transparent;color:", euiTheme.colors.text, ";border:", euiTheme.border.thick, ";;label:incomplete;"),
49
+ disabled: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'disabled').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'disabled').backgroundColor, ";;label:disabled;"),
50
+ loading: _ref,
51
+ warning: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'warning').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'warning').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:warning;"),
52
+ danger: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'danger').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'danger').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:danger;"),
53
+ complete: /*#__PURE__*/css("color:", euiButtonFillColor(euiThemeContext, 'success').color, ";background-color:", euiButtonFillColor(euiThemeContext, 'success').backgroundColor, ";", euiCanAnimate, "{animation:", euiAnimScale, " ", euiTheme.animation.fast, " ", euiTheme.animation.bounce, ";};label:complete;"),
54
+ current: /*#__PURE__*/css(";label:current;")
55
+ };
56
+ };
57
+ export var euiStepNumberContentStyles = function euiStepNumberContentStyles(_ref3) {
58
+ var euiTheme = _ref3.euiTheme;
59
+ return {
60
+ // Statuses with icon content
61
+ euiStepNumber__icon: /*#__PURE__*/css("vertical-align:middle;position:relative;inset-block-start:-", euiTheme.border.width.thin, ";;label:euiStepNumber__icon;"),
62
+ complete: /*#__PURE__*/css("stroke:currentColor;stroke-width:", mathWithUnits(euiTheme.border.width.thin, function (x) {
63
+ return x / 2;
64
+ }), ";;label:complete;"),
65
+ danger: /*#__PURE__*/css("stroke:currentColor;stroke-width:", mathWithUnits(euiTheme.border.width.thin, function (x) {
66
+ return x / 2;
67
+ }), ";;label:danger;"),
68
+ warning: /*#__PURE__*/css("inset-block-start:-", euiTheme.border.width.thick, ";;label:warning;"),
69
+ // Statuses with number content
70
+ euiStepNumber__number: /*#__PURE__*/css(";label:euiStepNumber__number;"),
71
+ incomplete: /*#__PURE__*/css("display:unset;position:relative;inset-block-start:-", euiTheme.border.width.thick, ";;label:incomplete;"),
72
+ loading: /*#__PURE__*/css(";label:loading;"),
73
+ disabled: /*#__PURE__*/css(";label:disabled;"),
74
+ current: /*#__PURE__*/css(";label:current;")
75
+ };
76
+ };
@@ -17,6 +17,7 @@ import classNames from 'classnames';
17
17
  import PropTypes from "prop-types";
18
18
  import React from 'react';
19
19
  import { EuiStepHorizontal } from './step_horizontal';
20
+ import { euiStepsHorizontalStyles } from './steps_horizontal.styles';
20
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
22
  export var EuiStepsHorizontal = function EuiStepsHorizontal(_ref) {
22
23
  var className = _ref.className,
@@ -24,16 +25,19 @@ export var EuiStepsHorizontal = function EuiStepsHorizontal(_ref) {
24
25
  rest = _objectWithoutProperties(_ref, _excluded);
25
26
 
26
27
  var classes = classNames('euiStepsHorizontal', className);
28
+ var styles = euiStepsHorizontalStyles();
29
+ var cssStyles = styles.euiStepsHorizontal;
30
+ var cssItemStyles = styles.euiStepsHorizontal__item;
27
31
  return ___EmotionJSX("ol", _extends({
28
- className: classes
32
+ className: classes,
33
+ css: cssStyles
29
34
  }, rest), steps.map(function (stepProps, index) {
30
- var isCurrent = stepProps.status === 'current' ? {
31
- 'aria-current': 'step'
32
- } : {};
33
- return ___EmotionJSX("li", _extends({
35
+ return ___EmotionJSX("li", {
34
36
  key: index,
35
- className: "euiStepHorizontal__item"
36
- }, isCurrent), ___EmotionJSX(EuiStepHorizontal, _extends({
37
+ className: "euiStepsHorizontal__item",
38
+ css: cssItemStyles,
39
+ "aria-current": stepProps.status === 'current' ? 'step' : undefined
40
+ }, ___EmotionJSX(EuiStepHorizontal, _extends({
37
41
  step: index + 1
38
42
  }, stepProps)));
39
43
  }));
@@ -0,0 +1,35 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react'; // 1. Make each step the same width
11
+
12
+ var _ref = process.env.NODE_ENV === "production" ? {
13
+ name: "1pmkwst-euiStepsHorizontal__item",
14
+ styles: "flex-grow:1;flex-basis:0%;&:first-of-type>.euiStepHorizontal::before,&:last-of-type>.euiStepHorizontal::after{display:none;};label:euiStepsHorizontal__item;"
15
+ } : {
16
+ name: "1pmkwst-euiStepsHorizontal__item",
17
+ styles: "flex-grow:1;flex-basis:0%;&:first-of-type>.euiStepHorizontal::before,&:last-of-type>.euiStepHorizontal::after{display:none;};label:euiStepsHorizontal__item;",
18
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
+ };
20
+
21
+ var _ref2 = process.env.NODE_ENV === "production" ? {
22
+ name: "44yl7r-euiStepsHorizontal",
23
+ styles: "display:flex;align-items:stretch;label:euiStepsHorizontal;"
24
+ } : {
25
+ name: "44yl7r-euiStepsHorizontal",
26
+ styles: "display:flex;align-items:stretch;label:euiStepsHorizontal;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
29
+
30
+ export var euiStepsHorizontalStyles = function euiStepsHorizontalStyles() {
31
+ return {
32
+ euiStepsHorizontal: _ref2,
33
+ euiStepsHorizontal__item: _ref
34
+ };
35
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiSubStepsStyles } from './sub_steps.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiSubSteps = function EuiSubSteps(_ref) {
21
23
  var children = _ref.children,
@@ -23,8 +25,12 @@ export var EuiSubSteps = function EuiSubSteps(_ref) {
23
25
  rest = _objectWithoutProperties(_ref, _excluded);
24
26
 
25
27
  var classes = classNames('euiSubSteps', className);
28
+ var euiTheme = useEuiTheme();
29
+ var styles = euiSubStepsStyles(euiTheme);
30
+ var cssStyles = [styles.euiSubSteps];
26
31
  return ___EmotionJSX("div", _extends({
27
- className: classes
32
+ className: classes,
33
+ css: cssStyles
28
34
  }, rest), children);
29
35
  };
30
36
  EuiSubSteps.propTypes = {
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ export var euiSubStepsStyles = function euiSubStepsStyles(_ref) {
10
+ var euiTheme = _ref.euiTheme;
11
+ return {
12
+ euiSubSteps: /*#__PURE__*/css("padding:", euiTheme.size.base, ";background-color:", euiTheme.colors.lightestShade, ";margin-block-end:", euiTheme.size.base, ";>*:last-child{margin-block-end:0;}& ol,.euiText & ol{list-style-type:lower-alpha;};label:euiSubSteps;")
13
+ };
14
+ };
@@ -49,7 +49,6 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
49
49
  }, function (isActive) {
50
50
  return ___EmotionJSX(EuiIcon, {
51
51
  type: "dot",
52
- className: "euiStepNumber__icon",
53
52
  "aria-label": isActive,
54
53
  color: "success",
55
54
  "aria-current": "step"
@@ -62,7 +61,6 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
62
61
  }, function (isComplete) {
63
62
  return ___EmotionJSX(EuiIcon, {
64
63
  type: "dot",
65
- className: "euiStepNumber__icon",
66
64
  "aria-label": isComplete,
67
65
  color: "subdued"
68
66
  });
@@ -74,7 +72,6 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
74
72
  }, function (isIncomplete) {
75
73
  return ___EmotionJSX(EuiIcon, {
76
74
  type: "dot",
77
- className: "euiStepNumber__icon",
78
75
  "aria-label": isIncomplete,
79
76
  color: "subdued"
80
77
  });
@@ -1,4 +1,4 @@
1
- var _templateObject, _templateObject2, _templateObject3;
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
2
2
 
3
3
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
4
 
@@ -15,5 +15,6 @@ export var euiAnimSlideInUp = function euiAnimSlideInUp(size) {
15
15
  return keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
16
16
  };
17
17
  export var euiAnimSlideX = function euiAnimSlideX(size) {
18
- return keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: translateX(", ");\n }\n\n 100% {\n transform: translateX(0);\n }\n"])), size);
19
- };
18
+ return keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: translateX(", ");\n }\n\n 100% {\n transform: translateX(0);\n\n }\n"])), size);
19
+ };
20
+ export var euiAnimScale = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n\n 1% {\n opacity: 0;\n transform: scale(0);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n"])));
package/eui.d.ts CHANGED
@@ -1733,6 +1733,7 @@ declare module '@elastic/eui/src/global_styling/utility/animations' {
1733
1733
  export const euiAnimFadeIn: import("@emotion/serialize").Keyframes;
1734
1734
  export const euiAnimSlideInUp: (size: string) => import("@emotion/serialize").Keyframes;
1735
1735
  export const euiAnimSlideX: (size: string) => import("@emotion/serialize").Keyframes;
1736
+ export const euiAnimScale: import("@emotion/serialize").Keyframes;
1736
1737
 
1737
1738
  }
1738
1739
  declare module '@elastic/eui/src/components/skeleton/utils' {
@@ -9216,6 +9217,22 @@ declare module '@elastic/eui/src/components/card' {
9216
9217
  export type { EuiCheckableCardProps } from '@elastic/eui/src/components/card/checkable_card';
9217
9218
  export { EuiCheckableCard } from '@elastic/eui/src/components/card/checkable_card';
9218
9219
 
9220
+ }
9221
+ declare module '@elastic/eui/src/components/code/code_block_annotations.style' {
9222
+ import { UseEuiTheme } from '@elastic/eui/src/services';
9223
+ export const euiCodeBlockAnnotationsStyles: (euiTheme: UseEuiTheme['euiTheme']) => {
9224
+ euiCodeBlockAnnotation: import("@emotion/utils").SerializedStyles;
9225
+ euiCodeBlockAnnotation__buttonIcon: import("@emotion/utils").SerializedStyles;
9226
+ };
9227
+
9228
+ }
9229
+ declare module '@elastic/eui/src/components/code/code_block_annotations' {
9230
+ import { FunctionComponent, ReactNode } from 'react';
9231
+ export type LineAnnotationMap = Record<number, ReactNode>;
9232
+ export const EuiCodeBlockAnnotation: FunctionComponent<{
9233
+ lineNumber: number;
9234
+ }>;
9235
+
9219
9236
  }
9220
9237
  declare module '@elastic/eui/src/components/code/code_block_line.styles' {
9221
9238
  import { UseEuiTheme } from '@elastic/eui/src/services';
@@ -9227,6 +9244,7 @@ declare module '@elastic/eui/src/components/code/code_block_line.styles' {
9227
9244
  isHighlighted: string;
9228
9245
  };
9229
9246
  lineNumber: {
9247
+ euiCodeBlock__lineNumberWrapper: string;
9230
9248
  euiCodeBlock__lineNumber: string;
9231
9249
  };
9232
9250
  };
@@ -9237,6 +9255,7 @@ declare module '@elastic/eui/src/components/code/utils' {
9237
9255
  import { AST, RefractorNode } from 'refractor';
9238
9256
  import { CommonProps } from '@elastic/eui/src/components/common';
9239
9257
  import { UseEuiTheme } from '@elastic/eui/src/services';
9258
+ import { LineAnnotationMap } from '@elastic/eui/src/components/code/code_block_annotations';
9240
9259
  /**
9241
9260
  * Utils shared between EuiCode and EuiCodeBlock
9242
9261
  */
@@ -9258,6 +9277,7 @@ declare module '@elastic/eui/src/components/code/utils' {
9258
9277
  start: number;
9259
9278
  show: boolean;
9260
9279
  highlight?: string;
9280
+ annotations?: LineAnnotationMap;
9261
9281
  }
9262
9282
  export const parseLineRanges: (ranges: string) => number[];
9263
9283
  export const highlightByLine: (children: string, language: string, data: LineNumbersConfig, euiTheme: UseEuiTheme) => RefractorNode[];
@@ -9547,6 +9567,7 @@ declare module '@elastic/eui/src/components/code/code_block' {
9547
9567
  import { FunctionComponent } from 'react';
9548
9568
  import { ExclusiveUnion } from '@elastic/eui/src/components/common';
9549
9569
  import { EuiCodeSharedProps } from '@elastic/eui/src/components/code/utils';
9570
+ import { LineAnnotationMap } from '@elastic/eui/src/components/code/code_block_annotations';
9550
9571
  export const FONT_SIZES: readonly ["s", "m", "l"];
9551
9572
  export type EuiCodeBlockFontSize = typeof FONT_SIZES[number];
9552
9573
  export const PADDING_SIZES: readonly ["none", "s", "m", "l"];
@@ -9562,6 +9583,7 @@ declare module '@elastic/eui/src/components/code/code_block' {
9562
9583
  interface LineNumbersConfig {
9563
9584
  start?: number;
9564
9585
  highlight?: string;
9586
+ annotations?: LineAnnotationMap;
9565
9587
  }
9566
9588
  export type EuiCodeBlockProps = EuiCodeSharedProps & {
9567
9589
  paddingSize?: EuiCodeBlockPaddingSize;
@@ -9578,8 +9600,9 @@ declare module '@elastic/eui/src/components/code/code_block' {
9578
9600
  isCopyable?: boolean;
9579
9601
  /**
9580
9602
  * Displays line numbers.
9581
- * Optionally accepts a configuration object for setting the starting number and visual highlighting ranges:
9582
- * `{ start: 100, highlight: '1, 5-10, 20-30, 40' }`
9603
+ * Optionally accepts a configuration object for setting the starting number,
9604
+ * visually highlighting ranges, or annotating specific lines:
9605
+ * `{ start: 100, highlight: '1, 5-10, 20-30, 40', annotations: { 6: 'A special note about this line' } }`
9583
9606
  */
9584
9607
  lineNumbers?: boolean | LineNumbersConfig;
9585
9608
  /**
@@ -19048,12 +19071,69 @@ declare module '@elastic/eui/src/components/steps/step_strings' {
19048
19071
  export const useI18nCurrentStep: ({ number, title }: Props) => string;
19049
19072
  export {};
19050
19073
 
19074
+ }
19075
+ declare module '@elastic/eui/src/components/steps/step.styles' {
19076
+ import { UseEuiTheme } from '@elastic/eui/src/services';
19077
+ export const euiStepVariables: (euiTheme: UseEuiTheme['euiTheme']) => {
19078
+ numberSize: string;
19079
+ numberXSSize: string;
19080
+ numberMargin: string;
19081
+ };
19082
+ export const euiStepStyles: (euiThemeContext: UseEuiTheme) => {
19083
+ euiStep: import("@emotion/utils").SerializedStyles;
19084
+ m: import("@emotion/utils").SerializedStyles;
19085
+ s: import("@emotion/utils").SerializedStyles;
19086
+ xs: import("@emotion/utils").SerializedStyles;
19087
+ };
19088
+ export const euiStepContentStyles: (euiThemeContext: UseEuiTheme) => {
19089
+ euiStep__content: import("@emotion/utils").SerializedStyles;
19090
+ m: import("@emotion/utils").SerializedStyles;
19091
+ s: import("@emotion/utils").SerializedStyles;
19092
+ xs: import("@emotion/utils").SerializedStyles;
19093
+ };
19094
+ export const euiStepTitleStyles: (euiThemeContext: UseEuiTheme) => {
19095
+ euiStep__titleWrapper: import("@emotion/utils").SerializedStyles;
19096
+ euiStep__title: import("@emotion/utils").SerializedStyles;
19097
+ isDisabled: import("@emotion/utils").SerializedStyles;
19098
+ m: import("@emotion/utils").SerializedStyles;
19099
+ s: import("@emotion/utils").SerializedStyles;
19100
+ xs: import("@emotion/utils").SerializedStyles;
19101
+ };
19102
+
19103
+ }
19104
+ declare module '@elastic/eui/src/components/steps/step_number.styles' {
19105
+ import { UseEuiTheme } from '@elastic/eui/src/services';
19106
+ export const euiStepNumberStyles: (euiThemeContext: UseEuiTheme) => {
19107
+ euiStepNumber: import("@emotion/utils").SerializedStyles;
19108
+ m: import("@emotion/utils").SerializedStyles;
19109
+ s: import("@emotion/utils").SerializedStyles;
19110
+ xs: import("@emotion/utils").SerializedStyles;
19111
+ incomplete: import("@emotion/utils").SerializedStyles;
19112
+ disabled: import("@emotion/utils").SerializedStyles;
19113
+ loading: import("@emotion/utils").SerializedStyles;
19114
+ warning: import("@emotion/utils").SerializedStyles;
19115
+ danger: import("@emotion/utils").SerializedStyles;
19116
+ complete: import("@emotion/utils").SerializedStyles;
19117
+ current: import("@emotion/utils").SerializedStyles;
19118
+ };
19119
+ export const euiStepNumberContentStyles: ({ euiTheme }: UseEuiTheme) => {
19120
+ euiStepNumber__icon: import("@emotion/utils").SerializedStyles;
19121
+ complete: import("@emotion/utils").SerializedStyles;
19122
+ danger: import("@emotion/utils").SerializedStyles;
19123
+ warning: import("@emotion/utils").SerializedStyles;
19124
+ euiStepNumber__number: import("@emotion/utils").SerializedStyles;
19125
+ incomplete: import("@emotion/utils").SerializedStyles;
19126
+ loading: import("@emotion/utils").SerializedStyles;
19127
+ disabled: import("@emotion/utils").SerializedStyles;
19128
+ current: import("@emotion/utils").SerializedStyles;
19129
+ };
19130
+
19051
19131
  }
19052
19132
  declare module '@elastic/eui/src/components/steps/step_number' {
19053
19133
  import { FunctionComponent, HTMLAttributes } from 'react';
19054
19134
  import { CommonProps } from '@elastic/eui/src/components/common';
19055
19135
  import { EuiStepProps } from '@elastic/eui/src/components/steps/step';
19056
- export const STATUS: ("warning" | "danger" | "disabled" | "current" | "loading" | "incomplete" | "complete")[];
19136
+ export const STATUS: readonly ["incomplete", "disabled", "loading", "warning", "danger", "complete", "current"];
19057
19137
  export type EuiStepStatus = typeof STATUS[number];
19058
19138
  export interface EuiStepNumberProps extends CommonProps, HTMLAttributes<HTMLDivElement> {
19059
19139
  /**
@@ -19126,6 +19206,13 @@ declare module '@elastic/eui/src/components/steps/steps' {
19126
19206
  }
19127
19207
  export const EuiSteps: FunctionComponent<EuiStepsProps>;
19128
19208
 
19209
+ }
19210
+ declare module '@elastic/eui/src/components/steps/sub_steps.styles' {
19211
+ import { UseEuiTheme } from '@elastic/eui/src/services';
19212
+ export const euiSubStepsStyles: ({ euiTheme }: UseEuiTheme) => {
19213
+ euiSubSteps: import("@emotion/utils").SerializedStyles;
19214
+ };
19215
+
19129
19216
  }
19130
19217
  declare module '@elastic/eui/src/components/steps/sub_steps' {
19131
19218
  import { HTMLAttributes, FunctionComponent } from 'react';
@@ -19133,6 +19220,22 @@ declare module '@elastic/eui/src/components/steps/sub_steps' {
19133
19220
  export type EuiSubStepsProps = FunctionComponent<HTMLAttributes<HTMLDivElement> & CommonProps>;
19134
19221
  export const EuiSubSteps: EuiSubStepsProps;
19135
19222
 
19223
+ }
19224
+ declare module '@elastic/eui/src/components/steps/step_horizontal.styles' {
19225
+ import { UseEuiTheme } from '@elastic/eui/src/services';
19226
+ export const euiStepHorizontalStyles: (euiThemeContext: UseEuiTheme) => {
19227
+ euiStepHorizontal: import("@emotion/utils").SerializedStyles;
19228
+ enabled: import("@emotion/utils").SerializedStyles;
19229
+ disabled: import("@emotion/utils").SerializedStyles;
19230
+ };
19231
+ export const euiStepHorizontalNumberStyles: (euiThemeContext: UseEuiTheme) => {
19232
+ euiStepHorizontal__number: import("@emotion/utils").SerializedStyles;
19233
+ };
19234
+ export const euiStepHorizontalTitleStyles: (euiThemeContext: UseEuiTheme) => {
19235
+ euiStepHorizontal__title: import("@emotion/utils").SerializedStyles;
19236
+ disabled: import("@emotion/utils").SerializedStyles;
19237
+ };
19238
+
19136
19239
  }
19137
19240
  declare module '@elastic/eui/src/components/steps/step_horizontal' {
19138
19241
  import { ButtonHTMLAttributes, FunctionComponent, MouseEventHandler } from 'react';
@@ -19152,12 +19255,19 @@ declare module '@elastic/eui/src/components/steps/step_horizontal' {
19152
19255
  /**
19153
19256
  * Visual representation of the step number indicator.
19154
19257
  * May replace the number provided in props.step with alternate styling.
19155
- * The `isSelected`, `isComplete`, and `disabled` props will override these.
19258
+ * The `disabled` prop will override this.
19156
19259
  */
19157
19260
  status?: EuiStepStatus;
19158
19261
  }
19159
19262
  export const EuiStepHorizontal: FunctionComponent<EuiStepHorizontalProps>;
19160
19263
 
19264
+ }
19265
+ declare module '@elastic/eui/src/components/steps/steps_horizontal.styles' {
19266
+ export const euiStepsHorizontalStyles: () => {
19267
+ euiStepsHorizontal: import("@emotion/utils").SerializedStyles;
19268
+ euiStepsHorizontal__item: import("@emotion/utils").SerializedStyles;
19269
+ };
19270
+
19161
19271
  }
19162
19272
  declare module '@elastic/eui/src/components/steps/steps_horizontal' {
19163
19273
  import { FunctionComponent, OlHTMLAttributes } from 'react';
@@ -25913,6 +26023,7 @@ declare module '@elastic/eui' {
25913
26023
  "euiCardSelect.selected": any;
25914
26024
  "euiCardSelect.unavailable": any;
25915
26025
  "euiCardSelect.select": any;
26026
+ "euiCodeBlockAnnotations.ariaLabel": any;
25916
26027
  "euiCodeBlockCopy.copy": any;
25917
26028
  "euiCodeBlockFullScreen.fullscreenCollapse": any;
25918
26029
  "euiCodeBlockFullScreen.fullscreenExpand": any;