@elastic/eui-theme-common 7.2.0 → 8.0.0-snapshot.1771331649954
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/lib/cjs/global_styling/functions/math.d.ts +4 -2
- package/lib/cjs/global_styling/functions/size.d.ts +1 -1
- package/lib/cjs/global_styling/mixins/borders.d.ts +1 -1
- package/lib/cjs/global_styling/mixins/shadow.d.ts +9 -9
- package/lib/cjs/global_styling/variables/animations.d.ts +5 -5
- package/lib/cjs/global_styling/variables/borders.d.ts +1 -1
- package/lib/cjs/global_styling/variables/breakpoint.d.ts +2 -2
- package/lib/cjs/global_styling/variables/buttons.d.ts +2 -2
- package/lib/cjs/global_styling/variables/colors.d.ts +15 -15
- package/lib/cjs/global_styling/variables/components.d.ts +4 -3
- package/lib/cjs/global_styling/variables/flags.d.ts +2 -2
- package/lib/cjs/global_styling/variables/forms.d.ts +2 -2
- package/lib/cjs/global_styling/variables/levels.d.ts +2 -2
- package/lib/cjs/global_styling/variables/overrides.d.ts +1 -1
- package/lib/cjs/global_styling/variables/shadow.d.ts +7 -7
- package/lib/cjs/global_styling/variables/size.d.ts +3 -3
- package/lib/cjs/global_styling/variables/typography.d.ts +10 -10
- package/lib/cjs/services/theme/types.d.ts +14 -14
- package/lib/cjs/services/vis_color_store.d.ts +3 -3
- package/lib/cjs/types.d.ts +3 -3
- package/lib/cjs/utils.d.ts +7 -9
- package/lib/esm/global_styling/functions/math.d.ts +4 -2
- package/lib/esm/global_styling/functions/size.d.ts +1 -1
- package/lib/esm/global_styling/mixins/borders.d.ts +1 -1
- package/lib/esm/global_styling/mixins/shadow.d.ts +9 -9
- package/lib/esm/global_styling/variables/animations.d.ts +5 -5
- package/lib/esm/global_styling/variables/borders.d.ts +1 -1
- package/lib/esm/global_styling/variables/breakpoint.d.ts +2 -2
- package/lib/esm/global_styling/variables/buttons.d.ts +2 -2
- package/lib/esm/global_styling/variables/colors.d.ts +15 -15
- package/lib/esm/global_styling/variables/components.d.ts +4 -3
- package/lib/esm/global_styling/variables/flags.d.ts +2 -2
- package/lib/esm/global_styling/variables/forms.d.ts +2 -2
- package/lib/esm/global_styling/variables/levels.d.ts +2 -2
- package/lib/esm/global_styling/variables/overrides.d.ts +1 -1
- package/lib/esm/global_styling/variables/shadow.d.ts +7 -7
- package/lib/esm/global_styling/variables/size.d.ts +3 -3
- package/lib/esm/global_styling/variables/typography.d.ts +10 -10
- package/lib/esm/services/theme/types.d.ts +14 -14
- package/lib/esm/services/vis_color_store.d.ts +3 -3
- package/lib/esm/types.d.ts +3 -3
- package/lib/esm/utils.d.ts +7 -9
- package/package.json +6 -5
- package/src/global_styling/functions/_colors.scss +3 -3
- package/src/global_styling/mixins/_tool_tip.scss +2 -2
- package/src/global_styling/variables/_buttons.scss +1 -1
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
8
8
|
* mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
export declare const mathWithUnits: (values: ValueTypes | ValueTypes[],
|
|
10
|
+
type ValueTypes = string | number | undefined;
|
|
11
|
+
export declare const mathWithUnits: (values: ValueTypes | ValueTypes[], // Can accept a single input or array of inputs
|
|
12
|
+
callback: (...args: number[]) => number, // Can be multiplication, division, addition, etc.
|
|
13
|
+
unit?: string) => string;
|
|
12
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseEuiTheme } from '../../services/theme/types';
|
|
2
2
|
export declare const getBorderSide: (side: BorderSides) => string;
|
|
3
|
-
export
|
|
3
|
+
export type BorderSides = 'left' | 'right' | 'top' | 'bottom' | 'horizontal' | 'vertical' | 'all';
|
|
4
4
|
/**
|
|
5
5
|
* Defines styles for floating boarders applied in DARK mode via EUI shadow utils
|
|
6
6
|
*/
|
|
@@ -16,38 +16,38 @@ export interface EuiShadowOptions {
|
|
|
16
16
|
/**
|
|
17
17
|
* x-small shadow
|
|
18
18
|
*/
|
|
19
|
-
export declare const euiShadowXSmall: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
19
|
+
export declare const euiShadowXSmall: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
20
20
|
/**
|
|
21
21
|
* small shadow
|
|
22
22
|
*/
|
|
23
|
-
export declare const euiShadowSmall: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
23
|
+
export declare const euiShadowSmall: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
24
24
|
/**
|
|
25
25
|
* medium shadow
|
|
26
26
|
*/
|
|
27
|
-
export declare const euiShadowMedium: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
27
|
+
export declare const euiShadowMedium: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
28
28
|
/**
|
|
29
29
|
* large shadow
|
|
30
30
|
*/
|
|
31
|
-
export declare const euiShadowLarge: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
31
|
+
export declare const euiShadowLarge: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
32
32
|
/**
|
|
33
33
|
* x-large shadow
|
|
34
34
|
*/
|
|
35
35
|
export interface EuiShadowXLarge extends EuiShadowOptions {
|
|
36
36
|
reverse?: boolean;
|
|
37
37
|
}
|
|
38
|
-
export declare const euiShadowXLarge: (euiThemeContext: UseEuiTheme, options?: EuiShadowXLarge
|
|
38
|
+
export declare const euiShadowXLarge: (euiThemeContext: UseEuiTheme, options?: EuiShadowXLarge) => string;
|
|
39
39
|
/**
|
|
40
40
|
* flat shadow
|
|
41
41
|
* @deprecated - use euiShadowHover instead
|
|
42
42
|
*/
|
|
43
|
-
export declare const euiSlightShadowHover: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
43
|
+
export declare const euiSlightShadowHover: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
44
44
|
/**
|
|
45
45
|
* @deprecated - use euiShadowXSmall instead
|
|
46
46
|
*
|
|
47
47
|
* Similar to shadow medium but without the bottom depth.
|
|
48
48
|
* Useful for popovers that drop UP rather than DOWN.
|
|
49
49
|
*/
|
|
50
|
-
export declare const euiShadowFlat: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions
|
|
51
|
-
export declare const euiShadow: (euiThemeContext: UseEuiTheme, size?: _EuiThemeShadowSize, options?: EuiShadowOptions
|
|
50
|
+
export declare const euiShadowFlat: (euiThemeContext: UseEuiTheme, options?: EuiShadowOptions) => string;
|
|
51
|
+
export declare const euiShadow: (euiThemeContext: UseEuiTheme, size?: _EuiThemeShadowSize, options?: EuiShadowOptions) => string;
|
|
52
52
|
/** Hover shadows */
|
|
53
|
-
export declare const euiShadowHover: (euiThemeContext: UseEuiTheme, size?: _EuiThemeShadowSize |
|
|
53
|
+
export declare const euiShadowHover: (euiThemeContext: UseEuiTheme, size?: _EuiThemeShadowSize | "base", options?: EuiShadowOptions) => string;
|
|
@@ -13,8 +13,8 @@ export declare const euiCantAnimate = "@media screen and (prefers-reduced-motion
|
|
|
13
13
|
* Speeds / Durations / Delays
|
|
14
14
|
*/
|
|
15
15
|
export declare const EuiThemeAnimationSpeeds: readonly ["extraFast", "fast", "normal", "slow", "extraSlow"];
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type _EuiThemeAnimationSpeed = (typeof EuiThemeAnimationSpeeds)[number];
|
|
17
|
+
export type _EuiThemeAnimationSpeeds = {
|
|
18
18
|
/** - Default value: 90ms */
|
|
19
19
|
extraFast: CSSProperties['animationDuration'];
|
|
20
20
|
/** - Default value: 150ms */
|
|
@@ -30,6 +30,6 @@ export declare type _EuiThemeAnimationSpeeds = {
|
|
|
30
30
|
* Easings / Timing functions
|
|
31
31
|
*/
|
|
32
32
|
export declare const EuiThemeAnimationEasings: readonly ["bounce", "resistance"];
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
33
|
+
export type _EuiThemeAnimationEasing = (typeof EuiThemeAnimationEasings)[number];
|
|
34
|
+
export type _EuiThemeAnimationEasings = Record<_EuiThemeAnimationEasing, CSSProperties['animationTimingFunction']>;
|
|
35
|
+
export type _EuiThemeAnimation = _EuiThemeAnimationEasings & _EuiThemeAnimationSpeeds;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const EuiThemeBreakpoints: readonly ["xs", "s", "m", "l", "xl"];
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type _EuiThemeBreakpoint = string;
|
|
3
|
+
export type _EuiThemeBreakpoints = Record<_EuiThemeBreakpoint, number> & {
|
|
4
4
|
/** - Default value: 0 */
|
|
5
5
|
xs: number;
|
|
6
6
|
/** - Default value: 575 */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ColorModeSwitch, StrictColorModeSwitch } from '../../services/theme/types';
|
|
2
|
-
export
|
|
2
|
+
export type _EuiThemeButtonColors = {
|
|
3
3
|
backgroundPrimary: ColorModeSwitch;
|
|
4
4
|
backgroundAccent: ColorModeSwitch;
|
|
5
5
|
backgroundAccentSecondary: ColorModeSwitch;
|
|
@@ -95,4 +95,4 @@ export declare type _EuiThemeButtonColors = {
|
|
|
95
95
|
textColorFilledText: ColorModeSwitch;
|
|
96
96
|
textColorFilledDisabled: ColorModeSwitch;
|
|
97
97
|
};
|
|
98
|
-
export
|
|
98
|
+
export type _EuiThemeButton = StrictColorModeSwitch<_EuiThemeButtonColors> & {};
|
|
@@ -2,7 +2,7 @@ import { ColorModeSwitch, StrictColorModeSwitch } from '../../services/theme/typ
|
|
|
2
2
|
/**
|
|
3
3
|
* Top 5 colors
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type _EuiThemeBrandColors = {
|
|
6
6
|
/**
|
|
7
7
|
* Main brand color and used for most **call to actions** like buttons and links.
|
|
8
8
|
*/
|
|
@@ -31,7 +31,7 @@ export declare type _EuiThemeBrandColors = {
|
|
|
31
31
|
/**
|
|
32
32
|
* Every brand color must have a contrast computed text equivelant
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type _EuiThemeBrandTextColors = {
|
|
35
35
|
/**
|
|
36
36
|
* Typically computed against `colors.primary`
|
|
37
37
|
* @deprecated - use `textPrimary` instead
|
|
@@ -66,7 +66,7 @@ export declare type _EuiThemeBrandTextColors = {
|
|
|
66
66
|
textRisk: ColorModeSwitch;
|
|
67
67
|
textDanger: ColorModeSwitch;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type _EuiThemeShadeColors = {
|
|
70
70
|
/**
|
|
71
71
|
* Used as the background color of primary **page content and panels** including modals and flyouts.
|
|
72
72
|
* @deprecated - use specific semantic color tokens instead
|
|
@@ -103,7 +103,7 @@ export declare type _EuiThemeShadeColors = {
|
|
|
103
103
|
*/
|
|
104
104
|
fullShade: ColorModeSwitch;
|
|
105
105
|
};
|
|
106
|
-
export
|
|
106
|
+
export type _EuiThemeTextColors = {
|
|
107
107
|
/**
|
|
108
108
|
* Computed against `colors.darkestShade`
|
|
109
109
|
* @deprecated - use `textParagraph` instead
|
|
@@ -128,8 +128,10 @@ export declare type _EuiThemeTextColors = {
|
|
|
128
128
|
textSubdued: ColorModeSwitch;
|
|
129
129
|
textDisabled: ColorModeSwitch;
|
|
130
130
|
textInverse: ColorModeSwitch;
|
|
131
|
+
textInk: ColorModeSwitch;
|
|
132
|
+
textGhost: ColorModeSwitch;
|
|
131
133
|
};
|
|
132
|
-
export
|
|
134
|
+
export type _EuiThemeSpecialColors = {
|
|
133
135
|
/**
|
|
134
136
|
* The background color for the **whole window (body)** and is a computed value of `colors.lightestShade`.
|
|
135
137
|
* Provides denominator (background) value for **contrast calculations**.
|
|
@@ -156,7 +158,7 @@ export declare type _EuiThemeSpecialColors = {
|
|
|
156
158
|
*/
|
|
157
159
|
shadow: ColorModeSwitch;
|
|
158
160
|
};
|
|
159
|
-
export
|
|
161
|
+
export type _EuiThemeBackgroundColors = {
|
|
160
162
|
backgroundBasePrimary: ColorModeSwitch;
|
|
161
163
|
backgroundBaseAccent: ColorModeSwitch;
|
|
162
164
|
backgroundBaseAccentSecondary: ColorModeSwitch;
|
|
@@ -197,7 +199,7 @@ export declare type _EuiThemeBackgroundColors = {
|
|
|
197
199
|
backgroundFilledText: ColorModeSwitch;
|
|
198
200
|
};
|
|
199
201
|
/** TODO: remove once usages are re-mapped */
|
|
200
|
-
export
|
|
202
|
+
export type _EuiThemeTransparentBackgroundColors = {
|
|
201
203
|
/** @deprecated - temp. token, was never in use */
|
|
202
204
|
backgroundTransparent: string;
|
|
203
205
|
/** @deprecated - temp. token, was never in use */
|
|
@@ -223,7 +225,7 @@ export declare type _EuiThemeTransparentBackgroundColors = {
|
|
|
223
225
|
/** @deprecated - temp. token, was never in use */
|
|
224
226
|
backgroundTransparentPlain: ColorModeSwitch;
|
|
225
227
|
};
|
|
226
|
-
export
|
|
228
|
+
export type _EuiThemeBorderColors = {
|
|
227
229
|
borderBasePrimary: ColorModeSwitch;
|
|
228
230
|
borderBaseAccent: ColorModeSwitch;
|
|
229
231
|
borderBaseAccentSecondary: ColorModeSwitch;
|
|
@@ -255,7 +257,7 @@ export declare type _EuiThemeBorderColors = {
|
|
|
255
257
|
borderStrongDanger: ColorModeSwitch;
|
|
256
258
|
borderStrongText: ColorModeSwitch;
|
|
257
259
|
};
|
|
258
|
-
export
|
|
260
|
+
export type _EuiThemeVisColors = {
|
|
259
261
|
euiColorVis0: string;
|
|
260
262
|
euiColorVis1: string;
|
|
261
263
|
euiColorVis2: string;
|
|
@@ -320,7 +322,7 @@ export declare type _EuiThemeVisColors = {
|
|
|
320
322
|
euiColorVisComplementary0: string;
|
|
321
323
|
euiColorVisComplementary1: string;
|
|
322
324
|
};
|
|
323
|
-
export
|
|
325
|
+
export type _EuiThemeSeverityColors = {
|
|
324
326
|
unknown: string;
|
|
325
327
|
success: string;
|
|
326
328
|
neutral: string;
|
|
@@ -328,14 +330,12 @@ export declare type _EuiThemeSeverityColors = {
|
|
|
328
330
|
risk: string;
|
|
329
331
|
danger: string;
|
|
330
332
|
};
|
|
331
|
-
export
|
|
332
|
-
ghost: string;
|
|
333
|
-
ink: string;
|
|
333
|
+
export type _EuiThemeConstantColors = {
|
|
334
334
|
plainLight: string;
|
|
335
335
|
plainDark: string;
|
|
336
336
|
};
|
|
337
|
-
export
|
|
338
|
-
export
|
|
337
|
+
export type _EuiThemeColorsMode = _EuiThemeBrandColors & _EuiThemeBrandTextColors & _EuiThemeShadeColors & _EuiThemeSpecialColors & _EuiThemeTextColors & _EuiThemeBackgroundColors & _EuiThemeTransparentBackgroundColors & _EuiThemeBorderColors;
|
|
338
|
+
export type _EuiThemeColors = StrictColorModeSwitch<_EuiThemeColorsMode & {
|
|
339
339
|
vis: _EuiThemeVisColors;
|
|
340
340
|
severity: _EuiThemeSeverityColors;
|
|
341
341
|
}> & _EuiThemeConstantColors;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorModeSwitch, StrictColorModeSwitch } from '../../services/theme/types';
|
|
2
2
|
import { _EuiThemeButton } from './buttons';
|
|
3
3
|
import { _EuiThemeForm, _EuiThemeFormColors } from './forms';
|
|
4
|
-
export
|
|
4
|
+
export type _EuiThemeComponentColors = {
|
|
5
5
|
badgeBackground: ColorModeSwitch;
|
|
6
6
|
badgeBackgroundSubdued: ColorModeSwitch;
|
|
7
7
|
badgeBorderColorHollow: ColorModeSwitch;
|
|
@@ -87,7 +87,6 @@ export declare type _EuiThemeComponentColors = {
|
|
|
87
87
|
sideNavItemEmphasizedBackground: ColorModeSwitch;
|
|
88
88
|
selectableListItemBorderColor: ColorModeSwitch;
|
|
89
89
|
skeletonBackgroundSkeletonMiddleHighContrast: ColorModeSwitch;
|
|
90
|
-
superDatePickerBackgroundSuccees: ColorModeSwitch;
|
|
91
90
|
switchBackgroundOn: ColorModeSwitch;
|
|
92
91
|
switchBackgroundOff: ColorModeSwitch;
|
|
93
92
|
switchUncompressedBackgroundDisabled: ColorModeSwitch;
|
|
@@ -110,9 +109,11 @@ export declare type _EuiThemeComponentColors = {
|
|
|
110
109
|
tooltipBorder: ColorModeSwitch;
|
|
111
110
|
tooltipBorderFloating: ColorModeSwitch;
|
|
112
111
|
tourFooterBackground: ColorModeSwitch;
|
|
112
|
+
tourStepIndicatorInactiveColor: ColorModeSwitch;
|
|
113
|
+
tourStepIndicatorActiveColor: ColorModeSwitch;
|
|
113
114
|
treeViewItemBackgroundHover: ColorModeSwitch;
|
|
114
115
|
};
|
|
115
|
-
export
|
|
116
|
+
export type _EuiThemeComponents = {
|
|
116
117
|
buttons: _EuiThemeButton;
|
|
117
118
|
forms: _EuiThemeForm & StrictColorModeSwitch<_EuiThemeFormColors>;
|
|
118
119
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EuiThemeVariantFlags = {
|
|
2
2
|
shadowVariant: 'classic' | 'refresh';
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
5
|
* Theme specific setting flags
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type _EuiThemeFlags = EuiThemeVariantFlags;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ColorModeSwitch } from '../../services/theme/types';
|
|
2
|
-
export
|
|
2
|
+
export type _EuiThemeForm = {
|
|
3
3
|
maxWidth: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type _EuiThemeFormColors = {
|
|
6
6
|
background: ColorModeSwitch;
|
|
7
7
|
backgroundDisabled: ColorModeSwitch;
|
|
8
8
|
backgroundReadOnly: ColorModeSwitch;
|
|
@@ -15,8 +15,8 @@ import { CSSProperties } from 'react';
|
|
|
15
15
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context
|
|
16
16
|
*/
|
|
17
17
|
export declare const EuiThemeLevels: readonly ["toast", "modal", "mask", "navigation", "menu", "header", "flyout", "maskBelowHeader", "content"];
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type _EuiThemeLevel = (typeof EuiThemeLevels)[number];
|
|
19
|
+
export type _EuiThemeLevels = {
|
|
20
20
|
/** - Default value: 9000 */
|
|
21
21
|
toast: NonNullable<CSSProperties['zIndex']>;
|
|
22
22
|
/** - Default value: 8000 */
|
|
@@ -3,6 +3,6 @@ import { EUI_THEME_HIGH_CONTRAST_MODE_KEY, type EuiThemeShapeBase } from '../../
|
|
|
3
3
|
/**
|
|
4
4
|
* Theme specific conditional overrides, e.g. for high contrast mode
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type _EuiThemeOverrides = {
|
|
7
7
|
[EUI_THEME_HIGH_CONTRAST_MODE_KEY]: RecursivePartial<EuiThemeShapeBase>;
|
|
8
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { ColorModeSwitch } from '../../services/theme/types';
|
|
3
3
|
export declare const EuiThemeShadowSizes: readonly ["xs", "s", "m", "l", "xl"];
|
|
4
|
-
export
|
|
4
|
+
export type _EuiThemeShadowSize = (typeof EuiThemeShadowSizes)[number];
|
|
5
5
|
export declare const EuiThemeShadowHoverSizes: readonly ["s", "m", "l", "xl", "xxl"];
|
|
6
|
-
export
|
|
6
|
+
export type _EuiThemeShadowHoverSize = (typeof EuiThemeShadowHoverSizes)[number];
|
|
7
7
|
/**
|
|
8
8
|
* Shadow t-shirt sizes descriptions
|
|
9
9
|
*/
|
|
@@ -13,13 +13,13 @@ export interface _EuiThemeShadowCustomColor {
|
|
|
13
13
|
property?: 'box-shadow' | 'filter';
|
|
14
14
|
borderAllInHighContrastMode?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type _EuiThemeShadow = {
|
|
17
17
|
/** Default direction of the shadow */
|
|
18
18
|
down: CSSProperties['boxShadow'];
|
|
19
19
|
/** Reverse direction */
|
|
20
20
|
up: CSSProperties['boxShadow'];
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type _EuiThemeShadows = ColorModeSwitch<{
|
|
23
23
|
colors: {
|
|
24
24
|
base: string;
|
|
25
25
|
};
|
|
@@ -41,18 +41,18 @@ export declare type _EuiThemeShadows = ColorModeSwitch<{
|
|
|
41
41
|
* Represents a single shadow
|
|
42
42
|
* @see https://tr.designtokens.org/format/#shadow
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type _EuiThemeShadowLayer = {
|
|
45
45
|
opacity: number;
|
|
46
46
|
x: number;
|
|
47
47
|
y: number;
|
|
48
48
|
blur: number;
|
|
49
49
|
spread: number;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type _EuiThemeShadowPrimitive = {
|
|
52
52
|
light: _EuiThemeShadowLayer[];
|
|
53
53
|
dark: _EuiThemeShadowLayer[];
|
|
54
54
|
};
|
|
55
|
-
export
|
|
55
|
+
export type _EuiThemeShadowPrimitives = {
|
|
56
56
|
xs: _EuiThemeShadowPrimitive;
|
|
57
57
|
s: _EuiThemeShadowPrimitive;
|
|
58
58
|
m: _EuiThemeShadowPrimitive;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type _EuiThemeBase = number;
|
|
2
2
|
export declare const EuiThemeSizes: readonly ["xxs", "xs", "s", "m", "base", "l", "xl", "xxl", "xxxl", "xxxxl"];
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type _EuiThemeSize = (typeof EuiThemeSizes)[number];
|
|
4
|
+
export type _EuiThemeSizes = {
|
|
5
5
|
/** - Default value: 2px */
|
|
6
6
|
xxs: string;
|
|
7
7
|
/** - Default value: 4px */
|
|
@@ -3,11 +3,11 @@ import { CSSProperties } from 'react';
|
|
|
3
3
|
* Font units of measure
|
|
4
4
|
*/
|
|
5
5
|
export declare const EuiThemeFontUnits: readonly ["rem", "px", "em"];
|
|
6
|
-
export
|
|
6
|
+
export type _EuiThemeFontUnit = (typeof EuiThemeFontUnits)[number];
|
|
7
7
|
export declare const EuiThemeFontScales: readonly ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl"];
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
8
|
+
export type _EuiThemeFontScale = (typeof EuiThemeFontScales)[number];
|
|
9
|
+
export type _EuiThemeFontScales = Record<_EuiThemeFontScale, number>;
|
|
10
|
+
export type _EuiThemeFontBase = {
|
|
11
11
|
/**
|
|
12
12
|
* The whole font family stack for all parts of the UI.
|
|
13
13
|
* We encourage only customizing the first font in the stack.
|
|
@@ -46,17 +46,17 @@ export declare type _EuiThemeFontBase = {
|
|
|
46
46
|
lineHeightMultiplier: number;
|
|
47
47
|
};
|
|
48
48
|
export declare const EuiThemeFontWeights: readonly ["light", "regular", "medium", "semiBold", "bold"];
|
|
49
|
-
export
|
|
50
|
-
export
|
|
49
|
+
export type _EuiThemeFontWeight = (typeof EuiThemeFontWeights)[number];
|
|
50
|
+
export type _EuiThemeFontWeights = {
|
|
51
51
|
/** - Default value: 300 */
|
|
52
52
|
light: CSSProperties['fontWeight'];
|
|
53
53
|
/** - Default value: 400 */
|
|
54
54
|
regular: CSSProperties['fontWeight'];
|
|
55
|
-
/** - Default value:
|
|
55
|
+
/** - Default value: 450 */
|
|
56
56
|
medium: CSSProperties['fontWeight'];
|
|
57
|
-
/** - Default value:
|
|
57
|
+
/** - Default value: 500 */
|
|
58
58
|
semiBold: CSSProperties['fontWeight'];
|
|
59
|
-
/** - Default value:
|
|
59
|
+
/** - Default value: 600 */
|
|
60
60
|
bold: CSSProperties['fontWeight'];
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
@@ -81,7 +81,7 @@ export interface _EuiThemeTitle {
|
|
|
81
81
|
*/
|
|
82
82
|
weight: keyof _EuiThemeFontWeights;
|
|
83
83
|
}
|
|
84
|
-
export
|
|
84
|
+
export type _EuiThemeFont = _EuiThemeFontBase & {
|
|
85
85
|
scale: _EuiThemeFontScales;
|
|
86
86
|
/**
|
|
87
87
|
* See {@link https://eui.elastic.co/docs/getting-started/theming/tokens/typography/font-weight/ | Reference} for more information
|
|
@@ -17,20 +17,20 @@ export declare const COLOR_MODES_STANDARD: {
|
|
|
17
17
|
readonly dark: "DARK";
|
|
18
18
|
};
|
|
19
19
|
export declare const COLOR_MODES_INVERSE: "INVERSE";
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
20
|
+
export type EuiThemeColorModeInverse = typeof COLOR_MODES_INVERSE;
|
|
21
|
+
export type EuiThemeColorModeStandard = ValueOf<typeof COLOR_MODES_STANDARD>;
|
|
22
|
+
export type EuiThemeColorMode = 'light' | 'dark' | EuiThemeColorModeStandard | 'inverse' | EuiThemeColorModeInverse;
|
|
23
|
+
export type ColorModeSwitch<T = string> = {
|
|
24
24
|
[key in EuiThemeColorModeStandard]: T;
|
|
25
25
|
} | T;
|
|
26
|
-
export
|
|
26
|
+
export type StrictColorModeSwitch<T = string> = {
|
|
27
27
|
[key in EuiThemeColorModeStandard]: T;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
30
|
-
export
|
|
29
|
+
export type EuiThemeHighContrastModeProp = boolean;
|
|
30
|
+
export type EuiThemeHighContrastMode = 'forced' | 'preferred' | false;
|
|
31
31
|
export declare const EUI_THEME_HIGH_CONTRAST_MODE_KEY: "HCM";
|
|
32
32
|
export declare const EUI_THEME_OVERRIDES_KEY: "overrides";
|
|
33
|
-
export
|
|
33
|
+
export type EuiThemeShapeBase = {
|
|
34
34
|
colors: _EuiThemeColors;
|
|
35
35
|
/** - Default value: 16 */
|
|
36
36
|
base: _EuiThemeBase;
|
|
@@ -48,24 +48,24 @@ export declare type EuiThemeShapeBase = {
|
|
|
48
48
|
components: _EuiThemeComponents;
|
|
49
49
|
flags: _EuiThemeFlags;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type EuiThemeShape = EuiThemeShapeBase & {
|
|
52
52
|
overrides?: _EuiThemeOverrides;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type EuiThemeSystem<T = {}> = {
|
|
55
55
|
root: EuiThemeShape & T;
|
|
56
56
|
model: EuiThemeShape & T;
|
|
57
57
|
key: string;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
60
|
-
export
|
|
59
|
+
export type EuiThemeModifications<T = {}> = RecursivePartial<EuiThemeShape & T>;
|
|
60
|
+
export type ComputedThemeShape<T, P = string | number | bigint | boolean | null | undefined> = T extends P | ColorModeSwitch<infer X> ? T extends ColorModeSwitch<X> ? X extends P ? X : {
|
|
61
61
|
[K in keyof (X & Exclude<T, keyof X | keyof StrictColorModeSwitch>)]: ComputedThemeShape<(X & Exclude<T, keyof X | keyof StrictColorModeSwitch>)[K], P>;
|
|
62
62
|
} : T : {
|
|
63
63
|
[K in keyof T]: ComputedThemeShape<T[K], P>;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export type EuiThemeComputed<T = {}> = ComputedThemeShape<EuiThemeShape & T> & {
|
|
66
66
|
themeName: string;
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type EuiThemeNested = {
|
|
69
69
|
isGlobalTheme: boolean;
|
|
70
70
|
hasDifferentColorFromGlobalTheme: boolean;
|
|
71
71
|
bodyColor: string;
|
|
@@ -2,9 +2,9 @@ import { _EuiThemeVisColors } from '../global_styling';
|
|
|
2
2
|
export declare const VIS_COLOR_STORE_EVENTS: {
|
|
3
3
|
readonly UPDATE: "UPDATE";
|
|
4
4
|
};
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export
|
|
5
|
+
export type VisColorStoreEvents = keyof typeof VIS_COLOR_STORE_EVENTS;
|
|
6
|
+
type EventId = string;
|
|
7
|
+
export type _EuiVisColorStore = {
|
|
8
8
|
visColors: _EuiThemeVisColors;
|
|
9
9
|
setVisColors: (colors: _EuiThemeVisColors) => void;
|
|
10
10
|
subscribe: (eventName: VisColorStoreEvents, callback: any) => EventId;
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ValueOf<typeof {key1: 'value1', key2: 'value2'}>
|
|
4
4
|
* Results in `'value1' | 'value2'`
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type ValueOf<T> = T[keyof T];
|
|
7
7
|
/**
|
|
8
8
|
* Replaces all properties on any type as optional, includes nested types
|
|
9
9
|
*
|
|
@@ -25,8 +25,8 @@ export declare type ValueOf<T> = T[keyof T];
|
|
|
25
25
|
* }
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type RecursivePartial<T> = {
|
|
29
29
|
[P in keyof T]?: T[P] extends NonAny[] ? T[P] : T[P] extends readonly NonAny[] ? T[P] : T[P] extends Array<infer U> ? Array<RecursivePartial<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<RecursivePartial<U>> : T[P] extends Set<infer V> ? Set<RecursivePartial<V>> : T[P] extends Map<infer K, infer V> ? Map<K, RecursivePartial<V>> : T[P] extends NonAny ? T[P] : RecursivePartial<T[P]>;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
type NonAny = number | boolean | string | symbol | null;
|
|
32
32
|
export {};
|
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { EuiThemeColorMode, EuiThemeColorModeStandard, EuiThemeSystem, EuiThemeShape, EuiThemeComputed, _EuiThemeShadowLayer, EuiThemeHighContrastMode } from './global_styling';
|
|
1
|
+
import { EuiThemeColorMode, EuiThemeColorModeInverse, EuiThemeColorModeStandard, EuiThemeModifications, EuiThemeSystem, EuiThemeShape, EuiThemeComputed, _EuiThemeShadowLayer, EuiThemeHighContrastMode } from './global_styling';
|
|
2
2
|
export declare const DEFAULT_COLOR_MODE: "LIGHT";
|
|
3
3
|
/**
|
|
4
4
|
* Returns whether the provided color mode is `inverse`
|
|
5
5
|
* @param {string} colorMode - `light`, `dark`, or `inverse`
|
|
6
6
|
*/
|
|
7
|
-
export declare const isInverseColorMode: (colorMode?: string
|
|
7
|
+
export declare const isInverseColorMode: (colorMode?: string) => colorMode is EuiThemeColorModeInverse;
|
|
8
8
|
/**
|
|
9
9
|
* Returns the color mode configured in the current EuiThemeProvider.
|
|
10
10
|
* Returns the parent color mode if none is explicity set.
|
|
@@ -12,7 +12,7 @@ export declare const isInverseColorMode: (colorMode?: string | undefined) => col
|
|
|
12
12
|
* @param {string} parentColorMode - `LIGHT` or `DARK`; used as the fallback
|
|
13
13
|
* @param {boolean} isForced
|
|
14
14
|
*/
|
|
15
|
-
export declare const getColorMode: (colorMode?: EuiThemeColorMode
|
|
15
|
+
export declare const getColorMode: (colorMode?: EuiThemeColorMode, parentColorMode?: EuiThemeColorModeStandard, isForced?: boolean) => EuiThemeColorModeStandard;
|
|
16
16
|
/**
|
|
17
17
|
* Returns a value at a given path on an object.
|
|
18
18
|
* If `colorMode` is provided, will scope the value to the appropriate color mode key (LIGHT\DARK)
|
|
@@ -22,7 +22,7 @@ export declare const getColorMode: (colorMode?: EuiThemeColorMode | undefined, p
|
|
|
22
22
|
*/
|
|
23
23
|
export declare const getOn: (model: {
|
|
24
24
|
[key: string]: any;
|
|
25
|
-
}, _path: string, colorMode?: EuiThemeColorModeStandard
|
|
25
|
+
}, _path: string, colorMode?: EuiThemeColorModeStandard) => {
|
|
26
26
|
[key: string]: any;
|
|
27
27
|
} | undefined;
|
|
28
28
|
/**
|
|
@@ -53,9 +53,7 @@ export declare class Computed<T> {
|
|
|
53
53
|
* @param {object} working - Partially computed theme
|
|
54
54
|
* @param {string} colorMode - `light` or `dark`
|
|
55
55
|
*/
|
|
56
|
-
getValue(base: EuiThemeSystem | EuiThemeShape | null, modifications:
|
|
57
|
-
overrides?: import("./global_styling")._EuiThemeOverrides | undefined;
|
|
58
|
-
}> | undefined, working: Partial<EuiThemeComputed>, colorMode?: EuiThemeColorModeStandard): T;
|
|
56
|
+
getValue(base: EuiThemeSystem | EuiThemeShape | null, modifications: EuiThemeModifications | undefined, working: Partial<EuiThemeComputed>, colorMode?: EuiThemeColorModeStandard): T;
|
|
59
57
|
}
|
|
60
58
|
/**
|
|
61
59
|
* Returns a Class (`Computed`) that stores the arbitrary computer method
|
|
@@ -75,7 +73,7 @@ export declare function computed<T>(computer: (value: any) => T, dependencies: s
|
|
|
75
73
|
* @param {Proxy | object} over - Unique identifier or name
|
|
76
74
|
* @param {string} colorMode - `light` or `dark`
|
|
77
75
|
*/
|
|
78
|
-
export declare const getComputed: <T = EuiThemeShape>(base: EuiThemeSystem<T>, over: Partial<EuiThemeSystem<T>>, colorMode: EuiThemeColorModeStandard, highContrastMode?: EuiThemeHighContrastMode
|
|
76
|
+
export declare const getComputed: <T = EuiThemeShape>(base: EuiThemeSystem<T>, over: Partial<EuiThemeSystem<T>>, colorMode: EuiThemeColorModeStandard, highContrastMode?: EuiThemeHighContrastMode) => EuiThemeComputed<T>;
|
|
79
77
|
/**
|
|
80
78
|
* Builds a Proxy with a custom `handler` designed to self-reference values
|
|
81
79
|
* and prevent arbitrary value overrides.
|
|
@@ -103,7 +101,7 @@ export declare const mergeDeep: (_target: {
|
|
|
103
101
|
* Returns token name string based on passed dynamic variants
|
|
104
102
|
* and additional prefix/suffix
|
|
105
103
|
*/
|
|
106
|
-
export declare const getTokenName: (prefix: string, variant?: string
|
|
104
|
+
export declare const getTokenName: (prefix: string, variant?: string, suffix?: string) => string;
|
|
107
105
|
/**
|
|
108
106
|
* Format an array of shadow "objects" into a string for CSS.
|
|
109
107
|
* The "up" direction is built by making the y offset from layers
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
8
8
|
* mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
export declare const mathWithUnits: (values: ValueTypes | ValueTypes[],
|
|
10
|
+
type ValueTypes = string | number | undefined;
|
|
11
|
+
export declare const mathWithUnits: (values: ValueTypes | ValueTypes[], // Can accept a single input or array of inputs
|
|
12
|
+
callback: (...args: number[]) => number, // Can be multiplication, division, addition, etc.
|
|
13
|
+
unit?: string) => string;
|
|
12
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseEuiTheme } from '../../services/theme/types';
|
|
2
2
|
export declare const getBorderSide: (side: BorderSides) => string;
|
|
3
|
-
export
|
|
3
|
+
export type BorderSides = 'left' | 'right' | 'top' | 'bottom' | 'horizontal' | 'vertical' | 'all';
|
|
4
4
|
/**
|
|
5
5
|
* Defines styles for floating boarders applied in DARK mode via EUI shadow utils
|
|
6
6
|
*/
|