@hai-dev/ui-kit 1.2.1 → 1.2.2

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