@elastic/eui 110.0.0 → 111.0.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 (237) hide show
  1. package/es/components/collapsible_nav/collapsible_nav.js +20 -101
  2. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  3. package/es/components/flyout/_flyout_overlay.js +52 -0
  4. package/es/components/flyout/_flyout_resize_button.js +32 -0
  5. package/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
  6. package/es/components/flyout/const.js +42 -0
  7. package/es/components/flyout/flyout.component.js +481 -0
  8. package/es/components/flyout/flyout.js +77 -379
  9. package/es/components/flyout/flyout.styles.js +105 -7
  10. package/es/components/flyout/flyout_menu.js +241 -0
  11. package/es/components/flyout/flyout_menu.styles.js +19 -0
  12. package/{optimize/es/components/flyout/flyout_context.js → es/components/flyout/flyout_menu_context.js} +1 -7
  13. package/es/components/flyout/flyout_parent_context.js +36 -0
  14. package/es/components/flyout/flyout_resizable.js +33 -144
  15. package/es/components/flyout/hooks.js +25 -0
  16. package/es/components/flyout/index.js +5 -2
  17. package/es/components/flyout/manager/actions.js +153 -0
  18. package/es/components/flyout/manager/activity_stage.js +95 -0
  19. package/es/components/flyout/manager/const.js +56 -0
  20. package/es/components/flyout/manager/context.js +33 -0
  21. package/es/components/flyout/manager/flyout_child.js +75 -0
  22. package/es/components/flyout/manager/flyout_main.js +65 -0
  23. package/es/components/flyout/manager/flyout_main.styles.js +25 -0
  24. package/es/components/flyout/manager/flyout_managed.js +227 -0
  25. package/es/components/flyout/manager/flyout_managed.styles.js +69 -0
  26. package/es/components/flyout/manager/hooks.js +55 -0
  27. package/es/components/flyout/manager/index.js +31 -0
  28. package/es/components/flyout/manager/layout_mode.js +167 -0
  29. package/es/components/flyout/manager/provider.js +57 -0
  30. package/es/components/flyout/manager/reducer.js +320 -0
  31. package/es/components/flyout/manager/selectors.js +116 -0
  32. package/es/components/flyout/manager/store.js +113 -0
  33. package/es/components/flyout/manager/validation.js +85 -0
  34. package/es/components/flyout/use_flyout_resizable.js +149 -0
  35. package/es/components/flyout/use_flyout_z_index.js +46 -0
  36. package/es/components/overlay_mask/overlay_mask.js +13 -3
  37. package/es/components/overlay_mask/overlay_mask.styles.js +11 -2
  38. package/es/components/provider/provider.js +2 -1
  39. package/eui.d.ts +1484 -921
  40. package/i18ntokens.json +1207 -1153
  41. package/lib/components/collapsible_nav/collapsible_nav.js +20 -101
  42. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  43. package/lib/components/flyout/_flyout_overlay.js +59 -0
  44. package/lib/components/flyout/_flyout_resize_button.js +38 -0
  45. package/{test-env/components/flyout/flyout_resizable.styles.js → lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
  46. package/lib/components/flyout/const.js +49 -0
  47. package/lib/components/flyout/flyout.component.js +488 -0
  48. package/lib/components/flyout/flyout.js +102 -379
  49. package/lib/components/flyout/flyout.styles.js +105 -7
  50. package/lib/components/flyout/flyout_menu.js +243 -0
  51. package/lib/components/flyout/flyout_menu.styles.js +25 -0
  52. package/{optimize/lib/components/flyout/flyout_context.js → lib/components/flyout/flyout_menu_context.js} +2 -7
  53. package/lib/components/flyout/flyout_parent_context.js +43 -0
  54. package/lib/components/flyout/flyout_resizable.js +36 -147
  55. package/lib/components/flyout/hooks.js +30 -0
  56. package/lib/components/flyout/index.js +21 -14
  57. package/lib/components/flyout/manager/actions.js +159 -0
  58. package/lib/components/flyout/manager/activity_stage.js +101 -0
  59. package/lib/components/flyout/manager/const.js +62 -0
  60. package/lib/components/flyout/manager/context.js +41 -0
  61. package/lib/components/flyout/manager/flyout_child.js +80 -0
  62. package/lib/components/flyout/manager/flyout_main.js +70 -0
  63. package/lib/components/flyout/manager/flyout_main.styles.js +31 -0
  64. package/lib/components/flyout/manager/flyout_managed.js +233 -0
  65. package/lib/components/flyout/manager/flyout_managed.styles.js +73 -0
  66. package/lib/components/flyout/manager/hooks.js +131 -0
  67. package/lib/components/flyout/manager/index.js +168 -0
  68. package/lib/components/flyout/manager/layout_mode.js +171 -0
  69. package/lib/components/flyout/manager/provider.js +63 -0
  70. package/lib/components/flyout/manager/reducer.js +325 -0
  71. package/lib/components/flyout/manager/selectors.js +122 -0
  72. package/lib/components/flyout/manager/store.js +120 -0
  73. package/lib/components/flyout/manager/validation.js +94 -0
  74. package/lib/components/flyout/use_flyout_resizable.js +153 -0
  75. package/lib/components/flyout/use_flyout_z_index.js +51 -0
  76. package/lib/components/overlay_mask/overlay_mask.js +12 -2
  77. package/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
  78. package/lib/components/provider/provider.js +2 -1
  79. package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -0
  80. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  81. package/optimize/es/components/flyout/_flyout_overlay.js +52 -0
  82. package/optimize/es/components/flyout/_flyout_resize_button.js +31 -0
  83. package/optimize/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
  84. package/optimize/es/components/flyout/const.js +42 -0
  85. package/optimize/es/components/flyout/flyout.component.js +469 -0
  86. package/optimize/es/components/flyout/flyout.js +53 -349
  87. package/optimize/es/components/flyout/flyout.styles.js +102 -7
  88. package/optimize/es/components/flyout/flyout_menu.js +162 -0
  89. package/optimize/es/components/flyout/flyout_menu.styles.js +19 -0
  90. package/{es/components/flyout/flyout_context.js → optimize/es/components/flyout/flyout_menu_context.js} +1 -7
  91. package/optimize/es/components/flyout/flyout_parent_context.js +36 -0
  92. package/optimize/es/components/flyout/flyout_resizable.js +7 -138
  93. package/optimize/es/components/flyout/hooks.js +25 -0
  94. package/optimize/es/components/flyout/index.js +5 -2
  95. package/optimize/es/components/flyout/manager/actions.js +153 -0
  96. package/optimize/es/components/flyout/manager/activity_stage.js +95 -0
  97. package/optimize/es/components/flyout/manager/const.js +56 -0
  98. package/optimize/es/components/flyout/manager/context.js +33 -0
  99. package/optimize/es/components/flyout/manager/flyout_child.js +71 -0
  100. package/optimize/es/components/flyout/manager/flyout_main.js +61 -0
  101. package/optimize/es/components/flyout/manager/flyout_main.styles.js +25 -0
  102. package/optimize/es/components/flyout/manager/flyout_managed.js +223 -0
  103. package/optimize/es/components/flyout/manager/flyout_managed.styles.js +69 -0
  104. package/optimize/es/components/flyout/manager/hooks.js +55 -0
  105. package/optimize/es/components/flyout/manager/index.js +31 -0
  106. package/optimize/es/components/flyout/manager/layout_mode.js +162 -0
  107. package/optimize/es/components/flyout/manager/provider.js +53 -0
  108. package/optimize/es/components/flyout/manager/reducer.js +312 -0
  109. package/optimize/es/components/flyout/manager/selectors.js +116 -0
  110. package/optimize/es/components/flyout/manager/store.js +113 -0
  111. package/optimize/es/components/flyout/manager/types.js +1 -0
  112. package/optimize/es/components/flyout/manager/validation.js +85 -0
  113. package/optimize/es/components/flyout/types.js +1 -0
  114. package/optimize/es/components/flyout/use_flyout_resizable.js +144 -0
  115. package/optimize/es/components/flyout/use_flyout_z_index.js +46 -0
  116. package/optimize/es/components/overlay_mask/overlay_mask.js +13 -3
  117. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +11 -2
  118. package/optimize/es/components/provider/provider.js +2 -1
  119. package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -0
  120. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  121. package/optimize/lib/components/flyout/_flyout_overlay.js +62 -0
  122. package/optimize/lib/components/flyout/_flyout_resize_button.js +37 -0
  123. package/{lib/components/flyout/flyout_resizable.styles.js → optimize/lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
  124. package/optimize/lib/components/flyout/const.js +49 -0
  125. package/optimize/lib/components/flyout/flyout.component.js +477 -0
  126. package/optimize/lib/components/flyout/flyout.js +77 -349
  127. package/optimize/lib/components/flyout/flyout.styles.js +102 -7
  128. package/optimize/lib/components/flyout/flyout_menu.js +168 -0
  129. package/optimize/lib/components/flyout/flyout_menu.styles.js +25 -0
  130. package/{lib/components/flyout/flyout_context.js → optimize/lib/components/flyout/flyout_menu_context.js} +2 -7
  131. package/optimize/lib/components/flyout/flyout_parent_context.js +43 -0
  132. package/optimize/lib/components/flyout/flyout_resizable.js +9 -139
  133. package/optimize/lib/components/flyout/hooks.js +30 -0
  134. package/optimize/lib/components/flyout/index.js +21 -14
  135. package/optimize/lib/components/flyout/manager/actions.js +159 -0
  136. package/optimize/lib/components/flyout/manager/activity_stage.js +101 -0
  137. package/optimize/lib/components/flyout/manager/const.js +62 -0
  138. package/optimize/lib/components/flyout/manager/context.js +41 -0
  139. package/optimize/lib/components/flyout/manager/flyout_child.js +76 -0
  140. package/optimize/lib/components/flyout/manager/flyout_main.js +66 -0
  141. package/optimize/lib/components/flyout/manager/flyout_main.styles.js +31 -0
  142. package/optimize/lib/components/flyout/manager/flyout_managed.js +231 -0
  143. package/optimize/lib/components/flyout/manager/flyout_managed.styles.js +74 -0
  144. package/optimize/lib/components/flyout/manager/hooks.js +131 -0
  145. package/optimize/lib/components/flyout/manager/index.js +168 -0
  146. package/optimize/lib/components/flyout/manager/layout_mode.js +169 -0
  147. package/optimize/lib/components/flyout/manager/provider.js +61 -0
  148. package/optimize/lib/components/flyout/manager/reducer.js +318 -0
  149. package/optimize/lib/components/flyout/manager/selectors.js +122 -0
  150. package/optimize/lib/components/flyout/manager/store.js +120 -0
  151. package/optimize/lib/components/flyout/manager/validation.js +94 -0
  152. package/optimize/lib/components/flyout/types.js +5 -0
  153. package/optimize/lib/components/flyout/use_flyout_resizable.js +151 -0
  154. package/optimize/lib/components/flyout/use_flyout_z_index.js +51 -0
  155. package/optimize/lib/components/overlay_mask/overlay_mask.js +12 -2
  156. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
  157. package/optimize/lib/components/provider/provider.js +2 -1
  158. package/package.json +5 -4
  159. package/test-env/components/collapsible_nav/collapsible_nav.js +20 -101
  160. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  161. package/test-env/components/flyout/_flyout_overlay.js +62 -0
  162. package/test-env/components/flyout/_flyout_resize_button.js +37 -0
  163. package/{optimize/lib/components/flyout/flyout_resizable.styles.js → test-env/components/flyout/_flyout_resize_button.styles.js} +12 -12
  164. package/test-env/components/flyout/const.js +49 -0
  165. package/test-env/components/flyout/flyout.component.js +477 -0
  166. package/test-env/components/flyout/flyout.styles.js +102 -7
  167. package/test-env/components/flyout/flyout_menu.js +241 -0
  168. package/test-env/components/flyout/flyout_menu.styles.js +25 -0
  169. package/test-env/components/flyout/{flyout_context.js → flyout_menu_context.js} +2 -7
  170. package/test-env/components/flyout/flyout_parent_context.js +43 -0
  171. package/test-env/components/flyout/flyout_resizable.js +35 -139
  172. package/test-env/components/flyout/hooks.js +30 -0
  173. package/test-env/components/flyout/index.js +21 -14
  174. package/test-env/components/flyout/manager/actions.js +159 -0
  175. package/test-env/components/flyout/manager/activity_stage.js +101 -0
  176. package/test-env/components/flyout/manager/const.js +62 -0
  177. package/test-env/components/flyout/manager/context.js +41 -0
  178. package/test-env/components/flyout/manager/flyout_child.js +76 -0
  179. package/test-env/components/flyout/manager/flyout_main.js +66 -0
  180. package/test-env/components/flyout/manager/flyout_main.styles.js +31 -0
  181. package/test-env/components/flyout/manager/flyout_managed.js +231 -0
  182. package/test-env/components/flyout/manager/flyout_managed.styles.js +74 -0
  183. package/test-env/components/flyout/manager/hooks.js +131 -0
  184. package/test-env/components/flyout/manager/index.js +168 -0
  185. package/test-env/components/flyout/manager/layout_mode.js +169 -0
  186. package/test-env/components/flyout/manager/provider.js +61 -0
  187. package/test-env/components/flyout/manager/reducer.js +318 -0
  188. package/test-env/components/flyout/manager/selectors.js +122 -0
  189. package/test-env/components/flyout/manager/store.js +120 -0
  190. package/test-env/components/flyout/manager/types.js +5 -0
  191. package/test-env/components/flyout/manager/validation.js +94 -0
  192. package/test-env/components/flyout/types.js +5 -0
  193. package/test-env/components/flyout/use_flyout_resizable.js +151 -0
  194. package/test-env/components/flyout/use_flyout_z_index.js +51 -0
  195. package/test-env/components/overlay_mask/overlay_mask.js +12 -2
  196. package/test-env/components/overlay_mask/overlay_mask.styles.js +11 -4
  197. package/test-env/components/provider/provider.js +2 -1
  198. package/es/components/flyout/flyout_child.js +0 -223
  199. package/es/components/flyout/flyout_child.styles.js +0 -32
  200. package/es/components/flyout/flyout_child_manager.js +0 -114
  201. package/es/components/flyout/sessions/flyout_provider.js +0 -95
  202. package/es/components/flyout/sessions/flyout_reducer.js +0 -195
  203. package/es/components/flyout/sessions/index.js +0 -10
  204. package/es/components/flyout/sessions/use_eui_flyout.js +0 -82
  205. package/lib/components/flyout/flyout_child.js +0 -231
  206. package/lib/components/flyout/flyout_child.styles.js +0 -38
  207. package/lib/components/flyout/flyout_child_manager.js +0 -122
  208. package/lib/components/flyout/sessions/flyout_provider.js +0 -102
  209. package/lib/components/flyout/sessions/flyout_reducer.js +0 -202
  210. package/lib/components/flyout/sessions/index.js +0 -25
  211. package/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
  212. package/optimize/es/components/flyout/flyout_child.js +0 -178
  213. package/optimize/es/components/flyout/flyout_child.styles.js +0 -32
  214. package/optimize/es/components/flyout/flyout_child_manager.js +0 -100
  215. package/optimize/es/components/flyout/sessions/flyout_provider.js +0 -90
  216. package/optimize/es/components/flyout/sessions/flyout_reducer.js +0 -187
  217. package/optimize/es/components/flyout/sessions/index.js +0 -10
  218. package/optimize/es/components/flyout/sessions/use_eui_flyout.js +0 -82
  219. package/optimize/lib/components/flyout/flyout_child.js +0 -186
  220. package/optimize/lib/components/flyout/flyout_child.styles.js +0 -38
  221. package/optimize/lib/components/flyout/flyout_child_manager.js +0 -110
  222. package/optimize/lib/components/flyout/sessions/flyout_provider.js +0 -100
  223. package/optimize/lib/components/flyout/sessions/flyout_reducer.js +0 -195
  224. package/optimize/lib/components/flyout/sessions/index.js +0 -25
  225. package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
  226. package/test-env/components/flyout/flyout_child.js +0 -230
  227. package/test-env/components/flyout/flyout_child.styles.js +0 -38
  228. package/test-env/components/flyout/flyout_child_manager.js +0 -119
  229. package/test-env/components/flyout/sessions/flyout_provider.js +0 -100
  230. package/test-env/components/flyout/sessions/flyout_reducer.js +0 -195
  231. package/test-env/components/flyout/sessions/index.js +0 -25
  232. package/test-env/components/flyout/sessions/use_eui_flyout.js +0 -88
  233. /package/es/components/flyout/{sessions → manager}/types.js +0 -0
  234. /package/{optimize/es/components/flyout/sessions → es/components/flyout}/types.js +0 -0
  235. /package/lib/components/flyout/{sessions → manager}/types.js +0 -0
  236. /package/{optimize/lib/components/flyout/sessions → lib/components/flyout}/types.js +0 -0
  237. /package/{test-env/components/flyout/sessions → optimize/lib/components/flyout/manager}/types.js +0 -0
@@ -5,29 +5,43 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.TYPES = exports.SIZES = exports.SIDES = exports.PADDING_SIZES = exports.EuiFlyout = void 0;
8
+ exports.EuiFlyout = void 0;
9
+ Object.defineProperty(exports, "FLYOUT_PADDING_SIZES", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _const2.FLYOUT_PADDING_SIZES;
13
+ }
14
+ });
15
+ Object.defineProperty(exports, "FLYOUT_SIDES", {
16
+ enumerable: true,
17
+ get: function get() {
18
+ return _const2.FLYOUT_SIDES;
19
+ }
20
+ });
21
+ Object.defineProperty(exports, "FLYOUT_SIZES", {
22
+ enumerable: true,
23
+ get: function get() {
24
+ return _const2.FLYOUT_SIZES;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "FLYOUT_TYPES", {
28
+ enumerable: true,
29
+ get: function get() {
30
+ return _const2.FLYOUT_TYPES;
31
+ }
32
+ });
9
33
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
34
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
14
35
  var _react = _interopRequireWildcard(require("react"));
15
- var _classnames = _interopRequireDefault(require("classnames"));
16
- var _services = require("../../services");
17
- var _global_styling = require("../../global_styling");
18
- var _focus_trap = require("../focus_trap");
19
- var _overlay_mask = require("../overlay_mask");
20
- var _i18n = require("../i18n");
21
- var _resize_observer = require("../observer/resize_observer");
22
- var _portal = require("../portal");
23
- var _accessibility = require("../accessibility");
24
- var _flyout_close_button = require("./_flyout_close_button");
25
- var _flyout = require("./flyout.styles");
26
- var _flyout_child = require("./flyout_child");
27
- var _flyout_child_manager = require("./flyout_child_manager");
28
36
  var _component_defaults = require("../provider/component_defaults");
37
+ var _flyout = require("./flyout.component");
38
+ var _manager = require("./manager");
39
+ var _flyout_menu_context = require("./flyout_menu_context");
40
+ var _flyout_parent_context = require("./flyout_parent_context");
41
+ var _const = require("./manager/const");
29
42
  var _react2 = require("@emotion/react");
30
- var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby"];
43
+ var _const2 = require("./const");
44
+ var _excluded = ["as", "onClose", "onActive", "session"];
31
45
  /*
32
46
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
33
47
  * or more contributor license agreements. Licensed under the Elastic License
@@ -37,348 +51,62 @@ var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonP
37
51
  */
38
52
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
39
53
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
40
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
42
- var TYPES = exports.TYPES = ['push', 'overlay'];
43
- var SIDES = exports.SIDES = ['left', 'right'];
44
- var SIZES = exports.SIZES = ['s', 'm', 'l'];
45
- /**
46
- * Custom type checker for named flyout sizes since the prop
47
- * `size` can also be CSSProperties['width'] (string | number)
48
- */
49
- function isEuiFlyoutSizeNamed(value) {
50
- return SIZES.includes(value);
51
- }
52
- var PADDING_SIZES = exports.PADDING_SIZES = ['none', 's', 'm', 'l'];
53
- var defaultElement = 'div';
54
54
  var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
55
55
  var _usePropsWithComponen = (0, _component_defaults.usePropsWithComponentDefaults)('EuiFlyout', props),
56
- className = _usePropsWithComponen.className,
57
- children = _usePropsWithComponen.children,
58
56
  as = _usePropsWithComponen.as,
59
- _usePropsWithComponen2 = _usePropsWithComponen.hideCloseButton,
60
- hideCloseButton = _usePropsWithComponen2 === void 0 ? false : _usePropsWithComponen2,
61
- closeButtonProps = _usePropsWithComponen.closeButtonProps,
62
- _usePropsWithComponen3 = _usePropsWithComponen.closeButtonPosition,
63
- _closeButtonPosition = _usePropsWithComponen3 === void 0 ? 'inside' : _usePropsWithComponen3,
64
57
  onClose = _usePropsWithComponen.onClose,
65
- _usePropsWithComponen4 = _usePropsWithComponen.ownFocus,
66
- ownFocus = _usePropsWithComponen4 === void 0 ? true : _usePropsWithComponen4,
67
- _usePropsWithComponen5 = _usePropsWithComponen.side,
68
- side = _usePropsWithComponen5 === void 0 ? 'right' : _usePropsWithComponen5,
69
- _usePropsWithComponen6 = _usePropsWithComponen.size,
70
- size = _usePropsWithComponen6 === void 0 ? 'm' : _usePropsWithComponen6,
71
- _usePropsWithComponen7 = _usePropsWithComponen.paddingSize,
72
- paddingSize = _usePropsWithComponen7 === void 0 ? 'l' : _usePropsWithComponen7,
73
- _usePropsWithComponen8 = _usePropsWithComponen.maxWidth,
74
- maxWidth = _usePropsWithComponen8 === void 0 ? false : _usePropsWithComponen8,
75
- style = _usePropsWithComponen.style,
76
- maskProps = _usePropsWithComponen.maskProps,
77
- _usePropsWithComponen9 = _usePropsWithComponen.type,
78
- type = _usePropsWithComponen9 === void 0 ? 'overlay' : _usePropsWithComponen9,
79
- outsideClickCloses = _usePropsWithComponen.outsideClickCloses,
80
- _usePropsWithComponen10 = _usePropsWithComponen.pushMinBreakpoint,
81
- pushMinBreakpoint = _usePropsWithComponen10 === void 0 ? 'l' : _usePropsWithComponen10,
82
- _usePropsWithComponen11 = _usePropsWithComponen.pushAnimation,
83
- pushAnimation = _usePropsWithComponen11 === void 0 ? false : _usePropsWithComponen11,
84
- _focusTrapProps = _usePropsWithComponen.focusTrapProps,
85
- _usePropsWithComponen12 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
86
- includeFixedHeadersInFocusTrap = _usePropsWithComponen12 === void 0 ? true : _usePropsWithComponen12,
87
- includeSelectorInFocusTrap = _usePropsWithComponen.includeSelectorInFocusTrap,
88
- _ariaDescribedBy = _usePropsWithComponen['aria-describedby'],
58
+ onActive = _usePropsWithComponen.onActive,
59
+ session = _usePropsWithComponen.session,
89
60
  rest = (0, _objectWithoutProperties2.default)(_usePropsWithComponen, _excluded);
90
- var _useEuiThemeCSSVariab = (0, _services.useEuiThemeCSSVariables)(),
91
- setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
92
- var Element = as || defaultElement;
93
- var maskRef = (0, _react.useRef)(null);
94
-
95
- // Ref for the main flyout element to pass to context
96
- var internalParentFlyoutRef = (0, _react.useRef)(null);
97
- var _useState = (0, _react.useState)(false),
98
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
99
- isChildFlyoutOpen = _useState2[0],
100
- setIsChildFlyoutOpen = _useState2[1];
101
- var _useState3 = (0, _react.useState)('side-by-side'),
102
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
103
- childLayoutMode = _useState4[0],
104
- setChildLayoutMode = _useState4[1];
105
-
106
- // Check for child flyout
107
- var childFlyoutElement = _react.default.Children.toArray(children).find(function (child) {
108
- return /*#__PURE__*/_react.default.isValidElement(child) && (child.type === _flyout_child.EuiFlyoutChild || child.type.displayName === 'EuiFlyoutChild');
109
- });
110
- var hasChildFlyout = !!childFlyoutElement;
111
-
112
- // Validate props, determine close button position and set child flyout classes
113
- var closeButtonPosition;
114
- var childFlyoutClasses = [];
115
- if (hasChildFlyout) {
116
- if (side !== 'right') {
117
- throw new Error('EuiFlyout: When an EuiFlyoutChild is present, the `side` prop of EuiFlyout must be "right".');
118
- }
119
- if (!isEuiFlyoutSizeNamed(size) || !['s', 'm'].includes(size)) {
120
- throw new Error("EuiFlyout: When an EuiFlyoutChild is present, the `size` prop of EuiFlyout must be \"s\" or \"m\". Received \"".concat(size, "\"."));
121
- }
122
- if (_closeButtonPosition !== 'inside') {
123
- throw new Error('EuiFlyout: When an EuiFlyoutChild is present, the `closeButtonPosition` prop of EuiFlyout must be "inside".');
124
- }
125
- closeButtonPosition = 'inside';
126
- childFlyoutClasses = ['euiFlyout--hasChild', "euiFlyout--hasChild--".concat(childLayoutMode), "euiFlyout--hasChild--".concat(childFlyoutElement.props.size || 's')];
127
- } else {
128
- closeButtonPosition = _closeButtonPosition;
129
- }
130
- var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
131
- var isPushed = type === 'push' && windowIsLargeEnoughToPush;
132
-
133
- /**
134
- * Setting up the refs on the actual flyout element in order to
135
- * accommodate for the `isPushed` state by adding padding to the body equal to the width of the element
136
- */
137
- var _useState5 = (0, _react.useState)(null),
138
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
139
- resizeRef = _useState6[0],
140
- setResizeRef = _useState6[1];
141
- var setRef = (0, _services.useCombinedRefs)([setResizeRef, ref, internalParentFlyoutRef]);
142
- var _useResizeObserver = (0, _resize_observer.useResizeObserver)(isPushed ? resizeRef : null, 'width'),
143
- width = _useResizeObserver.width;
144
- (0, _react.useEffect)(function () {
145
- /**
146
- * Accomodate for the `isPushed` state by adding padding to the body equal to the width of the element
147
- */
148
- if (isPushed) {
149
- var paddingSide = side === 'left' ? 'paddingInlineStart' : 'paddingInlineEnd';
150
- var cssVarName = "--euiPushFlyoutOffset".concat(side === 'left' ? 'InlineStart' : 'InlineEnd');
151
- document.body.style[paddingSide] = "".concat(width, "px");
152
-
153
- // EUI doesn't use this css variable, but it is useful for consumers
154
- setGlobalCSSVariables((0, _defineProperty2.default)({}, cssVarName, "".concat(width, "px")));
155
- return function () {
156
- document.body.style[paddingSide] = '';
157
- setGlobalCSSVariables((0, _defineProperty2.default)({}, cssVarName, null));
158
- };
159
- }
160
- }, [isPushed, setGlobalCSSVariables, side, width]);
161
-
162
- /**
163
- * This class doesn't actually do anything by EUI, but is nice to add for consumers (JIC)
164
- */
165
- (0, _react.useEffect)(function () {
166
- document.body.classList.add('euiBody--hasFlyout');
167
- return function () {
168
- // Remove the hasFlyout class when the flyout is unmounted
169
- document.body.classList.remove('euiBody--hasFlyout');
170
- };
171
- }, []);
172
-
173
- /**
174
- * ESC key closes flyout (always?)
175
- */
176
- var onKeyDown = (0, _react.useCallback)(function (event) {
177
- if (!isPushed && event.key === _services.keys.ESCAPE && !isChildFlyoutOpen) {
178
- event.preventDefault();
179
- onClose(event);
180
- }
181
- }, [onClose, isPushed, isChildFlyoutOpen]);
182
-
183
- /**
184
- * Set inline styles
185
- */
186
- var inlineStyles = (0, _react.useMemo)(function () {
187
- var widthStyle = !isEuiFlyoutSizeNamed(size) && (0, _global_styling.logicalStyle)('width', size);
188
- var maxWidthStyle = typeof maxWidth !== 'boolean' && (0, _global_styling.logicalStyle)('max-width', maxWidth);
189
- return _objectSpread(_objectSpread(_objectSpread({}, style), widthStyle), maxWidthStyle);
190
- }, [style, maxWidth, size]);
191
- var styles = (0, _services.useEuiMemoizedStyles)(_flyout.euiFlyoutStyles);
192
- var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
193
- var classes = _classnames.default.apply(void 0, ['euiFlyout'].concat((0, _toConsumableArray2.default)(childFlyoutClasses), [className]));
61
+ var hasActiveSession = (0, _manager.useHasActiveSession)();
62
+ var isInsideParentFlyout = (0, _flyout_parent_context.useIsInsideParentFlyout)();
63
+ var isUnmanagedFlyout = (0, _react.useRef)(false);
194
64
 
195
65
  /*
196
- * Trap focus even when `ownFocus={false}`, otherwise closing
197
- * the flyout won't return focus to the originating button.
198
- *
199
- * Set `clickOutsideDisables={true}` when `ownFocus={false}`
200
- * to allow non-keyboard users the ability to interact with
201
- * elements outside the flyout.
202
- *
203
- * Set `onClickOutside={onClose}` when `ownFocus` and `type` are the defaults,
204
- * or if `outsideClickCloses={true}` to close on clicks that target
205
- * (both mousedown and mouseup) the overlay mask.
66
+ * Flyout routing logic:
67
+ * - session="start" Main flyout (creates new session)
68
+ * - session="inherit" + active session → Child flyout (auto-joins, works across React roots!)
69
+ * - session="inherit" + no session → Standard flyout
70
+ * - session="never" Standard flyout (explicit opt-out)
71
+ * - session=undefined + inside parent + active session → Child flyout (auto-inherit)
72
+ * - session=undefined + not inside parent → Standard flyout (default behavior)
206
73
  */
207
- var flyoutToggle = (0, _react.useRef)(document.activeElement);
208
- var _useState7 = (0, _react.useState)([]),
209
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
210
- focusTrapShards = _useState8[0],
211
- setFocusTrapShards = _useState8[1];
212
- var focusTrapSelectors = (0, _react.useMemo)(function () {
213
- var selectors = [];
214
- if (includeSelectorInFocusTrap) {
215
- selectors = Array.isArray(includeSelectorInFocusTrap) ? includeSelectorInFocusTrap : [includeSelectorInFocusTrap];
216
- }
217
- if (includeFixedHeadersInFocusTrap) {
218
- selectors.push('.euiHeader[data-fixed-header]');
219
- }
220
- return selectors;
221
- }, [includeSelectorInFocusTrap, includeFixedHeadersInFocusTrap]);
222
74
 
223
- /**
224
- * Finds the shards to include in the focus trap by querying by `focusTrapSelectors`.
225
- *
226
- * @param shouldAutoFocus Whether to auto-focus the flyout wrapper when the focus trap is activated.
227
- * This is necessary because when a flyout is toggled from within a shard, the focus trap's `autoFocus`
228
- * feature doesn't work. This logic manually focuses the flyout as a workaround.
229
- */
230
- var findShards = (0, _react.useCallback)(function () {
231
- var shouldAutoFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
232
- if (focusTrapSelectors.length > 0) {
233
- var shardsEls = focusTrapSelectors.flatMap(function (selector) {
234
- return Array.from(document.querySelectorAll(selector));
235
- });
236
- setFocusTrapShards(Array.from(shardsEls));
237
- if (shouldAutoFocus) {
238
- shardsEls.forEach(function (shard) {
239
- if (shard.contains(flyoutToggle.current)) {
240
- resizeRef === null || resizeRef === void 0 || resizeRef.focus();
241
- }
242
- });
75
+ // Determine effective session behavior when session is undefined
76
+ var effectiveSession = session === undefined && isInsideParentFlyout && hasActiveSession ? _const.SESSION_INHERIT : session !== null && session !== void 0 ? session : _const.SESSION_NEVER;
77
+ if (effectiveSession !== _const.SESSION_NEVER) {
78
+ if (effectiveSession === _const.SESSION_START) {
79
+ // session=start: create new session
80
+ if (isUnmanagedFlyout.current) {
81
+ // TODO: @tkajtoch - We need to find a better way to handle the missing event.
82
+ onClose === null || onClose === void 0 || onClose({});
83
+ return null;
243
84
  }
244
- } else {
245
- // Clear existing shards if necessary, e.g. switching to `false`
246
- setFocusTrapShards(function (shards) {
247
- return shards.length ? [] : shards;
248
- });
85
+ return (0, _react2.jsx)(_manager.EuiFlyoutMain, (0, _extends2.default)({}, rest, {
86
+ onClose: onClose,
87
+ onActive: onActive,
88
+ as: "div"
89
+ }));
249
90
  }
250
- }, [focusTrapSelectors, resizeRef]);
251
- (0, _react.useEffect)(function () {
252
- // Auto-focus should only happen on initial flyout mount (or when the dependencies change)
253
- // because it snaps focus to the flyout wrapper, which steals it from subsequently focused elements.
254
- findShards(true);
255
- var unsubscribe = _services.focusTrapPubSub.subscribe(function () {
256
- return findShards();
257
- });
258
- return unsubscribe;
259
- }, [findShards]);
260
- var focusTrapProps = (0, _react.useMemo)(function () {
261
- return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
262
- shards: [].concat((0, _toConsumableArray2.default)(focusTrapShards), (0, _toConsumableArray2.default)((_focusTrapProps === null || _focusTrapProps === void 0 ? void 0 : _focusTrapProps.shards) || []))
263
- });
264
- }, [_focusTrapProps, focusTrapShards]);
265
-
266
- /*
267
- * Provide meaningful screen reader instructions/details
268
- */
269
- var hasOverlayMask = ownFocus && !isPushed;
270
- var descriptionId = (0, _services.useGeneratedHtmlId)();
271
- var ariaDescribedBy = (0, _classnames.default)(descriptionId, _ariaDescribedBy);
272
- var screenReaderDescription = (0, _react.useMemo)(function () {
273
- return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
274
- id: descriptionId
275
- }, hasOverlayMask ? (0, _react2.jsx)(_i18n.EuiI18n, {
276
- token: "euiFlyout.screenReaderModalDialog",
277
- default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
278
- }) : (0, _react2.jsx)(_i18n.EuiI18n, {
279
- token: "euiFlyout.screenReaderNonModalDialog",
280
- default: "You are in a non-modal dialog. To close the dialog, press Escape."
281
- }), ' ', focusTrapShards.length > 0 && (0, _react2.jsx)(_i18n.EuiI18n, {
282
- token: "euiFlyout.screenReaderFocusTrapShards",
283
- default: "You can still continue tabbing through other global page landmarks."
284
- })));
285
- }, [hasOverlayMask, descriptionId, focusTrapShards.length]);
286
91
 
287
- /*
288
- * Trap focus even when `ownFocus={false}`, otherwise closing
289
- * the flyout won't return focus to the originating button.
290
- *
291
- * Set `clickOutsideDisables={true}` when `ownFocus={false}`
292
- * to allow non-keyboard users the ability to interact with
293
- * elements outside the flyout.
294
- *
295
- * Set `onClickOutside={onClose}` when `ownFocus` and `type` are the defaults,
296
- * or if `outsideClickCloses={true}` to close on clicks that target
297
- * (both mousedown and mouseup) the overlay mask.
298
- */
299
- var onClickOutside = (0, _react.useCallback)(function (event) {
300
- // Do not close the flyout for any external click
301
- if (outsideClickCloses === false) return undefined;
302
- if (hasOverlayMask) {
303
- // The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
304
- if (event.target === maskRef.current) return onClose(event);
305
- } else {
306
- // No overlay mask is present, so any outside clicks should close the flyout
307
- if (outsideClickCloses === true) return onClose(event);
92
+ // session=inherit: auto-join existing session as child
93
+ if (hasActiveSession && effectiveSession === _const.SESSION_INHERIT) {
94
+ return (0, _react2.jsx)(_manager.EuiFlyoutChild, (0, _extends2.default)({}, rest, {
95
+ onClose: onClose,
96
+ onActive: onActive,
97
+ as: "div"
98
+ }));
308
99
  }
309
- // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
310
- return undefined;
311
- }, [onClose, hasOverlayMask, outsideClickCloses]);
312
- var closeButton = !hideCloseButton && (0, _react2.jsx)(_flyout_close_button.EuiFlyoutCloseButton, (0, _extends2.default)({}, closeButtonProps, {
313
- onClose: onClose,
314
- closeButtonPosition: closeButtonPosition,
315
- side: side
316
- }));
317
-
318
- // render content within EuiFlyoutChildProvider if childFlyoutElement is present
319
- var contentToRender = children;
320
- if (hasChildFlyout && childFlyoutElement) {
321
- contentToRender = (0, _react2.jsx)(_flyout_child_manager.EuiFlyoutChildProvider, {
322
- parentSize: size,
323
- parentFlyoutRef: internalParentFlyoutRef,
324
- childElement: childFlyoutElement,
325
- childrenToRender: children,
326
- reportIsChildOpen: setIsChildFlyoutOpen,
327
- reportChildLayoutMode: setChildLayoutMode
328
- });
329
- }
330
- return (0, _react2.jsx)(EuiFlyoutWrapper, {
331
- hasOverlayMask: hasOverlayMask,
332
- maskProps: _objectSpread(_objectSpread({}, maskProps), {}, {
333
- maskRef: (0, _services.useCombinedRefs)([maskProps === null || maskProps === void 0 ? void 0 : maskProps.maskRef, maskRef])
334
- }),
335
- isPortalled: !isPushed
336
- }, (0, _react2.jsx)(_services.EuiWindowEvent, {
337
- event: "keydown",
338
- handler: onKeyDown
339
- }), (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
340
- disabled: isPushed || ownFocus && isChildFlyoutOpen,
341
- scrollLock: hasOverlayMask,
342
- clickOutsideDisables: !ownFocus,
343
- onClickOutside: onClickOutside
344
- }, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
345
- className: classes,
346
- css: cssStyles,
347
- style: inlineStyles,
348
- ref: setRef
349
- }, rest, {
350
- role: !isPushed ? 'dialog' : rest.role,
351
- "aria-modal": !isPushed || undefined,
352
- tabIndex: !isPushed ? 0 : rest.tabIndex,
353
- "aria-describedby": !isPushed ? ariaDescribedBy : _ariaDescribedBy,
354
- "data-autofocus": !isPushed || undefined
355
- }), !isPushed && screenReaderDescription, closeButton, contentToRender)));
356
- }
357
- // React.forwardRef interferes with the inferred element type
358
- // Casting to ensure correct element prop type checking for `as`
359
- // e.g., `href` is not on a `div`
360
- );
361
- // Recast to allow `displayName`
362
- EuiFlyout.displayName = 'EuiFlyout';
363
-
364
- /**
365
- * Light wrapper for conditionally rendering portals or overlay masks:
366
- * - If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
367
- * - Otherwise still wrap within an EuiPortal so it appends to the bottom of the window.
368
- * Push flyouts have no overlay OR portal behavior.
369
- */
370
- var EuiFlyoutWrapper = function EuiFlyoutWrapper(_ref) {
371
- var children = _ref.children,
372
- hasOverlayMask = _ref.hasOverlayMask,
373
- maskProps = _ref.maskProps,
374
- isPortalled = _ref.isPortalled;
375
- if (hasOverlayMask) {
376
- return (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, (0, _extends2.default)({
377
- headerZindexLocation: "below"
378
- }, maskProps), children);
379
- } else if (isPortalled) {
380
- return (0, _react2.jsx)(_portal.EuiPortal, null, children);
381
- } else {
382
- return (0, _react2.jsx)(_react.default.Fragment, null, children);
383
100
  }
384
- };
101
+ isUnmanagedFlyout.current = true;
102
+ return (0, _react2.jsx)(_flyout_menu_context.EuiFlyoutMenuContext.Provider, {
103
+ value: {
104
+ onClose: onClose
105
+ }
106
+ }, (0, _react2.jsx)(_flyout.EuiFlyoutComponent, (0, _extends2.default)({}, rest, {
107
+ onClose: onClose,
108
+ as: as,
109
+ ref: ref
110
+ })));
111
+ });
112
+ EuiFlyout.displayName = 'EuiFlyout';
@@ -4,13 +4,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.maxedFlyoutWidth = exports.euiFlyoutStyles = exports.euiFlyoutSlideInRight = exports.euiFlyoutSlideInLeft = exports.composeFlyoutSizing = exports.FLYOUT_BREAKPOINT = void 0;
7
+ exports.maxedFlyoutWidth = exports.euiFlyoutStyles = exports.euiFlyoutSlideOutRight = exports.euiFlyoutSlideOutLeft = exports.euiFlyoutSlideInRight = exports.euiFlyoutSlideInLeft = exports.composeFlyoutSizing = exports.composeFlyoutInlineStyles = exports.FLYOUT_BREAKPOINT = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
10
  var _react = require("@emotion/react");
10
11
  var _euiThemeCommon = require("@elastic/eui-theme-common");
12
+ var _const = require("./const");
11
13
  var _global_styling = require("../../global_styling");
12
14
  var _form = require("../form/form.styles");
13
- var _templateObject, _templateObject2;
15
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
16
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
18
  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)."; } /*
15
19
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
20
  * or more contributor license agreements. Licensed under the Elastic License
@@ -19,8 +23,10 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
19
23
  * Side Public License, v 1.
20
24
  */
21
25
  var FLYOUT_BREAKPOINT = exports.FLYOUT_BREAKPOINT = 'm';
22
- var euiFlyoutSlideInRight = exports.euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
23
- var euiFlyoutSlideInLeft = exports.euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
26
+ var euiFlyoutSlideInRight = exports.euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from {\n opacity: 0;\n transform: translateX(100%);\n }\n to {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
27
+ var euiFlyoutSlideOutRight = exports.euiFlyoutSlideOutRight = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n from {\n opacity: 1;\n transform: translateX(0%);\n }\n to {\n opacity: 0;\n transform: translateX(100%);\n }\n"])));
28
+ var euiFlyoutSlideInLeft = exports.euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n from {\n opacity: 0;\n transform: translateX(-100%);\n }\n to {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
29
+ var euiFlyoutSlideOutLeft = exports.euiFlyoutSlideOutLeft = (0, _react.keyframes)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n from {\n opacity: 1;\n transform: translateX(0);\n }\n to {\n opacity: 0;\n transform: translateX(-100%);\n }\n"])));
24
30
  var _ref = process.env.NODE_ENV === "production" ? {
25
31
  name: "yokctr-noAnimation",
26
32
  styles: "animation-duration:0s!important;label:noAnimation;"
@@ -40,17 +46,18 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
40
46
  var euiFlyoutStyles = exports.euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
41
47
  var euiTheme = euiThemeContext.euiTheme;
42
48
  return {
43
- euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", maxedFlyoutWidth(euiThemeContext), ";;label:euiFlyout;"),
49
+ euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " background:", euiTheme.colors.backgroundBasePlain, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}&.euiFlyout--hasChildBackground{background:", euiTheme.colors.backgroundBaseSubdued, ";}", maxedFlyoutWidth(euiThemeContext), ";;label:euiFlyout;"),
44
50
  // Flyout sizes
45
51
  // When a child flyout is stacked on top of the parent, the parent flyout size will match the child flyout size
46
52
  s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--m{", composeFlyoutSizing(euiThemeContext, 'm'), ";};label:s;"),
47
53
  m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--s{", composeFlyoutSizing(euiThemeContext, 's'), ";};label:m;"),
48
54
  l: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
55
+ fill: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'fill'), ";;label:fill;"),
49
56
  noMaxWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', 'none'), ";;label:noMaxWidth;"),
50
57
  // Side
51
- right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";}&.euiFlyout--hasChild{clip-path:none;};label:right;"),
58
+ right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), "animation:", euiFlyoutSlideInRight, " 0s ", euiTheme.animation.resistance, " forwards;", _global_styling.euiCanAnimate, "{animation-duration:", euiTheme.animation.normal, ";}&.euiFlyout--hasChild{clip-path:none;};label:right;"),
52
59
  // Left-side flyouts should only be used for navigation
53
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
60
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);animation:", euiFlyoutSlideInLeft, " 0s ", euiTheme.animation.resistance, " forwards;", _global_styling.euiCanAnimate, "{animation-duration:", euiTheme.animation.normal, ";};label:left;"),
54
61
  // Type
55
62
  overlay: {
56
63
  overlay: _ref2,
@@ -106,6 +113,13 @@ var composeFlyoutSizing = exports.composeFlyoutSizing = function composeFlyoutSi
106
113
  // 1.
107
114
  width: '75vw',
108
115
  max: "".concat(euiTheme.breakpoint.l, "px")
116
+ },
117
+ // NOTE: These styles are for the flyout system in `stacked` layout mode.
118
+ // In `side-by-side` mode, @flyout.component.tsx uses inline styles.
119
+ fill: {
120
+ min: '90vw',
121
+ width: '90vw',
122
+ max: '90vw'
109
123
  }
110
124
  };
111
125
  return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, FLYOUT_BREAKPOINT), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].min), "\n }\n ").concat((0, _global_styling.euiMinBreakpoint)(euiThemeContext, FLYOUT_BREAKPOINT), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', flyoutSizes[size].min), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].width), "\n }\n ");
@@ -131,4 +145,85 @@ var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddin
131
145
  }), " ").concat(euiTheme.size.l, ";")
132
146
  };
133
147
  return "\n .euiFlyoutHeader {\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat((0, _global_styling.logicalCSS)('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat((0, _global_styling.logicalCSS)('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
148
+ };
149
+
150
+ /**
151
+ * Helper for `composeFlyoutInlineStyles`
152
+ * Handles maxWidth prop overrides to ensure they take precedence over base CSS
153
+ */
154
+ var composeMaxWidthOverrides = function composeMaxWidthOverrides(maxWidth, isFill) {
155
+ if (typeof maxWidth === 'boolean') {
156
+ return {};
157
+ }
158
+ var overrides = {
159
+ maxWidth: maxWidth
160
+ };
161
+
162
+ // For fill size flyouts, we need to override min-width to allow dynamic sizing
163
+ if (isFill) {
164
+ overrides.minWidth = '0';
165
+
166
+ // When maxWidth is provided for fill flyouts, we need to override the CSS rule
167
+ // that sets min-inline-size: 90vw. We calculate min(maxWidth, 90vw) to ensure
168
+ // the flyout respects both constraints and doesn't get stuck at 90vw minimum.
169
+ if (maxWidth) {
170
+ var maxWidthWithUnits = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
171
+ overrides.minWidth = "min(".concat(maxWidthWithUnits, ", 90vw)");
172
+ }
173
+ }
174
+ return (0, _global_styling.logicalStyles)(overrides);
175
+ };
176
+
177
+ /**
178
+ * Composes all inline styles for a flyout based on its configuration
179
+ */
180
+ var composeFlyoutInlineStyles = exports.composeFlyoutInlineStyles = function composeFlyoutInlineStyles(size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, zIndex) {
181
+ // Handle custom width values (non-named sizes)
182
+ var customWidthStyles = !(0, _const.isEuiFlyoutSizeNamed)(size) ? (0, _global_styling.logicalStyles)({
183
+ width: size
184
+ }) : {};
185
+ var isFill = size === 'fill';
186
+
187
+ // Handle dynamic width calculation for fill size in side-by-side mode
188
+ var dynamicStyles = isFill && layoutMode === 'side-by-side' && siblingFlyoutId && siblingFlyoutWidth ? (0, _global_styling.logicalStyles)({
189
+ width: "calc(90vw - ".concat(siblingFlyoutWidth, "px)"),
190
+ minWidth: '0'
191
+ }) : {};
192
+
193
+ // For fill flyouts with maxWidth, we need to ensure the minWidth override is applied
194
+ // to override the CSS rule that sets min-inline-size: 90vw
195
+ var minWidthOverride = {};
196
+ if (isFill && maxWidth) {
197
+ if (layoutMode === 'side-by-side' && siblingFlyoutId && siblingFlyoutWidth && dynamicStyles.inlineSize) {
198
+ // For fill flyouts with maxWidth and a sibling: min(maxWidth, calc(90vw - siblingWidth))
199
+ var dynamicWidth = dynamicStyles.inlineSize;
200
+ var maxWidthWithUnits = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
201
+ minWidthOverride = {
202
+ minWidth: "min(".concat(maxWidthWithUnits, ", ").concat(dynamicWidth, ")")
203
+ };
204
+ } else {
205
+ // For fill flyouts with maxWidth but no sibling: min(maxWidth, 90vw)
206
+ var maxWidthOverrides = composeMaxWidthOverrides(maxWidth, isFill);
207
+ minWidthOverride = {
208
+ minWidth: maxWidthOverrides.minInlineSize
209
+ };
210
+ }
211
+ }
212
+
213
+ // Calculate the final maxWidth based on conditions
214
+ var finalMaxWidth;
215
+ if (maxWidth && isFill && layoutMode === 'side-by-side' && siblingFlyoutId && siblingFlyoutWidth && dynamicStyles.inlineSize) {
216
+ // For fill flyouts with maxWidth and a sibling: min(maxWidth, calc(90vw - siblingWidth))
217
+ var _dynamicWidth = dynamicStyles.inlineSize;
218
+ var _maxWidthWithUnits = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
219
+ finalMaxWidth = "min(".concat(_maxWidthWithUnits, ", ").concat(_dynamicWidth, ")");
220
+ } else if (maxWidth) {
221
+ // For all other cases with maxWidth: use the original maxWidth value
222
+ finalMaxWidth = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
223
+ }
224
+ return (0, _global_styling.logicalStyles)(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, customWidthStyles), dynamicStyles), minWidthOverride), finalMaxWidth ? {
225
+ maxWidth: finalMaxWidth
226
+ } : {}), {}, {
227
+ zIndex: zIndex
228
+ }));
134
229
  };