@hai-dev/ui-kit 1.0.4 → 1.0.6

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