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