@elastic/eui 93.4.0 → 93.5.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/eui_theme_dark.css +3 -0
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +3 -0
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/header/header_links/header_links.js +10 -2
  6. package/es/components/icon/icon.js +3 -3
  7. package/es/components/panel/panel.js +2 -3
  8. package/es/components/resizable_container/resizable_button.js +2 -3
  9. package/es/components/resizable_container/resizable_collapse_button.js +2 -3
  10. package/es/components/resizable_container/resizable_container.js +1 -2
  11. package/es/components/resizable_container/resizable_container.styles.js +11 -14
  12. package/es/components/resizable_container/resizable_panel.js +6 -8
  13. package/es/components/resizable_container/resizable_panel.styles.js +18 -29
  14. package/es/components/selectable/selectable_list/selectable_list.js +29 -6
  15. package/es/components/tool_tip/icon_tip.js +4 -3
  16. package/es/global_styling/mixins/_color.js +60 -32
  17. package/es/global_styling/mixins/_padding.js +60 -16
  18. package/es/services/theme/style_memoization.js +1 -3
  19. package/eui.d.ts +37 -54
  20. package/i18ntokens.json +38 -20
  21. package/lib/components/header/header_links/header_links.js +10 -2
  22. package/lib/components/icon/icon.js +3 -3
  23. package/lib/components/panel/panel.js +1 -2
  24. package/lib/components/resizable_container/resizable_button.js +1 -2
  25. package/lib/components/resizable_container/resizable_collapse_button.js +1 -2
  26. package/lib/components/resizable_container/resizable_container.js +1 -2
  27. package/lib/components/resizable_container/resizable_container.styles.js +11 -14
  28. package/lib/components/resizable_container/resizable_panel.js +3 -5
  29. package/lib/components/resizable_container/resizable_panel.styles.js +17 -28
  30. package/lib/components/selectable/selectable_list/selectable_list.js +29 -6
  31. package/lib/components/tool_tip/icon_tip.js +4 -3
  32. package/lib/global_styling/mixins/_color.js +65 -40
  33. package/lib/global_styling/mixins/_padding.js +66 -25
  34. package/lib/services/theme/style_memoization.js +1 -3
  35. package/optimize/es/components/header/header_links/header_links.js +3 -2
  36. package/optimize/es/components/icon/icon.js +3 -3
  37. package/optimize/es/components/panel/panel.js +2 -3
  38. package/optimize/es/components/resizable_container/resizable_button.js +2 -3
  39. package/optimize/es/components/resizable_container/resizable_collapse_button.js +2 -3
  40. package/optimize/es/components/resizable_container/resizable_container.js +1 -2
  41. package/optimize/es/components/resizable_container/resizable_container.styles.js +11 -14
  42. package/optimize/es/components/resizable_container/resizable_panel.js +6 -8
  43. package/optimize/es/components/resizable_container/resizable_panel.styles.js +18 -26
  44. package/optimize/es/components/selectable/selectable_list/selectable_list.js +29 -6
  45. package/optimize/es/components/tool_tip/icon_tip.js +4 -3
  46. package/optimize/es/global_styling/mixins/_color.js +57 -32
  47. package/optimize/es/global_styling/mixins/_padding.js +52 -16
  48. package/optimize/es/services/theme/style_memoization.js +1 -3
  49. package/optimize/lib/components/header/header_links/header_links.js +3 -2
  50. package/optimize/lib/components/icon/icon.js +3 -3
  51. package/optimize/lib/components/panel/panel.js +1 -2
  52. package/optimize/lib/components/resizable_container/resizable_button.js +1 -2
  53. package/optimize/lib/components/resizable_container/resizable_collapse_button.js +1 -2
  54. package/optimize/lib/components/resizable_container/resizable_container.js +1 -2
  55. package/optimize/lib/components/resizable_container/resizable_container.styles.js +11 -14
  56. package/optimize/lib/components/resizable_container/resizable_panel.js +3 -5
  57. package/optimize/lib/components/resizable_container/resizable_panel.styles.js +17 -26
  58. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +29 -6
  59. package/optimize/lib/components/tool_tip/icon_tip.js +4 -3
  60. package/optimize/lib/global_styling/mixins/_color.js +63 -40
  61. package/optimize/lib/global_styling/mixins/_padding.js +59 -25
  62. package/optimize/lib/services/theme/style_memoization.js +1 -3
  63. package/package.json +8 -11
  64. package/src/components/form/text_area/_text_area.scss +5 -0
  65. package/src/components/selectable/selectable_list/_selectable_list.scss +2 -0
  66. package/test-env/components/header/header_links/header_links.js +10 -2
  67. package/test-env/components/panel/panel.js +1 -2
  68. package/test-env/components/resizable_container/resizable_button.js +1 -2
  69. package/test-env/components/resizable_container/resizable_collapse_button.js +1 -2
  70. package/test-env/components/resizable_container/resizable_container.js +1 -2
  71. package/test-env/components/resizable_container/resizable_container.styles.js +11 -14
  72. package/test-env/components/resizable_container/resizable_panel.js +3 -5
  73. package/test-env/components/resizable_container/resizable_panel.styles.js +17 -26
  74. package/test-env/components/selectable/selectable_list/selectable_list.js +29 -6
  75. package/test-env/components/tool_tip/icon_tip.js +4 -3
  76. package/test-env/global_styling/mixins/_color.js +63 -40
  77. package/test-env/global_styling/mixins/_padding.js +59 -25
  78. package/test-env/services/theme/style_memoization.js +1 -3
package/eui.d.ts CHANGED
@@ -1082,6 +1082,7 @@ declare module '@elastic/eui/src/components/form/checkbox' {
1082
1082
 
1083
1083
  }
1084
1084
  declare module '@elastic/eui/src/global_styling/mixins/_color' {
1085
+ import { SerializedStyles } from '@emotion/react';
1085
1086
  import { UseEuiTheme } from '@elastic/eui/src/services';
1086
1087
  export const BACKGROUND_COLORS: readonly ["transparent", "plain", "subdued", "accent", "primary", "success", "warning", "danger"];
1087
1088
  export type _EuiBackgroundColor = (typeof BACKGROUND_COLORS)[number];
@@ -1092,29 +1093,17 @@ declare module '@elastic/eui/src/global_styling/mixins/_color' {
1092
1093
  */
1093
1094
  method?: 'opaque' | 'transparent';
1094
1095
  }
1096
+ /**
1097
+ * @returns A single background color with optional alpha transparency
1098
+ */
1095
1099
  export const euiBackgroundColor: ({ euiTheme, colorMode }: UseEuiTheme, color: _EuiBackgroundColor, { method }?: _EuiBackgroundColorOptions) => string;
1096
1100
  export const useEuiBackgroundColor: (color: _EuiBackgroundColor, { method }?: _EuiBackgroundColorOptions) => string;
1097
- export const useEuiBackgroundColorCSS: () => {
1098
- transparent: import("@emotion/utils").SerializedStyles;
1099
- plain: import("@emotion/utils").SerializedStyles;
1100
- subdued: import("@emotion/utils").SerializedStyles;
1101
- accent: import("@emotion/utils").SerializedStyles;
1102
- primary: import("@emotion/utils").SerializedStyles;
1103
- success: import("@emotion/utils").SerializedStyles;
1104
- warning: import("@emotion/utils").SerializedStyles;
1105
- danger: import("@emotion/utils").SerializedStyles;
1106
- };
1101
+ export const useEuiBackgroundColorCSS: () => Record<"transparent" | "plain" | "subdued" | "accent" | "primary" | "success" | "warning" | "danger", SerializedStyles>;
1102
+ /**
1103
+ * Border colors
1104
+ */
1107
1105
  export const euiBorderColor: ({ euiTheme, colorMode }: UseEuiTheme, color: _EuiBackgroundColor) => string;
1108
- export const useEuiBorderColorCSS: () => {
1109
- transparent: import("@emotion/utils").SerializedStyles;
1110
- plain: import("@emotion/utils").SerializedStyles;
1111
- subdued: import("@emotion/utils").SerializedStyles;
1112
- accent: import("@emotion/utils").SerializedStyles;
1113
- primary: import("@emotion/utils").SerializedStyles;
1114
- success: import("@emotion/utils").SerializedStyles;
1115
- warning: import("@emotion/utils").SerializedStyles;
1116
- danger: import("@emotion/utils").SerializedStyles;
1117
- };
1106
+ export const useEuiBorderColorCSS: () => Record<"transparent" | "plain" | "subdued" | "accent" | "primary" | "success" | "warning" | "danger", SerializedStyles>;
1118
1107
 
1119
1108
  }
1120
1109
  declare module '@elastic/eui/src/global_styling/functions/logicals' {
@@ -1483,27 +1472,16 @@ declare module '@elastic/eui/src/global_styling/mixins/_helpers' {
1483
1472
 
1484
1473
  }
1485
1474
  declare module '@elastic/eui/src/global_styling/mixins/_padding' {
1475
+ import { SerializedStyles } from '@emotion/react';
1486
1476
  import { UseEuiTheme } from '@elastic/eui/src/services/theme';
1487
1477
  export const PADDING_SIZES: readonly ["none", "xs", "s", "m", "l", "xl"];
1488
1478
  export type EuiPaddingSize = (typeof PADDING_SIZES)[number];
1479
+ /**
1480
+ * Get a single padding size
1481
+ */
1489
1482
  export const euiPaddingSize: ({ euiTheme }: UseEuiTheme, size: EuiPaddingSize) => string | null;
1490
- export const euiPaddingSizeCSS: (euiThemeContext: UseEuiTheme, side?: "left" | "right" | "horizontal" | "vertical" | "bottom" | "top" | undefined) => {
1491
- none: null;
1492
- xs: import("@emotion/utils").SerializedStyles;
1493
- s: import("@emotion/utils").SerializedStyles;
1494
- m: import("@emotion/utils").SerializedStyles;
1495
- l: import("@emotion/utils").SerializedStyles;
1496
- xl: import("@emotion/utils").SerializedStyles;
1497
- };
1498
- export const useEuiPaddingSize: (size: EuiPaddingSize) => string | null;
1499
- export const useEuiPaddingCSS: (side?: "left" | "right" | "horizontal" | "vertical" | "bottom" | "top" | undefined) => {
1500
- none: null;
1501
- xs: import("@emotion/utils").SerializedStyles;
1502
- s: import("@emotion/utils").SerializedStyles;
1503
- m: import("@emotion/utils").SerializedStyles;
1504
- l: import("@emotion/utils").SerializedStyles;
1505
- xl: import("@emotion/utils").SerializedStyles;
1506
- };
1483
+ export const useEuiPaddingSize: (size: EuiPaddingSize) => string;
1484
+ export const useEuiPaddingCSS: (side?: "left" | "right" | "horizontal" | "vertical" | "bottom" | "top" | undefined) => Record<"xs" | "s" | "m" | "l" | "xl" | "none", SerializedStyles>;
1507
1485
 
1508
1486
  }
1509
1487
  declare module '@elastic/eui/src/global_styling/mixins/_states' {
@@ -2830,12 +2808,18 @@ declare module '@elastic/eui/src/components/i18n/i18n' {
2830
2808
  interface I18nTokenShape<T, DEFAULT extends Renderable<T>> {
2831
2809
  token: string;
2832
2810
  default: DEFAULT;
2811
+ /**
2812
+ * Render function that returns a ReactElement
2813
+ */
2833
2814
  children?: (x: ResolvedType<DEFAULT>) => ReactChild;
2834
2815
  values?: T;
2835
2816
  }
2836
- interface I18nTokensShape<T extends any[]> {
2817
+ export interface I18nTokensShape<T extends any[]> {
2837
2818
  tokens: string[];
2838
2819
  defaults: T;
2820
+ /**
2821
+ * Render function that returns a ReactElement
2822
+ */
2839
2823
  children: (x: Array<T[number]>) => ReactChild;
2840
2824
  values?: Record<string, ReactChild>;
2841
2825
  }
@@ -3296,7 +3280,7 @@ declare module '@elastic/eui/src/themes/amsterdam/global_styling/mixins/button'
3296
3280
  * Creates the translate animation when button is in focus.
3297
3281
  * @returns string
3298
3282
  */
3299
- export const useEuiButtonFocusCSS: () => any;
3283
+ export const useEuiButtonFocusCSS: () => SerializedStyles;
3300
3284
  /**
3301
3285
  * Map of `size` props to various sizings/scales
3302
3286
  * that should remain consistent across all buttons
@@ -8283,15 +8267,14 @@ declare module '@elastic/eui/src/services/hooks' {
8283
8267
  }
8284
8268
  declare module '@elastic/eui/src/services/theme/style_memoization' {
8285
8269
  import React, { FunctionComponent, PropsWithChildren } from 'react';
8286
- import type { SerializedStyles, CSSObject } from '@emotion/react';
8287
- import { UseEuiTheme } from '@elastic/eui/src/services/theme/hooks'; type Styles = SerializedStyles | CSSObject | string | null; type StylesMaps = Record<string, Styles | Record<string, Styles>>; type MemoizedStylesMap = WeakMap<Function, StylesMaps>;
8270
+ import { UseEuiTheme } from '@elastic/eui/src/services/theme/hooks'; type StylesMap = Record<string, any>; type MemoizedStylesMap = WeakMap<Function, StylesMap>;
8288
8271
  export const EuiThemeMemoizedStylesContext: React.Context<MemoizedStylesMap>;
8289
8272
  export const EuiThemeMemoizedStylesProvider: FunctionComponent<PropsWithChildren>;
8290
8273
  /**
8291
8274
  * Hook that memoizes the returned values of components style fns/generators
8292
8275
  * per-theme
8293
8276
  */
8294
- export const useEuiMemoizedStyles: <T extends (theme: UseEuiTheme) => StylesMaps>(stylesGenerator: T) => ReturnType<T>;
8277
+ export const useEuiMemoizedStyles: <T extends (theme: UseEuiTheme) => StylesMap>(stylesGenerator: T) => ReturnType<T>;
8295
8278
  /**
8296
8279
  * HOC for class components
8297
8280
  * Syntax is mostly copied from withEuiTheme HOC
@@ -11268,17 +11251,9 @@ declare module '@elastic/eui/src/components/resizable_container/resizable_collap
11268
11251
  }
11269
11252
  declare module '@elastic/eui/src/components/resizable_container/resizable_panel.styles' {
11270
11253
  import { UseEuiTheme } from '@elastic/eui/src/services';
11271
- export const euiResizablePanelStyles: (euiThemeContext: UseEuiTheme) => {
11254
+ export const euiResizablePanelStyles: {
11272
11255
  euiResizablePanel: import("@emotion/utils").SerializedStyles;
11273
11256
  collapsed: import("@emotion/utils").SerializedStyles;
11274
- paddingSizes: {
11275
- none: null;
11276
- xs: import("@emotion/utils").SerializedStyles;
11277
- s: import("@emotion/utils").SerializedStyles;
11278
- m: import("@emotion/utils").SerializedStyles;
11279
- l: import("@emotion/utils").SerializedStyles;
11280
- xl: import("@emotion/utils").SerializedStyles;
11281
- };
11282
11257
  };
11283
11258
  export const euiResizablePanelContentStyles: (euiThemeContext: UseEuiTheme) => {
11284
11259
  euiResizablePanel__content: import("@emotion/utils").SerializedStyles;
@@ -11404,7 +11379,7 @@ declare module '@elastic/eui/src/components/resizable_container/helpers' {
11404
11379
 
11405
11380
  }
11406
11381
  declare module '@elastic/eui/src/components/resizable_container/resizable_container.styles' {
11407
- export const euiResizableContainerStyles: () => {
11382
+ export const euiResizableContainerStyles: {
11408
11383
  euiResizableContainer: import("@emotion/utils").SerializedStyles;
11409
11384
  horizontal: import("@emotion/utils").SerializedStyles;
11410
11385
  vertical: import("@emotion/utils").SerializedStyles;
@@ -17565,7 +17540,7 @@ declare module '@elastic/eui/src/components/header/header_links/header_links.sty
17565
17540
 
17566
17541
  }
17567
17542
  declare module '@elastic/eui/src/components/header/header_links/header_links' {
17568
- import { HTMLAttributes, FunctionComponent } from 'react';
17543
+ import { ReactNode, HTMLAttributes, FunctionComponent } from 'react';
17569
17544
  import { CommonProps } from '@elastic/eui/src/components/common';
17570
17545
  import { IconType } from '@elastic/eui/src/components/icon';
17571
17546
  import { EuiPopoverProps } from '@elastic/eui/src/components/popover';
@@ -17574,7 +17549,14 @@ declare module '@elastic/eui/src/components/header/header_links/header_links' {
17574
17549
  export const GUTTER_SIZES: readonly ["xs", "s", "m", "l"]; type EuiHeaderLinksGutterSize = (typeof GUTTER_SIZES)[number]; type EuiHeaderLinksPopoverButtonProps = Partial<EuiHeaderSectionItemButtonProps> & {
17575
17550
  iconType?: IconType;
17576
17551
  };
17577
- export type EuiHeaderLinksProps = CommonProps & HTMLAttributes<HTMLElement> & {
17552
+ export type EuiHeaderLinksProps = CommonProps & Omit<HTMLAttributes<HTMLElement>, 'children'> & {
17553
+ /**
17554
+ * Takes any rendered node(s), typically of `EuiHeaderLink`s.
17555
+ *
17556
+ * Optionally takes a render function that will pass a callback allowing you
17557
+ * to close the mobile popover from within your popover content.
17558
+ */
17559
+ children?: ReactNode | ((closeMobilePopover: () => void) => ReactNode);
17578
17560
  /**
17579
17561
  * Spacing between direct children
17580
17562
  */
@@ -29313,6 +29295,7 @@ declare module '@elastic/eui' {
29313
29295
  "euiToast.newNotification": any;
29314
29296
  "euiToast.notification": any;
29315
29297
  "euiToast.dismissToast": any;
29298
+ "euiIconTip.defaultAriaLabel": any;
29316
29299
  "euiTourFooter.endTour": any;
29317
29300
  "euiTourFooter.skipTour": any;
29318
29301
  "euiTourFooter.closeTour": any;
package/i18ntokens.json CHANGED
@@ -4901,14 +4901,14 @@
4901
4901
  "highlighting": "string",
4902
4902
  "loc": {
4903
4903
  "start": {
4904
- "line": 106,
4904
+ "line": 114,
4905
4905
  "column": 4,
4906
- "index": 3070
4906
+ "index": 3416
4907
4907
  },
4908
4908
  "end": {
4909
- "line": 106,
4909
+ "line": 114,
4910
4910
  "column": 75,
4911
- "index": 3141
4911
+ "index": 3487
4912
4912
  }
4913
4913
  },
4914
4914
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -4919,14 +4919,14 @@
4919
4919
  "highlighting": "string",
4920
4920
  "loc": {
4921
4921
  "start": {
4922
- "line": 120,
4922
+ "line": 131,
4923
4923
  "column": 4,
4924
- "index": 3472
4924
+ "index": 3915
4925
4925
  },
4926
4926
  "end": {
4927
- "line": 120,
4927
+ "line": 131,
4928
4928
  "column": 69,
4929
- "index": 3537
4929
+ "index": 3980
4930
4930
  }
4931
4931
  },
4932
4932
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -5765,14 +5765,14 @@
5765
5765
  "highlighting": "string",
5766
5766
  "loc": {
5767
5767
  "start": {
5768
- "line": 89,
5768
+ "line": 88,
5769
5769
  "column": 6,
5770
- "index": 2724
5770
+ "index": 2709
5771
5771
  },
5772
5772
  "end": {
5773
- "line": 98,
5773
+ "line": 97,
5774
5774
  "column": 7,
5775
- "index": 3053
5775
+ "index": 3038
5776
5776
  }
5777
5777
  },
5778
5778
  "filepath": "src/components/resizable_container/resizable_button.tsx"
@@ -5783,14 +5783,14 @@
5783
5783
  "highlighting": "string",
5784
5784
  "loc": {
5785
5785
  "start": {
5786
- "line": 89,
5786
+ "line": 88,
5787
5787
  "column": 6,
5788
- "index": 2724
5788
+ "index": 2709
5789
5789
  },
5790
5790
  "end": {
5791
- "line": 98,
5791
+ "line": 97,
5792
5792
  "column": 7,
5793
- "index": 3053
5793
+ "index": 3038
5794
5794
  }
5795
5795
  },
5796
5796
  "filepath": "src/components/resizable_container/resizable_button.tsx"
@@ -5801,14 +5801,14 @@
5801
5801
  "highlighting": "string",
5802
5802
  "loc": {
5803
5803
  "start": {
5804
- "line": 320,
5804
+ "line": 321,
5805
5805
  "column": 32,
5806
- "index": 9679
5806
+ "index": 9643
5807
5807
  },
5808
5808
  "end": {
5809
- "line": 323,
5809
+ "line": 324,
5810
5810
  "column": 3,
5811
- "index": 9774
5811
+ "index": 9738
5812
5812
  }
5813
5813
  },
5814
5814
  "filepath": "src/components/resizable_container/resizable_panel.tsx"
@@ -6785,6 +6785,24 @@
6785
6785
  },
6786
6786
  "filepath": "src/components/toast/toast.tsx"
6787
6787
  },
6788
+ {
6789
+ "token": "euiIconTip.defaultAriaLabel",
6790
+ "defString": "Info",
6791
+ "highlighting": "string",
6792
+ "loc": {
6793
+ "start": {
6794
+ "line": 65,
6795
+ "column": 27,
6796
+ "index": 1855
6797
+ },
6798
+ "end": {
6799
+ "line": 65,
6800
+ "column": 76,
6801
+ "index": 1904
6802
+ }
6803
+ },
6804
+ "filepath": "src/components/tool_tip/icon_tip.tsx"
6805
+ },
6788
6806
  {
6789
6807
  "token": "euiTourFooter.endTour",
6790
6808
  "defString": "End tour",
@@ -88,6 +88,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
88
88
  size: "m"
89
89
  }));
90
90
  });
91
+ var renderedChildren = typeof children === 'function' ? children(closeMenu) : children;
91
92
  return (0, _react2.jsx)(_i18n.EuiI18n, {
92
93
  token: "euiHeaderLinks.appNavigation",
93
94
  default: "App menu"
@@ -101,7 +102,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
101
102
  }, (0, _react2.jsx)("div", {
102
103
  className: "euiHeaderLinks__list",
103
104
  css: [styles.euiHeaderLinks__list, styles.gutterSizes[gutterSize], ";label:EuiHeaderLinks;"]
104
- }, children)), (0, _react2.jsx)(_responsive.EuiShowFor, {
105
+ }, renderedChildren)), (0, _react2.jsx)(_responsive.EuiShowFor, {
105
106
  sizes: popoverBreakpoints
106
107
  }, (0, _react2.jsx)(_popover.EuiPopover, _extends({
107
108
  button: button,
@@ -113,7 +114,7 @@ var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
113
114
  }, popoverProps), (0, _react2.jsx)("div", {
114
115
  className: "euiHeaderLinks__mobileList",
115
116
  css: styles.euiHeaderLinks__mobileList
116
- }, children))));
117
+ }, renderedChildren))));
117
118
  });
118
119
  };
119
120
  exports.EuiHeaderLinks = EuiHeaderLinks;
@@ -122,6 +123,13 @@ EuiHeaderLinks.propTypes = {
122
123
  "aria-label": _propTypes.default.string,
123
124
  "data-test-subj": _propTypes.default.string,
124
125
  css: _propTypes.default.any,
126
+ /**
127
+ * Takes any rendered node(s), typically of `EuiHeaderLink`s.
128
+ *
129
+ * Optionally takes a render function that will pass a callback allowing you
130
+ * to close the mobile popover from within your popover content.
131
+ */
132
+ children: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.func.isRequired]),
125
133
  /**
126
134
  * Spacing between direct children
127
135
  */
@@ -244,8 +244,8 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
244
244
  } else {
245
245
  var Svg = icon;
246
246
 
247
- // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true
248
- var isAriaHidden = icon === _empty.icon || !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
247
+ // If there is no aria-label, aria-labelledby, or title it gets aria-hidden true
248
+ var isAriaHidden = !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
249
249
 
250
250
  // If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated
251
251
  // The svg aria-labelledby attribute gets this titleId
@@ -265,7 +265,7 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
265
265
  "data-is-loaded": isLoaded || undefined,
266
266
  "data-is-loading": isLoading || undefined
267
267
  }, rest, {
268
- "aria-hidden": isAriaHidden || undefined
268
+ "aria-hidden": isAriaHidden || rest['aria-hidden']
269
269
  }));
270
270
  }
271
271
  }
@@ -62,11 +62,10 @@ var EuiPanel = function EuiPanel(_ref) {
62
62
  panelRef = _ref.panelRef,
63
63
  element = _ref.element,
64
64
  rest = _objectWithoutProperties(_ref, _excluded);
65
- var euiTheme = (0, _services.useEuiTheme)();
66
65
  // Shadows are only allowed when there's a white background (plain)
67
66
  var canHaveShadow = !hasBorder && color === 'plain';
68
67
  var canHaveBorder = color === 'plain' || color === 'transparent';
69
- var styles = (0, _panel.euiPanelStyles)(euiTheme);
68
+ var styles = (0, _services.useEuiMemoizedStyles)(_panel.euiPanelStyles);
70
69
  var cssStyles = [styles.euiPanel, grow && styles.grow, styles.radius[borderRadius], (0, _global_styling.useEuiPaddingCSS)()[paddingSize], (0, _global_styling.useEuiBackgroundColorCSS)()[color], canHaveShadow && hasShadow === true && styles.hasShadow, canHaveBorder && hasBorder === true && styles.hasBorder, rest.onClick && styles.isClickable];
71
70
  var classes = (0, _classnames.default)('euiPanel', "euiPanel--".concat(color), _defineProperty({}, "euiPanel--".concat(paddingSizeToClassNameMap[paddingSize]), paddingSizeToClassNameMap[paddingSize]), className);
72
71
  if (rest.onClick && element !== 'div') {
@@ -48,8 +48,7 @@ var EuiResizableButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
48
48
  rest = _objectWithoutProperties(_ref, _excluded);
49
49
  var classes = (0, _classnames.default)('euiResizableButton', className);
50
50
  var resizeDirection = isHorizontal ? 'horizontal' : 'vertical';
51
- var euiTheme = (0, _services.useEuiTheme)();
52
- var styles = (0, _resizable_button.euiResizableButtonStyles)(euiTheme);
51
+ var styles = (0, _services.useEuiMemoizedStyles)(_resizable_button.euiResizableButtonStyles);
53
52
  var cssStyles = [styles.euiResizableButton, styles[indicator], styles["".concat(indicator, "Direction")][resizeDirection], styles[resizeDirection], indicator === 'handle' && styles.alignIndicator[alignIndicator]];
54
53
  return (0, _react2.jsx)(_i18n.EuiI18n, {
55
54
  tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
@@ -44,8 +44,7 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
44
44
  var isHorizontal = direction === 'horizontal';
45
45
  var showOnFocus = !isCollapsed && !isVisible;
46
46
  var screenReaderOnlyStyles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus).euiScreenReaderOnly;
47
- var euiTheme = (0, _services.useEuiTheme)();
48
- var styles = (0, _resizable_collapse_button.euiResizableCollapseButtonStyles)(euiTheme);
47
+ var styles = (0, _services.useEuiMemoizedStyles)(_resizable_collapse_button.euiResizableCollapseButtonStyles);
49
48
  var collapsedStyles = [styles.collapsed.collapsed, styles.collapsed[direction], styles.collapsed["".concat(direction, "Positions")][internalPosition]];
50
49
  var collapsibleStyles = [styles.collapsible.collapsible, styles.collapsible[direction][externalPosition], styles.collapsible[direction][internalPosition]];
51
50
  var cssStyles = [styles.euiResizableCollapseButton, showOnFocus && screenReaderOnlyStyles].concat(_toConsumableArray(isCollapsed ? collapsedStyles : collapsibleStyles));
@@ -67,8 +67,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
67
67
  var containerRef = (0, _react.useRef)(null);
68
68
  var isHorizontal = direction === 'horizontal';
69
69
  var classes = (0, _classnames.default)('euiResizableContainer', className);
70
- var styles = (0, _resizable_container.euiResizableContainerStyles)();
71
- var cssStyles = [styles.euiResizableContainer, styles[direction]];
70
+ var cssStyles = [_resizable_container.euiResizableContainerStyles.euiResizableContainer, _resizable_container.euiResizableContainerStyles[direction]];
72
71
  var _useContainerCallback = (0, _helpers.useContainerCallbacks)({
73
72
  initialState: _objectSpread(_objectSpread({}, initialState), {}, {
74
73
  isHorizontal: isHorizontal
@@ -13,19 +13,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
13
13
  * in compliance with, at your election, the Elastic License 2.0 or the Server
14
14
  * Side Public License, v 1.
15
15
  */
16
- var _ref = process.env.NODE_ENV === "production" ? {
17
- name: "omnk2l-vertical",
18
- styles: "flex-direction:column;label:vertical;"
19
- } : {
20
- name: "omnk2l-vertical",
21
- styles: "flex-direction:column;label:vertical;",
22
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
23
- };
24
- var euiResizableContainerStyles = function euiResizableContainerStyles() {
25
- return {
26
- euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
27
- horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
28
- vertical: _ref
29
- };
16
+ var euiResizableContainerStyles = {
17
+ euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
18
+ horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
19
+ vertical: process.env.NODE_ENV === "production" ? {
20
+ name: "omnk2l-vertical",
21
+ styles: "flex-direction:column;label:vertical;"
22
+ } : {
23
+ name: "omnk2l-vertical",
24
+ styles: "flex-direction:column;label:vertical;",
25
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
+ }
30
27
  };
31
28
  exports.euiResizableContainerStyles = euiResizableContainerStyles;
@@ -148,15 +148,13 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
148
148
  return direction;
149
149
  }, [isCollapsed, isCollapsible, position, panels, panelId]);
150
150
  var axis = isHorizontal ? 'horizontal' : 'vertical';
151
- var euiTheme = (0, _services.useEuiTheme)();
152
- var styles = (0, _resizable_panel.euiResizablePanelStyles)(euiTheme);
153
- var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
154
- var contentStyles = (0, _resizable_panel.euiResizablePanelContentStyles)(euiTheme);
151
+ var cssStyles = [_resizable_panel.euiResizablePanelStyles.euiResizablePanel, isCollapsed && _resizable_panel.euiResizablePanelStyles.collapsed, (0, _global_styling.useEuiPaddingCSS)()[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
152
+ var contentStyles = (0, _services.useEuiMemoizedStyles)(_resizable_panel.euiResizablePanelContentStyles);
155
153
  var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
156
154
  var classes = (0, _classnames.default)('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
157
155
  var panelClasses = (0, _classnames.default)('euiResizablePanel__content', className);
158
156
  var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? (0, _global_styling.logicalSizeStyle)("".concat(size || innerSize, "%"), 'auto') : (0, _global_styling.logicalSizeStyle)('100%', "".concat(size || innerSize, "%")));
159
- var padding = (0, _global_styling.euiPaddingSize)(euiTheme, paddingSize) || '0px';
157
+ var padding = (0, _global_styling.useEuiPaddingSize)(paddingSize) || '0px';
160
158
  (0, _react.useEffect)(function () {
161
159
  if (!registration) return;
162
160
  var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.euiResizablePanelStyles = exports.euiResizablePanelContentStyles = void 0;
8
7
  var _react = require("@emotion/react");
9
8
  var _global_styling = require("../../global_styling");
10
- 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; }
11
- 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; }
12
- 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; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- 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); }
15
9
  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)."; } /*
16
10
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
11
  * or more contributor license agreements. Licensed under the Elastic License
@@ -19,28 +13,23 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
19
13
  * in compliance with, at your election, the Elastic License 2.0 or the Server
20
14
  * Side Public License, v 1.
21
15
  */
22
- var _ref2 = process.env.NODE_ENV === "production" ? {
23
- name: "11qmbh3-collapsed",
24
- styles: "overflow:hidden;label:collapsed;"
25
- } : {
26
- name: "11qmbh3-collapsed",
27
- styles: "overflow:hidden;label:collapsed;",
28
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
- };
30
- var _ref3 = process.env.NODE_ENV === "production" ? {
31
- name: "15ifdgc-euiResizablePanel",
32
- styles: "position:relative;label:euiResizablePanel;"
33
- } : {
34
- name: "15ifdgc-euiResizablePanel",
35
- styles: "position:relative;label:euiResizablePanel;",
36
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
37
- };
38
- var euiResizablePanelStyles = function euiResizablePanelStyles(euiThemeContext) {
39
- return {
40
- euiResizablePanel: _ref3,
41
- collapsed: _ref2,
42
- paddingSizes: _objectSpread({}, (0, _global_styling.euiPaddingSizeCSS)(euiThemeContext))
43
- };
16
+ var euiResizablePanelStyles = {
17
+ euiResizablePanel: process.env.NODE_ENV === "production" ? {
18
+ name: "15ifdgc-euiResizablePanel",
19
+ styles: "position:relative;label:euiResizablePanel;"
20
+ } : {
21
+ name: "15ifdgc-euiResizablePanel",
22
+ styles: "position:relative;label:euiResizablePanel;",
23
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
24
+ },
25
+ collapsed: process.env.NODE_ENV === "production" ? {
26
+ name: "11qmbh3-collapsed",
27
+ styles: "overflow:hidden;label:collapsed;"
28
+ } : {
29
+ name: "11qmbh3-collapsed",
30
+ styles: "overflow:hidden;label:collapsed;",
31
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
32
+ }
44
33
  };
45
34
  exports.euiResizablePanelStyles = euiResizablePanelStyles;
46
35
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -427,14 +427,33 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
427
427
  key: "componentDidUpdate",
428
428
  value: function componentDidUpdate(prevProps) {
429
429
  var _this$props9 = this.props,
430
+ isVirtualized = _this$props9.isVirtualized,
430
431
  activeOptionIndex = _this$props9.activeOptionIndex,
431
432
  visibleOptions = _this$props9.visibleOptions,
432
433
  options = _this$props9.options;
433
- if (this.listBoxRef && this.props.searchable !== true) {
434
- this.listBoxRef.setAttribute('aria-activedescendant', "".concat(this.props.makeOptionId(activeOptionIndex)));
435
- }
436
- if (this.listRef && typeof activeOptionIndex !== 'undefined') {
437
- this.listRef.scrollToItem(activeOptionIndex, 'auto');
434
+ if (prevProps.activeOptionIndex !== activeOptionIndex) {
435
+ var makeOptionId = this.props.makeOptionId;
436
+ if (this.listBoxRef && this.props.searchable !== true) {
437
+ this.listBoxRef.setAttribute('aria-activedescendant', makeOptionId(activeOptionIndex));
438
+ }
439
+ if (typeof activeOptionIndex !== 'undefined') {
440
+ if (isVirtualized) {
441
+ var _this$listRef;
442
+ (_this$listRef = this.listRef) === null || _this$listRef === void 0 ? void 0 : _this$listRef.scrollToItem(activeOptionIndex, 'auto');
443
+ } else {
444
+ var _this$listBoxRef;
445
+ var activeOptionId = "#".concat(makeOptionId(activeOptionIndex));
446
+ var activeOptionEl = (_this$listBoxRef = this.listBoxRef) === null || _this$listBoxRef === void 0 ? void 0 : _this$listBoxRef.querySelector(activeOptionId);
447
+ if (activeOptionEl) {
448
+ var _activeOptionEl$scrol;
449
+ // TODO: we can remove scrollIntoView's conditional chaining once jsdom stubs it
450
+ // @see https://github.com/jsdom/jsdom/issues/1695
451
+ (_activeOptionEl$scrol = activeOptionEl.scrollIntoView) === null || _activeOptionEl$scrol === void 0 ? void 0 : _activeOptionEl$scrol.call(activeOptionEl, {
452
+ block: 'nearest'
453
+ });
454
+ }
455
+ }
456
+ }
438
457
  }
439
458
  if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
440
459
  var optionArray = visibleOptions || options;
@@ -477,14 +496,18 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
477
496
  textWrap = _this$props10.textWrap,
478
497
  truncationProps = _this$props10.truncationProps,
479
498
  rest = _objectWithoutProperties(_this$props10, _excluded3);
499
+ var heightIsFull = forcedHeight === 'full';
480
500
  var classes = (0, _classnames.default)('euiSelectableList', {
481
- 'euiSelectableList-fullHeight': forcedHeight === 'full',
501
+ 'euiSelectableList-fullHeight': heightIsFull,
482
502
  'euiSelectableList-bordered': bordered
483
503
  }, className);
484
504
  return (0, _react2.jsx)("div", _extends({
485
505
  className: classes
486
506
  }, rest), isVirtualized ? this.renderVirtualizedList() : (0, _react2.jsx)("div", {
487
507
  className: "euiSelectableList__list",
508
+ style: !heightIsFull ? {
509
+ blockSize: forcedHeight
510
+ } : undefined,
488
511
  ref: this.removeScrollableTabStop
489
512
  }, (0, _react2.jsx)("ul", {
490
513
  ref: this.setListBoxRef
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EuiIconTip = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _i18n = require("../i18n");
9
10
  var _icon = require("../icon");
10
11
  var _tool_tip = require("./tool_tip");
11
12
  var _react2 = require("@emotion/react");
@@ -24,8 +25,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
24
25
  var EuiIconTip = function EuiIconTip(_ref) {
25
26
  var _ref$type = _ref.type,
26
27
  type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
27
- _ref$ariaLabel = _ref['aria-label'],
28
- ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
28
+ ariaLabel = _ref['aria-label'],
29
29
  color = _ref.color,
30
30
  size = _ref.size,
31
31
  iconProps = _ref.iconProps,
@@ -34,6 +34,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
34
34
  _ref$delay = _ref.delay,
35
35
  delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
36
36
  rest = _objectWithoutProperties(_ref, _excluded);
37
+ var defaultAriaLabel = (0, _i18n.useEuiI18n)('euiIconTip.defaultAriaLabel', 'Info');
37
38
  return (0, _react2.jsx)(_tool_tip.EuiToolTip, _extends({
38
39
  position: position,
39
40
  delay: delay
@@ -42,7 +43,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
42
43
  type: type,
43
44
  color: color,
44
45
  size: size,
45
- "aria-label": ariaLabel
46
+ "aria-label": ariaLabel || defaultAriaLabel
46
47
  }, iconProps)));
47
48
  };
48
49
  exports.EuiIconTip = EuiIconTip;