@elastic/eui 97.1.0 → 97.2.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.
@@ -57,27 +57,21 @@ export var useColumnWidths = function useColumnWidths(_ref) {
57
57
  trailingControlColumns = _ref.trailingControlColumns,
58
58
  defaultColumnWidth = _ref.defaultColumnWidth,
59
59
  onColumnResize = _ref.onColumnResize;
60
- var getInitialWidths = useCallback(function (prevColumnWidths) {
61
- var columnWidths = _objectSpread({}, prevColumnWidths);
62
- columns.filter(doesColumnHaveAnInitialWidth).forEach(function (_ref2) {
63
- var id = _ref2.id,
64
- initialWidth = _ref2.initialWidth;
65
- if (columnWidths[id] == null) {
66
- columnWidths[id] = initialWidth;
67
- }
68
- });
69
- return columnWidths;
60
+ var computeColumnWidths = useCallback(function () {
61
+ return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
62
+ return _objectSpread(_objectSpread({}, initialWidths), {}, _defineProperty({}, column.id, column.initialWidth));
63
+ }, {});
70
64
  }, [columns]);
71
65
 
72
66
  // Passes initializer function for performance, so computing only runs once on init
73
67
  // @see https://react.dev/reference/react/useState#examples-initializer
74
- var _useState = useState(getInitialWidths),
68
+ var _useState = useState(computeColumnWidths),
75
69
  _useState2 = _slicedToArray(_useState, 2),
76
70
  columnWidths = _useState2[0],
77
71
  setColumnWidths = _useState2[1];
78
72
  useUpdateEffect(function () {
79
- setColumnWidths(getInitialWidths);
80
- }, [columns]);
73
+ setColumnWidths(computeColumnWidths());
74
+ }, [computeColumnWidths]);
81
75
  var setColumnWidth = useCallback(function (columnId, width) {
82
76
  setColumnWidths(function (prevColumnWidths) {
83
77
  return _objectSpread(_objectSpread({}, prevColumnWidths), {}, _defineProperty({}, columnId, width));
@@ -28,7 +28,7 @@ import { EuiHeaderSectionItemButton } from '../header_section';
28
28
  import { EuiHideFor, EuiShowFor } from '../../responsive';
29
29
  import { euiHeaderLinksStyles } from './header_links.styles';
30
30
  import { jsx as ___EmotionJSX } from "@emotion/react";
31
- export var GUTTER_SIZES = ['xs', 's', 'm', 'l'];
31
+ export var GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
32
32
  export var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
33
33
  var children = _ref.children,
34
34
  className = _ref.className,
@@ -31,6 +31,7 @@ export var euiHeaderLinksStyles = function euiHeaderLinksStyles(_ref3) {
31
31
  euiHeaderLinks: _ref2,
32
32
  euiHeaderLinks__list: _ref,
33
33
  gutterSizes: {
34
+ xxs: /*#__PURE__*/css("gap:", euiTheme.size.xs, ";;label:xxs;"),
34
35
  xs: /*#__PURE__*/css("gap:", euiTheme.size.s, ";;label:xs;"),
35
36
  s: /*#__PURE__*/css("gap:", euiTheme.size.m, ";;label:s;"),
36
37
  m: /*#__PURE__*/css("gap:", euiTheme.size.base, ";;label:m;"),
package/eui.d.ts CHANGED
@@ -19030,6 +19030,7 @@ declare module '@elastic/eui/src/components/header/header_links/header_links.sty
19030
19030
  euiHeaderLinks: import("@emotion/utils").SerializedStyles;
19031
19031
  euiHeaderLinks__list: import("@emotion/utils").SerializedStyles;
19032
19032
  gutterSizes: {
19033
+ xxs: import("@emotion/utils").SerializedStyles;
19033
19034
  xs: import("@emotion/utils").SerializedStyles;
19034
19035
  s: import("@emotion/utils").SerializedStyles;
19035
19036
  m: import("@emotion/utils").SerializedStyles;
@@ -19046,7 +19047,7 @@ declare module '@elastic/eui/src/components/header/header_links/header_links' {
19046
19047
  import { EuiPopoverProps } from '@elastic/eui/src/components/popover';
19047
19048
  import { EuiHeaderSectionItemButtonProps } from '@elastic/eui/src/components/header/header_section';
19048
19049
  import { EuiBreakpointSize } from '@elastic/eui/src/services/breakpoint';
19049
- export const GUTTER_SIZES: readonly ["xs", "s", "m", "l"]; type EuiHeaderLinksGutterSize = (typeof GUTTER_SIZES)[number]; type EuiHeaderLinksPopoverButtonProps = Partial<EuiHeaderSectionItemButtonProps> & {
19050
+ export const GUTTER_SIZES: readonly ["xxs", "xs", "s", "m", "l"]; type EuiHeaderLinksGutterSize = (typeof GUTTER_SIZES)[number]; type EuiHeaderLinksPopoverButtonProps = Partial<EuiHeaderSectionItemButtonProps> & {
19050
19051
  iconType?: IconType;
19051
19052
  };
19052
19053
  export type EuiHeaderLinksProps = CommonProps & Omit<HTMLAttributes<HTMLElement>, 'children'> & {
package/i18ntokens.json CHANGED
@@ -5119,12 +5119,12 @@
5119
5119
  "start": {
5120
5120
  "line": 114,
5121
5121
  "column": 4,
5122
- "index": 3416
5122
+ "index": 3423
5123
5123
  },
5124
5124
  "end": {
5125
5125
  "line": 114,
5126
5126
  "column": 75,
5127
- "index": 3487
5127
+ "index": 3494
5128
5128
  }
5129
5129
  },
5130
5130
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -5137,12 +5137,12 @@
5137
5137
  "start": {
5138
5138
  "line": 131,
5139
5139
  "column": 4,
5140
- "index": 3915
5140
+ "index": 3922
5141
5141
  },
5142
5142
  "end": {
5143
5143
  "line": 131,
5144
5144
  "column": 69,
5145
- "index": 3980
5145
+ "index": 3987
5146
5146
  }
5147
5147
  },
5148
5148
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -61,27 +61,21 @@ var useColumnWidths = exports.useColumnWidths = function useColumnWidths(_ref) {
61
61
  trailingControlColumns = _ref.trailingControlColumns,
62
62
  defaultColumnWidth = _ref.defaultColumnWidth,
63
63
  onColumnResize = _ref.onColumnResize;
64
- var getInitialWidths = (0, _react.useCallback)(function (prevColumnWidths) {
65
- var columnWidths = _objectSpread({}, prevColumnWidths);
66
- columns.filter(doesColumnHaveAnInitialWidth).forEach(function (_ref2) {
67
- var id = _ref2.id,
68
- initialWidth = _ref2.initialWidth;
69
- if (columnWidths[id] == null) {
70
- columnWidths[id] = initialWidth;
71
- }
72
- });
73
- return columnWidths;
64
+ var computeColumnWidths = (0, _react.useCallback)(function () {
65
+ return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
66
+ return _objectSpread(_objectSpread({}, initialWidths), {}, _defineProperty({}, column.id, column.initialWidth));
67
+ }, {});
74
68
  }, [columns]);
75
69
 
76
70
  // Passes initializer function for performance, so computing only runs once on init
77
71
  // @see https://react.dev/reference/react/useState#examples-initializer
78
- var _useState = (0, _react.useState)(getInitialWidths),
72
+ var _useState = (0, _react.useState)(computeColumnWidths),
79
73
  _useState2 = _slicedToArray(_useState, 2),
80
74
  columnWidths = _useState2[0],
81
75
  setColumnWidths = _useState2[1];
82
76
  (0, _services.useUpdateEffect)(function () {
83
- setColumnWidths(getInitialWidths);
84
- }, [columns]);
77
+ setColumnWidths(computeColumnWidths());
78
+ }, [computeColumnWidths]);
85
79
  var setColumnWidth = (0, _react.useCallback)(function (columnId, width) {
86
80
  setColumnWidths(function (prevColumnWidths) {
87
81
  return _objectSpread(_objectSpread({}, prevColumnWidths), {}, _defineProperty({}, columnId, width));
@@ -37,7 +37,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
37
37
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
38
38
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
39
39
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
40
- var GUTTER_SIZES = exports.GUTTER_SIZES = ['xs', 's', 'm', 'l'];
40
+ var GUTTER_SIZES = exports.GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
41
41
  var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
42
42
  var children = _ref.children,
43
43
  className = _ref.className,
@@ -35,6 +35,7 @@ var euiHeaderLinksStyles = exports.euiHeaderLinksStyles = function euiHeaderLink
35
35
  euiHeaderLinks: _ref2,
36
36
  euiHeaderLinks__list: _ref,
37
37
  gutterSizes: {
38
+ xxs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:xxs;"),
38
39
  xs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:xs;"),
39
40
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:s;"),
40
41
  m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
@@ -46,27 +46,21 @@ export var useColumnWidths = function useColumnWidths(_ref) {
46
46
  trailingControlColumns = _ref.trailingControlColumns,
47
47
  defaultColumnWidth = _ref.defaultColumnWidth,
48
48
  onColumnResize = _ref.onColumnResize;
49
- var getInitialWidths = useCallback(function (prevColumnWidths) {
50
- var columnWidths = _objectSpread({}, prevColumnWidths);
51
- columns.filter(doesColumnHaveAnInitialWidth).forEach(function (_ref2) {
52
- var id = _ref2.id,
53
- initialWidth = _ref2.initialWidth;
54
- if (columnWidths[id] == null) {
55
- columnWidths[id] = initialWidth;
56
- }
57
- });
58
- return columnWidths;
49
+ var computeColumnWidths = useCallback(function () {
50
+ return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
51
+ return _objectSpread(_objectSpread({}, initialWidths), {}, _defineProperty({}, column.id, column.initialWidth));
52
+ }, {});
59
53
  }, [columns]);
60
54
 
61
55
  // Passes initializer function for performance, so computing only runs once on init
62
56
  // @see https://react.dev/reference/react/useState#examples-initializer
63
- var _useState = useState(getInitialWidths),
57
+ var _useState = useState(computeColumnWidths),
64
58
  _useState2 = _slicedToArray(_useState, 2),
65
59
  columnWidths = _useState2[0],
66
60
  setColumnWidths = _useState2[1];
67
61
  useUpdateEffect(function () {
68
- setColumnWidths(getInitialWidths);
69
- }, [columns]);
62
+ setColumnWidths(computeColumnWidths());
63
+ }, [computeColumnWidths]);
70
64
  var setColumnWidth = useCallback(function (columnId, width) {
71
65
  setColumnWidths(function (prevColumnWidths) {
72
66
  return _objectSpread(_objectSpread({}, prevColumnWidths), {}, _defineProperty({}, columnId, width));
@@ -21,7 +21,7 @@ import { EuiHeaderSectionItemButton } from '../header_section';
21
21
  import { EuiHideFor, EuiShowFor } from '../../responsive';
22
22
  import { euiHeaderLinksStyles } from './header_links.styles';
23
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
- export var GUTTER_SIZES = ['xs', 's', 'm', 'l'];
24
+ export var GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
25
25
  export var EuiHeaderLinks = function EuiHeaderLinks(_ref) {
26
26
  var children = _ref.children,
27
27
  className = _ref.className,
@@ -31,6 +31,7 @@ export var euiHeaderLinksStyles = function euiHeaderLinksStyles(_ref3) {
31
31
  euiHeaderLinks: _ref2,
32
32
  euiHeaderLinks__list: _ref,
33
33
  gutterSizes: {
34
+ xxs: /*#__PURE__*/css("gap:", euiTheme.size.xs, ";;label:xxs;"),
34
35
  xs: /*#__PURE__*/css("gap:", euiTheme.size.s, ";;label:xs;"),
35
36
  s: /*#__PURE__*/css("gap:", euiTheme.size.m, ";;label:s;"),
36
37
  m: /*#__PURE__*/css("gap:", euiTheme.size.base, ";;label:m;"),
@@ -51,27 +51,21 @@ var useColumnWidths = exports.useColumnWidths = function useColumnWidths(_ref) {
51
51
  trailingControlColumns = _ref.trailingControlColumns,
52
52
  defaultColumnWidth = _ref.defaultColumnWidth,
53
53
  onColumnResize = _ref.onColumnResize;
54
- var getInitialWidths = (0, _react.useCallback)(function (prevColumnWidths) {
55
- var columnWidths = _objectSpread({}, prevColumnWidths);
56
- columns.filter(doesColumnHaveAnInitialWidth).forEach(function (_ref2) {
57
- var id = _ref2.id,
58
- initialWidth = _ref2.initialWidth;
59
- if (columnWidths[id] == null) {
60
- columnWidths[id] = initialWidth;
61
- }
62
- });
63
- return columnWidths;
54
+ var computeColumnWidths = (0, _react.useCallback)(function () {
55
+ return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
56
+ return _objectSpread(_objectSpread({}, initialWidths), {}, (0, _defineProperty2.default)({}, column.id, column.initialWidth));
57
+ }, {});
64
58
  }, [columns]);
65
59
 
66
60
  // Passes initializer function for performance, so computing only runs once on init
67
61
  // @see https://react.dev/reference/react/useState#examples-initializer
68
- var _useState = (0, _react.useState)(getInitialWidths),
62
+ var _useState = (0, _react.useState)(computeColumnWidths),
69
63
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
70
64
  columnWidths = _useState2[0],
71
65
  setColumnWidths = _useState2[1];
72
66
  (0, _services.useUpdateEffect)(function () {
73
- setColumnWidths(getInitialWidths);
74
- }, [columns]);
67
+ setColumnWidths(computeColumnWidths());
68
+ }, [computeColumnWidths]);
75
69
  var setColumnWidth = (0, _react.useCallback)(function (columnId, width) {
76
70
  setColumnWidths(function (prevColumnWidths) {
77
71
  return _objectSpread(_objectSpread({}, prevColumnWidths), {}, (0, _defineProperty2.default)({}, columnId, width));
@@ -30,7 +30,7 @@ var _excluded = ["children", "className", "gutterSize", "popoverBreakpoints", "p
30
30
  */
31
31
  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); }
32
32
  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; }
33
- var GUTTER_SIZES = exports.GUTTER_SIZES = ['xs', 's', 'm', 'l'];
33
+ var GUTTER_SIZES = exports.GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
34
34
  var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
35
35
  var children = _ref.children,
36
36
  className = _ref.className,
@@ -35,6 +35,7 @@ var euiHeaderLinksStyles = exports.euiHeaderLinksStyles = function euiHeaderLink
35
35
  euiHeaderLinks: _ref2,
36
36
  euiHeaderLinks__list: _ref,
37
37
  gutterSizes: {
38
+ xxs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:xxs;"),
38
39
  xs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:xs;"),
39
40
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:s;"),
40
41
  m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "97.1.0",
4
+ "version": "97.2.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -51,27 +51,21 @@ var useColumnWidths = exports.useColumnWidths = function useColumnWidths(_ref) {
51
51
  trailingControlColumns = _ref.trailingControlColumns,
52
52
  defaultColumnWidth = _ref.defaultColumnWidth,
53
53
  onColumnResize = _ref.onColumnResize;
54
- var getInitialWidths = (0, _react.useCallback)(function (prevColumnWidths) {
55
- var columnWidths = _objectSpread({}, prevColumnWidths);
56
- columns.filter(doesColumnHaveAnInitialWidth).forEach(function (_ref2) {
57
- var id = _ref2.id,
58
- initialWidth = _ref2.initialWidth;
59
- if (columnWidths[id] == null) {
60
- columnWidths[id] = initialWidth;
61
- }
62
- });
63
- return columnWidths;
54
+ var computeColumnWidths = (0, _react.useCallback)(function () {
55
+ return columns.filter(doesColumnHaveAnInitialWidth).reduce(function (initialWidths, column) {
56
+ return _objectSpread(_objectSpread({}, initialWidths), {}, (0, _defineProperty2.default)({}, column.id, column.initialWidth));
57
+ }, {});
64
58
  }, [columns]);
65
59
 
66
60
  // Passes initializer function for performance, so computing only runs once on init
67
61
  // @see https://react.dev/reference/react/useState#examples-initializer
68
- var _useState = (0, _react.useState)(getInitialWidths),
62
+ var _useState = (0, _react.useState)(computeColumnWidths),
69
63
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
70
64
  columnWidths = _useState2[0],
71
65
  setColumnWidths = _useState2[1];
72
66
  (0, _services.useUpdateEffect)(function () {
73
- setColumnWidths(getInitialWidths);
74
- }, [columns]);
67
+ setColumnWidths(computeColumnWidths());
68
+ }, [computeColumnWidths]);
75
69
  var setColumnWidth = (0, _react.useCallback)(function (columnId, width) {
76
70
  setColumnWidths(function (prevColumnWidths) {
77
71
  return _objectSpread(_objectSpread({}, prevColumnWidths), {}, (0, _defineProperty2.default)({}, columnId, width));
@@ -31,7 +31,7 @@ var _excluded = ["children", "className", "gutterSize", "popoverBreakpoints", "p
31
31
  */
32
32
  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); }
33
33
  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; }
34
- var GUTTER_SIZES = exports.GUTTER_SIZES = ['xs', 's', 'm', 'l'];
34
+ var GUTTER_SIZES = exports.GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
35
35
  var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
36
36
  var children = _ref.children,
37
37
  className = _ref.className,
@@ -35,6 +35,7 @@ var euiHeaderLinksStyles = exports.euiHeaderLinksStyles = function euiHeaderLink
35
35
  euiHeaderLinks: _ref2,
36
36
  euiHeaderLinks__list: _ref,
37
37
  gutterSizes: {
38
+ xxs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:xxs;"),
38
39
  xs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:xs;"),
39
40
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:s;"),
40
41
  m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),