mui-design-system 0.0.34 → 0.0.36

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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - JSDoc for `UFTextField` component for better IDE support.
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { TextFieldVariants } from '@mui/material';
3
- import { BaseTextFieldProps } from '@mui/material/TextField/TextField';
3
+ import type { BaseTextFieldProps } from '@mui/material/TextField';
4
4
  import { TInputLabelMode } from '../form/type';
5
5
  interface Props extends BaseTextFieldProps {
6
6
  openCalendar: any;
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import "../../styles/datePicker.css";
3
3
  import { CalendarProps } from "react-multi-date-picker";
4
- import { BaseTextFieldProps } from "@mui/material/TextField/TextField";
4
+ import type { BaseTextFieldProps } from "@mui/material/TextField";
5
5
  import { TInputLabelMode } from "../form/type";
6
6
  export interface ICustomDatePickerProps extends CalendarProps {
7
7
  error: any;
@@ -16,10 +16,10 @@ const CustomTableBody = ({ table, onClickRow, renderSubComponent, withSelect, wi
16
16
  '& tr:last-child': {
17
17
  '& > td > div': { border: 'unset' },
18
18
  '& > td:first-child > div': {
19
- borderEndStartRadius: borderRadius * theme.shape.borderRadius,
19
+ borderEndStartRadius: borderRadius * Number(theme.shape.borderRadius),
20
20
  },
21
21
  '& > td:last-child > div': {
22
- borderEndEndRadius: borderRadius * theme.shape.borderRadius,
22
+ borderEndEndRadius: borderRadius * Number(theme.shape.borderRadius),
23
23
  },
24
24
  },
25
25
  }, children: table?.getRowModel()?.rows?.map((row, i) => {
@@ -23,10 +23,10 @@ const CustomTableHead = ({ table, variant, withSelect, withRadio, withIndex, hea
23
23
  bgcolor: 'surface.secondary',
24
24
  borderBottom: (theme) => `1px solid ${theme.palette.divider}`,
25
25
  '& th:first-of-type': {
26
- borderRadius: `${borderRadius * theme?.shape.borderRadius}px 0 0 ${rowBorderRadius * theme?.shape.borderRadius}px`,
26
+ borderRadius: `${borderRadius * Number(theme.shape.borderRadius)}px 0 0 ${rowBorderRadius * Number(theme.shape.borderRadius)}px`,
27
27
  },
28
28
  '& th:last-child': {
29
- borderRadius: `0 ${borderRadius * theme?.shape.borderRadius}px ${rowBorderRadius * theme?.shape.borderRadius}px 0`,
29
+ borderRadius: `0 ${borderRadius * Number(theme.shape.borderRadius)}px ${rowBorderRadius * Number(theme.shape.borderRadius)}px 0`,
30
30
  },
31
31
  '& th': {
32
32
  border: variant === 'linear' ? 0 : '',
@@ -20,12 +20,12 @@ const CustomTableRow = ({ row, onClickRow, renderSubComponent, withSelect, withI
20
20
  height: { xs: 44, md: 56 },
21
21
  cursor: onClickRow ? 'pointer' : '',
22
22
  '& td:first-of-type > div': {
23
- borderEndStartRadius: rowBorderRadius * theme?.shape.borderRadius,
24
- borderStartStartRadius: rowBorderRadius * theme?.shape.borderRadius,
23
+ borderEndStartRadius: rowBorderRadius * Number(theme.shape.borderRadius),
24
+ borderStartStartRadius: rowBorderRadius * Number(theme.shape.borderRadius),
25
25
  },
26
26
  '& td:last-child > div': {
27
- borderEndEndRadius: rowBorderRadius * theme?.shape.borderRadius,
28
- borderStartEndRadius: rowBorderRadius * theme?.shape.borderRadius,
27
+ borderEndEndRadius: rowBorderRadius * Number(theme.shape.borderRadius),
28
+ borderStartEndRadius: rowBorderRadius * Number(theme.shape.borderRadius),
29
29
  },
30
30
  ...(rowStyle ? rowStyle({ row }) : {}),
31
31
  '& td > div': {
@@ -1,6 +1,6 @@
1
1
  import { FC } from "react";
2
2
  import { UseFormReturn } from "react-hook-form";
3
- import { GridProps } from "@mui/material/Grid";
3
+ import { GridLegacyProps as GridProps } from "@mui/material/GridLegacy";
4
4
  import { TypographyProps } from "@mui/material/Typography";
5
5
  import { TFormSchema, TInputLabelMode } from "./type";
6
6
  import { TextFieldProps } from "@mui/material/TextField";
@@ -3,7 +3,7 @@ import { isValidElement } from "react";
3
3
  //------------------------------------------------------------------------
4
4
  //@Mui
5
5
  import Box from "@mui/material/Box";
6
- import Grid from "@mui/material/Grid";
6
+ import Grid from "@mui/material/GridLegacy";
7
7
  import Stack from "@mui/material/Stack";
8
8
  import Typography from "@mui/material/Typography";
9
9
  import UseFormInput from "./UseFormInput";
@@ -2,10 +2,9 @@ import { FC } from "react";
2
2
  import { ICheckboxForm } from "../type";
3
3
  import { CheckboxProps } from "@mui/material";
4
4
  import { UseFormReturn } from "react-hook-form";
5
- import { SwitchBaseProps } from "@mui/material/internal/SwitchBase";
6
5
  import { TypographyProps } from "@mui/material/Typography";
7
6
  export interface ICustomCheckboxProps {
8
- inputProps: SwitchBaseProps["inputProps"];
7
+ inputProps: CheckboxProps["inputProps"];
9
8
  slotProps: {
10
9
  typography?: TypographyProps;
11
10
  };
@@ -3,6 +3,7 @@ import Checkbox from "@mui/material/Checkbox";
3
3
  import FormControl from "@mui/material/FormControl";
4
4
  import { Controller } from "react-hook-form";
5
5
  import FormControlLabel from "@mui/material/FormControlLabel";
6
+ // inputProps matches Checkbox's underlying input; avoid MUI internal SwitchBase (not in public API in MUI 7)
6
7
  import Typography from "@mui/material/Typography";
7
8
  import { useFormContext } from "../../../context/FormContext";
8
9
  import { deepMerge } from "../../../methods/general";
@@ -7,5 +7,6 @@ type Props = ITextFieldForm & {
7
7
  };
8
8
  export declare const p2e: (s: string) => boolean;
9
9
  export declare const checkIfNumber: (value: string) => boolean;
10
+ /** Form-integrated text field with theme support and numeric validation. */
10
11
  declare const UFTextField: FC<Props>;
11
12
  export default UFTextField;
@@ -8,6 +8,7 @@ export const checkIfNumber = (value) => {
8
8
  const charLength = value.length;
9
9
  return !charLength || p2e(value);
10
10
  };
11
+ /** Form-integrated text field with theme support and numeric validation. */
11
12
  const UFTextField = ({ form, name, type = 'text', defaultValue, label, rules, readonly, disabled, placeholder, error, itemProps, props, helperText, variant = "outlined", withoutHelperText, inputLabelMode, }) => {
12
13
  const { theme } = useFormContext();
13
14
  const themeProp = theme?.[type];
@@ -1,4 +1,4 @@
1
- import { GridProps } from '@mui/material/Grid';
1
+ import { GridLegacyProps as GridProps } from '@mui/material/GridLegacy';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { RegisterOptions } from 'react-hook-form';
4
4
  import { TypographyProps } from '@mui/material/Typography';
@@ -7,7 +7,7 @@ export const MuiAutoComplete = {
7
7
  styleOverrides: {
8
8
  root: ({ ownerState, theme }) => ({
9
9
  position: 'relative',
10
- borderRadius: theme.shape.borderRadius * 2,
10
+ borderRadius: Number(theme.shape.borderRadius) * 2,
11
11
  '& .Mui-focused': {
12
12
  height: 'auto !important',
13
13
  },
@@ -1,5 +1,5 @@
1
1
  import { Components, Theme } from "@mui/material/styles";
2
- declare module "@mui/material/Button/Button" {
2
+ declare module "@mui/material/Button" {
3
3
  interface ButtonOwnProps {
4
4
  isLoading?: boolean;
5
5
  }
@@ -10,7 +10,7 @@ export const MuiButton = {
10
10
  root: ({ ownerState, theme }) => ({
11
11
  fontWeight: 500,
12
12
  outline: "0px solid",
13
- borderRadius: theme.shape.borderRadius * 2,
13
+ borderRadius: Number(theme.shape.borderRadius) * 2,
14
14
  minHeight: ownerState.size === "small" ? "36px" : "48px",
15
15
  fontSize: ownerState.size === "small" ? 15 : 17,
16
16
  width: ownerState.fullWidth ? "100%" : "max-content",
@@ -113,7 +113,7 @@ export const MuiButton = {
113
113
  backgroundColor: theme.palette.background.default,
114
114
  content: "''",
115
115
  position: "absolute",
116
- borderRadius: theme.shape.borderRadius * 2,
116
+ borderRadius: Number(theme.shape.borderRadius) * 2,
117
117
  opacity: 0,
118
118
  transition: "all 0.3s",
119
119
  },
@@ -160,7 +160,7 @@ export const MuiButton = {
160
160
  backgroundColor: theme.palette.background.default,
161
161
  content: "''",
162
162
  position: "absolute",
163
- borderRadius: theme.shape.borderRadius * 2,
163
+ borderRadius: Number(theme.shape.borderRadius) * 2,
164
164
  opacity: 0,
165
165
  transition: "all 0.3s",
166
166
  },
@@ -12,7 +12,7 @@ export const MuiDialog = {
12
12
  ...(ownerState.withoutBoxShadow && {
13
13
  boxShadow: "none",
14
14
  }),
15
- borderRadius: theme.shape.borderRadius * 2,
15
+ borderRadius: Number(theme.shape.borderRadius) * 2,
16
16
  minHeight: "340px",
17
17
  minWidth: "500px",
18
18
  padding: "16px 24px",
@@ -18,7 +18,7 @@ export const MuiTab = {
18
18
  backgroundColor: theme.palette.mode === 'light' ? theme.palette.primary.main : theme.palette.text.primary,
19
19
  color: theme.palette.mode === 'light' ? theme.palette.text.secondary : theme.palette.primary.main,
20
20
  stroke: theme.palette.mode === 'light' ? theme.palette.text.secondary : theme.palette.primary.main,
21
- borderRadius: theme.shape.borderRadius * 2,
21
+ borderRadius: Number(theme.shape.borderRadius) * 2,
22
22
  fontWeight: 500,
23
23
  },
24
24
  }),
@@ -35,7 +35,7 @@ export const MuiFilledInput = {
35
35
  //Temporary Added
36
36
  paddingRight: 10,
37
37
  border: `1px solid ${theme.palette.background[4]}`,
38
- borderRadius: theme.shape.borderRadius * 2,
38
+ borderRadius: Number(theme.shape.borderRadius) * 2,
39
39
  transition: 'all 0.2s ease',
40
40
  color: theme.palette.mode === 'light'
41
41
  ? theme.palette.text.primary
@@ -36,7 +36,7 @@ export const MuiTextField = {
36
36
  },
37
37
  //Base Input & Text area components
38
38
  '& .MuiInputBase-input': {
39
- borderRadius: theme.shape.borderRadius / 2,
39
+ borderRadius: Number(theme.shape.borderRadius) / 2,
40
40
  '&:-webkit-autofill': {
41
41
  WebkitTextFillColor: theme.palette.text.primary,
42
42
  transition: 'background-color 5000s ease-in-out 0s',
@@ -1,2 +1,2 @@
1
- import { TypographyOptions } from '@mui/material/styles/createTypography';
2
- export declare const typography: TypographyOptions;
1
+ import type { TypographyVariantsOptions } from '@mui/material/styles';
2
+ export declare const typography: TypographyVariantsOptions;
@@ -1,2 +1,2 @@
1
- import { PaletteOptions } from '@mui/material/styles/createPalette';
1
+ import type { PaletteOptions } from '@mui/material/styles';
2
2
  export declare const darkPalette: PaletteOptions;
@@ -1,2 +1,2 @@
1
- import { PaletteOptions } from '@mui/material/styles/createPalette';
1
+ import type { PaletteOptions } from '@mui/material/styles';
2
2
  export declare const lightPalette: PaletteOptions;
@@ -1,4 +1,4 @@
1
- import { PaletteColor } from '@mui/material/styles/createPalette';
1
+ import type { PaletteColor } from '@mui/material/styles';
2
2
  interface ICustomColor {
3
3
  main?: string;
4
4
  16?: string;
@@ -22,19 +22,17 @@ declare module '@mui/material' {
22
22
  interface Color extends ICustomColor {
23
23
  }
24
24
  }
25
- declare module '@mui/material/styles/createPalette' {
25
+ interface IPalette {
26
+ default: PaletteColor;
27
+ inherit: PaletteColor;
28
+ }
29
+ declare module '@mui/material/styles' {
26
30
  interface PaletteColor extends ICustomColor {
27
31
  }
28
32
  interface SimplePaletteColorOptions extends ICustomColor {
29
33
  }
30
34
  interface TypeText extends ICustomColor {
31
35
  }
32
- }
33
- interface IPalette {
34
- default: PaletteColor;
35
- inherit: PaletteColor;
36
- }
37
- declare module '@mui/material/styles' {
38
36
  interface Palette extends IPalette {
39
37
  }
40
38
  interface PaletteOptions extends IPalette {
@@ -48,8 +46,6 @@ declare module '@mui/material/styles' {
48
46
  3?: string;
49
47
  4?: string;
50
48
  }
51
- }
52
- declare module '@mui/material/styles/createPalette' {
53
49
  interface PaletteColor {
54
50
  main: string;
55
51
  }
@@ -1 +1,2 @@
1
+ // Typography variants are augmented via module declaration below; no createTypography import needed for v7.
1
2
  export {};
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "mui-design-system",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "MUI-based design system with theme, form components, and utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc && node copy-files.js",
10
+ "prepublishOnly": "npm run build",
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "publish": "npm publish"
13
+ },
8
14
  "exports": {
9
15
  ".": {
10
16
  "types": "./dist/index.d.ts",
@@ -19,14 +25,9 @@
19
25
  },
20
26
  "files": [
21
27
  "dist",
22
- "README.md"
28
+ "README.md",
29
+ "CHANGELOG.md"
23
30
  ],
24
- "scripts": {
25
- "build": "tsc && node copy-files.js",
26
- "prepublishOnly": "npm run build",
27
- "test": "echo \"Error: no test specified\" && exit 1",
28
- "publish": "npm publish"
29
- },
30
31
  "dependencies": {
31
32
  "react-window": "^1.8.10",
32
33
  "react-multi-date-picker": "^4.4.1",
@@ -35,11 +36,11 @@
35
36
  "react-hook-form": "^7.51.2"
36
37
  },
37
38
  "peerDependencies": {
38
- "@emotion/react": "^11.13.5",
39
- "@emotion/styled": "^11.13.5",
40
- "@mui/material": "^6.1.9",
41
- "@mui/material-nextjs": "^6.1.9",
42
- "@mui/styled-engine-sc": "^6.0.0-alpha.17",
39
+ "@emotion/react": "^11.14.0",
40
+ "@emotion/styled": "^11.14.1",
41
+ "@mui/material": "^7.3.9",
42
+ "@mui/material-nextjs": "^7.3.9",
43
+ "@mui/styled-engine-sc": "^7.3.9",
43
44
  "styled-components": "^6.1.8",
44
45
  "stylis-plugin-rtl": "^2.1.1",
45
46
  "react": "^18.2.0",