From 869874d0aa92bf1898d4a450c012b7bfffe52bd8 Mon Sep 17 00:00:00 2001 From: Michael Marcialis Date: Mon, 16 Oct 2023 12:08:51 -0400 Subject: [PATCH] [EuiIcon] Add Sparse Vector Token, Update Dense Vector Token (#7282) Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com> --- src-docs/src/views/icon/tokens.tsx | 3 +- .../icon/__snapshots__/icon.test.tsx.snap | 56 ++++++++++++++++++- .../icon/assets/tokenVectorDense.tsx | 36 ++++++++++++ ...nDenseVector.tsx => tokenVectorSparse.tsx} | 8 ++- src/components/icon/icon_map.ts | 4 +- .../icon/svgs/tokens/tokenDenseVector.svg | 3 - .../icon/svgs/tokens/tokenVectorDense.svg | 5 ++ .../icon/svgs/tokens/tokenVectorSparse.svg | 5 ++ .../token/__snapshots__/token.test.tsx.snap | 22 +++++++- src/components/token/token_map.ts | 22 ++++++-- upcoming_changelogs/7282.md | 1 + 11 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 src/components/icon/assets/tokenVectorDense.tsx rename src/components/icon/assets/{tokenDenseVector.tsx => tokenVectorSparse.tsx} (66%) delete mode 100644 src/components/icon/svgs/tokens/tokenDenseVector.svg create mode 100644 src/components/icon/svgs/tokens/tokenVectorDense.svg create mode 100644 src/components/icon/svgs/tokens/tokenVectorSparse.svg create mode 100644 upcoming_changelogs/7282.md diff --git a/src-docs/src/views/icon/tokens.tsx b/src-docs/src/views/icon/tokens.tsx index beaad629f09..b11f2a44b61 100644 --- a/src-docs/src/views/icon/tokens.tsx +++ b/src-docs/src/views/icon/tokens.tsx @@ -22,7 +22,6 @@ const tokens: EuiTokenMapType[] = [ 'tokenCompletionSuggester', 'tokenConstant', 'tokenDate', - 'tokenDenseVector', 'tokenElement', 'tokenEnum', 'tokenEnumMember', @@ -66,6 +65,8 @@ const tokens: EuiTokenMapType[] = [ 'tokenText', 'tokenTokenCount', 'tokenVariable', + 'tokenVectorDense', + 'tokenVectorSparse', ]; export default () => ( diff --git a/src/components/icon/__snapshots__/icon.test.tsx.snap b/src/components/icon/__snapshots__/icon.test.tsx.snap index 430ad7993c8..d3d2d347700 100644 --- a/src/components/icon/__snapshots__/icon.test.tsx.snap +++ b/src/components/icon/__snapshots__/icon.test.tsx.snap @@ -9675,7 +9675,13 @@ exports[`EuiIcon props type tokenDenseVector is rendered 1`] = ` xmlns="http://www.w3.org/2000/svg" > + + `; @@ -10501,6 +10507,54 @@ exports[`EuiIcon props type tokenVariable is rendered 1`] = ` `; +exports[`EuiIcon props type tokenVectorDense is rendered 1`] = ` + +`; + +exports[`EuiIcon props type tokenVectorSparse is rendered 1`] = ` + +`; + exports[`EuiIcon props type training is rendered 1`] = ` ); -export const icon = EuiIconTokenDenseVector; +export const icon = EuiIconTokenVectorSparse; diff --git a/src/components/icon/icon_map.ts b/src/components/icon/icon_map.ts index 8595347bc36..28c68c74f49 100644 --- a/src/components/icon/icon_map.ts +++ b/src/components/icon/icon_map.ts @@ -444,7 +444,6 @@ export const typeToPathMap = { tokenCompletionSuggester: 'tokenCompletionSuggester', tokenConstant: 'tokenConstant', tokenDate: 'tokenDate', - tokenDenseVector: 'tokenDenseVector', tokenElement: 'tokenElement', tokenEnum: 'tokenEnum', tokenEnumMember: 'tokenEnumMember', @@ -488,4 +487,7 @@ export const typeToPathMap = { tokenText: 'tokenText', tokenTokenCount: 'tokenTokenCount', tokenVariable: 'tokenVariable', + tokenVectorDense: 'tokenVectorDense', + tokenDenseVector: 'tokenVectorDense', // NOTE: This is an undocumented alias for `tokenVectorDense`, added for legacy compatability + tokenVectorSparse: 'tokenVectorSparse', }; diff --git a/src/components/icon/svgs/tokens/tokenDenseVector.svg b/src/components/icon/svgs/tokens/tokenDenseVector.svg deleted file mode 100644 index 66cbdf88904..00000000000 --- a/src/components/icon/svgs/tokens/tokenDenseVector.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/components/icon/svgs/tokens/tokenVectorDense.svg b/src/components/icon/svgs/tokens/tokenVectorDense.svg new file mode 100644 index 00000000000..883e56bcf02 --- /dev/null +++ b/src/components/icon/svgs/tokens/tokenVectorDense.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/icon/svgs/tokens/tokenVectorSparse.svg b/src/components/icon/svgs/tokens/tokenVectorSparse.svg new file mode 100644 index 00000000000..f2296572cf0 --- /dev/null +++ b/src/components/icon/svgs/tokens/tokenVectorSparse.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/token/__snapshots__/token.test.tsx.snap b/src/components/token/__snapshots__/token.test.tsx.snap index b776fbd354e..83caf2c1e79 100644 --- a/src/components/token/__snapshots__/token.test.tsx.snap +++ b/src/components/token/__snapshots__/token.test.tsx.snap @@ -256,7 +256,7 @@ exports[`EuiToken props iconType as EuiTokenMapType tokenDate is rendered 1`] = exports[`EuiToken props iconType as EuiTokenMapType tokenDenseVector is rendered 1`] = ` `; +exports[`EuiToken props iconType as EuiTokenMapType tokenVectorDense is rendered 1`] = ` + + + +`; + +exports[`EuiToken props iconType as EuiTokenMapType tokenVectorSparse is rendered 1`] = ` + + + +`; + exports[`EuiToken props shape circle is rendered 1`] = `