mui-design-system 0.0.19 → 0.0.21

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.
@@ -8,7 +8,8 @@ import Stack from "@mui/material/Stack";
8
8
  import Typography from "@mui/material/Typography";
9
9
  import UseFormInput from "./UseFormInput";
10
10
  import { deepMerge, result } from "../../methods/general";
11
- const Form = ({ schema, form, gridItemProps, gridContainerProps, labelsProps, itemProps, hideRequiredStar = false, inputLabelMode = "static", inputVariants = "outlined", withoutHelperText, disabled, }) => {
11
+ const Form = ({ schema, form, gridItemProps, gridContainerProps, labelsProps, itemProps, hideRequiredStar = false, inputLabelMode = "relative", inputVariants = "outlined", withoutHelperText, disabled, }) => {
12
+ console.log('inputLabelMode', inputLabelMode);
12
13
  return (_jsx(Grid, { container: true, columnSpacing: 4, rowSpacing: 0, rowGap: 2, alignItems: "flex-start", ...gridContainerProps, children: schema?.map((inputProp) => (_jsxs(Grid, { item: true, xs: 4, width: "100%", height: "auto", position: "relative", ...deepMerge(gridItemProps, inputProp.gridItemProp), children: [inputLabelMode === "static" && inputProp.type !== "checkbox" && (_jsx(Box, { display: "flex", children: _jsx(Typography, { flexGrow: 1, width: 0, component: "label", display: "inline-block", mb: 2, htmlFor: inputProp.name, color: result(form?.formState?.errors, `${inputProp.name}`)
13
14
  ? "error"
14
15
  : "text.16", noWrap: true, title: !isValidElement(inputProp?.label)
@@ -115,7 +115,7 @@ export interface IUploaderForm extends IBaseForm {
115
115
  itemProps?: Partial<ICustomUploaderProps>;
116
116
  }
117
117
  export interface ITextFieldForm extends IBaseForm {
118
- type?: 'text' | 'email' | 'password' | 'phone' | 'number';
118
+ type?: 'text' | 'email' | 'password' | 'number' | "tel";
119
119
  props?: Partial<TextFieldProps>;
120
120
  itemProps?: Partial<TextFieldProps>;
121
121
  }
@@ -125,7 +125,7 @@ export type TFormTheme = {
125
125
  text?: Partial<TextFieldProps>;
126
126
  email?: Partial<TextFieldProps>;
127
127
  password?: Partial<TextFieldProps>;
128
- phone?: Partial<TextFieldProps>;
128
+ tel?: Partial<TextFieldProps>;
129
129
  number?: Partial<TextFieldProps>;
130
130
  uploader?: {
131
131
  uploaderProps?: Partial<ICustomUploaderProps>;
@@ -6,7 +6,7 @@ export const MuiFormControlLabel = {
6
6
  '& .MuiFormControlLabel-label': {
7
7
  color: theme.palette.text.primary,
8
8
  textAlign: 'initial',
9
- ...theme.typography.caption1
9
+ ...theme.typography?.["body3.medium"],
10
10
  },
11
11
  })
12
12
  },
@@ -20,7 +20,7 @@ export const MuiInputLabel = {
20
20
  root: ({ ownerState, theme }) => ({
21
21
  color: theme.palette.text.primary,
22
22
  textAlign: 'start',
23
- ...theme.typography.caption1,
23
+ ...theme.typography?.["body3.medium"],
24
24
  lineHeight: '150%',
25
25
  // ...(ownerState.variant === "outlined"
26
26
  // ? {
@@ -24,7 +24,7 @@ export const MuiFilledInput = {
24
24
  stroke: theme.palette.text.primary,
25
25
  minWidth: 80,
26
26
  minHeight: ownerState.size === 'small' ? '40px' : '48px',
27
- ...theme.typography.caption1,
27
+ ...theme.typography?.["body3.medium"],
28
28
  lineHeight: '100%',
29
29
  backgroundColor: theme.palette.text['4'],
30
30
  ...(ownerState.readOnly && {
@@ -1,27 +1,10 @@
1
- // import { OverridesStyleRules } from "@mui/material/styles/overrides";
2
- // import { OutlinedInputProps, OutlinedInputClasses } from "@mui/material";
3
- // type TMuiOutlinedInput =
4
- // | {
5
- // defaultProps?: Partial<OutlinedInputProps> | undefined;
6
- // styleOverrides?:
7
- // | Partial<
8
- // OverridesStyleRules<
9
- // keyof OutlinedInputClasses,
10
- // "MuiOutlinedInput",
11
- // Omit<Theme, "components">
12
- // >
13
- // >
14
- // | undefined;
15
- // variants?: [] | undefined;
16
- // }
17
- // | undefined;
18
1
  export const MuiOutlinedInput = {
19
2
  styleOverrides: {
20
3
  root: ({ ownerState, theme }) => ({
21
4
  stroke: theme.palette.text.primary,
22
5
  borderRadius: theme.spacing(2),
23
6
  minWidth: 80,
24
- ...theme.typography.caption1,
7
+ ...theme.typography?.["body3.medium"],
25
8
  lineHeight: '100%',
26
9
  height: ownerState.size === 'small'
27
10
  ? '40px'
@@ -51,7 +34,7 @@ export const MuiOutlinedInput = {
51
34
  //Label that goes on the border of component
52
35
  '& .MuiOutlinedInput-notchedOutline': {
53
36
  transition: 'border-color 0.2s ease',
54
- ...theme.typography.caption1,
37
+ ...theme.typography?.["body3.medium"],
55
38
  ...(ownerState.disabled && {
56
39
  border: 'none',
57
40
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mui-design-system",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",