@cgi-learning-hub/ui 0.0.1-dev.1708974808 → 0.0.1-dev.1709023966

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