@cgi-learning-hub/ui 0.0.1-dev.1709558390 → 0.0.1-dev.1709568003

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