@elastic/eui 88.0.0 → 88.1.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.
- package/dist/eui_charts_theme.js +9 -8
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +2 -5
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +2 -5
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/es/components/description_list/description_list.js +40 -3
- package/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/es/components/text/text.styles.js +3 -6
- package/es/global_styling/functions/typography.js +8 -8
- package/es/global_styling/variables/typography.js +1 -1
- package/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/eui.d.ts +36 -7
- package/i18ntokens.json +108 -108
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/lib/components/description_list/description_list.js +39 -3
- package/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/lib/components/text/text.styles.js +3 -6
- package/lib/global_styling/functions/typography.js +8 -8
- package/lib/global_styling/variables/typography.js +3 -3
- package/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +4 -2
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/es/components/description_list/description_list.js +22 -2
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/es/components/text/text.styles.js +3 -6
- package/optimize/es/global_styling/functions/typography.js +8 -8
- package/optimize/es/global_styling/variables/typography.js +1 -1
- package/optimize/es/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +4 -2
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/optimize/lib/components/description_list/description_list.js +22 -2
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +3 -6
- package/optimize/lib/components/text/text.styles.js +3 -6
- package/optimize/lib/global_styling/functions/typography.js +8 -8
- package/optimize/lib/global_styling/variables/typography.js +3 -3
- package/optimize/lib/themes/amsterdam/global_styling/variables/_typography.js +1 -0
- package/package.json +1 -1
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +1 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +9 -2
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -0
- package/test-env/components/description_list/description_list.js +37 -3
- package/test-env/components/markdown_editor/markdown_format.styles.js +3 -6
- package/test-env/components/text/text.styles.js +3 -6
- package/test-env/global_styling/functions/typography.js +8 -8
- package/test-env/global_styling/variables/typography.js +3 -3
- package/test-env/themes/amsterdam/global_styling/variables/_typography.js +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "width", "side", "focusTrapProps"];
|
|
2
|
+
var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
5
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -45,6 +45,7 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
45
45
|
style = _ref.style,
|
|
46
46
|
_ref$initialIsCollaps = _ref.initialIsCollapsed,
|
|
47
47
|
initialIsCollapsed = _ref$initialIsCollaps === void 0 ? false : _ref$initialIsCollaps,
|
|
48
|
+
onCollapseToggle = _ref.onCollapseToggle,
|
|
48
49
|
_ref$width = _ref.width,
|
|
49
50
|
_width = _ref$width === void 0 ? 248 : _ref$width,
|
|
50
51
|
_ref$side = _ref.side,
|
|
@@ -63,9 +64,10 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
|
|
|
63
64
|
setIsCollapsed = _useState2[1];
|
|
64
65
|
var toggleCollapsed = useCallback(function () {
|
|
65
66
|
return setIsCollapsed(function (isCollapsed) {
|
|
67
|
+
onCollapseToggle === null || onCollapseToggle === void 0 ? void 0 : onCollapseToggle(!isCollapsed);
|
|
66
68
|
return !isCollapsed;
|
|
67
69
|
});
|
|
68
|
-
}, []);
|
|
70
|
+
}, [onCollapseToggle]);
|
|
69
71
|
var onClose = useCallback(function () {
|
|
70
72
|
return setIsCollapsed(true);
|
|
71
73
|
}, []);
|
|
@@ -202,6 +204,11 @@ EuiCollapsibleNavBeta.propTypes = {
|
|
|
202
204
|
* Whether the navigation flyout should default to initially collapsed or expanded
|
|
203
205
|
*/
|
|
204
206
|
initialIsCollapsed: PropTypes.bool,
|
|
207
|
+
/**
|
|
208
|
+
* Optional callback that fires when the user toggles the nav between
|
|
209
|
+
* collapsed and uncollapsed states
|
|
210
|
+
*/
|
|
211
|
+
onCollapseToggle: PropTypes.func,
|
|
205
212
|
/**
|
|
206
213
|
* Defaults to 248px wide. The navigation width determines behavior at
|
|
207
214
|
* various responsive breakpoints.
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["align", "children", "className", "style", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "rowGutterSize", "columnGutterSize", "columnWidths"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
11
|
/*
|
|
@@ -24,6 +30,7 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
24
30
|
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
25
31
|
children = _ref.children,
|
|
26
32
|
className = _ref.className,
|
|
33
|
+
style = _ref.style,
|
|
27
34
|
_ref$compressed = _ref.compressed,
|
|
28
35
|
compressed = _ref$compressed === void 0 ? false : _ref$compressed,
|
|
29
36
|
descriptionProps = _ref.descriptionProps,
|
|
@@ -37,6 +44,7 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
37
44
|
rowGutterSize = _ref$rowGutterSize === void 0 ? 's' : _ref$rowGutterSize,
|
|
38
45
|
_ref$columnGutterSize = _ref.columnGutterSize,
|
|
39
46
|
columnGutterSize = _ref$columnGutterSize === void 0 ? 's' : _ref$columnGutterSize,
|
|
47
|
+
columnWidths = _ref.columnWidths,
|
|
40
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
49
|
var showResponsiveColumns = useIsWithinBreakpoints(['xs', 's']);
|
|
42
50
|
var type = useMemo(function () {
|
|
@@ -49,6 +57,20 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
49
57
|
var euiTheme = useEuiTheme();
|
|
50
58
|
var styles = euiDescriptionListStyles(euiTheme);
|
|
51
59
|
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align], type === 'column' && styles.rowGap[rowGutterSize], type === 'column' && styles.columnGap[columnGutterSize]];
|
|
60
|
+
var inlineStyles = useMemo(function () {
|
|
61
|
+
if (type === 'column' && columnWidths) {
|
|
62
|
+
// Leave string values as is - e.g. if a consumer passes in a specific '200px' or 'minmax()'
|
|
63
|
+
var convertNumbersToFr = function convertNumbersToFr(value) {
|
|
64
|
+
return typeof value === 'number' ? "".concat(value, "fr") : value;
|
|
65
|
+
};
|
|
66
|
+
var titleWidth = convertNumbersToFr(columnWidths[0]);
|
|
67
|
+
var descriptionWidth = convertNumbersToFr(columnWidths[1]);
|
|
68
|
+
return _objectSpread({
|
|
69
|
+
gridTemplateColumns: "".concat(titleWidth, " ").concat(descriptionWidth)
|
|
70
|
+
}, style);
|
|
71
|
+
}
|
|
72
|
+
return style;
|
|
73
|
+
}, [style, type, columnWidths]);
|
|
52
74
|
var classes = classNames('euiDescriptionList', className);
|
|
53
75
|
var childrenOrListItems = null;
|
|
54
76
|
if (listItems) {
|
|
@@ -72,7 +94,8 @@ export var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
72
94
|
}
|
|
73
95
|
}, ___EmotionJSX("dl", _extends({
|
|
74
96
|
className: classes,
|
|
75
|
-
css: cssStyles
|
|
97
|
+
css: cssStyles,
|
|
98
|
+
style: inlineStyles
|
|
76
99
|
}, rest, {
|
|
77
100
|
"data-type": _type
|
|
78
101
|
}), childrenOrListItems));
|
|
@@ -130,5 +153,19 @@ EuiDescriptionList.propTypes = {
|
|
|
130
153
|
*
|
|
131
154
|
* Only applies to `column` and `responsiveColumn` types.
|
|
132
155
|
*/
|
|
133
|
-
columnGutterSize: PropTypes.any
|
|
156
|
+
columnGutterSize: PropTypes.any,
|
|
157
|
+
/**
|
|
158
|
+
* Allows customizing specific column widths (e.g. `['100px', '200px']`). The first
|
|
159
|
+
* array value applies to the title column, and the second applies to the description column.
|
|
160
|
+
*
|
|
161
|
+
* Passing numbers instead of CSS width strings will use a ratio of widths.
|
|
162
|
+
* For example, [1, 3] will render a description column 3x the width of the title column.
|
|
163
|
+
* In other words, descriptions will have a width of `75%` and titles will have a width of `25%`.
|
|
164
|
+
*
|
|
165
|
+
* Only applies to `column` and `responsiveColumn` types.
|
|
166
|
+
*
|
|
167
|
+
* _Advanced usage note:_ column width strings also accept [CSS grid special units,
|
|
168
|
+
* sizing, keywords, and sizing functions](https://css-tricks.com/snippets/css/complete-guide-grid/#aa-special-units-functions).
|
|
169
|
+
*/
|
|
170
|
+
columnWidths: PropTypes.any
|
|
134
171
|
};
|
|
@@ -17,8 +17,8 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
17
17
|
var _euiFontSize = euiFontSize(euiTheme, 'm', options),
|
|
18
18
|
fontSize = _euiFontSize.fontSize,
|
|
19
19
|
lineHeight = _euiFontSize.lineHeight;
|
|
20
|
-
var
|
|
21
|
-
var lineHeightSize =
|
|
20
|
+
var unit = options.unit;
|
|
21
|
+
var lineHeightSize = unit === 'em' ? "".concat(lineHeight, "em") : lineHeight;
|
|
22
22
|
|
|
23
23
|
// Custom scales
|
|
24
24
|
var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
|
|
@@ -39,19 +39,16 @@ export var euiMarkdownFormatStyles = function euiMarkdownFormatStyles(euiTheme)
|
|
|
39
39
|
euiMarkdownFormat: /*#__PURE__*/css(";label:euiMarkdownFormat;"),
|
|
40
40
|
// Text sizes
|
|
41
41
|
m: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
42
|
-
measurement: 'rem',
|
|
43
42
|
customScale: 'm'
|
|
44
43
|
}), ";;label:m;"),
|
|
45
44
|
s: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
46
|
-
measurement: 'rem',
|
|
47
45
|
customScale: 's'
|
|
48
46
|
}), ";;label:s;"),
|
|
49
47
|
xs: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
50
|
-
measurement: 'rem',
|
|
51
48
|
customScale: 'xs'
|
|
52
49
|
}), ";;label:xs;"),
|
|
53
50
|
relative: /*#__PURE__*/css(euiScaleMarkdownFormatText(euiTheme, {
|
|
54
|
-
|
|
51
|
+
unit: 'em'
|
|
55
52
|
}), ";;label:relative;")
|
|
56
53
|
};
|
|
57
54
|
};
|
|
@@ -33,9 +33,9 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
33
33
|
fontSize = _euiFontSize.fontSize,
|
|
34
34
|
lineHeight = _euiFontSize.lineHeight;
|
|
35
35
|
var euiTheme = euiThemeContext.euiTheme;
|
|
36
|
-
var
|
|
36
|
+
var unit = options.unit,
|
|
37
37
|
_customScale = options.customScale;
|
|
38
|
-
var lineHeightSize =
|
|
38
|
+
var lineHeightSize = unit === 'em' ? "".concat(lineHeight, "em") : lineHeight;
|
|
39
39
|
var headings = {
|
|
40
40
|
h1: euiTitle(euiThemeContext, 'l', options),
|
|
41
41
|
h2: euiTitle(euiThemeContext, 'm', options),
|
|
@@ -71,19 +71,16 @@ export var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
|
71
71
|
constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
72
72
|
// Sizes
|
|
73
73
|
m: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
74
|
-
measurement: 'rem',
|
|
75
74
|
customScale: 'm'
|
|
76
75
|
}), ";;label:m;"),
|
|
77
76
|
s: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
78
|
-
measurement: 'rem',
|
|
79
77
|
customScale: 's'
|
|
80
78
|
}), ";;label:s;"),
|
|
81
79
|
xs: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
82
|
-
measurement: 'rem',
|
|
83
80
|
customScale: 'xs'
|
|
84
81
|
}), ";;label:xs;"),
|
|
85
82
|
relative: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
|
|
86
|
-
|
|
83
|
+
unit: 'em'
|
|
87
84
|
}), ";;label:relative;")
|
|
88
85
|
};
|
|
89
86
|
};
|
|
@@ -20,16 +20,16 @@ export function euiFontSizeFromScale(scale, _ref) {
|
|
|
20
20
|
var base = _ref.base,
|
|
21
21
|
font = _ref.font;
|
|
22
22
|
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
23
|
-
_ref2$
|
|
24
|
-
|
|
23
|
+
_ref2$unit = _ref2.unit,
|
|
24
|
+
unit = _ref2$unit === void 0 ? font.defaultUnits : _ref2$unit,
|
|
25
25
|
customScale = _ref2.customScale;
|
|
26
|
-
if (
|
|
26
|
+
if (unit === 'em') {
|
|
27
27
|
return "".concat(font.scale[scale], "em");
|
|
28
28
|
}
|
|
29
29
|
var numerator = base * font.scale[scale];
|
|
30
30
|
if (customScale) numerator *= font.scale[customScale];
|
|
31
31
|
var denominator = base * font.scale[font.body.scale];
|
|
32
|
-
return
|
|
32
|
+
return unit === 'px' ? "".concat(numerator, "px") : "".concat((numerator / denominator).toFixed(4), "rem");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -48,8 +48,8 @@ export function euiLineHeightFromBaseline(scale, _ref3) {
|
|
|
48
48
|
var base = _ref3.base,
|
|
49
49
|
font = _ref3.font;
|
|
50
50
|
var _ref4 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
51
|
-
_ref4$
|
|
52
|
-
|
|
51
|
+
_ref4$unit = _ref4.unit,
|
|
52
|
+
unit = _ref4$unit === void 0 ? font.defaultUnits : _ref4$unit,
|
|
53
53
|
customScale = _ref4.customScale;
|
|
54
54
|
var baseline = font.baseline,
|
|
55
55
|
lineHeightMultiplier = font.lineHeightMultiplier;
|
|
@@ -57,13 +57,13 @@ export function euiLineHeightFromBaseline(scale, _ref3) {
|
|
|
57
57
|
if (customScale) numerator *= font.scale[customScale];
|
|
58
58
|
var denominator = base * font.scale[font.body.scale];
|
|
59
59
|
var _lineHeightMultiplier = numerator <= base ? lineHeightMultiplier : lineHeightMultiplier * 0.833;
|
|
60
|
-
if (
|
|
60
|
+
if (unit === 'em') {
|
|
61
61
|
// Even though the line-height via `em` cannot be determined against the pixel baseline grid;
|
|
62
62
|
// we will assume that typically larger scale font-sizes should have a shorter line-height;
|
|
63
63
|
return _lineHeightMultiplier.toFixed(4).toString();
|
|
64
64
|
}
|
|
65
65
|
var pixelValue = Math.floor(Math.round(numerator * _lineHeightMultiplier) / baseline) * baseline;
|
|
66
|
-
return
|
|
66
|
+
return unit === 'px' ? "".concat(pixelValue, "px") : "".concat((pixelValue / denominator).toFixed(4), "rem");
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
@@ -38,6 +38,7 @@ export var fontBase = {
|
|
|
38
38
|
familySerif: 'Georgia, Times, Times New Roman, serif',
|
|
39
39
|
// Careful using ligatures. Code editors like ACE will often error because of width calculations
|
|
40
40
|
featureSettings: "'calt' 1, 'kern' 1, 'liga' 1",
|
|
41
|
+
defaultUnits: 'rem',
|
|
41
42
|
baseline: computed(function (_ref) {
|
|
42
43
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
43
44
|
base = _ref2[0];
|
package/eui.d.ts
CHANGED
|
@@ -514,8 +514,8 @@ declare module '@elastic/eui/src/global_styling/variables/typography' {
|
|
|
514
514
|
/**
|
|
515
515
|
* Font units of measure
|
|
516
516
|
*/
|
|
517
|
-
export const
|
|
518
|
-
export type
|
|
517
|
+
export const EuiThemeFontUnits: readonly ["rem", "px", "em"];
|
|
518
|
+
export type _EuiThemeFontUnit = (typeof EuiThemeFontUnits)[number];
|
|
519
519
|
export const EuiThemeFontScales: readonly ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
520
520
|
export type _EuiThemeFontScale = (typeof EuiThemeFontScales)[number];
|
|
521
521
|
export type _EuiThemeFontScales = Record<_EuiThemeFontScale, number>;
|
|
@@ -538,6 +538,16 @@ declare module '@elastic/eui/src/global_styling/variables/typography' {
|
|
|
538
538
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings
|
|
539
539
|
*/
|
|
540
540
|
featureSettings?: string;
|
|
541
|
+
/**
|
|
542
|
+
* Sets the default units used for font size & line height set by UI components
|
|
543
|
+
* like EuiText or EuiTitle. Defaults to `rem`.
|
|
544
|
+
*
|
|
545
|
+
* NOTE: This may overridden by some internal usages, e.g.
|
|
546
|
+
* EuiText's `relative` size which must use `em`.
|
|
547
|
+
*
|
|
548
|
+
* @default 'rem'
|
|
549
|
+
*/
|
|
550
|
+
defaultUnits: _EuiThemeFontUnit;
|
|
541
551
|
/**
|
|
542
552
|
* A computed number that is 1/4 of `base`
|
|
543
553
|
*/
|
|
@@ -1359,13 +1369,13 @@ declare module '@elastic/eui/src/services/theme/hooks' {
|
|
|
1359
1369
|
|
|
1360
1370
|
}
|
|
1361
1371
|
declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
1362
|
-
import { _EuiThemeFontScale,
|
|
1372
|
+
import { _EuiThemeFontScale, _EuiThemeFontUnit, _EuiThemeFontWeights } from '@elastic/eui/src/global_styling/variables/typography';
|
|
1363
1373
|
import { UseEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
1364
1374
|
export interface _FontScaleOptions {
|
|
1365
1375
|
/**
|
|
1366
|
-
* The
|
|
1376
|
+
* The font-size or line-height unit to return
|
|
1367
1377
|
*/
|
|
1368
|
-
|
|
1378
|
+
unit?: _EuiThemeFontUnit;
|
|
1369
1379
|
/**
|
|
1370
1380
|
* An additional custom scale multiplier to use against the current scale
|
|
1371
1381
|
* This parameter can be used (e.g. by EuiText sizes) to get sizes of text smaller than the default
|
|
@@ -1380,7 +1390,7 @@ declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
|
1380
1390
|
*
|
|
1381
1391
|
* @returns string - Calculated font-size value
|
|
1382
1392
|
*/
|
|
1383
|
-
export function euiFontSizeFromScale(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], {
|
|
1393
|
+
export function euiFontSizeFromScale(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], { unit, customScale }?: _FontScaleOptions): string;
|
|
1384
1394
|
/**
|
|
1385
1395
|
* Calculates the line-height to the closest multiple of the baseline
|
|
1386
1396
|
* EX: A proper line-height for text is 1.5 times the font-size.
|
|
@@ -1392,7 +1402,7 @@ declare module '@elastic/eui/src/global_styling/functions/typography' {
|
|
|
1392
1402
|
*
|
|
1393
1403
|
* @returns string - Calculated line-height value aligned to baseline
|
|
1394
1404
|
*/
|
|
1395
|
-
export function euiLineHeightFromBaseline(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], {
|
|
1405
|
+
export function euiLineHeightFromBaseline(scale: _EuiThemeFontScale, { base, font }: UseEuiTheme['euiTheme'], { unit, customScale }?: _FontScaleOptions): string;
|
|
1396
1406
|
/**
|
|
1397
1407
|
* Text weight shifting
|
|
1398
1408
|
*
|
|
@@ -10580,6 +10590,11 @@ declare module '@elastic/eui/src/components/collapsible_nav_beta/collapsible_nav
|
|
|
10580
10590
|
* Whether the navigation flyout should default to initially collapsed or expanded
|
|
10581
10591
|
*/
|
|
10582
10592
|
initialIsCollapsed?: boolean;
|
|
10593
|
+
/**
|
|
10594
|
+
* Optional callback that fires when the user toggles the nav between
|
|
10595
|
+
* collapsed and uncollapsed states
|
|
10596
|
+
*/
|
|
10597
|
+
onCollapseToggle?: (isCollapsed: boolean) => void;
|
|
10583
10598
|
/**
|
|
10584
10599
|
* Defaults to 248px wide. The navigation width determines behavior at
|
|
10585
10600
|
* various responsive breakpoints.
|
|
@@ -14206,6 +14221,20 @@ declare module '@elastic/eui/src/components/description_list/description_list_ty
|
|
|
14206
14221
|
* Only applies to `column` and `responsiveColumn` types.
|
|
14207
14222
|
*/
|
|
14208
14223
|
columnGutterSize?: EuiDescriptionListColumnGapSizes;
|
|
14224
|
+
/**
|
|
14225
|
+
* Allows customizing specific column widths (e.g. `['100px', '200px']`). The first
|
|
14226
|
+
* array value applies to the title column, and the second applies to the description column.
|
|
14227
|
+
*
|
|
14228
|
+
* Passing numbers instead of CSS width strings will use a ratio of widths.
|
|
14229
|
+
* For example, [1, 3] will render a description column 3x the width of the title column.
|
|
14230
|
+
* In other words, descriptions will have a width of `75%` and titles will have a width of `25%`.
|
|
14231
|
+
*
|
|
14232
|
+
* Only applies to `column` and `responsiveColumn` types.
|
|
14233
|
+
*
|
|
14234
|
+
* _Advanced usage note:_ column width strings also accept [CSS grid special units,
|
|
14235
|
+
* sizing, keywords, and sizing functions](https://css-tricks.com/snippets/css/complete-guide-grid/#aa-special-units-functions).
|
|
14236
|
+
*/
|
|
14237
|
+
columnWidths?: [number | string, number | string];
|
|
14209
14238
|
}
|
|
14210
14239
|
export const CHILD_TYPES: readonly ["row", "inline", "column"];
|
|
14211
14240
|
export type EuiDescriptionListChildTypes = (typeof CHILD_TYPES)[number];
|