From 430593e25f74faf7874768d9f8fd44f84c3b3fac Mon Sep 17 00:00:00 2001 From: Bree Hall Date: Tue, 25 Jul 2023 14:29:32 -0400 Subject: [PATCH 1/6] [Color Palette] Create a new euiPaletteComplementary and deprecate euiPaletteComplimentary due to a spelling error. --- src/services/color/eui_palettes.ts | 15 +++++++++++++++ src/services/color/index.ts | 1 + src/services/index.ts | 1 + 3 files changed, 17 insertions(+) diff --git a/src/services/color/eui_palettes.ts b/src/services/color/eui_palettes.ts index d9c1514fb7b..c28a8eb86ed 100644 --- a/src/services/color/eui_palettes.ts +++ b/src/services/color/eui_palettes.ts @@ -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 { if (steps === 1) { return [euiPaletteColorBlind()[1]]; @@ -196,6 +199,18 @@ export const euiPaletteComplimentary = function (steps: number): EuiPalette { ); }; +export const euiPaletteComplementary = function (steps: number): EuiPalette { + 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]; diff --git a/src/services/color/index.ts b/src/services/color/index.ts index ee57703c181..2ae35ec9c5a 100644 --- a/src/services/color/index.ts +++ b/src/services/color/index.ts @@ -31,6 +31,7 @@ export { euiPaletteForStatus, euiPaletteForTemperature, euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, diff --git a/src/services/index.ts b/src/services/index.ts index 5243593e1e9..b81e657cc94 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -37,6 +37,7 @@ export { euiPaletteColorBlind, euiPaletteColorBlindBehindText, euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteCool, euiPaletteForDarkBackground, euiPaletteForLightBackground, From 9ee4a97707bbc3801c6e2f8d1acfe575ed8d03ea Mon Sep 17 00:00:00 2001 From: Bree Hall Date: Tue, 25 Jul 2023 14:44:03 -0400 Subject: [PATCH 2/6] [Color Palette] Update references to euiPaletteComplimentary to point to the new euiPaletteColmplementary --- .../src/views/color_palette/color_palette_quantitative.js | 4 ++-- src-docs/src/views/color_picker/color_palette_display.js | 4 ++-- src-docs/src/views/elastic_charts/theming.js | 4 ++-- .../src/views/markdown_editor/markdown_editor_with_plugins.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src-docs/src/views/color_palette/color_palette_quantitative.js b/src-docs/src/views/color_palette/color_palette_quantitative.js index b791464fc30..79c5be5ba1c 100644 --- a/src-docs/src/views/color_palette/color_palette_quantitative.js +++ b/src-docs/src/views/color_palette/color_palette_quantitative.js @@ -11,7 +11,7 @@ import { import { ColorPaletteFlexItem, ColorPaletteCopyCode } from './shared'; import { - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteCool, @@ -23,7 +23,7 @@ import { const paletteData = { euiPaletteForStatus, euiPaletteForTemperature, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, diff --git a/src-docs/src/views/color_picker/color_palette_display.js b/src-docs/src/views/color_picker/color_palette_display.js index e031399c19b..12585bd7776 100644 --- a/src-docs/src/views/color_picker/color_palette_display.js +++ b/src-docs/src/views/color_picker/color_palette_display.js @@ -3,7 +3,7 @@ import { euiPaletteColorBlind, euiPaletteForStatus, euiPaletteForTemperature, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, @@ -49,7 +49,7 @@ const paletteWithStops = [ const paletteData = { euiPaletteForStatus, euiPaletteForTemperature, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, diff --git a/src-docs/src/views/elastic_charts/theming.js b/src-docs/src/views/elastic_charts/theming.js index 71ee50a33fe..0732d7108a5 100644 --- a/src-docs/src/views/elastic_charts/theming.js +++ b/src-docs/src/views/elastic_charts/theming.js @@ -23,7 +23,7 @@ import { import { euiPaletteColorBlind, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteForStatus, euiPaletteForTemperature, euiPaletteCool, @@ -38,7 +38,7 @@ const paletteData = { euiPaletteColorBlind, euiPaletteForStatus, euiPaletteForTemperature, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, diff --git a/src-docs/src/views/markdown_editor/markdown_editor_with_plugins.js b/src-docs/src/views/markdown_editor/markdown_editor_with_plugins.js index a5e69b49170..77e101a268a 100644 --- a/src-docs/src/views/markdown_editor/markdown_editor_with_plugins.js +++ b/src-docs/src/views/markdown_editor/markdown_editor_with_plugins.js @@ -37,7 +37,7 @@ import { import { useEuiTheme, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteCool, euiPaletteForStatus, euiPaletteForTemperature, @@ -51,7 +51,7 @@ import { getDefaultEuiMarkdownUiPlugins } from '../../../../src/components/markd const paletteData = { euiPaletteForStatus, euiPaletteForTemperature, - euiPaletteComplimentary, + euiPaletteComplementary, euiPaletteNegative, euiPalettePositive, euiPaletteCool, From b385148d70f513f08be83a7121398b6226343462 Mon Sep 17 00:00:00 2001 From: Bree Hall Date: Tue, 25 Jul 2023 14:50:55 -0400 Subject: [PATCH 3/6] CHANGELOG --- upcoming_changelogs/6992.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 upcoming_changelogs/6992.md diff --git a/upcoming_changelogs/6992.md b/upcoming_changelogs/6992.md new file mode 100644 index 00000000000..329a41e7c96 --- /dev/null +++ b/upcoming_changelogs/6992.md @@ -0,0 +1,4 @@ +**Deprecations** + +- Deprecated `euiPaletteComplimentary`; Use `euiPaletteComplementary` instead. + From d3f1c00a0956434548a3eabf840b3d83db272ab9 Mon Sep 17 00:00:00 2001 From: Bree Hall <40739624+breehall@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:25:17 -0400 Subject: [PATCH 4/6] Update src/services/color/eui_palettes.ts Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com> --- src/services/color/eui_palettes.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/services/color/eui_palettes.ts b/src/services/color/eui_palettes.ts index c28a8eb86ed..6f2764f8312 100644 --- a/src/services/color/eui_palettes.ts +++ b/src/services/color/eui_palettes.ts @@ -184,10 +184,7 @@ export const euiPaletteForTemperature = function (steps: number): EuiPalette { return euiPalette([...cools, ...warms], steps, true); }; -/** - * @deprecated Use euiPaletteComplementary instead - */ -export const euiPaletteComplimentary = function (steps: number): EuiPalette { +export const euiPaletteComplementary = function (steps: number): EuiPalette { if (steps === 1) { return [euiPaletteColorBlind()[1]]; } From 54aaa14e44beaa4a45d97bd37b4bb4c206bc23dd Mon Sep 17 00:00:00 2001 From: Bree Hall <40739624+breehall@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:25:23 -0400 Subject: [PATCH 5/6] Update src/services/color/eui_palettes.ts Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com> --- src/services/color/eui_palettes.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/services/color/eui_palettes.ts b/src/services/color/eui_palettes.ts index 6f2764f8312..7a2d7c4e3a9 100644 --- a/src/services/color/eui_palettes.ts +++ b/src/services/color/eui_palettes.ts @@ -196,7 +196,11 @@ export const euiPaletteComplementary = function (steps: number): EuiPalette { ); }; -export const euiPaletteComplementary = 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; if (steps === 1) { return [euiPaletteColorBlind()[1]]; } From 84b883cfca0045cc61d44542400c20b0b88490ce Mon Sep 17 00:00:00 2001 From: Bree Hall Date: Tue, 25 Jul 2023 16:31:23 -0400 Subject: [PATCH 6/6] [PR Feedback] Reformat code change made in Github UI --- src/services/color/eui_palettes.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/services/color/eui_palettes.ts b/src/services/color/eui_palettes.ts index 7a2d7c4e3a9..6248b136831 100644 --- a/src/services/color/eui_palettes.ts +++ b/src/services/color/eui_palettes.ts @@ -201,16 +201,6 @@ export const euiPaletteComplementary = function (steps: number): EuiPalette { * @deprecated Use euiPaletteComplementary instead */ export const euiPaletteComplimentary = euiPaletteComplementary; - if (steps === 1) { - return [euiPaletteColorBlind()[1]]; - } - - return euiPalette( - [euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]], - steps, - true - ); -}; export const euiPaletteNegative = function (steps: number): EuiPalette { if (steps === 1) {