@onehat/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +92 -0
- package/OneHatUi.code-workspace +7 -0
- package/package.json +54 -0
- package/prettier.config.js +14 -0
- package/src/OneHatUi.js +24 -0
- package/src/index.js +13 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"eslint:recommended",
|
|
4
|
+
"plugin:react/recommended",
|
|
5
|
+
"plugin:cypress/recommended",
|
|
6
|
+
"prettier"
|
|
7
|
+
],
|
|
8
|
+
"plugins": [
|
|
9
|
+
"react-hooks",
|
|
10
|
+
"cypress",
|
|
11
|
+
"chai-friendly"
|
|
12
|
+
],
|
|
13
|
+
"env": {
|
|
14
|
+
"browser": true,
|
|
15
|
+
"node": true,
|
|
16
|
+
"cypress/globals": true
|
|
17
|
+
},
|
|
18
|
+
"parserOptions": {
|
|
19
|
+
"ecmaVersion": 9,
|
|
20
|
+
"sourceType": "module",
|
|
21
|
+
"ecmaFeatures": {
|
|
22
|
+
"jsx": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"globals": {
|
|
26
|
+
},
|
|
27
|
+
"rules": {
|
|
28
|
+
"react-hooks/rules-of-hooks": "error",
|
|
29
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
30
|
+
"no-unused-expressions": 0,
|
|
31
|
+
"chai-friendly/no-unused-expressions": 2,
|
|
32
|
+
"no-console": 0,
|
|
33
|
+
"no-debugger": 0,
|
|
34
|
+
"no-extra-parens": 0,
|
|
35
|
+
"curly": [
|
|
36
|
+
"error",
|
|
37
|
+
"all"
|
|
38
|
+
],
|
|
39
|
+
"dot-notation": 2,
|
|
40
|
+
"guard-for-in": 2,
|
|
41
|
+
"no-fallthrough": 0,
|
|
42
|
+
"no-floating-decimal": 0,
|
|
43
|
+
"no-implicit-globals": 0,
|
|
44
|
+
"no-implied-eval": 2,
|
|
45
|
+
"no-multi-spaces": 2,
|
|
46
|
+
"no-new": 2,
|
|
47
|
+
"no-new-func": 2,
|
|
48
|
+
"no-new-wrappers": 2,
|
|
49
|
+
"radix": 2,
|
|
50
|
+
"wrap-iife": [
|
|
51
|
+
"error",
|
|
52
|
+
"inside"
|
|
53
|
+
],
|
|
54
|
+
"yoda": 2,
|
|
55
|
+
"no-use-before-define": 0,
|
|
56
|
+
"block-spacing": 2,
|
|
57
|
+
"brace-style": [
|
|
58
|
+
"error",
|
|
59
|
+
"1tbs"
|
|
60
|
+
],
|
|
61
|
+
"comma-dangle": [
|
|
62
|
+
"error",
|
|
63
|
+
"only-multiline"
|
|
64
|
+
],
|
|
65
|
+
"consistent-this": [
|
|
66
|
+
"warn",
|
|
67
|
+
"oThis",
|
|
68
|
+
"that",
|
|
69
|
+
"me"
|
|
70
|
+
],
|
|
71
|
+
"indent": [
|
|
72
|
+
"error",
|
|
73
|
+
"tab",
|
|
74
|
+
{
|
|
75
|
+
"SwitchCase": 1,
|
|
76
|
+
"ignoreComments": true
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"quotes": [
|
|
80
|
+
"error",
|
|
81
|
+
"single"
|
|
82
|
+
],
|
|
83
|
+
"linebreak-style": [
|
|
84
|
+
"error",
|
|
85
|
+
"unix"
|
|
86
|
+
],
|
|
87
|
+
"semi": [
|
|
88
|
+
"error",
|
|
89
|
+
"always"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onehat/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Base UI for OneHat apps",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "npx cypress open --config-file ../cypress.json",
|
|
9
|
+
"docs": "jsdoc -c ./jsdoc.json -t ./node_modules/ink-docstrap/template -R README.md"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/OneHatRepo/ui.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"onehat",
|
|
17
|
+
"js",
|
|
18
|
+
"ui"
|
|
19
|
+
],
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Scott Spuler",
|
|
22
|
+
"company": "OneHat Technologies, LLC",
|
|
23
|
+
"url": "https://onehat.com"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/OneHatRepo/ui/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/OneHatRepo/ui#readme",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@onehat/data": "^1.8.25",
|
|
32
|
+
"js-cookie": "^3.0.1",
|
|
33
|
+
"native-base": "^3.4.25",
|
|
34
|
+
"react-hook-form": "^7.40.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "*",
|
|
38
|
+
"react-dom": "*",
|
|
39
|
+
"react-native": "*"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.20.5",
|
|
43
|
+
"@babel/node": "^7.20.5",
|
|
44
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
45
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
46
|
+
"@babel/preset-env": "^7.20.2",
|
|
47
|
+
"@babel/register": "^7.18.9",
|
|
48
|
+
"@babel/runtime": "^7.20.6",
|
|
49
|
+
"@cypress/webpack-preprocessor": "^5.15.7",
|
|
50
|
+
"babel-loader": "^9.1.0",
|
|
51
|
+
"cypress": "^12.1.0",
|
|
52
|
+
"webpack": "^5.75.0"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"printWidth": 80,
|
|
3
|
+
"tabWidth": 4,
|
|
4
|
+
"useTabs": true,
|
|
5
|
+
"semi": true,
|
|
6
|
+
"singleQuote": true,
|
|
7
|
+
"jsxSingleQuote": false,
|
|
8
|
+
"trailingComma": "es5",
|
|
9
|
+
"bracketSpacing": true,
|
|
10
|
+
"jsxBracketSameLine": false,
|
|
11
|
+
"arrowParens": "avoid",
|
|
12
|
+
"requirePragma": false,
|
|
13
|
+
"endOfLine": "auto"
|
|
14
|
+
};
|
package/src/OneHatUi.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @module OneHatUi */
|
|
2
|
+
|
|
3
|
+
import EventEmitter from '@onehat/events';
|
|
4
|
+
import _ from 'lodash';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @extends EventEmitter
|
|
8
|
+
*/
|
|
9
|
+
export class OneHatUi extends EventEmitter {
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
this.registerEvents([
|
|
16
|
+
'error',
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Create and export a singleton
|
|
23
|
+
const oneHatUi = new OneHatUi();
|
|
24
|
+
export default oneHatUi;
|