Skip to content

Commit

Permalink
Adding a namespace and module token. (#1839)
Browse files Browse the repository at this point in the history
* Adding a namespace and module token.

* Removing fill from the token svgs.

* Updating test snapshots.
  • Loading branch information
daveyholler authored Apr 18, 2019
1 parent 9187f1f commit 1a51009
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Adding `tokenModule` and `tokenNamespace` icons to `EuiToken` ([#1839](https://github.com/elastic/eui/pull/1839))
- Use `cache-loader` to speed up development docs site build ([#1841](https://github.com/elastic/eui/pull/1841)
- Converted `matching_options` to TS ([#1828](https://github.com/elastic/eui/pull/1828))
- Converted `EuiFormHelpText` to TS ([#1852](https://github.com/elastic/eui/pull/1852))
Expand Down
2 changes: 2 additions & 0 deletions src-docs/src/views/icon/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const tokens = [
'tokenInterface',
'tokenKey',
'tokenMethod',
'tokenModule',
'tokenNamespace',
'tokenNull',
'tokenNumber',
'tokenObject',
Expand Down
33 changes: 33 additions & 0 deletions src/components/icon/__snapshots__/icon.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5950,6 +5950,39 @@ exports[`EuiIcon props type tokenMethod is rendered 1`] = `
</svg>
`;

exports[`EuiIcon props type tokenModule is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 2l5.196 3v.178l-.866.468V5.5L8 3 3.67 5.5v5L8 13l4.33-2.5V5.77l.866-.474V11L8 14l-5.196-3V5L8 2z"
/>
<path
d="M5.243 4.429L9.597 7.04 8 7.928 3.743 5.563a.5.5 0 1 0-.486.874L7.5 8.794V13.5h1V8.794l4.243-2.357a.508.508 0 0 0 .06-.04l.392-.202V5.047l-.917.505a.573.573 0 0 0-.02.01l-.106.06-.191.105-1.355.753-4.849-2.909-.514.858z"
/>
</svg>
`;

exports[`EuiIcon props type tokenNamespace is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
focusable="false"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.556 8.416l-.804-1.68h-.036v5.64H5V4h1.992l2.292 3.96.804 1.68h.036V4h1.716v8.376H9.848l-2.292-3.96z"
/>
</svg>
`;

exports[`EuiIcon props type tokenNull is rendered 1`] = `
<svg
class="euiIcon euiIcon--medium"
Expand Down
4 changes: 4 additions & 0 deletions src/components/icon/assets/tokens/tokenModule.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/assets/tokens/tokenNamespace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ import tokenEnumMember from './assets/tokens/tokenEnumMember.svg';
import tokenRepo from './assets/tokens/tokenRepo.svg';
import tokenSymbol from './assets/tokens/tokenSymbol.svg';
import tokenFile from './assets/tokens/tokenFile.svg';
import tokenModule from './assets/tokens/tokenModule.svg';
import tokenNamespace from './assets/tokens/tokenNamespace.svg';

const typeToIconMap = {
addDataApp,
Expand Down Expand Up @@ -557,6 +559,8 @@ const typeToIconMap = {
tokenInterface,
tokenKey,
tokenMethod,
tokenModule,
tokenNamespace,
tokenNull,
tokenNumber,
tokenObject,
Expand Down
10 changes: 9 additions & 1 deletion src/components/token/token_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,12 @@ export const TOKEN_MAP = {
'color': 'tokenTint12',
'fill': true,
},
};
tokenNamespace: {
'shape': 'square',
'color': 'tokenTint01'
},
tokenModule: {
'shape': 'square',
'color': 'tokenTint09'
}
};

0 comments on commit 1a51009

Please sign in to comment.