@elastic/eui 99.0.0 → 99.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/es/components/badge/badge.styles.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.styles.js +11 -7
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +19 -5
- package/es/components/stat/stat.js +1 -1
- package/es/components/stat/stat.styles.js +1 -0
- package/eui.d.ts +17 -4
- package/i18ntokens.json +4 -4
- package/lib/components/badge/badge.styles.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.styles.js +11 -7
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +19 -5
- package/lib/components/stat/stat.js +1 -1
- package/lib/components/stat/stat.styles.js +1 -0
- package/optimize/es/components/badge/badge.styles.js +1 -1
- package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +11 -7
- package/optimize/es/components/color_picker/color_palette_picker/color_palette_picker.js +9 -3
- package/optimize/es/components/stat/stat.js +1 -1
- package/optimize/es/components/stat/stat.styles.js +1 -0
- package/optimize/lib/components/badge/badge.styles.js +1 -1
- package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +11 -7
- package/optimize/lib/components/color_picker/color_palette_picker/color_palette_picker.js +9 -3
- package/optimize/lib/components/stat/stat.js +1 -1
- package/optimize/lib/components/stat/stat.styles.js +1 -0
- package/package.json +1 -1
- package/test-env/components/badge/badge.styles.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.styles.js +11 -7
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +19 -5
- package/test-env/components/stat/stat.js +1 -1
- package/test-env/components/stat/stat.styles.js +1 -0
|
@@ -30,7 +30,7 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
30
30
|
// Account for the border
|
|
31
31
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
32
32
|
return x + y * 2;
|
|
33
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:
|
|
33
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
34
34
|
return x / 2;
|
|
35
35
|
}), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
36
36
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
@@ -38,8 +38,14 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
38
38
|
var euiTheme = euiThemeContext.euiTheme,
|
|
39
39
|
colorMode = euiThemeContext.colorMode;
|
|
40
40
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
41
|
+
var badgeSizes = {
|
|
42
|
+
m: euiTheme.size.l,
|
|
43
|
+
s: mathWithUnits(euiTheme.size.base, function (x) {
|
|
44
|
+
return x * 1.25;
|
|
45
|
+
})
|
|
46
|
+
};
|
|
41
47
|
return {
|
|
42
|
-
euiBetaBadge: /*#__PURE__*/css("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.
|
|
48
|
+
euiBetaBadge: /*#__PURE__*/css("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.semiBold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", euiTextTruncate(), " &:focus{", euiFocusRing(euiThemeContext, 'outset', {
|
|
43
49
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
44
50
|
}), ";};label:euiBetaBadge;"),
|
|
45
51
|
// Colors
|
|
@@ -48,15 +54,13 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
48
54
|
hollow: /*#__PURE__*/css("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
49
55
|
warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
|
|
50
56
|
// Font sizes
|
|
51
|
-
m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:",
|
|
52
|
-
s: /*#__PURE__*/css("font-size:0.
|
|
53
|
-
return x + euiTheme.base;
|
|
54
|
-
}), ";;label:s;"),
|
|
57
|
+
m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
58
|
+
s: /*#__PURE__*/css("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
55
59
|
// Padding/width sizes
|
|
56
60
|
badgeSizes: {
|
|
57
61
|
default: {
|
|
58
|
-
m: "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.base)),
|
|
59
|
-
s: "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.m))
|
|
62
|
+
m: "\n ".concat(logicalCSS('height', badgeSizes.m), "\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.base), "\n "),
|
|
63
|
+
s: "\n ".concat(logicalCSS('height', badgeSizes.s), "\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.m), "\n ")
|
|
60
64
|
},
|
|
61
65
|
// When it's just an icon or a single letter, make the badge a circle
|
|
62
66
|
circle: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isInvalid", "onChange", "readOnly", "valueOfSelected", "palettes", "append", "prepend", "selectionDisplay"],
|
|
3
|
-
_excluded2 = ["type", "value", "title", "palette"];
|
|
3
|
+
_excluded2 = ["type", "value", "title", "append", "palette"];
|
|
4
4
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -24,6 +24,7 @@ import { EuiText } from '../../text';
|
|
|
24
24
|
import { EuiSuperSelect } from '../../form/super_select'; // Note: needs to be pointed at this specific subdir for Storybook to inherit types correctly??
|
|
25
25
|
|
|
26
26
|
import { EuiColorPaletteDisplay } from '../color_palette_display';
|
|
27
|
+
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
|
|
27
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
28
29
|
export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
29
30
|
var className = _ref.className,
|
|
@@ -59,6 +60,7 @@ export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
|
59
60
|
var type = item.type,
|
|
60
61
|
value = item.value,
|
|
61
62
|
title = item.title,
|
|
63
|
+
append = item.append,
|
|
62
64
|
palette = item.palette,
|
|
63
65
|
rest = _objectWithoutProperties(item, _excluded2);
|
|
64
66
|
var paletteForDisplay = item.type !== 'text' ? getPalette(item) : null;
|
|
@@ -71,11 +73,15 @@ export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
|
71
73
|
// Accessible labels are managed by color_palette_display_fixed and
|
|
72
74
|
// color_palette_display_gradient. Adding the aria-hidden attribute
|
|
73
75
|
// here to ensure screen readers don't speak the listbox options twice.
|
|
74
|
-
___EmotionJSX(React.Fragment, null, ___EmotionJSX(
|
|
76
|
+
___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexGroup, {
|
|
77
|
+
responsive: false
|
|
78
|
+
}, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiText, {
|
|
75
79
|
"aria-hidden": "true",
|
|
76
80
|
className: "euiColorPalettePicker__itemTitle",
|
|
77
81
|
size: "xs"
|
|
78
|
-
}, title), ___EmotionJSX(
|
|
82
|
+
}, title)), append && ___EmotionJSX(EuiFlexItem, {
|
|
83
|
+
grow: 0
|
|
84
|
+
}, append)), ___EmotionJSX(EuiSpacer, {
|
|
79
85
|
size: "xs"
|
|
80
86
|
})), type === 'text' ? title : paletteForDisplay)
|
|
81
87
|
}, rest);
|
|
@@ -200,7 +206,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
200
206
|
/**
|
|
201
207
|
* The name of your palette
|
|
202
208
|
*/
|
|
203
|
-
title: PropTypes.string,
|
|
209
|
+
title: PropTypes.string.isRequired,
|
|
210
|
+
/**
|
|
211
|
+
* Node appended to right of title
|
|
212
|
+
*/
|
|
213
|
+
append: PropTypes.node,
|
|
204
214
|
/**
|
|
205
215
|
* `fixed`: individual color blocks
|
|
206
216
|
*/
|
|
@@ -224,7 +234,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
224
234
|
/**
|
|
225
235
|
* The name of your palette
|
|
226
236
|
*/
|
|
227
|
-
title: PropTypes.string,
|
|
237
|
+
title: PropTypes.string.isRequired,
|
|
238
|
+
/**
|
|
239
|
+
* Node appended to right of title
|
|
240
|
+
*/
|
|
241
|
+
append: PropTypes.node,
|
|
228
242
|
/**
|
|
229
243
|
* `gradient`: each color fades into the next
|
|
230
244
|
*/
|
|
@@ -19,7 +19,7 @@ import { useEuiI18n } from '../i18n';
|
|
|
19
19
|
import { useEuiMemoizedStyles } from '../../services';
|
|
20
20
|
import { euiStatStyles, euiStatTitleStyles } from './stat.styles';
|
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
|
-
export var COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
22
|
+
export var COLORS = ['default', 'subdued', 'primary', 'success', 'warning', 'danger', 'accent'];
|
|
23
23
|
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
24
24
|
export var EuiStat = function EuiStat(_ref) {
|
|
25
25
|
var children = _ref.children,
|
|
@@ -28,6 +28,7 @@ export var euiStatTitleStyles = function euiStatTitleStyles(_ref) {
|
|
|
28
28
|
subdued: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
29
29
|
primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
30
30
|
success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
31
|
+
warning: /*#__PURE__*/css("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
31
32
|
danger: /*#__PURE__*/css("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
32
33
|
accent: /*#__PURE__*/css("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
33
34
|
// Loading
|
package/eui.d.ts
CHANGED
|
@@ -6748,7 +6748,7 @@ declare module '@elastic/eui/src/components/color_picker/color_palette_display'
|
|
|
6748
6748
|
|
|
6749
6749
|
}
|
|
6750
6750
|
declare module '@elastic/eui/src/components/color_picker/color_palette_picker/color_palette_picker' {
|
|
6751
|
-
import { FunctionComponent } from 'react';
|
|
6751
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
6752
6752
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
6753
6753
|
import { type EuiSuperSelectProps } from '@elastic/eui/src/components/form/super_select';
|
|
6754
6754
|
export interface PaletteColorStop {
|
|
@@ -6764,6 +6764,10 @@ declare module '@elastic/eui/src/components/color_picker/color_palette_picker/co
|
|
|
6764
6764
|
* The name of your palette
|
|
6765
6765
|
*/
|
|
6766
6766
|
title: string;
|
|
6767
|
+
/**
|
|
6768
|
+
* Node appended to right of title - disallowed for text-only options
|
|
6769
|
+
*/
|
|
6770
|
+
append?: never;
|
|
6767
6771
|
/**
|
|
6768
6772
|
* `text`: a text only option (a title is required).
|
|
6769
6773
|
*/
|
|
@@ -6781,7 +6785,11 @@ declare module '@elastic/eui/src/components/color_picker/color_palette_picker/co
|
|
|
6781
6785
|
/**
|
|
6782
6786
|
* The name of your palette
|
|
6783
6787
|
*/
|
|
6784
|
-
title
|
|
6788
|
+
title: string;
|
|
6789
|
+
/**
|
|
6790
|
+
* Node appended to right of title
|
|
6791
|
+
*/
|
|
6792
|
+
append?: ReactNode;
|
|
6785
6793
|
/**
|
|
6786
6794
|
* `fixed`: individual color blocks
|
|
6787
6795
|
*/
|
|
@@ -6799,7 +6807,11 @@ declare module '@elastic/eui/src/components/color_picker/color_palette_picker/co
|
|
|
6799
6807
|
/**
|
|
6800
6808
|
* The name of your palette
|
|
6801
6809
|
*/
|
|
6802
|
-
title
|
|
6810
|
+
title: string;
|
|
6811
|
+
/**
|
|
6812
|
+
* Node appended to right of title
|
|
6813
|
+
*/
|
|
6814
|
+
append?: ReactNode;
|
|
6803
6815
|
/**
|
|
6804
6816
|
* `gradient`: each color fades into the next
|
|
6805
6817
|
*/
|
|
@@ -23751,6 +23763,7 @@ declare module '@elastic/eui/src/components/stat/stat.styles' {
|
|
|
23751
23763
|
subdued: import("@emotion/utils").SerializedStyles;
|
|
23752
23764
|
primary: import("@emotion/utils").SerializedStyles;
|
|
23753
23765
|
success: import("@emotion/utils").SerializedStyles;
|
|
23766
|
+
warning: import("@emotion/utils").SerializedStyles;
|
|
23754
23767
|
danger: import("@emotion/utils").SerializedStyles;
|
|
23755
23768
|
accent: import("@emotion/utils").SerializedStyles;
|
|
23756
23769
|
isLoading: import("@emotion/utils").SerializedStyles;
|
|
@@ -23761,7 +23774,7 @@ declare module '@elastic/eui/src/components/stat/stat' {
|
|
|
23761
23774
|
import { HTMLAttributes, FunctionComponent, ReactNode } from 'react';
|
|
23762
23775
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
23763
23776
|
import { EuiTitleSize } from '@elastic/eui/src/components/title/title';
|
|
23764
|
-
export const COLORS: readonly ["default", "subdued", "primary", "success", "danger", "accent"]; type TitleColor = (typeof COLORS)[number];
|
|
23777
|
+
export const COLORS: readonly ["default", "subdued", "primary", "success", "warning", "danger", "accent"]; type TitleColor = (typeof COLORS)[number];
|
|
23765
23778
|
export const ALIGNMENTS: readonly ["left", "center", "right"];
|
|
23766
23779
|
export interface EuiStatProps {
|
|
23767
23780
|
/**
|
package/i18ntokens.json
CHANGED
|
@@ -6521,14 +6521,14 @@
|
|
|
6521
6521
|
"highlighting": "string",
|
|
6522
6522
|
"loc": {
|
|
6523
6523
|
"start": {
|
|
6524
|
-
"line":
|
|
6524
|
+
"line": 95,
|
|
6525
6525
|
"column": 32,
|
|
6526
|
-
"index":
|
|
6526
|
+
"index": 2317
|
|
6527
6527
|
},
|
|
6528
6528
|
"end": {
|
|
6529
|
-
"line":
|
|
6529
|
+
"line": 98,
|
|
6530
6530
|
"column": 3,
|
|
6531
|
-
"index":
|
|
6531
|
+
"index": 2386
|
|
6532
6532
|
}
|
|
6533
6533
|
},
|
|
6534
6534
|
"filepath": "src/components/stat/stat.tsx"
|
|
@@ -34,7 +34,7 @@ var euiBadgeStyles = exports.euiBadgeStyles = function euiBadgeStyles(euiThemeCo
|
|
|
34
34
|
// Account for the border
|
|
35
35
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
36
36
|
return x + y * 2;
|
|
37
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:
|
|
37
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
38
38
|
return x / 2;
|
|
39
39
|
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
40
40
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
@@ -42,8 +42,14 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
42
42
|
var euiTheme = euiThemeContext.euiTheme,
|
|
43
43
|
colorMode = euiThemeContext.colorMode;
|
|
44
44
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
45
|
+
var badgeSizes = {
|
|
46
|
+
m: euiTheme.size.l,
|
|
47
|
+
s: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
48
|
+
return x * 1.25;
|
|
49
|
+
})
|
|
50
|
+
};
|
|
45
51
|
return {
|
|
46
|
-
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.
|
|
52
|
+
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.semiBold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
|
|
47
53
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
48
54
|
}), ";};label:euiBetaBadge;"),
|
|
49
55
|
// Colors
|
|
@@ -52,15 +58,13 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
52
58
|
hollow: /*#__PURE__*/(0, _react.css)("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
53
59
|
warning: /*#__PURE__*/(0, _react.css)(badgeColors.warning, ";label:warning;"),
|
|
54
60
|
// Font sizes
|
|
55
|
-
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:",
|
|
56
|
-
s: /*#__PURE__*/(0, _react.css)("font-size:0.
|
|
57
|
-
return x + euiTheme.base;
|
|
58
|
-
}), ";;label:s;"),
|
|
61
|
+
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
62
|
+
s: /*#__PURE__*/(0, _react.css)("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
59
63
|
// Padding/width sizes
|
|
60
64
|
badgeSizes: {
|
|
61
65
|
default: {
|
|
62
|
-
m: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base)),
|
|
63
|
-
s: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m))
|
|
66
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.m), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), "\n "),
|
|
67
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.s), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), "\n ")
|
|
64
68
|
},
|
|
65
69
|
// When it's just an icon or a single letter, make the badge a circle
|
|
66
70
|
circle: {
|
|
@@ -11,9 +11,10 @@ var _spacer = require("../../spacer");
|
|
|
11
11
|
var _text = require("../../text");
|
|
12
12
|
var _super_select = require("../../form/super_select");
|
|
13
13
|
var _color_palette_display = require("../color_palette_display");
|
|
14
|
+
var _flex = require("../../flex");
|
|
14
15
|
var _react2 = require("@emotion/react");
|
|
15
16
|
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isInvalid", "onChange", "readOnly", "valueOfSelected", "palettes", "append", "prepend", "selectionDisplay"],
|
|
16
|
-
_excluded2 = ["type", "value", "title", "palette"];
|
|
17
|
+
_excluded2 = ["type", "value", "title", "append", "palette"];
|
|
17
18
|
/*
|
|
18
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
20
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -67,6 +68,7 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
67
68
|
var type = item.type,
|
|
68
69
|
value = item.value,
|
|
69
70
|
title = item.title,
|
|
71
|
+
append = item.append,
|
|
70
72
|
palette = item.palette,
|
|
71
73
|
rest = _objectWithoutProperties(item, _excluded2);
|
|
72
74
|
var paletteForDisplay = item.type !== 'text' ? getPalette(item) : null;
|
|
@@ -79,11 +81,15 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
79
81
|
// Accessible labels are managed by color_palette_display_fixed and
|
|
80
82
|
// color_palette_display_gradient. Adding the aria-hidden attribute
|
|
81
83
|
// here to ensure screen readers don't speak the listbox options twice.
|
|
82
|
-
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
84
|
+
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
85
|
+
responsive: false
|
|
86
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_text.EuiText, {
|
|
83
87
|
"aria-hidden": "true",
|
|
84
88
|
className: "euiColorPalettePicker__itemTitle",
|
|
85
89
|
size: "xs"
|
|
86
|
-
}, title), (0, _react2.jsx)(
|
|
90
|
+
}, title)), append && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
91
|
+
grow: 0
|
|
92
|
+
}, append)), (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
87
93
|
size: "xs"
|
|
88
94
|
})), type === 'text' ? title : paletteForDisplay)
|
|
89
95
|
}, rest);
|
|
@@ -208,7 +214,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
208
214
|
/**
|
|
209
215
|
* The name of your palette
|
|
210
216
|
*/
|
|
211
|
-
title: _propTypes.default.string,
|
|
217
|
+
title: _propTypes.default.string.isRequired,
|
|
218
|
+
/**
|
|
219
|
+
* Node appended to right of title
|
|
220
|
+
*/
|
|
221
|
+
append: _propTypes.default.node,
|
|
212
222
|
/**
|
|
213
223
|
* `fixed`: individual color blocks
|
|
214
224
|
*/
|
|
@@ -232,7 +242,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
232
242
|
/**
|
|
233
243
|
* The name of your palette
|
|
234
244
|
*/
|
|
235
|
-
title: _propTypes.default.string,
|
|
245
|
+
title: _propTypes.default.string.isRequired,
|
|
246
|
+
/**
|
|
247
|
+
* Node appended to right of title
|
|
248
|
+
*/
|
|
249
|
+
append: _propTypes.default.node,
|
|
236
250
|
/**
|
|
237
251
|
* `gradient`: each color fades into the next
|
|
238
252
|
*/
|
|
@@ -28,7 +28,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
28
28
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
29
29
|
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; }
|
|
30
30
|
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; }
|
|
31
|
-
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
31
|
+
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'warning', 'danger', 'accent'];
|
|
32
32
|
var ALIGNMENTS = exports.ALIGNMENTS = ['left', 'center', 'right'];
|
|
33
33
|
var EuiStat = exports.EuiStat = function EuiStat(_ref) {
|
|
34
34
|
var children = _ref.children,
|
|
@@ -33,6 +33,7 @@ var euiStatTitleStyles = exports.euiStatTitleStyles = function euiStatTitleStyle
|
|
|
33
33
|
subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
34
34
|
primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
35
35
|
success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
36
|
+
warning: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
36
37
|
danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
37
38
|
accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
38
39
|
// Loading
|
|
@@ -30,7 +30,7 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
30
30
|
// Account for the border
|
|
31
31
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
32
32
|
return x + y * 2;
|
|
33
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:
|
|
33
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
34
34
|
return x / 2;
|
|
35
35
|
}), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
36
36
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
@@ -38,8 +38,14 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
38
38
|
var euiTheme = euiThemeContext.euiTheme,
|
|
39
39
|
colorMode = euiThemeContext.colorMode;
|
|
40
40
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
41
|
+
var badgeSizes = {
|
|
42
|
+
m: euiTheme.size.l,
|
|
43
|
+
s: mathWithUnits(euiTheme.size.base, function (x) {
|
|
44
|
+
return x * 1.25;
|
|
45
|
+
})
|
|
46
|
+
};
|
|
41
47
|
return {
|
|
42
|
-
euiBetaBadge: /*#__PURE__*/css("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.
|
|
48
|
+
euiBetaBadge: /*#__PURE__*/css("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.semiBold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", euiTextTruncate(), " &:focus{", euiFocusRing(euiThemeContext, 'outset', {
|
|
43
49
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
44
50
|
}), ";};label:euiBetaBadge;"),
|
|
45
51
|
// Colors
|
|
@@ -48,15 +54,13 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
48
54
|
hollow: /*#__PURE__*/css("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
49
55
|
warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
|
|
50
56
|
// Font sizes
|
|
51
|
-
m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:",
|
|
52
|
-
s: /*#__PURE__*/css("font-size:0.
|
|
53
|
-
return x + euiTheme.base;
|
|
54
|
-
}), ";;label:s;"),
|
|
57
|
+
m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
58
|
+
s: /*#__PURE__*/css("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
55
59
|
// Padding/width sizes
|
|
56
60
|
badgeSizes: {
|
|
57
61
|
default: {
|
|
58
|
-
m: "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.base)),
|
|
59
|
-
s: "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.m))
|
|
62
|
+
m: "\n ".concat(logicalCSS('height', badgeSizes.m), "\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.base), "\n "),
|
|
63
|
+
s: "\n ".concat(logicalCSS('height', badgeSizes.s), "\n ").concat(logicalCSS('padding-horizontal', euiTheme.size.m), "\n ")
|
|
60
64
|
},
|
|
61
65
|
// When it's just an icon or a single letter, make the badge a circle
|
|
62
66
|
circle: {
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isInvalid", "onChange", "readOnly", "valueOfSelected", "palettes", "append", "prepend", "selectionDisplay"],
|
|
5
|
-
_excluded2 = ["type", "value", "title", "palette"];
|
|
5
|
+
_excluded2 = ["type", "value", "title", "append", "palette"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
/*
|
|
@@ -19,6 +19,7 @@ import { EuiText } from '../../text';
|
|
|
19
19
|
import { EuiSuperSelect } from '../../form/super_select'; // Note: needs to be pointed at this specific subdir for Storybook to inherit types correctly??
|
|
20
20
|
|
|
21
21
|
import { EuiColorPaletteDisplay } from '../color_palette_display';
|
|
22
|
+
import { EuiFlexGroup, EuiFlexItem } from '../../flex';
|
|
22
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
24
|
export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
24
25
|
var className = _ref.className,
|
|
@@ -54,6 +55,7 @@ export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
|
54
55
|
var type = item.type,
|
|
55
56
|
value = item.value,
|
|
56
57
|
title = item.title,
|
|
58
|
+
append = item.append,
|
|
57
59
|
palette = item.palette,
|
|
58
60
|
rest = _objectWithoutProperties(item, _excluded2);
|
|
59
61
|
var paletteForDisplay = item.type !== 'text' ? getPalette(item) : null;
|
|
@@ -66,11 +68,15 @@ export var EuiColorPalettePicker = function EuiColorPalettePicker(_ref) {
|
|
|
66
68
|
// Accessible labels are managed by color_palette_display_fixed and
|
|
67
69
|
// color_palette_display_gradient. Adding the aria-hidden attribute
|
|
68
70
|
// here to ensure screen readers don't speak the listbox options twice.
|
|
69
|
-
___EmotionJSX(React.Fragment, null, ___EmotionJSX(
|
|
71
|
+
___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexGroup, {
|
|
72
|
+
responsive: false
|
|
73
|
+
}, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiText, {
|
|
70
74
|
"aria-hidden": "true",
|
|
71
75
|
className: "euiColorPalettePicker__itemTitle",
|
|
72
76
|
size: "xs"
|
|
73
|
-
}, title), ___EmotionJSX(
|
|
77
|
+
}, title)), append && ___EmotionJSX(EuiFlexItem, {
|
|
78
|
+
grow: 0
|
|
79
|
+
}, append)), ___EmotionJSX(EuiSpacer, {
|
|
74
80
|
size: "xs"
|
|
75
81
|
})), type === 'text' ? title : paletteForDisplay)
|
|
76
82
|
}, rest);
|
|
@@ -17,7 +17,7 @@ import { useEuiI18n } from '../i18n';
|
|
|
17
17
|
import { useEuiMemoizedStyles } from '../../services';
|
|
18
18
|
import { euiStatStyles, euiStatTitleStyles } from './stat.styles';
|
|
19
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
-
export var COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
20
|
+
export var COLORS = ['default', 'subdued', 'primary', 'success', 'warning', 'danger', 'accent'];
|
|
21
21
|
export var ALIGNMENTS = ['left', 'center', 'right'];
|
|
22
22
|
export var EuiStat = function EuiStat(_ref) {
|
|
23
23
|
var children = _ref.children,
|
|
@@ -28,6 +28,7 @@ export var euiStatTitleStyles = function euiStatTitleStyles(_ref) {
|
|
|
28
28
|
subdued: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
29
29
|
primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
30
30
|
success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
31
|
+
warning: /*#__PURE__*/css("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
31
32
|
danger: /*#__PURE__*/css("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
32
33
|
accent: /*#__PURE__*/css("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
33
34
|
// Loading
|
|
@@ -34,7 +34,7 @@ var euiBadgeStyles = exports.euiBadgeStyles = function euiBadgeStyles(euiThemeCo
|
|
|
34
34
|
// Account for the border
|
|
35
35
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
36
36
|
return x + y * 2;
|
|
37
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:
|
|
37
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
38
38
|
return x / 2;
|
|
39
39
|
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
40
40
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
@@ -42,8 +42,14 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
42
42
|
var euiTheme = euiThemeContext.euiTheme,
|
|
43
43
|
colorMode = euiThemeContext.colorMode;
|
|
44
44
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
45
|
+
var badgeSizes = {
|
|
46
|
+
m: euiTheme.size.l,
|
|
47
|
+
s: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
48
|
+
return x * 1.25;
|
|
49
|
+
})
|
|
50
|
+
};
|
|
45
51
|
return {
|
|
46
|
-
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.
|
|
52
|
+
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.semiBold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
|
|
47
53
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
48
54
|
}), ";};label:euiBetaBadge;"),
|
|
49
55
|
// Colors
|
|
@@ -52,15 +58,13 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
52
58
|
hollow: /*#__PURE__*/(0, _react.css)("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
53
59
|
warning: /*#__PURE__*/(0, _react.css)(badgeColors.warning, ";label:warning;"),
|
|
54
60
|
// Font sizes
|
|
55
|
-
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:",
|
|
56
|
-
s: /*#__PURE__*/(0, _react.css)("font-size:0.
|
|
57
|
-
return x + euiTheme.base;
|
|
58
|
-
}), ";;label:s;"),
|
|
61
|
+
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
62
|
+
s: /*#__PURE__*/(0, _react.css)("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
59
63
|
// Padding/width sizes
|
|
60
64
|
badgeSizes: {
|
|
61
65
|
default: {
|
|
62
|
-
m: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base)),
|
|
63
|
-
s: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m))
|
|
66
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.m), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), "\n "),
|
|
67
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.s), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), "\n ")
|
|
64
68
|
},
|
|
65
69
|
// When it's just an icon or a single letter, make the badge a circle
|
|
66
70
|
circle: {
|
|
@@ -14,9 +14,10 @@ var _spacer = require("../../spacer");
|
|
|
14
14
|
var _text = require("../../text");
|
|
15
15
|
var _super_select = require("../../form/super_select");
|
|
16
16
|
var _color_palette_display = require("../color_palette_display");
|
|
17
|
+
var _flex = require("../../flex");
|
|
17
18
|
var _react2 = require("@emotion/react");
|
|
18
19
|
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isInvalid", "onChange", "readOnly", "valueOfSelected", "palettes", "append", "prepend", "selectionDisplay"],
|
|
19
|
-
_excluded2 = ["type", "value", "title", "palette"];
|
|
20
|
+
_excluded2 = ["type", "value", "title", "append", "palette"];
|
|
20
21
|
/*
|
|
21
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
22
23
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -63,6 +64,7 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
63
64
|
var type = item.type,
|
|
64
65
|
value = item.value,
|
|
65
66
|
title = item.title,
|
|
67
|
+
append = item.append,
|
|
66
68
|
palette = item.palette,
|
|
67
69
|
rest = (0, _objectWithoutProperties2.default)(item, _excluded2);
|
|
68
70
|
var paletteForDisplay = item.type !== 'text' ? getPalette(item) : null;
|
|
@@ -75,11 +77,15 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
75
77
|
// Accessible labels are managed by color_palette_display_fixed and
|
|
76
78
|
// color_palette_display_gradient. Adding the aria-hidden attribute
|
|
77
79
|
// here to ensure screen readers don't speak the listbox options twice.
|
|
78
|
-
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
80
|
+
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
81
|
+
responsive: false
|
|
82
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_text.EuiText, {
|
|
79
83
|
"aria-hidden": "true",
|
|
80
84
|
className: "euiColorPalettePicker__itemTitle",
|
|
81
85
|
size: "xs"
|
|
82
|
-
}, title), (0, _react2.jsx)(
|
|
86
|
+
}, title)), append && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
87
|
+
grow: 0
|
|
88
|
+
}, append)), (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
83
89
|
size: "xs"
|
|
84
90
|
})), type === 'text' ? title : paletteForDisplay)
|
|
85
91
|
}, rest);
|
|
@@ -26,7 +26,7 @@ var _excluded = ["children", "className", "description", "isLoading", "reverse",
|
|
|
26
26
|
*/
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
|
-
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
29
|
+
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'warning', 'danger', 'accent'];
|
|
30
30
|
var ALIGNMENTS = exports.ALIGNMENTS = ['left', 'center', 'right'];
|
|
31
31
|
var EuiStat = exports.EuiStat = function EuiStat(_ref) {
|
|
32
32
|
var children = _ref.children,
|
|
@@ -34,6 +34,7 @@ var euiStatTitleStyles = exports.euiStatTitleStyles = function euiStatTitleStyle
|
|
|
34
34
|
subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
35
35
|
primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
36
36
|
success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
37
|
+
warning: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
37
38
|
danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
38
39
|
accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
39
40
|
// Loading
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ var euiBadgeStyles = exports.euiBadgeStyles = function euiBadgeStyles(euiThemeCo
|
|
|
34
34
|
// Account for the border
|
|
35
35
|
[euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
|
|
36
36
|
return x + y * 2;
|
|
37
|
-
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:
|
|
37
|
+
}), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:inherit;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
38
38
|
return x / 2;
|
|
39
39
|
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
40
40
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
@@ -42,8 +42,14 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
42
42
|
var euiTheme = euiThemeContext.euiTheme,
|
|
43
43
|
colorMode = euiThemeContext.colorMode;
|
|
44
44
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
45
|
+
var badgeSizes = {
|
|
46
|
+
m: euiTheme.size.l,
|
|
47
|
+
s: (0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
48
|
+
return x * 1.25;
|
|
49
|
+
})
|
|
50
|
+
};
|
|
45
51
|
return {
|
|
46
|
-
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.
|
|
52
|
+
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.semiBold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
|
|
47
53
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
48
54
|
}), ";};label:euiBetaBadge;"),
|
|
49
55
|
// Colors
|
|
@@ -52,15 +58,13 @@ var euiBetaBadgeStyles = exports.euiBetaBadgeStyles = function euiBetaBadgeStyle
|
|
|
52
58
|
hollow: /*#__PURE__*/(0, _react.css)("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
53
59
|
warning: /*#__PURE__*/(0, _react.css)(badgeColors.warning, ";label:warning;"),
|
|
54
60
|
// Font sizes
|
|
55
|
-
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:",
|
|
56
|
-
s: /*#__PURE__*/(0, _react.css)("font-size:0.
|
|
57
|
-
return x + euiTheme.base;
|
|
58
|
-
}), ";;label:s;"),
|
|
61
|
+
m: /*#__PURE__*/(0, _react.css)("font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";line-height:", badgeSizes.m, ";;label:m;"),
|
|
62
|
+
s: /*#__PURE__*/(0, _react.css)("font-size:0.7rem;line-height:", badgeSizes.s, ";;label:s;"),
|
|
59
63
|
// Padding/width sizes
|
|
60
64
|
badgeSizes: {
|
|
61
65
|
default: {
|
|
62
|
-
m: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base)),
|
|
63
|
-
s: "\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m))
|
|
66
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.m), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), "\n "),
|
|
67
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('height', badgeSizes.s), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), "\n ")
|
|
64
68
|
},
|
|
65
69
|
// When it's just an icon or a single letter, make the badge a circle
|
|
66
70
|
circle: {
|
|
@@ -15,9 +15,10 @@ var _spacer = require("../../spacer");
|
|
|
15
15
|
var _text = require("../../text");
|
|
16
16
|
var _super_select = require("../../form/super_select");
|
|
17
17
|
var _color_palette_display = require("../color_palette_display");
|
|
18
|
+
var _flex = require("../../flex");
|
|
18
19
|
var _react2 = require("@emotion/react");
|
|
19
20
|
var _excluded = ["className", "compressed", "disabled", "fullWidth", "isInvalid", "onChange", "readOnly", "valueOfSelected", "palettes", "append", "prepend", "selectionDisplay"],
|
|
20
|
-
_excluded2 = ["type", "value", "title", "palette"];
|
|
21
|
+
_excluded2 = ["type", "value", "title", "append", "palette"];
|
|
21
22
|
/*
|
|
22
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -64,6 +65,7 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
64
65
|
var type = item.type,
|
|
65
66
|
value = item.value,
|
|
66
67
|
title = item.title,
|
|
68
|
+
append = item.append,
|
|
67
69
|
palette = item.palette,
|
|
68
70
|
rest = (0, _objectWithoutProperties2.default)(item, _excluded2);
|
|
69
71
|
var paletteForDisplay = item.type !== 'text' ? getPalette(item) : null;
|
|
@@ -76,11 +78,15 @@ var EuiColorPalettePicker = exports.EuiColorPalettePicker = function EuiColorPal
|
|
|
76
78
|
// Accessible labels are managed by color_palette_display_fixed and
|
|
77
79
|
// color_palette_display_gradient. Adding the aria-hidden attribute
|
|
78
80
|
// here to ensure screen readers don't speak the listbox options twice.
|
|
79
|
-
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
81
|
+
(0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
82
|
+
responsive: false
|
|
83
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, null, (0, _react2.jsx)(_text.EuiText, {
|
|
80
84
|
"aria-hidden": "true",
|
|
81
85
|
className: "euiColorPalettePicker__itemTitle",
|
|
82
86
|
size: "xs"
|
|
83
|
-
}, title), (0, _react2.jsx)(
|
|
87
|
+
}, title)), append && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
88
|
+
grow: 0
|
|
89
|
+
}, append)), (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
84
90
|
size: "xs"
|
|
85
91
|
})), type === 'text' ? title : paletteForDisplay)
|
|
86
92
|
}, rest);
|
|
@@ -205,7 +211,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
205
211
|
/**
|
|
206
212
|
* The name of your palette
|
|
207
213
|
*/
|
|
208
|
-
title: _propTypes.default.string,
|
|
214
|
+
title: _propTypes.default.string.isRequired,
|
|
215
|
+
/**
|
|
216
|
+
* Node appended to right of title
|
|
217
|
+
*/
|
|
218
|
+
append: _propTypes.default.node,
|
|
209
219
|
/**
|
|
210
220
|
* `fixed`: individual color blocks
|
|
211
221
|
*/
|
|
@@ -229,7 +239,11 @@ EuiColorPalettePicker.propTypes = {
|
|
|
229
239
|
/**
|
|
230
240
|
* The name of your palette
|
|
231
241
|
*/
|
|
232
|
-
title: _propTypes.default.string,
|
|
242
|
+
title: _propTypes.default.string.isRequired,
|
|
243
|
+
/**
|
|
244
|
+
* Node appended to right of title
|
|
245
|
+
*/
|
|
246
|
+
append: _propTypes.default.node,
|
|
233
247
|
/**
|
|
234
248
|
* `gradient`: each color fades into the next
|
|
235
249
|
*/
|
|
@@ -27,7 +27,7 @@ var _excluded = ["children", "className", "description", "isLoading", "reverse",
|
|
|
27
27
|
*/
|
|
28
28
|
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); }
|
|
29
29
|
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; }
|
|
30
|
-
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
|
|
30
|
+
var COLORS = exports.COLORS = ['default', 'subdued', 'primary', 'success', 'warning', 'danger', 'accent'];
|
|
31
31
|
var ALIGNMENTS = exports.ALIGNMENTS = ['left', 'center', 'right'];
|
|
32
32
|
var EuiStat = exports.EuiStat = function EuiStat(_ref) {
|
|
33
33
|
var children = _ref.children,
|
|
@@ -34,6 +34,7 @@ var euiStatTitleStyles = exports.euiStatTitleStyles = function euiStatTitleStyle
|
|
|
34
34
|
subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
35
35
|
primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
36
36
|
success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
37
|
+
warning: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
37
38
|
danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
38
39
|
accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
39
40
|
// Loading
|