@zesty-io/material 0.6.6 → 0.7.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.
@@ -1,10 +1,10 @@
1
- import { OutlinedTextFieldProps } from '@mui/material/TextField';
2
- import { ReactNode } from 'react';
3
- export interface FieldTypeTextProps extends Omit<OutlinedTextFieldProps, 'variant'> {
1
+ import { OutlinedTextFieldProps } from "@mui/material/TextField";
2
+ import { ReactNode } from "react";
3
+ export interface FieldTypeTextProps extends Omit<OutlinedTextFieldProps, "variant"> {
4
4
  /**
5
- * Max length of the field
6
- * @default 150
7
- */
5
+ * Max length of the field
6
+ * @default 150
7
+ */
8
8
  maxLength?: number;
9
9
  value: string;
10
10
  endLabel?: ReactNode;
@@ -1,9 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import MuiTextField from '@mui/material/TextField';
3
- import { FormControl, FormLabel, Box, InputAdornment } from '@mui/material';
2
+ import MuiTextField from "@mui/material/TextField";
3
+ import { FormControl, FormLabel, Box, InputAdornment } from "@mui/material";
4
4
  const FieldTypeText = ({ label, maxLength = 150, value, helperText, required, endLabel, ...props }) => {
5
- return (_jsxs(FormControl, { fullWidth: true, required: required, children: [_jsxs(FormLabel, { sx: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', '& .MuiFormLabel-asterisk': { order: 2 } }, children: [_jsx(Box, { sx: { order: 1 }, children: label }), _jsx(Box, { sx: { order: 3, flex: 1, textAlign: 'right' }, children: endLabel })] }), _jsx(MuiTextField, { size: "small", variant: 'outlined', value: value, error: value?.length > maxLength, helperText: value?.length > maxLength ? 'Your input is over the specified limit' : helperText, InputProps: {
6
- endAdornment: (_jsxs(InputAdornment, { position: "end", sx: { fontSize: '14px' }, children: [value?.length, "/", maxLength] })),
5
+ return (_jsxs(FormControl, { fullWidth: true, required: required, children: [_jsxs(FormLabel, { sx: {
6
+ lineHeight: "inherit",
7
+ fontSize: "inherit",
8
+ display: "flex",
9
+ justifyContent: "space-between",
10
+ alignItems: "center",
11
+ "& .MuiFormLabel-asterisk": { order: 2 },
12
+ mb: 0.5,
13
+ }, children: [_jsx(Box, { sx: { order: 1 }, children: label }), _jsx(Box, { sx: { order: 3, flex: 1, textAlign: "right" }, children: endLabel })] }), _jsx(MuiTextField, { size: "small", variant: "outlined", value: value, error: value?.length > maxLength, helperText: value?.length > maxLength
14
+ ? "Your input is over the specified limit"
15
+ : helperText, InputProps: {
16
+ endAdornment: (_jsxs(InputAdornment, { position: "end", sx: { fontSize: "14px" }, children: [value?.length, "/", maxLength] })),
7
17
  }, ...props })] }));
8
18
  };
9
19
  export default FieldTypeText;
@@ -1,3 +1,2 @@
1
- import { Theme } from "@mui/material/styles";
2
- declare let theme: Theme;
1
+ declare let theme: import("@mui/material/styles").Theme;
3
2
  export default theme;
@@ -20,6 +20,15 @@ theme = createTheme(theme, {
20
20
  styleOverrides: {
21
21
  root: {
22
22
  minWidth: "auto",
23
+ boxShadow: "none",
24
+ textTransform: "none",
25
+ },
26
+ },
27
+ },
28
+ MuiButtonGroup: {
29
+ styleOverrides: {
30
+ root: {
31
+ boxShadow: "none",
23
32
  },
24
33
  },
25
34
  },
@@ -67,17 +76,6 @@ theme = createTheme(theme, {
67
76
  },
68
77
  },
69
78
  },
70
- MuiToggleButton: {
71
- styleOverrides: {
72
- root: ({ ownerState, theme }) => ({
73
- backgroundColor: `${theme.palette[ownerState.color].contrastText} !important`,
74
- ...(ownerState.selected && {
75
- color: `${theme.palette[ownerState.color].contrastText} !important`,
76
- backgroundColor: `${theme.palette[ownerState.color].main} !important`,
77
- }),
78
- }),
79
- },
80
- },
81
79
  MuiCssBaseline: {
82
80
  styleOverrides: {
83
81
  body: {
@@ -97,6 +95,52 @@ theme = createTheme(theme, {
97
95
  },
98
96
  },
99
97
  },
98
+ MuiOutlinedInput: {
99
+ styleOverrides: {
100
+ root: {
101
+ padding: "0px 8px",
102
+ borderRadius: "8px",
103
+ backgroundColor: theme.palette.common.white,
104
+ "&.Mui-disabled .MuiOutlinedInput-notchedOutline": {
105
+ borderColor: "#F2F4F7",
106
+ },
107
+ "&:hover .MuiOutlinedInput-notchedOutline": {
108
+ borderColor: "#F2F4F7",
109
+ },
110
+ "&.Mui-focused:hover .MuiOutlinedInput-notchedOutline": {
111
+ borderColor: "#FF5D0A",
112
+ },
113
+ },
114
+ input: {
115
+ padding: "10px 0px",
116
+ ":read-only": {
117
+ color: "#475467",
118
+ },
119
+ },
120
+ sizeSmall: {
121
+ input: {
122
+ padding: "8px 0px",
123
+ },
124
+ },
125
+ notchedOutline: {
126
+ borderColor: "#F2F4F7",
127
+ },
128
+ },
129
+ },
130
+ MuiLink: {
131
+ styleOverrides: {
132
+ root: {
133
+ color: theme.palette.info.dark,
134
+ textDecorationColor: theme.palette.info.main,
135
+ "&:hover": {
136
+ textDecorationColor: theme.palette.info.dark,
137
+ },
138
+ },
139
+ },
140
+ defaultProps: {
141
+ underline: "hover",
142
+ },
143
+ },
100
144
  },
101
145
  });
102
146
  export default theme;
@@ -1,3 +1,3 @@
1
- import { PaletteOptions } from '@mui/material/styles';
1
+ import { PaletteOptions } from "@mui/material/styles";
2
2
  declare const palette: PaletteOptions;
3
3
  export default palette;
@@ -1,23 +1,23 @@
1
1
  const palette = {
2
2
  primary: {
3
- main: '#404759',
4
- contrastText: '#ffffff',
3
+ main: "#404759",
4
+ contrastText: "#ffffff",
5
5
  },
6
6
  secondary: {
7
- main: '#497edf',
8
- contrastText: '#ffffff',
7
+ main: "#497edf",
8
+ contrastText: "#ffffff",
9
9
  },
10
10
  success: {
11
- main: '#75bf25',
12
- contrastText: '#ffffff',
11
+ main: "#75bf25",
12
+ contrastText: "#ffffff",
13
13
  },
14
14
  warning: {
15
- main: '#f17829',
16
- contrastText: '#ffffff',
15
+ main: "#f17829",
16
+ contrastText: "#ffffff",
17
17
  },
18
18
  error: {
19
- main: '#e53c05',
20
- contrastText: '#ffffff',
19
+ main: "#e53c05",
20
+ contrastText: "#ffffff",
21
21
  },
22
22
  };
23
23
  export default palette;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zesty-io/material",
3
- "version": "0.6.6",
3
+ "version": "0.7.0",
4
4
  "description": "Contains custom components which are in addition to the @mui design-system",
5
5
  "author": "Zesty.io",
6
6
  "license": "MIT",