@elastic/eui 67.1.7 → 67.1.8
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 +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -1
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -1
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/card/card.js +6 -28
- package/es/components/card/checkable_card/checkable_card.js +3 -2
- package/eui.d.ts +2 -3
- package/i18ntokens.json +12 -12
- package/lib/components/card/card.js +7 -30
- package/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/es/components/card/card.js +5 -27
- package/optimize/es/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/lib/components/card/card.js +6 -29
- package/optimize/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/package.json +1 -1
- package/src/components/modal/_modal.scss +3 -1
- package/test-env/components/card/card.js +7 -30
- package/test-env/components/card/checkable_card/checkable_card.js +3 -2
|
@@ -23,33 +23,19 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
23
23
|
import React, { isValidElement } from 'react';
|
|
24
24
|
import PropTypes from "prop-types";
|
|
25
25
|
import classNames from 'classnames';
|
|
26
|
-
import { keysOf } from '../common';
|
|
27
26
|
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
27
|
+
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
28
28
|
import { EuiText } from '../text';
|
|
29
29
|
import { EuiTitle } from '../title';
|
|
30
30
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
31
|
-
import { EuiCardSelect
|
|
31
|
+
import { EuiCardSelect } from './card_select';
|
|
32
32
|
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
33
33
|
import { validateHref } from '../../services/security/href_validator';
|
|
34
34
|
import { EuiPanel } from '../panel';
|
|
35
35
|
import { EuiSpacer } from '../spacer';
|
|
36
36
|
import { euiCardBetaBadgeStyles, euiCardStyles, euiCardTextStyles } from './card.styles';
|
|
37
37
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
38
|
-
var
|
|
39
|
-
left: 'euiCard--leftAligned',
|
|
40
|
-
center: 'euiCard--centerAligned',
|
|
41
|
-
right: 'euiCard--rightAligned'
|
|
42
|
-
};
|
|
43
|
-
export var ALIGNMENTS = keysOf(textAlignToClassNameMap);
|
|
44
|
-
var layoutToClassNameMap = {
|
|
45
|
-
vertical: '',
|
|
46
|
-
horizontal: 'euiCard--horizontal'
|
|
47
|
-
};
|
|
48
|
-
export var LAYOUT_ALIGNMENTS = keysOf(layoutToClassNameMap);
|
|
49
|
-
/**
|
|
50
|
-
* Certain props are only allowed when the layout is vertical
|
|
51
|
-
*/
|
|
52
|
-
|
|
38
|
+
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
53
39
|
export var EuiCard = function EuiCard(_ref) {
|
|
54
40
|
var className = _ref.className,
|
|
55
41
|
description = _ref.description,
|
|
@@ -109,15 +95,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
109
95
|
}
|
|
110
96
|
}
|
|
111
97
|
|
|
112
|
-
var
|
|
113
|
-
var classes = classNames('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
114
|
-
'euiCard--isClickable': isClickable,
|
|
115
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
116
|
-
'euiCard--hasIcon': icon,
|
|
117
|
-
'euiCard--isSelectable': selectable,
|
|
118
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
119
|
-
'euiCard-isDisabled': isDisabled
|
|
120
|
-
}, selectableColorClass, className);
|
|
98
|
+
var classes = classNames('euiCard', className);
|
|
121
99
|
var ariaId = useGeneratedHtmlId();
|
|
122
100
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
123
101
|
/**
|
|
@@ -145,7 +123,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
145
123
|
|
|
146
124
|
if (icon) {
|
|
147
125
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
148
|
-
iconNode =
|
|
126
|
+
iconNode = cloneElementWithCss(icon, {
|
|
149
127
|
className: classNames(icon.props.className, 'euiCard__icon'),
|
|
150
128
|
css: iconStyles
|
|
151
129
|
});
|
|
@@ -320,7 +298,7 @@ EuiCard.propTypes = {
|
|
|
320
298
|
/**
|
|
321
299
|
* Changes alignment of the title and description
|
|
322
300
|
*/
|
|
323
|
-
textAlign: PropTypes.
|
|
301
|
+
textAlign: PropTypes.any,
|
|
324
302
|
|
|
325
303
|
/**
|
|
326
304
|
* Accepts any combination of elements
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
1
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -24,6 +24,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
24
24
|
export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
25
25
|
var children = _ref.children,
|
|
26
26
|
className = _ref.className,
|
|
27
|
+
css = _ref.css,
|
|
27
28
|
_ref$checkableType = _ref.checkableType,
|
|
28
29
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
29
30
|
label = _ref.label,
|
|
@@ -36,7 +37,7 @@ export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
36
37
|
|
|
37
38
|
var euiThemeContext = useEuiTheme();
|
|
38
39
|
var styles = euiCheckableCardStyles(euiThemeContext);
|
|
39
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
40
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
40
41
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
41
42
|
var childStyles = [styles.euiCheckableCard__children];
|
|
42
43
|
var id = rest.id;
|
package/eui.d.ts
CHANGED
|
@@ -8345,9 +8345,8 @@ declare module '@elastic/eui/src/components/card/card' {
|
|
|
8345
8345
|
import { EuiBetaBadgeProps } from '@elastic/eui/src/components/badge/beta_badge';
|
|
8346
8346
|
import { EuiIconProps } from '@elastic/eui/src/components/icon';
|
|
8347
8347
|
import { EuiCardSelectProps } from '@elastic/eui/src/components/card/card_select';
|
|
8348
|
-
import { EuiPanelProps } from '@elastic/eui/src/components/panel';
|
|
8349
|
-
export const ALIGNMENTS:
|
|
8350
|
-
export const LAYOUT_ALIGNMENTS: CardLayout[]; type EuiCardPropsLayout = ExclusiveUnion<{
|
|
8348
|
+
import { EuiPanelProps } from '@elastic/eui/src/components/panel';
|
|
8349
|
+
export const ALIGNMENTS: readonly ["left", "center", "right"]; type CardAlignment = typeof ALIGNMENTS[number]; type EuiCardPropsLayout = ExclusiveUnion<{
|
|
8351
8350
|
layout?: 'vertical';
|
|
8352
8351
|
/**
|
|
8353
8352
|
* Changes alignment of the title and description
|
package/i18ntokens.json
CHANGED
|
@@ -229,11 +229,11 @@
|
|
|
229
229
|
"highlighting": "string",
|
|
230
230
|
"loc": {
|
|
231
231
|
"start": {
|
|
232
|
-
"line":
|
|
232
|
+
"line": 182,
|
|
233
233
|
"column": 20
|
|
234
234
|
},
|
|
235
235
|
"end": {
|
|
236
|
-
"line":
|
|
236
|
+
"line": 185,
|
|
237
237
|
"column": 3
|
|
238
238
|
}
|
|
239
239
|
},
|
|
@@ -4229,11 +4229,11 @@
|
|
|
4229
4229
|
"highlighting": "string",
|
|
4230
4230
|
"loc": {
|
|
4231
4231
|
"start": {
|
|
4232
|
-
"line":
|
|
4232
|
+
"line": 107,
|
|
4233
4233
|
"column": 10
|
|
4234
4234
|
},
|
|
4235
4235
|
"end": {
|
|
4236
|
-
"line":
|
|
4236
|
+
"line": 110,
|
|
4237
4237
|
"column": 11
|
|
4238
4238
|
}
|
|
4239
4239
|
},
|
|
@@ -4661,11 +4661,11 @@
|
|
|
4661
4661
|
"highlighting": "string",
|
|
4662
4662
|
"loc": {
|
|
4663
4663
|
"start": {
|
|
4664
|
-
"line":
|
|
4664
|
+
"line": 684,
|
|
4665
4665
|
"column": 16
|
|
4666
4666
|
},
|
|
4667
4667
|
"end": {
|
|
4668
|
-
"line":
|
|
4668
|
+
"line": 687,
|
|
4669
4669
|
"column": 18
|
|
4670
4670
|
}
|
|
4671
4671
|
},
|
|
@@ -5605,11 +5605,11 @@
|
|
|
5605
5605
|
"highlighting": "string",
|
|
5606
5606
|
"loc": {
|
|
5607
5607
|
"start": {
|
|
5608
|
-
"line":
|
|
5608
|
+
"line": 234,
|
|
5609
5609
|
"column": 10
|
|
5610
5610
|
},
|
|
5611
5611
|
"end": {
|
|
5612
|
-
"line":
|
|
5612
|
+
"line": 241,
|
|
5613
5613
|
"column": 11
|
|
5614
5614
|
}
|
|
5615
5615
|
},
|
|
@@ -5621,11 +5621,11 @@
|
|
|
5621
5621
|
"highlighting": "string",
|
|
5622
5622
|
"loc": {
|
|
5623
5623
|
"start": {
|
|
5624
|
-
"line":
|
|
5624
|
+
"line": 234,
|
|
5625
5625
|
"column": 10
|
|
5626
5626
|
},
|
|
5627
5627
|
"end": {
|
|
5628
|
-
"line":
|
|
5628
|
+
"line": 241,
|
|
5629
5629
|
"column": 11
|
|
5630
5630
|
}
|
|
5631
5631
|
},
|
|
@@ -5637,11 +5637,11 @@
|
|
|
5637
5637
|
"highlighting": "string",
|
|
5638
5638
|
"loc": {
|
|
5639
5639
|
"start": {
|
|
5640
|
-
"line":
|
|
5640
|
+
"line": 234,
|
|
5641
5641
|
"column": 10
|
|
5642
5642
|
},
|
|
5643
5643
|
"end": {
|
|
5644
|
-
"line":
|
|
5644
|
+
"line": 241,
|
|
5645
5645
|
"column": 11
|
|
5646
5646
|
}
|
|
5647
5647
|
},
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.EuiCard = exports.ALIGNMENTS = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -13,10 +13,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
-
var _common = require("../common");
|
|
17
|
-
|
|
18
16
|
var _services = require("../../services");
|
|
19
17
|
|
|
18
|
+
var _clone_element = require("../../services/theme/clone_element");
|
|
19
|
+
|
|
20
20
|
var _text = require("../text");
|
|
21
21
|
|
|
22
22
|
var _title = require("../title");
|
|
@@ -58,23 +58,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
58
58
|
|
|
59
59
|
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; }
|
|
60
60
|
|
|
61
|
-
var
|
|
62
|
-
left: 'euiCard--leftAligned',
|
|
63
|
-
center: 'euiCard--centerAligned',
|
|
64
|
-
right: 'euiCard--rightAligned'
|
|
65
|
-
};
|
|
66
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
61
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
67
62
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
68
|
-
var layoutToClassNameMap = {
|
|
69
|
-
vertical: '',
|
|
70
|
-
horizontal: 'euiCard--horizontal'
|
|
71
|
-
};
|
|
72
|
-
var LAYOUT_ALIGNMENTS = (0, _common.keysOf)(layoutToClassNameMap);
|
|
73
|
-
/**
|
|
74
|
-
* Certain props are only allowed when the layout is vertical
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
exports.LAYOUT_ALIGNMENTS = LAYOUT_ALIGNMENTS;
|
|
78
63
|
|
|
79
64
|
var EuiCard = function EuiCard(_ref) {
|
|
80
65
|
var className = _ref.className,
|
|
@@ -135,15 +120,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
135
120
|
}
|
|
136
121
|
}
|
|
137
122
|
|
|
138
|
-
var
|
|
139
|
-
var classes = (0, _classnames.default)('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
140
|
-
'euiCard--isClickable': isClickable,
|
|
141
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
142
|
-
'euiCard--hasIcon': icon,
|
|
143
|
-
'euiCard--isSelectable': selectable,
|
|
144
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
145
|
-
'euiCard-isDisabled': isDisabled
|
|
146
|
-
}, selectableColorClass, className);
|
|
123
|
+
var classes = (0, _classnames.default)('euiCard', className);
|
|
147
124
|
var ariaId = (0, _accessibility.useGeneratedHtmlId)();
|
|
148
125
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
149
126
|
/**
|
|
@@ -171,7 +148,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
171
148
|
|
|
172
149
|
if (icon) {
|
|
173
150
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
174
|
-
iconNode =
|
|
151
|
+
iconNode = (0, _clone_element.cloneElementWithCss)(icon, {
|
|
175
152
|
className: (0, _classnames.default)(icon.props.className, 'euiCard__icon'),
|
|
176
153
|
css: iconStyles
|
|
177
154
|
});
|
|
@@ -348,7 +325,7 @@ EuiCard.propTypes = {
|
|
|
348
325
|
/**
|
|
349
326
|
* Changes alignment of the title and description
|
|
350
327
|
*/
|
|
351
|
-
textAlign: _propTypes.default.
|
|
328
|
+
textAlign: _propTypes.default.any,
|
|
352
329
|
|
|
353
330
|
/**
|
|
354
331
|
* Accepts any combination of elements
|
|
@@ -23,7 +23,7 @@ var _checkable_card = require("./checkable_card.styles");
|
|
|
23
23
|
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
26
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
@@ -40,6 +40,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
40
40
|
var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
41
41
|
var children = _ref.children,
|
|
42
42
|
className = _ref.className,
|
|
43
|
+
css = _ref.css,
|
|
43
44
|
_ref$checkableType = _ref.checkableType,
|
|
44
45
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
45
46
|
label = _ref.label,
|
|
@@ -52,7 +53,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
52
53
|
|
|
53
54
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
54
55
|
var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
|
|
55
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
56
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
56
57
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
57
58
|
var childStyles = [styles.euiCheckableCard__children];
|
|
58
59
|
var id = rest.id;
|
|
@@ -17,33 +17,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { isValidElement } from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
|
-
import { keysOf } from '../common';
|
|
21
20
|
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
21
|
+
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
22
22
|
import { EuiText } from '../text';
|
|
23
23
|
import { EuiTitle } from '../title';
|
|
24
24
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
25
|
-
import { EuiCardSelect
|
|
25
|
+
import { EuiCardSelect } from './card_select';
|
|
26
26
|
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
27
27
|
import { validateHref } from '../../services/security/href_validator';
|
|
28
28
|
import { EuiPanel } from '../panel';
|
|
29
29
|
import { EuiSpacer } from '../spacer';
|
|
30
30
|
import { euiCardBetaBadgeStyles, euiCardStyles, euiCardTextStyles } from './card.styles';
|
|
31
31
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
|
-
var
|
|
33
|
-
left: 'euiCard--leftAligned',
|
|
34
|
-
center: 'euiCard--centerAligned',
|
|
35
|
-
right: 'euiCard--rightAligned'
|
|
36
|
-
};
|
|
37
|
-
export var ALIGNMENTS = keysOf(textAlignToClassNameMap);
|
|
38
|
-
var layoutToClassNameMap = {
|
|
39
|
-
vertical: '',
|
|
40
|
-
horizontal: 'euiCard--horizontal'
|
|
41
|
-
};
|
|
42
|
-
export var LAYOUT_ALIGNMENTS = keysOf(layoutToClassNameMap);
|
|
43
|
-
/**
|
|
44
|
-
* Certain props are only allowed when the layout is vertical
|
|
45
|
-
*/
|
|
46
|
-
|
|
32
|
+
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
47
33
|
export var EuiCard = function EuiCard(_ref) {
|
|
48
34
|
var className = _ref.className,
|
|
49
35
|
description = _ref.description,
|
|
@@ -103,15 +89,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
103
89
|
}
|
|
104
90
|
}
|
|
105
91
|
|
|
106
|
-
var
|
|
107
|
-
var classes = classNames('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
108
|
-
'euiCard--isClickable': isClickable,
|
|
109
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
110
|
-
'euiCard--hasIcon': icon,
|
|
111
|
-
'euiCard--isSelectable': selectable,
|
|
112
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
113
|
-
'euiCard-isDisabled': isDisabled
|
|
114
|
-
}, selectableColorClass, className);
|
|
92
|
+
var classes = classNames('euiCard', className);
|
|
115
93
|
var ariaId = useGeneratedHtmlId();
|
|
116
94
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
117
95
|
/**
|
|
@@ -139,7 +117,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
139
117
|
|
|
140
118
|
if (icon) {
|
|
141
119
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
142
|
-
iconNode =
|
|
120
|
+
iconNode = cloneElementWithCss(icon, {
|
|
143
121
|
className: classNames(icon.props.className, 'euiCard__icon'),
|
|
144
122
|
css: iconStyles
|
|
145
123
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
3
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -19,6 +19,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
19
19
|
export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
20
20
|
var children = _ref.children,
|
|
21
21
|
className = _ref.className,
|
|
22
|
+
css = _ref.css,
|
|
22
23
|
_ref$checkableType = _ref.checkableType,
|
|
23
24
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
24
25
|
label = _ref.label,
|
|
@@ -31,7 +32,7 @@ export var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
31
32
|
|
|
32
33
|
var euiThemeContext = useEuiTheme();
|
|
33
34
|
var styles = euiCheckableCardStyles(euiThemeContext);
|
|
34
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
35
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
35
36
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
36
37
|
var childStyles = [styles.euiCheckableCard__children];
|
|
37
38
|
var id = rest.id;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.EuiCard = exports.ALIGNMENTS = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -19,10 +19,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
21
|
|
|
22
|
-
var _common = require("../common");
|
|
23
|
-
|
|
24
22
|
var _services = require("../../services");
|
|
25
23
|
|
|
24
|
+
var _clone_element = require("../../services/theme/clone_element");
|
|
25
|
+
|
|
26
26
|
var _text = require("../text");
|
|
27
27
|
|
|
28
28
|
var _title = require("../title");
|
|
@@ -54,23 +54,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
54
54
|
|
|
55
55
|
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; }
|
|
56
56
|
|
|
57
|
-
var
|
|
58
|
-
left: 'euiCard--leftAligned',
|
|
59
|
-
center: 'euiCard--centerAligned',
|
|
60
|
-
right: 'euiCard--rightAligned'
|
|
61
|
-
};
|
|
62
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
57
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
63
58
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
64
|
-
var layoutToClassNameMap = {
|
|
65
|
-
vertical: '',
|
|
66
|
-
horizontal: 'euiCard--horizontal'
|
|
67
|
-
};
|
|
68
|
-
var LAYOUT_ALIGNMENTS = (0, _common.keysOf)(layoutToClassNameMap);
|
|
69
|
-
/**
|
|
70
|
-
* Certain props are only allowed when the layout is vertical
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
exports.LAYOUT_ALIGNMENTS = LAYOUT_ALIGNMENTS;
|
|
74
59
|
|
|
75
60
|
var EuiCard = function EuiCard(_ref) {
|
|
76
61
|
var className = _ref.className,
|
|
@@ -130,15 +115,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
130
115
|
}
|
|
131
116
|
}
|
|
132
117
|
|
|
133
|
-
var
|
|
134
|
-
var classes = (0, _classnames.default)('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
135
|
-
'euiCard--isClickable': isClickable,
|
|
136
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
137
|
-
'euiCard--hasIcon': icon,
|
|
138
|
-
'euiCard--isSelectable': selectable,
|
|
139
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
140
|
-
'euiCard-isDisabled': isDisabled
|
|
141
|
-
}, selectableColorClass, className);
|
|
118
|
+
var classes = (0, _classnames.default)('euiCard', className);
|
|
142
119
|
var ariaId = (0, _accessibility.useGeneratedHtmlId)();
|
|
143
120
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
144
121
|
/**
|
|
@@ -166,7 +143,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
166
143
|
|
|
167
144
|
if (icon) {
|
|
168
145
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
169
|
-
iconNode =
|
|
146
|
+
iconNode = (0, _clone_element.cloneElementWithCss)(icon, {
|
|
170
147
|
className: (0, _classnames.default)(icon.props.className, 'euiCard__icon'),
|
|
171
148
|
css: iconStyles
|
|
172
149
|
});
|
|
@@ -27,7 +27,7 @@ var _checkable_card = require("./checkable_card.styles");
|
|
|
27
27
|
|
|
28
28
|
var _react2 = require("@emotion/react");
|
|
29
29
|
|
|
30
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
30
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
31
31
|
|
|
32
32
|
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); }
|
|
33
33
|
|
|
@@ -36,6 +36,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
36
36
|
var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
37
37
|
var children = _ref.children,
|
|
38
38
|
className = _ref.className,
|
|
39
|
+
css = _ref.css,
|
|
39
40
|
_ref$checkableType = _ref.checkableType,
|
|
40
41
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
41
42
|
label = _ref.label,
|
|
@@ -47,7 +48,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
47
48
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
49
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
49
50
|
var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
|
|
50
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
51
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
51
52
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
52
53
|
var childStyles = [styles.euiCheckableCard__children];
|
|
53
54
|
var id = rest.id;
|
package/package.json
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
max-height: 75vh; // We overflow the modal body based off this
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
// TODO: Consider restoring this once https://bugs.chromium.org/p/chromium/issues/detail?id=1229700 is resolved
|
|
10
|
+
// overflow: hidden; Ensure long, non-breaking text doesn't expand beyond the modal bounds
|
|
9
11
|
|
|
10
12
|
position: relative;
|
|
11
13
|
background-color: $euiColorEmptyShade;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.EuiCard = exports.ALIGNMENTS = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -21,10 +21,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
23
|
|
|
24
|
-
var _common = require("../common");
|
|
25
|
-
|
|
26
24
|
var _services = require("../../services");
|
|
27
25
|
|
|
26
|
+
var _clone_element = require("../../services/theme/clone_element");
|
|
27
|
+
|
|
28
28
|
var _text = require("../text");
|
|
29
29
|
|
|
30
30
|
var _title = require("../title");
|
|
@@ -56,23 +56,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
56
56
|
|
|
57
57
|
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; }
|
|
58
58
|
|
|
59
|
-
var
|
|
60
|
-
left: 'euiCard--leftAligned',
|
|
61
|
-
center: 'euiCard--centerAligned',
|
|
62
|
-
right: 'euiCard--rightAligned'
|
|
63
|
-
};
|
|
64
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
59
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
65
60
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
66
|
-
var layoutToClassNameMap = {
|
|
67
|
-
vertical: '',
|
|
68
|
-
horizontal: 'euiCard--horizontal'
|
|
69
|
-
};
|
|
70
|
-
var LAYOUT_ALIGNMENTS = (0, _common.keysOf)(layoutToClassNameMap);
|
|
71
|
-
/**
|
|
72
|
-
* Certain props are only allowed when the layout is vertical
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
exports.LAYOUT_ALIGNMENTS = LAYOUT_ALIGNMENTS;
|
|
76
61
|
|
|
77
62
|
var EuiCard = function EuiCard(_ref) {
|
|
78
63
|
var className = _ref.className,
|
|
@@ -132,15 +117,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
132
117
|
}
|
|
133
118
|
}
|
|
134
119
|
|
|
135
|
-
var
|
|
136
|
-
var classes = (0, _classnames.default)('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
137
|
-
'euiCard--isClickable': isClickable,
|
|
138
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
139
|
-
'euiCard--hasIcon': icon,
|
|
140
|
-
'euiCard--isSelectable': selectable,
|
|
141
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
142
|
-
'euiCard-isDisabled': isDisabled
|
|
143
|
-
}, selectableColorClass, className);
|
|
120
|
+
var classes = (0, _classnames.default)('euiCard', className);
|
|
144
121
|
var ariaId = (0, _accessibility.useGeneratedHtmlId)();
|
|
145
122
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
146
123
|
/**
|
|
@@ -168,7 +145,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
168
145
|
|
|
169
146
|
if (icon) {
|
|
170
147
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
171
|
-
iconNode =
|
|
148
|
+
iconNode = (0, _clone_element.cloneElementWithCss)(icon, {
|
|
172
149
|
className: (0, _classnames.default)(icon.props.className, 'euiCard__icon'),
|
|
173
150
|
css: iconStyles
|
|
174
151
|
});
|
|
@@ -343,7 +320,7 @@ EuiCard.propTypes = {
|
|
|
343
320
|
/**
|
|
344
321
|
* Changes alignment of the title and description
|
|
345
322
|
*/
|
|
346
|
-
textAlign: _propTypes.default.
|
|
323
|
+
textAlign: _propTypes.default.any,
|
|
347
324
|
|
|
348
325
|
/**
|
|
349
326
|
* Accepts any combination of elements
|
|
@@ -29,7 +29,7 @@ var _checkable_card = require("./checkable_card.styles");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
32
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
33
33
|
|
|
34
34
|
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
35
|
|
|
@@ -38,6 +38,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
38
|
var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
39
39
|
var children = _ref.children,
|
|
40
40
|
className = _ref.className,
|
|
41
|
+
css = _ref.css,
|
|
41
42
|
_ref$checkableType = _ref.checkableType,
|
|
42
43
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
43
44
|
label = _ref.label,
|
|
@@ -49,7 +50,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
49
50
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
50
51
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
51
52
|
var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
|
|
52
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
53
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
53
54
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
54
55
|
var childStyles = [styles.euiCheckableCard__children];
|
|
55
56
|
var id = rest.id;
|