Skip to content

Commit

Permalink
[EuiIcon] Add tokenSemanticText glyph (#7971)
Browse files Browse the repository at this point in the history
Co-authored-by: Cee Chen <[email protected]>. Merged by @1Copenut on request from @mdefazio.
  • Loading branch information
mdefazio committed Aug 22, 2024
1 parent 6d3d52d commit 3f092c1
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/eui/changelogs/upcoming/7971.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Updated `EuiIcon` with a new `tokenSemanticText` glyph

1 change: 1 addition & 0 deletions packages/eui/src-docs/src/views/icon/tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const tokens: EuiTokenMapType[] = [
'tokenRankFeatures',
'tokenRepo',
'tokenSearchType',
'tokenSemanticText',
'tokenShape',
'tokenString',
'tokenStruct',
Expand Down
18 changes: 18 additions & 0 deletions packages/eui/src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10893,6 +10893,24 @@ exports[`EuiIcon props type tokenSearchType is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type tokenSemanticText is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon emotion-euiIcon-m-isLoaded"
data-icon-type="tokenSemanticText"
data-is-loaded="true"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11ZM13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2ZM9.098 4.5l-.244 1.393h.896l-.212 1.211h-.896l-.435 2.574c-.024.176-.013.308.034.398.046.09.163.138.35.145.072.004.22-.005.445-.026L8.91 11.46a2.75 2.75 0 0 1-.916.129c-.528-.007-.923-.162-1.186-.466-.262-.304-.37-.716-.32-1.237l.455-2.78H6.25l.207-1.212h.694L7.394 4.5h1.704Z"
/>
</svg>
`;

exports[`EuiIcon props type tokenShape is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down
34 changes: 34 additions & 0 deletions packages/eui/src/components/icon/assets/tokenSemanticText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js

import * as React from 'react';
import type { SVGProps } from 'react';
interface SVGRProps {
title?: string;
titleId?: string;
}
const EuiIconTokenSemanticText = ({
title,
titleId,
...props
}: SVGProps<SVGSVGElement> & SVGRProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width={16}
height={16}
viewBox="0 0 16 16"
aria-labelledby={titleId}
{...props}
>
{title ? <title id={titleId}>{title}</title> : null}
<path d="M2 2.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1H3v10h1.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5v-11ZM13.5 2a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1H13V3h-1.5a.5.5 0 0 1 0-1h2ZM9.098 4.5l-.244 1.393h.896l-.212 1.211h-.896l-.435 2.574c-.024.176-.013.308.034.398.046.09.163.138.35.145.072.004.22-.005.445-.026L8.91 11.46a2.75 2.75 0 0 1-.916.129c-.528-.007-.923-.162-1.186-.466-.262-.304-.37-.716-.32-1.237l.455-2.78H6.25l.207-1.212h.694L7.394 4.5h1.704Z" />
</svg>
);
export const icon = EuiIconTokenSemanticText;
1 change: 1 addition & 0 deletions packages/eui/src/components/icon/icon_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ export const typeToPathMap = {
tokenRankFeatures: 'tokenRankFeatures',
tokenRepo: 'tokenRepo',
tokenSearchType: 'tokenSearchType',
tokenSemanticText: 'tokenSemanticText',
tokenShape: 'tokenShape',
tokenString: 'tokenString',
tokenStruct: 'tokenStruct',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ exports[`EuiToken props iconType as EuiTokenMapType tokenSearchType is rendered
</span>
`;

exports[`EuiToken props iconType as EuiTokenMapType tokenSemanticText is rendered 1`] = `
<span
class="euiToken emotion-euiToken-square-light-s-euiColorVis0"
>
<span
data-euiicon-type="tokenSemanticText"
/>
</span>
`;

exports[`EuiToken props iconType as EuiTokenMapType tokenShape is rendered 1`] = `
<span
class="euiToken emotion-euiToken-circle-light-s-euiColorVis8"
Expand Down
5 changes: 5 additions & 0 deletions packages/eui/src/components/token/token_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type EuiTokenMapType =
| 'tokenRankFeatures'
| 'tokenRepo'
| 'tokenSearchType'
| 'tokenSemanticText'
| 'tokenShape'
| 'tokenString'
| 'tokenStruct'
Expand Down Expand Up @@ -255,6 +256,10 @@ export const TOKEN_MAP: {
shape: 'square',
color: 'euiColorVis5',
},
tokenSemanticText: {
shape: 'square',
color: 'euiColorVis0',
},
tokenShape: {
shape: 'circle',
color: 'euiColorVis8',
Expand Down

0 comments on commit 3f092c1

Please sign in to comment.