@cgi-learning-hub/ui 0.0.1-dev.1708990372 → 0.0.1-dev.1709027888

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