-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from geoblink/add-helper-to-mock-pro-icons
Add helper to mock pro icons
- Loading branch information
Showing
13 changed files
with
233 additions
and
48 deletions.
There are no files selected for viewing
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,3 +1,4 @@ | ||
node_modules/* | ||
dist/* | ||
test/unit/coverage/* | ||
public/* |
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,76 @@ | ||
[](https://www.npmjs.com/package/@geoblink/design-system) | ||
[](https://travis-ci.com/geoblink/design-system) | ||
[](https://codecov.io/gh/geoblink/design-system) | ||
|
||
## Getting started | ||
|
||
To install this library first you have to add it to your dependencies: | ||
|
||
```sh | ||
yarn add @geoblink/design-system | ||
``` | ||
|
||
```sh | ||
npm i -P @geoblink/design-system | ||
``` | ||
|
||
After that, you must install it in your Vue instance: | ||
|
||
```js{2,6} | ||
import Vue from 'vue' | ||
import GeoblinkDesignSystem from '@geoblink/design-system' | ||
// ... | ||
Vue.use(GeoblinkDesignSystem) | ||
// ... | ||
``` | ||
|
||
Finally you have to import the styles. | ||
You can import the built CSS styles or the raw SCSS file (which include the design tokens as variables): | ||
|
||
```css | ||
@import '~@geoblink/design-system/dist/system.css'; | ||
``` | ||
|
||
```scss | ||
@import '~@geoblink/design-system/dist/system.utils.scss'; | ||
``` | ||
|
||
Depending on your bundler settings you can import it in your JavaScript bundle, too: | ||
|
||
```js | ||
import '@geoblink/design-system/dist/system.css' | ||
``` | ||
|
||
```js | ||
import '@geoblink/design-system/dist/system.utils.scss' | ||
``` | ||
|
||
Finally you'll be able use any component from the Design System like they are | ||
used in the demos: | ||
|
||
```vue | ||
<template> | ||
<geo-primary-button @click="doSomething()"> | ||
Do something! | ||
</geo-primary-button> | ||
</template> | ||
<script> | ||
export default { | ||
methods: { | ||
doSomething () { | ||
alert('Do something!') | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
|
||
 | ||
|
||
## Documentation | ||
|
||
Documentation for latest stable version is available at [https://geoblink-design-system.now.sh/](https://geoblink-design-system.now.sh/). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
// https://github.com/michael-ciniawsky/postcss-load-config | ||
|
||
module.exports = { | ||
plugins: { | ||
'postcss-import': {}, | ||
'postcss-url': {}, | ||
// to edit target browsers: use "browserslist" field in package.json | ||
autoprefixer: {} | ||
}, | ||
} |
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
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
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
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
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,46 @@ | ||
import { fas } from '@fortawesome/free-solid-svg-icons' | ||
|
||
const _ = require('lodash') | ||
|
||
export default function mockFontAwesomeProIcons (library) { | ||
const iconsToMock = [ | ||
'faChevronUp', | ||
'faChevronDown', | ||
'faChevronLeft', | ||
'faChevronRight', | ||
'faStepBackward', | ||
'faStepForward', | ||
'faCaretUp', | ||
'faCaretDown', | ||
'faLock', | ||
'faUpload', | ||
'faCheckCircle', | ||
'faExclamationTriangle', | ||
'faLightbulb', | ||
'faThumbsUp', | ||
'faEllipsisV', | ||
'faTimes', | ||
'faCheck', | ||
'faSearch' | ||
] | ||
|
||
const mockedFalIcons = _.mapValues(_.pick(fas, iconsToMock), function (original) { | ||
return _.assign({}, original, { | ||
prefix: 'fal' | ||
}) | ||
}) | ||
|
||
const nonExistingIconsToMock = { | ||
'external-link-square': 'faExternalLinkSquareAlt', | ||
'lock-alt': 'faLock' | ||
} | ||
const mockedNonExistingIcons = _.mapValues( | ||
nonExistingIconsToMock, | ||
(mockedIconKey, originalIconName) => _.assign({}, fas[mockedIconKey], { | ||
prefix: 'fal', | ||
iconName: originalIconName | ||
}) | ||
) | ||
|
||
library.add(mockedFalIcons, mockedNonExistingIcons) | ||
} |
cea9741
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs:
cea9741
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs:
cea9741
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: