@elastic/eui-theme-common 5.0.0 → 7.0.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.
Files changed (29) hide show
  1. package/lib/cjs/global_styling/mixins/shadow.d.ts +0 -1
  2. package/lib/cjs/global_styling/mixins/shadow.js +0 -1
  3. package/lib/cjs/global_styling/variables/borders.d.ts +1 -1
  4. package/lib/cjs/global_styling/variables/colors.d.ts +2 -1
  5. package/lib/cjs/global_styling/variables/components.d.ts +0 -1
  6. package/lib/cjs/global_styling/variables/flags.d.ts +1 -6
  7. package/lib/cjs/services/theme/types.d.ts +5 -0
  8. package/lib/cjs/services/vis_color_store.d.ts +3 -7
  9. package/lib/cjs/services/vis_color_store.js +4 -15
  10. package/lib/cjs/services/vis_color_store.test.js +1 -5
  11. package/lib/esm/global_styling/mixins/shadow.d.ts +0 -1
  12. package/lib/esm/global_styling/mixins/shadow.js +0 -1
  13. package/lib/esm/global_styling/variables/borders.d.ts +1 -1
  14. package/lib/esm/global_styling/variables/colors.d.ts +2 -1
  15. package/lib/esm/global_styling/variables/components.d.ts +0 -1
  16. package/lib/esm/global_styling/variables/flags.d.ts +1 -6
  17. package/lib/esm/services/theme/types.d.ts +5 -0
  18. package/lib/esm/services/vis_color_store.d.ts +3 -7
  19. package/lib/esm/services/vis_color_store.js +3 -12
  20. package/lib/esm/services/vis_color_store.test.js +1 -5
  21. package/package.json +1 -1
  22. package/src/global_styling/mixins/_index.scss +0 -6
  23. package/src/global_styling/mixins/_states.scss +1 -1
  24. package/src/global_styling/mixins/_button.scss +0 -149
  25. package/src/global_styling/mixins/_form.scss +0 -272
  26. package/src/global_styling/mixins/_link.scss +0 -11
  27. package/src/global_styling/mixins/_loading.scss +0 -6
  28. package/src/global_styling/mixins/_panel.scss +0 -55
  29. package/src/global_styling/mixins/_range.scss +0 -59
@@ -44,7 +44,6 @@ export declare const euiSlightShadowHover: (euiThemeContext: UseEuiTheme, option
44
44
  /**
45
45
  * @deprecated - use euiShadowXSmall instead
46
46
  *
47
- * Remains for backwards compatibility for the Amsterdam theme.
48
47
  * Similar to shadow medium but without the bottom depth.
49
48
  * Useful for popovers that drop UP rather than DOWN.
50
49
  */
@@ -122,7 +122,6 @@ var euiSlightShadowHover = exports.euiSlightShadowHover = function euiSlightShad
122
122
  /**
123
123
  * @deprecated - use euiShadowXSmall instead
124
124
  *
125
- * Remains for backwards compatibility for the Amsterdam theme.
126
125
  * Similar to shadow medium but without the bottom depth.
127
126
  * Useful for popovers that drop UP rather than DOWN.
128
127
  */
@@ -15,7 +15,7 @@ export interface _EuiThemeBorderWidthValues {
15
15
  export interface _EuiThemeBorderRadiusValues {
16
16
  /**
17
17
  * Primary corner radius size
18
- * - Default value: 4px (6px in Amsterdam)
18
+ * - Default value: 4px
19
19
  */
20
20
  medium: CSSProperties['borderRadius'];
21
21
  /**
@@ -234,6 +234,7 @@ export declare type _EuiThemeBorderColors = {
234
234
  borderBaseDanger: ColorModeSwitch;
235
235
  borderBasePlain: ColorModeSwitch;
236
236
  borderBaseSubdued: ColorModeSwitch;
237
+ borderBaseProminent: ColorModeSwitch;
237
238
  borderBaseDisabled: ColorModeSwitch;
238
239
  /**
239
240
  * Border used for floating elements on dark mode (e.g. popovers or tooltips)
@@ -241,8 +242,8 @@ export declare type _EuiThemeBorderColors = {
241
242
  */
242
243
  borderBaseFloating: ColorModeSwitch;
243
244
  borderBaseFormsColorSwatch: ColorModeSwitch;
244
- borderBaseFormsControl: ColorModeSwitch;
245
245
  borderInteractiveFormsHoverPlain: ColorModeSwitch;
246
+ borderInteractiveFormsHoverProminent: ColorModeSwitch;
246
247
  borderInteractiveFormsHoverDanger: ColorModeSwitch;
247
248
  borderStrongPrimary: ColorModeSwitch;
248
249
  borderStrongAccent: ColorModeSwitch;
@@ -67,7 +67,6 @@ export declare type _EuiThemeComponentColors = {
67
67
  filterSelectItemBackgroundFocusDisabled: ColorModeSwitch;
68
68
  flyoutFooterBackground: ColorModeSwitch;
69
69
  flyoutCloseButtonInsideBackground: ColorModeSwitch;
70
- keyPadMenuItemBackgroundDisabledSelect: ColorModeSwitch;
71
70
  listGroupItemBackgroundPrimaryActive: ColorModeSwitch;
72
71
  listGroupItemBackgroundSubduedActive: ColorModeSwitch;
73
72
  listGroupItemBackgroundHover: ColorModeSwitch;
@@ -1,12 +1,7 @@
1
1
  export declare type EuiThemeVariantFlags = {
2
- buttonVariant: 'classic' | 'refresh';
3
- formVariant: 'classic' | 'refresh';
4
2
  shadowVariant: 'classic' | 'refresh';
5
3
  };
6
4
  /**
7
5
  * Theme specific setting flags
8
6
  */
9
- export declare type _EuiThemeFlags = {
10
- hasGlobalFocusColor: boolean;
11
- hasVisColorAdjustment: boolean;
12
- } & EuiThemeVariantFlags;
7
+ export declare type _EuiThemeFlags = EuiThemeVariantFlags;
@@ -81,3 +81,8 @@ export interface UseEuiTheme<T extends {} = {}> {
81
81
  highContrastMode: EuiThemeHighContrastMode;
82
82
  modifications: EuiThemeModifications<T>;
83
83
  }
84
+ export interface EUI_THEME {
85
+ text: string;
86
+ value: string;
87
+ provider?: EuiThemeSystem;
88
+ }
@@ -6,28 +6,24 @@ export declare type VisColorStoreEvents = keyof typeof VIS_COLOR_STORE_EVENTS;
6
6
  declare type EventId = string;
7
7
  export declare type _EuiVisColorStore = {
8
8
  visColors: _EuiThemeVisColors;
9
- hasVisColorAdjustment: boolean;
10
- setVisColors: (colors: _EuiThemeVisColors, hasVisColorAdjustment?: boolean) => void;
9
+ setVisColors: (colors: _EuiThemeVisColors) => void;
11
10
  subscribe: (eventName: VisColorStoreEvents, callback: any) => EventId;
12
11
  unsubscribe: (eventName: VisColorStoreEvents, id: EventId) => void;
13
12
  };
14
13
  declare class EuiVisColorStoreImpl implements _EuiVisColorStore {
15
14
  private _visColors;
16
- private _hasVisColorAdjustment;
17
15
  private events;
18
16
  constructor(dependencies: {
19
17
  defaultColors: _EuiThemeVisColors;
20
- hasVisColorAdjustment: boolean;
21
18
  });
22
19
  get visColors(): _EuiVisColorStore['visColors'];
23
- get hasVisColorAdjustment(): _EuiVisColorStore['hasVisColorAdjustment'];
24
- setVisColors: (colors: _EuiThemeVisColors, hasColorAdjustment?: boolean | undefined) => void;
20
+ setVisColors: (colors: _EuiThemeVisColors) => void;
25
21
  subscribe: (eventName: VisColorStoreEvents, callback: NonNullable<any>) => string;
26
22
  unsubscribe: (eventName: VisColorStoreEvents, id: EventId) => void;
27
23
  private publishUpdate;
28
24
  }
29
25
  export declare class EuiVisColorStore {
30
26
  private static instance;
31
- static getInstance(defaultColors: _EuiThemeVisColors, hasVisColorAdjustment: boolean): EuiVisColorStoreImpl;
27
+ static getInstance(defaultColors: _EuiThemeVisColors): EuiVisColorStoreImpl;
32
28
  }
33
29
  export {};
@@ -28,14 +28,10 @@ var EuiVisColorStoreImpl = /*#__PURE__*/function () {
28
28
  var _this = this;
29
29
  _classCallCheck(this, EuiVisColorStoreImpl);
30
30
  _defineProperty(this, "_visColors", void 0);
31
- _defineProperty(this, "_hasVisColorAdjustment", void 0);
32
31
  _defineProperty(this, "events", {});
33
- _defineProperty(this, "setVisColors", function (colors, hasColorAdjustment) {
34
- if (!(0, _isEqual["default"])(_this._visColors, colors) || hasColorAdjustment !== _this._hasVisColorAdjustment) {
32
+ _defineProperty(this, "setVisColors", function (colors) {
33
+ if (!(0, _isEqual["default"])(_this._visColors, colors)) {
35
34
  _this._visColors = colors;
36
- if (hasColorAdjustment != null) {
37
- _this._hasVisColorAdjustment = hasColorAdjustment;
38
- }
39
35
  _this.publishUpdate(VIS_COLOR_STORE_EVENTS.UPDATE, _this._visColors);
40
36
  }
41
37
  });
@@ -61,18 +57,12 @@ var EuiVisColorStoreImpl = /*#__PURE__*/function () {
61
57
  });
62
58
  });
63
59
  this._visColors = dependencies.defaultColors;
64
- this._hasVisColorAdjustment = dependencies.hasVisColorAdjustment;
65
60
  }
66
61
  return _createClass(EuiVisColorStoreImpl, [{
67
62
  key: "visColors",
68
63
  get: function get() {
69
64
  return this._visColors;
70
65
  }
71
- }, {
72
- key: "hasVisColorAdjustment",
73
- get: function get() {
74
- return this._hasVisColorAdjustment;
75
- }
76
66
  }]);
77
67
  }();
78
68
  var EuiVisColorStore = exports.EuiVisColorStore = /*#__PURE__*/function () {
@@ -81,11 +71,10 @@ var EuiVisColorStore = exports.EuiVisColorStore = /*#__PURE__*/function () {
81
71
  }
82
72
  return _createClass(EuiVisColorStore, null, [{
83
73
  key: "getInstance",
84
- value: function getInstance(defaultColors, hasVisColorAdjustment) {
74
+ value: function getInstance(defaultColors) {
85
75
  if (!this.instance) {
86
76
  this.instance = new EuiVisColorStoreImpl({
87
- defaultColors: defaultColors,
88
- hasVisColorAdjustment: hasVisColorAdjustment
77
+ defaultColors: defaultColors
89
78
  });
90
79
  }
91
80
  return this.instance;
@@ -18,7 +18,7 @@ var visColors = {
18
18
  euiColorVis0: '#aabbcc'
19
19
  };
20
20
  describe('EuiVisColorStore', function () {
21
- var visColorStore = _vis_color_store.EuiVisColorStore.getInstance(visColors, false);
21
+ var visColorStore = _vis_color_store.EuiVisColorStore.getInstance(visColors);
22
22
  var updateFn;
23
23
  beforeEach(function () {
24
24
  updateFn = jest.fn();
@@ -37,10 +37,6 @@ describe('EuiVisColorStore', function () {
37
37
  visColorStore.setVisColors(customColors);
38
38
  expect(visColorStore.visColors).toEqual(customColors);
39
39
  });
40
- it('updates hasVisColorAdjustment', function () {
41
- visColorStore.setVisColors(customColors, true);
42
- expect(visColorStore.hasVisColorAdjustment).toEqual(true);
43
- });
44
40
  });
45
41
  describe('subcribe and unsubscribe', function () {
46
42
  it('subscribes to store updates', function () {
@@ -44,7 +44,6 @@ export declare const euiSlightShadowHover: (euiThemeContext: UseEuiTheme, option
44
44
  /**
45
45
  * @deprecated - use euiShadowXSmall instead
46
46
  *
47
- * Remains for backwards compatibility for the Amsterdam theme.
48
47
  * Similar to shadow medium but without the bottom depth.
49
48
  * Useful for popovers that drop UP rather than DOWN.
50
49
  */
@@ -95,7 +95,6 @@ export const euiSlightShadowHover = (euiThemeContext, options) => {
95
95
  /**
96
96
  * @deprecated - use euiShadowXSmall instead
97
97
  *
98
- * Remains for backwards compatibility for the Amsterdam theme.
99
98
  * Similar to shadow medium but without the bottom depth.
100
99
  * Useful for popovers that drop UP rather than DOWN.
101
100
  */
@@ -15,7 +15,7 @@ export interface _EuiThemeBorderWidthValues {
15
15
  export interface _EuiThemeBorderRadiusValues {
16
16
  /**
17
17
  * Primary corner radius size
18
- * - Default value: 4px (6px in Amsterdam)
18
+ * - Default value: 4px
19
19
  */
20
20
  medium: CSSProperties['borderRadius'];
21
21
  /**
@@ -234,6 +234,7 @@ export declare type _EuiThemeBorderColors = {
234
234
  borderBaseDanger: ColorModeSwitch;
235
235
  borderBasePlain: ColorModeSwitch;
236
236
  borderBaseSubdued: ColorModeSwitch;
237
+ borderBaseProminent: ColorModeSwitch;
237
238
  borderBaseDisabled: ColorModeSwitch;
238
239
  /**
239
240
  * Border used for floating elements on dark mode (e.g. popovers or tooltips)
@@ -241,8 +242,8 @@ export declare type _EuiThemeBorderColors = {
241
242
  */
242
243
  borderBaseFloating: ColorModeSwitch;
243
244
  borderBaseFormsColorSwatch: ColorModeSwitch;
244
- borderBaseFormsControl: ColorModeSwitch;
245
245
  borderInteractiveFormsHoverPlain: ColorModeSwitch;
246
+ borderInteractiveFormsHoverProminent: ColorModeSwitch;
246
247
  borderInteractiveFormsHoverDanger: ColorModeSwitch;
247
248
  borderStrongPrimary: ColorModeSwitch;
248
249
  borderStrongAccent: ColorModeSwitch;
@@ -67,7 +67,6 @@ export declare type _EuiThemeComponentColors = {
67
67
  filterSelectItemBackgroundFocusDisabled: ColorModeSwitch;
68
68
  flyoutFooterBackground: ColorModeSwitch;
69
69
  flyoutCloseButtonInsideBackground: ColorModeSwitch;
70
- keyPadMenuItemBackgroundDisabledSelect: ColorModeSwitch;
71
70
  listGroupItemBackgroundPrimaryActive: ColorModeSwitch;
72
71
  listGroupItemBackgroundSubduedActive: ColorModeSwitch;
73
72
  listGroupItemBackgroundHover: ColorModeSwitch;
@@ -1,12 +1,7 @@
1
1
  export declare type EuiThemeVariantFlags = {
2
- buttonVariant: 'classic' | 'refresh';
3
- formVariant: 'classic' | 'refresh';
4
2
  shadowVariant: 'classic' | 'refresh';
5
3
  };
6
4
  /**
7
5
  * Theme specific setting flags
8
6
  */
9
- export declare type _EuiThemeFlags = {
10
- hasGlobalFocusColor: boolean;
11
- hasVisColorAdjustment: boolean;
12
- } & EuiThemeVariantFlags;
7
+ export declare type _EuiThemeFlags = EuiThemeVariantFlags;
@@ -81,3 +81,8 @@ export interface UseEuiTheme<T extends {} = {}> {
81
81
  highContrastMode: EuiThemeHighContrastMode;
82
82
  modifications: EuiThemeModifications<T>;
83
83
  }
84
+ export interface EUI_THEME {
85
+ text: string;
86
+ value: string;
87
+ provider?: EuiThemeSystem;
88
+ }
@@ -6,28 +6,24 @@ export declare type VisColorStoreEvents = keyof typeof VIS_COLOR_STORE_EVENTS;
6
6
  declare type EventId = string;
7
7
  export declare type _EuiVisColorStore = {
8
8
  visColors: _EuiThemeVisColors;
9
- hasVisColorAdjustment: boolean;
10
- setVisColors: (colors: _EuiThemeVisColors, hasVisColorAdjustment?: boolean) => void;
9
+ setVisColors: (colors: _EuiThemeVisColors) => void;
11
10
  subscribe: (eventName: VisColorStoreEvents, callback: any) => EventId;
12
11
  unsubscribe: (eventName: VisColorStoreEvents, id: EventId) => void;
13
12
  };
14
13
  declare class EuiVisColorStoreImpl implements _EuiVisColorStore {
15
14
  private _visColors;
16
- private _hasVisColorAdjustment;
17
15
  private events;
18
16
  constructor(dependencies: {
19
17
  defaultColors: _EuiThemeVisColors;
20
- hasVisColorAdjustment: boolean;
21
18
  });
22
19
  get visColors(): _EuiVisColorStore['visColors'];
23
- get hasVisColorAdjustment(): _EuiVisColorStore['hasVisColorAdjustment'];
24
- setVisColors: (colors: _EuiThemeVisColors, hasColorAdjustment?: boolean | undefined) => void;
20
+ setVisColors: (colors: _EuiThemeVisColors) => void;
25
21
  subscribe: (eventName: VisColorStoreEvents, callback: NonNullable<any>) => string;
26
22
  unsubscribe: (eventName: VisColorStoreEvents, id: EventId) => void;
27
23
  private publishUpdate;
28
24
  }
29
25
  export declare class EuiVisColorStore {
30
26
  private static instance;
31
- static getInstance(defaultColors: _EuiThemeVisColors, hasVisColorAdjustment: boolean): EuiVisColorStoreImpl;
27
+ static getInstance(defaultColors: _EuiThemeVisColors): EuiVisColorStoreImpl;
32
28
  }
33
29
  export {};
@@ -13,13 +13,9 @@ export const VIS_COLOR_STORE_EVENTS = {
13
13
  class EuiVisColorStoreImpl {
14
14
  constructor(dependencies) {
15
15
  this.events = {};
16
- this.setVisColors = (colors, hasColorAdjustment) => {
17
- if (!isEqual(this._visColors, colors) ||
18
- hasColorAdjustment !== this._hasVisColorAdjustment) {
16
+ this.setVisColors = (colors) => {
17
+ if (!isEqual(this._visColors, colors)) {
19
18
  this._visColors = colors;
20
- if (hasColorAdjustment != null) {
21
- this._hasVisColorAdjustment = hasColorAdjustment;
22
- }
23
19
  this.publishUpdate(VIS_COLOR_STORE_EVENTS.UPDATE, this._visColors);
24
20
  }
25
21
  };
@@ -46,21 +42,16 @@ class EuiVisColorStoreImpl {
46
42
  });
47
43
  };
48
44
  this._visColors = dependencies.defaultColors;
49
- this._hasVisColorAdjustment = dependencies.hasVisColorAdjustment;
50
45
  }
51
46
  get visColors() {
52
47
  return this._visColors;
53
48
  }
54
- get hasVisColorAdjustment() {
55
- return this._hasVisColorAdjustment;
56
- }
57
49
  }
58
50
  export class EuiVisColorStore {
59
- static getInstance(defaultColors, hasVisColorAdjustment) {
51
+ static getInstance(defaultColors) {
60
52
  if (!this.instance) {
61
53
  this.instance = new EuiVisColorStoreImpl({
62
54
  defaultColors,
63
- hasVisColorAdjustment,
64
55
  });
65
56
  }
66
57
  return this.instance;
@@ -11,7 +11,7 @@ const visColors = {
11
11
  euiColorVis0: '#aabbcc',
12
12
  };
13
13
  describe('EuiVisColorStore', () => {
14
- const visColorStore = EuiVisColorStore.getInstance(visColors, false);
14
+ const visColorStore = EuiVisColorStore.getInstance(visColors);
15
15
  let updateFn;
16
16
  beforeEach(() => {
17
17
  updateFn = jest.fn();
@@ -31,10 +31,6 @@ describe('EuiVisColorStore', () => {
31
31
  visColorStore.setVisColors(customColors);
32
32
  expect(visColorStore.visColors).toEqual(customColors);
33
33
  });
34
- it('updates hasVisColorAdjustment', () => {
35
- visColorStore.setVisColors(customColors, true);
36
- expect(visColorStore.hasVisColorAdjustment).toEqual(true);
37
- });
38
34
  });
39
35
  describe('subcribe and unsubscribe', () => {
40
36
  it('subscribes to store updates', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/eui-theme-common",
3
- "version": "5.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "EUI theme common",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "scripts": {
@@ -4,10 +4,4 @@
4
4
  @import 'helpers';
5
5
  @import 'states';
6
6
 
7
- @import 'button';
8
- @import 'form';
9
- @import 'loading';
10
- @import 'link';
11
- @import 'panel';
12
- @import 'range';
13
7
  @import 'tool_tip';
@@ -1,4 +1,4 @@
1
- @mixin euiFocusRing($size: 'small', $amsterdamOnlyProp: null) {
1
+ @mixin euiFocusRing($size: 'small') {
2
2
  @if $size == 'large' {
3
3
  // It's always OK to use the focus animation. This will take precedence over times we turn it off individually like EuiButtonEmpty
4
4
  // stylelint-disable-next-line declaration-no-important
@@ -1,149 +0,0 @@
1
- // Provides a solid reset and base for handling sizing layout
2
- // Does not include any visual styles
3
- @mixin euiButtonBase {
4
- display: inline-block;
5
- appearance: none;
6
- cursor: pointer;
7
- height: $euiButtonHeight;
8
- line-height: $euiButtonHeight; // prevents descenders from getting cut off
9
- text-align: center;
10
- white-space: nowrap;
11
- max-width: 100%;
12
- vertical-align: middle;
13
- }
14
-
15
- // Adds the focus (and hover) animation for translating up 1px
16
- @mixin euiButtonFocus {
17
- @include euiCanAnimate {
18
- transition: transform $euiAnimSpeedNormal ease-in-out, background-color $euiAnimSpeedNormal ease-in-out;
19
-
20
- &:hover:not(:disabled) {
21
- transform: translateY(-1px);
22
- }
23
-
24
- &:focus {
25
- animation: euiButtonActive $euiAnimSpeedNormal $euiAnimSlightBounce;
26
- }
27
-
28
- &:active:not(:disabled) {
29
- transform: translateY(1px);
30
- }
31
- }
32
- }
33
-
34
- // All of the button base styles including the base, focus, font, and initial styles
35
- // Does not include individual alterations like color or sizes
36
- @mixin euiButton {
37
- @include euiButtonBase;
38
- @include euiFont;
39
- @include euiFontSize;
40
- @include euiButtonFocus;
41
-
42
- font-weight: $euiButtonFontWeight;
43
- text-decoration: none;
44
- outline-offset: -1px;
45
-
46
- &:hover:not(:disabled),
47
- &:focus {
48
- text-decoration: underline;
49
- }
50
- }
51
-
52
- // Correctly lays out the contents of a button when using the proper dom elements of:
53
- // <button>
54
- // <span className="__content">
55
- // {icon/spinner}
56
- // {child}
57
- // </span>
58
- // </button>
59
- // 1. Apply margin to all but last item in the flex.
60
- // 2. Margin gets flipped because of the row-reverse.
61
- @mixin euiButtonContent($isReverse: false) {
62
- height: 100%;
63
- width: 100%;
64
- vertical-align: middle;
65
-
66
- .euiButtonContent__icon,
67
- .euiButtonContent__spinner {
68
- flex-shrink: 0; // Ensures the icons/spinner don't scale down below their intended size
69
- }
70
-
71
- @if ($isReverse) {
72
- flex-direction: row-reverse;
73
-
74
- > * + * {
75
- margin-inline-start: 0; // 1, 2
76
- margin-inline-end: $euiSizeS; // 1, 2
77
- }
78
- } @else {
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
-
83
- > * + * {
84
- margin-inline-start: $euiSizeS; // 1
85
- }
86
- }
87
- }
88
-
89
- @mixin euiButtonContentDisabled {
90
- pointer-events: auto;
91
- cursor: not-allowed;
92
-
93
- &:hover,
94
- &:focus,
95
- &:focus-within {
96
- text-decoration: none;
97
- }
98
-
99
- .euiButtonContent__spinner {
100
- border-color: euiLoadingSpinnerBorderColors(currentColor);
101
- }
102
- }
103
-
104
- /*
105
- * Creates the Amsterdam style of button with a transparent background
106
- */
107
- @mixin euiButtonDefaultStyle($color: 'primary', $includeStates: true, $transparency: $euiButtonDefaultTransparency) {
108
- $backgroundColor: $color;
109
-
110
- @if (map-has-key($euiButtonTypes, $color)) {
111
- $backgroundColor: map-get($euiButtonTypes, $color);
112
- }
113
-
114
- $percentConversion: $transparency * 100%;
115
- // This variable simulates the possibly darkest background the button could be on
116
- // Simulates the 20% opaque color on top of the page background color
117
- $backgroundColorSimulated: mix($euiPageBackgroundColor, $backgroundColor, $percentConversion);
118
- // Then we can calculate the darkest text color needed
119
- color: makeHighContrastColor($backgroundColor, $backgroundColorSimulated);
120
- // But still use transparency
121
- background-color: transparentize($backgroundColor, $transparency);
122
-
123
- @if ($includeStates) {
124
- &:not([class*='isDisabled']) {
125
- &:hover,
126
- &:focus {
127
- // Duplicated from inert state simply to override default theme
128
- background-color: transparentize($backgroundColor, $transparency);
129
- }
130
- }
131
- }
132
- }
133
-
134
- /*
135
- * Creates the Amsterdam style of fill button
136
- */
137
- @mixin euiButtonFillStyle($color: 'primary') {
138
- $backgroundColor: $color;
139
-
140
- @if (map-has-key($euiButtonTypes, $color)) {
141
- $backgroundColor: map-get($euiButtonTypes, $color);
142
- }
143
-
144
- background-color: $backgroundColor;
145
- color: chooseLightOrDarkText($backgroundColor);
146
- }
147
-
148
- // Keyframe animation declarations can be found in
149
- // utility/animations.scss
@@ -1,272 +0,0 @@
1
- @mixin euiFormControlLayoutPadding($numOfIcons, $side: 'right', $compressed: false) {
2
- $iconSize: $euiSize;
3
- $iconPadding: $euiFormControlPadding;
4
- $marginBetweenIcons: $euiFormControlPadding / 2;
5
-
6
- @if ($compressed) {
7
- $iconPadding: $euiFormControlCompressedPadding;
8
- }
9
-
10
- @if variable-exists(numOfIcons) == false {
11
- @error '$numOfIcons:integer (1-3) must be provided to @mixin euiFormControlLayoutPadding().';
12
- } @else if $numOfIcons == 1 {
13
- padding-#{$side}: $iconPadding + $iconSize + $iconPadding;
14
- } @else if $numOfIcons == 2 {
15
- padding-#{$side}: $iconPadding + $iconSize + $marginBetweenIcons + $iconSize + $iconPadding;
16
- } @else if $numOfIcons == 3 {
17
- padding-#{$side}: $iconPadding + $iconSize + $marginBetweenIcons + $iconSize + $marginBetweenIcons + $iconSize + $iconPadding;
18
- }
19
- }
20
-
21
- @mixin euiPlaceholderPerBrowser {
22
- // stylelint-disable selector-no-vendor-prefix
23
- // Each prefix must be its own content block
24
- &::-webkit-input-placeholder { @content; opacity: 1; }
25
- &::-moz-placeholder { @content; opacity: 1; }
26
- &:-moz-placeholder { @content; opacity: 1; }
27
- &::placeholder { @content; opacity: 1; }
28
- }
29
-
30
- @function euiFormControlGradient($color: $euiColorPrimary) {
31
- @return linear-gradient(to top,
32
- $color,
33
- $color 2px,
34
- transparent 2px,
35
- transparent 100%
36
- );
37
- }
38
-
39
- @mixin euiFormControlText {
40
- @include euiFont;
41
- font-size: $euiFontSizeS;
42
- color: $euiColorTextParagraph;
43
-
44
- @include euiPlaceholderPerBrowser {
45
- color: $euiFormControlPlaceholderText;
46
- }
47
- }
48
-
49
- @mixin euiFormControlSize(
50
- $height: $euiFormControlHeight,
51
- $includeAlternates: false
52
- ) {
53
- // Default
54
- max-width: $euiFormMaxWidth;
55
- width: 100%;
56
- height: $height;
57
-
58
- @if ($includeAlternates) {
59
- &--fullWidth {
60
- max-width: 100%;
61
- }
62
-
63
- &--compressed {
64
- height: $euiFormControlCompressedHeight;
65
- }
66
-
67
- &--inGroup {
68
- height: 100%;
69
- }
70
- }
71
- }
72
-
73
- @mixin euiFormControlWithIcon($isIconOptional: false, $side: 'left', $compressed: false) {
74
- @if ($isIconOptional) {
75
- @at-root {
76
- #{&}--withIcon {
77
- @include euiFormControlLayoutPadding(1, $side, $compressed);
78
- }
79
- }
80
- } @else {
81
- @include euiFormControlLayoutPadding(1, $side, $compressed);
82
- }
83
- }
84
-
85
- @mixin euiFormControlIsLoading($isNextToIcon: false) {
86
- @at-root {
87
- #{&}-isLoading {
88
- @if ($isNextToIcon) {
89
- @include euiFormControlLayoutPadding(2);
90
- } @else {
91
- @include euiFormControlLayoutPadding(1);
92
- }
93
- }
94
-
95
- #{&}-isLoading#{&}--compressed {
96
- @if ($isNextToIcon) {
97
- @include euiFormControlLayoutPadding(2, $compressed: true);
98
- } @else {
99
- @include euiFormControlLayoutPadding(1, $compressed: true);
100
- }
101
- }
102
- }
103
- }
104
-
105
- // 1. Must supply both values to background-size or some browsers apply the single value to both directions
106
-
107
- @mixin euiFormControlDefaultShadow($borderOnly: false) {
108
- background-color: $euiFormBackgroundColor;
109
- background-repeat: no-repeat;
110
- background-size: 0% 100%; // 1
111
-
112
- @if ($borderOnly) {
113
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
114
- } @else {
115
- box-shadow:
116
- #{$euiFormControlBoxShadow},
117
- inset 0 0 0 1px $euiFormBorderColor;
118
- }
119
-
120
- transition:
121
- box-shadow $euiAnimSpeedFast ease-in,
122
- background-image $euiAnimSpeedFast ease-in,
123
- background-size $euiAnimSpeedFast ease-in,
124
- background-color $euiAnimSpeedFast ease-in;
125
-
126
- // Fixes bug in Firefox where adding a transition to the background-color
127
- // caused a flash of differently styled dropdown.
128
- @supports (-moz-appearance: none) {
129
- // List *must* be in the same order as the above.
130
- transition-property: box-shadow, background-image, background-size;
131
- }
132
- }
133
-
134
- @mixin euiFormControlFocusStyle($borderOnly: false) {
135
- background-color: tintOrShade($euiColorEmptyShade, 0%, 40%);
136
- background-image: euiFormControlGradient();
137
- background-size: 100% 100%; // 1
138
- outline: none; // Blanket remove all outlines relying on our own bottom border
139
-
140
- @if ($borderOnly) {
141
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
142
- } @else {
143
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
144
- }
145
- }
146
-
147
- @mixin euiFormControlInvalidStyle {
148
- background-image: euiFormControlGradient($euiColorDanger);
149
- background-size: 100%;
150
- }
151
-
152
- @mixin euiFormControlDisabledTextStyle {
153
- color: $euiFormControlDisabledColor;
154
- -webkit-text-fill-color: $euiFormControlDisabledColor; // Required for Safari
155
- }
156
-
157
- @mixin euiFormControlDisabledStyle {
158
- @include euiFormControlDisabledTextStyle;
159
- cursor: not-allowed;
160
- background: $euiFormBackgroundDisabledColor;
161
- box-shadow: inset 0 0 0 1px $euiFormBorderDisabledColor;
162
-
163
- @include euiPlaceholderPerBrowser {
164
- color: $euiFormControlDisabledColor;
165
- }
166
- }
167
-
168
- @mixin euiFormControlReadOnlyStyle {
169
- cursor: default;
170
- color: $euiColorTextParagraph;
171
- -webkit-text-fill-color: $euiColorTextParagraph; // Required for Safari
172
- // Use transparency since there is no border and in case form is on a non-white background
173
- background: $euiFormBackgroundReadOnlyColor;
174
- border-color: transparent;
175
- box-shadow: inset 0 0 0 1px $euiFormBorderDisabledColor;
176
- }
177
-
178
- // 2. Override invalid state with focus state.
179
-
180
- @mixin euiFormControlStyle($borderOnly: false, $includeStates: true, $includeSizes: true) {
181
- @include euiFormControlSize($includeAlternates: $includeSizes);
182
- @include euiFormControlDefaultShadow;
183
- @include euiFormControlText;
184
-
185
- border: none;
186
- border-radius: $euiFormControlBorderRadius;
187
- padding: $euiFormControlPadding;
188
-
189
- @if ($includeStates) {
190
- &:invalid { // 2
191
- @include euiFormControlInvalidStyle;
192
- }
193
-
194
- &:focus { // 2
195
- @include euiFormControlFocusStyle;
196
- }
197
-
198
- &:disabled {
199
- @include euiFormControlDisabledStyle;
200
- }
201
-
202
- &[readOnly] {
203
- @include euiFormControlReadOnlyStyle;
204
- }
205
-
206
- // Needs to be set for autofill
207
- &:-webkit-autofill {
208
- -webkit-text-fill-color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);
209
-
210
- ~ .euiFormControlLayoutIcons {
211
- color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);
212
- }
213
- }
214
- }
215
-
216
- @if ($includeSizes) {
217
- &--compressed {
218
- @include euiFormControlStyleCompressed($borderOnly, $includeStates);
219
- }
220
-
221
- &--inGroup {
222
- // stylelint-disable-next-line declaration-no-important
223
- box-shadow: none !important;
224
- border-radius: 0;
225
- }
226
- }
227
- }
228
-
229
- @mixin euiFormControlStyleCompressed($borderOnly: false, $includeStates: true) {
230
- @include euiFormControlDefaultShadow($borderOnly: true);
231
- padding: $euiFormControlCompressedPadding;
232
- border-radius: $euiFormControlCompressedBorderRadius;
233
-
234
- @if ($includeStates) {
235
- &:invalid { // 2
236
- @include euiFormControlInvalidStyle;
237
- }
238
-
239
- &:focus { // 2
240
- @include euiFormControlFocusStyle($borderOnly: true);
241
- }
242
-
243
- &:disabled {
244
- @include euiFormControlDisabledStyle;
245
- }
246
-
247
- &[readOnly] {
248
- @include euiFormControlReadOnlyStyle;
249
- }
250
- }
251
- }
252
-
253
- @mixin euiHiddenSelectableInput {
254
- position: absolute;
255
- // stylelint-disable-next-line declaration-no-important
256
- opacity: 0 !important; // Make sure it's still hidden when :disabled
257
- width: 100%;
258
- height: 100%;
259
- cursor: pointer;
260
- }
261
-
262
- // Adjusts form controls border radius
263
- @mixin euiFormControlSideBorderRadius($borderRadius, $side, $internal: false) {
264
- @if $internal == true {
265
- $borderRadius: $borderRadius - 1;
266
- }
267
- @if $side == 'left' {
268
- border-radius: $borderRadius 0 0 $borderRadius;
269
- } @else if $side == 'right' {
270
- border-radius: 0 $borderRadius $borderRadius 0;
271
- }
272
- }
@@ -1,11 +0,0 @@
1
- @mixin euiLink {
2
- text-align: left;
3
-
4
- &:hover {
5
- text-decoration: underline;
6
- }
7
-
8
- &:focus {
9
- text-decoration: underline;
10
- }
11
- }
@@ -1,6 +0,0 @@
1
- @function euiLoadingSpinnerBorderColors(
2
- $main: $euiColorLightShade,
3
- $highlight: $euiColorPrimary
4
- ) {
5
- @return $highlight $main $main $main;
6
- }
@@ -1,55 +0,0 @@
1
- @mixin euiPanel($selector) {
2
- @if variable-exists(selector) == false {
3
- @error 'A $selector must be provided to @mixin euiPanel().';
4
- } @else {
5
- #{$selector} {
6
- flex-grow: 1;
7
-
8
- &#{$selector}--flexGrowZero {
9
- flex-grow: 0;
10
- }
11
-
12
- &#{$selector}--hasShadow {
13
- @include euiBottomShadowMedium;
14
- }
15
-
16
- &#{$selector}--hasBorder {
17
- border: $euiBorderThin;
18
- box-shadow: none;
19
- }
20
-
21
- &#{$selector}--isClickable {
22
- // transition the shadow
23
- transition: all $euiAnimSpeedFast $euiAnimSlightResistance;
24
-
25
- &:enabled { // This is a good selector for buttons since it doesn't exist on divs
26
- // in case of button wrapper which inherently is inline-block and no width
27
- display: block;
28
- width: 100%;
29
- text-align: left;
30
- }
31
-
32
- &:hover,
33
- &:focus {
34
- @include euiBottomShadow;
35
- transform: translateY(-2px);
36
- cursor: pointer;
37
- }
38
- }
39
-
40
- // Border Radii
41
- @each $modifier, $amount in $euiPanelBorderRadiusModifiers {
42
- &#{$selector}--#{$modifier} {
43
- border-radius: $amount;
44
- }
45
- }
46
-
47
- // Background colors
48
- @each $modifier, $amount in $euiPanelBackgroundColorModifiers {
49
- &#{$selector}--#{$modifier} {
50
- background-color: $amount;
51
- }
52
- }
53
- }
54
- }
55
- }
@@ -1,59 +0,0 @@
1
- /*
2
- The CSS in JS version of this file lives in:
3
- - src/components/form/range/range.styles.ts
4
-
5
- The following files still use the Sass version:
6
- - src/themes/amsterdam/overrides/_color_stops.scss
7
- - src/themes/amsterdam/overrides/_hue.scss
8
- */
9
-
10
- @mixin euiRangeTrackSize($compressed: false) {
11
- height: $euiRangeTrackHeight;
12
- width: $euiRangeTrackWidth;
13
-
14
- @if ($compressed) {
15
- height: $euiRangeTrackCompressedHeight;
16
- }
17
- }
18
-
19
- @mixin euiRangeTrackPerBrowser {
20
- &::-webkit-slider-runnable-track { @content; }
21
- &::-moz-range-track { @content; }
22
- }
23
-
24
- @mixin euiRangeThumbBorder {
25
- border: 2px solid $euiRangeThumbBorderColor;
26
- }
27
-
28
- @mixin euiRangeThumbBoxShadow {
29
- box-shadow:
30
- 0 0 0 1px $euiRangeThumbBorderColor,
31
- 0 2px 2px -1px rgba($euiShadowColor, .2),
32
- 0 1px 5px -2px rgba($euiShadowColor, .2);
33
- }
34
-
35
- @mixin euiRangeThumbFocusBoxShadow {
36
- box-shadow: 0 0 0 2px $euiFocusRingColor;
37
- }
38
-
39
- @mixin euiRangeThumbStyle {
40
- @include euiRangeThumbBoxShadow;
41
- @include euiRangeThumbBorder;
42
- cursor: pointer;
43
- background-color: $euiRangeThumbBackgroundColor;
44
- padding: 0;
45
- height: $euiRangeThumbHeight;
46
- width: $euiRangeThumbWidth;
47
- box-sizing: border-box; // required for firefox or the border makes the width and height to increase
48
- }
49
-
50
- @mixin euiRangeThumbPerBrowser {
51
- &::-webkit-slider-thumb { @content; }
52
- &::-moz-range-thumb { @content; }
53
- }
54
-
55
- @mixin euiRangeThumbFocus {
56
- @include euiRangeThumbBorder;
57
- @include euiRangeThumbFocusBoxShadow;
58
- background-color: $euiColorPrimary;
59
- }