-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(icons): add icons documentation (#1217)
- Loading branch information
1 parent
d152365
commit 4a487a5
Showing
10 changed files
with
131 additions
and
16 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
packages/gatsby-theme-styleguide/src/gatsby-components/IconsLink/IconsLink.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
import { StaticQuery, graphql } from 'gatsby' | ||
|
||
const IconsLink = (props) => { | ||
const { children, ...rest } = props | ||
return ( | ||
<StaticQuery | ||
query={graphql` | ||
query IconsLstVersion { | ||
githubRelease(isCurrent: { eq: true }) { | ||
tagName | ||
} | ||
} | ||
`} | ||
render={(data) => { | ||
return ( | ||
<a | ||
{...rest} | ||
href={`https://github.com/adeo/design-system--styleguide/releases/download/${data.githubRelease.tagName}/icons.zip`} | ||
> | ||
{children} | ||
</a> | ||
) | ||
}} | ||
/> | ||
) | ||
} | ||
|
||
export default IconsLink |
1 change: 1 addition & 0 deletions
1
packages/gatsby-theme-styleguide/src/gatsby-components/IconsLink/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './IconsLink' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,9 +226,4 @@ | |
} | ||
} | ||
} | ||
|
||
// Overlay | ||
@at-root #{$parent}-overlay { | ||
@include set-page-overlay(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: 'Monochrome icons' | ||
order: 2 | ||
order: 3 | ||
--- | ||
|
||
<IconViewer type="monochrom" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: 'Coloured icons' | ||
order: 3 | ||
order: 4 | ||
--- | ||
|
||
<IconViewer type="color" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: 'Code' | ||
order: 2 | ||
status: | ||
scss: 'ready' | ||
figma: 'ready' | ||
react: 'ready' | ||
--- | ||
|
||
> Icons are considered as static assets. They are available in SVG and PDF, also they can be used as Vue, React and Svelte components. | ||
|
||
## Import | ||
|
||
The icon set can be downloaded using this link: | ||
<IconsLink> Download the Icon Kit here </IconsLink> | ||
|
||
The icon set can be added to your project dependencies: | ||
|
||
Using NPM: | ||
``` | ||
npm install --save-dev @mozaic-ds/icons | ||
``` | ||
|
||
Using Yarn: | ||
``` | ||
yarn add @mozaic-ds/icons | ||
``` | ||
|
||
## Usage | ||
All icon components are only wrappers for SVG. It has been done that way to facilitate the integration in your technology. | ||
|
||
### VueJs | ||
|
||
If you are a `@mozaic-ds/vue` or `@mozaic-ds/vue-3` users, you will be able to integrate the MIcon component. | ||
To know more about the `MIcon` follow [this documentation](https://adeo.github.io/mozaic-vue/?path=/docs/components-micon--default-story) | ||
|
||
### Angular | ||
|
||
The icon set doesn't contains Angular components. You must use the svgs icon type. | ||
In order to add the svgs to your project you can add the following code to your build: | ||
|
||
``` | ||
{ | ||
"glob": "**/*", | ||
"input": "./node_modules/@mozaic-ds/icons/svg/", | ||
"output": "./assets/images" | ||
} | ||
``` | ||
|
||
### React | ||
|
||
In order to use the icon set on React, you must install the `@mozaic-ds/icons` package. | ||
Once the package install you can import the needed icon into your code. | ||
> To find the icon's name, please refer to the icon catalog page. | ||
```js | ||
import {FullScreen48} from '@mozaic-ds/icons/react' | ||
``` | ||
|
||
### Web components | ||
|
||
In order to use the icon set on any technology, you can use our web components version. | ||
|
||
You must install the `mozaic-web-components` package. | ||
|
||
``` | ||
npm install --save-dev @mozaic-ds/mozaic-web-components | ||
``` | ||
|
||
You have to add the following to your code in order to import the web component. | ||
|
||
```js | ||
import ArrowArrowRight16 from '@mozaic-ds/mozaic-web-components/public/icons/ArrowArrowRight16.js'; | ||
|
||
if (!customElements.get('navigation-arrow-arrow--right-16px')) { | ||
customElements.define( | ||
'navigation-arrow-arrow--right-16px', | ||
ArrowArrowRight16 | ||
) | ||
} | ||
``` | ||
|
||
In order to use the web component you have to add to your HTML this: | ||
```html | ||
<navigation-arrow-arrow--right-16px></navigation-arrow-arrow--right-16px> | ||
``` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.