Skip to content

Commit cd938f2

Browse files
authored
[EuiToken] Update tokenKeyword and rename old tokenKeyword as tokenTag (#5251)
1 parent c92914a commit cd938f2

File tree

10 files changed

+98
-22
lines changed

10 files changed

+98
-22
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## [`master`](https://github.com/elastic/eui/tree/master)
22

3-
No public interface changes since `39.1.1`.
3+
- Updated `tokenKeyword` to match the definition of keyword field type ([#5251](https://github.com/elastic/eui/pull/5251))
4+
5+
**Breaking changes**
6+
7+
- Renamed `tokenKeyword` icon to `tokenTag` in `EuiToken` ([#5251](https://github.com/elastic/eui/pull/5251))
48

59
## [`39.1.1`](https://github.com/elastic/eui/tree/v39.1.1)
610

src-docs/src/views/icon/tokens.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const tokens = [
5555
'tokenRankFeature',
5656
'tokenRankFeatures',
5757
'tokenKeyword',
58+
'tokenTag',
5859
'tokenCompletionSuggester',
5960
'tokenDenseVector',
6061
'tokenText',

src/components/icon/__snapshots__/icon.test.tsx.snap

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8641,12 +8641,7 @@ exports[`EuiIcon props type tokenKeyword is rendered 1`] = `
86418641
xmlns="http://www.w3.org/2000/svg"
86428642
>
86438643
<path
8644-
d="M5.75 7.375a.25.25 0 00-.25.25v.75c0 .138.112.25.25.25h3.5a.25.25 0 00.25-.25v-.75a.25.25 0 00-.25-.25h-3.5z"
8645-
/>
8646-
<path
8647-
clip-rule="evenodd"
8648-
d="M3 5a1 1 0 011-1h5.989a1 1 0 01.825.436l2.05 3a1 1 0 010 1.128l-2.05 3A1 1 0 019.99 12H4a1 1 0 01-1-1V5zm1.25.75a.5.5 0 01.5-.5h4.745a.5.5 0 01.405.206l1.636 2.25a.5.5 0 010 .588L9.9 10.544a.5.5 0 01-.405.206H4.75a.5.5 0 01-.5-.5v-4.5z"
8649-
fill-rule="evenodd"
8644+
d="M10.33 10.28c-.12.04-.29.07-.42.07-.23 0-.43-.08-.53-.3l-.63-1.34 2.32-2.81H9.3L7.76 7.93h-.09L8.22 4H6.59l-1.05 7.5h1.63l.27-1.94h.1l.43 1.12c.27.71.74.92 1.33.92.23 0 .6-.04.86-.11l.17-1.21z"
86508645
/>
86518646
</svg>
86528647
`;
@@ -9038,6 +9033,28 @@ exports[`EuiIcon props type tokenSymbol is rendered 1`] = `
90389033
</svg>
90399034
`;
90409035

9036+
exports[`EuiIcon props type tokenTag is rendered 1`] = `
9037+
<svg
9038+
aria-hidden="true"
9039+
class="euiIcon euiIcon--medium euiIcon-isLoaded"
9040+
focusable="false"
9041+
height="16"
9042+
role="img"
9043+
viewBox="0 0 16 16"
9044+
width="16"
9045+
xmlns="http://www.w3.org/2000/svg"
9046+
>
9047+
<path
9048+
d="M5.75 7.375a.25.25 0 00-.25.25v.75c0 .138.112.25.25.25h3.5a.25.25 0 00.25-.25v-.75a.25.25 0 00-.25-.25h-3.5z"
9049+
/>
9050+
<path
9051+
clip-rule="evenodd"
9052+
d="M3 5a1 1 0 011-1h5.989a1 1 0 01.825.436l2.05 3a1 1 0 010 1.128l-2.05 3A1 1 0 019.99 12H4a1 1 0 01-1-1V5zm1.25.75a.5.5 0 01.5-.5h4.745a.5.5 0 01.405.206l1.636 2.25a.5.5 0 010 .588L9.9 10.544a.5.5 0 01-.405.206H4.75a.5.5 0 01-.5-.5v-4.5z"
9053+
fill-rule="evenodd"
9054+
/>
9055+
</svg>
9056+
`;
9057+
90419058
exports[`EuiIcon props type tokenText is rendered 1`] = `
90429059
<svg
90439060
aria-hidden="true"

src/components/icon/assets/tokenKeyword.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,15 @@ const EuiIconTokenKeyword = ({
2020
...props
2121
}: React.SVGProps<SVGSVGElement> & SVGRProps) => (
2222
<svg
23+
xmlns="http://www.w3.org/2000/svg"
2324
width={16}
2425
height={16}
2526
viewBox="0 0 16 16"
26-
xmlns="http://www.w3.org/2000/svg"
2727
aria-labelledby={titleId}
2828
{...props}
2929
>
3030
{title ? <title id={titleId}>{title}</title> : null}
31-
<path d="M5.75 7.375a.25.25 0 00-.25.25v.75c0 .138.112.25.25.25h3.5a.25.25 0 00.25-.25v-.75a.25.25 0 00-.25-.25h-3.5z" />
32-
<path
33-
fillRule="evenodd"
34-
clipRule="evenodd"
35-
d="M3 5a1 1 0 011-1h5.989a1 1 0 01.825.436l2.05 3a1 1 0 010 1.128l-2.05 3A1 1 0 019.99 12H4a1 1 0 01-1-1V5zm1.25.75a.5.5 0 01.5-.5h4.745a.5.5 0 01.405.206l1.636 2.25a.5.5 0 010 .588L9.9 10.544a.5.5 0 01-.405.206H4.75a.5.5 0 01-.5-.5v-4.5z"
36-
/>
31+
<path d="M10.33 10.28c-.12.04-.29.07-.42.07-.23 0-.43-.08-.53-.3l-.63-1.34 2.32-2.81H9.3L7.76 7.93h-.09L8.22 4H6.59l-1.05 7.5h1.63l.27-1.94h.1l.43 1.12c.27.71.74.92 1.33.92.23 0 .6-.04.86-.11l.17-1.21z" />
3732
</svg>
3833
);
3934

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
10+
11+
import * as React from 'react';
12+
interface SVGRProps {
13+
title?: string;
14+
titleId?: string;
15+
}
16+
17+
const EuiIconTokenTag = ({
18+
title,
19+
titleId,
20+
...props
21+
}: React.SVGProps<SVGSVGElement> & SVGRProps) => (
22+
<svg
23+
width={16}
24+
height={16}
25+
viewBox="0 0 16 16"
26+
xmlns="http://www.w3.org/2000/svg"
27+
aria-labelledby={titleId}
28+
{...props}
29+
>
30+
{title ? <title id={titleId}>{title}</title> : null}
31+
<path d="M5.75 7.375a.25.25 0 00-.25.25v.75c0 .138.112.25.25.25h3.5a.25.25 0 00.25-.25v-.75a.25.25 0 00-.25-.25h-3.5z" />
32+
<path
33+
fillRule="evenodd"
34+
clipRule="evenodd"
35+
d="M3 5a1 1 0 011-1h5.989a1 1 0 01.825.436l2.05 3a1 1 0 010 1.128l-2.05 3A1 1 0 019.99 12H4a1 1 0 01-1-1V5zm1.25.75a.5.5 0 01.5-.5h4.745a.5.5 0 01.405.206l1.636 2.25a.5.5 0 010 .588L9.9 10.544a.5.5 0 01-.405.206H4.75a.5.5 0 01-.5-.5v-4.5z"
36+
/>
37+
</svg>
38+
);
39+
40+
export const icon = EuiIconTokenTag;

src/components/icon/icon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ const typeToPathMap = {
442442
tokenRankFeature: 'tokenRankFeature',
443443
tokenRankFeatures: 'tokenRankFeatures',
444444
tokenKeyword: 'tokenKeyword',
445+
tokenTag: 'tokenTag',
445446
tokenCompletionSuggester: 'tokenCompletionSuggester',
446447
tokenDenseVector: 'tokenDenseVector',
447448
tokenText: 'tokenText',
Lines changed: 3 additions & 6 deletions
Loading
Lines changed: 6 additions & 0 deletions
Loading

src/components/token/__snapshots__/token.test.tsx.snap

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ exports[`EuiToken props iconType as EuiTokenMapType tokenKey is rendered 1`] = `
415415

416416
exports[`EuiToken props iconType as EuiTokenMapType tokenKeyword is rendered 1`] = `
417417
<span
418-
class="euiToken euiToken--euiColorVis9 euiToken--square euiToken--light euiToken--small"
418+
class="euiToken euiToken--euiColorVis1 euiToken--square euiToken--light euiToken--small"
419419
>
420420
<span
421421
data-euiicon-type="tokenKeyword"
@@ -633,6 +633,16 @@ exports[`EuiToken props iconType as EuiTokenMapType tokenSymbol is rendered 1`]
633633
</span>
634634
`;
635635

636+
exports[`EuiToken props iconType as EuiTokenMapType tokenTag is rendered 1`] = `
637+
<span
638+
class="euiToken euiToken--euiColorVis9 euiToken--square euiToken--light euiToken--small"
639+
>
640+
<span
641+
data-euiicon-type="tokenTag"
642+
/>
643+
</span>
644+
`;
645+
636646
exports[`EuiToken props iconType as EuiTokenMapType tokenText is rendered 1`] = `
637647
<span
638648
class="euiToken euiToken--euiColorVis3 euiToken--square euiToken--light euiToken--small"

src/components/token/token_map.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type EuiTokenMapType =
5353
| 'tokenRankFeature'
5454
| 'tokenRankFeatures'
5555
| 'tokenKeyword'
56+
| 'tokenTag'
5657
| 'tokenCompletionSuggester'
5758
| 'tokenDenseVector'
5859
| 'tokenText'
@@ -244,10 +245,14 @@ export const TOKEN_MAP: {
244245
shape: 'square',
245246
color: 'euiColorVis3',
246247
},
247-
tokenKeyword: {
248+
tokenTag: {
248249
shape: 'square',
249250
color: 'euiColorVis9',
250251
},
252+
tokenKeyword: {
253+
shape: 'square',
254+
color: 'euiColorVis1',
255+
},
251256
tokenCompletionSuggester: {
252257
shape: 'square',
253258
color: 'euiColorVis1',

0 commit comments

Comments
 (0)