Skip to content

Commit

Permalink
deprecated old palettes
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Mar 13, 2024
1 parent b29db2b commit 0025808
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions changelogs/upcoming/7570.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
**Breaking changes**
**Deprecations**

- Renamed `euiPalettePositive` and `euiPaletteNegative` to a more culturally inclusive `euiPaletteGreen` and `euiPaletteRed` ([#7570](https://github.com/elastic/eui/pull/7570))
- Deprecated `euiPalettePositive` and `euiPaletteNegative` in favour of a more culturally inclusive `euiPaletteGreen` and `euiPaletteRed` ([#7570](https://github.com/elastic/eui/pull/7570))
9 changes: 9 additions & 0 deletions src/services/color/eui_palettes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export const euiPaletteRed = function (steps: number): EuiPalette {

return euiPalette(['white', redColor], steps);
};
/**
* @deprecated - use `euiPaletteRed` instead
*/
export const euiPaletteNegative = euiPaletteRed;

export const euiPaletteGreen = function (steps: number): EuiPalette {
if (steps === 1) {
Expand All @@ -212,6 +216,11 @@ export const euiPaletteGreen = function (steps: number): EuiPalette {
return euiPalette(['white', greenColor], steps);
};

/**
* @deprecated - use `euiPaletteGreen` instead
*/
export const euiPalettePositive = euiPaletteGreen;

export const euiPaletteCool = function (steps: number): EuiPalette {
if (steps === 1) {
return [coolArray[1]];
Expand Down
2 changes: 2 additions & 0 deletions src/services/color/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export {
euiPaletteComplementary,
euiPaletteRed,
euiPaletteGreen,
euiPaletteNegative,
euiPalettePositive,
euiPaletteCool,
euiPaletteWarm,
euiPaletteGray,
Expand Down
2 changes: 2 additions & 0 deletions src/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export {
euiPaletteGray,
euiPaletteRed,
euiPaletteGreen,
euiPalettePositive,
euiPaletteNegative,
euiPaletteWarm,
getSteppedGradient,
hexToHsv,
Expand Down

0 comments on commit 0025808

Please sign in to comment.