@amateescu/portal-ui-components 0.0.30-beta8 → 0.0.31

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 (32) hide show
  1. package/dist/{Box-ZFRI9JCw.js → Box-D-aleOLf.js} +1 -1
  2. package/dist/{Button-CNfTnafe.js → Button-xgiLW4_3.js} +5 -7
  3. package/dist/{ButtonBase-DWpUn0eT.js → ButtonBase-DUKuDCWw.js} +126 -125
  4. package/dist/{CircularProgress-D6RyizwS.js → CircularProgress-Dq_bUtxt.js} +29 -30
  5. package/dist/{EllipsisOutlined-D-3xCg8z.js → EllipsisOutlined-CmR4hXJ_.js} +1 -1
  6. package/dist/{PurePanel-CTG2Gs1r.js → PurePanel-CykVuv66.js} +1 -1
  7. package/dist/{Skeleton-AxdUhch9.js → Skeleton-BBwDqRB3.js} +1 -1
  8. package/dist/{UserInfoDropdown-DLPEHXMj.js → UserInfoDropdown-DtadP0e7.js} +3 -3
  9. package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
  10. package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
  11. package/dist/components/CustomButton/CustomButton.js +1 -1
  12. package/dist/components/CustomButton/CustomButton.stories.js +1 -1
  13. package/dist/components/CustomPagination/CustomPagination.js +39 -41
  14. package/dist/components/ErrorModal/ErrorModal.js +1 -1
  15. package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
  16. package/dist/components/InfoModal/InfoModal.js +1 -1
  17. package/dist/components/InfoModal/InfoModal.stories.js +1 -1
  18. package/dist/components/KpiCard/KpiCard.js +3 -3
  19. package/dist/components/LoadingAnimation/LoadingAnimation.js +2 -2
  20. package/dist/components/Login/Login.js +1009 -989
  21. package/dist/components/SideMenu/SideMenu.js +1 -1
  22. package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
  23. package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
  24. package/dist/components/index.js +1 -1
  25. package/dist/{context-D9BBvKPl.js → context-4ttylmIf.js} +1648 -1676
  26. package/dist/{createSimplePaletteValueFilter-rq2_biPF.js → createSimplePaletteValueFilter-evt-Xthj.js} +197 -196
  27. package/dist/{createSvgIcon-jB7EUYpq.js → createSvgIcon-CgFXfzFk.js} +1 -1
  28. package/dist/{index-C4jQKFL8.js → index-Dz00OoV7.js} +3 -3
  29. package/dist/main.js +1 -1
  30. package/dist/useSlot-Baxtq84W.js +188 -0
  31. package/package.json +11 -11
  32. package/dist/useSlot-CT4096EK.js +0 -188
@@ -1,6 +1,6 @@
1
1
  import * as h from "react";
2
2
  import { jsxs as I, jsx as b } from "react/jsx-runtime";
3
- import { g as w, a as N, u as C, s as O, c as T, b as z, d as R, m as E, P as e } from "./createSimplePaletteValueFilter-rq2_biPF.js";
3
+ import { g as w, a as N, u as C, s as O, c as T, b as z, d as R, m as E, P as e } from "./createSimplePaletteValueFilter-evt-Xthj.js";
4
4
  function j(o) {
5
5
  return w("MuiSvgIcon", o);
6
6
  }
@@ -1,9 +1,9 @@
1
- import { L as Nn, G as ve, I as se, e as I, l as G, H as Pn, K as qe, J as In, n as Mn, c as M, h as Ne, _ as be, q as Ue, M as Pe, N as Tn, O as Ie, j as Me, P as Rn, Q as jn, k as Bn, R as Dn, S as Xe, g as ye, m as Ke, u as O, y as Fn, B as Ln, a as ce, v as he, D as ke, t as ie, T as zn, F as _n, C as Qe, U as Hn, W as Wn, X as Vn, Y as Ze } from "./context-D9BBvKPl.js";
1
+ import { L as Nn, G as ve, I as se, e as I, l as G, H as Pn, K as qe, J as In, n as Mn, c as M, h as Ne, _ as be, q as Ue, M as Pe, N as Tn, O as Ie, j as Me, P as Rn, Q as jn, k as Bn, R as Dn, S as Xe, g as ye, m as Ke, u as O, y as Fn, B as Ln, a as ce, v as he, D as ke, t as ie, T as zn, F as _n, C as Qe, U as Hn, W as Wn, X as Vn, Y as Ze } from "./context-4ttylmIf.js";
2
2
  import * as r from "react";
3
3
  import b, { useContext as ae, useRef as U, useMemo as An, useEffect as Te } from "react";
4
- import { B as xe, c as Ye, i as Gn, u as qn, C as Un, z as Xn, a as Kn, g as kn, w as Qn } from "./PurePanel-CTG2Gs1r.js";
4
+ import { B as xe, c as Ye, i as Gn, u as qn, C as Un, z as Xn, a as Kn, g as kn, w as Qn } from "./PurePanel-CykVuv66.js";
5
5
  import { _ as B } from "./objectWithoutPropertiesLoose-BTau6TOn.js";
6
- import { R as $e, S as Zn } from "./Skeleton-AxdUhch9.js";
6
+ import { R as $e, S as Zn } from "./Skeleton-BBwDqRB3.js";
7
7
  const Ee = (e, n) => {
8
8
  const o = r.useContext(Nn), t = r.useMemo(() => {
9
9
  var l;
package/dist/main.js CHANGED
@@ -10,7 +10,7 @@ import { LoadingAnimation as L } from "./components/LoadingAnimation/LoadingAnim
10
10
  import { Login as P } from "./components/Login/Login.js";
11
11
  import { SideMenu as h } from "./components/SideMenu/SideMenu.js";
12
12
  import { TotalDataGrid as A } from "./components/TotalDataGrid/TotalDataGrid.js";
13
- import { U as I } from "./UserInfoDropdown-DLPEHXMj.js";
13
+ import { U as I } from "./UserInfoDropdown-DtadP0e7.js";
14
14
  import { chunkArray as b } from "./portal-utils/chunkArray.js";
15
15
  import { cn as v } from "./portal-utils/cn.js";
16
16
  import { currency as B, date as E, datetime as F, decimal as G, fuelUnitPrice as S, fuelVolume as T, hours as V, number as W, time as j } from "./portal-utils/formatters.js";
@@ -0,0 +1,188 @@
1
+ import * as i from "react";
2
+ import { P as E, c as v } from "./createSimplePaletteValueFilter-evt-Xthj.js";
3
+ import "react/jsx-runtime";
4
+ import { u as I } from "./ButtonBase-DUKuDCWw.js";
5
+ const k = /* @__PURE__ */ i.createContext();
6
+ process.env.NODE_ENV !== "production" && (E.node, E.bool);
7
+ const _ = () => i.useContext(k) ?? !1;
8
+ function W(e) {
9
+ const {
10
+ controlled: o,
11
+ default: t,
12
+ name: n,
13
+ state: s = "value"
14
+ } = e, {
15
+ current: r
16
+ } = i.useRef(o !== void 0), [f, a] = i.useState(t), m = r ? o : f;
17
+ if (process.env.NODE_ENV !== "production") {
18
+ i.useEffect(() => {
19
+ r !== (o !== void 0) && console.error([`MUI: A component is changing the ${r ? "" : "un"}controlled ${s} state of ${n} to be ${r ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
20
+ `));
21
+ }, [s, n, o]);
22
+ const {
23
+ current: c
24
+ } = i.useRef(t);
25
+ i.useEffect(() => {
26
+ !r && !Object.is(c, t) && console.error([`MUI: A component is changing the default ${s} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
27
+ `));
28
+ }, [JSON.stringify(t)]);
29
+ }
30
+ const u = i.useCallback((c) => {
31
+ r || a(c);
32
+ }, []);
33
+ return [m, u];
34
+ }
35
+ function w(e) {
36
+ const o = typeof e;
37
+ switch (o) {
38
+ case "number":
39
+ return Number.isNaN(e) ? "NaN" : Number.isFinite(e) ? e !== Math.floor(e) ? "float" : "number" : "Infinity";
40
+ case "object":
41
+ return e === null ? "null" : e.constructor.name;
42
+ default:
43
+ return o;
44
+ }
45
+ }
46
+ function b(e, o, t, n) {
47
+ const s = e[o];
48
+ if (s == null || !Number.isInteger(s)) {
49
+ const r = w(s);
50
+ return new RangeError(`Invalid ${n} \`${o}\` of type \`${r}\` supplied to \`${t}\`, expected \`integer\`.`);
51
+ }
52
+ return null;
53
+ }
54
+ function R(e, o, t, n) {
55
+ return e[o] === void 0 ? null : b(e, o, t, n);
56
+ }
57
+ function N() {
58
+ return null;
59
+ }
60
+ R.isRequired = b;
61
+ N.isRequired = N;
62
+ const Z = process.env.NODE_ENV === "production" ? N : R;
63
+ function H(e) {
64
+ return typeof e == "string";
65
+ }
66
+ function j(e, o, t) {
67
+ return e === void 0 || H(e) ? o : {
68
+ ...o,
69
+ ownerState: {
70
+ ...o.ownerState,
71
+ ...t
72
+ }
73
+ };
74
+ }
75
+ function A(e, o, t) {
76
+ return typeof e == "function" ? e(o, t) : e;
77
+ }
78
+ function D(e, o = []) {
79
+ if (e === void 0)
80
+ return {};
81
+ const t = {};
82
+ return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !o.includes(n)).forEach((n) => {
83
+ t[n] = e[n];
84
+ }), t;
85
+ }
86
+ function C(e) {
87
+ if (e === void 0)
88
+ return {};
89
+ const o = {};
90
+ return Object.keys(e).filter((t) => !(t.match(/^on[A-Z]/) && typeof e[t] == "function")).forEach((t) => {
91
+ o[t] = e[t];
92
+ }), o;
93
+ }
94
+ function M(e) {
95
+ const {
96
+ getSlotProps: o,
97
+ additionalProps: t,
98
+ externalSlotProps: n,
99
+ externalForwardedProps: s,
100
+ className: r
101
+ } = e;
102
+ if (!o) {
103
+ const y = v(t == null ? void 0 : t.className, r, s == null ? void 0 : s.className, n == null ? void 0 : n.className), l = {
104
+ ...t == null ? void 0 : t.style,
105
+ ...s == null ? void 0 : s.style,
106
+ ...n == null ? void 0 : n.style
107
+ }, d = {
108
+ ...t,
109
+ ...s,
110
+ ...n
111
+ };
112
+ return y.length > 0 && (d.className = y), Object.keys(l).length > 0 && (d.style = l), {
113
+ props: d,
114
+ internalRef: void 0
115
+ };
116
+ }
117
+ const f = D({
118
+ ...s,
119
+ ...n
120
+ }), a = C(n), m = C(s), u = o(f), c = v(u == null ? void 0 : u.className, t == null ? void 0 : t.className, r, s == null ? void 0 : s.className, n == null ? void 0 : n.className), h = {
121
+ ...u == null ? void 0 : u.style,
122
+ ...t == null ? void 0 : t.style,
123
+ ...s == null ? void 0 : s.style,
124
+ ...n == null ? void 0 : n.style
125
+ }, p = {
126
+ ...u,
127
+ ...t,
128
+ ...m,
129
+ ...a
130
+ };
131
+ return c.length > 0 && (p.className = c), Object.keys(h).length > 0 && (p.style = h), {
132
+ props: p,
133
+ internalRef: u.ref
134
+ };
135
+ }
136
+ function z(e, o) {
137
+ const {
138
+ className: t,
139
+ elementType: n,
140
+ ownerState: s,
141
+ externalForwardedProps: r,
142
+ internalForwardedProps: f,
143
+ shouldForwardComponentProp: a = !1,
144
+ ...m
145
+ } = o, {
146
+ component: u,
147
+ slots: c = {
148
+ [e]: void 0
149
+ },
150
+ slotProps: h = {
151
+ [e]: void 0
152
+ },
153
+ ...p
154
+ } = r, y = c[e] || n, l = A(h[e], s), {
155
+ props: {
156
+ component: d,
157
+ ...$
158
+ },
159
+ internalRef: O
160
+ } = M({
161
+ className: t,
162
+ ...m,
163
+ externalForwardedProps: e === "root" ? p : void 0,
164
+ externalSlotProps: l
165
+ }), V = I(O, l == null ? void 0 : l.ref, o.ref), g = e === "root" ? d || u : d, T = j(y, {
166
+ ...e === "root" && !u && !c[e] && f,
167
+ ...e !== "root" && !c[e] && f,
168
+ ...$,
169
+ ...g && !a && {
170
+ as: g
171
+ },
172
+ ...g && a && {
173
+ component: g
174
+ },
175
+ ref: V
176
+ }, s);
177
+ return [y, T];
178
+ }
179
+ export {
180
+ _ as a,
181
+ z as b,
182
+ j as c,
183
+ D as e,
184
+ Z as i,
185
+ M as m,
186
+ A as r,
187
+ W as u
188
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@amateescu/portal-ui-components",
3
3
  "main": "dist/main.js",
4
4
  "types": "dist/main.d.ts",
5
- "version": "0.0.30-beta8",
5
+ "version": "0.0.31",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist",
@@ -37,10 +37,10 @@
37
37
  "@chromatic-com/storybook": "^3.2.6",
38
38
  "@emotion/react": "^11.14.0",
39
39
  "@emotion/styled": "^11.14.0",
40
- "@eslint/js": "^9.25.1",
41
- "@mui/icons-material": "^7.0.2",
42
- "@mui/material": "^7.0.2",
43
- "@mui/x-data-grid": "^7.29.1",
40
+ "@eslint/js": "^9.26.0",
41
+ "@mui/icons-material": "^7.1.0",
42
+ "@mui/material": "^7.1.0",
43
+ "@mui/x-data-grid": "^7.29.2",
44
44
  "@storybook/addon-essentials": "^8.6.12",
45
45
  "@storybook/addon-interactions": "^8.6.12",
46
46
  "@storybook/addon-onboarding": "^8.6.12",
@@ -49,19 +49,19 @@
49
49
  "@storybook/react-vite": "^8.6.12",
50
50
  "@storybook/test": "^8.6.12",
51
51
  "@types/postcss-import": "^14.0.3",
52
- "@types/react": "^19.1.2",
53
- "@types/react-dom": "^19.1.2",
52
+ "@types/react": "^19.1.3",
53
+ "@types/react-dom": "^19.1.3",
54
54
  "@vitejs/plugin-react": "^4.4.1",
55
- "antd": "^5.24.8",
55
+ "antd": "^5.24.9",
56
56
  "date-fns": "^4.1.0",
57
- "eslint": "^9.25.1",
57
+ "eslint": "^9.26.0",
58
58
  "eslint-plugin-react": "^7.37.5",
59
59
  "eslint-plugin-react-hooks": "^5.2.0",
60
60
  "eslint-plugin-react-refresh": "^0.4.20",
61
61
  "eslint-plugin-storybook": "^0.12.0",
62
62
  "glob": "^11.0.2",
63
- "globals": "^16.0.0",
64
- "i18next": "^25.0.1",
63
+ "globals": "^16.1.0",
64
+ "i18next": "^25.1.1",
65
65
  "postcss": "^8.5.3",
66
66
  "postcss-import": "^16.1.0",
67
67
  "postcss-preset-env": "^10.1.6",
@@ -1,188 +0,0 @@
1
- import * as c from "react";
2
- import { c as E, P as v } from "./createSimplePaletteValueFilter-rq2_biPF.js";
3
- import "react/jsx-runtime";
4
- import { u as I } from "./ButtonBase-DWpUn0eT.js";
5
- function _({
6
- controlled: e,
7
- default: o,
8
- name: n,
9
- state: t = "value"
10
- }) {
11
- const {
12
- current: s
13
- } = c.useRef(e !== void 0), [u, f] = c.useState(o), l = s ? e : u;
14
- if (process.env.NODE_ENV !== "production") {
15
- c.useEffect(() => {
16
- s !== (e !== void 0) && console.error([`MUI: A component is changing the ${s ? "" : "un"}controlled ${t} state of ${n} to be ${s ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
17
- `));
18
- }, [t, n, e]);
19
- const {
20
- current: r
21
- } = c.useRef(o);
22
- c.useEffect(() => {
23
- !s && !Object.is(r, o) && console.error([`MUI: A component is changing the default ${t} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
24
- `));
25
- }, [JSON.stringify(o)]);
26
- }
27
- const m = c.useCallback((r) => {
28
- s || f(r);
29
- }, []);
30
- return [l, m];
31
- }
32
- function k(e) {
33
- const o = typeof e;
34
- switch (o) {
35
- case "number":
36
- return Number.isNaN(e) ? "NaN" : Number.isFinite(e) ? e !== Math.floor(e) ? "float" : "number" : "Infinity";
37
- case "object":
38
- return e === null ? "null" : e.constructor.name;
39
- default:
40
- return o;
41
- }
42
- }
43
- function b(e, o, n, t) {
44
- const s = e[o];
45
- if (s == null || !Number.isInteger(s)) {
46
- const u = k(s);
47
- return new RangeError(`Invalid ${t} \`${o}\` of type \`${u}\` supplied to \`${n}\`, expected \`integer\`.`);
48
- }
49
- return null;
50
- }
51
- function R(e, o, ...n) {
52
- return e[o] === void 0 ? null : b(e, o, ...n);
53
- }
54
- function N() {
55
- return null;
56
- }
57
- R.isRequired = b;
58
- N.isRequired = N;
59
- const W = process.env.NODE_ENV === "production" ? N : R;
60
- function w(e) {
61
- return typeof e == "string";
62
- }
63
- function H(e, o, n) {
64
- return e === void 0 || w(e) ? o : {
65
- ...o,
66
- ownerState: {
67
- ...o.ownerState,
68
- ...n
69
- }
70
- };
71
- }
72
- function j(e, o = []) {
73
- if (e === void 0)
74
- return {};
75
- const n = {};
76
- return Object.keys(e).filter((t) => t.match(/^on[A-Z]/) && typeof e[t] == "function" && !o.includes(t)).forEach((t) => {
77
- n[t] = e[t];
78
- }), n;
79
- }
80
- function C(e) {
81
- if (e === void 0)
82
- return {};
83
- const o = {};
84
- return Object.keys(e).filter((n) => !(n.match(/^on[A-Z]/) && typeof e[n] == "function")).forEach((n) => {
85
- o[n] = e[n];
86
- }), o;
87
- }
88
- function A(e) {
89
- const {
90
- getSlotProps: o,
91
- additionalProps: n,
92
- externalSlotProps: t,
93
- externalForwardedProps: s,
94
- className: u
95
- } = e;
96
- if (!o) {
97
- const h = E(n == null ? void 0 : n.className, u, s == null ? void 0 : s.className, t == null ? void 0 : t.className), i = {
98
- ...n == null ? void 0 : n.style,
99
- ...s == null ? void 0 : s.style,
100
- ...t == null ? void 0 : t.style
101
- }, d = {
102
- ...n,
103
- ...s,
104
- ...t
105
- };
106
- return h.length > 0 && (d.className = h), Object.keys(i).length > 0 && (d.style = i), {
107
- props: d,
108
- internalRef: void 0
109
- };
110
- }
111
- const f = j({
112
- ...s,
113
- ...t
114
- }), l = C(t), m = C(s), r = o(f), a = E(r == null ? void 0 : r.className, n == null ? void 0 : n.className, u, s == null ? void 0 : s.className, t == null ? void 0 : t.className), p = {
115
- ...r == null ? void 0 : r.style,
116
- ...n == null ? void 0 : n.style,
117
- ...s == null ? void 0 : s.style,
118
- ...t == null ? void 0 : t.style
119
- }, y = {
120
- ...r,
121
- ...n,
122
- ...m,
123
- ...l
124
- };
125
- return a.length > 0 && (y.className = a), Object.keys(p).length > 0 && (y.style = p), {
126
- props: y,
127
- internalRef: r.ref
128
- };
129
- }
130
- function D(e, o, n) {
131
- return typeof e == "function" ? e(o, n) : e;
132
- }
133
- const M = /* @__PURE__ */ c.createContext();
134
- process.env.NODE_ENV !== "production" && (v.node, v.bool);
135
- const Z = () => c.useContext(M) ?? !1;
136
- function z(e, o) {
137
- const {
138
- className: n,
139
- elementType: t,
140
- ownerState: s,
141
- externalForwardedProps: u,
142
- internalForwardedProps: f,
143
- shouldForwardComponentProp: l = !1,
144
- ...m
145
- } = o, {
146
- component: r,
147
- slots: a = {
148
- [e]: void 0
149
- },
150
- slotProps: p = {
151
- [e]: void 0
152
- },
153
- ...y
154
- } = u, h = a[e] || t, i = D(p[e], s), {
155
- props: {
156
- component: d,
157
- ...$
158
- },
159
- internalRef: O
160
- } = A({
161
- className: n,
162
- ...m,
163
- externalForwardedProps: e === "root" ? y : void 0,
164
- externalSlotProps: i
165
- }), V = I(O, i == null ? void 0 : i.ref, o.ref), g = e === "root" ? d || r : d, T = H(h, {
166
- ...e === "root" && !r && !a[e] && f,
167
- ...e !== "root" && !a[e] && f,
168
- ...$,
169
- ...g && !l && {
170
- as: g
171
- },
172
- ...g && l && {
173
- component: g
174
- },
175
- ref: V
176
- }, s);
177
- return [h, T];
178
- }
179
- export {
180
- Z as a,
181
- z as b,
182
- H as c,
183
- j as e,
184
- W as i,
185
- A as m,
186
- D as r,
187
- _ as u
188
- };