@m4l/graphics 0.0.39 → 0.1.3

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.
Files changed (79) hide show
  1. package/{dist/components → components}/ProgressBarStyle/index.d.ts +0 -0
  2. package/{dist/components → components}/ProgressBarStyle/index.js +0 -0
  3. package/{dist/components → components}/index.d.ts +0 -0
  4. package/{dist/components → components}/index.js +0 -0
  5. package/{dist/contexts → contexts}/HostThemeContext/index.d.ts +0 -0
  6. package/{dist/contexts → contexts}/HostThemeContext/index.js +0 -0
  7. package/{dist/contexts → contexts}/HostThemeContext/types.d.ts +0 -0
  8. package/{dist/contexts → contexts}/LocalesContext/index.d.ts +0 -0
  9. package/{dist/contexts → contexts}/LocalesContext/index.js +0 -0
  10. package/{dist/contexts → contexts}/index.d.ts +0 -0
  11. package/{dist/contexts → contexts}/index.js +0 -0
  12. package/{dist/hooks → hooks}/index.d.ts +0 -1
  13. package/{dist/hooks → hooks}/index.js +0 -1
  14. package/{dist/hooks → hooks}/useHostTheme/index.d.ts +0 -0
  15. package/{dist/hooks → hooks}/useHostTheme/index.js +0 -0
  16. package/{dist/hooks → hooks}/useIsMountedRef.d.ts +0 -0
  17. package/{dist/hooks → hooks}/useLocales/index.d.ts +0 -0
  18. package/{dist/hooks → hooks}/useLocales/index.js +0 -0
  19. package/{dist/hooks → hooks}/useOffSetTop.d.ts +0 -0
  20. package/{dist/hooks → hooks}/useResponsive/index.d.ts +0 -0
  21. package/{dist/hooks → hooks}/useResponsive/index.js +0 -0
  22. package/{dist/index.d.ts → index.d.ts} +4 -0
  23. package/{dist/index.js → index.js} +3 -4
  24. package/package.json +16 -68
  25. package/{dist/theme → theme}/defaultThemeOptions.d.ts +0 -0
  26. package/{dist/theme → theme}/defaultThemeOptions.js +0 -0
  27. package/{dist/theme → theme}/overrides/Accordion.d.ts +0 -0
  28. package/{dist/theme → theme}/overrides/Autocomplete.d.ts +0 -0
  29. package/{dist/theme → theme}/overrides/Avatar.d.ts +0 -0
  30. package/{dist/theme → theme}/overrides/Backdrop.d.ts +0 -0
  31. package/{dist/theme → theme}/overrides/Badge.d.ts +0 -0
  32. package/{dist/theme → theme}/overrides/Breadcrumbs.d.ts +0 -0
  33. package/{dist/theme → theme}/overrides/Button.d.ts +0 -0
  34. package/{dist/theme → theme}/overrides/ButtonGroup.d.ts +0 -0
  35. package/{dist/theme → theme}/overrides/Card.d.ts +0 -0
  36. package/{dist/theme → theme}/overrides/Checkbox.d.ts +0 -0
  37. package/{dist/theme → theme}/overrides/ControlLabel.d.ts +0 -0
  38. package/{dist/theme → theme}/overrides/CssBaseline.d.ts +0 -0
  39. package/{dist/theme → theme}/overrides/DataGrid.d.ts +0 -0
  40. package/{dist/theme → theme}/overrides/Dialog.d.ts +0 -0
  41. package/{dist/theme → theme}/overrides/Drawer.d.ts +0 -0
  42. package/{dist/theme → theme}/overrides/Fab.d.ts +0 -0
  43. package/{dist/theme → theme}/overrides/IconButton.d.ts +0 -0
  44. package/{dist/theme → theme}/overrides/Input.d.ts +0 -0
  45. package/{dist/theme → theme}/overrides/InputLabel.d.ts +0 -0
  46. package/{dist/theme → theme}/overrides/Link.d.ts +0 -0
  47. package/{dist/theme → theme}/overrides/List.d.ts +0 -0
  48. package/{dist/theme → theme}/overrides/LoadingButton.d.ts +0 -0
  49. package/{dist/theme → theme}/overrides/Menu.d.ts +0 -0
  50. package/{dist/theme → theme}/overrides/Pagination.d.ts +0 -0
  51. package/{dist/theme → theme}/overrides/Paper.d.ts +0 -0
  52. package/{dist/theme → theme}/overrides/Popover.d.ts +0 -0
  53. package/{dist/theme → theme}/overrides/Progress.d.ts +0 -0
  54. package/{dist/theme → theme}/overrides/Radio.d.ts +0 -0
  55. package/{dist/theme → theme}/overrides/Skeleton.d.ts +0 -0
  56. package/{dist/theme → theme}/overrides/Slider.d.ts +0 -0
  57. package/{dist/theme → theme}/overrides/Stepper.d.ts +0 -0
  58. package/{dist/theme → theme}/overrides/SvgIcon.d.ts +0 -0
  59. package/{dist/theme → theme}/overrides/Switch.d.ts +0 -0
  60. package/{dist/theme → theme}/overrides/Table.d.ts +0 -0
  61. package/{dist/theme → theme}/overrides/Tabs.d.ts +0 -0
  62. package/{dist/theme → theme}/overrides/Timeline.d.ts +0 -0
  63. package/{dist/theme → theme}/overrides/ToggleButton.d.ts +0 -0
  64. package/{dist/theme → theme}/overrides/Tooltip.d.ts +0 -0
  65. package/{dist/theme → theme}/overrides/Typography.d.ts +0 -0
  66. package/{dist/theme → theme}/overrides/index.d.ts +0 -0
  67. package/{dist/theme → theme}/overrides.js +0 -0
  68. package/{dist/theme → theme}/palette.d.ts +1 -0
  69. package/{dist/theme → theme}/palette.js +0 -0
  70. package/{dist/theme → theme}/shadows.d.ts +1 -1
  71. package/{dist/theme → theme}/shadows.js +0 -0
  72. package/{dist/theme → theme}/typography.d.ts +0 -0
  73. package/{dist/theme → theme}/typography.js +0 -0
  74. package/{dist/types → types}/index.d.ts +0 -0
  75. package/{dist/utils → utils}/getColorPresets.d.ts +2 -1
  76. package/{dist/utils → utils}/getFontValue.d.ts +1 -1
  77. package/{dist/utils → utils}/index.js +25 -3
  78. /package/{dist/vite-env.d.ts → vite-env.d.ts} +0 -0
  79. package/README.md +0 -0
File without changes
File without changes
File without changes
File without changes
@@ -3,4 +3,3 @@ export { useIsMountedRef } from './useIsMountedRef';
3
3
  export { useLocales } from './useLocales';
4
4
  export { useOffSetTop } from './useOffSetTop';
5
5
  export { useHostTheme } from './useHostTheme';
6
- export { useFormContext, Controller, useWatch } from 'react-hook-form';
@@ -3,7 +3,6 @@ import "@mui/material/styles";
3
3
  import "@mui/material/useMediaQuery";
4
4
  import "../contexts/LocalesContext/index.js";
5
5
  import "../contexts/HostThemeContext/index.js";
6
- import "react-hook-form";
7
6
  function useIsMountedRef() {
8
7
  const isMounted = useRef(true);
9
8
  useEffect(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,5 +6,9 @@ export type { GradientsPaletteOptions } from './theme/palette';
6
6
  export type { ChartPaletteOptions } from './theme/palette';
7
7
  export type { GridPaletteOptions } from './theme/palette';
8
8
  export { defaultThemeOptions } from './theme/defaultThemeOptions';
9
+ export { shadows, customShadows } from './theme/shadows';
10
+ export { palette, type ColorSchema } from './theme/palette';
11
+ export { getColorPresets, colorPresets, defaultPreset } from './utils/getColorPresets';
12
+ export { getFontValue as GetFontValue } from './utils/getFontValue';
9
13
  export { default as fnComponentsOverrides } from './theme/overrides';
10
14
  export type { HostThemeType } from './types';
@@ -5,8 +5,10 @@ export { u as useResponsive, a as useResponsiveDesktop } from "./hooks/useRespon
5
5
  export { u as useIsMountedRef, a as useOffSetTop } from "./hooks/index.js";
6
6
  export { u as useLocales } from "./hooks/useLocales/index.js";
7
7
  export { u as useHostTheme } from "./hooks/useHostTheme/index.js";
8
- export { Controller, useFormContext, useWatch } from "react-hook-form";
9
8
  export { d as defaultThemeOptions } from "./theme/defaultThemeOptions.js";
9
+ export { c as customShadows, s as shadows } from "./theme/shadows.js";
10
+ export { p as palette } from "./theme/palette.js";
11
+ export { a as GetFontValue, c as colorPresets, d as defaultPreset, g as getColorPresets } from "./utils/index.js";
10
12
  export { f as fnComponentsOverrides } from "./theme/overrides.js";
11
13
  import "@mui/material/styles";
12
14
  import "@mui/material";
@@ -20,6 +22,3 @@ import "date-fns/locale/en-US";
20
22
  import "@m4l/core";
21
23
  import "@mui/material/useMediaQuery";
22
24
  import "./theme/typography.js";
23
- import "./utils/index.js";
24
- import "./theme/palette.js";
25
- import "./theme/shadows.js";
package/package.json CHANGED
@@ -1,86 +1,34 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "private": false,
4
- "version": "0.0.39",
3
+ "version": "0.1.3",
5
4
  "license": "UNLICENSED",
6
5
  "author": "M4L Team",
7
- "scripts": {
8
- "dev": "vite",
9
- "build": "tsc && vite build",
10
- "preview": "vite preview",
11
- "lint": "npx eslint src",
12
- "lint:fix": "npm run lint -- --fix",
13
- "prettier": "npx prettier src --check",
14
- "prettier:fix": "npm run prettier -- --write",
15
- "format": "npm run prettier:fix && npm run lint:fix"
16
- },
17
6
  "dependencies": {
18
- "@m4l/core": "^0.0.42",
19
- "@mui/material": "^5.8.6",
7
+ "@m4l/core": "*",
20
8
  "@mui/x-date-pickers": "^5.0.0-beta.3",
21
- "date-fns": "^2.29.1",
22
- "framer-motion": "^6.3.11",
23
- "react": ">=18",
24
- "react-dom": "^18.0.0",
25
- "react-dropzone": "^14.2.1",
26
- "react-hook-form": "^7.31.3",
27
- "react-intersection-observer": "^9.2.2",
28
- "react-router-dom": "^6.3.0",
29
- "vite-tsconfig-paths": "^3.5.0"
9
+ "date-fns": "^2.29.2"
30
10
  },
31
11
  "peerDependencies": {
32
- "date-fns": "^2.29.1",
33
- "react": ">=18",
34
- "react-dom": "^18.0.0"
35
- },
36
- "devDependencies": {
37
- "@emotion/styled": "^11.9.3",
38
- "@hookform/resolvers": "^2.9.3",
39
- "@mui/icons-material": "^5.8.4",
40
- "@types/mkcert": "^1.2.0",
41
- "@types/node": "^17.0.40",
42
- "@types/nprogress": "^0.2.0",
43
- "@types/react": "^18.0.0",
44
- "@types/react-dom": "^18.0.0",
45
- "@typescript-eslint/eslint-plugin": "^5.27.1",
46
- "@typescript-eslint/parser": "^5.27.1",
47
- "@vitejs/plugin-react": "^1.3.0",
48
- "eslint": "^8.17.0",
49
- "eslint-config-prettier": "^8.5.0",
50
- "eslint-import-resolver-alias": "^1.1.2",
51
- "eslint-plugin-import": "^2.26.0",
52
- "eslint-plugin-jsx-a11y": "^6.5.1",
53
- "eslint-plugin-prettier": "^4.0.0",
54
- "eslint-plugin-react": "^7.30.0",
55
- "eslint-plugin-react-hooks": "^4.5.0",
56
- "eslint-plugin-unused-imports": "^2.0.0",
57
- "prettier": "^2.6.2",
58
- "react": "^18.2.0",
59
- "react-dom": "^18.2.0",
60
- "react-toastify": "^9.0.5",
61
- "rollup-plugin-terser": "^7.0.2",
62
- "typescript": "^4.6.3",
63
- "vite": "^2.9.9",
64
- "vite-plugin-dts": "^1.2.0",
65
- "vite-plugin-mkcert": "^1.6.4"
12
+ "@mui/material": "^5.10.4",
13
+ "@mui/system": "^5.10.4",
14
+ "@types/react": "^17.0.0 || ^18.0.0",
15
+ "react": "^17.0.0 || ^18.0.0",
16
+ "react-dom": "^17.0.0 || ^18.0.0"
66
17
  },
67
18
  "files": [
68
- "dist"
19
+ "*"
69
20
  ],
70
- "main": "./dist/index.js",
71
- "module": "./dist/index.js",
21
+ "source": "src/index.ts",
22
+ "main": "./index.js",
23
+ "module": "./index.js",
72
24
  "type": "module",
73
- "types": "./dist/index.d.ts",
74
- "exports": {
75
- ".": {
76
- "import": "./dist/index.js"
77
- }
78
- },
25
+ "types": "./index.d.ts",
79
26
  "sideEffects": false,
80
27
  "publishConfig": {
81
28
  "access": "public"
82
29
  },
83
30
  "engines": {
84
31
  "node": ">=12.0.0"
85
- }
86
- }
32
+ },
33
+ "private": false
34
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -320,3 +320,4 @@ export declare const palette: {
320
320
  readonly divider: string;
321
321
  };
322
322
  };
323
+ export default palette;
File without changes
@@ -60,7 +60,7 @@ export declare const customShadows: {
60
60
  dropdown: string;
61
61
  };
62
62
  };
63
- declare const shadows: {
63
+ export declare const shadows: {
64
64
  light: Shadows;
65
65
  dark: Shadows;
66
66
  };
File without changes
File without changes
File without changes
File without changes
@@ -146,7 +146,7 @@ export declare const redPreset: {
146
146
  darker: string;
147
147
  contrastText: string;
148
148
  };
149
- export default function getColorPresets(presetsKey: ThemeColorPresets): {
149
+ export declare function getColorPresets(presetsKey: ThemeColorPresets): {
150
150
  LightSelected: string;
151
151
  LightSelectedHover: string;
152
152
  DarkSelected: string;
@@ -167,3 +167,4 @@ export default function getColorPresets(presetsKey: ThemeColorPresets): {
167
167
  darker: string;
168
168
  contrastText: string;
169
169
  };
170
+ export default getColorPresets;
@@ -16,7 +16,7 @@ export declare function responsiveFontSizes({ sm, md, lg }: {
16
16
  fontSize: string;
17
17
  };
18
18
  };
19
- export declare function GetFontValue(variant: Variant): {
19
+ export declare function getFontValue(variant: Variant): {
20
20
  fontSize: number;
21
21
  lineHeight: number;
22
22
  fontWeight: import("csstype").Property.FontWeight | undefined;
@@ -1,6 +1,9 @@
1
- import "@mui/material/styles";
2
- import "@mui/material/useMediaQuery";
1
+ import { useTheme } from "@mui/material/styles";
2
+ import { u as useResponsive } from "../hooks/useResponsive/index.js";
3
3
  import { p as palette } from "../theme/palette.js";
4
+ function remToPx(value) {
5
+ return Math.round(parseFloat(value) * 16);
6
+ }
4
7
  function pxToRem(value) {
5
8
  return `${value / 16}rem`;
6
9
  }
@@ -17,6 +20,25 @@ function responsiveFontSizes({ sm, md, lg }) {
17
20
  }
18
21
  };
19
22
  }
23
+ function useWidth() {
24
+ const theme = useTheme();
25
+ const keys = [...theme.breakpoints.keys].reverse();
26
+ return keys.reduce((output, key) => {
27
+ const matches = useResponsive("up", key);
28
+ return !output && matches ? key : output;
29
+ }, null) || "xs";
30
+ }
31
+ function getFontValue(variant) {
32
+ const theme = useTheme();
33
+ const breakpoints = useWidth();
34
+ const key = theme.breakpoints.up(breakpoints === "xl" ? "lg" : breakpoints);
35
+ const hasResponsive = variant === "h1" || variant === "h2" || variant === "h3" || variant === "h4" || variant === "h5" || variant === "h6";
36
+ const getFont = hasResponsive && theme.typography[variant][key] ? theme.typography[variant][key] : theme.typography[variant];
37
+ const fontSize = remToPx(getFont.fontSize);
38
+ const lineHeight = Number(theme.typography[variant].lineHeight) * fontSize;
39
+ const { fontWeight, letterSpacing } = theme.typography[variant];
40
+ return { fontSize, lineHeight, fontWeight, letterSpacing };
41
+ }
20
42
  const colorPresets = [
21
43
  {
22
44
  name: "default",
@@ -88,4 +110,4 @@ function getColorPresets(presetsKey) {
88
110
  default: defaultPreset
89
111
  }[presetsKey];
90
112
  }
91
- export { getColorPresets as g, pxToRem as p, responsiveFontSizes as r };
113
+ export { getFontValue as a, colorPresets as c, defaultPreset as d, getColorPresets as g, pxToRem as p, responsiveFontSizes as r };
File without changes
package/README.md DELETED
File without changes