@npm_leadtech/legal-lib-components 0.3.18 → 0.3.20
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 +1 -0
- package/dist/Button.js +41 -0
- package/package.json +6 -2
- package/.eslintignore +0 -1
- package/.eslintrc +0 -31
- package/.huskyrc +0 -5
- package/.prettierignore +0 -1
- package/.prettierrc +0 -19
- package/.storybook/main.js +0 -15
- package/.storybook/preview.js +0 -3
- package/babel.config.js +0 -3
- package/rollup.config.js +0 -41
- package/src/components/atoms/Button/Button.scss +0 -4
- package/src/components/atoms/Button/__stories__/Button.stories.js +0 -20
- package/src/components/atoms/Button/__tests__/Button.test.jsx +0 -10
- package/src/components/atoms/Button/index.jsx +0 -11
- package/src/index.js +0 -2
- package/webpack.config.js +0 -29
package/README
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Test
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function styleInject(css, ref) {
|
|
4
|
+
if ( ref === void 0 ) ref = {};
|
|
5
|
+
var insertAt = ref.insertAt;
|
|
6
|
+
|
|
7
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
8
|
+
|
|
9
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
10
|
+
var style = document.createElement('style');
|
|
11
|
+
style.type = 'text/css';
|
|
12
|
+
|
|
13
|
+
if (insertAt === 'top') {
|
|
14
|
+
if (head.firstChild) {
|
|
15
|
+
head.insertBefore(style, head.firstChild);
|
|
16
|
+
} else {
|
|
17
|
+
head.appendChild(style);
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
head.appendChild(style);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (style.styleSheet) {
|
|
24
|
+
style.styleSheet.cssText = css;
|
|
25
|
+
} else {
|
|
26
|
+
style.appendChild(document.createTextNode(css));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var css_248z = ".primary {\n background-color: blue;\n color: white; }\n";
|
|
31
|
+
styleInject(css_248z);
|
|
32
|
+
|
|
33
|
+
var Button = function Button(_ref) {
|
|
34
|
+
var _ref$message = _ref.message,
|
|
35
|
+
message = _ref$message === void 0 ? 'Hello world' : _ref$message;
|
|
36
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
37
|
+
className: "primary"
|
|
38
|
+
}, message);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default Button;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@npm_leadtech/legal-lib-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.20",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"react": "^17.0.1",
|
|
6
6
|
"react-dom": "^17.0.1"
|
|
@@ -71,5 +71,9 @@
|
|
|
71
71
|
"moduleNameMapper": {
|
|
72
72
|
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
"files": [
|
|
76
|
+
"dist"
|
|
77
|
+
],
|
|
78
|
+
"main": "dist/index.js"
|
|
75
79
|
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist/
|
package/.eslintrc
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": [
|
|
3
|
-
"plugin:react/recommended",
|
|
4
|
-
"plugin:react-hooks/recommended",
|
|
5
|
-
"prettier",
|
|
6
|
-
"plugin:prettier/recommended",
|
|
7
|
-
"eslint-config-prettier"
|
|
8
|
-
],
|
|
9
|
-
"plugins": ["eslint-plugin-prettier"],
|
|
10
|
-
"rules": {
|
|
11
|
-
"prettier/prettier": "error",
|
|
12
|
-
"react/prop-types": "warn",
|
|
13
|
-
"no-unused-vars": "warn",
|
|
14
|
-
"no-useless-escape": "warn",
|
|
15
|
-
"no-control-regex": "warn",
|
|
16
|
-
"react/jsx-no-undef": "warn",
|
|
17
|
-
"react-hooks/exhaustive-deps": "warn",
|
|
18
|
-
"react-hooks/rules-of-hooks": "warn"
|
|
19
|
-
},
|
|
20
|
-
"parser": "babel-eslint",
|
|
21
|
-
"env": {
|
|
22
|
-
"browser": true,
|
|
23
|
-
"es6": true
|
|
24
|
-
},
|
|
25
|
-
"settings": {
|
|
26
|
-
"react": {
|
|
27
|
-
"version": "detect"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
package/.huskyrc
DELETED
package/.prettierignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist/
|
package/.prettierrc
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"endOfLine": "lf",
|
|
3
|
-
"bracketSpacing": true,
|
|
4
|
-
"embeddedLanguageFormatting": "auto",
|
|
5
|
-
"htmlWhitespaceSensitivity": "css",
|
|
6
|
-
"insertPragma": false,
|
|
7
|
-
"jsxBracketSameLine": false,
|
|
8
|
-
"proseWrap": "preserve",
|
|
9
|
-
"quoteProps": "as-needed",
|
|
10
|
-
"requirePragma": false,
|
|
11
|
-
"semi": true,
|
|
12
|
-
"singleQuote": true,
|
|
13
|
-
"tabWidth": 2,
|
|
14
|
-
"trailingComma": "es5",
|
|
15
|
-
"useTabs": false,
|
|
16
|
-
"printWidth": 120,
|
|
17
|
-
"arrowParens": "always",
|
|
18
|
-
"jsxSingleQuote": true
|
|
19
|
-
}
|
package/.storybook/main.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
stories: ['../src/components/**/**/*.stories.js'],
|
|
5
|
-
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
|
6
|
-
webpackFinal: async (config, { configType }) => {
|
|
7
|
-
config.module.rules.push({
|
|
8
|
-
test: /\.scss$/,
|
|
9
|
-
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
10
|
-
include: path.resolve(__dirname, '../src'),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
return config;
|
|
14
|
-
},
|
|
15
|
-
};
|
package/.storybook/preview.js
DELETED
package/babel.config.js
DELETED
package/rollup.config.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import babel from 'rollup-plugin-babel';
|
|
2
|
-
import url from '@rollup/plugin-url';
|
|
3
|
-
import postcss from 'rollup-plugin-postcss';
|
|
4
|
-
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
const commonConfig = {
|
|
8
|
-
external: ['prop-types', 'react', 'react-dom', 'react-scripts'],
|
|
9
|
-
plugins: [
|
|
10
|
-
postcss({
|
|
11
|
-
extensions: ['.scss'],
|
|
12
|
-
}),
|
|
13
|
-
babel({
|
|
14
|
-
presets: ['react-app'],
|
|
15
|
-
plugins: [
|
|
16
|
-
'@babel/plugin-proposal-object-rest-spread',
|
|
17
|
-
'@babel/plugin-proposal-optional-chaining',
|
|
18
|
-
'@babel/plugin-syntax-dynamic-import',
|
|
19
|
-
'@babel/plugin-proposal-class-properties',
|
|
20
|
-
],
|
|
21
|
-
exclude: 'node_modules/**',
|
|
22
|
-
runtimeHelpers: true,
|
|
23
|
-
}),
|
|
24
|
-
url({ limit: 0 }),
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const componentNames = ['Button'];
|
|
29
|
-
|
|
30
|
-
const Components = componentNames.map((name) => ({
|
|
31
|
-
input: path.join(__dirname, `src/components/atoms/${name}/index.jsx`),
|
|
32
|
-
output: {
|
|
33
|
-
file: path.join(__dirname, `dist/${name}.js`),
|
|
34
|
-
name: '@Components',
|
|
35
|
-
format: 'esm',
|
|
36
|
-
sourcemap: false,
|
|
37
|
-
},
|
|
38
|
-
...commonConfig,
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
export default Components;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Button from '../index';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
component: Button,
|
|
7
|
-
title: 'Atoms/Button',
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const Template = (args) => <Button {...args} />;
|
|
11
|
-
|
|
12
|
-
export const Default = Template.bind({});
|
|
13
|
-
Default.args = {
|
|
14
|
-
message: 'Default',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Secondary = Template.bind({});
|
|
18
|
-
Secondary.args = {
|
|
19
|
-
message: 'Secondary',
|
|
20
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cleanup, render } from '@testing-library/react';
|
|
3
|
-
import Button from '../index';
|
|
4
|
-
|
|
5
|
-
afterEach(cleanup);
|
|
6
|
-
|
|
7
|
-
it('render component Button with label', () => {
|
|
8
|
-
const { getByText } = render(<Button message='Kappa' />);
|
|
9
|
-
expect(getByText('Kappa')).toBeTruthy();
|
|
10
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import './Button.scss';
|
|
4
|
-
|
|
5
|
-
const Button = ({ message = 'Hello world' }) => <button className='primary'>{message}</button>;
|
|
6
|
-
|
|
7
|
-
Button.propTypes = {
|
|
8
|
-
message: PropTypes.string,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default Button;
|
package/src/index.js
DELETED
package/webpack.config.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
3
|
-
const nodeExternals = require('webpack-node-externals');
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
entry: './src/index.js',
|
|
7
|
-
externals: [nodeExternals()],
|
|
8
|
-
output: {
|
|
9
|
-
filename: 'index.js',
|
|
10
|
-
path: path.resolve(__dirname, 'dist'),
|
|
11
|
-
library: '',
|
|
12
|
-
libraryTarget: 'commonjs',
|
|
13
|
-
},
|
|
14
|
-
plugins: [new CleanWebpackPlugin()],
|
|
15
|
-
module: {
|
|
16
|
-
rules: [
|
|
17
|
-
{
|
|
18
|
-
test: /\.(js|jsx)$/,
|
|
19
|
-
exclude: /node_modules/,
|
|
20
|
-
use: ['babel-loader'],
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
test: /\.scss$/,
|
|
24
|
-
use: ['style-loader', 'css-loader', 'sass-loader'],
|
|
25
|
-
include: path.resolve(__dirname, './src'),
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
};
|