@amateescu/portal-ui-components 0.0.28 → 0.0.30-beta

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 (45) hide show
  1. package/dist/Box-ZFRI9JCw.js +102 -0
  2. package/dist/Button-CNfTnafe.js +676 -0
  3. package/dist/ButtonBase-DWpUn0eT.js +965 -0
  4. package/dist/CircularProgress-D6RyizwS.js +247 -0
  5. package/dist/{EllipsisOutlined-DZsCEqiL.js → EllipsisOutlined-CzFuvGH_.js} +3 -3
  6. package/dist/{PurePanel-iUNZWTe_.js → PurePanel-CxlAi3G7.js} +3 -3
  7. package/dist/{Skeleton-CfEiGUkR.js → Skeleton-dypyF9G2.js} +2 -2
  8. package/dist/{UserInfoDropdown-CoZutJAR.js → UserInfoDropdown-DPyds49a.js} +763 -769
  9. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  10. package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
  11. package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
  12. package/dist/components/CustomButton/CustomButton.js +1 -1
  13. package/dist/components/CustomButton/CustomButton.stories.d.ts +1 -0
  14. package/dist/components/CustomButton/CustomButton.stories.js +21 -7
  15. package/dist/components/CustomFooter/CustomFooter.js +1 -1
  16. package/dist/components/CustomPagination/CustomPagination.js +484 -372
  17. package/dist/components/ErrorModal/ErrorModal.js +1 -1
  18. package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
  19. package/dist/components/InfoModal/InfoModal.js +1 -1
  20. package/dist/components/InfoModal/InfoModal.stories.js +1 -1
  21. package/dist/components/KpiCard/KpiCard.js +355 -351
  22. package/dist/components/LoadingAnimation/LoadingAnimation.js +6 -215
  23. package/dist/components/Login/Login.js +4638 -3844
  24. package/dist/components/Login/Login.stories.js +15693 -14785
  25. package/dist/components/SideMenu/SideMenu.js +1 -1
  26. package/dist/components/TotalDataGrid/TotalDataGrid.js +6 -6
  27. package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
  28. package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
  29. package/dist/components/index.js +1 -1
  30. package/dist/{context-Crxhk7DD.js → context-Bk4VnwMB.js} +7 -7
  31. package/dist/createSimplePaletteValueFilter-rq2_biPF.js +3443 -0
  32. package/dist/createSvgIcon-jB7EUYpq.js +248 -0
  33. package/dist/{index-BxiDYyNJ.js → index-DLbr86ak.js} +511 -513
  34. package/dist/{index-DpDv68WZ.js → index-xh_JY2OQ.js} +1 -1
  35. package/dist/main.js +1 -1
  36. package/dist/objectWithoutPropertiesLoose-BTau6TOn.js +33 -0
  37. package/dist/useSlot-CT4096EK.js +188 -0
  38. package/package.json +31 -31
  39. package/dist/Box-C1OwXVV-.js +0 -68
  40. package/dist/Button-CIvE-fcO.js +0 -355
  41. package/dist/ButtonBase-BeQnmGXr.js +0 -966
  42. package/dist/assertThisInitialized-BUtkG-md.js +0 -13
  43. package/dist/createSvgIcon-Db107M0j.js +0 -250
  44. package/dist/generateUtilityClasses-DY-qyzNG.js +0 -3427
  45. package/dist/objectWithoutPropertiesLoose-DYizGgyG.js +0 -46
@@ -0,0 +1,965 @@
1
+ var Be = Object.defineProperty;
2
+ var Le = (t, e, n) => e in t ? Be(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var X = (t, e, n) => Le(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import * as c from "react";
5
+ import K, { isValidElement as G, cloneElement as Z, Children as Oe } from "react";
6
+ import { f as ke, P as o, c as C, a as fe, u as de, s as ne, g as je, d as $e } from "./createSimplePaletteValueFilter-rq2_biPF.js";
7
+ import { jsx as F, jsxs as Fe } from "react/jsx-runtime";
8
+ import { a as Ue, _ as ze, b as _e, c as Ae } from "./objectWithoutPropertiesLoose-BTau6TOn.js";
9
+ import { keyframes as oe } from "@emotion/react";
10
+ function Ye(t) {
11
+ const {
12
+ prototype: e = {}
13
+ } = t;
14
+ return !!e.isReactComponent;
15
+ }
16
+ function Xe(t, e, n, u, i) {
17
+ const r = t[e], s = i || e;
18
+ if (r == null || // When server-side rendering React doesn't warn either.
19
+ // This is not an accurate check for SSR.
20
+ // This is only in place for emotion compat.
21
+ // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
22
+ typeof window > "u")
23
+ return null;
24
+ let l;
25
+ return typeof r == "function" && !Ye(r) && (l = "Did you accidentally provide a plain function component instead?"), l !== void 0 ? new Error(`Invalid ${u} \`${s}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`) : null;
26
+ }
27
+ const Ke = ke(o.elementType, Xe), qe = o.oneOfType([o.func, o.object]), He = typeof window < "u" ? c.useLayoutEffect : c.useEffect;
28
+ function J(t) {
29
+ const e = c.useRef(t);
30
+ return He(() => {
31
+ e.current = t;
32
+ }), c.useRef((...n) => (
33
+ // @ts-expect-error hide `this`
34
+ (0, e.current)(...n)
35
+ )).current;
36
+ }
37
+ function ae(...t) {
38
+ const e = c.useRef(void 0), n = c.useCallback((u) => {
39
+ const i = t.map((r) => {
40
+ if (r == null)
41
+ return null;
42
+ if (typeof r == "function") {
43
+ const s = r, l = s(u);
44
+ return typeof l == "function" ? l : () => {
45
+ s(null);
46
+ };
47
+ }
48
+ return r.current = u, () => {
49
+ r.current = null;
50
+ };
51
+ });
52
+ return () => {
53
+ i.forEach((r) => r == null ? void 0 : r());
54
+ };
55
+ }, t);
56
+ return c.useMemo(() => t.every((u) => u == null) ? null : (u) => {
57
+ e.current && (e.current(), e.current = void 0), u != null && (e.current = n(u));
58
+ }, t);
59
+ }
60
+ const le = {};
61
+ function he(t, e) {
62
+ const n = c.useRef(le);
63
+ return n.current === le && (n.current = t(e)), n;
64
+ }
65
+ const We = [];
66
+ function Ge(t) {
67
+ c.useEffect(t, We);
68
+ }
69
+ class re {
70
+ constructor() {
71
+ X(this, "currentId", null);
72
+ X(this, "clear", () => {
73
+ this.currentId !== null && (clearTimeout(this.currentId), this.currentId = null);
74
+ });
75
+ X(this, "disposeEffect", () => this.clear);
76
+ }
77
+ static create() {
78
+ return new re();
79
+ }
80
+ /**
81
+ * Executes `fn` after `delay`, clearing any previously scheduled call.
82
+ */
83
+ start(e, n) {
84
+ this.clear(), this.currentId = setTimeout(() => {
85
+ this.currentId = null, n();
86
+ }, e);
87
+ }
88
+ }
89
+ function Ze() {
90
+ const t = he(re.create).current;
91
+ return Ge(t.disposeEffect), t;
92
+ }
93
+ function ce(t) {
94
+ try {
95
+ return t.matches(":focus-visible");
96
+ } catch {
97
+ process.env.NODE_ENV !== "production" && !/jsdom/.test(window.navigator.userAgent) && console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.", "Some components rely on this feature to work properly."].join(`
98
+ `));
99
+ }
100
+ return !1;
101
+ }
102
+ class Q {
103
+ constructor() {
104
+ X(this, "mountEffect", () => {
105
+ this.shouldMount && !this.didMount && this.ref.current !== null && (this.didMount = !0, this.mounted.resolve());
106
+ });
107
+ this.ref = {
108
+ current: null
109
+ }, this.mounted = null, this.didMount = !1, this.shouldMount = !1, this.setShouldMount = null;
110
+ }
111
+ /** React ref to the ripple instance */
112
+ /** If the ripple component should be mounted */
113
+ /** Promise that resolves when the ripple component is mounted */
114
+ /** If the ripple component has been mounted */
115
+ /** React state hook setter */
116
+ static create() {
117
+ return new Q();
118
+ }
119
+ static use() {
120
+ const e = he(Q.create).current, [n, u] = c.useState(!1);
121
+ return e.shouldMount = n, e.setShouldMount = u, c.useEffect(e.mountEffect, [n]), e;
122
+ }
123
+ mount() {
124
+ return this.mounted || (this.mounted = Qe(), this.shouldMount = !0, this.setShouldMount(this.shouldMount)), this.mounted;
125
+ }
126
+ /* Ripple API */
127
+ start(...e) {
128
+ this.mount().then(() => {
129
+ var n;
130
+ return (n = this.ref.current) == null ? void 0 : n.start(...e);
131
+ });
132
+ }
133
+ stop(...e) {
134
+ this.mount().then(() => {
135
+ var n;
136
+ return (n = this.ref.current) == null ? void 0 : n.stop(...e);
137
+ });
138
+ }
139
+ pulsate(...e) {
140
+ this.mount().then(() => {
141
+ var n;
142
+ return (n = this.ref.current) == null ? void 0 : n.pulsate(...e);
143
+ });
144
+ }
145
+ }
146
+ function Je() {
147
+ return Q.use();
148
+ }
149
+ function Qe() {
150
+ let t, e;
151
+ const n = new Promise((u, i) => {
152
+ t = u, e = i;
153
+ });
154
+ return n.resolve = t, n.reject = e, n;
155
+ }
156
+ function et(t, e) {
157
+ t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Ue(t, e);
158
+ }
159
+ const pe = K.createContext(null);
160
+ function ie(t, e) {
161
+ var n = function(r) {
162
+ return e && G(r) ? e(r) : r;
163
+ }, u = /* @__PURE__ */ Object.create(null);
164
+ return t && Oe.map(t, function(i) {
165
+ return i;
166
+ }).forEach(function(i) {
167
+ u[i.key] = n(i);
168
+ }), u;
169
+ }
170
+ function tt(t, e) {
171
+ t = t || {}, e = e || {};
172
+ function n(h) {
173
+ return h in e ? e[h] : t[h];
174
+ }
175
+ var u = /* @__PURE__ */ Object.create(null), i = [];
176
+ for (var r in t)
177
+ r in e ? i.length && (u[r] = i, i = []) : i.push(r);
178
+ var s, l = {};
179
+ for (var p in e) {
180
+ if (u[p])
181
+ for (s = 0; s < u[p].length; s++) {
182
+ var d = u[p][s];
183
+ l[u[p][s]] = n(d);
184
+ }
185
+ l[p] = n(p);
186
+ }
187
+ for (s = 0; s < i.length; s++)
188
+ l[i[s]] = n(i[s]);
189
+ return l;
190
+ }
191
+ function O(t, e, n) {
192
+ return n[e] != null ? n[e] : t.props[e];
193
+ }
194
+ function nt(t, e) {
195
+ return ie(t.children, function(n) {
196
+ return Z(n, {
197
+ onExited: e.bind(null, n),
198
+ in: !0,
199
+ appear: O(n, "appear", t),
200
+ enter: O(n, "enter", t),
201
+ exit: O(n, "exit", t)
202
+ });
203
+ });
204
+ }
205
+ function ot(t, e, n) {
206
+ var u = ie(t.children), i = tt(e, u);
207
+ return Object.keys(i).forEach(function(r) {
208
+ var s = i[r];
209
+ if (G(s)) {
210
+ var l = r in e, p = r in u, d = e[r], h = G(d) && !d.props.in;
211
+ p && (!l || h) ? i[r] = Z(s, {
212
+ onExited: n.bind(null, s),
213
+ in: !0,
214
+ exit: O(s, "exit", t),
215
+ enter: O(s, "enter", t)
216
+ }) : !p && l && !h ? i[r] = Z(s, {
217
+ in: !1
218
+ }) : p && l && G(d) && (i[r] = Z(s, {
219
+ onExited: n.bind(null, s),
220
+ in: d.props.in,
221
+ exit: O(s, "exit", t),
222
+ enter: O(s, "enter", t)
223
+ }));
224
+ }
225
+ }), i;
226
+ }
227
+ var rt = Object.values || function(t) {
228
+ return Object.keys(t).map(function(e) {
229
+ return t[e];
230
+ });
231
+ }, it = {
232
+ component: "div",
233
+ childFactory: function(e) {
234
+ return e;
235
+ }
236
+ }, se = /* @__PURE__ */ function(t) {
237
+ et(e, t);
238
+ function e(u, i) {
239
+ var r;
240
+ r = t.call(this, u, i) || this;
241
+ var s = r.handleExited.bind(Ae(r));
242
+ return r.state = {
243
+ contextValue: {
244
+ isMounting: !0
245
+ },
246
+ handleExited: s,
247
+ firstRender: !0
248
+ }, r;
249
+ }
250
+ var n = e.prototype;
251
+ return n.componentDidMount = function() {
252
+ this.mounted = !0, this.setState({
253
+ contextValue: {
254
+ isMounting: !1
255
+ }
256
+ });
257
+ }, n.componentWillUnmount = function() {
258
+ this.mounted = !1;
259
+ }, e.getDerivedStateFromProps = function(i, r) {
260
+ var s = r.children, l = r.handleExited, p = r.firstRender;
261
+ return {
262
+ children: p ? nt(i, l) : ot(i, s, l),
263
+ firstRender: !1
264
+ };
265
+ }, n.handleExited = function(i, r) {
266
+ var s = ie(this.props.children);
267
+ i.key in s || (i.props.onExited && i.props.onExited(r), this.mounted && this.setState(function(l) {
268
+ var p = ze({}, l.children);
269
+ return delete p[i.key], {
270
+ children: p
271
+ };
272
+ }));
273
+ }, n.render = function() {
274
+ var i = this.props, r = i.component, s = i.childFactory, l = _e(i, ["component", "childFactory"]), p = this.state.contextValue, d = rt(this.state.children).map(s);
275
+ return delete l.appear, delete l.enter, delete l.exit, r === null ? /* @__PURE__ */ K.createElement(pe.Provider, {
276
+ value: p
277
+ }, d) : /* @__PURE__ */ K.createElement(pe.Provider, {
278
+ value: p
279
+ }, /* @__PURE__ */ K.createElement(r, l, d));
280
+ }, e;
281
+ }(K.Component);
282
+ se.propTypes = process.env.NODE_ENV !== "production" ? {
283
+ /**
284
+ * `<TransitionGroup>` renders a `<div>` by default. You can change this
285
+ * behavior by providing a `component` prop.
286
+ * If you use React v16+ and would like to avoid a wrapping `<div>` element
287
+ * you can pass in `component={null}`. This is useful if the wrapping div
288
+ * borks your css styles.
289
+ */
290
+ component: o.any,
291
+ /**
292
+ * A set of `<Transition>` components, that are toggled `in` and out as they
293
+ * leave. the `<TransitionGroup>` will inject specific transition props, so
294
+ * remember to spread them through if you are wrapping the `<Transition>` as
295
+ * with our `<Fade>` example.
296
+ *
297
+ * While this component is meant for multiple `Transition` or `CSSTransition`
298
+ * children, sometimes you may want to have a single transition child with
299
+ * content that you want to be transitioned out and in when you change it
300
+ * (e.g. routes, images etc.) In that case you can change the `key` prop of
301
+ * the transition child as you change its content, this will cause
302
+ * `TransitionGroup` to transition the child out and back in.
303
+ */
304
+ children: o.node,
305
+ /**
306
+ * A convenience prop that enables or disables appear animations
307
+ * for all children. Note that specifying this will override any defaults set
308
+ * on individual children Transitions.
309
+ */
310
+ appear: o.bool,
311
+ /**
312
+ * A convenience prop that enables or disables enter animations
313
+ * for all children. Note that specifying this will override any defaults set
314
+ * on individual children Transitions.
315
+ */
316
+ enter: o.bool,
317
+ /**
318
+ * A convenience prop that enables or disables exit animations
319
+ * for all children. Note that specifying this will override any defaults set
320
+ * on individual children Transitions.
321
+ */
322
+ exit: o.bool,
323
+ /**
324
+ * You may need to apply reactive updates to a child as it is exiting.
325
+ * This is generally done by using `cloneElement` however in the case of an exiting
326
+ * child the element has already been removed and not accessible to the consumer.
327
+ *
328
+ * If you do need to update a child as it leaves you can provide a `childFactory`
329
+ * to wrap every child, even the ones that are leaving.
330
+ *
331
+ * @type Function(child: ReactElement) -> ReactElement
332
+ */
333
+ childFactory: o.func
334
+ } : {};
335
+ se.defaultProps = it;
336
+ function me(t) {
337
+ const {
338
+ className: e,
339
+ classes: n,
340
+ pulsate: u = !1,
341
+ rippleX: i,
342
+ rippleY: r,
343
+ rippleSize: s,
344
+ in: l,
345
+ onExited: p,
346
+ timeout: d
347
+ } = t, [h, m] = c.useState(!1), R = C(e, n.ripple, n.rippleVisible, u && n.ripplePulsate), N = {
348
+ width: s,
349
+ height: s,
350
+ top: -(s / 2) + r,
351
+ left: -(s / 2) + i
352
+ }, g = C(n.child, h && n.childLeaving, u && n.childPulsate);
353
+ return !l && !h && m(!0), c.useEffect(() => {
354
+ if (!l && p != null) {
355
+ const S = setTimeout(p, d);
356
+ return () => {
357
+ clearTimeout(S);
358
+ };
359
+ }
360
+ }, [p, l, d]), /* @__PURE__ */ F("span", {
361
+ className: R,
362
+ style: N,
363
+ children: /* @__PURE__ */ F("span", {
364
+ className: g
365
+ })
366
+ });
367
+ }
368
+ process.env.NODE_ENV !== "production" && (me.propTypes = {
369
+ /**
370
+ * Override or extend the styles applied to the component.
371
+ */
372
+ classes: o.object.isRequired,
373
+ className: o.string,
374
+ /**
375
+ * @ignore - injected from TransitionGroup
376
+ */
377
+ in: o.bool,
378
+ /**
379
+ * @ignore - injected from TransitionGroup
380
+ */
381
+ onExited: o.func,
382
+ /**
383
+ * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
384
+ */
385
+ pulsate: o.bool,
386
+ /**
387
+ * Diameter of the ripple.
388
+ */
389
+ rippleSize: o.number,
390
+ /**
391
+ * Horizontal position of the ripple center.
392
+ */
393
+ rippleX: o.number,
394
+ /**
395
+ * Vertical position of the ripple center.
396
+ */
397
+ rippleY: o.number,
398
+ /**
399
+ * exit delay
400
+ */
401
+ timeout: o.number.isRequired
402
+ });
403
+ const y = fe("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]), te = 550, st = 80, ut = oe`
404
+ 0% {
405
+ transform: scale(0);
406
+ opacity: 0.1;
407
+ }
408
+
409
+ 100% {
410
+ transform: scale(1);
411
+ opacity: 0.3;
412
+ }
413
+ `, at = oe`
414
+ 0% {
415
+ opacity: 1;
416
+ }
417
+
418
+ 100% {
419
+ opacity: 0;
420
+ }
421
+ `, lt = oe`
422
+ 0% {
423
+ transform: scale(1);
424
+ }
425
+
426
+ 50% {
427
+ transform: scale(0.92);
428
+ }
429
+
430
+ 100% {
431
+ transform: scale(1);
432
+ }
433
+ `, ct = ne("span", {
434
+ name: "MuiTouchRipple",
435
+ slot: "Root"
436
+ })({
437
+ overflow: "hidden",
438
+ pointerEvents: "none",
439
+ position: "absolute",
440
+ zIndex: 0,
441
+ top: 0,
442
+ right: 0,
443
+ bottom: 0,
444
+ left: 0,
445
+ borderRadius: "inherit"
446
+ }), pt = ne(me, {
447
+ name: "MuiTouchRipple",
448
+ slot: "Ripple"
449
+ })`
450
+ opacity: 0;
451
+ position: absolute;
452
+
453
+ &.${y.rippleVisible} {
454
+ opacity: 0.3;
455
+ transform: scale(1);
456
+ animation-name: ${ut};
457
+ animation-duration: ${te}ms;
458
+ animation-timing-function: ${({
459
+ theme: t
460
+ }) => t.transitions.easing.easeInOut};
461
+ }
462
+
463
+ &.${y.ripplePulsate} {
464
+ animation-duration: ${({
465
+ theme: t
466
+ }) => t.transitions.duration.shorter}ms;
467
+ }
468
+
469
+ & .${y.child} {
470
+ opacity: 1;
471
+ display: block;
472
+ width: 100%;
473
+ height: 100%;
474
+ border-radius: 50%;
475
+ background-color: currentColor;
476
+ }
477
+
478
+ & .${y.childLeaving} {
479
+ opacity: 0;
480
+ animation-name: ${at};
481
+ animation-duration: ${te}ms;
482
+ animation-timing-function: ${({
483
+ theme: t
484
+ }) => t.transitions.easing.easeInOut};
485
+ }
486
+
487
+ & .${y.childPulsate} {
488
+ position: absolute;
489
+ /* @noflip */
490
+ left: 0px;
491
+ top: 0;
492
+ animation-name: ${lt};
493
+ animation-duration: 2500ms;
494
+ animation-timing-function: ${({
495
+ theme: t
496
+ }) => t.transitions.easing.easeInOut};
497
+ animation-iteration-count: infinite;
498
+ animation-delay: 200ms;
499
+ }
500
+ `, be = /* @__PURE__ */ c.forwardRef(function(e, n) {
501
+ const u = de({
502
+ props: e,
503
+ name: "MuiTouchRipple"
504
+ }), {
505
+ center: i = !1,
506
+ classes: r = {},
507
+ className: s,
508
+ ...l
509
+ } = u, [p, d] = c.useState([]), h = c.useRef(0), m = c.useRef(null);
510
+ c.useEffect(() => {
511
+ m.current && (m.current(), m.current = null);
512
+ }, [p]);
513
+ const R = c.useRef(!1), N = Ze(), g = c.useRef(null), S = c.useRef(null), x = c.useCallback((f) => {
514
+ const {
515
+ pulsate: T,
516
+ rippleX: M,
517
+ rippleY: $,
518
+ rippleSize: I,
519
+ cb: U
520
+ } = f;
521
+ d((E) => [...E, /* @__PURE__ */ F(pt, {
522
+ classes: {
523
+ ripple: C(r.ripple, y.ripple),
524
+ rippleVisible: C(r.rippleVisible, y.rippleVisible),
525
+ ripplePulsate: C(r.ripplePulsate, y.ripplePulsate),
526
+ child: C(r.child, y.child),
527
+ childLeaving: C(r.childLeaving, y.childLeaving),
528
+ childPulsate: C(r.childPulsate, y.childPulsate)
529
+ },
530
+ timeout: te,
531
+ pulsate: T,
532
+ rippleX: M,
533
+ rippleY: $,
534
+ rippleSize: I
535
+ }, h.current)]), h.current += 1, m.current = U;
536
+ }, [r]), k = c.useCallback((f = {}, T = {}, M = () => {
537
+ }) => {
538
+ const {
539
+ pulsate: $ = !1,
540
+ center: I = i || T.pulsate,
541
+ fakeElement: U = !1
542
+ // For test purposes
543
+ } = T;
544
+ if ((f == null ? void 0 : f.type) === "mousedown" && R.current) {
545
+ R.current = !1;
546
+ return;
547
+ }
548
+ (f == null ? void 0 : f.type) === "touchstart" && (R.current = !0);
549
+ const E = U ? null : S.current, D = E ? E.getBoundingClientRect() : {
550
+ width: 0,
551
+ height: 0,
552
+ left: 0,
553
+ top: 0
554
+ };
555
+ let v, P, V;
556
+ if (I || f === void 0 || f.clientX === 0 && f.clientY === 0 || !f.clientX && !f.touches)
557
+ v = Math.round(D.width / 2), P = Math.round(D.height / 2);
558
+ else {
559
+ const {
560
+ clientX: z,
561
+ clientY: B
562
+ } = f.touches && f.touches.length > 0 ? f.touches[0] : f;
563
+ v = Math.round(z - D.left), P = Math.round(B - D.top);
564
+ }
565
+ if (I)
566
+ V = Math.sqrt((2 * D.width ** 2 + D.height ** 2) / 3), V % 2 === 0 && (V += 1);
567
+ else {
568
+ const z = Math.max(Math.abs((E ? E.clientWidth : 0) - v), v) * 2 + 2, B = Math.max(Math.abs((E ? E.clientHeight : 0) - P), P) * 2 + 2;
569
+ V = Math.sqrt(z ** 2 + B ** 2);
570
+ }
571
+ f != null && f.touches ? g.current === null && (g.current = () => {
572
+ x({
573
+ pulsate: $,
574
+ rippleX: v,
575
+ rippleY: P,
576
+ rippleSize: V,
577
+ cb: M
578
+ });
579
+ }, N.start(st, () => {
580
+ g.current && (g.current(), g.current = null);
581
+ })) : x({
582
+ pulsate: $,
583
+ rippleX: v,
584
+ rippleY: P,
585
+ rippleSize: V,
586
+ cb: M
587
+ });
588
+ }, [i, x, N]), q = c.useCallback(() => {
589
+ k({}, {
590
+ pulsate: !0
591
+ });
592
+ }, [k]), j = c.useCallback((f, T) => {
593
+ if (N.clear(), (f == null ? void 0 : f.type) === "touchend" && g.current) {
594
+ g.current(), g.current = null, N.start(0, () => {
595
+ j(f, T);
596
+ });
597
+ return;
598
+ }
599
+ g.current = null, d((M) => M.length > 0 ? M.slice(1) : M), m.current = T;
600
+ }, [N]);
601
+ return c.useImperativeHandle(n, () => ({
602
+ pulsate: q,
603
+ start: k,
604
+ stop: j
605
+ }), [q, k, j]), /* @__PURE__ */ F(ct, {
606
+ className: C(y.root, r.root, s),
607
+ ref: S,
608
+ ...l,
609
+ children: /* @__PURE__ */ F(se, {
610
+ component: null,
611
+ exit: !0,
612
+ children: p
613
+ })
614
+ });
615
+ });
616
+ process.env.NODE_ENV !== "production" && (be.propTypes = {
617
+ /**
618
+ * If `true`, the ripple starts at the center of the component
619
+ * rather than at the point of interaction.
620
+ */
621
+ center: o.bool,
622
+ /**
623
+ * Override or extend the styles applied to the component.
624
+ */
625
+ classes: o.object,
626
+ /**
627
+ * @ignore
628
+ */
629
+ className: o.string
630
+ });
631
+ function ft(t) {
632
+ return je("MuiButtonBase", t);
633
+ }
634
+ const dt = fe("MuiButtonBase", ["root", "disabled", "focusVisible"]), ht = (t) => {
635
+ const {
636
+ disabled: e,
637
+ focusVisible: n,
638
+ focusVisibleClassName: u,
639
+ classes: i
640
+ } = t, s = $e({
641
+ root: ["root", e && "disabled", n && "focusVisible"]
642
+ }, ft, i);
643
+ return n && u && (s.root += ` ${u}`), s;
644
+ }, mt = ne("button", {
645
+ name: "MuiButtonBase",
646
+ slot: "Root",
647
+ overridesResolver: (t, e) => e.root
648
+ })({
649
+ display: "inline-flex",
650
+ alignItems: "center",
651
+ justifyContent: "center",
652
+ position: "relative",
653
+ boxSizing: "border-box",
654
+ WebkitTapHighlightColor: "transparent",
655
+ backgroundColor: "transparent",
656
+ // Reset default value
657
+ // We disable the focus ring for mouse, touch and keyboard users.
658
+ outline: 0,
659
+ border: 0,
660
+ margin: 0,
661
+ // Remove the margin in Safari
662
+ borderRadius: 0,
663
+ padding: 0,
664
+ // Remove the padding in Firefox
665
+ cursor: "pointer",
666
+ userSelect: "none",
667
+ verticalAlign: "middle",
668
+ MozAppearance: "none",
669
+ // Reset
670
+ WebkitAppearance: "none",
671
+ // Reset
672
+ textDecoration: "none",
673
+ // So we take precedent over the style of a native <a /> element.
674
+ color: "inherit",
675
+ "&::-moz-focus-inner": {
676
+ borderStyle: "none"
677
+ // Remove Firefox dotted outline.
678
+ },
679
+ [`&.${dt.disabled}`]: {
680
+ pointerEvents: "none",
681
+ // Disable link interactions
682
+ cursor: "default"
683
+ },
684
+ "@media print": {
685
+ colorAdjust: "exact"
686
+ }
687
+ }), bt = /* @__PURE__ */ c.forwardRef(function(e, n) {
688
+ const u = de({
689
+ props: e,
690
+ name: "MuiButtonBase"
691
+ }), {
692
+ action: i,
693
+ centerRipple: r = !1,
694
+ children: s,
695
+ className: l,
696
+ component: p = "button",
697
+ disabled: d = !1,
698
+ disableRipple: h = !1,
699
+ disableTouchRipple: m = !1,
700
+ focusRipple: R = !1,
701
+ focusVisibleClassName: N,
702
+ LinkComponent: g = "a",
703
+ onBlur: S,
704
+ onClick: x,
705
+ onContextMenu: k,
706
+ onDragLeave: q,
707
+ onFocus: j,
708
+ onFocusVisible: f,
709
+ onKeyDown: T,
710
+ onKeyUp: M,
711
+ onMouseDown: $,
712
+ onMouseLeave: I,
713
+ onMouseUp: U,
714
+ onTouchEnd: E,
715
+ onTouchMove: D,
716
+ onTouchStart: v,
717
+ tabIndex: P = 0,
718
+ TouchRippleProps: V,
719
+ touchRippleRef: z,
720
+ type: B,
721
+ ..._
722
+ } = u, A = c.useRef(null), b = Je(), ge = ae(b.ref, z), [L, H] = c.useState(!1);
723
+ d && L && H(!1), c.useImperativeHandle(i, () => ({
724
+ focusVisible: () => {
725
+ H(!0), A.current.focus();
726
+ }
727
+ }), []);
728
+ const ye = b.shouldMount && !h && !d;
729
+ c.useEffect(() => {
730
+ L && R && !h && b.pulsate();
731
+ }, [h, R, L, b]);
732
+ const Re = w(b, "start", $, m), Me = w(b, "stop", k, m), Te = w(b, "stop", q, m), Ee = w(b, "stop", U, m), Ce = w(b, "stop", (a) => {
733
+ L && a.preventDefault(), I && I(a);
734
+ }, m), xe = w(b, "start", v, m), Pe = w(b, "stop", E, m), we = w(b, "stop", D, m), Ne = w(b, "stop", (a) => {
735
+ ce(a.target) || H(!1), S && S(a);
736
+ }, !1), De = J((a) => {
737
+ A.current || (A.current = a.currentTarget), ce(a.target) && (H(!0), f && f(a)), j && j(a);
738
+ }), ee = () => {
739
+ const a = A.current;
740
+ return p && p !== "button" && !(a.tagName === "A" && a.href);
741
+ }, ve = J((a) => {
742
+ R && !a.repeat && L && a.key === " " && b.stop(a, () => {
743
+ b.start(a);
744
+ }), a.target === a.currentTarget && ee() && a.key === " " && a.preventDefault(), T && T(a), a.target === a.currentTarget && ee() && a.key === "Enter" && !d && (a.preventDefault(), x && x(a));
745
+ }), Ve = J((a) => {
746
+ R && a.key === " " && L && !a.defaultPrevented && b.stop(a, () => {
747
+ b.pulsate(a);
748
+ }), M && M(a), x && a.target === a.currentTarget && ee() && a.key === " " && !a.defaultPrevented && x(a);
749
+ });
750
+ let W = p;
751
+ W === "button" && (_.href || _.to) && (W = g);
752
+ const Y = {};
753
+ W === "button" ? (Y.type = B === void 0 ? "button" : B, Y.disabled = d) : (!_.href && !_.to && (Y.role = "button"), d && (Y["aria-disabled"] = d));
754
+ const Se = ae(n, A), ue = {
755
+ ...u,
756
+ centerRipple: r,
757
+ component: p,
758
+ disabled: d,
759
+ disableRipple: h,
760
+ disableTouchRipple: m,
761
+ focusRipple: R,
762
+ tabIndex: P,
763
+ focusVisible: L
764
+ }, Ie = ht(ue);
765
+ return /* @__PURE__ */ Fe(mt, {
766
+ as: W,
767
+ className: C(Ie.root, l),
768
+ ownerState: ue,
769
+ onBlur: Ne,
770
+ onClick: x,
771
+ onContextMenu: Me,
772
+ onFocus: De,
773
+ onKeyDown: ve,
774
+ onKeyUp: Ve,
775
+ onMouseDown: Re,
776
+ onMouseLeave: Ce,
777
+ onMouseUp: Ee,
778
+ onDragLeave: Te,
779
+ onTouchEnd: Pe,
780
+ onTouchMove: we,
781
+ onTouchStart: xe,
782
+ ref: Se,
783
+ tabIndex: d ? -1 : P,
784
+ type: B,
785
+ ...Y,
786
+ ..._,
787
+ children: [s, ye ? /* @__PURE__ */ F(be, {
788
+ ref: ge,
789
+ center: r,
790
+ ...V
791
+ }) : null]
792
+ });
793
+ });
794
+ function w(t, e, n, u = !1) {
795
+ return J((i) => (n && n(i), u || t[e](i), !0));
796
+ }
797
+ process.env.NODE_ENV !== "production" && (bt.propTypes = {
798
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
799
+ // │ These PropTypes are generated from the TypeScript type definitions. │
800
+ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
801
+ // └─────────────────────────────────────────────────────────────────────┘
802
+ /**
803
+ * A ref for imperative actions.
804
+ * It currently only supports `focusVisible()` action.
805
+ */
806
+ action: qe,
807
+ /**
808
+ * If `true`, the ripples are centered.
809
+ * They won't start at the cursor interaction position.
810
+ * @default false
811
+ */
812
+ centerRipple: o.bool,
813
+ /**
814
+ * The content of the component.
815
+ */
816
+ children: o.node,
817
+ /**
818
+ * Override or extend the styles applied to the component.
819
+ */
820
+ classes: o.object,
821
+ /**
822
+ * @ignore
823
+ */
824
+ className: o.string,
825
+ /**
826
+ * The component used for the root node.
827
+ * Either a string to use a HTML element or a component.
828
+ */
829
+ component: Ke,
830
+ /**
831
+ * If `true`, the component is disabled.
832
+ * @default false
833
+ */
834
+ disabled: o.bool,
835
+ /**
836
+ * If `true`, the ripple effect is disabled.
837
+ *
838
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
839
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
840
+ * @default false
841
+ */
842
+ disableRipple: o.bool,
843
+ /**
844
+ * If `true`, the touch ripple effect is disabled.
845
+ * @default false
846
+ */
847
+ disableTouchRipple: o.bool,
848
+ /**
849
+ * If `true`, the base button will have a keyboard focus ripple.
850
+ * @default false
851
+ */
852
+ focusRipple: o.bool,
853
+ /**
854
+ * This prop can help identify which element has keyboard focus.
855
+ * The class name will be applied when the element gains the focus through keyboard interaction.
856
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
857
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
858
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
859
+ * if needed.
860
+ */
861
+ focusVisibleClassName: o.string,
862
+ /**
863
+ * @ignore
864
+ */
865
+ href: o.any,
866
+ /**
867
+ * The component used to render a link when the `href` prop is provided.
868
+ * @default 'a'
869
+ */
870
+ LinkComponent: o.elementType,
871
+ /**
872
+ * @ignore
873
+ */
874
+ onBlur: o.func,
875
+ /**
876
+ * @ignore
877
+ */
878
+ onClick: o.func,
879
+ /**
880
+ * @ignore
881
+ */
882
+ onContextMenu: o.func,
883
+ /**
884
+ * @ignore
885
+ */
886
+ onDragLeave: o.func,
887
+ /**
888
+ * @ignore
889
+ */
890
+ onFocus: o.func,
891
+ /**
892
+ * Callback fired when the component is focused with a keyboard.
893
+ * We trigger a `onFocus` callback too.
894
+ */
895
+ onFocusVisible: o.func,
896
+ /**
897
+ * @ignore
898
+ */
899
+ onKeyDown: o.func,
900
+ /**
901
+ * @ignore
902
+ */
903
+ onKeyUp: o.func,
904
+ /**
905
+ * @ignore
906
+ */
907
+ onMouseDown: o.func,
908
+ /**
909
+ * @ignore
910
+ */
911
+ onMouseLeave: o.func,
912
+ /**
913
+ * @ignore
914
+ */
915
+ onMouseUp: o.func,
916
+ /**
917
+ * @ignore
918
+ */
919
+ onTouchEnd: o.func,
920
+ /**
921
+ * @ignore
922
+ */
923
+ onTouchMove: o.func,
924
+ /**
925
+ * @ignore
926
+ */
927
+ onTouchStart: o.func,
928
+ /**
929
+ * The system prop that allows defining system overrides as well as additional CSS styles.
930
+ */
931
+ sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
932
+ /**
933
+ * @default 0
934
+ */
935
+ tabIndex: o.number,
936
+ /**
937
+ * Props applied to the `TouchRipple` element.
938
+ */
939
+ TouchRippleProps: o.object,
940
+ /**
941
+ * A ref that points to the `TouchRipple` element.
942
+ */
943
+ touchRippleRef: o.oneOfType([o.func, o.shape({
944
+ current: o.shape({
945
+ pulsate: o.func.isRequired,
946
+ start: o.func.isRequired,
947
+ stop: o.func.isRequired
948
+ })
949
+ })]),
950
+ /**
951
+ * @ignore
952
+ */
953
+ type: o.oneOfType([o.oneOf(["button", "reset", "submit"]), o.string])
954
+ });
955
+ export {
956
+ bt as B,
957
+ pe as T,
958
+ et as _,
959
+ He as a,
960
+ J as b,
961
+ Ze as c,
962
+ Ke as e,
963
+ qe as r,
964
+ ae as u
965
+ };