mui-design-system 0.0.39 → 0.0.41

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.
@@ -3,7 +3,7 @@ import { InputAdornment, TextField } from '@mui/material';
3
3
  import SvgCalendar from '../../icons/Calendar';
4
4
  const CustomComponent = ({ openCalendar, value, handleValueChange, disabled, error, readonly, variant, lang, placeholder, inputLabelMode, label, withoutHelperText, ...rest }) => {
5
5
  const { sx, helperText, ...props } = rest;
6
- return (_jsx(TextField, { placeholder: placeholder ?? lang === 'fa' ? 'انتخاب کنید' : 'Pick a date', error: Boolean(error), ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), fullWidth: true, variant: variant, sx: {
6
+ return (_jsx(TextField, { placeholder: 'انتخاب کنید', error: Boolean(error), ...(inputLabelMode === 'static' && { hiddenLabel: true }), ...(inputLabelMode === 'relative' && { label: label }), fullWidth: true, variant: variant, sx: {
7
7
  // ...(inputLabelMode === "static" && {
8
8
  // ".MuiFilledInput-input": {
9
9
  // py: "16px !important",
@@ -31,6 +31,6 @@ const CustomComponent = ({ openCalendar, value, handleValueChange, disabled, err
31
31
  ? `${theme.palette.text.disabled} !important`
32
32
  : 'text.primary',
33
33
  }, children: _jsx(SvgCalendar, { primarycolor: 'inherit' }) })),
34
- }, disabled: disabled, value: value, onFocus: openCalendar, onClick: openCalendar, onChange: handleValueChange, helperText: withoutHelperText ? undefined : error?.message ?? helperText ?? ' ', ...props }));
34
+ }, disabled: disabled, value: value, onFocus: openCalendar, onClick: openCalendar, onChange: handleValueChange, helperText: withoutHelperText ? undefined : (error?.message ?? helperText ?? ' '), ...props }));
35
35
  };
36
36
  export default CustomComponent;
@@ -13,12 +13,10 @@ const CustomDatePicker = ({ onChange, value, disabled, error, readOnly, textFiel
13
13
  onChange(convertDate);
14
14
  }
15
15
  };
16
- let lang = document.documentElement.lang;
17
16
  const { palette } = useTheme();
18
17
  const [portalTarget, setPortalTarget] = useState();
19
18
  useEffect(() => {
20
19
  setColors(palette);
21
- lang = document.documentElement.lang;
22
20
  }, [palette.mode, document.documentElement.lang]);
23
21
  useEffect(() => {
24
22
  const portalDiv = document.createElement("div");
@@ -32,11 +30,7 @@ const CustomDatePicker = ({ onChange, value, disabled, error, readOnly, textFiel
32
30
  };
33
31
  }, []);
34
32
  const defaultWeekDays = ["ش", "ی", "د", "س", "چ", "پ", "ج"];
35
- return (_jsx(DatePicker, { className: "custom-calender", value: value ? new Date(value) : null, portal: true, portalTarget: portalTarget, hideOnScroll: true, onChange: handleChange, ...(lang === "fa" && {
36
- weekDays: defaultWeekDays,
37
- calendar: persian,
38
- locale: persian_fa,
39
- }), calendarPosition: "bottom-left", editable: false, disabled: disabled, containerStyle: { width: "100%" }, ...rest, render: _jsx(CustomComponent, { lang: lang, error: error, disabled: disabled, readonly: readOnly, label: label, inputLabelMode: inputLabelMode, openCalendar: undefined, value: value, handleValueChange: undefined, withoutHelperText: withoutHelperText, ...textFieldProps }) }));
33
+ return (_jsx(DatePicker, { className: 'custom-calender', value: value ? new Date(value) : null, portal: true, portalTarget: portalTarget, hideOnScroll: true, onChange: handleChange, weekDays: defaultWeekDays, calendar: persian, locale: persian_fa, calendarPosition: 'bottom-left', editable: false, disabled: disabled, containerStyle: { width: '100%' }, ...rest, render: _jsx(CustomComponent, { lang: 'fa', error: error, disabled: disabled, readonly: readOnly, label: label, inputLabelMode: inputLabelMode, openCalendar: undefined, value: value, handleValueChange: undefined, withoutHelperText: withoutHelperText, ...textFieldProps }) }));
40
34
  };
41
35
  export default CustomDatePicker;
42
36
  const setColors = (colors) => {
@@ -5,17 +5,17 @@ import { TypographyProps } from "@mui/material/Typography";
5
5
  import { TFormSchema, TInputLabelMode } from "./type";
6
6
  import { TextFieldProps } from "@mui/material/TextField";
7
7
  export interface FormProps {
8
+ itemProps?: any;
9
+ disabled?: boolean;
8
10
  schema: TFormSchema;
9
- form: UseFormReturn<any, any, any>;
10
- gridContainerProps?: GridProps;
11
11
  gridItemProps?: GridProps;
12
- itemProps?: any;
13
- labelsProps?: Partial<TypographyProps<"label", {}>> | undefined;
14
12
  hideRequiredStar?: boolean;
13
+ withoutHelperText?: boolean;
14
+ gridContainerProps?: GridProps;
15
15
  inputLabelMode?: TInputLabelMode;
16
+ form: UseFormReturn<any, any, any>;
16
17
  inputVariants?: TextFieldProps["variant"];
17
- withoutHelperText?: boolean;
18
- disabled?: boolean;
18
+ labelsProps?: Partial<TypographyProps<"label", {}>> | undefined;
19
19
  }
20
20
  declare const Form: FC<FormProps>;
21
21
  export default Form;
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { isValidElement } from "react";
3
+ //@3rd Party
4
+ import { get } from "react-hook-form";
3
5
  //------------------------------------------------------------------------
4
6
  //@Mui
5
7
  import Box from "@mui/material/Box";
@@ -9,10 +11,10 @@ import Typography from "@mui/material/Typography";
9
11
  import UseFormInput from "./UseFormInput";
10
12
  import { deepMerge, result } from "../../methods/general";
11
13
  const Form = ({ schema, form, gridItemProps, gridContainerProps, labelsProps, itemProps, hideRequiredStar = false, inputLabelMode = "static", inputVariants = "outlined", withoutHelperText, disabled, }) => {
12
- 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, { variant: "body-s-semibold", flexGrow: 1, width: 0, component: "label", display: "inline-block", mb: 2, htmlFor: inputProp.name, color: result(form?.formState?.errors, `${inputProp.name}`)
13
- ? "error"
14
- : "text.16", noWrap: true, title: !isValidElement(inputProp?.label)
15
- ? inputProp?.label?.toString() || ""
16
- : "", ...deepMerge(labelsProps, inputProp.labelProps), children: _jsxs(Stack, { direction: "row", children: [inputProp.label, inputProp.rules?.required && !hideRequiredStar && (_jsx(Typography, { component: "span", color: "error", fontSize: 12, children: "*" }))] }) }) })), _jsx(UseFormInput, { form: form, itemProps: itemProps, error: result(form?.formState?.errors, `${inputProp.name}`), inputLabelMode: inputLabelMode, inputVariants: inputVariants, withoutHelperText: withoutHelperText, disabled: disabled, ...inputProp })] }, inputProp.name))) }));
14
+ 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, { variant: 'body-s-semibold', flexGrow: 1, width: 0, component: 'label', display: 'inline-block', mb: 2, htmlFor: inputProp.name, color: result(form?.formState?.errors, `${inputProp.name}`)
15
+ ? 'error'
16
+ : 'text.16', noWrap: true, title: !isValidElement(inputProp?.label)
17
+ ? inputProp?.label?.toString() || ''
18
+ : '', ...deepMerge(labelsProps, inputProp.labelProps), children: _jsxs(Stack, { direction: 'row', children: [inputProp.label, inputProp.rules?.required && !hideRequiredStar && (_jsx(Typography, { component: 'span', color: 'error', fontSize: 12, children: "*" }))] }) }) })), _jsx(UseFormInput, { form: form, itemProps: itemProps, error: get(form?.formState?.errors, `${inputProp.name}`), inputLabelMode: inputLabelMode, inputVariants: inputVariants, withoutHelperText: withoutHelperText, disabled: disabled, ...inputProp })] }, inputProp.name))) }));
17
19
  };
18
20
  export default Form;
@@ -17,7 +17,7 @@ const UFCheckbox = ({ form, name, label, rules, error, helperText, withoutHelper
17
17
  typography: {
18
18
  ...props?.slotProps?.typography,
19
19
  },
20
- }, control: _jsx(Checkbox, { color: "primary", checked: value, onChange: onChange, disabled: disabled, name: name, ...deepMerge(theme?.checkbox?.checkboxProps, itemProps, propsForCheckbox) }), label: label }), !withoutHelperText && (_jsx(Typography, { sx: {
20
+ }, control: _jsx(Checkbox, { name: name, color: "primary", checked: value, onChange: onChange, disabled: disabled, ...deepMerge(theme?.checkbox?.checkboxProps, itemProps, propsForCheckbox) }), label: label }), !withoutHelperText && (_jsx(Typography, { sx: {
21
21
  height: 23,
22
22
  width: "max-content",
23
23
  color: error ? "error.4" : "text.primary",
@@ -1,31 +1,77 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { keyframes } from '@mui/material/styles';
2
3
  import UnCheckedIcon from './assets/UnChekedIcon';
3
4
  import CheckedIcon from './assets/CheckedIcon';
4
5
  import IntermediateIcon from './assets/IntermediateIcon';
6
+ const checkboxIconSize = {
7
+ small: 20,
8
+ medium: 24,
9
+ large: 32,
10
+ };
11
+ const checkboxRootSize = {
12
+ small: 34,
13
+ medium: 42,
14
+ large: 50,
15
+ };
16
+ const checkboxPop = keyframes `
17
+ 0% { transform: scale(0.82); opacity: 0.4; }
18
+ 65% { transform: scale(1.08); opacity: 1; }
19
+ 100% { transform: scale(1); opacity: 1; }
20
+ `;
21
+ const drawCheckmark = keyframes `
22
+ from { stroke-dashoffset: 13; }
23
+ to { stroke-dashoffset: 0; }
24
+ `;
25
+ const drawIndeterminate = keyframes `
26
+ from { stroke-dashoffset: 8; }
27
+ to { stroke-dashoffset: 0; }
28
+ `;
5
29
  export const MuiCheckbox = {
6
30
  defaultProps: {
31
+ size: 'medium',
7
32
  icon: _jsx(UnCheckedIcon, {}),
8
33
  checkedIcon: _jsx(CheckedIcon, {}),
9
34
  indeterminateIcon: _jsx(IntermediateIcon, {}),
10
35
  },
11
36
  styleOverrides: {
12
- root: ({ theme, ownerState }) => ({
13
- transition: 'transform 0.5s ease',
14
- width: ownerState.size === 'small' ? '34px' : '42px',
15
- height: ownerState.size === 'small' ? '34px' : '42px',
16
- ':active': {
17
- transform: 'scale(85%)',
18
- },
19
- '&.Mui-checked': {
20
- fill: theme.palette[ownerState?.color ?? 'primary'].main,
21
- stroke: theme.palette.text.primary,
22
- },
23
- }),
24
- checked: ({ theme, ownerState }) => ({
25
- fill: theme.palette[ownerState?.color ?? 'primary'].main,
26
- }),
27
- indeterminate: ({ theme, ownerState }) => ({
28
- fill: theme.palette[ownerState?.color ?? 'primary'].main,
29
- }),
37
+ root: ({ theme, ownerState }) => {
38
+ const size = ownerState.size ?? 'medium';
39
+ const iconSize = checkboxIconSize[size];
40
+ const rootSize = checkboxRootSize[size];
41
+ return {
42
+ color: theme.palette.divider,
43
+ padding: size === 'small' ? '7px' : '9px',
44
+ transition: 'transform 150ms ease',
45
+ width: rootSize,
46
+ height: rootSize,
47
+ '& svg': {
48
+ width: iconSize,
49
+ height: iconSize,
50
+ },
51
+ ':active': {
52
+ transform: 'scale(85%)',
53
+ },
54
+ '&.Mui-checked, &.MuiCheckbox-indeterminate': {
55
+ color: theme.palette[ownerState.color ?? 'primary'].main,
56
+ },
57
+ '&.Mui-checked svg, &.MuiCheckbox-indeterminate svg': {
58
+ animation: `${checkboxPop} 180ms cubic-bezier(0.2, 0, 0, 1)`,
59
+ },
60
+ '&.Mui-checked svg path': {
61
+ strokeDasharray: 13,
62
+ animation: `${drawCheckmark} 220ms 40ms ease-out both`,
63
+ },
64
+ '&.MuiCheckbox-indeterminate svg path': {
65
+ strokeDasharray: 8,
66
+ animation: `${drawIndeterminate} 180ms 40ms ease-out both`,
67
+ },
68
+ '@media (prefers-reduced-motion: reduce)': {
69
+ transition: 'none',
70
+ '& svg, & svg path': {
71
+ animation: 'none',
72
+ },
73
+ },
74
+ };
75
+ },
30
76
  },
31
77
  };
@@ -1,8 +1,3 @@
1
- import { type SVGProps } from "react";
2
- type ColorTypes = "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
3
- interface Props extends SVGProps<any> {
4
- backgroundColor?: ColorTypes;
5
- borderColor?: string;
6
- }
7
- declare const CheckedIcon: ({ borderColor, backgroundColor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
1
+ import { type SVGProps } from 'react';
2
+ declare const CheckedIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
8
3
  export default CheckedIcon;
@@ -1,12 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- const CheckedIcon = ({ borderColor, backgroundColor, ...props }) => {
4
- const theme = useTheme();
5
- const svgBackgroundColor = backgroundColor
6
- ? theme.palette[backgroundColor ?? "primary"].main
7
- : "inherit";
8
- const svgBorderColor = borderColor ?? "inherit";
9
- const svgInnerElementColor = theme.palette.grey[1];
10
- return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: svgBackgroundColor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: svgBorderColor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7" }), _jsx("path", { stroke: svgInnerElementColor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "m7.75 12 2.83 2.83 5.67-5.66" })] }));
11
- };
2
+ const CheckedIcon = (props) => (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', width: 24, height: 24, viewBox: '0 0 24 24', fill: 'none', ...props, children: [_jsx("rect", { width: 20, height: 20, x: 2, y: 2, rx: 3.5, fill: 'currentColor' }), _jsx("path", { d: 'm7.5 12 3 3 6-6', stroke: '#fff', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: 2 })] }));
12
3
  export default CheckedIcon;
@@ -1,8 +1,3 @@
1
1
  import { type SVGProps } from 'react';
2
- type ColorTypes = 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
3
- interface Props extends SVGProps<any> {
4
- backgroundColor?: ColorTypes;
5
- borderColor?: string;
6
- }
7
- declare const IntermediateIcon: ({ borderColor, backgroundColor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
2
+ declare const IntermediateIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
8
3
  export default IntermediateIcon;
@@ -1,10 +1,3 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- const IntermediateIcon = ({ borderColor, backgroundColor, ...props }) => {
4
- const theme = useTheme();
5
- const svgInnerElementColor = theme.palette.background.paper;
6
- const svgBorderColor = borderColor ?? theme.palette.text.primary;
7
- const svgBackgroundColor = theme.palette[backgroundColor ?? 'primary'].main;
8
- return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: svgBackgroundColor || "none", viewBox: "0 0 24 24", ...props, children: [_jsx("path", { stroke: svgBorderColor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7" }), _jsx("path", { stroke: svgInnerElementColor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M8 12h8M9 0" })] }));
9
- };
2
+ const IntermediateIcon = (props) => (_jsxs("svg", { xmlns: 'http://www.w3.org/2000/svg', width: 24, height: 24, viewBox: '0 0 24 24', fill: 'none', ...props, children: [_jsx("rect", { width: 20, height: 20, x: 2, y: 2, rx: 3.5, fill: 'currentColor' }), _jsx("path", { d: 'M8 12h8', stroke: '#fff', strokeLinecap: 'round', strokeWidth: 2 })] }));
10
3
  export default IntermediateIcon;
@@ -1,7 +1,3 @@
1
1
  import { type SVGProps } from 'react';
2
- interface Props extends SVGProps<any> {
3
- backgroundColor?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
4
- borderColor?: string;
5
- }
6
- declare const UnCheckedIcon: ({ backgroundColor, borderColor, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
2
+ declare const UnCheckedIcon: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
7
3
  export default UnCheckedIcon;
@@ -1,9 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useTheme } from "@mui/material";
3
- const UnCheckedIcon = ({ backgroundColor, borderColor, ...props }) => {
4
- const theme = useTheme();
5
- const svgBackgroundColor = backgroundColor ? theme.palette[backgroundColor ?? 'primary'].main : undefined;
6
- const svgBorderColor = borderColor ?? theme.palette.text.primary;
7
- return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: svgBackgroundColor || "none", viewBox: "0 0 24 24", ...props, children: _jsx("path", { stroke: svgBorderColor || "#1A1A1A", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M9.3 21h5.4c4.5 0 6.3-1.8 6.3-6.3V9.3C21 4.8 19.2 3 14.7 3H9.3C4.8 3 3 4.8 3 9.3v5.4C3 19.2 4.8 21 9.3 21" }) }));
8
- };
2
+ const UnCheckedIcon = (props) => (_jsx("svg", { xmlns: 'http://www.w3.org/2000/svg', width: 24, height: 24, viewBox: '0 0 24 24', fill: 'none', ...props, children: _jsx("rect", { width: 19, height: 19, x: 2.5, y: 2.5, rx: 3.5, stroke: 'currentColor', strokeWidth: 1 }) }));
9
3
  export default UnCheckedIcon;
@@ -34,11 +34,7 @@ export const MuiSelect = {
34
34
  pointerEvents: 'none',
35
35
  backgroundColor: theme.palette.background[3],
36
36
  }),
37
- '&.Mui-disabled': {
38
- stroke: theme.palette.background['1'],
39
- color: theme.palette.text.disabled,
40
- backgroundColor: theme.palette.background['1'],
41
- },
37
+ '&.Mui-disabled': {},
42
38
  '&.Mui-error': {
43
39
  stroke: theme.palette.error[3],
44
40
  },
@@ -1,64 +1,53 @@
1
1
  export const MuiOutlinedInput = {
2
2
  styleOverrides: {
3
3
  root: ({ ownerState, theme }) => ({
4
- stroke: theme.palette.text.primary,
5
4
  borderRadius: theme.spacing(2),
6
5
  minWidth: 80,
7
- ...theme.typography?.["body-s-medium"],
6
+ height: ownerState.size === 'small' ? 40 : ownerState.multiline ? 'auto' : 48,
7
+ ...theme.typography['body-s-medium'],
8
8
  lineHeight: '100%',
9
- height: ownerState.size === 'small'
10
- ? '40px'
11
- : ownerState.multiline
12
- ? 'auto'
13
- : '48px',
9
+ paddingRight: 10,
10
+ // Input text
14
11
  '& .MuiOutlinedInput-input': {
15
12
  display: 'flex',
16
13
  alignItems: 'center',
17
- color: `${theme.palette.text.primary} !important`,
14
+ color: theme.palette.text.primary + ' !important',
18
15
  ...(ownerState.readOnly && {
19
16
  pointerEvents: 'none',
20
- backgroundColor: 'shadow.2',
21
- color: 'text.disabled',
17
+ color: theme.palette.text.disabled,
22
18
  }),
23
19
  },
24
- //Temporary Added
25
- paddingRight: 10,
26
- //Disable state
20
+ // Disabled state
27
21
  '&.Mui-disabled': {
28
22
  pointerEvents: 'none',
23
+ backgroundColor: theme.palette.text[4],
29
24
  '& .MuiInputAdornment-root': {
30
25
  stroke: theme.palette.text[8],
31
26
  },
32
- backgroundColor: theme.palette.text[4],
33
27
  },
34
- //Label that goes on the border of component
28
+ // Normal outline
35
29
  '& .MuiOutlinedInput-notchedOutline': {
36
30
  transition: 'border-color 0.2s ease',
37
- ...theme.typography?.["body-s-medium"],
38
- ...(ownerState.disabled && {
39
- border: 'none',
40
- }),
41
31
  },
42
- //Main border color on hover
32
+ // ❗ FIX: Prevent hover border color change
43
33
  '&:hover .MuiOutlinedInput-notchedOutline': {
44
- borderColor: theme.palette.text.primary,
34
+ borderColor: theme.palette.text[6],
45
35
  },
46
- //Focused State
47
- '&.Mui-focused ': {
48
- '& .MuiOutlinedInput-notchedOutline': {
49
- borderColor: theme.palette[ownerState.color ?? 'primary'].main,
50
- borderWidth: 1,
51
- },
36
+ // Focused
37
+ '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
38
+ borderColor: theme.palette[ownerState.color ?? 'primary'].main,
39
+ borderWidth: 1,
52
40
  },
53
- //Error State
54
- '&.Mui-error ': {
55
- stroke: theme.palette.error[3],
41
+ }),
42
+ error: ({ theme }) => ({
43
+ // Error
44
+ '&.Mui-error': {
56
45
  '& .MuiOutlinedInput-notchedOutline': {
57
- borderColor: theme.palette.error['3'],
46
+ borderColor: theme.palette.error.main,
58
47
  borderWidth: 1,
59
48
  },
60
49
  '& .MuiInputAdornment-root': {
61
- stroke: theme.palette.error['2'],
50
+ stroke: theme.palette.error.dark,
62
51
  },
63
52
  },
64
53
  }),
@@ -8,7 +8,6 @@ export const MuiMenuItem = {
8
8
  backgroundColor: theme.palette.primary[1]
9
9
  },
10
10
  color: theme.palette.text.primary,
11
- ...theme.typography['body-2xs'],
12
11
  })
13
12
  },
14
13
  };
@@ -1,11 +1,11 @@
1
1
  export const darkPalette = {
2
2
  primary: {
3
3
  main: '#6950f3',
4
- contrastText: "#fff"
4
+ contrastText: '#fff',
5
5
  },
6
6
  secondary: {
7
7
  main: '#0d1619',
8
- contrastText: "#fff"
8
+ contrastText: '#fff',
9
9
  },
10
10
  divider: '#D4D4D4',
11
11
  background: {
@@ -32,50 +32,34 @@ export const darkPalette = {
32
32
  primary: '#FFFFFF',
33
33
  secondary: '#FDFDFD',
34
34
  disabled: '#F7F7F7',
35
- "16": "rgb(255,255,255)",
36
- "15": "rgb(238,238,238)",
37
- "14": "rgb(221,221,221)",
38
- "13": "rgb(204,204,204)",
39
- "12": "rgb(187,187,187)",
40
- "11": "rgb(170,170,170)",
41
- "10": "rgb(153,153,153)",
42
- "8": "rgb(119,119,119)",
43
- "9": "rgb(136,136,136)",
44
- "7": "rgb(102,102,102)",
45
- "6": "rgb(85,85,85)",
46
- "5": "rgb(68,68,68)",
47
- "4": "rgb(51,51,51)",
48
- "3": "rgb(34,34,34)",
49
- "2": "rgb(17,17,17)",
50
- "1": "#0d1619",
35
+ '16': 'rgb(255,255,255)',
36
+ '15': 'rgb(238,238,238)',
37
+ '14': 'rgb(221,221,221)',
38
+ '13': 'rgb(204,204,204)',
39
+ '12': 'rgb(187,187,187)',
40
+ '11': 'rgb(170,170,170)',
41
+ '10': 'rgb(153,153,153)',
42
+ '8': 'rgb(119,119,119)',
43
+ '9': 'rgb(136,136,136)',
44
+ '7': 'rgb(102,102,102)',
45
+ '6': 'rgb(85,85,85)',
46
+ '5': 'rgb(68,68,68)',
47
+ '4': 'rgb(51,51,51)',
48
+ '3': 'rgb(34,34,34)',
49
+ '2': 'rgb(17,17,17)',
50
+ '1': '#0d1619',
51
51
  },
52
52
  inherit: {
53
- light: "inherit",
54
- dark: "inherit",
55
- contrastText: "inherit",
56
- main: "#1A1A1A",
57
- 16: 'inherit',
58
- 15: 'inherit',
59
- 14: 'inherit',
60
- 13: 'inherit',
61
- 12: 'inherit',
62
- 11: 'inherit',
63
- 10: 'inherit',
64
- 9: 'inherit',
65
- 8: 'inherit',
66
- 7: 'inherit',
67
- 6: 'inherit',
68
- 5: 'inherit',
69
- 4: 'inherit',
70
- 3: 'inherit',
71
- 2: 'inherit',
72
- 1: 'inherit',
53
+ light: 'rgb(51,51,51)',
54
+ dark: 'rgb(17,17,17)',
55
+ contrastText: '#0d1619',
56
+ main: '#FDFDFD',
73
57
  },
74
58
  default: {
75
- light: "#616161",
76
- dark: "#616161",
77
- contrastText: "#616161",
78
- main: "#1A1A1A",
59
+ light: '#616161',
60
+ dark: '#616161',
61
+ contrastText: '#616161',
62
+ main: '#1A1A1A',
79
63
  16: '#1A1A1A',
80
64
  15: '#303030',
81
65
  14: '#4A4A4A',
@@ -92,5 +76,5 @@ export const darkPalette = {
92
76
  3: '#FAFAFA',
93
77
  2: '#FDFDFD',
94
78
  1: '#FFFFFF',
95
- }
79
+ },
96
80
  };
@@ -1,11 +1,11 @@
1
1
  export const lightPalette = {
2
2
  primary: {
3
3
  main: '#6950f3',
4
- contrastText: "#fff"
4
+ contrastText: '#fff',
5
5
  },
6
6
  secondary: {
7
7
  main: '#0d1619',
8
- contrastText: "#fff"
8
+ contrastText: '#fff',
9
9
  },
10
10
  divider: '#D4D4D4',
11
11
  background: {
@@ -23,7 +23,9 @@ export const lightPalette = {
23
23
  main: '#E1CB00',
24
24
  },
25
25
  error: {
26
- main: '#B5260B',
26
+ main: '#d4163a',
27
+ light: '#f81a43',
28
+ dark: '#9a112c',
27
29
  },
28
30
  info: {
29
31
  main: '#007CB4',
@@ -32,50 +34,34 @@ export const lightPalette = {
32
34
  primary: '#0d1619',
33
35
  secondary: '#141414',
34
36
  disabled: '#303030',
35
- "16": "#0d1619",
36
- "15": "rgb(17,17,17)",
37
- "14": "rgb(34,34,34)",
38
- "13": "rgb(51,51,51)",
39
- "12": "rgb(68,68,68)",
40
- "11": "rgb(85,85,85)",
41
- "10": "rgb(102,102,102)",
42
- "9": "rgb(119,119,119)",
43
- "8": "rgb(136,136,136)",
44
- "7": "rgb(153,153,153)",
45
- "6": "rgb(170,170,170)",
46
- "5": "rgb(187,187,187)",
47
- "4": "rgb(204,204,204)",
48
- "3": "rgb(221,221,221)",
49
- "2": "rgb(238,238,238)",
50
- "1": "rgb(255,255,255)",
37
+ '16': '#0d1619',
38
+ '15': 'rgb(17,17,17)',
39
+ '14': 'rgb(34,34,34)',
40
+ '13': 'rgb(51,51,51)',
41
+ '12': 'rgb(68,68,68)',
42
+ '11': 'rgb(85,85,85)',
43
+ '10': 'rgb(102,102,102)',
44
+ '9': 'rgb(119,119,119)',
45
+ '8': 'rgb(136,136,136)',
46
+ '7': 'rgb(153,153,153)',
47
+ '6': 'rgb(170,170,170)',
48
+ '5': 'rgb(187,187,187)',
49
+ '4': 'rgb(204,204,204)',
50
+ '3': 'rgb(221,221,221)',
51
+ '2': 'rgb(238,238,238)',
52
+ '1': 'rgb(255,255,255)',
51
53
  },
52
54
  inherit: {
53
- light: "inherit",
54
- dark: "inherit",
55
- contrastText: "inherit",
56
- main: "#1A1A1A",
57
- 16: 'inherit',
58
- 15: 'inherit',
59
- 14: 'inherit',
60
- 13: 'inherit',
61
- 12: 'inherit',
62
- 11: 'inherit',
63
- 10: 'inherit',
64
- 9: 'inherit',
65
- 8: 'inherit',
66
- 7: 'inherit',
67
- 6: 'inherit',
68
- 5: 'inherit',
69
- 4: 'inherit',
70
- 3: 'inherit',
71
- 2: 'inherit',
72
- 1: 'inherit',
55
+ light: 'rgb(238,238,238)',
56
+ dark: 'rgb(204,204,204)',
57
+ contrastText: '#FDFDFD',
58
+ main: '#0d1619',
73
59
  },
74
60
  default: {
75
- light: "#616161",
76
- dark: "#616161",
77
- contrastText: "#616161",
78
- main: "#1A1A1A",
61
+ light: '#616161',
62
+ dark: '#616161',
63
+ contrastText: '#616161',
64
+ main: '#1A1A1A',
79
65
  16: '#1A1A1A',
80
66
  15: '#303030',
81
67
  14: '#4A4A4A',
@@ -92,5 +78,5 @@ export const lightPalette = {
92
78
  3: '#FAFAFA',
93
79
  2: '#FDFDFD',
94
80
  1: '#FFFFFF',
95
- }
81
+ },
96
82
  };
@@ -27,6 +27,7 @@ import { MuiBreadcrumbs } from '../mui/BreadCrumbs/MuiBreadCrumbs';
27
27
  import { MuiDialog } from '../mui/Dialog/MuiDialog';
28
28
  import { breakpoints } from '../mui/breakpoints';
29
29
  import { MuiMenuItem } from '../mui/menu/MuiMenuItem';
30
+ import { MuiCheckbox } from '../mui/Checkbox/Checkbox';
30
31
  const getDesignTokens = (mode) => ({
31
32
  mode,
32
33
  ...(mode === 'light' ? lightPalette : darkPalette),
@@ -38,30 +39,31 @@ export const themeOptions = (mode, isRtl) => ({
38
39
  typography,
39
40
  breakpoints,
40
41
  components: {
41
- MuiCssBaseline,
42
- MuiAccordion,
43
- MuiAlert,
44
42
  MuiChip,
45
- MuiPagination,
46
- MuiPaginationItem,
47
- MuiSelect,
48
- MuiIconButton,
49
43
  MuiMenu,
50
44
  MuiCard,
51
- MuiTypography,
52
- MuiInputLabel,
53
- MuiTooltip,
54
- MuiFormControlLabel,
55
- MuiInputAdornment,
56
- MuiAutocomplete,
57
- MuiBreadcrumbs,
45
+ MuiRadio,
46
+ MuiAlert,
58
47
  MuiDialog,
48
+ MuiSelect,
49
+ MuiButton,
50
+ MuiSwitch,
51
+ MuiTooltip,
59
52
  MuiMenuItem,
53
+ MuiCheckbox,
60
54
  MuiTextField,
61
- MuiOutlinedInput,
55
+ MuiAccordion,
56
+ MuiInputLabel,
57
+ MuiIconButton,
58
+ MuiTypography,
59
+ MuiPagination,
60
+ MuiCssBaseline,
62
61
  MuiFilledInput,
63
- MuiButton,
64
- MuiSwitch,
65
- MuiRadio,
62
+ MuiBreadcrumbs,
63
+ MuiAutocomplete,
64
+ MuiOutlinedInput,
65
+ MuiPaginationItem,
66
+ MuiInputAdornment,
67
+ MuiFormControlLabel,
66
68
  },
67
69
  });
@@ -34,6 +34,9 @@ declare module '@mui/material/Checkbox/Checkbox' {
34
34
  interface CheckboxProps {
35
35
  customColor?: string;
36
36
  }
37
+ interface CheckboxPropsSizeOverrides {
38
+ large: true;
39
+ }
37
40
  }
38
41
  declare module '@mui/material/Chip' {
39
42
  interface ChipOwnProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mui-design-system",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
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",
@@ -69,4 +69,4 @@
69
69
  "bugs": {
70
70
  "url": "https://github.com/MohammadPj/design-system/issues"
71
71
  }
72
- }
72
+ }