@m4l/graphics 0.1.30 → 0.1.32

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/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { P as l } from "./components/ProgressBarStyle/index.fb6fd9ed.js";
2
- import { F as d, a as F } from "./contexts/FormatterContext/index.92336f4c.js";
3
- import { L as g, a as v, g as C } from "./contexts/LocalesContext/index.5b555637.js";
4
- import { H as L, a as R } from "./contexts/HostThemeContext/index.9fe9854f.js";
5
- import { u as H } from "./hooks/useFirstRender/index.1e9b02fb.js";
6
- import { u as S } from "./hooks/useFormatter/index.57ac8cca.js";
7
- import { b as y, u as z, a as w } from "./hooks/index.64cf4fc4.js";
8
- import { u as D } from "./hooks/useLocales/index.f676279e.js";
9
- import { u as M, a as N } from "./hooks/useResponsive/index.fc5e1b4f.js";
10
- import { C as V, b as j, c as q, a as A, d as E, g as G, i as J, o as K, p as Q, f as U, r as W, e as X, h as Y } from "./utils/index.22212127.js";
1
+ import { P as x } from "./components/ProgressBarStyle/index.fb6fd9ed.js";
2
+ import { F as l, a as F } from "./contexts/FormatterContext/index.92336f4c.js";
3
+ import { L as v, a as C, g as L } from "./contexts/LocalesContext/index.5b555637.js";
4
+ import { H as c, a as H } from "./contexts/HostThemeContext/index.9fe9854f.js";
5
+ import { u as T } from "./hooks/useFirstRender/index.1e9b02fb.js";
6
+ import { u as h } from "./hooks/useFormatter/index.57ac8cca.js";
7
+ import { b as S, u as b, a as w } from "./hooks/index.64cf4fc4.js";
8
+ import { u as z } from "./hooks/useLocales/index.f676279e.js";
9
+ import { u as D, a as I } from "./hooks/useResponsive/index.fc5e1b4f.js";
10
+ import { C as N } from "./utils/index.54cae015.js";
11
11
  import "@mui/material/styles";
12
12
  import "@mui/material";
13
13
  import "react/jsx-runtime";
@@ -17,36 +17,22 @@ import "@mui/x-date-pickers/AdapterDateFns";
17
17
  import "@mui/x-date-pickers";
18
18
  import "date-fns/locale/en-US";
19
19
  import "@mui/material/useMediaQuery";
20
- import "@m4l/graphics";
21
- import "./vendor.158914a7.js";
22
20
  export {
23
- V as Capitalize,
24
- d as FormatterContext,
21
+ N as Capitalize,
22
+ l as FormatterContext,
25
23
  F as FormatterProvider,
26
- L as HostThemeContext,
27
- R as HostThemeProvider,
28
- g as LocalesContext,
29
- v as LocalesProvider,
30
- l as ProgressBarStyle,
31
- j as bluePreset,
32
- q as colorPresets,
33
- A as cyanPreset,
34
- E as defaultPreset,
35
- G as getColorPresets,
36
- J as getFontValue,
37
- C as getLocaleFromNetwork,
38
- K as orangePreset,
39
- Q as purplePreset,
40
- U as pxToRem,
41
- W as redPreset,
42
- X as remToPx,
43
- Y as responsiveFontSizes,
44
- H as useFirstRender,
45
- S as useFormatter,
46
- y as useHostTheme,
47
- z as useIsMountedRef,
48
- D as useLocales,
24
+ c as HostThemeContext,
25
+ H as HostThemeProvider,
26
+ v as LocalesContext,
27
+ C as LocalesProvider,
28
+ x as ProgressBarStyle,
29
+ L as getLocaleFromNetwork,
30
+ T as useFirstRender,
31
+ h as useFormatter,
32
+ S as useHostTheme,
33
+ b as useIsMountedRef,
34
+ z as useLocales,
49
35
  w as useOffSetTop,
50
- M as useResponsive,
51
- N as useResponsiveDesktop
36
+ D as useResponsive,
37
+ I as useResponsiveDesktop
52
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/graphics",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "license": "UNLICENSED",
5
5
  "author": "M4L Team",
6
6
  "dependencies": {
@@ -0,0 +1,4 @@
1
+ const a = (e) => e && e[0].toUpperCase() + e.slice(1) || "";
2
+ export {
3
+ a as C
4
+ };
package/utils/index.d.ts CHANGED
@@ -1,3 +1 @@
1
- export * from './getColorPresets';
2
- export * from './getFontValue';
3
1
  export * from './strings';
@@ -1,170 +0,0 @@
1
- import { ThemeColorPresets } from '../../../m4l_styles/src/types';
2
- export declare const colorPresets: ({
3
- LightSelected: string;
4
- LightSelectedHover: string;
5
- DarkSelected: string;
6
- DarkSelectedHover: string;
7
- contrastText: string;
8
- lighter: string;
9
- light: string;
10
- main: string;
11
- dark: string;
12
- darker: string;
13
- name: string;
14
- } | {
15
- name: string;
16
- lighter: string;
17
- light: string;
18
- main: string;
19
- dark: string;
20
- darker: string;
21
- contrastText: string;
22
- })[];
23
- export declare const defaultPreset: {
24
- LightSelected: string;
25
- LightSelectedHover: string;
26
- DarkSelected: string;
27
- DarkSelectedHover: string;
28
- contrastText: string;
29
- lighter: string;
30
- light: string;
31
- main: string;
32
- dark: string;
33
- darker: string;
34
- name: string;
35
- } | {
36
- name: string;
37
- lighter: string;
38
- light: string;
39
- main: string;
40
- dark: string;
41
- darker: string;
42
- contrastText: string;
43
- };
44
- export declare const purplePreset: {
45
- LightSelected: string;
46
- LightSelectedHover: string;
47
- DarkSelected: string;
48
- DarkSelectedHover: string;
49
- contrastText: string;
50
- lighter: string;
51
- light: string;
52
- main: string;
53
- dark: string;
54
- darker: string;
55
- name: string;
56
- } | {
57
- name: string;
58
- lighter: string;
59
- light: string;
60
- main: string;
61
- dark: string;
62
- darker: string;
63
- contrastText: string;
64
- };
65
- export declare const cyanPreset: {
66
- LightSelected: string;
67
- LightSelectedHover: string;
68
- DarkSelected: string;
69
- DarkSelectedHover: string;
70
- contrastText: string;
71
- lighter: string;
72
- light: string;
73
- main: string;
74
- dark: string;
75
- darker: string;
76
- name: string;
77
- } | {
78
- name: string;
79
- lighter: string;
80
- light: string;
81
- main: string;
82
- dark: string;
83
- darker: string;
84
- contrastText: string;
85
- };
86
- export declare const bluePreset: {
87
- LightSelected: string;
88
- LightSelectedHover: string;
89
- DarkSelected: string;
90
- DarkSelectedHover: string;
91
- contrastText: string;
92
- lighter: string;
93
- light: string;
94
- main: string;
95
- dark: string;
96
- darker: string;
97
- name: string;
98
- } | {
99
- name: string;
100
- lighter: string;
101
- light: string;
102
- main: string;
103
- dark: string;
104
- darker: string;
105
- contrastText: string;
106
- };
107
- export declare const orangePreset: {
108
- LightSelected: string;
109
- LightSelectedHover: string;
110
- DarkSelected: string;
111
- DarkSelectedHover: string;
112
- contrastText: string;
113
- lighter: string;
114
- light: string;
115
- main: string;
116
- dark: string;
117
- darker: string;
118
- name: string;
119
- } | {
120
- name: string;
121
- lighter: string;
122
- light: string;
123
- main: string;
124
- dark: string;
125
- darker: string;
126
- contrastText: string;
127
- };
128
- export declare const redPreset: {
129
- LightSelected: string;
130
- LightSelectedHover: string;
131
- DarkSelected: string;
132
- DarkSelectedHover: string;
133
- contrastText: string;
134
- lighter: string;
135
- light: string;
136
- main: string;
137
- dark: string;
138
- darker: string;
139
- name: string;
140
- } | {
141
- name: string;
142
- lighter: string;
143
- light: string;
144
- main: string;
145
- dark: string;
146
- darker: string;
147
- contrastText: string;
148
- };
149
- export declare function getColorPresets(presetsKey: ThemeColorPresets): {
150
- LightSelected: string;
151
- LightSelectedHover: string;
152
- DarkSelected: string;
153
- DarkSelectedHover: string;
154
- contrastText: string;
155
- lighter: string;
156
- light: string;
157
- main: string;
158
- dark: string;
159
- darker: string;
160
- name: string;
161
- } | {
162
- name: string;
163
- lighter: string;
164
- light: string;
165
- main: string;
166
- dark: string;
167
- darker: string;
168
- contrastText: string;
169
- };
170
- export default getColorPresets;
@@ -1,24 +0,0 @@
1
- import type { Variant } from '@mui/material/styles/createTypography';
2
- export declare function remToPx(value: string): number;
3
- export declare function pxToRem(value: number): string;
4
- export declare function responsiveFontSizes({ sm, md, lg }: {
5
- sm: number;
6
- md: number;
7
- lg: number;
8
- }): {
9
- '@media (min-width:600px)': {
10
- fontSize: string;
11
- };
12
- '@media (min-width:900px)': {
13
- fontSize: string;
14
- };
15
- '@media (min-width:1200px)': {
16
- fontSize: string;
17
- };
18
- };
19
- export declare function getFontValue(variant: Variant): {
20
- fontSize: number;
21
- lineHeight: number;
22
- fontWeight: import("csstype").Property.FontWeight | undefined;
23
- letterSpacing: import("csstype").Property.LetterSpacing<string | number> | undefined;
24
- };
@@ -1,113 +0,0 @@
1
- import { useResponsive as m } from "@m4l/graphics";
2
- import { useTheme as h } from "@mui/material/styles";
3
- import { p as s } from "../vendor.158914a7.js";
4
- const n = [
5
- {
6
- name: "default",
7
- ...s.light.primary,
8
- LightSelected: "#EBF9F1",
9
- LightSelectedHover: "#D6F2E3",
10
- DarkSelected: "#142827",
11
- DarkSelectedHover: "#12342B"
12
- },
13
- {
14
- name: "purple",
15
- lighter: "#EBD6FD",
16
- light: "#B985F4",
17
- main: "#7635dc",
18
- dark: "#431A9E",
19
- darker: "#200A69",
20
- contrastText: "#fff"
21
- },
22
- {
23
- name: "cyan",
24
- lighter: "#D1FFFC",
25
- light: "#76F2FF",
26
- main: "#1CCAFF",
27
- dark: "#0E77B7",
28
- darker: "#053D7A",
29
- contrastText: s.light.grey[800]
30
- },
31
- {
32
- name: "blue",
33
- lighter: "#D1E9FC",
34
- light: "#76B0F1",
35
- main: "#2065D1",
36
- dark: "#103996",
37
- darker: "#061B64",
38
- contrastText: "#fff"
39
- },
40
- {
41
- name: "orange",
42
- lighter: "#FEF4D4",
43
- light: "#FED680",
44
- main: "#fda92d",
45
- dark: "#B66816",
46
- darker: "#793908",
47
- contrastText: s.light.grey[800]
48
- },
49
- {
50
- name: "red",
51
- lighter: "#FFE3D5",
52
- light: "#FFC1AC",
53
- main: "#FF3030",
54
- dark: "#B71833",
55
- darker: "#7A0930",
56
- contrastText: "#fff"
57
- }
58
- ], u = n[0], f = n[1], F = n[2], y = n[3], k = n[4], x = n[5];
59
- function P(e) {
60
- return {
61
- purple: f,
62
- cyan: F,
63
- blue: y,
64
- orange: k,
65
- red: x,
66
- default: u
67
- }[e];
68
- }
69
- function D(e) {
70
- return Math.round(parseFloat(e) * 16);
71
- }
72
- function a(e) {
73
- return `${e / 16}rem`;
74
- }
75
- function b({ sm: e, md: t, lg: r }) {
76
- return {
77
- "@media (min-width:600px)": {
78
- fontSize: a(e)
79
- },
80
- "@media (min-width:900px)": {
81
- fontSize: a(t)
82
- },
83
- "@media (min-width:1200px)": {
84
- fontSize: a(r)
85
- }
86
- };
87
- }
88
- function S() {
89
- return [...h().breakpoints.keys].reverse().reduce((r, o) => {
90
- const i = m("up", o);
91
- return !r && i ? o : r;
92
- }, null) || "xs";
93
- }
94
- function T(e) {
95
- const t = h(), r = S(), o = t.breakpoints.up(r === "xl" ? "lg" : r), p = (e === "h1" || e === "h2" || e === "h3" || e === "h4" || e === "h5" || e === "h6") && t.typography[e][o] ? t.typography[e][o] : t.typography[e], c = D(p.fontSize), l = Number(t.typography[e].lineHeight) * c, { fontWeight: g, letterSpacing: d } = t.typography[e];
96
- return { fontSize: c, lineHeight: l, fontWeight: g, letterSpacing: d };
97
- }
98
- const z = (e) => e && e[0].toUpperCase() + e.slice(1) || "";
99
- export {
100
- z as C,
101
- F as a,
102
- y as b,
103
- n as c,
104
- u as d,
105
- D as e,
106
- a as f,
107
- P as g,
108
- b as h,
109
- T as i,
110
- k as o,
111
- f as p,
112
- x as r
113
- };
@@ -1,135 +0,0 @@
1
- import { alpha as t } from "@mui/material/styles";
2
- import "./components/ProgressBarStyle/index.fb6fd9ed.js";
3
- import "./contexts/FormatterContext/index.92336f4c.js";
4
- import "./contexts/LocalesContext/index.5b555637.js";
5
- import "./contexts/HostThemeContext/index.9fe9854f.js";
6
- import "./hooks/useFirstRender/index.1e9b02fb.js";
7
- import "./hooks/useFormatter/index.57ac8cca.js";
8
- import "./hooks/index.64cf4fc4.js";
9
- import "./hooks/useLocales/index.f676279e.js";
10
- import "./hooks/useResponsive/index.fc5e1b4f.js";
11
- import "./utils/index.22212127.js";
12
- function r(c, l) {
13
- return `linear-gradient(to bottom, ${c}, ${l})`;
14
- }
15
- const a = {
16
- lighter: "#C8FACD",
17
- light: "#5BE584",
18
- main: "#00AB55",
19
- dark: "#007B55",
20
- darker: "#005249"
21
- }, A = {
22
- lighter: "#D6E4FF",
23
- light: "#84A9FF",
24
- main: "#3366FF",
25
- dark: "#1939B7",
26
- darker: "#091A7A"
27
- }, i = {
28
- lighter: "#D0F2FF",
29
- light: "#74CAFF",
30
- main: "#1890FF",
31
- dark: "#0C53B7",
32
- darker: "#04297A"
33
- }, o = {
34
- lighter: "#E9FCD4",
35
- light: "#AAF27F",
36
- main: "#54D62C",
37
- dark: "#229A16",
38
- darker: "#08660D"
39
- }, n = {
40
- lighter: "#FFF7CD",
41
- light: "#FFE16A",
42
- main: "#FFC107",
43
- dark: "#B78103",
44
- darker: "#7A4F01"
45
- }, d = {
46
- lighter: "#FFE7D9",
47
- light: "#FFA48D",
48
- main: "#FF4842",
49
- dark: "#B72136",
50
- darker: "#7A0C2E"
51
- }, F = {
52
- 0: "#FFFFFF",
53
- 100: "#F9FAFB",
54
- 200: "#F4F6F8",
55
- 300: "#DFE3E8",
56
- 400: "#C4CDD5",
57
- 500: "#919EAB",
58
- 600: "#637381",
59
- 700: "#454F5B",
60
- 800: "#212B36",
61
- 900: "#161C24",
62
- 5008: t("#919EAB", 0.08),
63
- 50012: t("#919EAB", 0.12),
64
- 50016: t("#919EAB", 0.16),
65
- 50024: t("#919EAB", 0.24),
66
- 50032: t("#919EAB", 0.32),
67
- 50048: t("#919EAB", 0.48),
68
- 50056: t("#919EAB", 0.56),
69
- 50080: t("#919EAB", 0.8)
70
- }, s = {
71
- primary: r(a.light, a.main),
72
- info: r(i.light, i.main),
73
- success: r(o.light, o.main),
74
- warning: r(n.light, n.main),
75
- error: r(d.light, d.main)
76
- }, m = {
77
- violet: ["#826AF9", "#9E86FF", "#D0AEFF", "#F7D2FF"],
78
- blue: ["#2D99FF", "#83CFFF", "#A5F3FF", "#CCFAFF"],
79
- green: ["#2CD9C5", "#60F1C8", "#A4F7CC", "#C0F2DC"],
80
- yellow: ["#FFE700", "#FFEF5A", "#FFF7AE", "#FFF3D6"],
81
- red: ["#FF6C40", "#FF8F6D", "#FFBD98", "#FFF2D4"]
82
- }, e = {
83
- common: { black: "#000", white: "#fff" },
84
- primary: { ...a, contrastText: "#fff" },
85
- secondary: { ...A, contrastText: "#fff" },
86
- info: { ...i, contrastText: "#fff" },
87
- success: { ...o, contrastText: F[800] },
88
- warning: { ...n, contrastText: F[800] },
89
- error: { ...d, contrastText: "#fff" },
90
- grey: F,
91
- gradients: s,
92
- chart: m,
93
- divider: F[50024],
94
- action: {
95
- hover: F[5008],
96
- selected: F[50016],
97
- disabled: F[50080],
98
- disabledBackground: F[50024],
99
- focus: F[50024],
100
- hoverOpacity: 0.08,
101
- disabledOpacity: 0.48
102
- }
103
- }, R = {
104
- light: {
105
- ...e,
106
- mode: "light",
107
- text: { primary: F[800], secondary: F[700], disabled: F[500] },
108
- background: {
109
- paper: "#fff",
110
- default: "#fff",
111
- neutral: F[200],
112
- autocomplete: F[100],
113
- header: "#F6F7F9"
114
- },
115
- action: { active: F[600], ...e.action },
116
- grid: { sectionHeader: "#F6F7F9", divider: "#EDEFF2", rowHover: "#FAFBFC" }
117
- },
118
- dark: {
119
- ...e,
120
- mode: "dark",
121
- text: { primary: "#fff", secondary: F[500], disabled: F[600] },
122
- background: {
123
- paper: F[800],
124
- default: F[900],
125
- neutral: F[50016],
126
- autocomplete: F[800],
127
- header: "#29313A"
128
- },
129
- action: { active: F[500], ...e.action },
130
- grid: { sectionHeader: "#29313A", divider: "#3E464F", rowHover: "#1F262F" }
131
- }
132
- };
133
- export {
134
- R as p
135
- };