Skip to content
This repository was archived by the owner on Sep 29, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
index.js
node_modules
dist
build
78 changes: 16 additions & 62 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,75 +1,29 @@
{
"extends": ["airbnb-base", "prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true,
"node": true
},
"extends": ["airbnb"],
"globals": {
"it": true,
"describe": true,
"expect": true,
"jest": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"allowImportExportEverywhere": true,
"experimentalObjectRestSpread": true,
"jsx": true
},
"ecmaVersion": 2017,
"sourceType": "module"
},
"plugins": [
"react"
],
"plugins": ["react"],
"rules": {
"comma-dangle": 0,
"default-case": 2,
"eol-last": [2, "always"],
"import/extensions": [".js", ".jsx"],
"import/no-unresolved": 0,
"max-len": [1, { "tabWidth": 2 }],
"new-cap": [2, { "capIsNew": false }],
"no-console": 2,
"no-plusplus": 0,
"no-undef": 2,
"no-underscore-dangle": [
2,
{
"allowAfterThis": true,
"enforceInMethodNames": true
}
],
"no-unused-vars": [
2,
{
"args": "after-used",
"ignoreRestSiblings": false,
"vars": "all"
}
],
"object-shorthand": 2,
"prefer-const": 2,
"prefer-template": 2,
"quote-props": [2, "as-needed"],
"quotes": [2, "single", "avoid-escape"],
"react/jsx-boolean-value": 2,
"react/jsx-handler-names": 2,
"react/jsx-key": 2,
"react/jsx-no-bind": 2,
"react/jsx-no-literals": [2, {"noStrings": true}],
"react/jsx-sort-props": 2,
"react/jsx-uses-vars": 2,
"sort-keys": [
2,
"asc",
"error",
{
"caseSensitive": false
"vars": "local",
"args": "none"
}
],
"sort-vars": 2
"no-plusplus": "off",
"no-underscore-dangle": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"import/no-unresolved": "off"
}
}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
build
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": false
}
2 changes: 1 addition & 1 deletion .release-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"github": {
"release": true
}
}
}
4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
"recommendations": ["dbaeumer.vscode-eslint"]
}
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"files.eol": "\n"
}
"files.eol": "\n",
"editor.formatOnSave": true,
"eslint.enable": true
}
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,54 @@ Design system for Enterprise Web Apps
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)


## Getting Started

### Install

Install with npm:

```bash
npm install @afconsult/apollo --save
```

Install with [Yarn](https://yarnpkg.com/en/):

```bash
yarn add @afconsult/apollo
```

### Example

1. Import the stylesheet:

```jsx
import '@afconsult/apollo/dist/css/apollo.css';
```

2. Import required apollo components:

```jsx
import { Button, Form, FormGroup, Input, Label } from '@afconsult/apollo';
import {Button, Form, FormGroup, Input, Label} from '@afconsult/apollo';
```

3. Use the components:

```jsx
class Example extends React.PureComponent {
render() {
return (
<Form>
<FormGroup>
<Label for="example">Example Input</Label>
<Input id="example" placeholder="Inser text here.." />
</FormGroup>
<Button type="submit">Submit</Button>
</Form>
);
}
}
const Example = () => {
return (
<Form>
<FormGroup>
<Label for="example">Example Input</Label>
<Input id="example" placeholder="Inser text here.." />
</FormGroup>
<Button type="submit">Submit</Button>
</Form>
);
};
```

### Components

- [Alert](./src/components/Alert)
- [Avatar](./src/components/Avatar)
- [Badge](./src/components/Badge)
Expand All @@ -68,36 +75,45 @@ class Example extends React.PureComponent {
- [Tag](./src/components/Tag)

## Contribute

Feel free to [create an issue or feature request](https://github.com/afconsult/apollo/issues/new).

### Development

1. Install dependencies:

```bash
yarn install
```

2. Run examples at `http://localhost:8080/` with webpack dev server:

```bash
yarn run start
```

### Release

Note: you must have the GITHUB_TOKEN environment variable set to a valid GitHub token with write access to your repo.

1. Run release script and follow the instructions:

```bash
yarn run release
```

2. Run publish script to publish apollo to npm.

```bash
yarn run publish
```

## Authors

**Jon Wahlström** ([jonwa](https://github.com/jonwa))

See also the list of [contributors](https://github.com/afconsult/apollo/contributors).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = (process.env.NODE_ENV === 'production') ?
require('./dist/js/apollo.min.js') :
require('./dist/js/apollo.js');
module.exports =
process.env.NODE_ENV === 'production'
? require('./dist/js/apollo.min.js')
: require('./dist/js/apollo.js');
Loading