@elastic/eui 70.2.3 → 70.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.
Files changed (143) hide show
  1. package/dist/eui_theme_dark.css +0 -198
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -198
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accessibility/skip_link/skip_link.js +6 -5
  6. package/es/components/badge/beta_badge/beta_badge.js +11 -3
  7. package/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
  8. package/es/components/card/card.js +6 -1
  9. package/es/components/card/card.styles.js +4 -4
  10. package/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +109 -0
  11. package/es/components/flex/flex_group.styles.js +1 -1
  12. package/es/components/flyout/flyout.a11y.js +92 -0
  13. package/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
  14. package/es/components/modal/confirm_modal.js +11 -0
  15. package/es/components/modal/modal.a11y.js +70 -0
  16. package/es/components/modal/modal.js +17 -27
  17. package/es/components/modal/modal.styles.js +23 -0
  18. package/es/components/modal/modal_body.js +8 -0
  19. package/es/components/modal/modal_body.styles.js +16 -0
  20. package/es/components/modal/modal_footer.js +6 -0
  21. package/es/components/modal/modal_footer.styles.js +15 -0
  22. package/es/components/modal/modal_header.js +6 -0
  23. package/es/components/modal/modal_header.styles.js +14 -0
  24. package/es/components/modal/modal_header_title.js +3 -1
  25. package/es/components/page_template/outer/page_outer.js +1 -1
  26. package/es/components/page_template/page_template.js +28 -6
  27. package/es/components/popover/popover.a11y.js +83 -0
  28. package/es/components/search_bar/query/default_syntax.js +2 -1
  29. package/es/components/tabs/tabs.a11y.js +97 -0
  30. package/es/components/tree_view/tree_view.a11y.js +74 -0
  31. package/es/global_styling/utility/animations.js +5 -2
  32. package/eui.d.ts +58 -7
  33. package/i18ntokens.json +2 -2
  34. package/lib/components/accessibility/skip_link/skip_link.js +6 -5
  35. package/lib/components/badge/beta_badge/beta_badge.js +13 -4
  36. package/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
  37. package/lib/components/card/card.js +6 -1
  38. package/lib/components/card/card.styles.js +4 -4
  39. package/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  40. package/lib/components/flex/flex_group.styles.js +1 -1
  41. package/lib/components/flyout/flyout.a11y.js +94 -0
  42. package/lib/components/image/image_fullscreen_wrapper.styles.js +9 -10
  43. package/lib/components/modal/confirm_modal.js +13 -0
  44. package/lib/components/modal/modal.a11y.js +73 -0
  45. package/lib/components/modal/modal.js +17 -32
  46. package/lib/components/modal/modal.styles.js +36 -0
  47. package/lib/components/modal/modal_body.js +10 -0
  48. package/lib/components/modal/modal_body.styles.js +27 -0
  49. package/lib/components/modal/modal_footer.js +8 -0
  50. package/lib/components/modal/modal_footer.styles.js +26 -0
  51. package/lib/components/modal/modal_header.js +8 -0
  52. package/lib/components/modal/modal_header.styles.js +24 -0
  53. package/lib/components/modal/modal_header_title.js +4 -1
  54. package/lib/components/page_template/outer/page_outer.js +1 -1
  55. package/lib/components/page_template/page_template.js +32 -10
  56. package/lib/components/popover/popover.a11y.js +86 -0
  57. package/lib/components/search_bar/query/default_syntax.js +2 -1
  58. package/lib/components/tabs/tabs.a11y.js +98 -0
  59. package/lib/components/tree_view/tree_view.a11y.js +80 -0
  60. package/lib/global_styling/utility/animations.js +9 -3
  61. package/optimize/es/components/accessibility/skip_link/skip_link.js +6 -5
  62. package/optimize/es/components/badge/beta_badge/beta_badge.js +5 -2
  63. package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
  64. package/optimize/es/components/card/card.styles.js +4 -4
  65. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +98 -0
  66. package/optimize/es/components/flex/flex_group.styles.js +1 -1
  67. package/optimize/es/components/flyout/flyout.a11y.js +77 -0
  68. package/optimize/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
  69. package/optimize/es/components/modal/confirm_modal.js +6 -0
  70. package/optimize/es/components/modal/modal.a11y.js +60 -0
  71. package/optimize/es/components/modal/modal.js +17 -27
  72. package/optimize/es/components/modal/modal.styles.js +23 -0
  73. package/optimize/es/components/modal/modal_body.js +8 -0
  74. package/optimize/es/components/modal/modal_body.styles.js +16 -0
  75. package/optimize/es/components/modal/modal_footer.js +6 -0
  76. package/optimize/es/components/modal/modal_footer.styles.js +15 -0
  77. package/optimize/es/components/modal/modal_header.js +6 -0
  78. package/optimize/es/components/modal/modal_header.styles.js +14 -0
  79. package/optimize/es/components/modal/modal_header_title.js +3 -1
  80. package/optimize/es/components/page_template/page_template.js +5 -3
  81. package/optimize/es/components/popover/popover.a11y.js +73 -0
  82. package/optimize/es/components/search_bar/query/default_syntax.js +2 -1
  83. package/optimize/es/components/tabs/tabs.a11y.js +97 -0
  84. package/optimize/es/components/tree_view/tree_view.a11y.js +74 -0
  85. package/optimize/es/global_styling/utility/animations.js +5 -2
  86. package/optimize/lib/components/accessibility/skip_link/skip_link.js +6 -5
  87. package/optimize/lib/components/badge/beta_badge/beta_badge.js +7 -3
  88. package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
  89. package/optimize/lib/components/card/card.styles.js +4 -4
  90. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  91. package/optimize/lib/components/flex/flex_group.styles.js +1 -1
  92. package/optimize/lib/components/flyout/flyout.a11y.js +84 -0
  93. package/optimize/lib/components/image/image_fullscreen_wrapper.styles.js +9 -12
  94. package/optimize/lib/components/modal/confirm_modal.js +8 -0
  95. package/optimize/lib/components/modal/modal.a11y.js +73 -0
  96. package/optimize/lib/components/modal/modal.js +17 -31
  97. package/optimize/lib/components/modal/modal.styles.js +36 -0
  98. package/optimize/lib/components/modal/modal_body.js +10 -0
  99. package/optimize/lib/components/modal/modal_body.styles.js +27 -0
  100. package/optimize/lib/components/modal/modal_footer.js +8 -0
  101. package/optimize/lib/components/modal/modal_footer.styles.js +26 -0
  102. package/optimize/lib/components/modal/modal_header.js +8 -0
  103. package/optimize/lib/components/modal/modal_header.styles.js +24 -0
  104. package/optimize/lib/components/modal/modal_header_title.js +4 -1
  105. package/optimize/lib/components/page_template/page_template.js +5 -3
  106. package/optimize/lib/components/popover/popover.a11y.js +86 -0
  107. package/optimize/lib/components/search_bar/query/default_syntax.js +2 -1
  108. package/optimize/lib/components/tabs/tabs.a11y.js +98 -0
  109. package/optimize/lib/components/tree_view/tree_view.a11y.js +80 -0
  110. package/optimize/lib/global_styling/utility/animations.js +9 -3
  111. package/package.json +5 -4
  112. package/src/components/index.scss +0 -1
  113. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  114. package/test-env/components/accessibility/skip_link/skip_link.js +6 -5
  115. package/test-env/components/badge/beta_badge/beta_badge.js +13 -4
  116. package/test-env/components/badge/beta_badge/beta_badge.styles.js +25 -4
  117. package/test-env/components/card/card.js +6 -1
  118. package/test-env/components/card/card.styles.js +4 -4
  119. package/test-env/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  120. package/test-env/components/flex/flex_group.styles.js +1 -1
  121. package/test-env/components/flyout/flyout.a11y.js +84 -0
  122. package/test-env/components/image/image_fullscreen_wrapper.styles.js +9 -12
  123. package/test-env/components/modal/confirm_modal.js +13 -0
  124. package/test-env/components/modal/modal.a11y.js +73 -0
  125. package/test-env/components/modal/modal.js +17 -31
  126. package/test-env/components/modal/modal.styles.js +36 -0
  127. package/test-env/components/modal/modal_body.js +10 -0
  128. package/test-env/components/modal/modal_body.styles.js +27 -0
  129. package/test-env/components/modal/modal_footer.js +8 -0
  130. package/test-env/components/modal/modal_footer.styles.js +26 -0
  131. package/test-env/components/modal/modal_header.js +8 -0
  132. package/test-env/components/modal/modal_header.styles.js +24 -0
  133. package/test-env/components/modal/modal_header_title.js +4 -1
  134. package/test-env/components/page_template/outer/page_outer.js +1 -1
  135. package/test-env/components/page_template/page_template.js +32 -10
  136. package/test-env/components/popover/popover.a11y.js +86 -0
  137. package/test-env/components/search_bar/query/default_syntax.js +2 -1
  138. package/test-env/components/tabs/tabs.a11y.js +98 -0
  139. package/test-env/components/tree_view/tree_view.a11y.js +80 -0
  140. package/test-env/global_styling/utility/animations.js +9 -3
  141. package/src/components/modal/_index.scss +0 -1
  142. package/src/components/modal/_modal.scss +0 -156
  143. package/src/themes/amsterdam/overrides/_modal.scss +0 -3
package/eui.d.ts CHANGED
@@ -7567,6 +7567,7 @@ declare module '@elastic/eui/src/global_styling/reset/global_styles' {
7567
7567
  }
7568
7568
  declare module '@elastic/eui/src/global_styling/utility/animations' {
7569
7569
  export const euiAnimFadeIn: import("@emotion/serialize").Keyframes;
7570
+ export const euiAnimSlideInUp: (size: string) => import("@emotion/serialize").Keyframes;
7570
7571
 
7571
7572
  }
7572
7573
  declare module '@elastic/eui/src/global_styling' {
@@ -8086,6 +8087,8 @@ declare module '@elastic/eui/src/components/badge/beta_badge/beta_badge.styles'
8086
8087
  };
8087
8088
  };
8088
8089
  euiBetaBadge__icon: import("@emotion/utils").SerializedStyles;
8090
+ baseline: import("@emotion/utils").SerializedStyles;
8091
+ middle: import("@emotion/utils").SerializedStyles;
8089
8092
  };
8090
8093
  export const getBadgeColors: (backgroundColor: string, { euiTheme }: UseEuiTheme) => string;
8091
8094
 
@@ -8098,7 +8101,9 @@ declare module '@elastic/eui/src/components/badge/beta_badge/beta_badge' {
8098
8101
  export const COLORS: readonly ["accent", "subdued", "hollow"];
8099
8102
  export type BetaBadgeColor = typeof COLORS[number];
8100
8103
  export const SIZES: readonly ["s", "m"];
8101
- export type BetaBadgeSize = typeof SIZES[number]; type WithButtonProps = {
8104
+ export type BetaBadgeSize = typeof SIZES[number];
8105
+ export const ALIGNMENTS: readonly ["baseline", "middle"];
8106
+ export type BetaBadgeAlignment = typeof ALIGNMENTS[number]; type WithButtonProps = {
8102
8107
  /**
8103
8108
  * Will apply an onclick to the badge itself
8104
8109
  */
@@ -8155,6 +8160,10 @@ declare module '@elastic/eui/src/components/badge/beta_badge/beta_badge' {
8155
8160
  */
8156
8161
  color?: BetaBadgeColor;
8157
8162
  size?: BetaBadgeSize;
8163
+ /**
8164
+ * Sets the `vertical-align` CSS property
8165
+ */
8166
+ alignment?: BetaBadgeAlignment;
8158
8167
  } & ExclusiveUnion<LabelAsNode, LabelAsString>;
8159
8168
  export type EuiBetaBadgeProps = CommonProps & ExclusiveUnion<ExclusiveUnion<WithButtonProps, WithAnchorProps>, WithSpanProps> & BadgeProps;
8160
8169
  export const EuiBetaBadge: FunctionComponent<EuiBetaBadgeProps>;
@@ -15487,6 +15496,16 @@ declare module '@elastic/eui/src/components/markdown_editor/markdown_format' {
15487
15496
  };
15488
15497
  export const EuiMarkdownFormat: FunctionComponent<EuiMarkdownFormatProps>;
15489
15498
 
15499
+ }
15500
+ declare module '@elastic/eui/src/components/modal/modal.styles' {
15501
+ import { UseEuiTheme } from '@elastic/eui/src/services';
15502
+ export const euiModalStyles: (euiThemeContext: UseEuiTheme) => {
15503
+ euiModal: import("@emotion/utils").SerializedStyles;
15504
+ defaultMaxWidth: import("@emotion/utils").SerializedStyles;
15505
+ confirmation: import("@emotion/utils").SerializedStyles;
15506
+ euiModal__closeIcon: import("@emotion/utils").SerializedStyles;
15507
+ };
15508
+
15490
15509
  }
15491
15510
  declare module '@elastic/eui/src/components/modal/modal' {
15492
15511
  import React, { FunctionComponent, ReactNode, HTMLAttributes } from 'react';
@@ -15513,6 +15532,13 @@ declare module '@elastic/eui/src/components/modal/modal' {
15513
15532
  }
15514
15533
  export const EuiModal: FunctionComponent<EuiModalProps>;
15515
15534
 
15535
+ }
15536
+ declare module '@elastic/eui/src/components/modal/modal_footer.styles' {
15537
+ import { UseEuiTheme } from '@elastic/eui/src/services';
15538
+ export const euiModalFooterStyles: (euiThemeContext: UseEuiTheme) => {
15539
+ euiModalFooter: import("@emotion/utils").SerializedStyles;
15540
+ };
15541
+
15516
15542
  }
15517
15543
  declare module '@elastic/eui/src/components/modal/modal_footer' {
15518
15544
  import { FunctionComponent, HTMLAttributes } from 'react';
@@ -15520,6 +15546,13 @@ declare module '@elastic/eui/src/components/modal/modal_footer' {
15520
15546
  export type EuiModalFooterProps = FunctionComponent<HTMLAttributes<HTMLDivElement> & CommonProps>;
15521
15547
  export const EuiModalFooter: EuiModalFooterProps;
15522
15548
 
15549
+ }
15550
+ declare module '@elastic/eui/src/components/modal/modal_header.styles' {
15551
+ import { UseEuiTheme } from '@elastic/eui/src/services';
15552
+ export const euiModalHeaderStyles: (euiThemeContext: UseEuiTheme) => {
15553
+ euiModalHeader: import("@emotion/utils").SerializedStyles;
15554
+ };
15555
+
15523
15556
  }
15524
15557
  declare module '@elastic/eui/src/components/modal/modal_header' {
15525
15558
  import { FunctionComponent, HTMLAttributes } from 'react';
@@ -15534,6 +15567,14 @@ declare module '@elastic/eui/src/components/modal/modal_header_title' {
15534
15567
  export type EuiModalHeaderTitleProps = FunctionComponent<HTMLAttributes<HTMLDivElement> & CommonProps>;
15535
15568
  export const EuiModalHeaderTitle: EuiModalHeaderTitleProps;
15536
15569
 
15570
+ }
15571
+ declare module '@elastic/eui/src/components/modal/modal_body.styles' {
15572
+ import { UseEuiTheme } from '@elastic/eui/src/services';
15573
+ export const euiModalBodyStyles: (euiThemeContext: UseEuiTheme) => {
15574
+ euiModalBody: import("@emotion/utils").SerializedStyles;
15575
+ euiModalBody__overflow: import("@emotion/utils").SerializedStyles;
15576
+ };
15577
+
15537
15578
  }
15538
15579
  declare module '@elastic/eui/src/components/modal/modal_body' {
15539
15580
  import { FunctionComponent, HTMLAttributes } from 'react';
@@ -15546,7 +15587,7 @@ declare module '@elastic/eui/src/components/modal/confirm_modal' {
15546
15587
  import React, { FunctionComponent, ReactNode } from 'react';
15547
15588
  import { EuiModalProps } from '@elastic/eui/src/components/modal/modal';
15548
15589
  import { EuiButtonColor } from '@elastic/eui/src/components/button';
15549
- export interface EuiConfirmModalProps extends Omit<EuiModalProps, 'children' | 'initialFocus' | 'onClose' | 'title'> {
15590
+ export interface EuiConfirmModalProps extends Omit<EuiModalProps, 'children' | 'onClose' | 'title'> {
15550
15591
  /**
15551
15592
  * ReactNode to render as this component's content
15552
15593
  */
@@ -15558,6 +15599,10 @@ declare module '@elastic/eui/src/components/modal/confirm_modal' {
15558
15599
  onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
15559
15600
  confirmButtonDisabled?: boolean;
15560
15601
  className?: string;
15602
+ /**
15603
+ * Allows focusing either the confirm or cancel button on modal initialization.
15604
+ * Will take precedence over `initialFocus`, if `initialFocus` is passed.
15605
+ */
15561
15606
  defaultFocusedButton?: typeof CONFIRM_BUTTON | typeof CANCEL_BUTTON;
15562
15607
  buttonColor?: EuiButtonColor;
15563
15608
  /**
@@ -16506,7 +16551,7 @@ declare module '@elastic/eui/src/components/page_template/outer/page_outer' {
16506
16551
  */
16507
16552
  direction?: 'row' | 'column';
16508
16553
  /**
16509
- * When direction is `row`, it will flip to `column` when within these breakpoints
16554
+ * When direction is `row`, it will flip to `column` when within these breakpoints.
16510
16555
  */
16511
16556
  responsive?: _EuiThemeBreakpoint[];
16512
16557
  }
@@ -16533,7 +16578,8 @@ declare module '@elastic/eui/src/components/page_template/inner/page_inner.style
16533
16578
  declare module '@elastic/eui/src/components/page_template/inner/page_inner' {
16534
16579
  import React, { PropsWithChildren, ComponentType, ComponentProps } from 'react';
16535
16580
  import { CommonProps } from '@elastic/eui/src/components/common';
16536
- import { EuiPaddingSize, _EuiThemeBreakpoint } from '@elastic/eui/src/global_styling'; type ComponentTypes = keyof JSX.IntrinsicElements | ComponentType;
16581
+ import { EuiPaddingSize, _EuiThemeBreakpoint } from '@elastic/eui/src/global_styling';
16582
+ export type ComponentTypes = keyof JSX.IntrinsicElements | ComponentType;
16537
16583
  export type _EuiPageInnerProps<T extends ComponentTypes = 'main'> = CommonProps & ComponentProps<T> & {
16538
16584
  /**
16539
16585
  * Sets which HTML element to render.
@@ -16553,12 +16599,11 @@ declare module '@elastic/eui/src/components/page_template/inner/page_inner' {
16553
16599
  */
16554
16600
  paddingSize?: EuiPaddingSize;
16555
16601
  /**
16556
- * Decides at which point the component will be 100vw.
16602
+ * Decides at which point the main content wrapper will be 100vw.
16557
16603
  */
16558
16604
  responsive?: _EuiThemeBreakpoint[];
16559
16605
  };
16560
16606
  export const _EuiPageInner: <T extends ComponentTypes>({ children, component: Component, panelled, border, paddingSize, responsive, ...rest }: React.PropsWithChildren<_EuiPageInnerProps<T>>) => JSX.Element;
16561
- export {};
16562
16607
 
16563
16608
  }
16564
16609
  declare module '@elastic/eui/src/components/page_template/inner' {
@@ -16594,6 +16639,7 @@ declare module '@elastic/eui/src/components/page_template/page_template' {
16594
16639
  import React, { CSSProperties, FunctionComponent, HTMLAttributes } from 'react';
16595
16640
  import { _EuiPageOuterProps } from '@elastic/eui/src/components/page_template/outer';
16596
16641
  import { _EuiPageInnerProps } from '@elastic/eui/src/components/page_template/inner';
16642
+ import { ComponentTypes } from '@elastic/eui/src/components/page_template/inner/page_inner';
16597
16643
  import { _EuiPageBottomBarProps } from '@elastic/eui/src/components/page_template/bottom_bar/page_bottom_bar';
16598
16644
  import { _EuiPageEmptyPromptProps } from '@elastic/eui/src/components/page_template/empty_prompt/page_empty_prompt';
16599
16645
  import { EuiPageHeaderProps, EuiPageSectionProps } from '@elastic/eui/src/components/page';
@@ -16606,7 +16652,7 @@ declare module '@elastic/eui/src/components/page_template/page_template' {
16606
16652
  emptyPrompt: {};
16607
16653
  bottomBar: {};
16608
16654
  }>;
16609
- export type EuiPageTemplateProps = _EuiPageOuterProps & Omit<_EuiPageInnerProps, 'border'> & _EuiPageRestrictWidth & _EuiPageBottomBorder & {
16655
+ export type EuiPageTemplateProps = _EuiPageOuterProps & Omit<_EuiPageInnerProps, 'border' | 'component'> & _EuiPageRestrictWidth & _EuiPageBottomBorder & {
16610
16656
  /**
16611
16657
  * Applies a top or left border to the inner contents
16612
16658
  * to add separation between content and sidebar when a sidebar exists.
@@ -16626,6 +16672,11 @@ declare module '@elastic/eui/src/components/page_template/page_template' {
16626
16672
  * Passes through some common HTML attributes to the `main` content wrapper
16627
16673
  */
16628
16674
  mainProps?: CommonProps & HTMLAttributes<HTMLElement>;
16675
+ /**
16676
+ * Sets which HTML element to render for the `main` content wrapper
16677
+ * @default main
16678
+ */
16679
+ component?: ComponentTypes;
16629
16680
  };
16630
16681
  /**
16631
16682
  * Consumed via `EuiPageTemplate`,
package/i18ntokens.json CHANGED
@@ -4661,11 +4661,11 @@
4661
4661
  "highlighting": "string",
4662
4662
  "loc": {
4663
4663
  "start": {
4664
- "line": 107,
4664
+ "line": 93,
4665
4665
  "column": 10
4666
4666
  },
4667
4667
  "end": {
4668
- "line": 110,
4668
+ "line": 96,
4669
4669
  "column": 11
4670
4670
  }
4671
4671
  },
@@ -93,15 +93,16 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
93
93
 
94
94
  setHasValidId(false); // If no valid element via ID is available, use the fallback query selectors
95
95
 
96
- var fallbackEl = document.querySelector(fallbackDestination);
96
+ if (fallbackDestination) {
97
+ var fallbackEl = document.querySelector(fallbackDestination);
97
98
 
98
- if (fallbackEl) {
99
- setDestinationEl(fallbackEl);
99
+ if (fallbackEl) {
100
+ setDestinationEl(fallbackEl);
101
+ }
100
102
  }
101
103
  }, [destinationId, fallbackDestination]);
102
104
  var onClick = (0, _react.useCallback)(function (e) {
103
- if (overrideLinkBehavior || !hasValidId) {
104
- if (!destinationEl) return;
105
+ if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
105
106
  e.preventDefault(); // Scroll to the top of the destination content only if it's ~mostly out of view
106
107
 
107
108
  var destinationY = destinationEl.getBoundingClientRect().top;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SIZES = exports.EuiBetaBadge = exports.COLORS = void 0;
6
+ exports.SIZES = exports.EuiBetaBadge = exports.COLORS = exports.ALIGNMENTS = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -21,7 +21,7 @@ var _beta_badge = require("./beta_badge.styles");
21
21
 
22
22
  var _react2 = require("@emotion/react");
23
23
 
24
- var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
24
+ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size", "alignment"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -37,6 +37,8 @@ var COLORS = ['accent', 'subdued', 'hollow'];
37
37
  exports.COLORS = COLORS;
38
38
  var SIZES = ['s', 'm'];
39
39
  exports.SIZES = SIZES;
40
+ var ALIGNMENTS = ['baseline', 'middle'];
41
+ exports.ALIGNMENTS = ALIGNMENTS;
40
42
 
41
43
  var EuiBetaBadge = function EuiBetaBadge(_ref) {
42
44
  var className = _ref.className,
@@ -56,6 +58,8 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
56
58
  target = _ref.target,
57
59
  _ref$size = _ref.size,
58
60
  size = _ref$size === void 0 ? 'm' : _ref$size,
61
+ _ref$alignment = _ref.alignment,
62
+ alignment = _ref$alignment === void 0 ? 'baseline' : _ref$alignment,
59
63
  rest = _objectWithoutProperties(_ref, _excluded);
60
64
 
61
65
  var euiTheme = (0, _services.useEuiTheme)();
@@ -63,7 +67,7 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
63
67
  var isCircular = iconType || singleLetter;
64
68
  var classes = (0, _classnames.default)('euiBetaBadge', className);
65
69
  var styles = (0, _beta_badge.euiBetaBadgeStyles)(euiTheme);
66
- var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
70
+ var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], styles[alignment], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
67
71
  var icon;
68
72
 
69
73
  if (iconType) {
@@ -208,5 +212,10 @@ EuiBetaBadge.propTypes = {
208
212
  * Accepts accent, subdued and hollow.
209
213
  */
210
214
  color: _propTypes.default.any,
211
- size: _propTypes.default.any
215
+ size: _propTypes.default.any,
216
+
217
+ /**
218
+ * Sets the `vertical-align` CSS property
219
+ */
220
+ alignment: _propTypes.default.any
212
221
  };
@@ -26,6 +26,24 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
26
26
  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)."; }
27
27
 
28
28
  var _ref = process.env.NODE_ENV === "production" ? {
29
+ name: "l1nme7-middle",
30
+ styles: "vertical-align:middle;label:middle;"
31
+ } : {
32
+ name: "l1nme7-middle",
33
+ styles: "vertical-align:middle;label:middle;",
34
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
35
+ };
36
+
37
+ var _ref2 = process.env.NODE_ENV === "production" ? {
38
+ name: "19hexhy-baseline",
39
+ styles: "vertical-align:baseline;label:baseline;"
40
+ } : {
41
+ name: "19hexhy-baseline",
42
+ styles: "vertical-align:baseline;label:baseline;",
43
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
44
+ };
45
+
46
+ var _ref3 = process.env.NODE_ENV === "production" ? {
29
47
  name: "pzpqqg-euiBetaBadge__icon",
30
48
  styles: "position:relative;transform:translate(0, -1px);label:euiBetaBadge__icon;"
31
49
  } : {
@@ -38,7 +56,7 @@ var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
38
56
  var euiTheme = euiThemeContext.euiTheme,
39
57
  colorMode = euiThemeContext.colorMode;
40
58
  return {
41
- euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:super;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.bold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
59
+ euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.bold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
42
60
  color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
43
61
  }), ";};label:euiBetaBadge;"),
44
62
  // Colors
@@ -64,15 +82,18 @@ var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
64
82
  })), "\n ")
65
83
  }
66
84
  },
67
- euiBetaBadge__icon: _ref
85
+ euiBetaBadge__icon: _ref3,
86
+ // Alignments
87
+ baseline: _ref2,
88
+ middle: _ref
68
89
  };
69
90
  }; // Util for detecting text color based on badge bg color
70
91
 
71
92
 
72
93
  exports.euiBetaBadgeStyles = euiBetaBadgeStyles;
73
94
 
74
- var getBadgeColors = function getBadgeColors(backgroundColor, _ref2) {
75
- var euiTheme = _ref2.euiTheme;
95
+ var getBadgeColors = function getBadgeColors(backgroundColor, _ref4) {
96
+ var euiTheme = _ref4.euiTheme;
76
97
  var textColor = _services.isColorDark.apply(void 0, _toConsumableArray((0, _services.hexToRgb)(backgroundColor))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
77
98
  return "\n background-color: ".concat(backgroundColor, ";\n color: ").concat(textColor, ";\n ");
78
99
  };
@@ -448,7 +448,12 @@ EuiCard.propTypes = {
448
448
  * Accepts accent, subdued and hollow.
449
449
  */
450
450
  color: _propTypes.default.any,
451
- size: _propTypes.default.any
451
+ size: _propTypes.default.any,
452
+
453
+ /**
454
+ * Sets the `vertical-align` CSS property
455
+ */
456
+ alignment: _propTypes.default.any
452
457
  }),
453
458
 
454
459
  /**
@@ -58,11 +58,11 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
58
58
  };
59
59
 
60
60
  var _ref6 = process.env.NODE_ENV === "production" ? {
61
- name: "z24364-euiCard__main",
62
- styles: "display:flex;label:euiCard__main;"
61
+ name: "31kq8f-euiCard__main",
62
+ styles: "display:flex;inline-size:100%;label:euiCard__main;"
63
63
  } : {
64
- name: "z24364-euiCard__main",
65
- styles: "display:flex;label:euiCard__main;",
64
+ name: "31kq8f-euiCard__main",
65
+ styles: "display:flex;inline-size:100%;label:euiCard__main;",
66
66
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
67
67
  };
68
68
 
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ var _react = _interopRequireWildcard(require("react"));
6
+
7
+ var _super_date_picker = require("./super_date_picker");
8
+
9
+ var _react2 = require("@emotion/react");
10
+
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+
15
+ 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); }
16
+
17
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
+
19
+ 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."); }
20
+
21
+ 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); }
22
+
23
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
24
+
25
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
26
+
27
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
+
29
+ var SuperDatePicker = function SuperDatePicker() {
30
+ var _useState = (0, _react.useState)(false),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ isLoading = _useState2[0],
33
+ setIsLoading = _useState2[1];
34
+
35
+ var _useState3 = (0, _react.useState)(true),
36
+ _useState4 = _slicedToArray(_useState3, 1),
37
+ showUpdateButton = _useState4[0];
38
+
39
+ var _useState5 = (0, _react.useState)('now-30m'),
40
+ _useState6 = _slicedToArray(_useState5, 2),
41
+ start = _useState6[0],
42
+ setStart = _useState6[1];
43
+
44
+ var _useState7 = (0, _react.useState)('now'),
45
+ _useState8 = _slicedToArray(_useState7, 2),
46
+ end = _useState8[0],
47
+ setEnd = _useState8[1];
48
+
49
+ var _useState9 = (0, _react.useState)(true),
50
+ _useState10 = _slicedToArray(_useState9, 1),
51
+ showFill = _useState10[0];
52
+
53
+ var onTimeChange = function onTimeChange(_ref) {
54
+ var start = _ref.start,
55
+ end = _ref.end;
56
+ setStart(start);
57
+ setEnd(end);
58
+ setIsLoading(true);
59
+ startLoading();
60
+ };
61
+
62
+ var startLoading = function startLoading() {
63
+ setTimeout(stopLoading, 1000);
64
+ };
65
+
66
+ var stopLoading = function stopLoading() {
67
+ setIsLoading(false);
68
+ };
69
+
70
+ var datepickerProps = {
71
+ isLoading: isLoading,
72
+ start: start,
73
+ end: end,
74
+ onTimeChange: onTimeChange,
75
+ showUpdateButton: showUpdateButton
76
+ };
77
+ return (0, _react2.jsx)(_super_date_picker.EuiSuperDatePicker, _extends({}, datepickerProps, {
78
+ updateButtonProps: {
79
+ fill: showFill
80
+ }
81
+ }));
82
+ };
83
+
84
+ beforeEach(function () {
85
+ cy.mount((0, _react2.jsx)(SuperDatePicker, null));
86
+ cy.get('div.euiSuperDatePicker__flexWrapper').should('exist');
87
+ });
88
+ describe('EuiSuperDatePicker', function () {
89
+ describe('Automated accessibility check', function () {
90
+ it('has zero violations on render', function () {
91
+ cy.checkAxe();
92
+ });
93
+ it('has zero violations when quick select menu is open', function () {
94
+ cy.get('button.euiFormControlLayout__prepend').click();
95
+ cy.get('div.euiPanel').contains('Quick select').should('exist');
96
+ cy.checkAxe();
97
+ });
98
+ it('has zero violations when start / end date menus are open', function () {
99
+ cy.get('button.euiSuperDatePicker__prettyFormat').click();
100
+ cy.get('div.euiDatePopoverContent').should('exist');
101
+ cy.checkAxe();
102
+ cy.get('button.euiDatePopoverButton--start').click();
103
+ cy.get('button.euiDatePopoverButton--end').click();
104
+ cy.get('div.euiDatePopoverContent').should('exist');
105
+ cy.checkAxe();
106
+ cy.get('button.euiDatePopoverButton--end').click();
107
+ cy.get('div.euiDatePopoverContent').should('not.exist');
108
+ cy.checkAxe();
109
+ });
110
+ });
111
+ });
@@ -168,7 +168,7 @@ var euiFlexGroupStyles = function euiFlexGroupStyles(euiThemeContext) {
168
168
  var euiTheme = euiThemeContext.euiTheme;
169
169
  return {
170
170
  euiFlexGroup: _ref17,
171
- responsive: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;.euiFlexItem{", (0, _global_styling.logicalCSS)('width', '100%'), " flex-basis:100%;}};label:responsive;"),
171
+ responsive: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;&>.euiFlexItem{", (0, _global_styling.logicalCSS)('width', '100%'), " flex-basis:100%;}};label:responsive;"),
172
172
  wrap: _ref16,
173
173
  gutterSizes: {
174
174
  none: /*#__PURE__*/(0, _react.css)(";label:none;"),
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ 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); }
4
+
5
+ var _react = _interopRequireWildcard(require("react"));
6
+
7
+ var _flyout = require("./flyout");
8
+
9
+ var _button = require("../button");
10
+
11
+ var _react2 = require("@emotion/react");
12
+
13
+ var _excluded = ["children"];
14
+
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+
19
+ 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); }
20
+
21
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
22
+
23
+ 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."); }
24
+
25
+ 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); }
26
+
27
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
28
+
29
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
30
+
31
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
32
+
33
+ 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; }
34
+
35
+ 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; }
36
+
37
+ var childrenDefault = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("button", {
38
+ "data-test-subj": "itemA"
39
+ }, "Item A"), (0, _react2.jsx)("button", {
40
+ "data-test-subj": "itemB"
41
+ }, "Item B"), (0, _react2.jsx)("button", {
42
+ "data-test-subj": "itemC"
43
+ }, "Item C"), (0, _react2.jsx)("input", {
44
+ "data-test-subj": "itemD"
45
+ }));
46
+
47
+ var Flyout = function Flyout(_ref) {
48
+ var _ref$children = _ref.children,
49
+ children = _ref$children === void 0 ? childrenDefault : _ref$children,
50
+ rest = _objectWithoutProperties(_ref, _excluded);
51
+
52
+ var _useState = (0, _react.useState)(false),
53
+ _useState2 = _slicedToArray(_useState, 2),
54
+ isOpen = _useState2[0],
55
+ setIsOpen = _useState2[1];
56
+
57
+ var onButtonClick = function onButtonClick() {
58
+ return setIsOpen(!isOpen);
59
+ };
60
+
61
+ var button = (0, _react2.jsx)(_button.EuiButtonEmpty, {
62
+ onClick: onButtonClick
63
+ }, "Toggle flyout");
64
+ return (0, _react2.jsx)("div", null, button, isOpen ? (0, _react2.jsx)(_flyout.EuiFlyout, _extends({
65
+ "data-test-subj": "flyoutSpec",
66
+ onClose: function onClose() {
67
+ return setIsOpen(false);
68
+ }
69
+ }, rest), children) : null);
70
+ };
71
+
72
+ beforeEach(function () {
73
+ cy.mount((0, _react2.jsx)(Flyout, null));
74
+ cy.get('div.euiFlyout').should('not.exist');
75
+ });
76
+ describe('EuiFlyout', function () {
77
+ describe('Automated accessibility check', function () {
78
+ it('has zero violations on render', function () {
79
+ cy.checkAxe();
80
+ });
81
+ it('has zero violations when flyout is opened', function () {
82
+ cy.get('button.euiButtonEmpty').click();
83
+ cy.get('div.euiFlyout').should('exist');
84
+ cy.checkAxe();
85
+ });
86
+ it('has zero violations when flyout is closed', function () {
87
+ cy.get('button.euiButtonEmpty').click();
88
+ cy.get('div.euiFlyout').should('exist');
89
+ cy.get('button.euiFlyout__closeButton').click();
90
+ cy.get('div.euiFlyout').should('not.exist');
91
+ cy.checkAxe();
92
+ });
93
+ });
94
+ });
@@ -9,22 +9,21 @@ var _react = require("@emotion/react");
9
9
 
10
10
  var _global_styling = require("../../global_styling");
11
11
 
12
- var _templateObject;
13
-
14
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
15
-
12
+ /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
16
19
  var euiImageFullscreenWrapperStyles = function euiImageFullscreenWrapperStyles(euiThemeContext) {
17
20
  var euiTheme = euiThemeContext.euiTheme;
18
21
  return {
19
22
  // Base
20
- euiImageFullscreenWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '80vh'), ";", (0, _global_styling.logicalCSS)('max-width', '80vw'), ";", (0, _global_styling.logicalTextAlignCSS)('center'), ";line-height:0;", _global_styling.euiCanAnimate, "{animation:", euiImageFullScreen(euiTheme.size.xxxxl), " ", euiTheme.animation.extraSlow, " ", euiTheme.animation.bounce, ";}&:hover [class*='euiImageCaption']{text-decoration:underline;};label:euiImageFullscreenWrapper;"),
23
+ euiImageFullscreenWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '80vh'), ";", (0, _global_styling.logicalCSS)('max-width', '80vw'), ";", (0, _global_styling.logicalTextAlignCSS)('center'), ";line-height:0;", _global_styling.euiCanAnimate, "{animation:", (0, _global_styling.euiAnimSlideInUp)(euiTheme.size.xxxxl), " ", euiTheme.animation.extraSlow, " ", euiTheme.animation.bounce, ";}&:hover [class*='euiImageCaption']{text-decoration:underline;};label:euiImageFullscreenWrapper;"),
21
24
  // Sizes
22
25
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;")
23
26
  };
24
27
  };
25
28
 
26
- exports.euiImageFullscreenWrapperStyles = euiImageFullscreenWrapperStyles;
27
-
28
- var euiImageFullScreen = function euiImageFullScreen(size) {
29
- return (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
30
- };
29
+ exports.euiImageFullscreenWrapperStyles = euiImageFullscreenWrapperStyles;
@@ -23,6 +23,10 @@ var _modal_header_title = require("./modal_header_title");
23
23
 
24
24
  var _modal_body = require("./modal_body");
25
25
 
26
+ var _services = require("../../services");
27
+
28
+ var _modal2 = require("./modal.styles");
29
+
26
30
  var _button = require("../button");
27
31
 
28
32
  var _text = require("../text");
@@ -108,6 +112,9 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
108
112
  };
109
113
 
110
114
  var classes = (0, _classnames.default)('euiModal--confirmation', className);
115
+ var euiTheme = (0, _services.useEuiTheme)();
116
+ var styles = (0, _modal2.euiModalStyles)(euiTheme);
117
+ var cssStyles = [styles.confirmation];
111
118
  var modalTitle;
112
119
 
113
120
  if (title) {
@@ -126,6 +133,7 @@ var EuiConfirmModal = function EuiConfirmModal(_ref) {
126
133
 
127
134
  return (0, _react2.jsx)(_modal.EuiModal, _extends({
128
135
  className: classes,
136
+ css: cssStyles,
129
137
  onClose: onCancel
130
138
  }, rest), modalTitle, message && (0, _react2.jsx)(_modal_body.EuiModalBody, null, (0, _react2.jsx)(_text.EuiText, {
131
139
  "data-test-subj": "confirmModalBodyText"
@@ -157,6 +165,11 @@ EuiConfirmModal.propTypes = {
157
165
  onConfirm: _propTypes.default.func,
158
166
  confirmButtonDisabled: _propTypes.default.bool,
159
167
  className: _propTypes.default.string,
168
+
169
+ /**
170
+ * Allows focusing either the confirm or cancel button on modal initialization.
171
+ * Will take precedence over `initialFocus`, if `initialFocus` is passed.
172
+ */
160
173
  defaultFocusedButton: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
161
174
  buttonColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf(["ghost"])]),
162
175
  // For docs only, will get passed with ...rest