@junyiacademy/ui-test 1.5.12 → 1.5.15
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/declarations/libs/ui/src/utils/Capitalize.d.ts +1 -1
- package/dist/libs/ui/src/lib/button/Button.js +3 -3
- package/dist/libs/ui/src/lib/button-group/ButtonGroup.js +2 -2
- package/dist/libs/ui/src/lib/text-field/TextField.js +14 -4
- package/dist/libs/ui/src/utils/Capitalize.js +1 -1
- package/package.json +1 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function capitalize(string: any):
|
|
1
|
+
export default function capitalize(string: any): string;
|
|
@@ -7,12 +7,12 @@ const styles_1 = require("@mui/material/styles");
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const Button_1 = require("@mui/material/Button");
|
|
9
9
|
//utils
|
|
10
|
-
const
|
|
10
|
+
const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
|
|
11
11
|
const StyledButton = styles_1.styled(material_1.Button, {
|
|
12
12
|
shouldForwardProp: (prop) => prop !== 'active',
|
|
13
13
|
})(({ active, color = 'primary', theme }) => ({
|
|
14
14
|
// For variant: outlined
|
|
15
|
-
[`&.${Button_1.buttonClasses.outlined}${
|
|
15
|
+
[`&.${Button_1.buttonClasses.outlined}${Capitalize_1.default(color)}`]: {
|
|
16
16
|
backgroundColor: active
|
|
17
17
|
? theme.palette[color].main
|
|
18
18
|
: theme.palette.common.white,
|
|
@@ -30,7 +30,7 @@ const StyledButton = styles_1.styled(material_1.Button, {
|
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
// For variant: text
|
|
33
|
-
[`&.${Button_1.buttonClasses.text}${
|
|
33
|
+
[`&.${Button_1.buttonClasses.text}${Capitalize_1.default(color)}`]: {
|
|
34
34
|
'&:hover': {
|
|
35
35
|
backgroundColor: styles_1.alpha(theme.palette[color].main, 0.1),
|
|
36
36
|
},
|
|
@@ -7,10 +7,10 @@ const styles_1 = require("@mui/material/styles");
|
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const ButtonGroup_1 = require("@mui/material/ButtonGroup");
|
|
9
9
|
//utils
|
|
10
|
-
const
|
|
10
|
+
const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
|
|
11
11
|
// self-defined-components
|
|
12
12
|
const StyledButtonGroup = styles_1.styled(material_1.ButtonGroup)(({ color = 'primary', theme }) => ({
|
|
13
|
-
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlined}${
|
|
13
|
+
[`& .${ButtonGroup_1.buttonGroupClasses.groupedOutlined}${Capitalize_1.default(color)}.${ButtonGroup_1.buttonGroupClasses.grouped}.${ButtonGroup_1.buttonGroupClasses.disabled}`]: {
|
|
14
14
|
borderColor: styles_1.alpha(theme.palette[color].main, 0.5),
|
|
15
15
|
color: styles_1.alpha(theme.palette[color].main, 0.5),
|
|
16
16
|
},
|
|
@@ -9,8 +9,9 @@ const TextField_1 = require("@mui/material/TextField");
|
|
|
9
9
|
const Input_1 = require("@mui/material/Input");
|
|
10
10
|
const InputLabel_1 = require("@mui/material/InputLabel");
|
|
11
11
|
const OutlinedInput_1 = require("@mui/material/OutlinedInput");
|
|
12
|
+
const FormHelperText_1 = require("@mui/material/FormHelperText");
|
|
12
13
|
//utils
|
|
13
|
-
const
|
|
14
|
+
const Capitalize_1 = tslib_1.__importDefault(require("../../utils/Capitalize"));
|
|
14
15
|
// self-defined-components
|
|
15
16
|
const StyledTextField = styles_1.styled(material_1.TextField)(({ label, color = 'primary', theme }) => ({
|
|
16
17
|
[`& .${InputLabel_1.inputLabelClasses.error}`]: {
|
|
@@ -26,7 +27,7 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ label, color =
|
|
|
26
27
|
},
|
|
27
28
|
// For variant: standard | filled
|
|
28
29
|
[`& .${Input_1.inputClasses.underline}:not(.${Input_1.inputClasses.disabled})`]: {
|
|
29
|
-
[`&.MuiInputBase-color${
|
|
30
|
+
[`&.MuiInputBase-color${Capitalize_1.default(color)}:hover:before`]: {
|
|
30
31
|
borderColor: theme.palette[color].main,
|
|
31
32
|
},
|
|
32
33
|
},
|
|
@@ -38,7 +39,7 @@ const StyledTextField = styles_1.styled(material_1.TextField)(({ label, color =
|
|
|
38
39
|
borderColor: theme.palette.error.main,
|
|
39
40
|
},
|
|
40
41
|
[`&.${TextField_1.textFieldClasses.root} :not(.${Input_1.inputClasses.disabled}):not(.${Input_1.inputClasses.error})`]: {
|
|
41
|
-
[`&.MuiInputBase-color${
|
|
42
|
+
[`&.MuiInputBase-color${Capitalize_1.default(color)}:hover .${OutlinedInput_1.outlinedInputClasses.notchedOutline}`]: {
|
|
42
43
|
borderColor: theme.palette[color].main,
|
|
43
44
|
},
|
|
44
45
|
},
|
|
@@ -52,7 +53,16 @@ const TextField = (props) => {
|
|
|
52
53
|
var _a;
|
|
53
54
|
const hasEndAdornment = !!((_a = props === null || props === void 0 ? void 0 : props.InputProps) === null || _a === void 0 ? void 0 : _a.endAdornment);
|
|
54
55
|
const { InputLabelProps, InputProps } = props, otherProps = tslib_1.__rest(props, ["InputLabelProps", "InputProps"]);
|
|
55
|
-
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }),
|
|
56
|
+
return (react_1.default.createElement(StyledTextField, Object.assign({ InputLabelProps: Object.assign(Object.assign({}, InputLabelProps), { shrink: hasEndAdornment ? true : undefined }), FormHelperTextProps: {
|
|
57
|
+
sx: (theme) => ({
|
|
58
|
+
[`&.${FormHelperText_1.formHelperTextClasses.root}`]: {
|
|
59
|
+
marginLeft: 0,
|
|
60
|
+
[`&.${Input_1.inputClasses.error}`]: {
|
|
61
|
+
color: theme.palette.error.main,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
}, InputProps: Object.assign({}, InputProps) }, otherProps)));
|
|
56
66
|
};
|
|
57
67
|
exports.TextField = TextField;
|
|
58
68
|
exports.default = exports.TextField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function capitalize(string) {
|
|
4
|
-
return string.charAt(0).toUpperCase()
|
|
4
|
+
return `${string.charAt(0).toUpperCase()}${string.slice(1)}`;
|
|
5
5
|
}
|
|
6
6
|
exports.default = capitalize;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junyiacademy/ui-test",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.15",
|
|
4
4
|
"description": "junyiacademy ui library",
|
|
5
5
|
"main": "./dist/libs/ui/src/index.js",
|
|
6
6
|
"typings": "./declarations/libs/ui/src/index.d.ts",
|
|
@@ -21,11 +21,9 @@
|
|
|
21
21
|
"@emotion/styled": "11.6.0",
|
|
22
22
|
"@mui/icons-material": "5.2.5",
|
|
23
23
|
"@mui/material": "5.2.7",
|
|
24
|
-
"lodash": "^4.17.21",
|
|
25
24
|
"react": "17.0.2"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@types/lodash": "^4.14.179",
|
|
29
27
|
"typescript": "~4.1.4"
|
|
30
28
|
}
|
|
31
29
|
}
|