@elastic/eui 69.0.0 → 70.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 (191) hide show
  1. package/dist/eui_theme_dark.css +0 -375
  2. package/dist/eui_theme_dark.json +0 -27
  3. package/dist/eui_theme_dark.json.d.ts +0 -27
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -375
  6. package/dist/eui_theme_light.json +0 -27
  7. package/dist/eui_theme_light.json.d.ts +0 -27
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/basic_table/in_memory_table.js +8 -2
  10. package/es/components/code/code.js +7 -3
  11. package/es/components/code/code.styles.js +32 -0
  12. package/es/components/code/code_block.js +72 -315
  13. package/es/components/code/code_block.styles.js +153 -0
  14. package/es/components/code/code_block_controls.js +29 -0
  15. package/es/components/code/code_block_controls.styles.js +43 -0
  16. package/es/components/code/code_block_copy.js +65 -0
  17. package/es/components/code/code_block_full_screen.js +90 -0
  18. package/es/components/code/code_block_line.styles.js +49 -0
  19. package/es/components/code/code_block_overflow.js +78 -0
  20. package/es/components/code/code_block_virtualized.js +59 -0
  21. package/es/components/code/code_syntax.styles.js +43 -0
  22. package/es/components/code/utils.js +43 -37
  23. package/es/components/collapsible_nav/collapsible_nav.js +0 -5
  24. package/es/components/overlay_mask/overlay_mask.js +8 -14
  25. package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
  26. package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
  27. package/es/components/provider/provider.js +1 -5
  28. package/es/components/resizable_container/helpers.js +2 -2
  29. package/es/components/resizable_container/resizable_container.js +6 -9
  30. package/es/components/resizable_container/resizable_container.styles.js +28 -0
  31. package/es/components/resizable_container/resizable_panel.js +25 -48
  32. package/es/components/resizable_container/resizable_panel.styles.js +69 -0
  33. package/es/components/search_bar/query/ast.js +14 -3
  34. package/es/components/tool_tip/tool_tip.js +3 -2
  35. package/es/components/tool_tip/tool_tip.styles.js +17 -22
  36. package/es/components/tool_tip/tool_tip_arrow.js +17 -3
  37. package/es/components/tool_tip/tool_tip_popover.js +7 -7
  38. package/es/components/tour/tour.styles.js +4 -3
  39. package/es/components/tour/tour_step.js +7 -5
  40. package/es/global_styling/functions/logicals.js +5 -3
  41. package/es/global_styling/functions/math.js +37 -19
  42. package/es/global_styling/mixins/_padding.js +13 -9
  43. package/eui.d.ts +291 -37
  44. package/i18ntokens.json +22 -22
  45. package/lib/components/basic_table/in_memory_table.js +8 -2
  46. package/lib/components/code/code.js +9 -3
  47. package/lib/components/code/code.styles.js +35 -0
  48. package/lib/components/code/code_block.js +72 -320
  49. package/lib/components/code/code_block.styles.js +154 -0
  50. package/lib/components/code/code_block_controls.js +48 -0
  51. package/lib/components/code/code_block_controls.styles.js +39 -0
  52. package/lib/components/code/code_block_copy.js +78 -0
  53. package/lib/components/code/code_block_full_screen.js +108 -0
  54. package/lib/components/code/code_block_line.styles.js +45 -0
  55. package/lib/components/code/code_block_overflow.js +82 -0
  56. package/lib/components/code/code_block_virtualized.js +72 -0
  57. package/lib/components/code/code_syntax.styles.js +57 -0
  58. package/lib/components/code/utils.js +40 -39
  59. package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
  60. package/lib/components/overlay_mask/overlay_mask.js +9 -14
  61. package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
  62. package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  63. package/lib/components/provider/provider.js +7 -12
  64. package/lib/components/resizable_container/helpers.js +2 -2
  65. package/lib/components/resizable_container/resizable_container.js +7 -9
  66. package/lib/components/resizable_container/resizable_container.styles.js +31 -0
  67. package/lib/components/resizable_container/resizable_panel.js +28 -49
  68. package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
  69. package/lib/components/search_bar/query/ast.js +14 -3
  70. package/lib/components/tool_tip/tool_tip.js +3 -2
  71. package/lib/components/tool_tip/tool_tip.styles.js +18 -26
  72. package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
  73. package/lib/components/tool_tip/tool_tip_popover.js +6 -6
  74. package/lib/components/tour/tour.styles.js +3 -2
  75. package/lib/components/tour/tour_step.js +7 -5
  76. package/lib/global_styling/functions/logicals.js +5 -3
  77. package/lib/global_styling/functions/math.js +37 -19
  78. package/lib/global_styling/mixins/_padding.js +17 -10
  79. package/optimize/es/components/basic_table/in_memory_table.js +1 -1
  80. package/optimize/es/components/code/code.js +7 -3
  81. package/optimize/es/components/code/code.styles.js +32 -0
  82. package/optimize/es/components/code/code_block.js +70 -299
  83. package/optimize/es/components/code/code_block.styles.js +153 -0
  84. package/optimize/es/components/code/code_block_controls.js +29 -0
  85. package/optimize/es/components/code/code_block_controls.styles.js +43 -0
  86. package/optimize/es/components/code/code_block_copy.js +55 -0
  87. package/optimize/es/components/code/code_block_full_screen.js +80 -0
  88. package/optimize/es/components/code/code_block_line.styles.js +49 -0
  89. package/optimize/es/components/code/code_block_overflow.js +67 -0
  90. package/optimize/es/components/code/code_block_virtualized.js +59 -0
  91. package/optimize/es/components/code/code_syntax.styles.js +43 -0
  92. package/optimize/es/components/code/utils.js +43 -37
  93. package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
  94. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
  95. package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
  96. package/optimize/es/components/provider/provider.js +1 -5
  97. package/optimize/es/components/resizable_container/helpers.js +2 -2
  98. package/optimize/es/components/resizable_container/resizable_container.js +6 -9
  99. package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
  100. package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
  101. package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
  102. package/optimize/es/components/search_bar/query/ast.js +14 -3
  103. package/optimize/es/components/tool_tip/tool_tip.js +3 -2
  104. package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
  105. package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
  106. package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
  107. package/optimize/es/components/tour/tour.styles.js +4 -3
  108. package/optimize/es/components/tour/tour_step.js +7 -5
  109. package/optimize/es/global_styling/functions/logicals.js +5 -3
  110. package/optimize/es/global_styling/functions/math.js +35 -17
  111. package/optimize/es/global_styling/mixins/_padding.js +13 -9
  112. package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
  113. package/optimize/lib/components/code/code.js +9 -3
  114. package/optimize/lib/components/code/code.styles.js +35 -0
  115. package/optimize/lib/components/code/code_block.js +71 -306
  116. package/optimize/lib/components/code/code_block.styles.js +156 -0
  117. package/optimize/lib/components/code/code_block_controls.js +48 -0
  118. package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
  119. package/optimize/lib/components/code/code_block_copy.js +78 -0
  120. package/optimize/lib/components/code/code_block_full_screen.js +108 -0
  121. package/optimize/lib/components/code/code_block_line.styles.js +45 -0
  122. package/optimize/lib/components/code/code_block_overflow.js +82 -0
  123. package/optimize/lib/components/code/code_block_virtualized.js +81 -0
  124. package/optimize/lib/components/code/code_syntax.styles.js +57 -0
  125. package/optimize/lib/components/code/utils.js +40 -37
  126. package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
  127. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
  128. package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  129. package/optimize/lib/components/provider/provider.js +7 -12
  130. package/optimize/lib/components/resizable_container/helpers.js +2 -2
  131. package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
  132. package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
  133. package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
  134. package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
  135. package/optimize/lib/components/search_bar/query/ast.js +14 -3
  136. package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
  137. package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
  138. package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
  139. package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
  140. package/optimize/lib/components/tour/tour.styles.js +3 -2
  141. package/optimize/lib/components/tour/tour_step.js +7 -5
  142. package/optimize/lib/global_styling/functions/logicals.js +4 -10
  143. package/optimize/lib/global_styling/functions/math.js +37 -19
  144. package/optimize/lib/global_styling/mixins/_padding.js +17 -10
  145. package/package.json +8 -7
  146. package/src/components/index.scss +0 -1
  147. package/src/components/resizable_container/_index.scss +0 -2
  148. package/src/global_styling/mixins/_header.scss +1 -1
  149. package/src/global_styling/variables/_index.scss +0 -1
  150. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  151. package/test-env/components/basic_table/in_memory_table.js +8 -2
  152. package/test-env/components/code/code.styles.js +35 -0
  153. package/test-env/components/code/code_block.styles.js +156 -0
  154. package/test-env/components/code/code_block_controls.js +48 -0
  155. package/test-env/components/code/code_block_controls.styles.js +39 -0
  156. package/test-env/components/code/code_block_copy.js +78 -0
  157. package/test-env/components/code/code_block_full_screen.js +108 -0
  158. package/test-env/components/code/code_block_line.styles.js +45 -0
  159. package/test-env/components/code/code_block_overflow.js +82 -0
  160. package/test-env/components/code/code_block_virtualized.js +81 -0
  161. package/test-env/components/code/code_syntax.styles.js +57 -0
  162. package/test-env/components/code/utils.js +40 -37
  163. package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
  164. package/test-env/components/overlay_mask/overlay_mask.js +9 -14
  165. package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
  166. package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  167. package/test-env/components/provider/provider.js +7 -12
  168. package/test-env/components/resizable_container/helpers.js +2 -2
  169. package/test-env/components/resizable_container/resizable_container.js +7 -9
  170. package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
  171. package/test-env/components/resizable_container/resizable_panel.js +28 -49
  172. package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
  173. package/test-env/components/search_bar/query/ast.js +14 -3
  174. package/test-env/components/tool_tip/tool_tip.js +3 -2
  175. package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
  176. package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
  177. package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
  178. package/test-env/components/tour/tour.styles.js +3 -2
  179. package/test-env/components/tour/tour_step.js +7 -5
  180. package/test-env/global_styling/functions/logicals.js +4 -10
  181. package/test-env/global_styling/functions/math.js +37 -19
  182. package/test-env/global_styling/mixins/_padding.js +17 -10
  183. package/src/components/code/_code.scss +0 -15
  184. package/src/components/code/_code_block.scss +0 -177
  185. package/src/components/code/_index.scss +0 -4
  186. package/src/components/code/_mixins.scss +0 -127
  187. package/src/components/code/_variables.scss +0 -5
  188. package/src/components/resizable_container/_resizable_container.scss +0 -8
  189. package/src/components/resizable_container/_resizable_panel.scss +0 -51
  190. package/src/global_styling/variables/_colors_code.scss +0 -23
  191. package/src/themes/amsterdam/overrides/_code.scss +0 -9
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiCodeSyntaxTokens = exports.euiCodeSyntaxColors = void 0;
7
+
8
+ var _services = require("../../services");
9
+
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ var visColors = (0, _services.euiPaletteColorBlind)();
18
+
19
+ var euiCodeSyntaxColors = function euiCodeSyntaxColors(euiThemeContext) {
20
+ var euiTheme = euiThemeContext.euiTheme;
21
+ var backgroundColor = euiTheme.colors.lightestShade;
22
+ return {
23
+ backgroundColor: backgroundColor,
24
+ color: (0, _services.makeHighContrastColor)(euiTheme.colors.text)(backgroundColor),
25
+ inlineCodeColor: (0, _services.makeHighContrastColor)(visColors[3])(backgroundColor),
26
+ selectedBackgroundColor: 'inherit',
27
+ commentColor: (0, _services.makeHighContrastColor)(euiTheme.colors.subduedText)(backgroundColor),
28
+ selectorTagColor: 'inherit',
29
+ stringColor: (0, _services.makeHighContrastColor)(visColors[2])(backgroundColor),
30
+ tagColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
31
+ nameColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
32
+ numberColor: (0, _services.makeHighContrastColor)(visColors[0])(backgroundColor),
33
+ keywordColor: (0, _services.makeHighContrastColor)(visColors[3])(backgroundColor),
34
+ functionTitleColor: 'inherit',
35
+ typeColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
36
+ attributeColor: 'inherit',
37
+ symbolColor: (0, _services.makeHighContrastColor)(visColors[9])(backgroundColor),
38
+ paramsColor: 'inherit',
39
+ metaColor: (0, _services.makeHighContrastColor)(euiTheme.colors.subduedText)(backgroundColor),
40
+ titleColor: (0, _services.makeHighContrastColor)(visColors[7])(backgroundColor),
41
+ sectionColor: (0, _services.makeHighContrastColor)(visColors[9])(backgroundColor),
42
+ additionColor: (0, _services.makeHighContrastColor)(visColors[0])(backgroundColor),
43
+ deletionColor: (0, _services.makeHighContrastColor)(euiTheme.colors.danger)(backgroundColor),
44
+ selectorClassColor: 'inherit',
45
+ selectorIdColor: 'inherit'
46
+ };
47
+ };
48
+
49
+ exports.euiCodeSyntaxColors = euiCodeSyntaxColors;
50
+
51
+ var euiCodeSyntaxTokens = function euiCodeSyntaxTokens(euiThemeContext) {
52
+ var euiTheme = euiThemeContext.euiTheme;
53
+ var euiCodeBlock = euiCodeSyntaxColors(euiThemeContext);
54
+ return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: .7;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ".concat(euiCodeBlock.commentColor, ";\n font-style: italic;\n }\n \n .token.selector {\n color: ").concat(euiCodeBlock.selectorTagColor, ";\n }\n \n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(euiCodeBlock.stringColor, ";\n }\n \n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(euiCodeBlock.numberColor, ";\n }\n \n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(euiCodeBlock.keywordColor, ";\n }\n \n .token.function {\n color: ").concat(euiCodeBlock.functionTitleColor, ";\n }\n \n .token.tag {\n color: ").concat(euiCodeBlock.tagColor, ";\n }\n \n .token.class-name {\n color: ").concat(euiCodeBlock.typeColor, ";\n }\n \n .token.property {\n color: ").concat(euiCodeBlock.attributeColor, ";\n }\n \n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(euiCodeBlock.symbolColor, ";\n }\n \n .token.paramater {\n color: ").concat(euiCodeBlock.paramsColor, ";\n }\n \n .token.meta,\n .token.important {\n color: ").concat(euiCodeBlock.metaColor, ";\n }\n \n .token.title {\n color: ").concat(euiCodeBlock.titleColor, ";\n }\n \n .token.section {\n color: ").concat(euiCodeBlock.sectionColor, ";\n }\n \n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n \n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(euiCodeBlock.additionColor, ";\n color: ").concat(euiCodeBlock.additionColor, ";\n }\n \n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(euiCodeBlock.deletionColor, ";\n color: ").concat(euiCodeBlock.deletionColor, ";\n }\n \n .token.selector .token.class {\n color: ").concat(euiCodeBlock.selectorClassColor, ";\n }\n \n .token.selector .token.id {\n color: ").concat(euiCodeBlock.selectorIdColor, ";\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.important,\n .token.bold {\n font-weight: $euiCodeFontWeightBold;\n }\n \n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n \n .token.entity {\n cursor: help;\n }\n ");
55
+ };
56
+
57
+ exports.euiCodeSyntaxTokens = euiCodeSyntaxTokens;
@@ -15,7 +15,9 @@ var _react = _interopRequireWildcard(require("react"));
15
15
 
16
16
  var _refractor = require("refractor");
17
17
 
18
- var _classnames = _interopRequireDefault(require("classnames"));
18
+ var _css = require("@emotion/css");
19
+
20
+ var _code_block_line = require("./code_block_line.styles");
19
21
 
20
22
  var _react2 = require("@emotion/react");
21
23
 
@@ -64,7 +66,7 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
64
66
  children = node.children;
65
67
  return /*#__PURE__*/(0, _react.createElement)(tagName, _objectSpread(_objectSpread({}, properties), {}, {
66
68
  key: key,
67
- className: (0, _classnames.default)(properties.className)
69
+ className: (0, _css.cx)(properties.className)
68
70
  }), children && children.map(function (el, i) {
69
71
  return nodeToHtml(el, i, nodes, depth + 1);
70
72
  }));
@@ -81,8 +83,7 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
81
83
 
82
84
  exports.nodeToHtml = nodeToHtml;
83
85
  // Approximate width of a single digit/character
84
- var CHAR_SIZE = 8;
85
- var $euiSizeS = 8; // Creates an array of numbers from comma-separeated
86
+ var CHAR_SIZE = 8; // Creates an array of numbers from comma-separeated
86
87
  // string of numbers or number ranges using `-`
87
88
  // (e.g., "1, 3-10, 15")
88
89
 
@@ -157,8 +158,7 @@ var addLineData = function addLineData(nodes, data) {
157
158
  }, []);
158
159
  };
159
160
 
160
- function wrapLines(nodes, options) {
161
- var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
161
+ function wrapLines(nodes, options, euiTheme) {
162
162
  var grouped = [];
163
163
  nodes.forEach(function (node) {
164
164
  var lineStart = node.lineStart - 1;
@@ -170,41 +170,44 @@ function wrapLines(nodes, options) {
170
170
  }
171
171
  });
172
172
  var wrapped = [];
173
- var digits = grouped.length.toString().length;
174
- var width = digits * CHAR_SIZE;
175
173
  grouped.forEach(function (node, i) {
176
- var _properties;
177
-
178
- var lineNumber = i + 1;
179
- var classes = (0, _classnames.default)('euiCodeBlock__line', {
180
- 'euiCodeBlock__line--isHighlighted': highlights.includes(lineNumber)
181
- });
182
- var children = options.showLineNumbers ? [{
183
- type: 'element',
184
- tagName: 'span',
185
- properties: (_properties = {
186
- style: {
187
- width: width
188
- }
189
- }, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties, 'aria-hidden', true), (0, _defineProperty2.default)(_properties, "className", ['euiCodeBlock__lineNumber']), _properties),
190
- children: []
191
- }, {
192
- type: 'element',
193
- tagName: 'span',
194
- properties: {
195
- style: {
196
- marginLeft: width + $euiSizeS,
197
- width: "calc(100% - ".concat(width, "px)")
174
+ var children = node;
175
+ var styles = (0, _code_block_line.euiCodeBlockLineStyles)(euiTheme);
176
+ var lineStyles = (0, _css.cx)([styles.euiCodeBlock__line, options.showLineNumbers && styles.hasLineNumbers]);
177
+
178
+ if (options.showLineNumbers) {
179
+ var _properties;
180
+
181
+ var lineNumber = i + 1;
182
+ var digits = grouped.length.toString().length;
183
+ var width = digits * CHAR_SIZE;
184
+ var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
185
+ var lineTextStyles = (0, _css.cx)([styles.lineText.euiCodeBlock__lineText, highlights.includes(lineNumber) && styles.lineText.isHighlighted]);
186
+ var lineNumberStyles = (0, _css.cx)(styles.lineNumber.euiCodeBlock__lineNumber);
187
+ children = [{
188
+ type: 'element',
189
+ tagName: 'span',
190
+ properties: (_properties = {
191
+ style: {
192
+ inlineSize: width
193
+ }
194
+ }, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties, 'aria-hidden', true), (0, _defineProperty2.default)(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberStyles]), _properties),
195
+ children: []
196
+ }, {
197
+ type: 'element',
198
+ tagName: 'span',
199
+ properties: {
200
+ className: ['euiCodeBlock__lineText', lineTextStyles]
198
201
  },
199
- className: ['euiCodeBlock__lineText']
200
- },
201
- children: node
202
- }] : node;
202
+ children: node
203
+ }];
204
+ }
205
+
203
206
  wrapped.push({
204
207
  type: 'element',
205
208
  tagName: 'span',
206
209
  properties: {
207
- className: [classes]
210
+ className: ['euiCodeBlock__line', lineStyles]
208
211
  },
209
212
  children: children
210
213
  });
@@ -212,13 +215,13 @@ function wrapLines(nodes, options) {
212
215
  return wrapped;
213
216
  }
214
217
 
215
- var highlightByLine = function highlightByLine(children, language, data) {
218
+ var highlightByLine = function highlightByLine(children, language, data, euiTheme) {
216
219
  return wrapLines(addLineData((0, _refractor.highlight)(children, language), {
217
220
  lineNumber: data.start
218
221
  }), {
219
222
  showLineNumbers: data.show,
220
223
  highlight: data.highlight
221
- });
224
+ }, euiTheme);
222
225
  };
223
226
 
224
227
  exports.highlightByLine = highlightByLine;
@@ -188,11 +188,6 @@ EuiCollapsibleNav.propTypes = {
188
188
  * Adjustments to the EuiOverlayMask that is added when `ownFocus = true`
189
189
  */
190
190
  maskProps: _propTypes.default.shape({
191
- className: _propTypes.default.string,
192
- "aria-label": _propTypes.default.string,
193
- "data-test-subj": _propTypes.default.string,
194
- css: _propTypes.default.any,
195
-
196
191
  /**
197
192
  * ReactNode to render as this component's content
198
193
  */
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _propTypes = _interopRequireDefault(require("prop-types"));
19
19
 
20
- var _classnames = _interopRequireDefault(require("classnames"));
20
+ var _css = require("@emotion/css");
21
21
 
22
22
  var _react2 = require("@emotion/react");
23
23
 
@@ -29,7 +29,9 @@ var _portal = require("../portal");
29
29
 
30
30
  var _overlay_mask = require("./overlay_mask.styles");
31
31
 
32
- var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "css"];
32
+ var _overlay_mask_body = require("./overlay_mask_body.styles");
33
+
34
+ var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
33
35
 
34
36
  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); }
35
37
 
@@ -41,7 +43,6 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
41
43
  _ref$headerZindexLoca = _ref.headerZindexLocation,
42
44
  headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
43
45
  maskRef = _ref.maskRef,
44
- css = _ref.css,
45
46
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
46
47
 
47
48
  var _useState = (0, _react.useState)(null),
@@ -52,7 +53,7 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
52
53
  var combinedMaskRef = (0, _services.useCombinedRefs)([setOverlayMaskNode, maskRef]);
53
54
  var euiTheme = (0, _services.useEuiTheme)();
54
55
  var styles = (0, _overlay_mask.euiOverlayMaskStyles)(euiTheme);
55
- var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
56
+ var cssStyles = (0, _css.cx)([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]]);
56
57
  (0, _react.useEffect)(function () {
57
58
  if (!overlayMaskNode) return;
58
59
  (0, _common.keysOf)(rest).forEach(function (key) {
@@ -68,24 +69,18 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
68
69
 
69
70
  (0, _react.useEffect)(function () {
70
71
  if (!overlayMaskNode) return;
71
- overlayMaskNode.className = (0, _classnames.default)('euiOverlayMask', className);
72
- }, [overlayMaskNode, className]);
72
+ overlayMaskNode.className = (0, _css.cx)('euiOverlayMask', cssStyles, className);
73
+ overlayMaskNode.dataset.relativeToHeader = headerZindexLocation;
74
+ }, [overlayMaskNode, className, cssStyles, headerZindexLocation]);
73
75
  return (0, _react2.jsx)(_portal.EuiPortal, {
74
76
  portalRef: combinedMaskRef
75
77
  }, (0, _react2.jsx)(_react2.Global, {
76
- styles: _overlay_mask.euiOverlayMaskBodyStyles
77
- }), (0, _react2.jsx)(_react2.Global, {
78
- styles: cssStyles
78
+ styles: _overlay_mask_body.euiOverlayMaskBodyStyles
79
79
  }), children);
80
80
  };
81
81
 
82
82
  exports.EuiOverlayMask = EuiOverlayMask;
83
83
  EuiOverlayMask.propTypes = {
84
- className: _propTypes.default.string,
85
- "aria-label": _propTypes.default.string,
86
- "data-test-subj": _propTypes.default.string,
87
- css: _propTypes.default.any,
88
-
89
84
  /**
90
85
  * ReactNode to render as this component's content
91
86
  */
@@ -3,32 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiOverlayMaskStyles = exports.euiOverlayMaskBodyStyles = void 0;
6
+ exports.euiOverlayMaskStyles = void 0;
7
7
 
8
- var _react = require("@emotion/react");
8
+ var _css = require("@emotion/css");
9
9
 
10
10
  var _global_styling = require("../../global_styling");
11
11
 
12
12
  var _services = require("../../services");
13
13
 
14
- 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
-
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
16
21
  var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
17
22
  var euiTheme = _ref.euiTheme;
18
23
  return {
19
- euiOverlayMask: /*#__PURE__*/(0, _react.css)(".euiOverlayMask{position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', '10vh'), ";animation:", _global_styling.euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", (0, _services.transparentize)(euiTheme.colors.ink, 0.5), ";};label:euiOverlayMask;"),
20
- aboveHeader: /*#__PURE__*/(0, _react.css)(".euiOverlayMask{z-index:", euiTheme.levels.mask, ";};label:aboveHeader;"),
21
- belowHeader: /*#__PURE__*/(0, _react.css)(".euiOverlayMask{z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top', "".concat(euiTheme.base * 3, "px")), ";};label:belowHeader;")
24
+ euiOverlayMask: /*#__PURE__*/(0, _css.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', '10vh'), ";animation:", _global_styling.euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", (0, _services.transparentize)(euiTheme.colors.ink, 0.5), ";;label:euiOverlayMask;"),
25
+ aboveHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
26
+ belowHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top', "".concat(euiTheme.base * 3, "px")), ";;label:belowHeader;")
22
27
  };
23
28
  };
24
29
 
25
- exports.euiOverlayMaskStyles = euiOverlayMaskStyles;
26
- var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
27
- name: "131160-euiOverlayMaskBodyStyles",
28
- styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
29
- } : {
30
- name: "131160-euiOverlayMaskBodyStyles",
31
- styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
32
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
- };
34
- exports.euiOverlayMaskBodyStyles = euiOverlayMaskBodyStyles;
30
+ exports.euiOverlayMaskStyles = euiOverlayMaskStyles;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiOverlayMaskBodyStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ 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)."; }
11
+
12
+ var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
13
+ name: "131160-euiOverlayMaskBodyStyles",
14
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
15
+ } : {
16
+ name: "131160-euiOverlayMaskBodyStyles",
17
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
18
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
+ };
20
+ exports.euiOverlayMaskBodyStyles = euiOverlayMaskBodyStyles;
@@ -9,7 +9,7 @@ exports.EuiProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _cache = _interopRequireDefault(require("@emotion/cache"));
12
+ var _css = require("@emotion/css");
13
13
 
14
14
  var _global_styles = require("../../global_styling/reset/global_styles");
15
15
 
@@ -19,7 +19,7 @@ var _services = require("../../services");
19
19
 
20
20
  var _themes = require("../../themes");
21
21
 
22
- var _cache2 = require("./cache");
22
+ var _cache = require("./cache");
23
23
 
24
24
  var _react2 = require("@emotion/react");
25
25
 
@@ -34,16 +34,11 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
34
34
  return obj.hasOwnProperty('key');
35
35
  };
36
36
 
37
- var fallbackCache = (0, _cache.default)({
38
- key: 'css'
39
- });
40
- fallbackCache.compat = true;
41
-
42
37
  var EuiProvider = function EuiProvider(_ref) {
43
38
  var _defaultCache;
44
39
 
45
40
  var _ref$cache = _ref.cache,
46
- cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
41
+ cache = _ref$cache === void 0 ? _css.cache : _ref$cache,
47
42
  _ref$theme = _ref.theme,
48
43
  theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
49
44
  _ref$globalStyles = _ref.globalStyles,
@@ -82,16 +77,16 @@ var EuiProvider = function EuiProvider(_ref) {
82
77
  }
83
78
  }
84
79
 
85
- return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
86
- cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
80
+ return (0, _react2.jsx)(_cache.EuiCacheProvider, {
81
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : _css.cache
87
82
  }, (0, _react2.jsx)(_services.EuiThemeProvider, {
88
83
  theme: theme !== null && theme !== void 0 ? theme : undefined,
89
84
  colorMode: colorMode,
90
85
  modify: modify
91
- }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
86
+ }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache.EuiCacheProvider, {
92
87
  cache: globalCache,
93
88
  children: Globals && (0, _react2.jsx)(Globals, null)
94
- }), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
89
+ }), (0, _react2.jsx)(_cache.EuiCacheProvider, {
95
90
  cache: utilityCache,
96
91
  children: Utilities && (0, _react2.jsx)(Utilities, null)
97
92
  })), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
@@ -43,7 +43,7 @@ exports.sizesOnly = sizesOnly;
43
43
 
44
44
  var _getPanelMinSize = function _getPanelMinSize(panelMinSize, containerSize) {
45
45
  var panelMinSizePercent = 0;
46
- var panelMinSizeInt = parseInt(panelMinSize);
46
+ var panelMinSizeInt = parseFloat(panelMinSize);
47
47
 
48
48
  if (panelMinSize.indexOf('px') > -1) {
49
49
  panelMinSizePercent = pxToPercent(panelMinSizeInt, containerSize);
@@ -78,7 +78,7 @@ var getSiblingPanel = function getSiblingPanel(element, adjacency) {
78
78
  var sibling = element[method];
79
79
 
80
80
  while (sibling) {
81
- if (sibling.matches('.euiResizablePanel:not(.euiResizablePanel-isCollapsed)')) {
81
+ if (sibling.matches('.euiResizablePanel:not([data-collapsed])')) {
82
82
  return sibling;
83
83
  }
84
84
 
@@ -35,6 +35,8 @@ var _resizable_panel = require("./resizable_panel");
35
35
 
36
36
  var _helpers = require("./helpers");
37
37
 
38
+ var _resizable_container = require("./resizable_container.styles");
39
+
38
40
  var _react2 = require("@emotion/react");
39
41
 
40
42
  var _excluded = ["direction", "children", "className", "onPanelWidthChange", "onToggleCollapsed", "onResizeStart", "onResizeEnd"];
@@ -47,10 +49,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
47
49
 
48
50
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
49
51
 
50
- var containerDirections = {
51
- vertical: 'vertical',
52
- horizontal: 'horizontal'
53
- };
54
52
  var initialState = {
55
53
  isDragging: false,
56
54
  currentResizerPos: -1,
@@ -72,11 +70,10 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
72
70
  onResizeEnd = _ref.onResizeEnd,
73
71
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
74
72
  var containerRef = (0, _react.useRef)(null);
75
- var isHorizontal = direction === containerDirections.horizontal;
76
- var classes = (0, _classnames.default)('euiResizableContainer', {
77
- 'euiResizableContainer--vertical': !isHorizontal,
78
- 'euiResizableContainer--horizontal': isHorizontal
79
- }, className);
73
+ var isHorizontal = direction === 'horizontal';
74
+ var classes = (0, _classnames.default)('euiResizableContainer', className);
75
+ var styles = (0, _resizable_container.euiResizableContainerStyles)();
76
+ var cssStyles = [styles.euiResizableContainer, styles[direction]];
80
77
 
81
78
  var _useContainerCallback = (0, _helpers.useContainerCallbacks)({
82
79
  initialState: _objectSpread(_objectSpread({}, initialState), {}, {
@@ -249,6 +246,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
249
246
  resizers: reducerState.resizers
250
247
  }
251
248
  }, (0, _react2.jsx)("div", (0, _extends2.default)({
249
+ css: cssStyles,
252
250
  className: classes,
253
251
  ref: containerRef,
254
252
  onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiResizableContainerStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ 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)."; }
13
+
14
+ var _ref = process.env.NODE_ENV === "production" ? {
15
+ name: "omnk2l-vertical",
16
+ styles: "flex-direction:column;label:vertical;"
17
+ } : {
18
+ name: "omnk2l-vertical",
19
+ styles: "flex-direction:column;label:vertical;",
20
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
21
+ };
22
+
23
+ var euiResizableContainerStyles = function euiResizableContainerStyles() {
24
+ return {
25
+ euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
26
+ horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
27
+ vertical: _ref
28
+ };
29
+ };
30
+
31
+ exports.euiResizableContainerStyles = euiResizableContainerStyles;
@@ -25,16 +25,20 @@ var _react = _interopRequireWildcard(require("react"));
25
25
 
26
26
  var _classnames = _interopRequireDefault(require("classnames"));
27
27
 
28
- var _context = require("./context");
29
-
30
28
  var _services = require("../../services");
31
29
 
30
+ var _global_styling = require("../../global_styling");
31
+
32
+ var _context = require("./context");
33
+
32
34
  var _panel = require("../panel");
33
35
 
34
36
  var _i18n = require("../i18n");
35
37
 
36
38
  var _resizable_collapse_button = require("./resizable_collapse_button");
37
39
 
40
+ var _resizable_panel = require("./resizable_panel.styles");
41
+
38
42
  var _react2 = require("@emotion/react");
39
43
 
40
44
  var _excluded = ["children", "className", "id", "isHorizontal", "size", "initialSize", "minSize", "scrollable", "mode", "registration", "onToggleCollapsed", "onToggleCollapsedInternal", "wrapperProps", "hasShadow", "borderRadius", "color", "paddingSize", "wrapperPadding"];
@@ -47,14 +51,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
47
51
 
48
52
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
49
53
 
50
- var panelPaddingValues = {
51
- none: 0,
52
- xs: 4,
53
- s: 8,
54
- m: 16,
55
- l: 24,
56
- xl: 32
57
- };
58
54
  var defaultToggleOptions = {
59
55
  className: null,
60
56
  'data-test-subj': undefined,
@@ -72,12 +68,6 @@ var getToggleOptions = function getToggleOptions(mode) {
72
68
  };
73
69
 
74
70
  exports.getToggleOptions = getToggleOptions;
75
- var paddingSizeToClassNameMap = {
76
- none: null,
77
- s: 'euiResizablePanel--paddingSmall',
78
- m: 'euiResizablePanel--paddingMedium',
79
- l: 'euiResizablePanel--paddingLarge'
80
- };
81
71
 
82
72
  var getPosition = function getPosition(ref) {
83
73
  var position = 'middle';
@@ -184,34 +174,18 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
184
174
 
185
175
  return direction;
186
176
  }, [isCollapsed, isCollapsible, position, panels, panelId]);
187
- var padding = (0, _react.useMemo)(function () {
188
- return "".concat(panelPaddingValues[paddingSize] * 2, "px");
189
- }, [paddingSize]);
190
- var classes = (0, _classnames.default)('euiResizablePanel', // @ts-expect-error EuiPanel increased its available sizes
191
- // When we convert this component to Emotion, we should also increase sizes to match EuiPanel and remove this comment.
192
- paddingSizeToClassNameMap[wrapperPadding], {
193
- 'euiResizablePanel--collapsible': isCollapsible,
194
- 'euiResizablePanel-isCollapsed': isCollapsed
195
- }, "euiResizablePanel--".concat(position), wrapperProps && wrapperProps.className);
196
- var panelClasses = (0, _classnames.default)('euiResizablePanel__content', {
197
- 'euiResizablePanel__content--scrollable': scrollable
198
- }, className);
199
- var dimensions;
200
-
201
- if (size) {
202
- dimensions = {
203
- width: isHorizontal ? "".concat(size, "%") : '100%',
204
- height: isHorizontal ? 'auto' : "".concat(size, "%")
205
- };
206
- } else {
207
- dimensions = {
208
- width: isHorizontal ? "".concat(innerSize, "%") : '100%',
209
- height: isHorizontal ? 'auto' : "".concat(innerSize, "%")
210
- };
211
- }
212
-
213
- var styles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), dimensions);
214
-
177
+ var axis = isHorizontal ? 'horizontal' : 'vertical';
178
+ var euiTheme = (0, _services.useEuiTheme)();
179
+ var styles = (0, _resizable_panel.euiResizablePanelStyles)(euiTheme);
180
+ var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding]];
181
+ var contentStyles = (0, _resizable_panel.euiResizablePanelContentStyles)(euiTheme);
182
+ var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
183
+ var classes = (0, _classnames.default)('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
184
+ var panelClasses = (0, _classnames.default)('euiResizablePanel__content', className);
185
+
186
+ var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? (0, _global_styling.logicalSizeStyle)("".concat(size || innerSize, "%"), 'auto') : (0, _global_styling.logicalSizeStyle)('100%', "".concat(size || innerSize, "%")));
187
+
188
+ var padding = (0, _global_styling.euiPaddingSize)(euiTheme, paddingSize) || '0px';
215
189
  (0, _react.useEffect)(function () {
216
190
  if (!registration) return;
217
191
  var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
@@ -263,7 +237,7 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
263
237
  theResizer = resizers[resizerIds.current[0]];
264
238
  theToggle = (0, _react2.jsx)(_resizable_collapse_button.EuiResizableCollapseButton, {
265
239
  externalPosition: "before",
266
- direction: isHorizontal ? 'horizontal' : 'vertical',
240
+ direction: axis,
267
241
  isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
268
242
  isCollapsed: theResizer && theResizer.isDisabled,
269
243
  internalPosition: toggleOpts.position,
@@ -275,7 +249,7 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
275
249
  theResizer = resizers[resizerIds.current[1]];
276
250
  theToggle = (0, _react2.jsx)(_resizable_collapse_button.EuiResizableCollapseButton, {
277
251
  externalPosition: "after",
278
- direction: isHorizontal ? 'horizontal' : 'vertical',
252
+ direction: axis,
279
253
  isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
280
254
  isCollapsed: theResizer && theResizer.isDisabled,
281
255
  internalPosition: toggleOpts.position,
@@ -285,12 +259,17 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
285
259
  });
286
260
  }
287
261
 
288
- return (0, _react2.jsx)("div", (0, _extends2.default)({}, wrapperProps, {
262
+ return (0, _react2.jsx)("div", (0, _extends2.default)({
263
+ css: cssStyles
264
+ }, wrapperProps, {
289
265
  id: panelId,
290
266
  ref: divRef,
291
- style: styles,
292
- className: classes
267
+ style: inlineStyles,
268
+ className: classes,
269
+ "data-collapsed": isCollapsed || undefined,
270
+ "data-position": position
293
271
  }), hasVisibleToggle && hasLeftToggle && theToggle, (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
272
+ css: contentCssStyles,
294
273
  className: panelClasses,
295
274
  hasShadow: hasShadow,
296
275
  borderRadius: borderRadius,