@elastic/eui 60.0.0 → 60.1.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.
Files changed (180) hide show
  1. package/README.md +7 -0
  2. package/dist/eui_charts_theme.js +330 -330
  3. package/dist/eui_charts_theme.js.map +1 -1
  4. package/dist/eui_theme_dark.css +0 -445
  5. package/dist/eui_theme_dark.json +7 -44
  6. package/dist/eui_theme_dark.json.d.ts +7 -44
  7. package/dist/eui_theme_dark.min.css +1 -1
  8. package/dist/eui_theme_light.css +0 -445
  9. package/dist/eui_theme_light.json +7 -44
  10. package/dist/eui_theme_light.json.d.ts +7 -44
  11. package/dist/eui_theme_light.min.css +1 -1
  12. package/es/components/accessibility/screen_reader_live/screen_reader_live.js +30 -7
  13. package/es/components/accessibility/screen_reader_only/screen_reader_only.js +14 -19
  14. package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  15. package/es/components/accessibility/skip_link/skip_link.js +20 -4
  16. package/es/components/avatar/avatar.js +2 -2
  17. package/es/components/badge/badge.js +1 -1
  18. package/es/components/button/button_icon/button_icon.js +1 -1
  19. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  20. package/es/components/datagrid/body/data_grid_body.js +6 -6
  21. package/es/components/datagrid/body/data_grid_cell.js +12 -12
  22. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  23. package/es/components/datagrid/body/header/data_grid_header_row.js +6 -6
  24. package/es/components/datagrid/data_grid.js +6 -6
  25. package/es/components/datagrid/utils/in_memory.js +6 -6
  26. package/es/components/date_picker/date_picker.js +1 -1
  27. package/es/components/empty_prompt/empty_prompt.js +1 -1
  28. package/es/components/form/field_text/field_text.js +1 -1
  29. package/es/components/form/form_control_layout/form_control_layout.js +1 -1
  30. package/es/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  31. package/es/components/health/health.js +1 -1
  32. package/es/components/icon/icon.js +43 -495
  33. package/es/components/icon/icon.styles.js +75 -0
  34. package/es/components/icon/icon_map.js +455 -0
  35. package/es/components/icon/named_colors.js +2 -13
  36. package/es/components/list_group/list_group.js +1 -1
  37. package/es/components/list_group/list_group_item.js +1 -1
  38. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  39. package/es/components/notification/notification_event.js +2 -2
  40. package/es/components/notification/notification_event_meta.js +1 -1
  41. package/es/components/notification/notification_event_read_button.js +1 -1
  42. package/es/components/panel/panel.js +2 -1
  43. package/es/components/progress/progress.js +34 -87
  44. package/es/components/progress/progress.styles.js +155 -0
  45. package/es/components/selectable/selectable_list/selectable_list.js +3 -1
  46. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  47. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -2
  48. package/es/components/text/text.js +2 -0
  49. package/es/components/tool_tip/icon_tip.js +1 -1
  50. package/es/global_styling/utility/utility.js +3 -1
  51. package/es/services/theme/hooks.js +2 -0
  52. package/eui.d.ts +393 -453
  53. package/i18ntokens.json +2 -2
  54. package/lib/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  55. package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +22 -19
  56. package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  57. package/lib/components/accessibility/skip_link/skip_link.js +21 -4
  58. package/lib/components/avatar/avatar.js +2 -2
  59. package/lib/components/badge/badge.js +1 -1
  60. package/lib/components/button/button_icon/button_icon.js +1 -1
  61. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  62. package/lib/components/datagrid/body/data_grid_body.js +6 -6
  63. package/lib/components/datagrid/body/data_grid_cell.js +12 -12
  64. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  65. package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -6
  66. package/lib/components/datagrid/data_grid.js +6 -6
  67. package/lib/components/datagrid/utils/focus.js +1 -0
  68. package/lib/components/datagrid/utils/in_memory.js +6 -6
  69. package/lib/components/date_picker/date_picker.js +1 -1
  70. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  71. package/lib/components/form/field_text/field_text.js +1 -1
  72. package/lib/components/form/form_control_layout/form_control_layout.js +1 -1
  73. package/lib/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  74. package/lib/components/health/health.js +1 -1
  75. package/lib/components/icon/icon.js +54 -499
  76. package/lib/components/icon/icon.styles.js +79 -0
  77. package/lib/components/icon/icon_map.js +463 -0
  78. package/lib/components/icon/named_colors.js +4 -15
  79. package/lib/components/list_group/list_group.js +1 -1
  80. package/lib/components/list_group/list_group_item.js +1 -1
  81. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  82. package/lib/components/notification/notification_event.js +2 -2
  83. package/lib/components/notification/notification_event_meta.js +1 -1
  84. package/lib/components/notification/notification_event_read_button.js +1 -1
  85. package/lib/components/panel/panel.js +2 -1
  86. package/lib/components/progress/progress.js +36 -88
  87. package/lib/components/progress/progress.styles.js +166 -0
  88. package/lib/components/selectable/selectable_list/selectable_list.js +3 -1
  89. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  90. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  91. package/lib/components/text/text.js +2 -0
  92. package/lib/components/tool_tip/icon_tip.js +1 -1
  93. package/lib/global_styling/utility/utility.js +5 -1
  94. package/lib/services/theme/hooks.js +2 -0
  95. package/optimize/es/components/accessibility/screen_reader_live/screen_reader_live.js +21 -6
  96. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.js +11 -17
  97. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  98. package/optimize/es/components/accessibility/skip_link/skip_link.js +20 -4
  99. package/optimize/es/components/datagrid/utils/focus.js +1 -0
  100. package/optimize/es/components/icon/icon.js +40 -492
  101. package/optimize/es/components/icon/icon.styles.js +75 -0
  102. package/optimize/es/components/icon/icon_map.js +455 -0
  103. package/optimize/es/components/icon/named_colors.js +2 -13
  104. package/optimize/es/components/panel/panel.js +2 -1
  105. package/optimize/es/components/progress/progress.js +31 -84
  106. package/optimize/es/components/progress/progress.styles.js +155 -0
  107. package/optimize/es/components/selectable/selectable_list/selectable_list.js +2 -0
  108. package/optimize/es/components/text/text.js +2 -0
  109. package/optimize/es/global_styling/utility/utility.js +3 -1
  110. package/optimize/es/services/theme/hooks.js +2 -0
  111. package/optimize/lib/components/accessibility/screen_reader_live/screen_reader_live.js +20 -5
  112. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.js +18 -16
  113. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  114. package/optimize/lib/components/accessibility/skip_link/skip_link.js +21 -4
  115. package/optimize/lib/components/datagrid/utils/focus.js +1 -0
  116. package/optimize/lib/components/icon/icon.js +49 -494
  117. package/optimize/lib/components/icon/icon.styles.js +81 -0
  118. package/optimize/lib/components/icon/icon_map.js +463 -0
  119. package/optimize/lib/components/icon/named_colors.js +4 -15
  120. package/optimize/lib/components/panel/panel.js +2 -1
  121. package/optimize/lib/components/progress/progress.js +33 -85
  122. package/optimize/lib/components/progress/progress.styles.js +168 -0
  123. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +2 -0
  124. package/optimize/lib/components/text/text.js +2 -0
  125. package/optimize/lib/global_styling/utility/utility.js +5 -1
  126. package/optimize/lib/services/theme/hooks.js +2 -0
  127. package/package.json +2 -2
  128. package/src/components/form/form_control_layout/_form_control_layout.scss +2 -4
  129. package/src/components/index.scss +0 -3
  130. package/src/global_styling/variables/_form.scss +9 -0
  131. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  132. package/test-env/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  133. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +21 -18
  134. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  135. package/test-env/components/accessibility/skip_link/skip_link.js +21 -4
  136. package/test-env/components/avatar/avatar.js +2 -2
  137. package/test-env/components/badge/badge.js +1 -1
  138. package/test-env/components/button/button_icon/button_icon.js +1 -1
  139. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  140. package/test-env/components/datagrid/body/data_grid_body.js +6 -6
  141. package/test-env/components/datagrid/body/data_grid_cell.js +12 -12
  142. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  143. package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -6
  144. package/test-env/components/datagrid/data_grid.js +6 -6
  145. package/test-env/components/datagrid/utils/focus.js +1 -0
  146. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  147. package/test-env/components/date_picker/date_picker.js +1 -1
  148. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  149. package/test-env/components/form/field_text/field_text.js +1 -1
  150. package/test-env/components/form/form_control_layout/form_control_layout.js +1 -1
  151. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  152. package/test-env/components/health/health.js +1 -1
  153. package/test-env/components/icon/icon.styles.js +81 -0
  154. package/test-env/components/icon/icon_map.js +463 -0
  155. package/test-env/components/icon/named_colors.js +4 -15
  156. package/test-env/components/list_group/list_group.js +1 -1
  157. package/test-env/components/list_group/list_group_item.js +1 -1
  158. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  159. package/test-env/components/notification/notification_event.js +2 -2
  160. package/test-env/components/notification/notification_event_meta.js +1 -1
  161. package/test-env/components/notification/notification_event_read_button.js +1 -1
  162. package/test-env/components/panel/panel.js +2 -1
  163. package/test-env/components/progress/progress.js +36 -88
  164. package/test-env/components/progress/progress.styles.js +168 -0
  165. package/test-env/components/selectable/selectable_list/selectable_list.js +3 -1
  166. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  167. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  168. package/test-env/components/text/text.js +2 -0
  169. package/test-env/components/tool_tip/icon_tip.js +1 -1
  170. package/test-env/global_styling/utility/utility.js +5 -1
  171. package/test-env/services/theme/hooks.js +2 -0
  172. package/src/components/accessibility/_index.scss +0 -1
  173. package/src/components/accessibility/screen_reader_only/_screen_reader_only.scss +0 -5
  174. package/src/components/icon/_icon.scss +0 -87
  175. package/src/components/icon/_index.scss +0 -2
  176. package/src/components/icon/_variables.scss +0 -22
  177. package/src/components/progress/_index.scss +0 -2
  178. package/src/components/progress/_progress.scss +0 -166
  179. package/src/components/progress/_variables.scss +0 -21
  180. package/src/themes/amsterdam/overrides/_progress.scss +0 -3
@@ -1,9 +1,13 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
- var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad"];
3
+ var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "theme", "style"];
4
4
 
5
5
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
6
 
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8
+
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
10
+
7
11
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
12
 
9
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -41,10 +45,13 @@ import React, { PureComponent } from 'react';
41
45
  import PropTypes from "prop-types";
42
46
  import classNames from 'classnames';
43
47
  import { keysOf } from '../common';
48
+ import { typeToPathMap } from './icon_map';
44
49
  import { icon as empty } from './assets/empty';
45
50
  import { enqueueStateChange } from '../../services/react';
46
- import { htmlIdGenerator } from '../../services';
47
- import { colorToClassMap, isNamedColor } from './named_colors';
51
+ import { htmlIdGenerator, withEuiTheme } from '../../services';
52
+ export { COLORS } from './named_colors';
53
+ import { isNamedColor } from './named_colors';
54
+ import { euiIconStyles } from './icon.styles';
48
55
  import { jsx as ___EmotionJSX } from "@emotion/react";
49
56
 
50
57
  var getIsAppIcon = function getIsAppIcon(iconType) {
@@ -56,466 +63,8 @@ var getIsAppIcon = function getIsAppIcon(iconType) {
56
63
  return iconType.endsWith('App') || iconType.endsWith('Job');
57
64
  };
58
65
 
59
- var typeToPathMap = {
60
- accessibility: 'accessibility',
61
- addDataApp: 'app_add_data',
62
- advancedSettingsApp: 'app_advanced_settings',
63
- agentApp: 'app_fleet',
64
- aggregate: 'aggregate',
65
- alert: 'alert',
66
- analyzeEvent: 'analyzeEvent',
67
- annotation: 'annotation',
68
- apmApp: 'app_apm',
69
- apmTrace: 'apm_trace',
70
- appSearchApp: 'app_app_search',
71
- apps: 'apps',
72
- arrowDown: 'arrow_down',
73
- arrowLeft: 'arrow_left',
74
- arrowRight: 'arrow_right',
75
- arrowUp: 'arrow_up',
76
- arrowStart: 'arrowStart',
77
- arrowEnd: 'arrowEnd',
78
- asterisk: 'asterisk',
79
- auditbeatApp: 'app_auditbeat',
80
- beaker: 'beaker',
81
- bell: 'bell',
82
- bellSlash: 'bellSlash',
83
- bolt: 'bolt',
84
- boxesHorizontal: 'boxes_horizontal',
85
- boxesVertical: 'boxes_vertical',
86
- branch: 'branch',
87
- branchUser: 'branchUser',
88
- broom: 'broom',
89
- brush: 'brush',
90
- bug: 'bug',
91
- bullseye: 'bullseye',
92
- calendar: 'calendar',
93
- canvasApp: 'app_canvas',
94
- casesApp: 'app_cases',
95
- check: 'check',
96
- checkInCircleFilled: 'checkInCircleFilled',
97
- cheer: 'cheer',
98
- classificationJob: 'ml_classification_job',
99
- clock: 'clock',
100
- cloudDrizzle: 'cloudDrizzle',
101
- cloudStormy: 'cloudStormy',
102
- cloudSunny: 'cloudSunny',
103
- codeApp: 'app_code',
104
- color: 'color',
105
- compute: 'compute',
106
- console: 'console',
107
- consoleApp: 'app_console',
108
- continuityAbove: 'continuityAbove',
109
- continuityAboveBelow: 'continuityAboveBelow',
110
- continuityBelow: 'continuityBelow',
111
- continuityWithin: 'continuityWithin',
112
- controlsHorizontal: 'controls_horizontal',
113
- controlsVertical: 'controls_vertical',
114
- copy: 'copy',
115
- copyClipboard: 'copy_clipboard',
116
- createAdvancedJob: 'ml_create_advanced_job',
117
- createMultiMetricJob: 'ml_create_multi_metric_job',
118
- createPopulationJob: 'ml_create_population_job',
119
- createSingleMetricJob: 'ml_create_single_metric_job',
120
- cross: 'cross',
121
- crossClusterReplicationApp: 'app_cross_cluster_replication',
122
- crossInACircleFilled: 'crossInACircleFilled',
123
- crosshairs: 'crosshairs',
124
- currency: 'currency',
125
- cut: 'cut',
126
- dashboardApp: 'app_dashboard',
127
- dataVisualizer: 'ml_data_visualizer',
128
- database: 'database',
129
- desktop: 'desktop',
130
- devToolsApp: 'app_devtools',
131
- discoverApp: 'app_discover',
132
- document: 'document',
133
- documentEdit: 'documentEdit',
134
- documentation: 'documentation',
135
- documents: 'documents',
136
- dot: 'dot',
137
- doubleArrowLeft: 'doubleArrowLeft',
138
- doubleArrowRight: 'doubleArrowRight',
139
- download: 'download',
140
- editorAlignCenter: 'editor_align_center',
141
- editorAlignLeft: 'editor_align_left',
142
- editorAlignRight: 'editor_align_right',
143
- editorBold: 'editor_bold',
144
- editorChecklist: 'editor_checklist',
145
- editorCodeBlock: 'editor_code_block',
146
- editorComment: 'editor_comment',
147
- editorDistributeHorizontal: 'editorDistributeHorizontal',
148
- editorDistributeVertical: 'editorDistributeVertical',
149
- editorHeading: 'editor_heading',
150
- editorItalic: 'editor_italic',
151
- editorItemAlignBottom: 'editorItemAlignBottom',
152
- editorItemAlignCenter: 'editorItemAlignCenter',
153
- editorItemAlignLeft: 'editorItemAlignLeft',
154
- editorItemAlignMiddle: 'editorItemAlignMiddle',
155
- editorItemAlignRight: 'editorItemAlignRight',
156
- editorItemAlignTop: 'editorItemAlignTop',
157
- editorLink: 'editor_link',
158
- editorOrderedList: 'editor_ordered_list',
159
- editorPositionBottomLeft: 'editorPositionBottomLeft',
160
- editorPositionBottomRight: 'editorPositionBottomRight',
161
- editorPositionTopLeft: 'editorPositionTopLeft',
162
- editorPositionTopRight: 'editorPositionTopRight',
163
- editorRedo: 'editor_redo',
164
- editorStrike: 'editor_strike',
165
- editorTable: 'editor_table',
166
- editorUnderline: 'editor_underline',
167
- editorUndo: 'editor_undo',
168
- editorUnorderedList: 'editor_unordered_list',
169
- email: 'email',
170
- empty: 'empty',
171
- emsApp: 'app_ems',
172
- eql: 'eql',
173
- eraser: 'eraser',
174
- exit: 'exit',
175
- expand: 'expand',
176
- expandMini: 'expandMini',
177
- exportAction: 'export',
178
- eye: 'eye',
179
- eyeClosed: 'eye_closed',
180
- faceHappy: 'face_happy',
181
- faceNeutral: 'face_neutral',
182
- faceSad: 'face_sad',
183
- filebeatApp: 'app_filebeat',
184
- filter: 'filter',
185
- flag: 'flag',
186
- fleetApp: 'app_agent',
187
- fold: 'fold',
188
- folderCheck: 'folder_check',
189
- folderClosed: 'folder_closed',
190
- folderExclamation: 'folder_exclamation',
191
- folderOpen: 'folder_open',
192
- frameNext: 'frameNext',
193
- framePrevious: 'framePrevious',
194
- fullScreen: 'full_screen',
195
- fullScreenExit: 'fullScreenExit',
196
- function: 'function',
197
- gear: 'gear',
198
- gisApp: 'app_gis',
199
- glasses: 'glasses',
200
- globe: 'globe',
201
- grab: 'grab',
202
- grabHorizontal: 'grab_horizontal',
203
- graphApp: 'app_graph',
204
- grid: 'grid',
205
- grokApp: 'app_grok',
206
- heart: 'heart',
207
- heartbeatApp: 'app_heartbeat',
208
- heatmap: 'heatmap',
209
- help: 'help',
210
- home: 'home',
211
- iInCircle: 'iInCircle',
212
- image: 'image',
213
- importAction: 'import',
214
- indexClose: 'index_close',
215
- indexEdit: 'index_edit',
216
- indexFlush: 'index_flush',
217
- indexManagementApp: 'app_index_management',
218
- indexMapping: 'index_mapping',
219
- indexOpen: 'index_open',
220
- indexPatternApp: 'app_index_pattern',
221
- indexRollupApp: 'app_index_rollup',
222
- indexRuntime: 'index_runtime',
223
- indexSettings: 'index_settings',
224
- inputOutput: 'inputOutput',
225
- inspect: 'inspect',
226
- invert: 'invert',
227
- ip: 'ip',
228
- keyboardShortcut: 'keyboard_shortcut',
229
- kqlField: 'kql_field',
230
- kqlFunction: 'kql_function',
231
- kqlOperand: 'kql_operand',
232
- kqlSelector: 'kql_selector',
233
- kqlValue: 'kql_value',
234
- layers: 'layers',
235
- lensApp: 'app_lens',
236
- lettering: 'lettering',
237
- lineDashed: 'lineDashed',
238
- lineDotted: 'lineDotted',
239
- lineSolid: 'lineSolid',
240
- link: 'link',
241
- list: 'list',
242
- listAdd: 'list_add',
243
- lock: 'lock',
244
- lockOpen: 'lockOpen',
245
- logoAWS: 'logo_aws',
246
- logoAWSMono: 'logo_aws_mono',
247
- logoAerospike: 'logo_aerospike',
248
- logoApache: 'logo_apache',
249
- logoAppSearch: 'logo_app_search',
250
- logoAzure: 'logo_azure',
251
- logoAzureMono: 'logo_azure_mono',
252
- logoBeats: 'logo_beats',
253
- logoBusinessAnalytics: 'logo_business_analytics',
254
- logoCeph: 'logo_ceph',
255
- logoCloud: 'logo_cloud',
256
- logoCloudEnterprise: 'logo_cloud_ece',
257
- logoCode: 'logo_code',
258
- logoCodesandbox: 'logo_codesandbox',
259
- logoCouchbase: 'logo_couchbase',
260
- logoDocker: 'logo_docker',
261
- logoDropwizard: 'logo_dropwizard',
262
- logoElastic: 'logo_elastic',
263
- logoElasticStack: 'logo_elastic_stack',
264
- logoElasticsearch: 'logo_elasticsearch',
265
- logoEnterpriseSearch: 'logo_enterprise_search',
266
- logoEtcd: 'logo_etcd',
267
- logoGCP: 'logo_gcp',
268
- logoGCPMono: 'logo_gcp_mono',
269
- logoGithub: 'logo_github',
270
- logoGmail: 'logo_gmail',
271
- logoGolang: 'logo_golang',
272
- logoGoogleG: 'logo_google_g',
273
- logoHAproxy: 'logo_haproxy',
274
- logoIBM: 'logo_ibm',
275
- logoIBMMono: 'logo_ibm_mono',
276
- logoKafka: 'logo_kafka',
277
- logoKibana: 'logo_kibana',
278
- logoKubernetes: 'logo_kubernetes',
279
- logoLogging: 'logo_logging',
280
- logoLogstash: 'logo_logstash',
281
- logoMaps: 'logo_maps',
282
- logoMemcached: 'logo_memcached',
283
- logoMetrics: 'logo_metrics',
284
- logoMongodb: 'logo_mongodb',
285
- logoMySQL: 'logo_mysql',
286
- logoNginx: 'logo_nginx',
287
- logoObservability: 'logo_observability',
288
- logoOsquery: 'logo_osquery',
289
- logoPhp: 'logo_php',
290
- logoPostgres: 'logo_postgres',
291
- logoPrometheus: 'logo_prometheus',
292
- logoRabbitmq: 'logo_rabbitmq',
293
- logoRedis: 'logo_redis',
294
- logoSecurity: 'logo_security',
295
- logoSiteSearch: 'logo_site_search',
296
- logoSketch: 'logo_sketch',
297
- logoSlack: 'logo_slack',
298
- logoUptime: 'logo_uptime',
299
- logoWebhook: 'logo_webhook',
300
- logoWindows: 'logo_windows',
301
- logoWorkplaceSearch: 'logo_workplace_search',
302
- logsApp: 'app_logs',
303
- logstashFilter: 'logstash_filter',
304
- logstashIf: 'logstash_if',
305
- logstashInput: 'logstash_input',
306
- logstashOutput: 'logstash_output',
307
- logstashQueue: 'logstash_queue',
308
- machineLearningApp: 'app_ml',
309
- magnet: 'magnet',
310
- magnifyWithExclamation: 'magnifyWithExclamation',
311
- magnifyWithMinus: 'magnifyWithMinus',
312
- magnifyWithPlus: 'magnifyWithPlus',
313
- managementApp: 'app_management',
314
- mapMarker: 'map_marker',
315
- memory: 'memory',
316
- menu: 'menu',
317
- menuDown: 'menuDown',
318
- menuLeft: 'menuLeft',
319
- menuRight: 'menuRight',
320
- menuUp: 'menuUp',
321
- merge: 'merge',
322
- metricbeatApp: 'app_metricbeat',
323
- metricsApp: 'app_metrics',
324
- minimize: 'minimize',
325
- minus: 'minus',
326
- minusInCircle: 'minus_in_circle',
327
- minusInCircleFilled: 'minus_in_circle_filled',
328
- mobile: 'mobile',
329
- monitoringApp: 'app_monitoring',
330
- moon: 'moon',
331
- nested: 'nested',
332
- node: 'node',
333
- notebookApp: 'app_notebook',
334
- number: 'number',
335
- offline: 'offline',
336
- online: 'online',
337
- outlierDetectionJob: 'ml_outlier_detection_job',
338
- package: 'package',
339
- packetbeatApp: 'app_packetbeat',
340
- pageSelect: 'pageSelect',
341
- pagesSelect: 'pagesSelect',
342
- paperClip: 'paper_clip',
343
- partial: 'partial',
344
- pause: 'pause',
345
- payment: 'payment',
346
- pencil: 'pencil',
347
- percent: 'percent',
348
- pin: 'pin',
349
- pinFilled: 'pin_filled',
350
- pipelineApp: 'app_pipeline',
351
- play: 'play',
352
- playFilled: 'playFilled',
353
- plus: 'plus',
354
- plusInCircle: 'plus_in_circle',
355
- plusInCircleFilled: 'plus_in_circle_filled',
356
- popout: 'popout',
357
- push: 'push',
358
- questionInCircle: 'question_in_circle',
359
- quote: 'quote',
360
- recentlyViewedApp: 'app_recently_viewed',
361
- refresh: 'refresh',
362
- regressionJob: 'ml_regression_job',
363
- reporter: 'reporter',
364
- reportingApp: 'app_reporting',
365
- returnKey: 'return_key',
366
- save: 'save',
367
- savedObjectsApp: 'app_saved_objects',
368
- scale: 'scale',
369
- search: 'search',
370
- searchProfilerApp: 'app_search_profiler',
371
- securityAnalyticsApp: 'app_security_analytics',
372
- securityApp: 'app_security',
373
- securitySignal: 'securitySignal',
374
- securitySignalDetected: 'securitySignalDetected',
375
- securitySignalResolved: 'securitySignalResolved',
376
- sessionViewer: 'sessionViewer',
377
- shard: 'shard',
378
- share: 'share',
379
- snowflake: 'snowflake',
380
- sortDown: 'sort_down',
381
- sortLeft: 'sortLeft',
382
- sortRight: 'sortRight',
383
- sortUp: 'sort_up',
384
- sortable: 'sortable',
385
- spacesApp: 'app_spaces',
386
- sqlApp: 'app_sql',
387
- starEmpty: 'star_empty',
388
- starEmptySpace: 'star_empty_space',
389
- starFilled: 'star_filled',
390
- starFilledSpace: 'star_filled_space',
391
- starMinusEmpty: 'star_minus_empty',
392
- starMinusFilled: 'star_minus_filled',
393
- starPlusEmpty: 'starPlusEmpty',
394
- starPlusFilled: 'starPlusFilled',
395
- stats: 'stats',
396
- stop: 'stop',
397
- stopFilled: 'stop_filled',
398
- stopSlash: 'stop_slash',
399
- storage: 'storage',
400
- string: 'string',
401
- submodule: 'submodule',
402
- sun: 'sun',
403
- swatchInput: 'swatch_input',
404
- // Undocumented on purpose. Has an extra stroke for EuiColorPicker
405
- symlink: 'symlink',
406
- tableDensityCompact: 'table_density_compact',
407
- tableDensityExpanded: 'table_density_expanded',
408
- tableDensityNormal: 'table_density_normal',
409
- tableOfContents: 'tableOfContents',
410
- tag: 'tag',
411
- tear: 'tear',
412
- temperature: 'temperature',
413
- timeline: 'timeline',
414
- timelionApp: 'app_timelion',
415
- timeRefresh: 'timeRefresh',
416
- timeslider: 'timeslider',
417
- training: 'training',
418
- trash: 'trash',
419
- unfold: 'unfold',
420
- unlink: 'unlink',
421
- upgradeAssistantApp: 'app_upgrade_assistant',
422
- uptimeApp: 'app_uptime',
423
- user: 'user',
424
- userAvatar: 'userAvatar',
425
- users: 'users',
426
- usersRolesApp: 'app_users_roles',
427
- vector: 'vector',
428
- videoPlayer: 'videoPlayer',
429
- visArea: 'vis_area',
430
- visAreaStacked: 'vis_area_stacked',
431
- visBarHorizontal: 'vis_bar_horizontal',
432
- visBarHorizontalStacked: 'vis_bar_horizontal_stacked',
433
- visBarVertical: 'vis_bar_vertical',
434
- visBarVerticalStacked: 'vis_bar_vertical_stacked',
435
- visGauge: 'vis_gauge',
436
- visGoal: 'vis_goal',
437
- visLine: 'vis_line',
438
- visMapCoordinate: 'vis_map_coordinate',
439
- visMapRegion: 'vis_map_region',
440
- visMetric: 'vis_metric',
441
- visPie: 'vis_pie',
442
- visTable: 'vis_table',
443
- visTagCloud: 'vis_tag_cloud',
444
- visText: 'vis_text',
445
- visTimelion: 'vis_timelion',
446
- visVega: 'vis_vega',
447
- visVisualBuilder: 'vis_visual_builder',
448
- visualizeApp: 'app_visualize',
449
- watchesApp: 'app_watches',
450
- wordWrap: 'wordWrap',
451
- wordWrapDisabled: 'wordWrapDisabled',
452
- workplaceSearchApp: 'app_workplace_search',
453
- wrench: 'wrench',
454
- // Token Icon Imports
455
- tokenClass: 'tokenClass',
456
- tokenProperty: 'tokenProperty',
457
- tokenEnum: 'tokenEnum',
458
- tokenVariable: 'tokenVariable',
459
- tokenMethod: 'tokenMethod',
460
- tokenAnnotation: 'tokenAnnotation',
461
- tokenException: 'tokenException',
462
- tokenInterface: 'tokenInterface',
463
- tokenParameter: 'tokenParameter',
464
- tokenField: 'tokenField',
465
- tokenElement: 'tokenElement',
466
- tokenFunction: 'tokenFunction',
467
- tokenBoolean: 'tokenBoolean',
468
- tokenString: 'tokenString',
469
- tokenArray: 'tokenArray',
470
- tokenNumber: 'tokenNumber',
471
- tokenConstant: 'tokenConstant',
472
- tokenObject: 'tokenObject',
473
- tokenEvent: 'tokenEvent',
474
- tokenKey: 'tokenKey',
475
- tokenNull: 'tokenNull',
476
- tokenStruct: 'tokenStruct',
477
- tokenPackage: 'tokenPackage',
478
- tokenOperator: 'tokenOperator',
479
- tokenEnumMember: 'tokenEnumMember',
480
- tokenRepo: 'tokenRepo',
481
- tokenSymbol: 'tokenSymbol',
482
- tokenFile: 'tokenFile',
483
- tokenModule: 'tokenModule',
484
- tokenNamespace: 'tokenNamespace',
485
- tokenDate: 'tokenDate',
486
- tokenIP: 'tokenIP',
487
- tokenNested: 'tokenNested',
488
- tokenAlias: 'tokenAlias',
489
- tokenShape: 'tokenShape',
490
- tokenGeo: 'tokenGeo',
491
- tokenRange: 'tokenRange',
492
- tokenBinary: 'tokenBinary',
493
- tokenJoin: 'tokenJoin',
494
- tokenPercolator: 'tokenPercolator',
495
- tokenFlattened: 'tokenFlattened',
496
- tokenRankFeature: 'tokenRankFeature',
497
- tokenRankFeatures: 'tokenRankFeatures',
498
- tokenKeyword: 'tokenKeyword',
499
- tokenTag: 'tokenTag',
500
- tokenCompletionSuggester: 'tokenCompletionSuggester',
501
- tokenDenseVector: 'tokenDenseVector',
502
- tokenText: 'tokenText',
503
- tokenTokenCount: 'tokenTokenCount',
504
- tokenSearchType: 'tokenSearchType',
505
- tokenHistogram: 'tokenHistogram'
506
- };
507
66
  export var TYPES = keysOf(typeToPathMap);
508
- export var COLORS = keysOf(colorToClassMap); // We accept arbitrary color strings, which are impossible to type.
509
-
510
- var sizeToClassNameMap = {
511
- original: null,
512
- s: 'euiIcon--small',
513
- m: 'euiIcon--medium',
514
- l: 'euiIcon--large',
515
- xl: 'euiIcon--xLarge',
516
- xxl: 'euiIcon--xxLarge'
517
- };
518
- export var SIZES = keysOf(sizeToClassNameMap);
67
+ export var SIZES = ['original', 's', 'm', 'l', 'xl', 'xxl'];
519
68
 
520
69
  function isEuiIconType(x) {
521
70
  return typeof x === 'string' && typeToPathMap.hasOwnProperty(x);
@@ -553,15 +102,15 @@ export var appendIconComponentCache = function appendIconComponentCache(iconType
553
102
  }
554
103
  }
555
104
  };
556
- export var EuiIcon = /*#__PURE__*/function (_PureComponent) {
557
- _inherits(EuiIcon, _PureComponent);
105
+ export var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
106
+ _inherits(EuiIconClass, _PureComponent);
558
107
 
559
- var _super = _createSuper(EuiIcon);
108
+ var _super = _createSuper(EuiIconClass);
560
109
 
561
- function EuiIcon(props) {
110
+ function EuiIconClass(props) {
562
111
  var _this;
563
112
 
564
- _classCallCheck(this, EuiIcon);
113
+ _classCallCheck(this, EuiIconClass);
565
114
 
566
115
  _this = _super.call(this, props);
567
116
 
@@ -620,7 +169,7 @@ export var EuiIcon = /*#__PURE__*/function (_PureComponent) {
620
169
  return _this;
621
170
  }
622
171
 
623
- _createClass(EuiIcon, [{
172
+ _createClass(EuiIconClass, [{
624
173
  key: "componentDidMount",
625
174
  value: function componentDidMount() {
626
175
  var type = this.props.type;
@@ -676,35 +225,29 @@ export var EuiIcon = /*#__PURE__*/function (_PureComponent) {
676
225
  tabIndex = _this$props.tabIndex,
677
226
  title = _this$props.title,
678
227
  onIconLoad = _this$props.onIconLoad,
228
+ theme = _this$props.theme,
229
+ style = _this$props.style,
679
230
  rest = _objectWithoutProperties(_this$props, _excluded);
680
231
 
681
232
  var _this$state = this.state,
682
233
  isLoading = _this$state.isLoading,
683
- neededLoading = _this$state.neededLoading;
684
- var optionalColorClass = null;
685
- var optionalCustomStyles = null;
234
+ neededLoading = _this$state.neededLoading,
235
+ iconTitle = _this$state.iconTitle;
236
+ var isLoaded = !isLoading && neededLoading;
237
+ var isCustomColor = color && !isNamedColor(color);
238
+ var optionalCustomStyles = isCustomColor ? _objectSpread({
239
+ color: color
240
+ }, style) : style; // These icons are a little special and get some extra CSS flexibility
686
241
 
687
- if (color) {
688
- if (isNamedColor(color)) {
689
- optionalColorClass = colorToClassMap[color];
690
- } else {
691
- optionalCustomStyles = {
692
- color: color
693
- };
694
- optionalColorClass = 'euiIcon--customColor';
695
- }
696
- } // These icons are a little special and get some extra CSS flexibility
242
+ var isAppIcon = getIsAppIcon(type); // App color styles are only applied if no color is passed or if color="default" is passed
697
243
 
244
+ var appIconHasColor = color && color !== 'default'; // The Elastic logo should be an outline in text and ghost mode
698
245
 
699
- var isAppIcon = getIsAppIcon(type);
700
- var appIconHasColor = color && color !== 'default'; // parent is not one of
246
+ var isElasticLogoOutline = type === 'logoElastic' && (color === 'ghost' || color === 'text');
247
+ var classes = classNames('euiIcon', className); // Emotion styles
701
248
 
702
- var classes = classNames('euiIcon', sizeToClassNameMap[size], optionalColorClass, {
703
- // The app icon only gets the .euiIcon--app class if no color is passed or if color="default" is passed
704
- 'euiIcon--app': isAppIcon && !appIconHasColor,
705
- 'euiIcon-isLoading': isLoading,
706
- 'euiIcon-isLoaded': !isLoading && neededLoading
707
- }, className);
249
+ var styles = euiIconStyles(theme);
250
+ var cssStyles = [styles.euiIcon, styles[size], color && isNamedColor(color) && styles[color], isCustomColor && styles.customColor, isElasticLogoOutline && styles.logoElasticOutline, isAppIcon && !appIconHasColor && styles.app, isLoading && styles.isLoading, !isLoading && neededLoading && styles.isLoaded];
708
251
  var icon = this.state.icon || empty; // This is a fix for IE and Edge, which ignores tabindex="-1" on an SVG, but respects
709
252
  // focusable="false".
710
253
  // - If there's no tabindex specified, we'll default the icon to not be focusable,
@@ -719,6 +262,7 @@ export var EuiIcon = /*#__PURE__*/function (_PureComponent) {
719
262
  alt: title ? title : '',
720
263
  src: icon,
721
264
  className: classes,
265
+ css: cssStyles,
722
266
  tabIndex: tabIndex
723
267
  }, rest));
724
268
  } else {
@@ -741,19 +285,22 @@ export var EuiIcon = /*#__PURE__*/function (_PureComponent) {
741
285
  return ___EmotionJSX(Svg, _extends({
742
286
  className: classes,
743
287
  style: optionalCustomStyles,
288
+ css: cssStyles,
744
289
  tabIndex: tabIndex,
745
290
  focusable: focusable,
746
291
  role: "img",
747
292
  title: title,
748
- "data-icon-type": this.state.iconTitle
293
+ "data-icon-type": iconTitle,
294
+ "data-is-loaded": isLoaded || undefined,
295
+ "data-is-loading": isLoading || undefined
749
296
  }, titleId, rest, hideIconEmpty));
750
297
  }
751
298
  }
752
299
  }]);
753
300
 
754
- return EuiIcon;
301
+ return EuiIconClass;
755
302
  }(PureComponent);
756
- EuiIcon.propTypes = {
303
+ EuiIconClass.propTypes = {
757
304
  className: PropTypes.string,
758
305
  "aria-label": PropTypes.string,
759
306
  "data-test-subj": PropTypes.string,
@@ -767,12 +314,12 @@ EuiIcon.propTypes = {
767
314
  * One of EUI's color palette or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value.
768
315
  * Note that coloring only works if your SVG is removed of fill attributes.
769
316
  */
770
- color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.oneOf(["default", "primary", "success", "accent", "warning", "danger", "text", "subdued", "ghost", "inherit"]).isRequired]),
317
+ color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
771
318
 
772
319
  /**
773
320
  * Note that every size other than `original` assumes the provided SVG sits on a square viewbox.
774
321
  */
775
- size: PropTypes.oneOf(["original", "s", "m", "l", "xl", "xxl"]),
322
+ size: PropTypes.any,
776
323
 
777
324
  /**
778
325
  * Descriptive title for naming the icon based on its use
@@ -793,4 +340,5 @@ EuiIcon.propTypes = {
793
340
  * Callback when the icon has been loaded & rendered
794
341
  */
795
342
  onIconLoad: PropTypes.func
796
- };
343
+ };
344
+ export var EuiIcon = withEuiTheme(EuiIconClass);