@newton_duarte/reusable-components 1.0.0 → 1.0.1
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/lib/cjs/components/CustomButton/CustomButton.js +9 -0
- package/lib/cjs/components/CustomButton/CustomButton.styles.js +19 -0
- package/lib/cjs/components/CustomButton/index.js +5 -0
- package/lib/cjs/components/CustomTextField/CustomTextField.js +9 -0
- package/lib/cjs/components/CustomTextField/CustomTextField.styles.js +22 -0
- package/lib/cjs/components/CustomTextField/index.js +5 -0
- package/lib/cjs/index.js +7 -0
- package/lib/esm/components/CustomButton/CustomButton.js +7 -0
- package/lib/esm/components/CustomButton/CustomButton.styles.js +16 -0
- package/lib/esm/components/CustomButton/index.js +1 -0
- package/lib/esm/components/CustomTextField/CustomTextField.js +7 -0
- package/lib/esm/components/CustomTextField/CustomTextField.styles.js +19 -0
- package/lib/esm/components/CustomTextField/index.js +1 -0
- package/lib/esm/index.js +2 -0
- package/lib/types/components/CustomButton/CustomButton.styles.d.ts +1 -1
- package/package.json +7 -10
- package/lib/index.cjs +0 -19146
- package/lib/index.esm.js +0 -19125
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var CustomButton_styles_1 = require("./CustomButton.styles");
|
|
5
|
+
var CustomButton = function (_a) {
|
|
6
|
+
var _b = _a.buttonText, buttonText = _b === void 0 ? 'Hi there' : _b, _c = _a.onClickHandler, onClickHandler = _c === void 0 ? function () { } : _c;
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(CustomButton_styles_1.StyledButton, { onClick: onClickHandler, children: buttonText });
|
|
8
|
+
};
|
|
9
|
+
exports.default = CustomButton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledButton = void 0;
|
|
4
|
+
var styles_1 = require("@mui/material/styles");
|
|
5
|
+
var Button_1 = require("@mui/material/Button");
|
|
6
|
+
exports.StyledButton = (0, styles_1.styled)(Button_1.default)(function () { return ({
|
|
7
|
+
color: 'purple',
|
|
8
|
+
backgroundColor: '#00cc66',
|
|
9
|
+
borderRadius: 20,
|
|
10
|
+
padding: '6px 16px',
|
|
11
|
+
border: '1px solid #00cc66',
|
|
12
|
+
'&:focus': {
|
|
13
|
+
outline: 'none',
|
|
14
|
+
},
|
|
15
|
+
'&:hover': {
|
|
16
|
+
backgroundColor: '#00ff99',
|
|
17
|
+
border: '1px solid #00ff99',
|
|
18
|
+
},
|
|
19
|
+
}); });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomButton = void 0;
|
|
4
|
+
var CustomButton_1 = require("./CustomButton");
|
|
5
|
+
Object.defineProperty(exports, "CustomButton", { enumerable: true, get: function () { return CustomButton_1.default; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var CustomTextField_styles_1 = require("./CustomTextField.styles");
|
|
5
|
+
var CustomTextField = function (_a) {
|
|
6
|
+
var _b = _a.label, label = _b === void 0 ? 'Field label' : _b, _c = _a.value, value = _c === void 0 ? 'Hello there' : _c, onChangeHandler = _a.onChangeHandler;
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(CustomTextField_styles_1.StyledTextField, { value: value, onChange: onChangeHandler, label: label }));
|
|
8
|
+
};
|
|
9
|
+
exports.default = CustomTextField;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledTextField = void 0;
|
|
4
|
+
var styles_1 = require("@mui/material/styles");
|
|
5
|
+
var TextField_1 = require("@mui/material/TextField");
|
|
6
|
+
exports.StyledTextField = (0, styles_1.styled)(TextField_1.default)(function () { return ({
|
|
7
|
+
"& .MuiFormLabel-root": {
|
|
8
|
+
color: "#00cc66",
|
|
9
|
+
"&.MuiInputLabel-shrink": {
|
|
10
|
+
color: "#00cc66",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
14
|
+
borderColor: "purple !important",
|
|
15
|
+
"&.Mui-focused": {
|
|
16
|
+
borderColor: "purple",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
"& .MuiInputBase-root": {
|
|
20
|
+
color: "#00cc66",
|
|
21
|
+
},
|
|
22
|
+
}); });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomTextField = void 0;
|
|
4
|
+
var CustomTextField_1 = require("./CustomTextField");
|
|
5
|
+
Object.defineProperty(exports, "CustomTextField", { enumerable: true, get: function () { return CustomTextField_1.default; } });
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomButton = exports.CustomTextField = void 0;
|
|
4
|
+
var CustomTextField_1 = require("./components/CustomTextField");
|
|
5
|
+
Object.defineProperty(exports, "CustomTextField", { enumerable: true, get: function () { return CustomTextField_1.CustomTextField; } });
|
|
6
|
+
var CustomButton_1 = require("./components/CustomButton");
|
|
7
|
+
Object.defineProperty(exports, "CustomButton", { enumerable: true, get: function () { return CustomButton_1.CustomButton; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyledButton } from './CustomButton.styles';
|
|
3
|
+
var CustomButton = function (_a) {
|
|
4
|
+
var _b = _a.buttonText, buttonText = _b === void 0 ? 'Hi there' : _b, _c = _a.onClickHandler, onClickHandler = _c === void 0 ? function () { } : _c;
|
|
5
|
+
return _jsx(StyledButton, { onClick: onClickHandler, children: buttonText });
|
|
6
|
+
};
|
|
7
|
+
export default CustomButton;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
export var StyledButton = styled(Button)(function () { return ({
|
|
4
|
+
color: 'purple',
|
|
5
|
+
backgroundColor: '#00cc66',
|
|
6
|
+
borderRadius: 20,
|
|
7
|
+
padding: '6px 16px',
|
|
8
|
+
border: '1px solid #00cc66',
|
|
9
|
+
'&:focus': {
|
|
10
|
+
outline: 'none',
|
|
11
|
+
},
|
|
12
|
+
'&:hover': {
|
|
13
|
+
backgroundColor: '#00ff99',
|
|
14
|
+
border: '1px solid #00ff99',
|
|
15
|
+
},
|
|
16
|
+
}); });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomButton } from './CustomButton';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyledTextField } from './CustomTextField.styles';
|
|
3
|
+
var CustomTextField = function (_a) {
|
|
4
|
+
var _b = _a.label, label = _b === void 0 ? 'Field label' : _b, _c = _a.value, value = _c === void 0 ? 'Hello there' : _c, onChangeHandler = _a.onChangeHandler;
|
|
5
|
+
return (_jsx(StyledTextField, { value: value, onChange: onChangeHandler, label: label }));
|
|
6
|
+
};
|
|
7
|
+
export default CustomTextField;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import TextField from "@mui/material/TextField";
|
|
3
|
+
export var StyledTextField = styled(TextField)(function () { return ({
|
|
4
|
+
"& .MuiFormLabel-root": {
|
|
5
|
+
color: "#00cc66",
|
|
6
|
+
"&.MuiInputLabel-shrink": {
|
|
7
|
+
color: "#00cc66",
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
11
|
+
borderColor: "purple !important",
|
|
12
|
+
"&.Mui-focused": {
|
|
13
|
+
borderColor: "purple",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
"& .MuiInputBase-root": {
|
|
17
|
+
color: "#00cc66",
|
|
18
|
+
},
|
|
19
|
+
}); });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CustomTextField } from './CustomTextField';
|
package/lib/esm/index.js
ADDED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const StyledButton: import("@emotion/styled").StyledComponent<import("@mui/material/Button").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
2
2
|
ref?: import("react").Ref<HTMLButtonElement>;
|
|
3
|
-
}, "
|
|
3
|
+
}, "variant" | "classes" | "className" | "style" | "children" | "color" | "disabled" | "fullWidth" | "size" | "sx" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newton_duarte/reusable-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "This package implements react components based on MUI",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "lib/index.
|
|
6
|
+
"main": "lib/cjs/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": {
|
|
9
|
-
"default": "./lib/index.
|
|
9
|
+
"default": "./lib/esm/index.js",
|
|
10
10
|
"types": "./lib/types/index.d.ts"
|
|
11
11
|
},
|
|
12
12
|
"require": {
|
|
13
|
-
"default": "./lib/index.
|
|
13
|
+
"default": "./lib/cjs/index.js",
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
|
+
"sideEffects": false,
|
|
17
18
|
"files": [
|
|
18
19
|
"lib"
|
|
19
20
|
],
|
|
20
21
|
"scripts": {
|
|
21
|
-
"build": "
|
|
22
|
+
"build": "rimraf ./lib && tsc --skipLibCheck --project tsconfig.esm.json && tsc --skipLibCheck --project tsconfig.cjs.json",
|
|
22
23
|
"release-package": "npm run build && npx changeset publish"
|
|
23
24
|
},
|
|
24
25
|
"author": "Newton Duarte",
|
|
@@ -34,11 +35,7 @@
|
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@changesets/cli": "^2.27.1",
|
|
37
|
-
"
|
|
38
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
39
|
-
"rollup": "^4.13.0",
|
|
40
|
-
"rollup-plugin-delete": "^2.0.0",
|
|
41
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
38
|
+
"rimraf": "^6.1.2",
|
|
42
39
|
"typescript": "^5.4.2"
|
|
43
40
|
}
|
|
44
41
|
}
|