Skip to content

Commit c8d8de3

Browse files
author
Steven Slack
authored
Merge pull request #31 from alleyinteractive/feature/NYP-13213/add-core-framework
NYP-13213 - Add core framework, drop IE support
2 parents e3f1ec2 + 6c585c2 commit c8d8de3

File tree

19 files changed

+6821
-2472
lines changed

19 files changed

+6821
-2472
lines changed

.babelrc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
{
2-
"plugins": [
3-
"transform-es2015-parameters",
4-
["@babel/transform-runtime", {
5-
"regenerator": true
6-
}],
7-
"@babel/plugin-transform-spread"
8-
],
9-
"presets": [
10-
["@babel/preset-env"]
11-
]
2+
"plugins": ["@babel/plugin-transform-runtime"],
3+
"presets": ["@babel/preset-env"]
124
}

.eslintrc

Lines changed: 0 additions & 66 deletions
This file was deleted.

.eslintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["airbnb"],
8+
"parser": "@babel/eslint-parser",
9+
"parserOptions": {
10+
"ecmaFeatures": {
11+
"globalReturn": true,
12+
"impliedStrict": true
13+
},
14+
"sourceType": "module"
15+
},
16+
"rules": {
17+
"max-len": [
18+
"error", { "ignoreComments": true }
19+
]
20+
},
21+
"settings": {
22+
"react": {
23+
"version": "999.999.999"
24+
}
25+
}
26+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/lib/
2+
/core/
23
/node_modules/
34
*.sublime-*

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Component Starter Framework
1+
# Component Framework
22

33
A framework for attaching an ES6 class to a DOM element or collection of DOM elements, making it easier to organize the DOM interactions on your website.
44

@@ -16,6 +16,38 @@ The library will ...
1616

1717
This results in distinct (and encapsulated) functionality for each DOM element.
1818

19+
## Getting Started
20+
21+
Install the js-component-framework and all the plugins:
22+
```bash
23+
npm install js-component-framework
24+
```
25+
Below is a basic set up for using the component framework without the included Aria plugins:
26+
27+
```javascript
28+
// Import only the core component framework library.
29+
import { Component } from 'js-component-framework/core';
30+
31+
/**
32+
* Custom component which extends the base component class.
33+
*/
34+
class MyComponent extends Component {
35+
36+
/**
37+
* Start the component
38+
*/
39+
constructor(config) {
40+
super(config);
41+
}
42+
}
43+
```
44+
45+
If you also want to use the entire framework with the bundled Aria plugins use the default import:
46+
```js
47+
import { Component, plugins } from 'js-component-framework';
48+
```
49+
50+
1951
## Best practices for creating components
2052

2153
### Create one directory per component

examples/Header/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class Header extends Component {
1717
// Other Options
1818
this.offset = this.options.offset;
1919

20-
// Initalizations
20+
// Initializations
2121
this.init();
2222
}
2323

0 commit comments

Comments
 (0)