Skip to content

Commit

Permalink
[Color Palette] Deprecate euiPaletteComplimentary; Add `euiPaletteC…
Browse files Browse the repository at this point in the history
…omplementary` (#6992)

Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
  • Loading branch information
breehall and cee-chen authored Jul 26, 2023
1 parent e316e17 commit 4cd2803
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
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
8 changes: 7 additions & 1 deletion src/services/color/eui_palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const euiPaletteForTemperature = function (steps: number): EuiPalette {
return euiPalette([...cools, ...warms], steps, true);
};

export const euiPaletteComplimentary = function (steps: number): EuiPalette {
export const euiPaletteComplementary = function (steps: number): EuiPalette {
if (steps === 1) {
return [euiPaletteColorBlind()[1]];
}
Expand All @@ -196,6 +196,12 @@ export const euiPaletteComplimentary = function (steps: number): EuiPalette {
);
};

/**
* The old typo'd name for this palette remains exported until the end of its deprecation period
* @deprecated Use euiPaletteComplementary instead
*/
export const euiPaletteComplimentary = euiPaletteComplementary;

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.

0 comments on commit 4cd2803

Please sign in to comment.