@mjhls/mjh-framework 1.0.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/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # mjh-framework
2
+
3
+ > Foundation Framework
4
+
5
+ [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install --save mjh-framework
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```jsx
16
+ import React, { Component } from 'react'
17
+
18
+ import MyComponent from 'mjh-framework'
19
+
20
+ class Example extends Component {
21
+ render () {
22
+ return (
23
+ <MyComponent />
24
+ )
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## License
30
+
31
+ MIT © [mjh-framework](https://github.com/mjh-framework)
@@ -0,0 +1,113 @@
1
+ import React, { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ function styleInject(css, ref) {
5
+ if ( ref === void 0 ) ref = {};
6
+ var insertAt = ref.insertAt;
7
+
8
+ if (!css || typeof document === 'undefined') { return; }
9
+
10
+ var head = document.head || document.getElementsByTagName('head')[0];
11
+ var style = document.createElement('style');
12
+ style.type = 'text/css';
13
+
14
+ if (insertAt === 'top') {
15
+ if (head.firstChild) {
16
+ head.insertBefore(style, head.firstChild);
17
+ } else {
18
+ head.appendChild(style);
19
+ }
20
+ } else {
21
+ head.appendChild(style);
22
+ }
23
+
24
+ if (style.styleSheet) {
25
+ style.styleSheet.cssText = css;
26
+ } else {
27
+ style.appendChild(document.createTextNode(css));
28
+ }
29
+ }
30
+
31
+ var css = "/* add css styles here (optional) */\n\n.styles_test__3OKZ1 {\n display: inline-block;\n margin: 2em auto;\n border: 2px solid #000;\n font-size: 2em;\n}\n";
32
+ var styles = { "test": "styles_test__3OKZ1" };
33
+ styleInject(css);
34
+
35
+ var classCallCheck = function (instance, Constructor) {
36
+ if (!(instance instanceof Constructor)) {
37
+ throw new TypeError("Cannot call a class as a function");
38
+ }
39
+ };
40
+
41
+ var createClass = function () {
42
+ function defineProperties(target, props) {
43
+ for (var i = 0; i < props.length; i++) {
44
+ var descriptor = props[i];
45
+ descriptor.enumerable = descriptor.enumerable || false;
46
+ descriptor.configurable = true;
47
+ if ("value" in descriptor) descriptor.writable = true;
48
+ Object.defineProperty(target, descriptor.key, descriptor);
49
+ }
50
+ }
51
+
52
+ return function (Constructor, protoProps, staticProps) {
53
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
54
+ if (staticProps) defineProperties(Constructor, staticProps);
55
+ return Constructor;
56
+ };
57
+ }();
58
+
59
+ var inherits = function (subClass, superClass) {
60
+ if (typeof superClass !== "function" && superClass !== null) {
61
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
62
+ }
63
+
64
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
65
+ constructor: {
66
+ value: subClass,
67
+ enumerable: false,
68
+ writable: true,
69
+ configurable: true
70
+ }
71
+ });
72
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
73
+ };
74
+
75
+ var possibleConstructorReturn = function (self, call) {
76
+ if (!self) {
77
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
78
+ }
79
+
80
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
81
+ };
82
+
83
+ var ExampleComponent = function (_Component) {
84
+ inherits(ExampleComponent, _Component);
85
+
86
+ function ExampleComponent() {
87
+ classCallCheck(this, ExampleComponent);
88
+ return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments));
89
+ }
90
+
91
+ createClass(ExampleComponent, [{
92
+ key: 'render',
93
+ value: function render() {
94
+ var text = this.props.text;
95
+
96
+
97
+ return React.createElement(
98
+ 'div',
99
+ { className: styles.test },
100
+ 'Example Component: ',
101
+ text
102
+ );
103
+ }
104
+ }]);
105
+ return ExampleComponent;
106
+ }(Component);
107
+
108
+ ExampleComponent.propTypes = {
109
+ text: PropTypes.string
110
+ };
111
+
112
+ export default ExampleComponent;
113
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\n\nimport styles from './styles.css'\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n <div className={styles.test}>\n Example Component: {text}\n </div>\n )\n }\n}\n"],"names":["ExampleComponent","text","props","styles","test","Component","propTypes","PropTypes","string"],"mappings":";;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;EAC7B,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;EAC/B,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;;EAE5B,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;;EAExD,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EACrE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;EAC5C,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;;EAExB,IAAI,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;KAC3C,MAAM;MACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KACzB;GACF,MAAM;IACL,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;GACzB;;EAED,IAAI,KAAK,CAAC,UAAU,EAAE;IACpB,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;GAChC,MAAM;IACL,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;GACjD;CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICpBoBA;;;;;;;;;;6BAKV;UAELC,IAFK,GAGH,KAAKC,KAHF,CAELD,IAFK;;;aAML;;UAAK,WAAWE,OAAOC,IAAvB;;;OADF;;;;EAV0CC;;AAAzBL,iBACZM,YAAY;QACXC,UAAUC;;;;;"}
package/dist/index.js ADDED
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var React = require('react');
6
+ var React__default = _interopDefault(React);
7
+ var PropTypes = _interopDefault(require('prop-types'));
8
+
9
+ function styleInject(css, ref) {
10
+ if ( ref === void 0 ) ref = {};
11
+ var insertAt = ref.insertAt;
12
+
13
+ if (!css || typeof document === 'undefined') { return; }
14
+
15
+ var head = document.head || document.getElementsByTagName('head')[0];
16
+ var style = document.createElement('style');
17
+ style.type = 'text/css';
18
+
19
+ if (insertAt === 'top') {
20
+ if (head.firstChild) {
21
+ head.insertBefore(style, head.firstChild);
22
+ } else {
23
+ head.appendChild(style);
24
+ }
25
+ } else {
26
+ head.appendChild(style);
27
+ }
28
+
29
+ if (style.styleSheet) {
30
+ style.styleSheet.cssText = css;
31
+ } else {
32
+ style.appendChild(document.createTextNode(css));
33
+ }
34
+ }
35
+
36
+ var css = "/* add css styles here (optional) */\n\n.styles_test__3OKZ1 {\n display: inline-block;\n margin: 2em auto;\n border: 2px solid #000;\n font-size: 2em;\n}\n";
37
+ var styles = { "test": "styles_test__3OKZ1" };
38
+ styleInject(css);
39
+
40
+ var classCallCheck = function (instance, Constructor) {
41
+ if (!(instance instanceof Constructor)) {
42
+ throw new TypeError("Cannot call a class as a function");
43
+ }
44
+ };
45
+
46
+ var createClass = function () {
47
+ function defineProperties(target, props) {
48
+ for (var i = 0; i < props.length; i++) {
49
+ var descriptor = props[i];
50
+ descriptor.enumerable = descriptor.enumerable || false;
51
+ descriptor.configurable = true;
52
+ if ("value" in descriptor) descriptor.writable = true;
53
+ Object.defineProperty(target, descriptor.key, descriptor);
54
+ }
55
+ }
56
+
57
+ return function (Constructor, protoProps, staticProps) {
58
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
59
+ if (staticProps) defineProperties(Constructor, staticProps);
60
+ return Constructor;
61
+ };
62
+ }();
63
+
64
+ var inherits = function (subClass, superClass) {
65
+ if (typeof superClass !== "function" && superClass !== null) {
66
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
67
+ }
68
+
69
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
70
+ constructor: {
71
+ value: subClass,
72
+ enumerable: false,
73
+ writable: true,
74
+ configurable: true
75
+ }
76
+ });
77
+ if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
78
+ };
79
+
80
+ var possibleConstructorReturn = function (self, call) {
81
+ if (!self) {
82
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
83
+ }
84
+
85
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
86
+ };
87
+
88
+ var ExampleComponent = function (_Component) {
89
+ inherits(ExampleComponent, _Component);
90
+
91
+ function ExampleComponent() {
92
+ classCallCheck(this, ExampleComponent);
93
+ return possibleConstructorReturn(this, (ExampleComponent.__proto__ || Object.getPrototypeOf(ExampleComponent)).apply(this, arguments));
94
+ }
95
+
96
+ createClass(ExampleComponent, [{
97
+ key: 'render',
98
+ value: function render() {
99
+ var text = this.props.text;
100
+
101
+
102
+ return React__default.createElement(
103
+ 'div',
104
+ { className: styles.test },
105
+ 'Example Component: ',
106
+ text
107
+ );
108
+ }
109
+ }]);
110
+ return ExampleComponent;
111
+ }(React.Component);
112
+
113
+ ExampleComponent.propTypes = {
114
+ text: PropTypes.string
115
+ };
116
+
117
+ module.exports = ExampleComponent;
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\n\nimport styles from './styles.css'\n\nexport default class ExampleComponent extends Component {\n static propTypes = {\n text: PropTypes.string\n }\n\n render() {\n const {\n text\n } = this.props\n\n return (\n <div className={styles.test}>\n Example Component: {text}\n </div>\n )\n }\n}\n"],"names":["ExampleComponent","text","props","React","styles","test","Component","propTypes","PropTypes","string"],"mappings":";;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;EAC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
+ "author": "mjh-framework",
6
+ "license": "MIT",
7
+ "repository": "@mjhls/mjh-framework",
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.es.js",
10
+ "jsnext:main": "dist/index.es.js",
11
+ "engines": {
12
+ "node": ">=8",
13
+ "npm": ">=5"
14
+ },
15
+ "scripts": {
16
+ "test": "cross-env CI=1 react-scripts test --env=jsdom",
17
+ "test:watch": "react-scripts test --env=jsdom",
18
+ "build": "rollup -c",
19
+ "start": "rollup -c -w",
20
+ "prepare": "yarn run build",
21
+ "predeploy": "cd example && yarn install && yarn run build",
22
+ "deploy": "gh-pages -d example/build"
23
+ },
24
+ "peerDependencies": {
25
+ "prop-types": "^15.5.4",
26
+ "react": "^15.0.0 || ^16.0.0",
27
+ "react-dom": "^15.0.0 || ^16.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@svgr/rollup": "^2.4.1",
31
+ "babel-core": "^6.26.3",
32
+ "babel-eslint": "^8.2.5",
33
+ "babel-plugin-external-helpers": "^6.22.0",
34
+ "babel-preset-env": "^1.7.0",
35
+ "babel-preset-react": "^6.24.1",
36
+ "babel-preset-stage-0": "^6.24.1",
37
+ "cross-env": "^5.1.4",
38
+ "eslint": "^5.0.1",
39
+ "eslint-config-standard": "^11.0.0",
40
+ "eslint-config-standard-react": "^6.0.0",
41
+ "eslint-plugin-import": "^2.13.0",
42
+ "eslint-plugin-node": "^7.0.1",
43
+ "eslint-plugin-promise": "^4.0.0",
44
+ "eslint-plugin-react": "^7.10.0",
45
+ "eslint-plugin-standard": "^3.1.0",
46
+ "gh-pages": "^1.2.0",
47
+ "react": "^16.4.1",
48
+ "react-dom": "^16.4.1",
49
+ "react-scripts": "^1.1.4",
50
+ "rollup": "^0.64.1",
51
+ "rollup-plugin-babel": "^3.0.7",
52
+ "rollup-plugin-commonjs": "^9.1.3",
53
+ "rollup-plugin-node-resolve": "^3.3.0",
54
+ "rollup-plugin-peer-deps-external": "^2.2.0",
55
+ "rollup-plugin-postcss": "^1.6.2",
56
+ "rollup-plugin-url": "^1.4.0"
57
+ },
58
+ "files": [
59
+ "dist"
60
+ ]
61
+ }