@cgi-learning-hub/ui 0.0.1-dev.1709569189 → 0.0.1-dev.1709646249

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 (128) hide show
  1. package/dist/{Box-erN4AuKs.js → Box-C0qXdJzV.js} +8 -8
  2. package/dist/Box-DjRIKMD0.cjs +1 -0
  3. package/dist/ButtonBase-BvllyU4w.cjs +75 -0
  4. package/dist/ButtonBase-C14ZYs6z.js +833 -0
  5. package/dist/CircularProgress-Bf46-VRs.js +217 -0
  6. package/dist/CircularProgress-DjSMBYnK.cjs +28 -0
  7. package/dist/{DefaultButton-DbpZOb47.js → DefaultButton-B-2UppUm.js} +146 -355
  8. package/dist/DefaultButton-DPZOltN5.cjs +1 -0
  9. package/dist/{IconButton-DE5JOshS.js → IconButton-1URziYlU.js} +8 -8
  10. package/dist/IconButton-X6l-U-im.cjs +2 -0
  11. package/dist/InputBase-BrkAyp4z.cjs +4 -0
  12. package/dist/{InputBase-C8AzQJJ9.js → InputBase-D_wYPpmB.js} +173 -160
  13. package/dist/{LocalizationProvider-Cov62Xe0.js → LocalizationProvider-BD64DNxF.js} +3 -4
  14. package/dist/LocalizationProvider-DqwEOZOd.cjs +5 -0
  15. package/dist/SearchInput-CMLDZJ8k.cjs +1 -0
  16. package/dist/SearchInput-D2HnePqk.js +177 -0
  17. package/dist/Tabs-B9BPJaDx.js +1090 -0
  18. package/dist/Tabs-Dx8YJT4c.cjs +4 -0
  19. package/dist/TextInput-BO1q4hT2.cjs +12 -0
  20. package/dist/{TextInput-DmMk4i-V.js → TextInput-DiA3Q5CJ.js} +1353 -1594
  21. package/dist/TimePicker-CBI_tdzH.js +19695 -0
  22. package/dist/TimePicker-CnW0kylk.cjs +69 -0
  23. package/dist/Typography-CRt6WSxo.js +204 -0
  24. package/dist/Typography-DsPQABF2.cjs +1 -0
  25. package/dist/components/Dropzone/Dropzone.cjs.js +5 -5
  26. package/dist/components/Dropzone/Dropzone.es.js +11 -12
  27. package/dist/components/LocalizationProvider/LocalizationProvider.cjs.js +1 -1
  28. package/dist/components/LocalizationProvider/LocalizationProvider.es.js +1 -1
  29. package/dist/components/LocalizationProvider/index.cjs.js +1 -1
  30. package/dist/components/LocalizationProvider/index.es.js +1 -1
  31. package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +1 -1
  32. package/dist/components/buttons/DefaultButton/DefaultButton.es.js +3 -3
  33. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +1 -1
  34. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +6 -6
  35. package/dist/components/buttons/DefaultButton/index.cjs.js +1 -1
  36. package/dist/components/buttons/DefaultButton/index.es.js +1 -1
  37. package/dist/components/buttons/IconButton.stories.cjs.js +1 -1
  38. package/dist/components/buttons/IconButton.stories.es.js +9 -10
  39. package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +1 -1
  40. package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +2 -2
  41. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +1 -1
  42. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +1 -1
  43. package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +1 -1
  44. package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +2 -2
  45. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +1 -1
  46. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +1 -1
  47. package/dist/components/buttons/index.cjs.js +1 -1
  48. package/dist/components/buttons/index.es.js +1 -1
  49. package/dist/components/index.cjs.js +1 -1
  50. package/dist/components/index.es.js +91 -90
  51. package/dist/components/inputs/SearchInput/SearchInput.cjs.js +1 -1
  52. package/dist/components/inputs/SearchInput/SearchInput.es.js +6 -174
  53. package/dist/components/inputs/SearchInput/SearchInput.stories.cjs.js +1 -1
  54. package/dist/components/inputs/SearchInput/SearchInput.stories.es.js +4 -4
  55. package/dist/components/inputs/SearchInput/index.cjs.js +1 -1
  56. package/dist/components/inputs/SearchInput/index.es.js +2 -2
  57. package/dist/components/inputs/TextInput/TextInput.cjs.js +1 -1
  58. package/dist/components/inputs/TextInput/TextInput.d.ts +2 -3
  59. package/dist/components/inputs/TextInput/TextInput.es.js +2 -2
  60. package/dist/components/inputs/TextInput/TextInput.stories.cjs.js +1 -1
  61. package/dist/components/inputs/TextInput/TextInput.stories.es.js +1 -1
  62. package/dist/components/inputs/TextInput/index.cjs.js +1 -1
  63. package/dist/components/inputs/TextInput/index.es.js +1 -1
  64. package/dist/components/inputs/index.cjs.js +1 -1
  65. package/dist/components/inputs/index.es.js +4 -4
  66. package/dist/components/lists/FileList/FileList.cjs.js +1 -1
  67. package/dist/components/lists/FileList/FileList.es.js +2 -2
  68. package/dist/components/lists/FileList/FileListItem.cjs.js +1 -1
  69. package/dist/components/lists/FileList/FileListItem.es.js +39 -7
  70. package/dist/components/lists/FileList/index.cjs.js +1 -1
  71. package/dist/components/lists/FileList/index.es.js +4 -4
  72. package/dist/components/lists/TabList.stories.cjs.js +1 -1
  73. package/dist/components/lists/TabList.stories.es.js +16 -18
  74. package/dist/components/lists/index.cjs.js +1 -1
  75. package/dist/components/lists/index.es.js +4 -4
  76. package/dist/createSvgIcon-BOQCM03y.cjs +2 -0
  77. package/dist/createSvgIcon-C2VxBqzG.cjs +1 -0
  78. package/dist/{createSvgIcon-DeRU4e-L.js → createSvgIcon-Dspfpz-l.js} +18 -20
  79. package/dist/createSvgIcon-xJp3_zwo.js +84 -0
  80. package/dist/index.cjs.js +1 -1
  81. package/dist/index.es.js +94 -93
  82. package/dist/isHostComponent-PydJW4A4.cjs +1 -0
  83. package/dist/isHostComponent-kiaBvYVo.js +6 -0
  84. package/dist/refType-5EEBZL5_.cjs +1 -0
  85. package/dist/{refType-CoCfCK--.js → refType-BBFUe6fu.js} +1 -1
  86. package/dist/styled-D8lXwcQy.js +423 -0
  87. package/dist/styled-DFoJwRxe.cjs +24 -0
  88. package/dist/useSlotProps-BoMYRJkF.js +72 -0
  89. package/dist/useSlotProps-EKKRQjEn.cjs +1 -0
  90. package/dist/useTheme-BkW5nNsn.cjs +1 -0
  91. package/dist/useTheme-Bo1inEHN.js +9 -0
  92. package/dist/useThemeProps-BRWSvuZw.cjs +42 -0
  93. package/dist/useThemeProps-CZzcR_pm.js +2288 -0
  94. package/package.json +5 -2
  95. package/dist/Box-CjHm9A9L.cjs +0 -1
  96. package/dist/ButtonBase-BybMkBUd.cjs +0 -75
  97. package/dist/ButtonBase-CGcs8Gbj.cjs +0 -75
  98. package/dist/ButtonBase-V1pwsMMs.js +0 -649
  99. package/dist/ButtonBase-aujiNoUb.js +0 -649
  100. package/dist/DefaultButton-Cg4tPCgf.cjs +0 -28
  101. package/dist/FileListItem-ChKTjDnV.js +0 -254
  102. package/dist/FileListItem-CjFIZgYg.cjs +0 -28
  103. package/dist/IconButton-CHXclgOn.cjs +0 -2
  104. package/dist/InputBase-D6eXzDaz.cjs +0 -4
  105. package/dist/LocalizationProvider-42pD7VmS.cjs +0 -5
  106. package/dist/Tabs-DiWeNGD4.js +0 -1167
  107. package/dist/Tabs-DoxP7EMA.cjs +0 -4
  108. package/dist/TextInput-BbSyyuvO.cjs +0 -12
  109. package/dist/TimePicker-B5MjZCK0.cjs +0 -89
  110. package/dist/TimePicker-BmxG3a2D.js +0 -28354
  111. package/dist/TransitionGroup-COuDopJ-.js +0 -188
  112. package/dist/TransitionGroup-X90dkobW.cjs +0 -1
  113. package/dist/Typography-B90UzlQW.js +0 -179
  114. package/dist/Typography-KFjBz5Hm.cjs +0 -1
  115. package/dist/clamp-0LjYbpE_.cjs +0 -23
  116. package/dist/clamp-BGJvJ0FN.js +0 -1641
  117. package/dist/createSvgIcon-BSYat4nx.js +0 -74
  118. package/dist/createSvgIcon-BqRWmIPG.cjs +0 -1
  119. package/dist/createSvgIcon-doNQ5emq.cjs +0 -2
  120. package/dist/refType-Bt58K9Sk.cjs +0 -1
  121. package/dist/styled-BU8dAebc.js +0 -1751
  122. package/dist/styled-DGjsLYEN.cjs +0 -45
  123. package/dist/styled-DP6LeBLQ.js +0 -261
  124. package/dist/styled-Dkd1VGM-.cjs +0 -1
  125. package/dist/useTheme-C132tQV-.js +0 -10
  126. package/dist/useTheme-CliHZTkE.cjs +0 -1
  127. package/dist/useThemeProps-63SNG58r.js +0 -753
  128. package/dist/useThemeProps-CVatCXfo.cjs +0 -20
@@ -1,649 +0,0 @@
1
- import { P as e, a as pe, _ as v, g as _e } from "./clamp-BGJvJ0FN.js";
2
- import * as o from "react";
3
- import { c as M, g as fe, b as Fe } from "./styled-BU8dAebc.js";
4
- import { s as ee } from "./styled-DP6LeBLQ.js";
5
- import { u as de } from "./useThemeProps-63SNG58r.js";
6
- import { jsx as F, jsxs as Ke } from "react/jsx-runtime";
7
- import { u as Oe, a as q } from "./useTimeout-C7IkLqZ9.js";
8
- import { T as je } from "./TransitionGroup-COuDopJ-.js";
9
- import { keyframes as te } from "@emotion/react";
10
- import { a as re } from "./useForkRef-CQ5u1_mH.js";
11
- import { u as ze } from "./useIsFocusVisible-B88all80.js";
12
- import { r as Xe, e as Ye } from "./refType-CoCfCK--.js";
13
- function he(s) {
14
- const {
15
- className: C,
16
- classes: a,
17
- pulsate: u = !1,
18
- rippleX: k,
19
- rippleY: i,
20
- rippleSize: p,
21
- in: w,
22
- onExited: f,
23
- timeout: r
24
- } = s, [m, b] = o.useState(!1), d = M(C, a.ripple, a.rippleVisible, u && a.ripplePulsate), x = {
25
- width: p,
26
- height: p,
27
- top: -(p / 2) + i,
28
- left: -(p / 2) + k
29
- }, l = M(a.child, m && a.childLeaving, u && a.childPulsate);
30
- return !w && !m && b(!0), o.useEffect(() => {
31
- if (!w && f != null) {
32
- const R = setTimeout(f, r);
33
- return () => {
34
- clearTimeout(R);
35
- };
36
- }
37
- }, [f, w, r]), /* @__PURE__ */ F("span", {
38
- className: d,
39
- style: x,
40
- children: /* @__PURE__ */ F("span", {
41
- className: l
42
- })
43
- });
44
- }
45
- process.env.NODE_ENV !== "production" && (he.propTypes = {
46
- /**
47
- * Override or extend the styles applied to the component.
48
- */
49
- classes: e.object.isRequired,
50
- className: e.string,
51
- /**
52
- * @ignore - injected from TransitionGroup
53
- */
54
- in: e.bool,
55
- /**
56
- * @ignore - injected from TransitionGroup
57
- */
58
- onExited: e.func,
59
- /**
60
- * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
61
- */
62
- pulsate: e.bool,
63
- /**
64
- * Diameter of the ripple.
65
- */
66
- rippleSize: e.number,
67
- /**
68
- * Horizontal position of the ripple center.
69
- */
70
- rippleX: e.number,
71
- /**
72
- * Vertical position of the ripple center.
73
- */
74
- rippleY: e.number,
75
- /**
76
- * exit delay
77
- */
78
- timeout: e.number.isRequired
79
- });
80
- const c = fe("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsate", "child", "childLeaving", "childPulsate"]), Ae = ["center", "classes", "className"];
81
- let H = (s) => s, le, ae, ue, ce;
82
- const Z = 550, qe = 80, ve = te(le || (le = H`
83
- 0% {
84
- transform: scale(0);
85
- opacity: 0.1;
86
- }
87
-
88
- 100% {
89
- transform: scale(1);
90
- opacity: 0.3;
91
- }
92
- `)), He = te(ae || (ae = H`
93
- 0% {
94
- opacity: 1;
95
- }
96
-
97
- 100% {
98
- opacity: 0;
99
- }
100
- `)), We = te(ue || (ue = H`
101
- 0% {
102
- transform: scale(1);
103
- }
104
-
105
- 50% {
106
- transform: scale(0.92);
107
- }
108
-
109
- 100% {
110
- transform: scale(1);
111
- }
112
- `)), Ge = ee("span", {
113
- name: "MuiTouchRipple",
114
- slot: "Root"
115
- })({
116
- overflow: "hidden",
117
- pointerEvents: "none",
118
- position: "absolute",
119
- zIndex: 0,
120
- top: 0,
121
- right: 0,
122
- bottom: 0,
123
- left: 0,
124
- borderRadius: "inherit"
125
- }), Je = ee(he, {
126
- name: "MuiTouchRipple",
127
- slot: "Ripple"
128
- })(ce || (ce = H`
129
- opacity: 0;
130
- position: absolute;
131
-
132
- &.${0} {
133
- opacity: 0.3;
134
- transform: scale(1);
135
- animation-name: ${0};
136
- animation-duration: ${0}ms;
137
- animation-timing-function: ${0};
138
- }
139
-
140
- &.${0} {
141
- animation-duration: ${0}ms;
142
- }
143
-
144
- & .${0} {
145
- opacity: 1;
146
- display: block;
147
- width: 100%;
148
- height: 100%;
149
- border-radius: 50%;
150
- background-color: currentColor;
151
- }
152
-
153
- & .${0} {
154
- opacity: 0;
155
- animation-name: ${0};
156
- animation-duration: ${0}ms;
157
- animation-timing-function: ${0};
158
- }
159
-
160
- & .${0} {
161
- position: absolute;
162
- /* @noflip */
163
- left: 0px;
164
- top: 0;
165
- animation-name: ${0};
166
- animation-duration: 2500ms;
167
- animation-timing-function: ${0};
168
- animation-iteration-count: infinite;
169
- animation-delay: 200ms;
170
- }
171
- `), c.rippleVisible, ve, Z, ({
172
- theme: s
173
- }) => s.transitions.easing.easeInOut, c.ripplePulsate, ({
174
- theme: s
175
- }) => s.transitions.duration.shorter, c.child, c.childLeaving, He, Z, ({
176
- theme: s
177
- }) => s.transitions.easing.easeInOut, c.childPulsate, We, ({
178
- theme: s
179
- }) => s.transitions.easing.easeInOut), me = /* @__PURE__ */ o.forwardRef(function(C, a) {
180
- const u = de({
181
- props: C,
182
- name: "MuiTouchRipple"
183
- }), {
184
- center: k = !1,
185
- classes: i = {},
186
- className: p
187
- } = u, w = pe(u, Ae), [f, r] = o.useState([]), m = o.useRef(0), b = o.useRef(null);
188
- o.useEffect(() => {
189
- b.current && (b.current(), b.current = null);
190
- }, [f]);
191
- const d = o.useRef(!1), x = Oe(), l = o.useRef(null), R = o.useRef(null), K = o.useCallback((n) => {
192
- const {
193
- pulsate: g,
194
- rippleX: y,
195
- rippleY: L,
196
- rippleSize: _,
197
- cb: j
198
- } = n;
199
- r((T) => [...T, /* @__PURE__ */ F(Je, {
200
- classes: {
201
- ripple: M(i.ripple, c.ripple),
202
- rippleVisible: M(i.rippleVisible, c.rippleVisible),
203
- ripplePulsate: M(i.ripplePulsate, c.ripplePulsate),
204
- child: M(i.child, c.child),
205
- childLeaving: M(i.childLeaving, c.childLeaving),
206
- childPulsate: M(i.childPulsate, c.childPulsate)
207
- },
208
- timeout: Z,
209
- pulsate: g,
210
- rippleX: y,
211
- rippleY: L,
212
- rippleSize: _
213
- }, m.current)]), m.current += 1, b.current = j;
214
- }, [i]), I = o.useCallback((n = {}, g = {}, y = () => {
215
- }) => {
216
- const {
217
- pulsate: L = !1,
218
- center: _ = k || g.pulsate,
219
- fakeElement: j = !1
220
- // For test purposes
221
- } = g;
222
- if ((n == null ? void 0 : n.type) === "mousedown" && d.current) {
223
- d.current = !1;
224
- return;
225
- }
226
- (n == null ? void 0 : n.type) === "touchstart" && (d.current = !0);
227
- const T = j ? null : R.current, E = T ? T.getBoundingClientRect() : {
228
- width: 0,
229
- height: 0,
230
- left: 0,
231
- top: 0
232
- };
233
- let B, V, D;
234
- if (_ || n === void 0 || n.clientX === 0 && n.clientY === 0 || !n.clientX && !n.touches)
235
- B = Math.round(E.width / 2), V = Math.round(E.height / 2);
236
- else {
237
- const {
238
- clientX: S,
239
- clientY: N
240
- } = n.touches && n.touches.length > 0 ? n.touches[0] : n;
241
- B = Math.round(S - E.left), V = Math.round(N - E.top);
242
- }
243
- if (_)
244
- D = Math.sqrt((2 * E.width ** 2 + E.height ** 2) / 3), D % 2 === 0 && (D += 1);
245
- else {
246
- const S = Math.max(Math.abs((T ? T.clientWidth : 0) - B), B) * 2 + 2, N = Math.max(Math.abs((T ? T.clientHeight : 0) - V), V) * 2 + 2;
247
- D = Math.sqrt(S ** 2 + N ** 2);
248
- }
249
- n != null && n.touches ? l.current === null && (l.current = () => {
250
- K({
251
- pulsate: L,
252
- rippleX: B,
253
- rippleY: V,
254
- rippleSize: D,
255
- cb: y
256
- });
257
- }, x.start(qe, () => {
258
- l.current && (l.current(), l.current = null);
259
- })) : K({
260
- pulsate: L,
261
- rippleX: B,
262
- rippleY: V,
263
- rippleSize: D,
264
- cb: y
265
- });
266
- }, [k, K, x]), O = o.useCallback(() => {
267
- I({}, {
268
- pulsate: !0
269
- });
270
- }, [I]), U = o.useCallback((n, g) => {
271
- if (x.clear(), (n == null ? void 0 : n.type) === "touchend" && l.current) {
272
- l.current(), l.current = null, x.start(0, () => {
273
- U(n, g);
274
- });
275
- return;
276
- }
277
- l.current = null, r((y) => y.length > 0 ? y.slice(1) : y), b.current = g;
278
- }, [x]);
279
- return o.useImperativeHandle(a, () => ({
280
- pulsate: O,
281
- start: I,
282
- stop: U
283
- }), [O, I, U]), /* @__PURE__ */ F(Ge, v({
284
- className: M(c.root, i.root, p),
285
- ref: R
286
- }, w, {
287
- children: /* @__PURE__ */ F(je, {
288
- component: null,
289
- exit: !0,
290
- children: f
291
- })
292
- }));
293
- });
294
- process.env.NODE_ENV !== "production" && (me.propTypes = {
295
- /**
296
- * If `true`, the ripple starts at the center of the component
297
- * rather than at the point of interaction.
298
- */
299
- center: e.bool,
300
- /**
301
- * Override or extend the styles applied to the component.
302
- */
303
- classes: e.object,
304
- /**
305
- * @ignore
306
- */
307
- className: e.string
308
- });
309
- const Qe = me;
310
- function Ze(s) {
311
- return _e("MuiButtonBase", s);
312
- }
313
- const et = fe("MuiButtonBase", ["root", "disabled", "focusVisible"]), tt = ["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"], ot = (s) => {
314
- const {
315
- disabled: C,
316
- focusVisible: a,
317
- focusVisibleClassName: u,
318
- classes: k
319
- } = s, p = Fe({
320
- root: ["root", C && "disabled", a && "focusVisible"]
321
- }, Ze, k);
322
- return a && u && (p.root += ` ${u}`), p;
323
- }, nt = ee("button", {
324
- name: "MuiButtonBase",
325
- slot: "Root",
326
- overridesResolver: (s, C) => C.root
327
- })({
328
- display: "inline-flex",
329
- alignItems: "center",
330
- justifyContent: "center",
331
- position: "relative",
332
- boxSizing: "border-box",
333
- WebkitTapHighlightColor: "transparent",
334
- backgroundColor: "transparent",
335
- // Reset default value
336
- // We disable the focus ring for mouse, touch and keyboard users.
337
- outline: 0,
338
- border: 0,
339
- margin: 0,
340
- // Remove the margin in Safari
341
- borderRadius: 0,
342
- padding: 0,
343
- // Remove the padding in Firefox
344
- cursor: "pointer",
345
- userSelect: "none",
346
- verticalAlign: "middle",
347
- MozAppearance: "none",
348
- // Reset
349
- WebkitAppearance: "none",
350
- // Reset
351
- textDecoration: "none",
352
- // So we take precedent over the style of a native <a /> element.
353
- color: "inherit",
354
- "&::-moz-focus-inner": {
355
- borderStyle: "none"
356
- // Remove Firefox dotted outline.
357
- },
358
- [`&.${et.disabled}`]: {
359
- pointerEvents: "none",
360
- // Disable link interactions
361
- cursor: "default"
362
- },
363
- "@media print": {
364
- colorAdjust: "exact"
365
- }
366
- }), be = /* @__PURE__ */ o.forwardRef(function(C, a) {
367
- const u = de({
368
- props: C,
369
- name: "MuiButtonBase"
370
- }), {
371
- action: k,
372
- centerRipple: i = !1,
373
- children: p,
374
- className: w,
375
- component: f = "button",
376
- disabled: r = !1,
377
- disableRipple: m = !1,
378
- disableTouchRipple: b = !1,
379
- focusRipple: d = !1,
380
- LinkComponent: x = "a",
381
- onBlur: l,
382
- onClick: R,
383
- onContextMenu: K,
384
- onDragLeave: I,
385
- onFocus: O,
386
- onFocusVisible: U,
387
- onKeyDown: n,
388
- onKeyUp: g,
389
- onMouseDown: y,
390
- onMouseLeave: L,
391
- onMouseUp: _,
392
- onTouchEnd: j,
393
- onTouchMove: T,
394
- onTouchStart: E,
395
- tabIndex: B = 0,
396
- TouchRippleProps: V,
397
- touchRippleRef: D,
398
- type: S
399
- } = u, N = pe(u, tt), z = o.useRef(null), h = o.useRef(null), Re = re(h, D), {
400
- isFocusVisibleRef: oe,
401
- onFocus: ge,
402
- onBlur: ye,
403
- ref: Te
404
- } = ze(), [$, Y] = o.useState(!1);
405
- r && $ && Y(!1), o.useImperativeHandle(k, () => ({
406
- focusVisible: () => {
407
- Y(!0), z.current.focus();
408
- }
409
- }), []);
410
- const [W, Me] = o.useState(!1);
411
- o.useEffect(() => {
412
- Me(!0);
413
- }, []);
414
- const G = W && !m && !r;
415
- o.useEffect(() => {
416
- $ && d && !m && W && h.current.pulsate();
417
- }, [m, d, $, W]);
418
- function P(t, se, Ue = b) {
419
- return q((ie) => (se && se(ie), !Ue && h.current && h.current[t](ie), !0));
420
- }
421
- const Ce = P("start", y), xe = P("stop", K), Be = P("stop", I), Ne = P("stop", _), Pe = P("stop", (t) => {
422
- $ && t.preventDefault(), L && L(t);
423
- }), ke = P("start", E), Ee = P("stop", j), Ve = P("stop", T), De = P("stop", (t) => {
424
- ye(t), oe.current === !1 && Y(!1), l && l(t);
425
- }, !1), we = q((t) => {
426
- z.current || (z.current = t.currentTarget), ge(t), oe.current === !0 && (Y(!0), U && U(t)), O && O(t);
427
- }), J = () => {
428
- const t = z.current;
429
- return f && f !== "button" && !(t.tagName === "A" && t.href);
430
- }, Q = o.useRef(!1), Le = q((t) => {
431
- d && !Q.current && $ && h.current && t.key === " " && (Q.current = !0, h.current.stop(t, () => {
432
- h.current.start(t);
433
- })), t.target === t.currentTarget && J() && t.key === " " && t.preventDefault(), n && n(t), t.target === t.currentTarget && J() && t.key === "Enter" && !r && (t.preventDefault(), R && R(t));
434
- }), Se = q((t) => {
435
- d && t.key === " " && h.current && $ && !t.defaultPrevented && (Q.current = !1, h.current.stop(t, () => {
436
- h.current.pulsate(t);
437
- })), g && g(t), R && t.target === t.currentTarget && J() && t.key === " " && !t.defaultPrevented && R(t);
438
- });
439
- let A = f;
440
- A === "button" && (N.href || N.to) && (A = x);
441
- const X = {};
442
- A === "button" ? (X.type = S === void 0 ? "button" : S, X.disabled = r) : (!N.href && !N.to && (X.role = "button"), r && (X["aria-disabled"] = r));
443
- const $e = re(a, Te, z);
444
- process.env.NODE_ENV !== "production" && o.useEffect(() => {
445
- G && !h.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(`
446
- `));
447
- }, [G]);
448
- const ne = v({}, u, {
449
- centerRipple: i,
450
- component: f,
451
- disabled: r,
452
- disableRipple: m,
453
- disableTouchRipple: b,
454
- focusRipple: d,
455
- tabIndex: B,
456
- focusVisible: $
457
- }), Ie = ot(ne);
458
- return /* @__PURE__ */ Ke(nt, v({
459
- as: A,
460
- className: M(Ie.root, w),
461
- ownerState: ne,
462
- onBlur: De,
463
- onClick: R,
464
- onContextMenu: xe,
465
- onFocus: we,
466
- onKeyDown: Le,
467
- onKeyUp: Se,
468
- onMouseDown: Ce,
469
- onMouseLeave: Pe,
470
- onMouseUp: Ne,
471
- onDragLeave: Be,
472
- onTouchEnd: Ee,
473
- onTouchMove: Ve,
474
- onTouchStart: ke,
475
- ref: $e,
476
- tabIndex: r ? -1 : B,
477
- type: S
478
- }, X, N, {
479
- children: [p, G ? (
480
- /* TouchRipple is only needed client-side, x2 boost on the server. */
481
- /* @__PURE__ */ F(Qe, v({
482
- ref: Re,
483
- center: i
484
- }, V))
485
- ) : null]
486
- }));
487
- });
488
- process.env.NODE_ENV !== "production" && (be.propTypes = {
489
- // ┌────────────────────────────── Warning ──────────────────────────────┐
490
- // │ These PropTypes are generated from the TypeScript type definitions. │
491
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
492
- // └─────────────────────────────────────────────────────────────────────┘
493
- /**
494
- * A ref for imperative actions.
495
- * It currently only supports `focusVisible()` action.
496
- */
497
- action: Xe,
498
- /**
499
- * If `true`, the ripples are centered.
500
- * They won't start at the cursor interaction position.
501
- * @default false
502
- */
503
- centerRipple: e.bool,
504
- /**
505
- * The content of the component.
506
- */
507
- children: e.node,
508
- /**
509
- * Override or extend the styles applied to the component.
510
- */
511
- classes: e.object,
512
- /**
513
- * @ignore
514
- */
515
- className: e.string,
516
- /**
517
- * The component used for the root node.
518
- * Either a string to use a HTML element or a component.
519
- */
520
- component: Ye,
521
- /**
522
- * If `true`, the component is disabled.
523
- * @default false
524
- */
525
- disabled: e.bool,
526
- /**
527
- * If `true`, the ripple effect is disabled.
528
- *
529
- * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
530
- * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
531
- * @default false
532
- */
533
- disableRipple: e.bool,
534
- /**
535
- * If `true`, the touch ripple effect is disabled.
536
- * @default false
537
- */
538
- disableTouchRipple: e.bool,
539
- /**
540
- * If `true`, the base button will have a keyboard focus ripple.
541
- * @default false
542
- */
543
- focusRipple: e.bool,
544
- /**
545
- * This prop can help identify which element has keyboard focus.
546
- * The class name will be applied when the element gains the focus through keyboard interaction.
547
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
548
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
549
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
550
- * if needed.
551
- */
552
- focusVisibleClassName: e.string,
553
- /**
554
- * @ignore
555
- */
556
- href: e.any,
557
- /**
558
- * The component used to render a link when the `href` prop is provided.
559
- * @default 'a'
560
- */
561
- LinkComponent: e.elementType,
562
- /**
563
- * @ignore
564
- */
565
- onBlur: e.func,
566
- /**
567
- * @ignore
568
- */
569
- onClick: e.func,
570
- /**
571
- * @ignore
572
- */
573
- onContextMenu: e.func,
574
- /**
575
- * @ignore
576
- */
577
- onDragLeave: e.func,
578
- /**
579
- * @ignore
580
- */
581
- onFocus: e.func,
582
- /**
583
- * Callback fired when the component is focused with a keyboard.
584
- * We trigger a `onFocus` callback too.
585
- */
586
- onFocusVisible: e.func,
587
- /**
588
- * @ignore
589
- */
590
- onKeyDown: e.func,
591
- /**
592
- * @ignore
593
- */
594
- onKeyUp: e.func,
595
- /**
596
- * @ignore
597
- */
598
- onMouseDown: e.func,
599
- /**
600
- * @ignore
601
- */
602
- onMouseLeave: e.func,
603
- /**
604
- * @ignore
605
- */
606
- onMouseUp: e.func,
607
- /**
608
- * @ignore
609
- */
610
- onTouchEnd: e.func,
611
- /**
612
- * @ignore
613
- */
614
- onTouchMove: e.func,
615
- /**
616
- * @ignore
617
- */
618
- onTouchStart: e.func,
619
- /**
620
- * The system prop that allows defining system overrides as well as additional CSS styles.
621
- */
622
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
623
- /**
624
- * @default 0
625
- */
626
- tabIndex: e.number,
627
- /**
628
- * Props applied to the `TouchRipple` element.
629
- */
630
- TouchRippleProps: e.object,
631
- /**
632
- * A ref that points to the `TouchRipple` element.
633
- */
634
- touchRippleRef: e.oneOfType([e.func, e.shape({
635
- current: e.shape({
636
- pulsate: e.func.isRequired,
637
- start: e.func.isRequired,
638
- stop: e.func.isRequired
639
- })
640
- })]),
641
- /**
642
- * @ignore
643
- */
644
- type: e.oneOfType([e.oneOf(["button", "reset", "submit"]), e.string])
645
- });
646
- const bt = be;
647
- export {
648
- bt as B
649
- };