@amateescu/portal-ui-components 0.0.7 → 0.0.9-beta0

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