Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Color Palette] Deprecate euiPaletteComplimentary; Add euiPaletteComplementary #6992

Merged
merged 6 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { ColorPaletteFlexItem, ColorPaletteCopyCode } from './shared';

import {
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteCool,
Expand All @@ -23,7 +23,7 @@ import {
const paletteData = {
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/color_picker/color_palette_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
euiPaletteColorBlind,
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down Expand Up @@ -49,7 +49,7 @@ const paletteWithStops = [
const paletteData = {
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/elastic_charts/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {

import {
euiPaletteColorBlind,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteCool,
Expand All @@ -38,7 +38,7 @@ const paletteData = {
euiPaletteColorBlind,
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {

import {
useEuiTheme,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteCool,
euiPaletteForStatus,
euiPaletteForTemperature,
Expand All @@ -51,7 +51,7 @@ import { getDefaultEuiMarkdownUiPlugins } from '../../../../src/components/markd
const paletteData = {
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down
15 changes: 15 additions & 0 deletions src/services/color/eui_palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ export const euiPaletteForTemperature = function (steps: number): EuiPalette {
return euiPalette([...cools, ...warms], steps, true);
};

/**
* @deprecated Use euiPaletteComplementary instead
*/
export const euiPaletteComplimentary = function (steps: number): EuiPalette {
breehall marked this conversation as resolved.
Show resolved Hide resolved
if (steps === 1) {
return [euiPaletteColorBlind()[1]];
Expand All @@ -196,6 +199,18 @@ export const euiPaletteComplimentary = function (steps: number): EuiPalette {
);
};

export const euiPaletteComplementary = function (steps: number): EuiPalette {
breehall marked this conversation as resolved.
Show resolved Hide resolved
if (steps === 1) {
return [euiPaletteColorBlind()[1]];
}

return euiPalette(
[euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]],
steps,
true
);
};

export const euiPaletteNegative = function (steps: number): EuiPalette {
if (steps === 1) {
return [lightNegativeColor];
Expand Down
1 change: 1 addition & 0 deletions src/services/color/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export {
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
Expand Down
1 change: 1 addition & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export {
euiPaletteColorBlind,
euiPaletteColorBlindBehindText,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteCool,
euiPaletteForDarkBackground,
euiPaletteForLightBackground,
Expand Down
4 changes: 4 additions & 0 deletions upcoming_changelogs/6992.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**Deprecations**

- Deprecated `euiPaletteComplimentary`; Use `euiPaletteComplementary` instead.