@elastic/eui 93.2.0 → 93.3.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 +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +9 -6
- package/es/components/breadcrumbs/breadcrumbs.js +4 -2
- package/es/components/button/button_display/_button_display.js +2 -3
- package/es/components/button/button_empty/button_empty.js +2 -3
- package/es/components/button/button_group/button_group.js +3 -5
- package/es/components/button/button_group/button_group.styles.js +10 -13
- package/es/components/button/button_icon/button_icon.js +4 -5
- package/es/components/button/button_icon/button_icon.styles.js +11 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/es/components/datagrid/body/data_grid_body.js +1 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/es/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/es/components/datagrid/data_grid.js +3 -1
- package/es/components/facet/facet_button.styles.js +1 -2
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/es/components/icon/icon.js +13 -16
- package/es/components/icon/icon.styles.js +6 -9
- package/es/components/link/external_link_icon.js +11 -8
- package/es/components/link/link.js +2 -3
- package/es/components/link/link.styles.js +4 -10
- package/es/components/page/page_header/page_header_content.js +4 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/skeleton/skeleton_circle.js +2 -3
- package/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/es/components/skeleton/skeleton_text.js +16 -12
- package/es/components/skeleton/skeleton_title.js +2 -3
- package/es/components/text/text.js +2 -3
- package/es/components/text/text_align.js +1 -2
- package/es/components/text/text_align.styles.js +5 -7
- package/es/components/text/text_color.js +2 -3
- package/es/components/title/title.js +2 -3
- package/es/components/title/title.styles.js +0 -7
- package/es/global_styling/mixins/_typography.js +17 -6
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +47 -14
- package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/eui.d.ts +46 -37
- package/i18ntokens.json +36 -36
- package/lib/components/breadcrumbs/breadcrumb.js +9 -6
- package/lib/components/breadcrumbs/breadcrumbs.js +4 -2
- package/lib/components/button/button_display/_button_display.js +1 -2
- package/lib/components/button/button_empty/button_empty.js +1 -2
- package/lib/components/button/button_group/button_group.js +2 -4
- package/lib/components/button/button_group/button_group.styles.js +10 -13
- package/lib/components/button/button_icon/button_icon.js +3 -4
- package/lib/components/button/button_icon/button_icon.styles.js +10 -2
- package/lib/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/lib/components/datagrid/body/data_grid_body.js +1 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/lib/components/datagrid/data_grid.js +3 -1
- package/lib/components/facet/facet_button.styles.js +1 -2
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/lib/components/icon/icon.js +12 -15
- package/lib/components/icon/icon.styles.js +5 -8
- package/lib/components/link/external_link_icon.js +10 -7
- package/lib/components/link/link.js +1 -2
- package/lib/components/link/link.styles.js +6 -14
- package/lib/components/page/page_header/page_header_content.js +4 -2
- package/lib/components/progress/progress.styles.js +1 -1
- package/lib/components/skeleton/skeleton_circle.js +1 -2
- package/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/lib/components/skeleton/skeleton_text.js +18 -11
- package/lib/components/skeleton/skeleton_title.js +1 -2
- package/lib/components/text/text.js +1 -2
- package/lib/components/text/text_align.js +1 -2
- package/lib/components/text/text_align.styles.js +5 -7
- package/lib/components/text/text_color.js +1 -2
- package/lib/components/title/title.js +1 -2
- package/lib/components/title/title.styles.js +2 -10
- package/lib/global_styling/mixins/_typography.js +27 -19
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +49 -16
- package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
- package/optimize/es/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/es/components/button/button_display/_button_display.js +2 -3
- package/optimize/es/components/button/button_empty/button_empty.js +2 -3
- package/optimize/es/components/button/button_group/button_group.js +3 -5
- package/optimize/es/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/es/components/button/button_icon/button_icon.js +4 -5
- package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/es/components/datagrid/data_grid.js +3 -1
- package/optimize/es/components/facet/facet_button.styles.js +1 -2
- package/optimize/es/components/icon/icon.js +13 -16
- package/optimize/es/components/icon/icon.styles.js +6 -9
- package/optimize/es/components/link/external_link_icon.js +11 -8
- package/optimize/es/components/link/link.js +2 -3
- package/optimize/es/components/link/link.styles.js +4 -10
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_text.js +16 -12
- package/optimize/es/components/skeleton/skeleton_title.js +2 -3
- package/optimize/es/components/text/text.js +2 -3
- package/optimize/es/components/text/text_align.js +1 -2
- package/optimize/es/components/text/text_align.styles.js +5 -7
- package/optimize/es/components/text/text_color.js +2 -3
- package/optimize/es/components/title/title.js +2 -3
- package/optimize/es/components/title/title.styles.js +0 -7
- package/optimize/es/global_styling/mixins/_typography.js +14 -6
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +47 -14
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +5 -4
- package/optimize/lib/components/button/button_display/_button_display.js +1 -2
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
- package/optimize/lib/components/button/button_group/button_group.js +2 -4
- package/optimize/lib/components/button/button_group/button_group.styles.js +10 -13
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
- package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +5 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/optimize/lib/components/datagrid/data_grid.js +3 -1
- package/optimize/lib/components/facet/facet_button.styles.js +1 -2
- package/optimize/lib/components/icon/icon.js +12 -15
- package/optimize/lib/components/icon/icon.styles.js +5 -8
- package/optimize/lib/components/link/external_link_icon.js +10 -7
- package/optimize/lib/components/link/link.js +1 -2
- package/optimize/lib/components/link/link.styles.js +6 -14
- package/optimize/lib/components/progress/progress.styles.js +1 -1
- package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
- package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
- package/optimize/lib/components/text/text.js +1 -2
- package/optimize/lib/components/text/text_align.js +1 -2
- package/optimize/lib/components/text/text_align.styles.js +5 -7
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/title/title.js +1 -2
- package/optimize/lib/components/title/title.styles.js +2 -10
- package/optimize/lib/global_styling/mixins/_typography.js +25 -19
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +49 -16
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/package.json +3 -3
- package/src/components/datagrid/_data_grid_data_row.scss +4 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +9 -6
- package/test-env/components/breadcrumbs/breadcrumbs.js +4 -2
- package/test-env/components/button/button_display/_button_display.js +1 -2
- package/test-env/components/button/button_empty/button_empty.js +1 -2
- package/test-env/components/button/button_group/button_group.js +2 -4
- package/test-env/components/button/button_group/button_group.styles.js +10 -13
- package/test-env/components/button/button_icon/button_icon.js +3 -4
- package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +7 -3
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
- package/test-env/components/datagrid/body/data_grid_body.js +1 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +3 -0
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +3 -0
- package/test-env/components/datagrid/body/data_grid_row_manager.js +1 -1
- package/test-env/components/datagrid/data_grid.js +3 -1
- package/test-env/components/facet/facet_button.styles.js +1 -2
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
- package/test-env/components/icon/icon.styles.js +5 -8
- package/test-env/components/link/external_link_icon.js +10 -7
- package/test-env/components/link/link.js +1 -2
- package/test-env/components/link/link.styles.js +6 -14
- package/test-env/components/page/page_header/page_header_content.js +4 -2
- package/test-env/components/progress/progress.styles.js +1 -1
- package/test-env/components/skeleton/skeleton_circle.js +1 -2
- package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
- package/test-env/components/skeleton/skeleton_text.js +18 -11
- package/test-env/components/skeleton/skeleton_title.js +1 -2
- package/test-env/components/text/text.js +1 -2
- package/test-env/components/text/text_align.js +1 -2
- package/test-env/components/text/text_align.styles.js +5 -7
- package/test-env/components/text/text_color.js +1 -2
- package/test-env/components/title/title.js +1 -2
- package/test-env/components/title/title.styles.js +2 -10
- package/test-env/global_styling/mixins/_typography.js +25 -19
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +49 -16
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
|
@@ -300,12 +300,14 @@ EuiPageHeaderContent.propTypes = {
|
|
|
300
300
|
*/
|
|
301
301
|
"aria-current": PropTypes.any,
|
|
302
302
|
/**
|
|
303
|
-
* Creates a breadcrumb that toggles a popover dialog
|
|
303
|
+
* Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
|
|
304
|
+
* or a render function that will pass callback allowing you to close the
|
|
305
|
+
* breadcrumb popover from within your popover content.
|
|
304
306
|
*
|
|
305
307
|
* If passed, both `href` and `onClick` will be ignored - the breadcrumb's
|
|
306
308
|
* click behavior should only trigger a popover.
|
|
307
309
|
*/
|
|
308
|
-
popoverContent: PropTypes.node,
|
|
310
|
+
popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
|
|
309
311
|
/**
|
|
310
312
|
* Allows customizing the popover if necessary. Accepts any props that
|
|
311
313
|
* [EuiPopover](/#/layout/popover) accepts, except for props that control state.
|
|
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { css, keyframes } from '@emotion/react';
|
|
13
|
-
import { logicalCSS, logicalTextAlignCSS, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
|
|
13
|
+
import { logicalCSS, logicalTextAlignCSS, euiCanAnimate, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
|
|
14
14
|
import { euiPaletteColorBlind, makeHighContrastColor } from '../../services';
|
|
15
15
|
import { euiText } from '../text/text.styles';
|
|
16
16
|
|
|
@@ -63,7 +63,7 @@ export var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
|
|
|
63
63
|
// https://css-tricks.com/html5-progress-element/
|
|
64
64
|
// Good resource if you need to work in here. There's some gotchas with
|
|
65
65
|
// dealing with cross-browser progress bars.
|
|
66
|
-
native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue(
|
|
66
|
+
native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", euiCanAnimate, "{/* Note: FF/Mozilla doesn't actually support animating the native progress bar\n @see https://bugzilla.mozilla.org/show_bug.cgi?id=662351 */", crossBrowserProgressValue("transition: width ".concat(euiTheme.animation.normal, " linear")), ";};label:native;"),
|
|
67
67
|
// An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
|
|
68
68
|
// we apply this style to a <div> instead of a <progress> element.
|
|
69
69
|
// See https://css-tricks.com/html5-progress-element/ for more info.
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { EuiSkeletonLoading } from './skeleton_loading';
|
|
18
18
|
import { euiSkeletonCircleStyles } from './skeleton_circle.styles';
|
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -31,8 +31,7 @@ export var EuiSkeletonCircle = function EuiSkeletonCircle(_ref) {
|
|
|
31
31
|
ariaWrapperProps = _ref.ariaWrapperProps,
|
|
32
32
|
children = _ref.children,
|
|
33
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
-
var
|
|
35
|
-
var styles = euiSkeletonCircleStyles(euiTheme);
|
|
34
|
+
var styles = useEuiMemoizedStyles(euiSkeletonCircleStyles);
|
|
36
35
|
var cssStyles = [styles.euiSkeletonCircle, styles[size]];
|
|
37
36
|
return ___EmotionJSX(EuiSkeletonLoading, _extends({
|
|
38
37
|
isLoading: isLoading,
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import {
|
|
22
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
23
23
|
import { logicalStyles } from '../../global_styling';
|
|
24
24
|
import { EuiSkeletonLoading } from './skeleton_loading';
|
|
25
25
|
import { euiSkeletonRectangleStyles } from './skeleton_rectangle.styles';
|
|
@@ -43,8 +43,7 @@ export var EuiSkeletonRectangle = function EuiSkeletonRectangle(_ref) {
|
|
|
43
43
|
ariaWrapperProps = _ref.ariaWrapperProps,
|
|
44
44
|
children = _ref.children,
|
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var
|
|
47
|
-
var styles = euiSkeletonRectangleStyles(euiTheme);
|
|
46
|
+
var styles = useEuiMemoizedStyles(euiSkeletonRectangleStyles);
|
|
48
47
|
var cssStyles = [styles.euiSkeletonRectangle, styles[borderRadius]];
|
|
49
48
|
return ___EmotionJSX(EuiSkeletonLoading, _extends({
|
|
50
49
|
isLoading: isLoading,
|
|
@@ -10,10 +10,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React from 'react';
|
|
13
|
+
import React, { useMemo } from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { EuiSkeletonLoading } from './skeleton_loading';
|
|
18
18
|
import { euiSkeletonTextStyles } from './skeleton_text.styles';
|
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -33,16 +33,20 @@ export var EuiSkeletonText = function EuiSkeletonText(_ref) {
|
|
|
33
33
|
ariaWrapperProps = _ref.ariaWrapperProps,
|
|
34
34
|
children = _ref.children,
|
|
35
35
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
lineElements
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
var styles = useEuiMemoizedStyles(euiSkeletonTextStyles);
|
|
37
|
+
var cssStyles = useMemo(function () {
|
|
38
|
+
return [styles.euiSkeletonText, styles[size]];
|
|
39
|
+
}, [styles, size]);
|
|
40
|
+
var lineElements = useMemo(function () {
|
|
41
|
+
var lineElements = [];
|
|
42
|
+
for (var i = 0; i < lines; i++) {
|
|
43
|
+
lineElements.push(___EmotionJSX("span", {
|
|
44
|
+
key: i,
|
|
45
|
+
css: cssStyles
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
return lineElements;
|
|
49
|
+
}, [lines, cssStyles]);
|
|
46
50
|
return ___EmotionJSX(EuiSkeletonLoading, _extends({
|
|
47
51
|
isLoading: isLoading,
|
|
48
52
|
loadingContent: ___EmotionJSX("span", _extends({
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { EuiSkeletonLoading } from './skeleton_loading';
|
|
18
18
|
import { euiSkeletonTitleStyles } from './skeleton_title.styles';
|
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -30,8 +30,7 @@ export var EuiSkeletonTitle = function EuiSkeletonTitle(_ref) {
|
|
|
30
30
|
ariaWrapperProps = _ref.ariaWrapperProps,
|
|
31
31
|
children = _ref.children,
|
|
32
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
var
|
|
34
|
-
var styles = euiSkeletonTitleStyles(euiTheme);
|
|
33
|
+
var styles = useEuiMemoizedStyles(euiSkeletonTitleStyles);
|
|
35
34
|
var cssStyles = [styles.euiSkeletonTitle, styles[size]];
|
|
36
35
|
return ___EmotionJSX(EuiSkeletonLoading, _extends({
|
|
37
36
|
isLoading: isLoading,
|
|
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
17
17
|
import { euiTextStyles } from './text.styles';
|
|
18
18
|
import { EuiTextColor } from './text_color';
|
|
19
19
|
import { EuiTextAlign } from './text_align';
|
|
@@ -29,8 +29,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
29
29
|
children = _ref.children,
|
|
30
30
|
className = _ref.className,
|
|
31
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
var
|
|
33
|
-
var styles = euiTextStyles(euiTheme);
|
|
32
|
+
var styles = useEuiMemoizedStyles(euiTextStyles);
|
|
34
33
|
var cssStyles = [styles.euiText, !grow ? styles.constrainedWidth : undefined, styles[size]];
|
|
35
34
|
var classes = classNames('euiText', className);
|
|
36
35
|
var text = ___EmotionJSX("div", _extends({
|
|
@@ -18,7 +18,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
18
18
|
import React, { isValidElement } from 'react';
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { cloneElementWithCss } from '../../services';
|
|
21
|
-
import { euiTextAlignStyles } from './text_align.styles';
|
|
21
|
+
import { euiTextAlignStyles as styles } from './text_align.styles';
|
|
22
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
23
|
export var ALIGNMENTS = ['left', 'right', 'center'];
|
|
24
24
|
export var EuiTextAlign = function EuiTextAlign(_ref) {
|
|
@@ -28,7 +28,6 @@ export var EuiTextAlign = function EuiTextAlign(_ref) {
|
|
|
28
28
|
_ref$cloneElement = _ref.cloneElement,
|
|
29
29
|
cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
|
|
30
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var styles = euiTextAlignStyles();
|
|
32
31
|
var cssStyles = [styles.euiTextAlign, styles[textAlign]];
|
|
33
32
|
var props = _objectSpread({
|
|
34
33
|
css: cssStyles
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { logicalTextAlignCSS } from '../../global_styling';
|
|
11
|
-
export var euiTextAlignStyles =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;")
|
|
17
|
-
};
|
|
11
|
+
export var euiTextAlignStyles = {
|
|
12
|
+
euiTextAlign: /*#__PURE__*/css(";label:euiTextAlign;"),
|
|
13
|
+
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
|
|
14
|
+
right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;"),
|
|
15
|
+
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;")
|
|
18
16
|
};
|
|
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
|
|
18
18
|
import React, { isValidElement } from 'react';
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
|
-
import {
|
|
20
|
+
import { useEuiMemoizedStyles, cloneElementWithCss } from '../../services';
|
|
21
21
|
import { euiTextColorStyles } from './text_color.styles';
|
|
22
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
23
|
export var COLORS = ['default', 'subdued', 'success', 'accent', 'danger', 'warning', 'ghost', 'inherit'];
|
|
@@ -32,8 +32,7 @@ export var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
32
32
|
style = _ref.style,
|
|
33
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
var isNamedColor = COLORS.includes(color);
|
|
35
|
-
var
|
|
36
|
-
var styles = euiTextColorStyles(euiTheme);
|
|
35
|
+
var styles = useEuiMemoizedStyles(euiTextColorStyles);
|
|
37
36
|
var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor];
|
|
38
37
|
|
|
39
38
|
// We're checking if is a custom color.
|
|
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
17
17
|
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
|
-
import {
|
|
20
|
+
import { useEuiMemoizedStyles, cloneElementWithCss } from '../../services';
|
|
21
21
|
import { euiTitleStyles } from './title.styles';
|
|
22
22
|
export var TITLE_SIZES = ['xxxs', 'xxs', 'xs', 's', 'm', 'l'];
|
|
23
23
|
export var TEXT_TRANSFORM = ['uppercase'];
|
|
@@ -28,8 +28,7 @@ export var EuiTitle = function EuiTitle(_ref) {
|
|
|
28
28
|
className = _ref.className,
|
|
29
29
|
textTransform = _ref.textTransform,
|
|
30
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var
|
|
32
|
-
var styles = euiTitleStyles(euiTheme);
|
|
31
|
+
var styles = useEuiMemoizedStyles(euiTitleStyles);
|
|
33
32
|
var cssStyles = [styles.euiTitle, textTransform ? styles[textTransform] : undefined, styles[size]];
|
|
34
33
|
var classes = classNames('euiTitle', className, children.props.className);
|
|
35
34
|
var props = _objectSpread({
|
|
@@ -14,7 +14,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { css } from '@emotion/react';
|
|
17
|
-
import { useEuiTheme } from '../../services';
|
|
18
17
|
import { euiTextBreakWord, euiFontSize, logicalCSS } from '../../global_styling';
|
|
19
18
|
|
|
20
19
|
/**
|
|
@@ -39,12 +38,6 @@ export var euiTitle = function euiTitle(euiThemeContext) {
|
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
40
|
|
|
42
|
-
// Hook version
|
|
43
|
-
export var useEuiTitle = function useEuiTitle(scale, options) {
|
|
44
|
-
var euiTheme = useEuiTheme();
|
|
45
|
-
return euiTitle(euiTheme, scale, options);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
41
|
/**
|
|
49
42
|
* Styles
|
|
50
43
|
*/
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
7
|
/*
|
|
2
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,7 +13,8 @@
|
|
|
7
13
|
*/
|
|
8
14
|
|
|
9
15
|
import { euiLineHeightFromBaseline, euiFontSizeFromScale } from '../functions/typography';
|
|
10
|
-
import { useEuiTheme } from '../../services/theme
|
|
16
|
+
import { useEuiMemoizedStyles, useEuiTheme } from '../../services/theme';
|
|
17
|
+
import { EuiThemeFontScales } from '../variables/typography';
|
|
11
18
|
import { logicalCSS } from '../functions';
|
|
12
19
|
/**
|
|
13
20
|
* Returns font-size and line-height
|
|
@@ -21,7 +28,15 @@ export var euiFontSize = function euiFontSize(_ref, scale, options) {
|
|
|
21
28
|
};
|
|
22
29
|
export var useEuiFontSize = function useEuiFontSize(scale, options) {
|
|
23
30
|
var euiTheme = useEuiTheme();
|
|
24
|
-
|
|
31
|
+
var memoizedFontSizes = useEuiMemoizedStyles(euiFontSizes);
|
|
32
|
+
return !options ? memoizedFontSizes[scale] : euiFontSize(euiTheme, scale, options);
|
|
33
|
+
};
|
|
34
|
+
// Memomize a basic set of font sizes. We unfortunately can't
|
|
35
|
+
// memoize all possible options, there's too many permutations
|
|
36
|
+
var euiFontSizes = function euiFontSizes(euiThemeContext) {
|
|
37
|
+
return EuiThemeFontScales.reduce(function (map, scale) {
|
|
38
|
+
return _objectSpread(_objectSpread({}, map), {}, _defineProperty({}, scale, euiFontSize(euiThemeContext, scale)));
|
|
39
|
+
}, {});
|
|
25
40
|
};
|
|
26
41
|
|
|
27
42
|
/**
|
|
@@ -47,8 +62,4 @@ export var euiTextTruncate = function euiTextTruncate() {
|
|
|
47
62
|
export var euiNumberFormat = function euiNumberFormat(_ref2) {
|
|
48
63
|
var euiTheme = _ref2.euiTheme;
|
|
49
64
|
return "\n font-feature-settings: ".concat(euiTheme.font.featureSettings, ", 'tnum' 1;\n");
|
|
50
|
-
};
|
|
51
|
-
export var useEuiNumberFormat = function useEuiNumberFormat() {
|
|
52
|
-
var euiTheme = useEuiTheme();
|
|
53
|
-
return euiNumberFormat(euiTheme);
|
|
54
65
|
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
10
10
|
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme, useEuiThemeCSSVariables } from './hooks';
|
|
11
11
|
export { EuiThemeProvider } from './provider';
|
|
12
|
-
export { useEuiMemoizedStyles } from './style_memoization';
|
|
12
|
+
export { useEuiMemoizedStyles, withEuiStylesMemoizer } from './style_memoization';
|
|
13
13
|
export { getEuiDevProviderWarning, setEuiDevProviderWarning } from './warning';
|
|
14
14
|
export { buildTheme, computed, isInverseColorMode, getColorMode, getComputed, getOn, mergeDeep, setOn, Computed } from './utils';
|
|
15
15
|
export { COLOR_MODES_STANDARD } from './types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
1
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
4
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -12,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
12
13
|
* Side Public License, v 1.
|
|
13
14
|
*/
|
|
14
15
|
|
|
15
|
-
import React, { createContext, useContext, useState, useMemo } from 'react';
|
|
16
|
+
import React, { createContext, useContext, useState, useMemo, useCallback, forwardRef } from 'react';
|
|
16
17
|
import { useUpdateEffect } from '../hooks';
|
|
17
18
|
import { useEuiTheme } from './hooks';
|
|
18
19
|
|
|
@@ -41,25 +42,57 @@ export var EuiThemeMemoizedStylesProvider = function EuiThemeMemoizedStylesProvi
|
|
|
41
42
|
}, children);
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Internal util primarily responsible for getting the memoized styles (if they exist)
|
|
47
|
+
* and if not, generating and setting the styles. DRYed out to facilitate usage
|
|
48
|
+
* between both hook/function components and HOC/class components
|
|
49
|
+
*/
|
|
50
|
+
var getMemoizedStyles = function getMemoizedStyles(stylesGenerator, stylesMap, euiThemeContext) {
|
|
51
|
+
if (!stylesGenerator.name) {
|
|
52
|
+
throw new Error('Styles are memoized per function. Your style functions must be statically defined in order to not create a new map entry every rerender.');
|
|
53
|
+
}
|
|
54
|
+
var existingStyles = stylesMap.get(stylesGenerator);
|
|
55
|
+
if (existingStyles) {
|
|
56
|
+
return existingStyles;
|
|
57
|
+
} else {
|
|
58
|
+
var generatedStyles = stylesGenerator(euiThemeContext);
|
|
59
|
+
stylesMap.set(stylesGenerator, generatedStyles);
|
|
60
|
+
return generatedStyles;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
44
64
|
/**
|
|
45
65
|
* Hook that memoizes the returned values of components style fns/generators
|
|
46
66
|
* per-theme
|
|
47
67
|
*/
|
|
48
|
-
export var useEuiMemoizedStyles = function useEuiMemoizedStyles(
|
|
68
|
+
export var useEuiMemoizedStyles = function useEuiMemoizedStyles(stylesGenerator) {
|
|
49
69
|
var memoizedStyles = useContext(EuiThemeMemoizedStylesContext);
|
|
50
70
|
var euiThemeContext = useEuiTheme();
|
|
51
71
|
var memoizedComponentStyles = useMemo(function () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
var existingStyles = memoizedStyles.get(styleGenerator);
|
|
56
|
-
if (existingStyles) {
|
|
57
|
-
return existingStyles;
|
|
58
|
-
} else {
|
|
59
|
-
var generatedStyles = styleGenerator(euiThemeContext);
|
|
60
|
-
memoizedStyles.set(styleGenerator, generatedStyles);
|
|
61
|
-
return generatedStyles;
|
|
62
|
-
}
|
|
63
|
-
}, [styleGenerator, memoizedStyles, euiThemeContext]);
|
|
72
|
+
return getMemoizedStyles(stylesGenerator, memoizedStyles, euiThemeContext);
|
|
73
|
+
}, [stylesGenerator, memoizedStyles, euiThemeContext]);
|
|
64
74
|
return memoizedComponentStyles;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* HOC for class components
|
|
79
|
+
* Syntax is mostly copied from withEuiTheme HOC
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
export var withEuiStylesMemoizer = function withEuiStylesMemoizer(Component) {
|
|
83
|
+
var componentName = Component.displayName || Component.name || 'ComponentWithStylesMemoizer';
|
|
84
|
+
var Render = function Render(props, ref) {
|
|
85
|
+
var memoizedStyles = useContext(EuiThemeMemoizedStylesContext);
|
|
86
|
+
var euiThemeContext = useEuiTheme();
|
|
87
|
+
var stylesMemoizer = useCallback(function (stylesGenerator) {
|
|
88
|
+
return getMemoizedStyles(stylesGenerator, memoizedStyles, euiThemeContext);
|
|
89
|
+
}, [memoizedStyles, euiThemeContext]);
|
|
90
|
+
return ___EmotionJSX(Component, _extends({
|
|
91
|
+
stylesMemoizer: stylesMemoizer,
|
|
92
|
+
ref: ref
|
|
93
|
+
}, props));
|
|
94
|
+
};
|
|
95
|
+
var WithEuiStylesMemoizer = /*#__PURE__*/forwardRef(Render);
|
|
96
|
+
WithEuiStylesMemoizer.displayName = componentName;
|
|
97
|
+
return WithEuiStylesMemoizer;
|
|
65
98
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
1
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -12,10 +14,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
12
14
|
* Side Public License, v 1.
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
|
-
import { css } from '@emotion/react';
|
|
17
|
+
import { css, keyframes } from '@emotion/react';
|
|
16
18
|
import { euiBackgroundColor, euiCanAnimate } from '../../../../global_styling';
|
|
17
|
-
import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize,
|
|
19
|
+
import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize, useEuiMemoizedStyles } from '../../../../services';
|
|
18
20
|
export var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
21
|
+
export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
19
22
|
/**
|
|
20
23
|
* Creates the `base` version of button styles with proper text contrast.
|
|
21
24
|
* @param euiThemeContext
|
|
@@ -133,23 +136,35 @@ export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, c
|
|
|
133
136
|
*/
|
|
134
137
|
export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
135
138
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
139
|
+
var _options$display = options.display,
|
|
140
|
+
display = _options$display === void 0 ? 'base' : _options$display;
|
|
141
|
+
var colorsDisplaysMap = useEuiMemoizedStyles(euiButtonDisplaysColors);
|
|
142
|
+
return colorsDisplaysMap[display];
|
|
143
|
+
};
|
|
144
|
+
var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
|
|
145
|
+
var COLORS = [].concat(BUTTON_COLORS, ['disabled']);
|
|
146
|
+
var displaysColorsMap = {};
|
|
147
|
+
BUTTON_DISPLAYS.forEach(function (display) {
|
|
148
|
+
displaysColorsMap[display] = {};
|
|
149
|
+
COLORS.forEach(function (color) {
|
|
150
|
+
switch (display) {
|
|
151
|
+
case 'base':
|
|
152
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:displaysColorsMap-display-color;");
|
|
153
|
+
break;
|
|
154
|
+
case 'fill':
|
|
155
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:displaysColorsMap-display-color;");
|
|
156
|
+
break;
|
|
157
|
+
case 'empty':
|
|
158
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:displaysColorsMap-display-color;");
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Tweak auto-generated Emotion label/className output
|
|
163
|
+
var emotionOutput = displaysColorsMap[display][color];
|
|
164
|
+
emotionOutput.styles = emotionOutput.styles.replace('label:displaysColorsMap-display-color;', "label:".concat(display, "-").concat(color, ";"));
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
return displaysColorsMap;
|
|
153
168
|
};
|
|
154
169
|
|
|
155
170
|
/**
|
|
@@ -157,17 +172,25 @@ export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
|
157
172
|
* @returns string
|
|
158
173
|
*/
|
|
159
174
|
export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
return useEuiMemoizedStyles(euiButtonFocusCSS);
|
|
176
|
+
};
|
|
177
|
+
var euiButtonFocusAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
|
|
178
|
+
var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
|
|
179
|
+
var euiTheme = _ref.euiTheme;
|
|
180
|
+
var focusCSS = /*#__PURE__*/css(euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ease-in-out,background-color ", euiTheme.animation.normal, " ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:", euiButtonFocusAnimation, " ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";}&:active:not(:disabled){transform:translateY(1px);}};label:focusCSS;");
|
|
181
|
+
// Remove the auto-generated label.
|
|
182
|
+
// We could typically avoid a label by using a plain string `` instead of css``,
|
|
183
|
+
// but we need css`` for keyframes`` to work for the focus animation
|
|
184
|
+
focusCSS.styles = focusCSS.styles.replace('label:focusCSS;', '');
|
|
185
|
+
return focusCSS;
|
|
163
186
|
};
|
|
164
187
|
|
|
165
188
|
/**
|
|
166
189
|
* Map of `size` props to various sizings/scales
|
|
167
190
|
* that should remain consistent across all buttons
|
|
168
191
|
*/
|
|
169
|
-
export var euiButtonSizeMap = function euiButtonSizeMap(
|
|
170
|
-
var euiTheme =
|
|
192
|
+
export var euiButtonSizeMap = function euiButtonSizeMap(_ref2) {
|
|
193
|
+
var euiTheme = _ref2.euiTheme;
|
|
171
194
|
return {
|
|
172
195
|
xs: {
|
|
173
196
|
height: euiTheme.size.l,
|