@cgi-learning-hub/ui 0.0.1-dev.1708424507 → 0.0.1-dev.1708424596

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 (76) hide show
  1. package/dist/components/AnotherComponent/AnotherComponent.cjs.js +1 -1
  2. package/dist/components/AnotherComponent/AnotherComponent.es.js +6 -7
  3. package/dist/components/AnotherComponent/AnotherComponent.stories.d.ts +1 -1
  4. package/dist/components/BasicButtons/BasicButtons.cjs.js +98 -1
  5. package/dist/components/BasicButtons/BasicButtons.es.js +1897 -103
  6. package/dist/components/index.cjs.js +1 -1
  7. package/dist/components/index.d.ts +1 -3
  8. package/dist/components/index.es.js +4 -14
  9. package/dist/index.cjs.js +1 -1
  10. package/dist/index.es.js +4 -14
  11. package/dist/useTheme-CEi3JABy.cjs +42 -0
  12. package/dist/useTheme-DVWKQU4F.js +2235 -0
  13. package/package.json +1 -3
  14. package/dist/Button-8coRSZ3M.cjs +0 -1
  15. package/dist/Button-BJMp7Tz3.js +0 -355
  16. package/dist/ButtonBase-DfYGPVje.js +0 -892
  17. package/dist/ButtonBase-xIJbOm-V.cjs +0 -75
  18. package/dist/Input-DS9hzPC3.js +0 -322
  19. package/dist/Input-DWEaLJ-2.cjs +0 -1
  20. package/dist/InputBase-B31rEvBe.js +0 -854
  21. package/dist/InputBase-BuseI3Oe.cjs +0 -4
  22. package/dist/components/buttons/DefaultButton/DefaultButton.cjs.js +0 -1
  23. package/dist/components/buttons/DefaultButton/DefaultButton.d.ts +0 -12
  24. package/dist/components/buttons/DefaultButton/DefaultButton.es.js +0 -47
  25. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.cjs.js +0 -1
  26. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.d.ts +0 -9
  27. package/dist/components/buttons/DefaultButton/DefaultButtonIcon.es.js +0 -143
  28. package/dist/components/buttons/DefaultButton/index.cjs.js +0 -1
  29. package/dist/components/buttons/DefaultButton/index.d.ts +0 -2
  30. package/dist/components/buttons/DefaultButton/index.es.js +0 -4
  31. package/dist/components/buttons/PrimaryButton/PrimaryButton.cjs.js +0 -1
  32. package/dist/components/buttons/PrimaryButton/PrimaryButton.d.ts +0 -5
  33. package/dist/components/buttons/PrimaryButton/PrimaryButton.es.js +0 -11
  34. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.cjs.js +0 -1
  35. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.d.ts +0 -4
  36. package/dist/components/buttons/PrimaryButton/PrimaryButton.stories.es.js +0 -24
  37. package/dist/components/buttons/PrimaryButton/index.cjs.js +0 -1
  38. package/dist/components/buttons/PrimaryButton/index.d.ts +0 -2
  39. package/dist/components/buttons/PrimaryButton/index.es.js +0 -4
  40. package/dist/components/buttons/SecondaryButton/SecondaryButton.cjs.js +0 -1
  41. package/dist/components/buttons/SecondaryButton/SecondaryButton.d.ts +0 -5
  42. package/dist/components/buttons/SecondaryButton/SecondaryButton.es.js +0 -11
  43. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.cjs.js +0 -1
  44. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.d.ts +0 -4
  45. package/dist/components/buttons/SecondaryButton/SecondaryButton.stories.es.js +0 -24
  46. package/dist/components/buttons/SecondaryButton/index.cjs.js +0 -1
  47. package/dist/components/buttons/SecondaryButton/index.d.ts +0 -2
  48. package/dist/components/buttons/SecondaryButton/index.es.js +0 -4
  49. package/dist/components/buttons/index.cjs.js +0 -1
  50. package/dist/components/buttons/index.d.ts +0 -3
  51. package/dist/components/buttons/index.es.js +0 -8
  52. package/dist/components/inputs/SearchInput/SearchInput.cjs.js +0 -1
  53. package/dist/components/inputs/SearchInput/SearchInput.d.ts +0 -5
  54. package/dist/components/inputs/SearchInput/SearchInput.es.js +0 -345
  55. package/dist/components/inputs/SearchInput/index.cjs.js +0 -1
  56. package/dist/components/inputs/SearchInput/index.d.ts +0 -2
  57. package/dist/components/inputs/SearchInput/index.es.js +0 -4
  58. package/dist/components/inputs/TextInput/TextInput.cjs.js +0 -14
  59. package/dist/components/inputs/TextInput/TextInput.d.ts +0 -5
  60. package/dist/components/inputs/TextInput/TextInput.es.js +0 -5577
  61. package/dist/components/inputs/TextInput/index.cjs.js +0 -1
  62. package/dist/components/inputs/TextInput/index.d.ts +0 -2
  63. package/dist/components/inputs/TextInput/index.es.js +0 -4
  64. package/dist/components/inputs/index.cjs.js +0 -1
  65. package/dist/components/inputs/index.d.ts +0 -2
  66. package/dist/components/inputs/index.es.js +0 -6
  67. package/dist/createSvgIcon-BPyRt0N5.js +0 -182
  68. package/dist/createSvgIcon-Cz9hf1Fl.cjs +0 -1
  69. package/dist/extendSxProp-DzGZiKZk.js +0 -29
  70. package/dist/extendSxProp-LEI89AMt.cjs +0 -1
  71. package/dist/useForkRef-C0Hk1SEc.js +0 -44
  72. package/dist/useForkRef-YQvz-OME.cjs +0 -1
  73. package/dist/useTheme-BzgwMQvX.cjs +0 -1
  74. package/dist/useTheme-D1_U7jx5.js +0 -65
  75. package/dist/useThemeProps-Aqe6oH65.cjs +0 -65
  76. package/dist/useThemeProps-Dkkbtzcg.js +0 -2696
@@ -1,854 +0,0 @@
1
- import { P as e, w as He, _ as ge, a as d, x as Pe, T as Ve, g as We, b as _e, s as we, u as Le, h as fe, f as ee, e as je, y as Ue } from "./useThemeProps-Dkkbtzcg.js";
2
- import * as a from "react";
3
- import { jsx as R, jsxs as ne } from "react/jsx-runtime";
4
- import { a as ve, u as oe, e as $e, r as Ge } from "./useForkRef-C0Hk1SEc.js";
5
- import * as Ke from "react-dom";
6
- import { Global as qe } from "@emotion/react";
7
- function Ye(n, o = 166) {
8
- let t;
9
- function i(...r) {
10
- const p = () => {
11
- n.apply(this, r);
12
- };
13
- clearTimeout(t), t = setTimeout(p, o);
14
- }
15
- return i.clear = () => {
16
- clearTimeout(t);
17
- }, i;
18
- }
19
- function Ze(n) {
20
- return n && n.ownerDocument || document;
21
- }
22
- function me(n) {
23
- return Ze(n).defaultView || window;
24
- }
25
- function Je(n) {
26
- return n == null || Object.keys(n).length === 0;
27
- }
28
- function Ce(n) {
29
- const {
30
- styles: o,
31
- defaultTheme: t = {}
32
- } = n;
33
- return /* @__PURE__ */ R(qe, {
34
- styles: typeof o == "function" ? (r) => o(Je(r) ? t : r) : o
35
- });
36
- }
37
- process.env.NODE_ENV !== "production" && (Ce.propTypes = {
38
- defaultTheme: e.object,
39
- styles: e.oneOfType([e.array, e.string, e.object, e.func])
40
- });
41
- function Se({
42
- styles: n,
43
- themeId: o,
44
- defaultTheme: t = {}
45
- }) {
46
- const i = He(t), r = typeof n == "function" ? n(o && i[o] || i) : n;
47
- return /* @__PURE__ */ R(Ce, {
48
- styles: r
49
- });
50
- }
51
- process.env.NODE_ENV !== "production" && (Se.propTypes = {
52
- // ┌────────────────────────────── Warning ──────────────────────────────┐
53
- // │ These PropTypes are generated from the TypeScript type definitions. │
54
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
55
- // └─────────────────────────────────────────────────────────────────────┘
56
- /**
57
- * @ignore
58
- */
59
- defaultTheme: e.object,
60
- /**
61
- * @ignore
62
- */
63
- styles: e.oneOfType([e.array, e.func, e.number, e.object, e.string, e.bool]),
64
- /**
65
- * @ignore
66
- */
67
- themeId: e.string
68
- });
69
- function he(n) {
70
- return typeof n == "string";
71
- }
72
- const Qe = ["onChange", "maxRows", "minRows", "style", "value"];
73
- function U(n) {
74
- return parseInt(n, 10) || 0;
75
- }
76
- const Xe = {
77
- shadow: {
78
- // Visibility needed to hide the extra text area on iPads
79
- visibility: "hidden",
80
- // Remove from the content flow
81
- position: "absolute",
82
- // Ignore the scrollbar width
83
- overflow: "hidden",
84
- height: 0,
85
- top: 0,
86
- left: 0,
87
- // Create a new layer, increase the isolation of the computed values
88
- transform: "translateZ(0)"
89
- }
90
- };
91
- function ye(n) {
92
- return n == null || Object.keys(n).length === 0 || n.outerHeightStyle === 0 && !n.overflow;
93
- }
94
- const xe = /* @__PURE__ */ a.forwardRef(function(o, t) {
95
- const {
96
- onChange: i,
97
- maxRows: r,
98
- minRows: p = 1,
99
- style: I,
100
- value: E
101
- } = o, D = ge(o, Qe), {
102
- current: O
103
- } = a.useRef(E != null), S = a.useRef(null), F = ve(t, S), v = a.useRef(null), b = a.useRef(0), [N, k] = a.useState({
104
- outerHeightStyle: 0
105
- }), B = a.useCallback(() => {
106
- const c = S.current, u = me(c).getComputedStyle(c);
107
- if (u.width === "0px")
108
- return {
109
- outerHeightStyle: 0
110
- };
111
- const f = v.current;
112
- f.style.width = u.width, f.value = c.value || o.placeholder || "x", f.value.slice(-1) === `
113
- ` && (f.value += " ");
114
- const w = u.boxSizing, z = U(u.paddingBottom) + U(u.paddingTop), A = U(u.borderBottomWidth) + U(u.borderTopWidth), C = f.scrollHeight;
115
- f.value = "x";
116
- const T = f.scrollHeight;
117
- let h = C;
118
- p && (h = Math.max(Number(p) * T, h)), r && (h = Math.min(Number(r) * T, h)), h = Math.max(h, T);
119
- const G = h + (w === "border-box" ? z + A : 0), H = Math.abs(h - C) <= 1;
120
- return {
121
- outerHeightStyle: G,
122
- overflow: H
123
- };
124
- }, [r, p, o.placeholder]), W = (c, g) => {
125
- const {
126
- outerHeightStyle: u,
127
- overflow: f
128
- } = g;
129
- return b.current < 20 && (u > 0 && Math.abs((c.outerHeightStyle || 0) - u) > 1 || c.overflow !== f) ? (b.current += 1, {
130
- overflow: f,
131
- outerHeightStyle: u
132
- }) : (process.env.NODE_ENV !== "production" && b.current === 20 && console.error(["MUI: Too many re-renders. The layout is unstable.", "TextareaAutosize limits the number of renders to prevent an infinite loop."].join(`
133
- `)), c);
134
- }, m = a.useCallback(() => {
135
- const c = B();
136
- ye(c) || k((g) => W(g, c));
137
- }, [B]);
138
- oe(() => {
139
- const c = () => {
140
- const T = B();
141
- ye(T) || Ke.flushSync(() => {
142
- k((h) => W(h, T));
143
- });
144
- }, g = () => {
145
- b.current = 0, c();
146
- };
147
- let u;
148
- const f = () => {
149
- cancelAnimationFrame(u), u = requestAnimationFrame(() => {
150
- g();
151
- });
152
- }, w = Ye(g), z = S.current, A = me(z);
153
- A.addEventListener("resize", w);
154
- let C;
155
- return typeof ResizeObserver < "u" && (C = new ResizeObserver(process.env.NODE_ENV === "test" ? f : g), C.observe(z)), () => {
156
- w.clear(), cancelAnimationFrame(u), A.removeEventListener("resize", w), C && C.disconnect();
157
- };
158
- }, [B]), oe(() => {
159
- m();
160
- }), a.useEffect(() => {
161
- b.current = 0;
162
- }, [E]);
163
- const $ = (c) => {
164
- b.current = 0, O || m(), i && i(c);
165
- };
166
- return /* @__PURE__ */ ne(a.Fragment, {
167
- children: [/* @__PURE__ */ R("textarea", d({
168
- value: E,
169
- onChange: $,
170
- ref: F,
171
- rows: p,
172
- style: d({
173
- height: N.outerHeightStyle,
174
- // Need a large enough difference to allow scrolling.
175
- // This prevents infinite rendering loop.
176
- overflow: N.overflow ? "hidden" : void 0
177
- }, I)
178
- }, D)), /* @__PURE__ */ R("textarea", {
179
- "aria-hidden": !0,
180
- className: o.className,
181
- readOnly: !0,
182
- ref: v,
183
- tabIndex: -1,
184
- style: d({}, Xe.shadow, I, {
185
- paddingTop: 0,
186
- paddingBottom: 0
187
- })
188
- })]
189
- });
190
- });
191
- process.env.NODE_ENV !== "production" && (xe.propTypes = {
192
- // ┌────────────────────────────── Warning ──────────────────────────────┐
193
- // │ These PropTypes are generated from the TypeScript type definitions. │
194
- // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
195
- // └─────────────────────────────────────────────────────────────────────┘
196
- /**
197
- * @ignore
198
- */
199
- className: e.string,
200
- /**
201
- * Maximum number of rows to display.
202
- */
203
- maxRows: e.oneOfType([e.number, e.string]),
204
- /**
205
- * Minimum number of rows to display.
206
- * @default 1
207
- */
208
- minRows: e.oneOfType([e.number, e.string]),
209
- /**
210
- * @ignore
211
- */
212
- onChange: e.func,
213
- /**
214
- * @ignore
215
- */
216
- placeholder: e.string,
217
- /**
218
- * @ignore
219
- */
220
- style: e.object,
221
- /**
222
- * @ignore
223
- */
224
- value: e.oneOfType([e.arrayOf(e.string), e.number, e.string])
225
- });
226
- function en({
227
- props: n,
228
- states: o,
229
- muiFormControl: t
230
- }) {
231
- return o.reduce((i, r) => (i[r] = n[r], t && typeof n[r] > "u" && (i[r] = t[r]), i), {});
232
- }
233
- const Te = /* @__PURE__ */ a.createContext(void 0);
234
- process.env.NODE_ENV !== "production" && (Te.displayName = "FormControlContext");
235
- const Re = Te;
236
- function nn() {
237
- return a.useContext(Re);
238
- }
239
- function Ee(n) {
240
- return /* @__PURE__ */ R(Se, d({}, n, {
241
- defaultTheme: Pe,
242
- themeId: Ve
243
- }));
244
- }
245
- process.env.NODE_ENV !== "production" && (Ee.propTypes = {
246
- // ┌────────────────────────────── Warning ──────────────────────────────┐
247
- // │ These PropTypes are generated from the TypeScript type definitions. │
248
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
249
- // └─────────────────────────────────────────────────────────────────────┘
250
- /**
251
- * The styles you want to apply globally.
252
- */
253
- styles: e.oneOfType([e.array, e.func, e.number, e.object, e.string, e.bool])
254
- });
255
- function be(n) {
256
- return n != null && !(Array.isArray(n) && n.length === 0);
257
- }
258
- function on(n, o = !1) {
259
- return n && (be(n.value) && n.value !== "" || o && be(n.defaultValue) && n.defaultValue !== "");
260
- }
261
- function bn(n) {
262
- return n.startAdornment;
263
- }
264
- function tn(n) {
265
- return _e("MuiInputBase", n);
266
- }
267
- const rn = We("MuiInputBase", ["root", "formControl", "focused", "disabled", "adornedStart", "adornedEnd", "error", "sizeSmall", "multiline", "colorSecondary", "fullWidth", "hiddenLabel", "readOnly", "input", "inputSizeSmall", "inputMultiline", "inputTypeSearch", "inputAdornedStart", "inputAdornedEnd", "inputHiddenLabel"]), te = rn, sn = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "slotProps", "slots", "startAdornment", "type", "value"], an = (n, o) => {
268
- const {
269
- ownerState: t
270
- } = n;
271
- return [o.root, t.formControl && o.formControl, t.startAdornment && o.adornedStart, t.endAdornment && o.adornedEnd, t.error && o.error, t.size === "small" && o.sizeSmall, t.multiline && o.multiline, t.color && o[`color${ee(t.color)}`], t.fullWidth && o.fullWidth, t.hiddenLabel && o.hiddenLabel];
272
- }, ln = (n, o) => {
273
- const {
274
- ownerState: t
275
- } = n;
276
- return [o.input, t.size === "small" && o.inputSizeSmall, t.multiline && o.inputMultiline, t.type === "search" && o.inputTypeSearch, t.startAdornment && o.inputAdornedStart, t.endAdornment && o.inputAdornedEnd, t.hiddenLabel && o.inputHiddenLabel];
277
- }, un = (n) => {
278
- const {
279
- classes: o,
280
- color: t,
281
- disabled: i,
282
- error: r,
283
- endAdornment: p,
284
- focused: I,
285
- formControl: E,
286
- fullWidth: D,
287
- hiddenLabel: O,
288
- multiline: S,
289
- readOnly: F,
290
- size: v,
291
- startAdornment: b,
292
- type: N
293
- } = n, k = {
294
- root: ["root", `color${ee(t)}`, i && "disabled", r && "error", D && "fullWidth", I && "focused", E && "formControl", v && v !== "medium" && `size${ee(v)}`, S && "multiline", b && "adornedStart", p && "adornedEnd", O && "hiddenLabel", F && "readOnly"],
295
- input: ["input", i && "disabled", N === "search" && "inputTypeSearch", S && "inputMultiline", v === "small" && "inputSizeSmall", O && "inputHiddenLabel", b && "inputAdornedStart", p && "inputAdornedEnd", F && "readOnly"]
296
- };
297
- return je(k, tn, o);
298
- }, cn = we("div", {
299
- name: "MuiInputBase",
300
- slot: "Root",
301
- overridesResolver: an
302
- })(({
303
- theme: n,
304
- ownerState: o
305
- }) => d({}, n.typography.body1, {
306
- color: (n.vars || n).palette.text.primary,
307
- lineHeight: "1.4375em",
308
- // 23px
309
- boxSizing: "border-box",
310
- // Prevent padding issue with fullWidth.
311
- position: "relative",
312
- cursor: "text",
313
- display: "inline-flex",
314
- alignItems: "center",
315
- [`&.${te.disabled}`]: {
316
- color: (n.vars || n).palette.text.disabled,
317
- cursor: "default"
318
- }
319
- }, o.multiline && d({
320
- padding: "4px 0 5px"
321
- }, o.size === "small" && {
322
- paddingTop: 1
323
- }), o.fullWidth && {
324
- width: "100%"
325
- })), dn = we("input", {
326
- name: "MuiInputBase",
327
- slot: "Input",
328
- overridesResolver: ln
329
- })(({
330
- theme: n,
331
- ownerState: o
332
- }) => {
333
- const t = n.palette.mode === "light", i = d({
334
- color: "currentColor"
335
- }, n.vars ? {
336
- opacity: n.vars.opacity.inputPlaceholder
337
- } : {
338
- opacity: t ? 0.42 : 0.5
339
- }, {
340
- transition: n.transitions.create("opacity", {
341
- duration: n.transitions.duration.shorter
342
- })
343
- }), r = {
344
- opacity: "0 !important"
345
- }, p = n.vars ? {
346
- opacity: n.vars.opacity.inputPlaceholder
347
- } : {
348
- opacity: t ? 0.42 : 0.5
349
- };
350
- return d({
351
- font: "inherit",
352
- letterSpacing: "inherit",
353
- color: "currentColor",
354
- padding: "4px 0 5px",
355
- border: 0,
356
- boxSizing: "content-box",
357
- background: "none",
358
- height: "1.4375em",
359
- // Reset 23pxthe native input line-height
360
- margin: 0,
361
- // Reset for Safari
362
- WebkitTapHighlightColor: "transparent",
363
- display: "block",
364
- // Make the flex item shrink with Firefox
365
- minWidth: 0,
366
- width: "100%",
367
- // Fix IE11 width issue
368
- animationName: "mui-auto-fill-cancel",
369
- animationDuration: "10ms",
370
- "&::-webkit-input-placeholder": i,
371
- "&::-moz-placeholder": i,
372
- // Firefox 19+
373
- "&:-ms-input-placeholder": i,
374
- // IE11
375
- "&::-ms-input-placeholder": i,
376
- // Edge
377
- "&:focus": {
378
- outline: 0
379
- },
380
- // Reset Firefox invalid required input style
381
- "&:invalid": {
382
- boxShadow: "none"
383
- },
384
- "&::-webkit-search-decoration": {
385
- // Remove the padding when type=search.
386
- WebkitAppearance: "none"
387
- },
388
- // Show and hide the placeholder logic
389
- [`label[data-shrink=false] + .${te.formControl} &`]: {
390
- "&::-webkit-input-placeholder": r,
391
- "&::-moz-placeholder": r,
392
- // Firefox 19+
393
- "&:-ms-input-placeholder": r,
394
- // IE11
395
- "&::-ms-input-placeholder": r,
396
- // Edge
397
- "&:focus::-webkit-input-placeholder": p,
398
- "&:focus::-moz-placeholder": p,
399
- // Firefox 19+
400
- "&:focus:-ms-input-placeholder": p,
401
- // IE11
402
- "&:focus::-ms-input-placeholder": p
403
- // Edge
404
- },
405
- [`&.${te.disabled}`]: {
406
- opacity: 1,
407
- // Reset iOS opacity
408
- WebkitTextFillColor: (n.vars || n).palette.text.disabled
409
- // Fix opacity Safari bug
410
- },
411
- "&:-webkit-autofill": {
412
- animationDuration: "5000s",
413
- animationName: "mui-auto-fill"
414
- }
415
- }, o.size === "small" && {
416
- paddingTop: 1
417
- }, o.multiline && {
418
- height: "auto",
419
- resize: "none",
420
- padding: 0,
421
- paddingTop: 0
422
- }, o.type === "search" && {
423
- // Improve type search style.
424
- MozAppearance: "textfield"
425
- });
426
- }), pn = /* @__PURE__ */ R(Ee, {
427
- styles: {
428
- "@keyframes mui-auto-fill": {
429
- from: {
430
- display: "block"
431
- }
432
- },
433
- "@keyframes mui-auto-fill-cancel": {
434
- from: {
435
- display: "block"
436
- }
437
- }
438
- }
439
- }), Oe = /* @__PURE__ */ a.forwardRef(function(o, t) {
440
- var i;
441
- const r = Le({
442
- props: o,
443
- name: "MuiInputBase"
444
- }), {
445
- "aria-describedby": p,
446
- autoComplete: I,
447
- autoFocus: E,
448
- className: D,
449
- components: O = {},
450
- componentsProps: S = {},
451
- defaultValue: F,
452
- disabled: v,
453
- disableInjectingGlobalStyles: b,
454
- endAdornment: N,
455
- fullWidth: k = !1,
456
- id: B,
457
- inputComponent: W = "input",
458
- inputProps: m = {},
459
- inputRef: $,
460
- maxRows: c,
461
- minRows: g,
462
- multiline: u = !1,
463
- name: f,
464
- onBlur: w,
465
- onChange: z,
466
- onClick: A,
467
- onFocus: C,
468
- onKeyDown: T,
469
- onKeyUp: h,
470
- placeholder: G,
471
- readOnly: H,
472
- renderSuffix: re,
473
- rows: _,
474
- slotProps: ie = {},
475
- slots: se = {},
476
- startAdornment: P,
477
- type: ae = "text",
478
- value: Ne
479
- } = r, ze = ge(r, sn), L = m.value != null ? m.value : Ne, {
480
- current: K
481
- } = a.useRef(L != null), M = a.useRef(), Ae = a.useCallback((s) => {
482
- process.env.NODE_ENV !== "production" && s && s.nodeName !== "INPUT" && !s.focus && console.error(["MUI: You have provided a `inputComponent` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join(`
483
- `));
484
- }, []), Ie = ve(M, $, m.ref, Ae), [q, Y] = a.useState(!1), l = nn();
485
- process.env.NODE_ENV !== "production" && a.useEffect(() => {
486
- if (l)
487
- return l.registerEffect();
488
- }, [l]);
489
- const y = en({
490
- props: r,
491
- muiFormControl: l,
492
- states: ["color", "disabled", "error", "hiddenLabel", "size", "required", "filled"]
493
- });
494
- y.focused = l ? l.focused : q, a.useEffect(() => {
495
- !l && v && q && (Y(!1), w && w());
496
- }, [l, v, q, w]);
497
- const Z = l && l.onFilled, J = l && l.onEmpty, V = a.useCallback((s) => {
498
- on(s) ? Z && Z() : J && J();
499
- }, [Z, J]);
500
- oe(() => {
501
- K && V({
502
- value: L
503
- });
504
- }, [L, V, K]);
505
- const Fe = (s) => {
506
- if (y.disabled) {
507
- s.stopPropagation();
508
- return;
509
- }
510
- C && C(s), m.onFocus && m.onFocus(s), l && l.onFocus ? l.onFocus(s) : Y(!0);
511
- }, ke = (s) => {
512
- w && w(s), m.onBlur && m.onBlur(s), l && l.onBlur ? l.onBlur(s) : Y(!1);
513
- }, Be = (s, ...de) => {
514
- if (!K) {
515
- const pe = s.target || M.current;
516
- if (pe == null)
517
- throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `inputComponent` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." : Ue(1));
518
- V({
519
- value: pe.value
520
- });
521
- }
522
- m.onChange && m.onChange(s, ...de), z && z(s, ...de);
523
- };
524
- a.useEffect(() => {
525
- V(M.current);
526
- }, []);
527
- const Me = (s) => {
528
- M.current && s.currentTarget === s.target && M.current.focus(), A && A(s);
529
- };
530
- let Q = W, x = m;
531
- u && Q === "input" && (_ ? (process.env.NODE_ENV !== "production" && (g || c) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), x = d({
532
- type: void 0,
533
- minRows: _,
534
- maxRows: _
535
- }, x)) : x = d({
536
- type: void 0,
537
- maxRows: c,
538
- minRows: g
539
- }, x), Q = xe);
540
- const De = (s) => {
541
- V(s.animationName === "mui-auto-fill-cancel" ? M.current : {
542
- value: "x"
543
- });
544
- };
545
- a.useEffect(() => {
546
- l && l.setAdornedStart(!!P);
547
- }, [l, P]);
548
- const j = d({}, r, {
549
- color: y.color || "primary",
550
- disabled: y.disabled,
551
- endAdornment: N,
552
- error: y.error,
553
- focused: y.focused,
554
- formControl: l,
555
- fullWidth: k,
556
- hiddenLabel: y.hiddenLabel,
557
- multiline: u,
558
- size: y.size,
559
- startAdornment: P,
560
- type: ae
561
- }), le = un(j), ue = se.root || O.Root || cn, X = ie.root || S.root || {}, ce = se.input || O.Input || dn;
562
- return x = d({}, x, (i = ie.input) != null ? i : S.input), /* @__PURE__ */ ne(a.Fragment, {
563
- children: [!b && pn, /* @__PURE__ */ ne(ue, d({}, X, !he(ue) && {
564
- ownerState: d({}, j, X.ownerState)
565
- }, {
566
- ref: t,
567
- onClick: Me
568
- }, ze, {
569
- className: fe(le.root, X.className, D, H && "MuiInputBase-readOnly"),
570
- children: [P, /* @__PURE__ */ R(Re.Provider, {
571
- value: null,
572
- children: /* @__PURE__ */ R(ce, d({
573
- ownerState: j,
574
- "aria-invalid": y.error,
575
- "aria-describedby": p,
576
- autoComplete: I,
577
- autoFocus: E,
578
- defaultValue: F,
579
- disabled: y.disabled,
580
- id: B,
581
- onAnimationStart: De,
582
- name: f,
583
- placeholder: G,
584
- readOnly: H,
585
- required: y.required,
586
- rows: _,
587
- value: L,
588
- onKeyDown: T,
589
- onKeyUp: h,
590
- type: ae
591
- }, x, !he(ce) && {
592
- as: Q,
593
- ownerState: d({}, j, x.ownerState)
594
- }, {
595
- ref: Ie,
596
- className: fe(le.input, x.className, H && "MuiInputBase-readOnly"),
597
- onBlur: ke,
598
- onChange: Be,
599
- onFocus: Fe
600
- }))
601
- }), N, re ? re(d({}, y, {
602
- startAdornment: P
603
- })) : null]
604
- }))]
605
- });
606
- });
607
- process.env.NODE_ENV !== "production" && (Oe.propTypes = {
608
- // ┌────────────────────────────── Warning ──────────────────────────────┐
609
- // │ These PropTypes are generated from the TypeScript type definitions. │
610
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
611
- // └─────────────────────────────────────────────────────────────────────┘
612
- /**
613
- * @ignore
614
- */
615
- "aria-describedby": e.string,
616
- /**
617
- * This prop helps users to fill forms faster, especially on mobile devices.
618
- * The name can be confusing, as it's more like an autofill.
619
- * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
620
- */
621
- autoComplete: e.string,
622
- /**
623
- * If `true`, the `input` element is focused during the first mount.
624
- */
625
- autoFocus: e.bool,
626
- /**
627
- * Override or extend the styles applied to the component.
628
- */
629
- classes: e.object,
630
- /**
631
- * @ignore
632
- */
633
- className: e.string,
634
- /**
635
- * The color of the component.
636
- * It supports both default and custom theme colors, which can be added as shown in the
637
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
638
- * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
639
- */
640
- color: e.oneOfType([e.oneOf(["primary", "secondary", "error", "info", "success", "warning"]), e.string]),
641
- /**
642
- * The components used for each slot inside.
643
- *
644
- * This prop is an alias for the `slots` prop.
645
- * It's recommended to use the `slots` prop instead.
646
- *
647
- * @default {}
648
- */
649
- components: e.shape({
650
- Input: e.elementType,
651
- Root: e.elementType
652
- }),
653
- /**
654
- * The extra props for the slot components.
655
- * You can override the existing props or add new ones.
656
- *
657
- * This prop is an alias for the `slotProps` prop.
658
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
659
- *
660
- * @default {}
661
- */
662
- componentsProps: e.shape({
663
- input: e.object,
664
- root: e.object
665
- }),
666
- /**
667
- * The default value. Use when the component is not controlled.
668
- */
669
- defaultValue: e.any,
670
- /**
671
- * If `true`, the component is disabled.
672
- * The prop defaults to the value (`false`) inherited from the parent FormControl component.
673
- */
674
- disabled: e.bool,
675
- /**
676
- * If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
677
- * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
678
- * @default false
679
- */
680
- disableInjectingGlobalStyles: e.bool,
681
- /**
682
- * End `InputAdornment` for this component.
683
- */
684
- endAdornment: e.node,
685
- /**
686
- * If `true`, the `input` will indicate an error.
687
- * The prop defaults to the value (`false`) inherited from the parent FormControl component.
688
- */
689
- error: e.bool,
690
- /**
691
- * If `true`, the `input` will take up the full width of its container.
692
- * @default false
693
- */
694
- fullWidth: e.bool,
695
- /**
696
- * The id of the `input` element.
697
- */
698
- id: e.string,
699
- /**
700
- * The component used for the `input` element.
701
- * Either a string to use a HTML element or a component.
702
- * @default 'input'
703
- */
704
- inputComponent: $e,
705
- /**
706
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
707
- * @default {}
708
- */
709
- inputProps: e.object,
710
- /**
711
- * Pass a ref to the `input` element.
712
- */
713
- inputRef: Ge,
714
- /**
715
- * If `dense`, will adjust vertical spacing. This is normally obtained via context from
716
- * FormControl.
717
- * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
718
- */
719
- margin: e.oneOf(["dense", "none"]),
720
- /**
721
- * Maximum number of rows to display when multiline option is set to true.
722
- */
723
- maxRows: e.oneOfType([e.number, e.string]),
724
- /**
725
- * Minimum number of rows to display when multiline option is set to true.
726
- */
727
- minRows: e.oneOfType([e.number, e.string]),
728
- /**
729
- * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
730
- * @default false
731
- */
732
- multiline: e.bool,
733
- /**
734
- * Name attribute of the `input` element.
735
- */
736
- name: e.string,
737
- /**
738
- * Callback fired when the `input` is blurred.
739
- *
740
- * Notice that the first argument (event) might be undefined.
741
- */
742
- onBlur: e.func,
743
- /**
744
- * Callback fired when the value is changed.
745
- *
746
- * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
747
- * You can pull out the new value by accessing `event.target.value` (string).
748
- */
749
- onChange: e.func,
750
- /**
751
- * @ignore
752
- */
753
- onClick: e.func,
754
- /**
755
- * @ignore
756
- */
757
- onFocus: e.func,
758
- /**
759
- * Callback fired when the `input` doesn't satisfy its constraints.
760
- */
761
- onInvalid: e.func,
762
- /**
763
- * @ignore
764
- */
765
- onKeyDown: e.func,
766
- /**
767
- * @ignore
768
- */
769
- onKeyUp: e.func,
770
- /**
771
- * The short hint displayed in the `input` before the user enters a value.
772
- */
773
- placeholder: e.string,
774
- /**
775
- * It prevents the user from changing the value of the field
776
- * (not from interacting with the field).
777
- */
778
- readOnly: e.bool,
779
- /**
780
- * @ignore
781
- */
782
- renderSuffix: e.func,
783
- /**
784
- * If `true`, the `input` element is required.
785
- * The prop defaults to the value (`false`) inherited from the parent FormControl component.
786
- */
787
- required: e.bool,
788
- /**
789
- * Number of rows to display when multiline option is set to true.
790
- */
791
- rows: e.oneOfType([e.number, e.string]),
792
- /**
793
- * The size of the component.
794
- */
795
- size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
796
- /**
797
- * The extra props for the slot components.
798
- * You can override the existing props or add new ones.
799
- *
800
- * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
801
- *
802
- * @default {}
803
- */
804
- slotProps: e.shape({
805
- input: e.object,
806
- root: e.object
807
- }),
808
- /**
809
- * The components used for each slot inside.
810
- *
811
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
812
- *
813
- * @default {}
814
- */
815
- slots: e.shape({
816
- input: e.elementType,
817
- root: e.elementType
818
- }),
819
- /**
820
- * Start `InputAdornment` for this component.
821
- */
822
- startAdornment: e.node,
823
- /**
824
- * The system prop that allows defining system overrides as well as additional CSS styles.
825
- */
826
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
827
- /**
828
- * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
829
- * @default 'text'
830
- */
831
- type: e.string,
832
- /**
833
- * The value of the `input` element, required for a controlled component.
834
- */
835
- value: e.any
836
- });
837
- const gn = Oe;
838
- export {
839
- Re as F,
840
- cn as I,
841
- dn as a,
842
- ln as b,
843
- gn as c,
844
- he as d,
845
- me as e,
846
- en as f,
847
- bn as g,
848
- on as h,
849
- te as i,
850
- Ye as j,
851
- Ze as o,
852
- an as r,
853
- nn as u
854
- };