Skip to content

Commit

Permalink
Metric Counter and Gauge Token Additions (#6064)
Browse files Browse the repository at this point in the history
* added new metric counter and gauge tokens

* put tokens in alpha order

* added changelog
  • Loading branch information
MichaelMarcialis authored Jul 20, 2022
1 parent 48d0ba1 commit 63ff92f
Show file tree
Hide file tree
Showing 10 changed files with 333 additions and 184 deletions.
48 changes: 25 additions & 23 deletions src-docs/src/views/icon/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,59 @@ import {
} from '../../../../src/components';

const tokens = [
'tokenString',
'tokenNumber',
'tokenBoolean',
'tokenDate',
'tokenGeo',
'tokenIP',
'tokenShape',
'tokenNested',
'tokenAlias',
'tokenRange',
'tokenAnnotation',
'tokenArray',
'tokenBinary',
'tokenBoolean',
'tokenClass',
'tokenCompletionSuggester',
'tokenConstant',
'tokenDate',
'tokenDenseVector',
'tokenElement',
'tokenEnum',
'tokenEnumMember',
'tokenEvent',
'tokenException',
'tokenField',
'tokenFile',
'tokenFlattened',
'tokenFunction',
'tokenGeo',
'tokenHistogram',
'tokenInterface',
'tokenIP',
'tokenJoin',
'tokenKey',
'tokenKeyword',
'tokenMethod',
'tokenMetricCounter',
'tokenMetricGauge',
'tokenModule',
'tokenNamespace',
'tokenNested',
'tokenNull',
'tokenNumber',
'tokenObject',
'tokenOperator',
'tokenPackage',
'tokenParameter',
'tokenProperty',
'tokenStruct',
'tokenVariable',
'tokenFile',
'tokenSymbol',
'tokenRepo',
'tokenBinary',
'tokenJoin',
'tokenPercolator',
'tokenFlattened',
'tokenProperty',
'tokenRange',
'tokenRankFeature',
'tokenRankFeatures',
'tokenKeyword',
'tokenRepo',
'tokenSearchType',
'tokenShape',
'tokenString',
'tokenStruct',
'tokenSymbol',
'tokenTag',
'tokenCompletionSuggester',
'tokenDenseVector',
'tokenText',
'tokenTokenCount',
'tokenSearchType',
'tokenHistogram',
'tokenVariable',
];

export default () => (
Expand Down
38 changes: 38 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9935,6 +9935,44 @@ exports[`EuiIcon props type tokenMethod is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type tokenMetricCounter is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon emotion-euiIcon-m-isLoaded"
data-icon-type="tokenMetricCounter"
data-is-loaded="true"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M11 3a1 1 0 00-1 1v1H9a1 1 0 000 2h1v1a1 1 0 102 0V7h1a1 1 0 100-2h-1V4a1 1 0 00-1-1zM5 7a1 1 0 00-1 1v1H3a1 1 0 000 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2H6V8a1 1 0 00-1-1z"
/>
</svg>
`;

exports[`EuiIcon props type tokenMetricGauge is rendered 1`] = `
<svg
aria-hidden="true"
class="euiIcon emotion-euiIcon-m-isLoaded"
data-icon-type="tokenMetricGauge"
data-is-loaded="true"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5 4h-.5a.5.5 0 010-1h1a.5.5 0 01.5.5v9a.5.5 0 01-.5.5h-1a.5.5 0 010-1H5v-2h-.5a.5.5 0 010-1H5V7h-.5a.5.5 0 010-1H5V4zm3 1a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1V6a1 1 0 00-1-1H8z"
/>
</svg>
`;

exports[`EuiIcon props type tokenModule is rendered 1`] = `
<svg
aria-hidden="true"
Expand Down
35 changes: 35 additions & 0 deletions src/components/icon/assets/tokenMetricCounter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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';
interface SVGRProps {
title?: string;
titleId?: string;
}

const EuiIconTokenMetricCounter = ({
title,
titleId,
...props
}: React.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="M11 3a1 1 0 00-1 1v1H9a1 1 0 000 2h1v1a1 1 0 102 0V7h1a1 1 0 100-2h-1V4a1 1 0 00-1-1zM5 7a1 1 0 00-1 1v1H3a1 1 0 000 2h1v1a1 1 0 102 0v-1h1a1 1 0 100-2H6V8a1 1 0 00-1-1z" />
</svg>
);

export const icon = EuiIconTokenMetricCounter;
35 changes: 35 additions & 0 deletions src/components/icon/assets/tokenMetricGauge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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';
interface SVGRProps {
title?: string;
titleId?: string;
}

const EuiIconTokenMetricGauge = ({
title,
titleId,
...props
}: React.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="M5 4h-.5a.5.5 0 010-1h1a.5.5 0 01.5.5v9a.5.5 0 01-.5.5h-1a.5.5 0 010-1H5v-2h-.5a.5.5 0 010-1H5V7h-.5a.5.5 0 010-1H5V4zm3 1a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1V6a1 1 0 00-1-1H8z" />
</svg>
);

export const icon = EuiIconTokenMetricGauge;
74 changes: 38 additions & 36 deletions src/components/icon/icon_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,55 +406,57 @@ export const typeToPathMap = {
workplaceSearchApp: 'app_workplace_search',
wrench: 'wrench',
// Token Icon Imports
tokenAlias: 'tokenAlias',
tokenAnnotation: 'tokenAnnotation',
tokenArray: 'tokenArray',
tokenBinary: 'tokenBinary',
tokenBoolean: 'tokenBoolean',
tokenClass: 'tokenClass',
tokenProperty: 'tokenProperty',
tokenCompletionSuggester: 'tokenCompletionSuggester',
tokenConstant: 'tokenConstant',
tokenDate: 'tokenDate',
tokenDenseVector: 'tokenDenseVector',
tokenElement: 'tokenElement',
tokenEnum: 'tokenEnum',
tokenVariable: 'tokenVariable',
tokenMethod: 'tokenMethod',
tokenAnnotation: 'tokenAnnotation',
tokenEnumMember: 'tokenEnumMember',
tokenEvent: 'tokenEvent',
tokenException: 'tokenException',
tokenInterface: 'tokenInterface',
tokenParameter: 'tokenParameter',
tokenField: 'tokenField',
tokenElement: 'tokenElement',
tokenFile: 'tokenFile',
tokenFlattened: 'tokenFlattened',
tokenFunction: 'tokenFunction',
tokenBoolean: 'tokenBoolean',
tokenString: 'tokenString',
tokenArray: 'tokenArray',
tokenNumber: 'tokenNumber',
tokenConstant: 'tokenConstant',
tokenObject: 'tokenObject',
tokenEvent: 'tokenEvent',
tokenGeo: 'tokenGeo',
tokenHistogram: 'tokenHistogram',
tokenInterface: 'tokenInterface',
tokenIP: 'tokenIP',
tokenJoin: 'tokenJoin',
tokenKey: 'tokenKey',
tokenNull: 'tokenNull',
tokenStruct: 'tokenStruct',
tokenPackage: 'tokenPackage',
tokenOperator: 'tokenOperator',
tokenEnumMember: 'tokenEnumMember',
tokenRepo: 'tokenRepo',
tokenSymbol: 'tokenSymbol',
tokenFile: 'tokenFile',
tokenKeyword: 'tokenKeyword',
tokenMethod: 'tokenMethod',
tokenMetricCounter: 'tokenMetricCounter',
tokenMetricGauge: 'tokenMetricGauge',
tokenModule: 'tokenModule',
tokenNamespace: 'tokenNamespace',
tokenDate: 'tokenDate',
tokenIP: 'tokenIP',
tokenNested: 'tokenNested',
tokenAlias: 'tokenAlias',
tokenShape: 'tokenShape',
tokenGeo: 'tokenGeo',
tokenRange: 'tokenRange',
tokenBinary: 'tokenBinary',
tokenJoin: 'tokenJoin',
tokenNull: 'tokenNull',
tokenNumber: 'tokenNumber',
tokenObject: 'tokenObject',
tokenOperator: 'tokenOperator',
tokenPackage: 'tokenPackage',
tokenParameter: 'tokenParameter',
tokenPercolator: 'tokenPercolator',
tokenFlattened: 'tokenFlattened',
tokenProperty: 'tokenProperty',
tokenRange: 'tokenRange',
tokenRankFeature: 'tokenRankFeature',
tokenRankFeatures: 'tokenRankFeatures',
tokenKeyword: 'tokenKeyword',
tokenRepo: 'tokenRepo',
tokenSearchType: 'tokenSearchType',
tokenShape: 'tokenShape',
tokenString: 'tokenString',
tokenStruct: 'tokenStruct',
tokenSymbol: 'tokenSymbol',
tokenTag: 'tokenTag',
tokenCompletionSuggester: 'tokenCompletionSuggester',
tokenDenseVector: 'tokenDenseVector',
tokenText: 'tokenText',
tokenTokenCount: 'tokenTokenCount',
tokenSearchType: 'tokenSearchType',
tokenHistogram: 'tokenHistogram',
tokenVariable: 'tokenVariable',
};
3 changes: 3 additions & 0 deletions src/components/icon/svgs/tokens/tokenMetricCounter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/icon/svgs/tokens/tokenMetricGauge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/components/token/__snapshots__/token.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,26 @@ exports[`EuiToken props iconType as EuiTokenMapType tokenMethod is rendered 1`]
</span>
`;

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

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

exports[`EuiToken props iconType as EuiTokenMapType tokenModule is rendered 1`] = `
<span
class="euiToken euiToken--euiColorVis4 euiToken--square euiToken--light euiToken--small"
Expand Down
Loading

0 comments on commit 63ff92f

Please sign in to comment.