@elastic/eui 69.0.0 → 70.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.
- package/dist/eui_theme_dark.css +0 -554
- package/dist/eui_theme_dark.json +0 -27
- package/dist/eui_theme_dark.json.d.ts +0 -27
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -554
- package/dist/eui_theme_light.json +0 -27
- package/dist/eui_theme_light.json.d.ts +0 -27
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +6 -6
- package/es/components/basic_table/in_memory_table.js +16 -2
- package/es/components/button/button_display/_button_display.js +7 -6
- package/es/components/button/button_display/_button_display.styles.js +4 -4
- package/es/components/button/button_display/_button_display_content.js +6 -9
- package/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/es/components/code/code.js +7 -3
- package/es/components/code/code.styles.js +32 -0
- package/es/components/code/code_block.js +72 -315
- package/es/components/code/code_block.styles.js +153 -0
- package/es/components/code/code_block_controls.js +29 -0
- package/es/components/code/code_block_controls.styles.js +43 -0
- package/es/components/code/code_block_copy.js +65 -0
- package/es/components/code/code_block_full_screen.js +90 -0
- package/es/components/code/code_block_line.styles.js +49 -0
- package/es/components/code/code_block_overflow.js +78 -0
- package/es/components/code/code_block_virtualized.js +59 -0
- package/es/components/code/code_syntax.styles.js +43 -0
- package/es/components/code/utils.js +43 -37
- package/es/components/collapsible_nav/collapsible_nav.js +0 -5
- package/es/components/datagrid/controls/column_selector.js +1 -1
- package/es/components/datagrid/controls/column_sorting.js +1 -1
- package/es/components/header/header_links/header_links.js +6 -0
- package/es/components/loading/loading_spinner.js +14 -3
- package/es/components/loading/loading_spinner.styles.js +11 -7
- package/es/components/modal/modal.js +17 -2
- package/es/components/overlay_mask/overlay_mask.js +8 -14
- package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/es/components/page_template/page_template.js +6 -9
- package/es/components/popover/popover.js +13 -3
- package/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/es/components/popover/popover_panel/_popover_panel.js +8 -2
- package/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/es/components/provider/provider.js +1 -5
- package/es/components/resizable_container/helpers.js +2 -2
- package/es/components/resizable_container/resizable_container.js +6 -9
- package/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/es/components/resizable_container/resizable_panel.js +25 -48
- package/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/es/components/search_bar/query/ast.js +14 -3
- package/es/components/search_bar/search_bar.js +39 -5
- package/es/components/search_bar/search_box.js +37 -4
- package/es/components/tabs/tab.js +33 -13
- package/es/components/tabs/tab.styles.js +50 -0
- package/es/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/es/components/tabs/tabs.js +20 -14
- package/es/components/tabs/tabs.styles.js +23 -0
- package/es/components/tool_tip/tool_tip.js +3 -2
- package/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/es/components/tool_tip/tool_tip_arrow.js +17 -3
- package/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/es/components/tour/tour.styles.js +4 -3
- package/es/components/tour/tour_step.js +13 -5
- package/es/global_styling/functions/logicals.js +5 -3
- package/es/global_styling/functions/math.js +37 -19
- package/es/global_styling/mixins/_padding.js +13 -9
- package/eui.d.ts +401 -84
- package/i18ntokens.json +26 -26
- package/lib/components/badge/beta_badge/beta_badge.js +6 -10
- package/lib/components/basic_table/in_memory_table.js +16 -2
- package/lib/components/button/button_display/_button_display.js +7 -6
- package/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/lib/components/button/button_display/_button_display_content.js +6 -9
- package/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/lib/components/code/code.js +9 -3
- package/lib/components/code/code.styles.js +35 -0
- package/lib/components/code/code_block.js +72 -320
- package/lib/components/code/code_block.styles.js +154 -0
- package/lib/components/code/code_block_controls.js +48 -0
- package/lib/components/code/code_block_controls.styles.js +39 -0
- package/lib/components/code/code_block_copy.js +78 -0
- package/lib/components/code/code_block_full_screen.js +108 -0
- package/lib/components/code/code_block_line.styles.js +45 -0
- package/lib/components/code/code_block_overflow.js +82 -0
- package/lib/components/code/code_block_virtualized.js +72 -0
- package/lib/components/code/code_syntax.styles.js +57 -0
- package/lib/components/code/utils.js +40 -39
- package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
- package/lib/components/datagrid/controls/column_selector.js +1 -1
- package/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/lib/components/header/header_links/header_links.js +6 -0
- package/lib/components/loading/loading_spinner.js +13 -2
- package/lib/components/loading/loading_spinner.styles.js +14 -6
- package/lib/components/modal/modal.js +23 -2
- package/lib/components/overlay_mask/overlay_mask.js +9 -14
- package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/lib/components/page_template/page_template.js +6 -9
- package/lib/components/popover/popover.js +13 -3
- package/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/lib/components/popover/popover_panel/_popover_panel.js +8 -2
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/lib/components/provider/provider.js +7 -12
- package/lib/components/resizable_container/helpers.js +2 -2
- package/lib/components/resizable_container/resizable_container.js +7 -9
- package/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/lib/components/resizable_container/resizable_panel.js +28 -49
- package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
- package/lib/components/search_bar/query/ast.js +14 -3
- package/lib/components/search_bar/search_bar.js +40 -5
- package/lib/components/search_bar/search_box.js +38 -4
- package/lib/components/tabs/tab.js +33 -12
- package/lib/components/tabs/tab.styles.js +56 -0
- package/lib/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/lib/components/tabs/tabs.js +24 -14
- package/lib/components/tabs/tabs.styles.js +34 -0
- package/lib/components/tool_tip/tool_tip.js +3 -2
- package/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
- package/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/lib/components/tour/tour.styles.js +3 -2
- package/lib/components/tour/tour_step.js +7 -5
- package/lib/global_styling/functions/logicals.js +5 -3
- package/lib/global_styling/functions/math.js +37 -19
- package/lib/global_styling/mixins/_padding.js +17 -10
- package/optimize/es/components/badge/beta_badge/beta_badge.js +6 -6
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/button/button_display/_button_display.js +6 -5
- package/optimize/es/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/es/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/optimize/es/components/code/code.js +7 -3
- package/optimize/es/components/code/code.styles.js +32 -0
- package/optimize/es/components/code/code_block.js +70 -299
- package/optimize/es/components/code/code_block.styles.js +153 -0
- package/optimize/es/components/code/code_block_controls.js +29 -0
- package/optimize/es/components/code/code_block_controls.styles.js +43 -0
- package/optimize/es/components/code/code_block_copy.js +55 -0
- package/optimize/es/components/code/code_block_full_screen.js +80 -0
- package/optimize/es/components/code/code_block_line.styles.js +49 -0
- package/optimize/es/components/code/code_block_overflow.js +67 -0
- package/optimize/es/components/code/code_block_virtualized.js +59 -0
- package/optimize/es/components/code/code_syntax.styles.js +43 -0
- package/optimize/es/components/code/utils.js +43 -37
- package/optimize/es/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/es/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/es/components/loading/loading_spinner.js +13 -3
- package/optimize/es/components/loading/loading_spinner.styles.js +11 -7
- package/optimize/es/components/modal/modal.js +17 -2
- package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/optimize/es/components/page_template/page_template.js +6 -9
- package/optimize/es/components/popover/popover.js +7 -3
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/optimize/es/components/provider/provider.js +1 -5
- package/optimize/es/components/resizable_container/helpers.js +2 -2
- package/optimize/es/components/resizable_container/resizable_container.js +6 -9
- package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/optimize/es/components/search_bar/query/ast.js +14 -3
- package/optimize/es/components/search_bar/search_bar.js +31 -5
- package/optimize/es/components/search_bar/search_box.js +29 -3
- package/optimize/es/components/tabs/tab.js +21 -13
- package/optimize/es/components/tabs/tab.styles.js +50 -0
- package/optimize/es/components/tabs/tabs.js +20 -14
- package/optimize/es/components/tabs/tabs.styles.js +23 -0
- package/optimize/es/components/tool_tip/tool_tip.js +3 -2
- package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
- package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/optimize/es/components/tour/tour.styles.js +4 -3
- package/optimize/es/components/tour/tour_step.js +7 -5
- package/optimize/es/global_styling/functions/logicals.js +5 -3
- package/optimize/es/global_styling/functions/math.js +35 -17
- package/optimize/es/global_styling/mixins/_padding.js +13 -9
- package/optimize/lib/components/badge/beta_badge/beta_badge.js +6 -13
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/button/button_display/_button_display.js +7 -6
- package/optimize/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/optimize/lib/components/code/code.js +9 -3
- package/optimize/lib/components/code/code.styles.js +35 -0
- package/optimize/lib/components/code/code_block.js +71 -306
- package/optimize/lib/components/code/code_block.styles.js +156 -0
- package/optimize/lib/components/code/code_block_controls.js +48 -0
- package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
- package/optimize/lib/components/code/code_block_copy.js +78 -0
- package/optimize/lib/components/code/code_block_full_screen.js +108 -0
- package/optimize/lib/components/code/code_block_line.styles.js +45 -0
- package/optimize/lib/components/code/code_block_overflow.js +82 -0
- package/optimize/lib/components/code/code_block_virtualized.js +81 -0
- package/optimize/lib/components/code/code_syntax.styles.js +57 -0
- package/optimize/lib/components/code/utils.js +40 -37
- package/optimize/lib/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/lib/components/loading/loading_spinner.js +14 -2
- package/optimize/lib/components/loading/loading_spinner.styles.js +14 -6
- package/optimize/lib/components/modal/modal.js +22 -2
- package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/optimize/lib/components/page_template/page_template.js +6 -9
- package/optimize/lib/components/popover/popover.js +7 -3
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/optimize/lib/components/provider/provider.js +7 -12
- package/optimize/lib/components/resizable_container/helpers.js +2 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
- package/optimize/lib/components/search_bar/query/ast.js +14 -3
- package/optimize/lib/components/search_bar/search_bar.js +31 -5
- package/optimize/lib/components/search_bar/search_box.js +30 -3
- package/optimize/lib/components/tabs/tab.js +21 -12
- package/optimize/lib/components/tabs/tab.styles.js +56 -0
- package/optimize/lib/components/tabs/tabs.js +24 -14
- package/optimize/lib/components/tabs/tabs.styles.js +34 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/optimize/lib/components/tour/tour.styles.js +3 -2
- package/optimize/lib/components/tour/tour_step.js +7 -5
- package/optimize/lib/global_styling/functions/logicals.js +4 -10
- package/optimize/lib/global_styling/functions/math.js +37 -19
- package/optimize/lib/global_styling/mixins/_padding.js +17 -10
- package/package.json +10 -9
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -8
- package/src/components/index.scss +0 -2
- package/src/components/resizable_container/_index.scss +0 -2
- package/src/global_styling/mixins/_header.scss +1 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -2
- package/test-env/components/badge/beta_badge/beta_badge.js +6 -13
- package/test-env/components/basic_table/in_memory_table.js +16 -2
- package/test-env/components/button/button_display/_button_display.js +7 -6
- package/test-env/components/button/button_display/_button_display.styles.js +4 -4
- package/test-env/components/button/button_display/_button_display_content.js +6 -9
- package/test-env/components/button/button_display/_button_display_content.styles.js +10 -40
- package/test-env/components/code/code.styles.js +35 -0
- package/test-env/components/code/code_block.styles.js +156 -0
- package/test-env/components/code/code_block_controls.js +48 -0
- package/test-env/components/code/code_block_controls.styles.js +39 -0
- package/test-env/components/code/code_block_copy.js +78 -0
- package/test-env/components/code/code_block_full_screen.js +108 -0
- package/test-env/components/code/code_block_line.styles.js +45 -0
- package/test-env/components/code/code_block_overflow.js +82 -0
- package/test-env/components/code/code_block_virtualized.js +81 -0
- package/test-env/components/code/code_syntax.styles.js +57 -0
- package/test-env/components/code/utils.js +40 -37
- package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
- package/test-env/components/datagrid/controls/column_selector.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting.js +1 -1
- package/test-env/components/header/header_links/header_links.js +6 -0
- package/test-env/components/loading/loading_spinner.js +14 -2
- package/test-env/components/loading/loading_spinner.styles.js +14 -6
- package/test-env/components/modal/modal.js +22 -2
- package/test-env/components/overlay_mask/overlay_mask.js +9 -14
- package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/test-env/components/page_template/page_template.js +6 -9
- package/test-env/components/popover/popover.js +13 -3
- package/test-env/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/test-env/components/popover/popover_panel/_popover_panel.js +8 -2
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/test-env/components/provider/provider.js +7 -12
- package/test-env/components/resizable_container/helpers.js +2 -2
- package/test-env/components/resizable_container/resizable_container.js +7 -9
- package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
- package/test-env/components/resizable_container/resizable_panel.js +28 -49
- package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
- package/test-env/components/search_bar/query/ast.js +14 -3
- package/test-env/components/search_bar/search_bar.js +39 -5
- package/test-env/components/search_bar/search_box.js +38 -4
- package/test-env/components/tabs/tab.js +33 -12
- package/test-env/components/tabs/tab.styles.js +56 -0
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/test-env/components/tabs/tabs.js +24 -14
- package/test-env/components/tabs/tabs.styles.js +34 -0
- package/test-env/components/tool_tip/tool_tip.js +3 -2
- package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
- package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
- package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
- package/test-env/components/tour/tour.styles.js +3 -2
- package/test-env/components/tour/tour_step.js +7 -5
- package/test-env/global_styling/functions/logicals.js +4 -10
- package/test-env/global_styling/functions/math.js +37 -19
- package/test-env/global_styling/mixins/_padding.js +17 -10
- package/src/components/code/_code.scss +0 -15
- package/src/components/code/_code_block.scss +0 -177
- package/src/components/code/_index.scss +0 -4
- package/src/components/code/_mixins.scss +0 -127
- package/src/components/code/_variables.scss +0 -5
- package/src/components/resizable_container/_resizable_container.scss +0 -8
- package/src/components/resizable_container/_resizable_panel.scss +0 -51
- package/src/components/tabs/_index.scss +0 -1
- package/src/components/tabs/_tabs.scss +0 -110
- package/src/global_styling/variables/_colors_code.scss +0 -23
- package/src/themes/amsterdam/overrides/_code.scss +0 -9
- package/src/themes/amsterdam/overrides/_tabs.scss +0 -80
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
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)."; }
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
import { css } from '@emotion/react';
|
|
17
|
+
import { logicalCSS, logicalCSSWithFallback, euiScrollBarStyles, euiPaddingSizeCSS } from '../../global_styling';
|
|
18
|
+
|
|
19
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
20
|
+
name: "11qmbh3-collapsed",
|
|
21
|
+
styles: "overflow:hidden;label:collapsed;"
|
|
22
|
+
} : {
|
|
23
|
+
name: "11qmbh3-collapsed",
|
|
24
|
+
styles: "overflow:hidden;label:collapsed;",
|
|
25
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
29
|
+
name: "15ifdgc-euiResizablePanel",
|
|
30
|
+
styles: "position:relative;label:euiResizablePanel;"
|
|
31
|
+
} : {
|
|
32
|
+
name: "15ifdgc-euiResizablePanel",
|
|
33
|
+
styles: "position:relative;label:euiResizablePanel;",
|
|
34
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export var euiResizablePanelStyles = function euiResizablePanelStyles(euiThemeContext) {
|
|
38
|
+
return {
|
|
39
|
+
euiResizablePanel: _ref3,
|
|
40
|
+
collapsed: _ref2,
|
|
41
|
+
paddingSizes: _objectSpread({}, euiPaddingSizeCSS(euiThemeContext))
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
46
|
+
name: "597kt8-collapsedChildren",
|
|
47
|
+
styles: "*{display:none;};label:collapsedChildren;"
|
|
48
|
+
} : {
|
|
49
|
+
name: "597kt8-collapsedChildren",
|
|
50
|
+
styles: "*{display:none;};label:collapsedChildren;",
|
|
51
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export var euiResizablePanelContentStyles = function euiResizablePanelContentStyles(euiThemeContext) {
|
|
55
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
56
|
+
return {
|
|
57
|
+
euiResizablePanel__content: /*#__PURE__*/css(logicalCSS('height', '100%'), ";;label:euiResizablePanel__content;"),
|
|
58
|
+
scrollable: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " ", logicalCSSWithFallback('overflow-y', 'auto'), ";;label:scrollable;"),
|
|
59
|
+
collapsedChildren: _ref,
|
|
60
|
+
horizontal: {
|
|
61
|
+
collapsed: /*#__PURE__*/css(logicalCSS('min-width', '0 !important'), ";;label:collapsed;"),
|
|
62
|
+
hasCollapsibleButton: /*#__PURE__*/css(logicalCSS('min-width', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
63
|
+
},
|
|
64
|
+
vertical: {
|
|
65
|
+
collapsed: /*#__PURE__*/css(logicalCSS('min-height', '0 !important'), ";;label:collapsed;"),
|
|
66
|
+
hasCollapsibleButton: /*#__PURE__*/css(logicalCSS('min-height', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -283,6 +283,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
283
283
|
return valuesEqual(item, value);
|
|
284
284
|
});
|
|
285
285
|
};
|
|
286
|
+
|
|
287
|
+
var mustToMatch = function mustToMatch(must) {
|
|
288
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
289
|
+
};
|
|
286
290
|
/**
|
|
287
291
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
288
292
|
*
|
|
@@ -407,9 +411,16 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
407
411
|
}
|
|
408
412
|
}, {
|
|
409
413
|
key: "getOrFieldClause",
|
|
410
|
-
value: function getOrFieldClause(field, value) {
|
|
414
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
411
415
|
return this.getFieldClause(field, function (clause) {
|
|
412
|
-
|
|
416
|
+
if (!isArray(clause.value)) {
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
var matchValue = isNil(value) || arrayIncludesValue(clause.value, value);
|
|
421
|
+
var matchMust = isNil(must) || mustToMatch(must) === clause.match;
|
|
422
|
+
var matchOperator = isNil(operator) || operator === clause.operator;
|
|
423
|
+
return matchValue && matchMust && matchOperator;
|
|
413
424
|
});
|
|
414
425
|
}
|
|
415
426
|
}, {
|
|
@@ -417,7 +428,7 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
417
428
|
value: function addOrFieldValue(field, value) {
|
|
418
429
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
419
430
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
420
|
-
var existingClause = this.getOrFieldClause(field);
|
|
431
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
421
432
|
|
|
422
433
|
if (!existingClause) {
|
|
423
434
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -2,6 +2,10 @@ var _excluded = ["schema"];
|
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
5
9
|
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; }
|
|
6
10
|
|
|
7
11
|
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; }
|
|
@@ -40,6 +44,7 @@ import PropTypes from "prop-types";
|
|
|
40
44
|
* Side Public License, v 1.
|
|
41
45
|
*/
|
|
42
46
|
import React, { Component } from 'react';
|
|
47
|
+
import { htmlIdGenerator } from '../../services/accessibility';
|
|
43
48
|
import { isString } from '../../services/predicate';
|
|
44
49
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
45
50
|
import { EuiSearchBox } from './search_box';
|
|
@@ -80,6 +85,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
80
85
|
|
|
81
86
|
_this = _super.call(this, props);
|
|
82
87
|
|
|
88
|
+
_defineProperty(_assertThisInitialized(_this), "hintId", htmlIdGenerator('__hint')());
|
|
89
|
+
|
|
83
90
|
_defineProperty(_assertThisInitialized(_this), "onSearch", function (queryText) {
|
|
84
91
|
try {
|
|
85
92
|
var query = parseQuery(queryText, _this.props);
|
|
@@ -136,7 +143,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
136
143
|
_this.state = {
|
|
137
144
|
query: _query,
|
|
138
145
|
queryText: _query.text,
|
|
139
|
-
error: null
|
|
146
|
+
error: null,
|
|
147
|
+
isHintVisible: false
|
|
140
148
|
};
|
|
141
149
|
return _this;
|
|
142
150
|
}
|
|
@@ -198,10 +206,15 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
198
206
|
}, {
|
|
199
207
|
key: "render",
|
|
200
208
|
value: function render() {
|
|
209
|
+
var _hint$popoverProps$is,
|
|
210
|
+
_hint$popoverProps,
|
|
211
|
+
_this2 = this;
|
|
212
|
+
|
|
201
213
|
var _this$state = this.state,
|
|
202
214
|
query = _this$state.query,
|
|
203
215
|
queryText = _this$state.queryText,
|
|
204
|
-
error = _this$state.error
|
|
216
|
+
error = _this$state.error,
|
|
217
|
+
isHintVisibleState = _this$state.isHintVisible;
|
|
205
218
|
var _this$props = this.props,
|
|
206
219
|
_this$props$box = _this$props.box;
|
|
207
220
|
_this$props$box = _this$props$box === void 0 ? {
|
|
@@ -212,7 +225,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
212
225
|
box = _objectWithoutProperties(_this$props$box, _excluded),
|
|
213
226
|
filters = _this$props.filters,
|
|
214
227
|
toolsLeft = _this$props.toolsLeft,
|
|
215
|
-
toolsRight = _this$props.toolsRight
|
|
228
|
+
toolsRight = _this$props.toolsRight,
|
|
229
|
+
hint = _this$props.hint;
|
|
216
230
|
|
|
217
231
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
218
232
|
var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
|
|
@@ -224,6 +238,7 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
224
238
|
onChange: this.onFiltersChange
|
|
225
239
|
}));
|
|
226
240
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
241
|
+
var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 ? void 0 : (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
|
|
227
242
|
return ___EmotionJSX(EuiFlexGroup, {
|
|
228
243
|
gutterSize: "m",
|
|
229
244
|
alignItems: "center",
|
|
@@ -235,7 +250,17 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
235
250
|
query: queryText,
|
|
236
251
|
onSearch: this.onSearch,
|
|
237
252
|
isInvalid: error != null,
|
|
238
|
-
title: error ? error.message : undefined
|
|
253
|
+
title: error ? error.message : undefined,
|
|
254
|
+
"aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
|
|
255
|
+
hint: hint ? _objectSpread({
|
|
256
|
+
isVisible: isHintVisible,
|
|
257
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
258
|
+
_this2.setState({
|
|
259
|
+
isHintVisible: isVisible
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
id: this.hintId
|
|
263
|
+
}, hint) : undefined
|
|
239
264
|
}))), filtersBar, toolsRightEl);
|
|
240
265
|
}
|
|
241
266
|
}], [{
|
|
@@ -246,7 +271,8 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
246
271
|
return {
|
|
247
272
|
query: query,
|
|
248
273
|
queryText: query.text,
|
|
249
|
-
error: null
|
|
274
|
+
error: null,
|
|
275
|
+
isHintVisible: prevState.isHintVisible
|
|
250
276
|
};
|
|
251
277
|
}
|
|
252
278
|
|
|
@@ -438,6 +464,14 @@ EuiSearchBar.propTypes = {
|
|
|
438
464
|
* Date formatter to use when parsing date values
|
|
439
465
|
*/
|
|
440
466
|
dateFormat: PropTypes.any,
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Hint to render below the search bar
|
|
470
|
+
*/
|
|
471
|
+
hint: PropTypes.shape({
|
|
472
|
+
content: PropTypes.node.isRequired,
|
|
473
|
+
popoverProps: PropTypes.any
|
|
474
|
+
}),
|
|
441
475
|
className: PropTypes.string,
|
|
442
476
|
"aria-label": PropTypes.string,
|
|
443
477
|
"data-test-subj": PropTypes.string,
|
|
@@ -1,6 +1,6 @@
|
|
|
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 = ["query", "incremental"];
|
|
3
|
+
var _excluded = ["query", "incremental", "hint"];
|
|
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
|
|
|
@@ -40,6 +40,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
40
40
|
import React, { Component } from 'react';
|
|
41
41
|
import PropTypes from "prop-types";
|
|
42
42
|
import { EuiFieldSearch } from '../form';
|
|
43
|
+
import { EuiInputPopover } from '../popover';
|
|
43
44
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
44
45
|
export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
45
46
|
_inherits(EuiSearchBox, _Component);
|
|
@@ -78,6 +79,7 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
var _this$props = this.props,
|
|
79
80
|
query = _this$props.query,
|
|
80
81
|
incremental = _this$props.incremental,
|
|
82
|
+
hint = _this$props.hint,
|
|
81
83
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
82
84
|
|
|
83
85
|
var ariaLabel;
|
|
@@ -88,15 +90,39 @@ export var EuiSearchBox = /*#__PURE__*/function (_Component) {
|
|
|
88
90
|
ariaLabel = 'This is a search bar. After typing your query, hit enter to filter the results lower in the page.';
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
var search = ___EmotionJSX(EuiFieldSearch, _extends({
|
|
92
94
|
inputRef: function inputRef(input) {
|
|
93
95
|
return _this2.inputElement = input;
|
|
94
96
|
},
|
|
95
97
|
fullWidth: true,
|
|
96
98
|
defaultValue: query,
|
|
97
99
|
incremental: incremental,
|
|
98
|
-
"aria-label": ariaLabel
|
|
100
|
+
"aria-label": ariaLabel,
|
|
101
|
+
onFocus: function onFocus() {
|
|
102
|
+
hint === null || hint === void 0 ? void 0 : hint.setIsVisible(true);
|
|
103
|
+
}
|
|
99
104
|
}, rest));
|
|
105
|
+
|
|
106
|
+
if (hint) {
|
|
107
|
+
return ___EmotionJSX(EuiInputPopover, _extends({
|
|
108
|
+
disableFocusTrap: true,
|
|
109
|
+
input: search,
|
|
110
|
+
isOpen: hint.isVisible,
|
|
111
|
+
fullWidth: true,
|
|
112
|
+
closePopover: function closePopover() {
|
|
113
|
+
hint.setIsVisible(false);
|
|
114
|
+
},
|
|
115
|
+
panelProps: {
|
|
116
|
+
'aria-live': undefined,
|
|
117
|
+
'aria-modal': undefined,
|
|
118
|
+
role: undefined,
|
|
119
|
+
tabIndex: -1,
|
|
120
|
+
id: hint.id
|
|
121
|
+
}
|
|
122
|
+
}, hint.popoverProps), hint.content);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return search;
|
|
100
126
|
}
|
|
101
127
|
}]);
|
|
102
128
|
|
|
@@ -111,5 +137,12 @@ _defineProperty(EuiSearchBox, "defaultProps", {
|
|
|
111
137
|
EuiSearchBox.propTypes = {
|
|
112
138
|
query: PropTypes.string.isRequired,
|
|
113
139
|
// This is optional in EuiFieldSearchProps
|
|
114
|
-
onSearch: PropTypes.func.isRequired
|
|
140
|
+
onSearch: PropTypes.func.isRequired,
|
|
141
|
+
hint: PropTypes.shape({
|
|
142
|
+
id: PropTypes.string.isRequired,
|
|
143
|
+
isVisible: PropTypes.bool.isRequired,
|
|
144
|
+
setIsVisible: PropTypes.func.isRequired,
|
|
145
|
+
content: PropTypes.node.isRequired,
|
|
146
|
+
popoverProps: PropTypes.any
|
|
147
|
+
})
|
|
115
148
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"];
|
|
1
|
+
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append", "size", "expand"];
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
@@ -16,8 +16,9 @@ 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 { getSecureRelForTarget } from '../../services';
|
|
19
|
+
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
20
20
|
import { validateHref } from '../../services/security/href_validator';
|
|
21
|
+
import { euiTabStyles, euiTabContentStyles } from './tab.styles';
|
|
21
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
23
|
export var EuiTab = function EuiTab(_ref) {
|
|
23
24
|
var isSelected = _ref.isSelected,
|
|
@@ -29,22 +30,25 @@ export var EuiTab = function EuiTab(_ref) {
|
|
|
29
30
|
rel = _ref.rel,
|
|
30
31
|
prepend = _ref.prepend,
|
|
31
32
|
append = _ref.append,
|
|
33
|
+
size = _ref.size,
|
|
34
|
+
expand = _ref.expand,
|
|
32
35
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
36
|
|
|
37
|
+
var euiTheme = useEuiTheme();
|
|
34
38
|
var isHrefValid = !href || validateHref(href);
|
|
35
|
-
var disabled = _disabled || !isHrefValid;
|
|
39
|
+
var disabled = _disabled || !isHrefValid; // Keep CSS classnames for reference
|
|
40
|
+
|
|
36
41
|
var classes = classNames('euiTab', className, {
|
|
37
|
-
'euiTab-isSelected': isSelected
|
|
38
|
-
'euiTab-isDisabled': disabled
|
|
42
|
+
'euiTab-isSelected': isSelected
|
|
39
43
|
});
|
|
44
|
+
var tabStyles = euiTabStyles(euiTheme);
|
|
45
|
+
var cssTabStyles = [tabStyles.euiTab, expand && tabStyles.expanded, isSelected && tabStyles.selected, disabled && tabStyles.disabled, size && tabStyles[size]];
|
|
46
|
+
var tabContentStyles = euiTabContentStyles(euiTheme);
|
|
47
|
+
var cssTabContentStyles = [tabContentStyles.euiTab__content, size && tabContentStyles[size], isSelected && tabContentStyles.selected, disabled && tabContentStyles.disabled];
|
|
40
48
|
|
|
41
|
-
var prependNode = prepend && ___EmotionJSX("span",
|
|
42
|
-
className: "euiTab__prepend"
|
|
43
|
-
}, prepend);
|
|
49
|
+
var prependNode = prepend && ___EmotionJSX("span", null, prepend);
|
|
44
50
|
|
|
45
|
-
var appendNode = append && ___EmotionJSX("span",
|
|
46
|
-
className: "euiTab__append"
|
|
47
|
-
}, append); // <a> elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
|
|
51
|
+
var appendNode = append && ___EmotionJSX("span", null, append); // <a> elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
|
|
48
52
|
// this is a button and piggyback off its disabled styles.
|
|
49
53
|
|
|
50
54
|
|
|
@@ -58,11 +62,13 @@ export var EuiTab = function EuiTab(_ref) {
|
|
|
58
62
|
role: "tab",
|
|
59
63
|
"aria-selected": !!isSelected,
|
|
60
64
|
className: classes,
|
|
65
|
+
css: cssTabStyles,
|
|
61
66
|
href: href,
|
|
62
67
|
target: target,
|
|
63
68
|
rel: secureRel
|
|
64
69
|
}, rest), prependNode, ___EmotionJSX("span", {
|
|
65
|
-
className: "euiTab__content"
|
|
70
|
+
className: "euiTab__content",
|
|
71
|
+
css: cssTabContentStyles
|
|
66
72
|
}, children), appendNode);
|
|
67
73
|
}
|
|
68
74
|
|
|
@@ -71,9 +77,11 @@ export var EuiTab = function EuiTab(_ref) {
|
|
|
71
77
|
"aria-selected": !!isSelected,
|
|
72
78
|
type: "button",
|
|
73
79
|
className: classes,
|
|
80
|
+
css: cssTabStyles,
|
|
74
81
|
disabled: disabled
|
|
75
82
|
}, rest), prependNode, ___EmotionJSX("span", {
|
|
76
|
-
className: "euiTab__content"
|
|
83
|
+
className: "euiTab__content",
|
|
84
|
+
css: cssTabContentStyles
|
|
77
85
|
}, children), appendNode);
|
|
78
86
|
};
|
|
79
87
|
EuiTab.propTypes = {
|
|
@@ -101,6 +109,18 @@ EuiTab.propTypes = {
|
|
|
101
109
|
* Will be excluded from interactive effects.
|
|
102
110
|
*/
|
|
103
111
|
append: PropTypes.node,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Evenly stretches each tab to fill the
|
|
115
|
+
* horizontal space
|
|
116
|
+
*/
|
|
117
|
+
expand: PropTypes.bool,
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Sizes affect both font size and overall size.
|
|
121
|
+
* Only use the `xl` size when displayed as page titles.
|
|
122
|
+
*/
|
|
123
|
+
size: PropTypes.any,
|
|
104
124
|
className: PropTypes.string,
|
|
105
125
|
"aria-label": PropTypes.string,
|
|
106
126
|
"data-test-subj": PropTypes.string,
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { euiTitle } from '../title/title.styles';
|
|
12
|
+
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "10tso78-expanded",
|
|
15
|
+
styles: "flex-basis:0%;flex-grow:1;justify-content:center;label:expanded;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "10tso78-expanded",
|
|
18
|
+
styles: "flex-basis:0%;flex-grow:1;justify-content:center;label:expanded;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var euiTabStyles = function euiTabStyles(_ref2) {
|
|
23
|
+
var euiTheme = _ref2.euiTheme;
|
|
24
|
+
return {
|
|
25
|
+
euiTab: /*#__PURE__*/css("display:flex;cursor:pointer;flex-direction:row;align-items:center;font-weight:", euiTheme.font.weight.semiBold, ";gap:", euiTheme.size.s, ";&:focus{background-color:transparent;outline-offset:-", euiTheme.focus.width, ";};label:euiTab;"),
|
|
26
|
+
// sizes
|
|
27
|
+
s: /*#__PURE__*/css("padding:0 ", euiTheme.size.xs, ";;label:s;"),
|
|
28
|
+
m: /*#__PURE__*/css("padding:0 ", euiTheme.size.xs, ";;label:m;"),
|
|
29
|
+
l: /*#__PURE__*/css("padding:0 ", euiTheme.size.xs, ";;label:l;"),
|
|
30
|
+
xl: /*#__PURE__*/css("padding:", euiTheme.size.s, " ", euiTheme.size.xs, ";;label:xl;"),
|
|
31
|
+
// variations
|
|
32
|
+
expanded: _ref,
|
|
33
|
+
selected: /*#__PURE__*/css("box-shadow:inset 0 calc(", euiTheme.border.width.thick, " * -1) 0 ", euiTheme.colors.primary, ";;label:selected;"),
|
|
34
|
+
disabled: /*#__PURE__*/css("cursor:not-allowed;color:", euiTheme.colors.disabledText, ";.euiTab.euiTab__isSelected{box-shadow:inset 0 calc(", euiTheme.border.width.thick, " * -1) 0 ", euiTheme.colors.disabledText, ";};label:disabled;")
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export var euiTabContentStyles = function euiTabContentStyles(euiThemeContext) {
|
|
38
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
39
|
+
return {
|
|
40
|
+
euiTab__content: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";&:hover{text-decoration:none;};label:euiTab__content;"),
|
|
41
|
+
// sizes
|
|
42
|
+
s: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxxs'), ";line-height:", euiTheme.size.xl, ";;label:s;"),
|
|
43
|
+
m: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxs'), ";line-height:", euiTheme.size.xxl, ";;label:m;"),
|
|
44
|
+
l: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xs'), ";line-height:calc(", euiTheme.size.xl, " + ", euiTheme.size.s, ");;label:l;"),
|
|
45
|
+
xl: /*#__PURE__*/css(euiTitle(euiThemeContext, 's'), ";line-height:calc(", euiTheme.size.xxxl, " + ", euiTheme.size.s, ");;label:xl;"),
|
|
46
|
+
// variations
|
|
47
|
+
selected: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:selected;"),
|
|
48
|
+
disabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";&:hover{text-decoration:none;};label:disabled;")
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -239,6 +239,18 @@ EuiTabbedContent.propTypes = {
|
|
|
239
239
|
* Will be excluded from interactive effects.
|
|
240
240
|
*/
|
|
241
241
|
append: PropTypes.node,
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Evenly stretches each tab to fill the
|
|
245
|
+
* horizontal space
|
|
246
|
+
*/
|
|
247
|
+
expand: PropTypes.bool,
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Sizes affect both font size and overall size.
|
|
251
|
+
* Only use the `xl` size when displayed as page titles.
|
|
252
|
+
*/
|
|
253
|
+
size: PropTypes.any,
|
|
242
254
|
className: PropTypes.string,
|
|
243
255
|
"aria-label": PropTypes.string,
|
|
244
256
|
"data-test-subj": PropTypes.string,
|
|
@@ -257,6 +269,8 @@ EuiTabbedContent.propTypes = {
|
|
|
257
269
|
disabled: PropTypes.bool,
|
|
258
270
|
prepend: PropTypes.node,
|
|
259
271
|
append: PropTypes.node,
|
|
272
|
+
expand: PropTypes.bool,
|
|
273
|
+
size: PropTypes.any,
|
|
260
274
|
className: PropTypes.string,
|
|
261
275
|
"aria-label": PropTypes.string,
|
|
262
276
|
"data-test-subj": PropTypes.string,
|
|
@@ -276,6 +290,8 @@ EuiTabbedContent.propTypes = {
|
|
|
276
290
|
disabled: PropTypes.bool,
|
|
277
291
|
prepend: PropTypes.node,
|
|
278
292
|
append: PropTypes.node,
|
|
293
|
+
expand: PropTypes.bool,
|
|
294
|
+
size: PropTypes.any,
|
|
279
295
|
className: PropTypes.string,
|
|
280
296
|
"aria-label": PropTypes.string,
|
|
281
297
|
"data-test-subj": PropTypes.string,
|
|
@@ -15,15 +15,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
15
15
|
*/
|
|
16
16
|
import React, { forwardRef } from 'react';
|
|
17
17
|
import classNames from 'classnames';
|
|
18
|
-
import {
|
|
18
|
+
import { useEuiTheme } from '../../services';
|
|
19
|
+
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
20
|
+
import { euiTabsStyles } from './tabs.styles';
|
|
19
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
-
var
|
|
21
|
-
s: 'euiTabs--small',
|
|
22
|
-
m: null,
|
|
23
|
-
l: 'euiTabs--large',
|
|
24
|
-
xl: 'euiTabs--xlarge'
|
|
25
|
-
};
|
|
26
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
22
|
+
export var SIZES = ['s', 'm', 'l', 'xl'];
|
|
27
23
|
export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
28
24
|
var children = _ref.children,
|
|
29
25
|
className = _ref.className,
|
|
@@ -35,15 +31,25 @@ export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
31
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
36
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
33
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
var euiTheme = useEuiTheme();
|
|
35
|
+
var classes = classNames('euiTabs', className);
|
|
36
|
+
var tabsStyles = euiTabsStyles(euiTheme);
|
|
37
|
+
var computedStyles = [tabsStyles.euiTabs, tabsStyles[size], bottomBorder && tabsStyles.bottomBorder];
|
|
38
|
+
var tabItems = React.Children.map(children, function (child) {
|
|
39
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
40
|
+
return cloneElementWithCss(child, {
|
|
41
|
+
// we're passing the parent `size` and `expand` down to the children
|
|
42
|
+
size: size,
|
|
43
|
+
expand: expand
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
42
47
|
return ___EmotionJSX("div", _extends({
|
|
43
48
|
ref: ref,
|
|
44
|
-
className: classes
|
|
49
|
+
className: classes,
|
|
50
|
+
css: computedStyles
|
|
45
51
|
}, children && {
|
|
46
52
|
role: 'tablist'
|
|
47
|
-
}, rest),
|
|
53
|
+
}, rest), tabItems);
|
|
48
54
|
});
|
|
49
55
|
EuiTabs.displayName = 'EuiTabs';
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import { logicalCSS, logicalCSSWithFallback, mathWithUnits } from '../../global_styling';
|
|
10
|
+
export var euiTabsStyles = function euiTabsStyles(euiThemeContext) {
|
|
11
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
12
|
+
return {
|
|
13
|
+
euiTabs: /*#__PURE__*/css("display:flex;", logicalCSS('max-width', '100%'), ";", logicalCSSWithFallback('overflow-x', 'auto'), ";", logicalCSSWithFallback('overflow-y', 'hidden'), ";position:relative;flex-shrink:0;;label:euiTabs;"),
|
|
14
|
+
bottomBorder: /*#__PURE__*/css("box-shadow:inset 0 ", mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
15
|
+
return x * -1;
|
|
16
|
+
}), " 0 ", euiTheme.border.color, ";;label:bottomBorder;"),
|
|
17
|
+
// sizes
|
|
18
|
+
s: /*#__PURE__*/css("gap:", euiTheme.size.m, ";;label:s;"),
|
|
19
|
+
m: /*#__PURE__*/css("gap:", euiTheme.size.base, ";;label:m;"),
|
|
20
|
+
l: /*#__PURE__*/css("gap:", euiTheme.size.l, ";;label:l;"),
|
|
21
|
+
xl: /*#__PURE__*/css("gap:", euiTheme.size.xl, ";;label:xl;")
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -280,7 +280,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
280
280
|
toolTipStyles = _this$state.toolTipStyles,
|
|
281
281
|
visible = _this$state.visible,
|
|
282
282
|
calculatedPosition = _this$state.calculatedPosition;
|
|
283
|
-
var classes = classNames('euiToolTip',
|
|
283
|
+
var classes = classNames('euiToolTip', className);
|
|
284
284
|
var anchorClasses = classNames(anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
|
|
285
285
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiToolTipAnchor, _extends({}, anchorProps, {
|
|
286
286
|
ref: this.setAnchorRef,
|
|
@@ -303,7 +303,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
303
303
|
calculatedPosition: calculatedPosition
|
|
304
304
|
}, rest), ___EmotionJSX(EuiToolTipArrow, {
|
|
305
305
|
style: arrowStyles,
|
|
306
|
-
className: "euiToolTip__arrow"
|
|
306
|
+
className: "euiToolTip__arrow",
|
|
307
|
+
position: calculatedPosition
|
|
307
308
|
}), ___EmotionJSX(EuiResizeObserver, {
|
|
308
309
|
onResize: this.positionToolTip
|
|
309
310
|
}, function (resizeRef) {
|
|
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
import { css, keyframes } from '@emotion/react';
|
|
15
|
-
import { logicalCSS, logicalSizeCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
15
|
+
import { logicalCSS, logicalSizeCSS, euiFontSize, euiCanAnimate, mathWithUnits } from '../../global_styling';
|
|
16
16
|
import { COLOR_MODES_STANDARD, tint, shade } from '../../services';
|
|
17
17
|
import { euiShadow } from '../../themes/amsterdam';
|
|
18
18
|
export var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
|
|
@@ -33,39 +33,34 @@ var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size)
|
|
|
33
33
|
export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
34
34
|
var euiTheme = euiThemeContext.euiTheme,
|
|
35
35
|
colorMode = euiThemeContext.colorMode;
|
|
36
|
-
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
|
|
37
|
-
/*
|
|
38
|
-
* 1. Shift arrow 1px more than half its size to account for border radius
|
|
39
|
-
*/
|
|
36
|
+
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards"); // Shift arrow 1px more than half its size to account for border radius
|
|
40
37
|
|
|
41
38
|
var arrowSize = euiTheme.size.m;
|
|
42
39
|
var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
|
|
43
40
|
return (x / 2 + 1) * -1;
|
|
44
|
-
});
|
|
45
|
-
|
|
41
|
+
});
|
|
46
42
|
var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
|
|
47
43
|
return (x / 2 - 1) * -1;
|
|
48
|
-
});
|
|
49
|
-
|
|
44
|
+
});
|
|
50
45
|
return {
|
|
51
46
|
// Base
|
|
52
47
|
euiToolTip: /*#__PURE__*/css(euiShadow(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", logicalCSS('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", euiFontSize(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
|
|
53
48
|
// Sizes
|
|
54
49
|
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
|
|
55
50
|
// Positions
|
|
56
|
-
top: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, "
|
|
57
|
-
bottom: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";
|
|
58
|
-
left: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";
|
|
59
|
-
right: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";
|
|
60
|
-
//
|
|
61
|
-
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
51
|
+
top: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";};label:right;"),
|
|
55
|
+
// Arrow
|
|
56
|
+
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), ";;label:euiToolTip__arrow;"),
|
|
57
|
+
arrowPositions: {
|
|
58
|
+
top: /*#__PURE__*/css("transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:top;"),
|
|
59
|
+
bottom: /*#__PURE__*/css("transform:translateY(", arrowMinusSize, ") rotateZ(45deg);;label:bottom;"),
|
|
60
|
+
left: /*#__PURE__*/css("transform:translateX(", arrowPlusSize, ") rotateZ(45deg);;label:left;"),
|
|
61
|
+
right: /*#__PURE__*/css("transform:translateX(", arrowMinusSize, ") rotateZ(45deg);;label:right;")
|
|
62
|
+
},
|
|
63
|
+
// Title
|
|
69
64
|
euiToolTip__title: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";", logicalCSS('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", logicalCSS('padding-bottom', euiTheme.size.xs), ";", logicalCSS('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
|
|
70
65
|
};
|
|
71
66
|
};
|