@hybridcore/ui 1.3.2 → 1.3.4

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 (68) hide show
  1. package/dist/{ButtonBase-C875Ww3z.js → ButtonBase-DJz-TFGO.js} +200 -208
  2. package/dist/{CardContent-pWhEcyoR.js → CardContent-DZnCVGy9.js} +15 -15
  3. package/dist/{Checkbox-COCZU8Yl.js → Checkbox-DzmWBCrt.js} +154 -144
  4. package/dist/{Collapse-CZFw4GZs.js → Collapse-NqW0GIK_.js} +79 -77
  5. package/dist/DialogContent-D51w7KVX.js +2119 -0
  6. package/dist/FormControl-aXQs42m6.js +1363 -0
  7. package/dist/FormControlLabel-hDa-xf_q.js +639 -0
  8. package/dist/{IconButton-DM-0JFx9.js → IconButton-SnBOFQ43.js} +22 -22
  9. package/dist/{Input-DgIhcA8j.js → Input-CeVb6kjv.js} +34 -34
  10. package/dist/InputAdornment-fM3loNyx.js +155 -0
  11. package/dist/{List-Dz3Z1qJk.js → List-DLIiXc6r.js} +10 -10
  12. package/dist/{ListItem-DnyWDeDF.js → ListItem-BkxmqFI8.js} +23 -23
  13. package/dist/{MenuItem-BjC83iWq.js → MenuItem-BEW28T9O.js} +27 -27
  14. package/dist/{OutlinedInput-CS2BwiVg.js → OutlinedInput-DkzLHRTd.js} +75 -78
  15. package/dist/{Paper-seBMlMwu.js → Paper-Dp3qO0cK.js} +18 -18
  16. package/dist/Select-Cdmu0dQ4.js +2175 -0
  17. package/dist/Typography-CXe5ytr0.js +201 -0
  18. package/dist/components/card/index.js +17 -17
  19. package/dist/components/card/styled.js +1 -1
  20. package/dist/components/collapsible-card/style.js +222 -302
  21. package/dist/components/confirm/dialog.js +13 -13
  22. package/dist/components/container/index.js +19 -19
  23. package/dist/components/context-menu/index.js +32 -32
  24. package/dist/components/data-management/instance-form/components/composite-list/index.js +1 -1
  25. package/dist/components/data-management/instance-form/components/variable/index.js +6 -6
  26. package/dist/components/data-management/instance-form/components/variables/index.js +1 -1
  27. package/dist/components/date-time-picker/index.js +4 -4
  28. package/dist/components/geometry-picker/index.js +7 -6
  29. package/dist/components/icon-button/index.js +1 -1
  30. package/dist/components/map/styled.js +14 -14
  31. package/dist/components/search-input/index.js +10 -9
  32. package/dist/components/template-property-filters/index.js +1 -1
  33. package/dist/components/template-property-filters/property.js +4 -4
  34. package/dist/components/tree-select/index.js +4 -4
  35. package/dist/components/treeview-filter/index.js +29 -30
  36. package/dist/components/treeview-filter/item/index.js +1 -1
  37. package/dist/components/treeview-filter/item-label/index.js +2 -2
  38. package/dist/createStyled-liRRhQcN.js +1910 -0
  39. package/dist/createSvgIcon-B4TFefhd.js +73 -0
  40. package/dist/{createSvgIcon-pajAAvTK.js → createSvgIcon-Cl8kMTkx.js} +82 -85
  41. package/dist/{exactProp-D0xuoiRB.js → exactProp-CT2wqJXE.js} +2 -2
  42. package/dist/{index-tNZngrO0.js → index-D9TdkXAs.js} +10 -10
  43. package/dist/{index-DlFdC7eU.js → index-DRy8nExS.js} +205 -218
  44. package/dist/{listItemTextClasses-DRMkDW2V.js → listItemTextClasses-BrCbmCR1.js} +2 -2
  45. package/dist/main.js +248 -326
  46. package/dist/property-BsU8ijQF.js +6857 -0
  47. package/dist/requirePropFactory-BItwGLRQ.js +18 -0
  48. package/dist/styled-Dm8rXzIG.js +677 -0
  49. package/dist/useTheme-CTuK-wFF.js +10 -0
  50. package/dist/useThemeProps-BXn-nVhw.js +107 -0
  51. package/dist/{utils-Cbb4HUTT.js → utils-DY9Jk4Ah.js} +2 -2
  52. package/package.json +4 -4
  53. package/dist/DialogContent-DhcqAG-q.js +0 -1982
  54. package/dist/FormControl-BhwmBUAq.js +0 -1479
  55. package/dist/FormControlLabel-BL6c4YAN.js +0 -827
  56. package/dist/Select-C8Iimh3g.js +0 -2305
  57. package/dist/Typography-CqyjdT7p.js +0 -178
  58. package/dist/chainPropTypes-CwfDfLEA.js +0 -96
  59. package/dist/createSvgIcon-CTQMsmqJ.js +0 -77
  60. package/dist/createTheme-CCwx9ptk.js +0 -2395
  61. package/dist/property-CKak9_tn.js +0 -7020
  62. package/dist/resolveComponentProps-DVsx78bV.js +0 -54
  63. package/dist/styled-CPg13iuX.js +0 -142
  64. package/dist/styled-fcu13kUF.js +0 -1033
  65. package/dist/useTheme-BWgLzAUj.js +0 -18
  66. package/dist/useTheme-pp7LSyyX.js +0 -10
  67. package/dist/useThemeProps-CDWnyqCh.js +0 -62
  68. package/dist/useThemeProps-DOuXhu3E.js +0 -27
@@ -0,0 +1,1363 @@
1
+ import { a as G, _ as a } from "./extends-Cyw62AD_.js";
2
+ import * as i from "react";
3
+ import { P as e, a as K, f as Ve } from "./createStyled-liRRhQcN.js";
4
+ import { b as Ue, g as ee, u as oe, c as V, a as ne } from "./useThemeProps-BXn-nVhw.js";
5
+ import { u as fe, F as Ee } from "./useFormControl-CatNKXAi.js";
6
+ import { d as Ge, g as re, s as _, r as Ke } from "./styled-Dm8rXzIG.js";
7
+ import { jsxs as U, jsx as N } from "react/jsx-runtime";
8
+ import { u as Ne, b as ke, e as Ye, r as Ze } from "./ButtonBase-DJz-TFGO.js";
9
+ import * as Je from "react-dom";
10
+ import { o as we } from "./ownerWindow-niciwP7I.js";
11
+ import { d as Qe } from "./debounce-46wSf_lW.js";
12
+ import { i as Oe } from "./isHostComponent-kiaBvYVo.js";
13
+ import { Global as Xe } from "@emotion/react";
14
+ import { i as ce } from "./isMuiElement-CxT3_ACP.js";
15
+ const eo = ["onChange", "maxRows", "minRows", "style", "value"];
16
+ function X(o) {
17
+ return parseInt(o, 10) || 0;
18
+ }
19
+ const oo = {
20
+ shadow: {
21
+ // Visibility needed to hide the extra text area on iPads
22
+ visibility: "hidden",
23
+ // Remove from the content flow
24
+ position: "absolute",
25
+ // Ignore the scrollbar width
26
+ overflow: "hidden",
27
+ height: 0,
28
+ top: 0,
29
+ left: 0,
30
+ // Create a new layer, increase the isolation of the computed values
31
+ transform: "translateZ(0)"
32
+ }
33
+ };
34
+ function Te(o) {
35
+ return o == null || Object.keys(o).length === 0 || o.outerHeightStyle === 0 && !o.overflow;
36
+ }
37
+ const Fe = /* @__PURE__ */ i.forwardRef(function(n, r) {
38
+ const {
39
+ onChange: t,
40
+ maxRows: s,
41
+ minRows: u = 1,
42
+ style: h,
43
+ value: g
44
+ } = n, p = G(n, eo), {
45
+ current: l
46
+ } = i.useRef(g != null), b = i.useRef(null), C = Ne(r, b), w = i.useRef(null), T = i.useRef(0), [E, k] = i.useState({
47
+ outerHeightStyle: 0
48
+ }), F = i.useCallback(() => {
49
+ const d = b.current, y = we(d).getComputedStyle(d);
50
+ if (y.width === "0px")
51
+ return {
52
+ outerHeightStyle: 0
53
+ };
54
+ const f = w.current;
55
+ f.style.width = y.width, f.value = d.value || n.placeholder || "x", f.value.slice(-1) === `
56
+ ` && (f.value += " ");
57
+ const I = y.boxSizing, L = X(y.paddingBottom) + X(y.paddingTop), A = X(y.borderBottomWidth) + X(y.borderTopWidth), P = f.scrollHeight;
58
+ f.value = "x";
59
+ const O = f.scrollHeight;
60
+ let v = P;
61
+ u && (v = Math.max(Number(u) * O, v)), s && (v = Math.min(Number(s) * O, v)), v = Math.max(v, O);
62
+ const M = v + (I === "border-box" ? L + A : 0), Y = Math.abs(v - P) <= 1;
63
+ return {
64
+ outerHeightStyle: M,
65
+ overflow: Y
66
+ };
67
+ }, [s, u, n.placeholder]), B = (d, x) => {
68
+ const {
69
+ outerHeightStyle: y,
70
+ overflow: f
71
+ } = x;
72
+ return T.current < 20 && (y > 0 && Math.abs((d.outerHeightStyle || 0) - y) > 1 || d.overflow !== f) ? (T.current += 1, {
73
+ overflow: f,
74
+ outerHeightStyle: y
75
+ }) : (process.env.NODE_ENV !== "production" && T.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(`
76
+ `)), d);
77
+ }, S = i.useCallback(() => {
78
+ const d = F();
79
+ Te(d) || k((x) => B(x, d));
80
+ }, [F]), j = () => {
81
+ const d = F();
82
+ Te(d) || Je.flushSync(() => {
83
+ k((x) => B(x, d));
84
+ });
85
+ };
86
+ i.useEffect(() => {
87
+ const d = Qe(() => {
88
+ T.current = 0, b.current && j();
89
+ });
90
+ let x;
91
+ const y = b.current, f = we(y);
92
+ return f.addEventListener("resize", d), typeof ResizeObserver < "u" && (x = new ResizeObserver(d), x.observe(y)), () => {
93
+ d.clear(), f.removeEventListener("resize", d), x && x.disconnect();
94
+ };
95
+ }), ke(() => {
96
+ S();
97
+ }), i.useEffect(() => {
98
+ T.current = 0;
99
+ }, [g]);
100
+ const W = (d) => {
101
+ T.current = 0, l || S(), t && t(d);
102
+ };
103
+ return /* @__PURE__ */ U(i.Fragment, {
104
+ children: [/* @__PURE__ */ N("textarea", a({
105
+ value: g,
106
+ onChange: W,
107
+ ref: C,
108
+ rows: u,
109
+ style: a({
110
+ height: E.outerHeightStyle,
111
+ // Need a large enough difference to allow scrolling.
112
+ // This prevents infinite rendering loop.
113
+ overflow: E.overflow ? "hidden" : void 0
114
+ }, h)
115
+ }, p)), /* @__PURE__ */ N("textarea", {
116
+ "aria-hidden": !0,
117
+ className: n.className,
118
+ readOnly: !0,
119
+ ref: w,
120
+ tabIndex: -1,
121
+ style: a({}, oo.shadow, h, {
122
+ padding: 0
123
+ })
124
+ })]
125
+ });
126
+ });
127
+ process.env.NODE_ENV !== "production" && (Fe.propTypes = {
128
+ // ----------------------------- Warning --------------------------------
129
+ // | These PropTypes are generated from the TypeScript type definitions |
130
+ // | To update them edit TypeScript types and run "yarn proptypes" |
131
+ // ----------------------------------------------------------------------
132
+ /**
133
+ * @ignore
134
+ */
135
+ className: e.string,
136
+ /**
137
+ * Maximum number of rows to display.
138
+ */
139
+ maxRows: e.oneOfType([e.number, e.string]),
140
+ /**
141
+ * Minimum number of rows to display.
142
+ * @default 1
143
+ */
144
+ minRows: e.oneOfType([e.number, e.string]),
145
+ /**
146
+ * @ignore
147
+ */
148
+ onChange: e.func,
149
+ /**
150
+ * @ignore
151
+ */
152
+ placeholder: e.string,
153
+ /**
154
+ * @ignore
155
+ */
156
+ style: e.object,
157
+ /**
158
+ * @ignore
159
+ */
160
+ value: e.oneOfType([e.arrayOf(e.string), e.number, e.string])
161
+ });
162
+ function no(o) {
163
+ return o == null || Object.keys(o).length === 0;
164
+ }
165
+ function ze(o) {
166
+ const {
167
+ styles: n,
168
+ defaultTheme: r = {}
169
+ } = o;
170
+ return /* @__PURE__ */ N(Xe, {
171
+ styles: typeof n == "function" ? (s) => n(no(s) ? r : s) : n
172
+ });
173
+ }
174
+ process.env.NODE_ENV !== "production" && (ze.propTypes = {
175
+ defaultTheme: e.object,
176
+ styles: e.oneOfType([e.array, e.string, e.object, e.func])
177
+ });
178
+ function Ie({
179
+ styles: o,
180
+ themeId: n,
181
+ defaultTheme: r = {}
182
+ }) {
183
+ const t = Ue(r), s = typeof o == "function" ? o(n && t[n] || t) : o;
184
+ return /* @__PURE__ */ N(ze, {
185
+ styles: s
186
+ });
187
+ }
188
+ process.env.NODE_ENV !== "production" && (Ie.propTypes = {
189
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
190
+ // │ These PropTypes are generated from the TypeScript type definitions. │
191
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
192
+ // └─────────────────────────────────────────────────────────────────────┘
193
+ /**
194
+ * @ignore
195
+ */
196
+ defaultTheme: e.object,
197
+ /**
198
+ * @ignore
199
+ */
200
+ styles: e.oneOfType([e.array, e.func, e.number, e.object, e.string, e.bool]),
201
+ /**
202
+ * @ignore
203
+ */
204
+ themeId: e.string
205
+ });
206
+ function me({
207
+ props: o,
208
+ states: n,
209
+ muiFormControl: r
210
+ }) {
211
+ return n.reduce((t, s) => (t[s] = o[s], r && typeof o[s] > "u" && (t[s] = r[s]), t), {});
212
+ }
213
+ function Ae(o) {
214
+ return /* @__PURE__ */ N(Ie, a({}, o, {
215
+ defaultTheme: Ge
216
+ }));
217
+ }
218
+ process.env.NODE_ENV !== "production" && (Ae.propTypes = {
219
+ // ----------------------------- Warning --------------------------------
220
+ // | These PropTypes are generated from the TypeScript type definitions |
221
+ // | To update them edit the d.ts file and run "yarn proptypes" |
222
+ // ----------------------------------------------------------------------
223
+ /**
224
+ * The styles you want to apply globally.
225
+ */
226
+ styles: e.oneOfType([e.func, e.number, e.object, e.shape({
227
+ __emotion_styles: e.any.isRequired
228
+ }), e.string, e.bool])
229
+ });
230
+ function Re(o) {
231
+ return o != null && !(Array.isArray(o) && o.length === 0);
232
+ }
233
+ function Me(o, n = !1) {
234
+ return o && (Re(o.value) && o.value !== "" || n && Re(o.defaultValue) && o.defaultValue !== "");
235
+ }
236
+ function ro(o) {
237
+ return o.startAdornment;
238
+ }
239
+ function to(o) {
240
+ return re("MuiInputBase", o);
241
+ }
242
+ const pe = ee("MuiInputBase", ["root", "formControl", "focused", "disabled", "adornedStart", "adornedEnd", "error", "sizeSmall", "multiline", "colorSecondary", "fullWidth", "hiddenLabel", "readOnly", "input", "inputSizeSmall", "inputMultiline", "inputTypeSearch", "inputAdornedStart", "inputAdornedEnd", "inputHiddenLabel"]), so = ["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"], io = (o, n) => {
243
+ const {
244
+ ownerState: r
245
+ } = o;
246
+ return [n.root, r.formControl && n.formControl, r.startAdornment && n.adornedStart, r.endAdornment && n.adornedEnd, r.error && n.error, r.size === "small" && n.sizeSmall, r.multiline && n.multiline, r.color && n[`color${K(r.color)}`], r.fullWidth && n.fullWidth, r.hiddenLabel && n.hiddenLabel];
247
+ }, ao = (o, n) => {
248
+ const {
249
+ ownerState: r
250
+ } = o;
251
+ return [n.input, r.size === "small" && n.inputSizeSmall, r.multiline && n.inputMultiline, r.type === "search" && n.inputTypeSearch, r.startAdornment && n.inputAdornedStart, r.endAdornment && n.inputAdornedEnd, r.hiddenLabel && n.inputHiddenLabel];
252
+ }, lo = (o) => {
253
+ const {
254
+ classes: n,
255
+ color: r,
256
+ disabled: t,
257
+ error: s,
258
+ endAdornment: u,
259
+ focused: h,
260
+ formControl: g,
261
+ fullWidth: p,
262
+ hiddenLabel: l,
263
+ multiline: b,
264
+ readOnly: C,
265
+ size: w,
266
+ startAdornment: T,
267
+ type: E
268
+ } = o, k = {
269
+ root: ["root", `color${K(r)}`, t && "disabled", s && "error", p && "fullWidth", h && "focused", g && "formControl", w === "small" && "sizeSmall", b && "multiline", T && "adornedStart", u && "adornedEnd", l && "hiddenLabel", C && "readOnly"],
270
+ input: ["input", t && "disabled", E === "search" && "inputTypeSearch", b && "inputMultiline", w === "small" && "inputSizeSmall", l && "inputHiddenLabel", T && "inputAdornedStart", u && "inputAdornedEnd", C && "readOnly"]
271
+ };
272
+ return ne(k, to, n);
273
+ }, uo = _("div", {
274
+ name: "MuiInputBase",
275
+ slot: "Root",
276
+ overridesResolver: io
277
+ })(({
278
+ theme: o,
279
+ ownerState: n
280
+ }) => a({}, o.typography.body1, {
281
+ color: (o.vars || o).palette.text.primary,
282
+ lineHeight: "1.4375em",
283
+ // 23px
284
+ boxSizing: "border-box",
285
+ // Prevent padding issue with fullWidth.
286
+ position: "relative",
287
+ cursor: "text",
288
+ display: "inline-flex",
289
+ alignItems: "center",
290
+ [`&.${pe.disabled}`]: {
291
+ color: (o.vars || o).palette.text.disabled,
292
+ cursor: "default"
293
+ }
294
+ }, n.multiline && a({
295
+ padding: "4px 0 5px"
296
+ }, n.size === "small" && {
297
+ paddingTop: 1
298
+ }), n.fullWidth && {
299
+ width: "100%"
300
+ })), co = _("input", {
301
+ name: "MuiInputBase",
302
+ slot: "Input",
303
+ overridesResolver: ao
304
+ })(({
305
+ theme: o,
306
+ ownerState: n
307
+ }) => {
308
+ const r = o.palette.mode === "light", t = a({
309
+ color: "currentColor"
310
+ }, o.vars ? {
311
+ opacity: o.vars.opacity.inputPlaceholder
312
+ } : {
313
+ opacity: r ? 0.42 : 0.5
314
+ }, {
315
+ transition: o.transitions.create("opacity", {
316
+ duration: o.transitions.duration.shorter
317
+ })
318
+ }), s = {
319
+ opacity: "0 !important"
320
+ }, u = o.vars ? {
321
+ opacity: o.vars.opacity.inputPlaceholder
322
+ } : {
323
+ opacity: r ? 0.42 : 0.5
324
+ };
325
+ return a({
326
+ font: "inherit",
327
+ letterSpacing: "inherit",
328
+ color: "currentColor",
329
+ padding: "4px 0 5px",
330
+ border: 0,
331
+ boxSizing: "content-box",
332
+ background: "none",
333
+ height: "1.4375em",
334
+ // Reset 23pxthe native input line-height
335
+ margin: 0,
336
+ // Reset for Safari
337
+ WebkitTapHighlightColor: "transparent",
338
+ display: "block",
339
+ // Make the flex item shrink with Firefox
340
+ minWidth: 0,
341
+ width: "100%",
342
+ // Fix IE11 width issue
343
+ animationName: "mui-auto-fill-cancel",
344
+ animationDuration: "10ms",
345
+ "&::-webkit-input-placeholder": t,
346
+ "&::-moz-placeholder": t,
347
+ // Firefox 19+
348
+ "&:-ms-input-placeholder": t,
349
+ // IE11
350
+ "&::-ms-input-placeholder": t,
351
+ // Edge
352
+ "&:focus": {
353
+ outline: 0
354
+ },
355
+ // Reset Firefox invalid required input style
356
+ "&:invalid": {
357
+ boxShadow: "none"
358
+ },
359
+ "&::-webkit-search-decoration": {
360
+ // Remove the padding when type=search.
361
+ WebkitAppearance: "none"
362
+ },
363
+ // Show and hide the placeholder logic
364
+ [`label[data-shrink=false] + .${pe.formControl} &`]: {
365
+ "&::-webkit-input-placeholder": s,
366
+ "&::-moz-placeholder": s,
367
+ // Firefox 19+
368
+ "&:-ms-input-placeholder": s,
369
+ // IE11
370
+ "&::-ms-input-placeholder": s,
371
+ // Edge
372
+ "&:focus::-webkit-input-placeholder": u,
373
+ "&:focus::-moz-placeholder": u,
374
+ // Firefox 19+
375
+ "&:focus:-ms-input-placeholder": u,
376
+ // IE11
377
+ "&:focus::-ms-input-placeholder": u
378
+ // Edge
379
+ },
380
+ [`&.${pe.disabled}`]: {
381
+ opacity: 1,
382
+ // Reset iOS opacity
383
+ WebkitTextFillColor: (o.vars || o).palette.text.disabled
384
+ // Fix opacity Safari bug
385
+ },
386
+ "&:-webkit-autofill": {
387
+ animationDuration: "5000s",
388
+ animationName: "mui-auto-fill"
389
+ }
390
+ }, n.size === "small" && {
391
+ paddingTop: 1
392
+ }, n.multiline && {
393
+ height: "auto",
394
+ resize: "none",
395
+ padding: 0,
396
+ paddingTop: 0
397
+ }, n.type === "search" && {
398
+ // Improve type search style.
399
+ MozAppearance: "textfield"
400
+ });
401
+ }), po = /* @__PURE__ */ N(Ae, {
402
+ styles: {
403
+ "@keyframes mui-auto-fill": {
404
+ from: {
405
+ display: "block"
406
+ }
407
+ },
408
+ "@keyframes mui-auto-fill-cancel": {
409
+ from: {
410
+ display: "block"
411
+ }
412
+ }
413
+ }
414
+ }), fo = /* @__PURE__ */ i.forwardRef(function(n, r) {
415
+ var t;
416
+ const s = oe({
417
+ props: n,
418
+ name: "MuiInputBase"
419
+ }), {
420
+ "aria-describedby": u,
421
+ autoComplete: h,
422
+ autoFocus: g,
423
+ className: p,
424
+ components: l = {},
425
+ componentsProps: b = {},
426
+ defaultValue: C,
427
+ disabled: w,
428
+ disableInjectingGlobalStyles: T,
429
+ endAdornment: E,
430
+ fullWidth: k = !1,
431
+ id: F,
432
+ inputComponent: B = "input",
433
+ inputProps: S = {},
434
+ inputRef: j,
435
+ maxRows: W,
436
+ minRows: d,
437
+ multiline: x = !1,
438
+ name: y,
439
+ onBlur: f,
440
+ onChange: I,
441
+ onClick: L,
442
+ onFocus: A,
443
+ onKeyDown: P,
444
+ onKeyUp: O,
445
+ placeholder: v,
446
+ readOnly: M,
447
+ renderSuffix: Y,
448
+ rows: Z,
449
+ slotProps: be = {},
450
+ slots: he = {},
451
+ startAdornment: $,
452
+ type: ye = "text",
453
+ value: Le
454
+ } = s, Be = G(s, so), J = S.value != null ? S.value : Le, {
455
+ current: te
456
+ } = i.useRef(J != null), D = i.useRef(), Pe = i.useCallback((c) => {
457
+ process.env.NODE_ENV !== "production" && c && c.nodeName !== "INPUT" && !c.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(`
458
+ `));
459
+ }, []), De = Ne(D, j, S.ref, Pe), [se, ie] = i.useState(!1), m = fe();
460
+ process.env.NODE_ENV !== "production" && i.useEffect(() => {
461
+ if (m)
462
+ return m.registerEffect();
463
+ }, [m]);
464
+ const R = me({
465
+ props: s,
466
+ muiFormControl: m,
467
+ states: ["color", "disabled", "error", "hiddenLabel", "size", "required", "filled"]
468
+ });
469
+ R.focused = m ? m.focused : se, i.useEffect(() => {
470
+ !m && w && se && (ie(!1), f && f());
471
+ }, [m, w, se, f]);
472
+ const ae = m && m.onFilled, le = m && m.onEmpty, q = i.useCallback((c) => {
473
+ Me(c) ? ae && ae() : le && le();
474
+ }, [ae, le]);
475
+ ke(() => {
476
+ te && q({
477
+ value: J
478
+ });
479
+ }, [J, q, te]);
480
+ const _e = (c) => {
481
+ if (R.disabled) {
482
+ c.stopPropagation();
483
+ return;
484
+ }
485
+ A && A(c), S.onFocus && S.onFocus(c), m && m.onFocus ? m.onFocus(c) : ie(!0);
486
+ }, je = (c) => {
487
+ f && f(c), S.onBlur && S.onBlur(c), m && m.onBlur ? m.onBlur(c) : ie(!1);
488
+ }, $e = (c, ...Ce) => {
489
+ if (!te) {
490
+ const Se = c.target || D.current;
491
+ if (Se == null)
492
+ 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." : Ve(1));
493
+ q({
494
+ value: Se.value
495
+ });
496
+ }
497
+ S.onChange && S.onChange(c, ...Ce), I && I(c, ...Ce);
498
+ };
499
+ i.useEffect(() => {
500
+ q(D.current);
501
+ }, []);
502
+ const qe = (c) => {
503
+ D.current && c.currentTarget === c.target && D.current.focus(), L && L(c);
504
+ };
505
+ let ue = B, z = S;
506
+ x && ue === "input" && (Z ? (process.env.NODE_ENV !== "production" && (d || W) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), z = a({
507
+ type: void 0,
508
+ minRows: Z,
509
+ maxRows: Z
510
+ }, z)) : z = a({
511
+ type: void 0,
512
+ maxRows: W,
513
+ minRows: d
514
+ }, z), ue = Fe);
515
+ const He = (c) => {
516
+ q(c.animationName === "mui-auto-fill-cancel" ? D.current : {
517
+ value: "x"
518
+ });
519
+ };
520
+ i.useEffect(() => {
521
+ m && m.setAdornedStart(!!$);
522
+ }, [m, $]);
523
+ const Q = a({}, s, {
524
+ color: R.color || "primary",
525
+ disabled: R.disabled,
526
+ endAdornment: E,
527
+ error: R.error,
528
+ focused: R.focused,
529
+ formControl: m,
530
+ fullWidth: k,
531
+ hiddenLabel: R.hiddenLabel,
532
+ multiline: x,
533
+ size: R.size,
534
+ startAdornment: $,
535
+ type: ye
536
+ }), ge = lo(Q), ve = he.root || l.Root || uo, de = be.root || b.root || {}, xe = he.input || l.Input || co;
537
+ return z = a({}, z, (t = be.input) != null ? t : b.input), /* @__PURE__ */ U(i.Fragment, {
538
+ children: [!T && po, /* @__PURE__ */ U(ve, a({}, de, !Oe(ve) && {
539
+ ownerState: a({}, Q, de.ownerState)
540
+ }, {
541
+ ref: r,
542
+ onClick: qe
543
+ }, Be, {
544
+ className: V(ge.root, de.className, p, M && "MuiInputBase-readOnly"),
545
+ children: [$, /* @__PURE__ */ N(Ee.Provider, {
546
+ value: null,
547
+ children: /* @__PURE__ */ N(xe, a({
548
+ ownerState: Q,
549
+ "aria-invalid": R.error,
550
+ "aria-describedby": u,
551
+ autoComplete: h,
552
+ autoFocus: g,
553
+ defaultValue: C,
554
+ disabled: R.disabled,
555
+ id: F,
556
+ onAnimationStart: He,
557
+ name: y,
558
+ placeholder: v,
559
+ readOnly: M,
560
+ required: R.required,
561
+ rows: Z,
562
+ value: J,
563
+ onKeyDown: P,
564
+ onKeyUp: O,
565
+ type: ye
566
+ }, z, !Oe(xe) && {
567
+ as: ue,
568
+ ownerState: a({}, Q, z.ownerState)
569
+ }, {
570
+ ref: De,
571
+ className: V(ge.input, z.className, M && "MuiInputBase-readOnly"),
572
+ onBlur: je,
573
+ onChange: $e,
574
+ onFocus: _e
575
+ }))
576
+ }), E, Y ? Y(a({}, R, {
577
+ startAdornment: $
578
+ })) : null]
579
+ }))]
580
+ });
581
+ });
582
+ process.env.NODE_ENV !== "production" && (fo.propTypes = {
583
+ // ----------------------------- Warning --------------------------------
584
+ // | These PropTypes are generated from the TypeScript type definitions |
585
+ // | To update them edit the d.ts file and run "yarn proptypes" |
586
+ // ----------------------------------------------------------------------
587
+ /**
588
+ * @ignore
589
+ */
590
+ "aria-describedby": e.string,
591
+ /**
592
+ * This prop helps users to fill forms faster, especially on mobile devices.
593
+ * The name can be confusing, as it's more like an autofill.
594
+ * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
595
+ */
596
+ autoComplete: e.string,
597
+ /**
598
+ * If `true`, the `input` element is focused during the first mount.
599
+ */
600
+ autoFocus: e.bool,
601
+ /**
602
+ * Override or extend the styles applied to the component.
603
+ */
604
+ classes: e.object,
605
+ /**
606
+ * @ignore
607
+ */
608
+ className: e.string,
609
+ /**
610
+ * The color of the component.
611
+ * It supports both default and custom theme colors, which can be added as shown in the
612
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
613
+ * The prop defaults to the value (`'primary'`) inherited from the parent FormControl component.
614
+ */
615
+ color: e.oneOfType([e.oneOf(["primary", "secondary", "error", "info", "success", "warning"]), e.string]),
616
+ /**
617
+ * The components used for each slot inside.
618
+ *
619
+ * This prop is an alias for the `slots` prop.
620
+ * It's recommended to use the `slots` prop instead.
621
+ *
622
+ * @default {}
623
+ */
624
+ components: e.shape({
625
+ Input: e.elementType,
626
+ Root: e.elementType
627
+ }),
628
+ /**
629
+ * The extra props for the slot components.
630
+ * You can override the existing props or add new ones.
631
+ *
632
+ * This prop is an alias for the `slotProps` prop.
633
+ * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
634
+ *
635
+ * @default {}
636
+ */
637
+ componentsProps: e.shape({
638
+ input: e.object,
639
+ root: e.object
640
+ }),
641
+ /**
642
+ * The default value. Use when the component is not controlled.
643
+ */
644
+ defaultValue: e.any,
645
+ /**
646
+ * If `true`, the component is disabled.
647
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
648
+ */
649
+ disabled: e.bool,
650
+ /**
651
+ * 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.
652
+ * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
653
+ * @default false
654
+ */
655
+ disableInjectingGlobalStyles: e.bool,
656
+ /**
657
+ * End `InputAdornment` for this component.
658
+ */
659
+ endAdornment: e.node,
660
+ /**
661
+ * If `true`, the `input` will indicate an error.
662
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
663
+ */
664
+ error: e.bool,
665
+ /**
666
+ * If `true`, the `input` will take up the full width of its container.
667
+ * @default false
668
+ */
669
+ fullWidth: e.bool,
670
+ /**
671
+ * The id of the `input` element.
672
+ */
673
+ id: e.string,
674
+ /**
675
+ * The component used for the `input` element.
676
+ * Either a string to use a HTML element or a component.
677
+ * @default 'input'
678
+ */
679
+ inputComponent: Ye,
680
+ /**
681
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
682
+ * @default {}
683
+ */
684
+ inputProps: e.object,
685
+ /**
686
+ * Pass a ref to the `input` element.
687
+ */
688
+ inputRef: Ze,
689
+ /**
690
+ * If `dense`, will adjust vertical spacing. This is normally obtained via context from
691
+ * FormControl.
692
+ * The prop defaults to the value (`'none'`) inherited from the parent FormControl component.
693
+ */
694
+ margin: e.oneOf(["dense", "none"]),
695
+ /**
696
+ * Maximum number of rows to display when multiline option is set to true.
697
+ */
698
+ maxRows: e.oneOfType([e.number, e.string]),
699
+ /**
700
+ * Minimum number of rows to display when multiline option is set to true.
701
+ */
702
+ minRows: e.oneOfType([e.number, e.string]),
703
+ /**
704
+ * If `true`, a [TextareaAutosize](/material-ui/react-textarea-autosize/) element is rendered.
705
+ * @default false
706
+ */
707
+ multiline: e.bool,
708
+ /**
709
+ * Name attribute of the `input` element.
710
+ */
711
+ name: e.string,
712
+ /**
713
+ * Callback fired when the `input` is blurred.
714
+ *
715
+ * Notice that the first argument (event) might be undefined.
716
+ */
717
+ onBlur: e.func,
718
+ /**
719
+ * Callback fired when the value is changed.
720
+ *
721
+ * @param {React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>} event The event source of the callback.
722
+ * You can pull out the new value by accessing `event.target.value` (string).
723
+ */
724
+ onChange: e.func,
725
+ /**
726
+ * @ignore
727
+ */
728
+ onClick: e.func,
729
+ /**
730
+ * @ignore
731
+ */
732
+ onFocus: e.func,
733
+ /**
734
+ * Callback fired when the `input` doesn't satisfy its constraints.
735
+ */
736
+ onInvalid: e.func,
737
+ /**
738
+ * @ignore
739
+ */
740
+ onKeyDown: e.func,
741
+ /**
742
+ * @ignore
743
+ */
744
+ onKeyUp: e.func,
745
+ /**
746
+ * The short hint displayed in the `input` before the user enters a value.
747
+ */
748
+ placeholder: e.string,
749
+ /**
750
+ * It prevents the user from changing the value of the field
751
+ * (not from interacting with the field).
752
+ */
753
+ readOnly: e.bool,
754
+ /**
755
+ * @ignore
756
+ */
757
+ renderSuffix: e.func,
758
+ /**
759
+ * If `true`, the `input` element is required.
760
+ * The prop defaults to the value (`false`) inherited from the parent FormControl component.
761
+ */
762
+ required: e.bool,
763
+ /**
764
+ * Number of rows to display when multiline option is set to true.
765
+ */
766
+ rows: e.oneOfType([e.number, e.string]),
767
+ /**
768
+ * The size of the component.
769
+ */
770
+ size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
771
+ /**
772
+ * The extra props for the slot components.
773
+ * You can override the existing props or add new ones.
774
+ *
775
+ * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
776
+ *
777
+ * @default {}
778
+ */
779
+ slotProps: e.shape({
780
+ input: e.object,
781
+ root: e.object
782
+ }),
783
+ /**
784
+ * The components used for each slot inside.
785
+ *
786
+ * This prop is an alias for the `components` prop, which will be deprecated in the future.
787
+ *
788
+ * @default {}
789
+ */
790
+ slots: e.shape({
791
+ input: e.elementType,
792
+ root: e.elementType
793
+ }),
794
+ /**
795
+ * Start `InputAdornment` for this component.
796
+ */
797
+ startAdornment: e.node,
798
+ /**
799
+ * The system prop that allows defining system overrides as well as additional CSS styles.
800
+ */
801
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
802
+ /**
803
+ * 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).
804
+ * @default 'text'
805
+ */
806
+ type: e.string,
807
+ /**
808
+ * The value of the `input` element, required for a controlled component.
809
+ */
810
+ value: e.any
811
+ });
812
+ function mo(o) {
813
+ return re("MuiFormLabel", o);
814
+ }
815
+ const H = ee("MuiFormLabel", ["root", "colorSecondary", "focused", "disabled", "error", "filled", "required", "asterisk"]), bo = ["children", "className", "color", "component", "disabled", "error", "filled", "focused", "required"], ho = (o) => {
816
+ const {
817
+ classes: n,
818
+ color: r,
819
+ focused: t,
820
+ disabled: s,
821
+ error: u,
822
+ filled: h,
823
+ required: g
824
+ } = o, p = {
825
+ root: ["root", `color${K(r)}`, s && "disabled", u && "error", h && "filled", t && "focused", g && "required"],
826
+ asterisk: ["asterisk", u && "error"]
827
+ };
828
+ return ne(p, mo, n);
829
+ }, yo = _("label", {
830
+ name: "MuiFormLabel",
831
+ slot: "Root",
832
+ overridesResolver: ({
833
+ ownerState: o
834
+ }, n) => a({}, n.root, o.color === "secondary" && n.colorSecondary, o.filled && n.filled)
835
+ })(({
836
+ theme: o,
837
+ ownerState: n
838
+ }) => a({
839
+ color: (o.vars || o).palette.text.secondary
840
+ }, o.typography.body1, {
841
+ lineHeight: "1.4375em",
842
+ padding: 0,
843
+ position: "relative",
844
+ [`&.${H.focused}`]: {
845
+ color: (o.vars || o).palette[n.color].main
846
+ },
847
+ [`&.${H.disabled}`]: {
848
+ color: (o.vars || o).palette.text.disabled
849
+ },
850
+ [`&.${H.error}`]: {
851
+ color: (o.vars || o).palette.error.main
852
+ }
853
+ })), go = _("span", {
854
+ name: "MuiFormLabel",
855
+ slot: "Asterisk",
856
+ overridesResolver: (o, n) => n.asterisk
857
+ })(({
858
+ theme: o
859
+ }) => ({
860
+ [`&.${H.error}`]: {
861
+ color: (o.vars || o).palette.error.main
862
+ }
863
+ })), We = /* @__PURE__ */ i.forwardRef(function(n, r) {
864
+ const t = oe({
865
+ props: n,
866
+ name: "MuiFormLabel"
867
+ }), {
868
+ children: s,
869
+ className: u,
870
+ component: h = "label"
871
+ } = t, g = G(t, bo), p = fe(), l = me({
872
+ props: t,
873
+ muiFormControl: p,
874
+ states: ["color", "required", "focused", "disabled", "error", "filled"]
875
+ }), b = a({}, t, {
876
+ color: l.color || "primary",
877
+ component: h,
878
+ disabled: l.disabled,
879
+ error: l.error,
880
+ filled: l.filled,
881
+ focused: l.focused,
882
+ required: l.required
883
+ }), C = ho(b);
884
+ return /* @__PURE__ */ U(yo, a({
885
+ as: h,
886
+ ownerState: b,
887
+ className: V(C.root, u),
888
+ ref: r
889
+ }, g, {
890
+ children: [s, l.required && /* @__PURE__ */ U(go, {
891
+ ownerState: b,
892
+ "aria-hidden": !0,
893
+ className: C.asterisk,
894
+ children: [" ", "*"]
895
+ })]
896
+ }));
897
+ });
898
+ process.env.NODE_ENV !== "production" && (We.propTypes = {
899
+ // ----------------------------- Warning --------------------------------
900
+ // | These PropTypes are generated from the TypeScript type definitions |
901
+ // | To update them edit the d.ts file and run "yarn proptypes" |
902
+ // ----------------------------------------------------------------------
903
+ /**
904
+ * The content of the component.
905
+ */
906
+ children: e.node,
907
+ /**
908
+ * Override or extend the styles applied to the component.
909
+ */
910
+ classes: e.object,
911
+ /**
912
+ * @ignore
913
+ */
914
+ className: e.string,
915
+ /**
916
+ * The color of the component.
917
+ * It supports both default and custom theme colors, which can be added as shown in the
918
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
919
+ */
920
+ color: e.oneOfType([e.oneOf(["error", "info", "primary", "secondary", "success", "warning"]), e.string]),
921
+ /**
922
+ * The component used for the root node.
923
+ * Either a string to use a HTML element or a component.
924
+ */
925
+ component: e.elementType,
926
+ /**
927
+ * If `true`, the label should be displayed in a disabled state.
928
+ */
929
+ disabled: e.bool,
930
+ /**
931
+ * If `true`, the label is displayed in an error state.
932
+ */
933
+ error: e.bool,
934
+ /**
935
+ * If `true`, the label should use filled classes key.
936
+ */
937
+ filled: e.bool,
938
+ /**
939
+ * If `true`, the input of this label is focused (used by `FormGroup` components).
940
+ */
941
+ focused: e.bool,
942
+ /**
943
+ * If `true`, the label will indicate that the `input` is required.
944
+ */
945
+ required: e.bool,
946
+ /**
947
+ * The system prop that allows defining system overrides as well as additional CSS styles.
948
+ */
949
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
950
+ });
951
+ function vo(o) {
952
+ return re("MuiInputLabel", o);
953
+ }
954
+ ee("MuiInputLabel", ["root", "focused", "disabled", "error", "required", "asterisk", "formControl", "sizeSmall", "shrink", "animated", "standard", "filled", "outlined"]);
955
+ const xo = ["disableAnimation", "margin", "shrink", "variant", "className"], Co = (o) => {
956
+ const {
957
+ classes: n,
958
+ formControl: r,
959
+ size: t,
960
+ shrink: s,
961
+ disableAnimation: u,
962
+ variant: h,
963
+ required: g
964
+ } = o, l = ne({
965
+ root: ["root", r && "formControl", !u && "animated", s && "shrink", t === "small" && "sizeSmall", h],
966
+ asterisk: [g && "asterisk"]
967
+ }, vo, n);
968
+ return a({}, n, l);
969
+ }, So = _(We, {
970
+ shouldForwardProp: (o) => Ke(o) || o === "classes",
971
+ name: "MuiInputLabel",
972
+ slot: "Root",
973
+ overridesResolver: (o, n) => {
974
+ const {
975
+ ownerState: r
976
+ } = o;
977
+ return [{
978
+ [`& .${H.asterisk}`]: n.asterisk
979
+ }, n.root, r.formControl && n.formControl, r.size === "small" && n.sizeSmall, r.shrink && n.shrink, !r.disableAnimation && n.animated, n[r.variant]];
980
+ }
981
+ })(({
982
+ theme: o,
983
+ ownerState: n
984
+ }) => a({
985
+ display: "block",
986
+ transformOrigin: "top left",
987
+ whiteSpace: "nowrap",
988
+ overflow: "hidden",
989
+ textOverflow: "ellipsis",
990
+ maxWidth: "100%"
991
+ }, n.formControl && {
992
+ position: "absolute",
993
+ left: 0,
994
+ top: 0,
995
+ // slight alteration to spec spacing to match visual spec result
996
+ transform: "translate(0, 20px) scale(1)"
997
+ }, n.size === "small" && {
998
+ // Compensation for the `Input.inputSizeSmall` style.
999
+ transform: "translate(0, 17px) scale(1)"
1000
+ }, n.shrink && {
1001
+ transform: "translate(0, -1.5px) scale(0.75)",
1002
+ transformOrigin: "top left",
1003
+ maxWidth: "133%"
1004
+ }, !n.disableAnimation && {
1005
+ transition: o.transitions.create(["color", "transform", "max-width"], {
1006
+ duration: o.transitions.duration.shorter,
1007
+ easing: o.transitions.easing.easeOut
1008
+ })
1009
+ }, n.variant === "filled" && a({
1010
+ // Chrome's autofill feature gives the input field a yellow background.
1011
+ // Since the input field is behind the label in the HTML tree,
1012
+ // the input field is drawn last and hides the label with an opaque background color.
1013
+ // zIndex: 1 will raise the label above opaque background-colors of input.
1014
+ zIndex: 1,
1015
+ pointerEvents: "none",
1016
+ transform: "translate(12px, 16px) scale(1)",
1017
+ maxWidth: "calc(100% - 24px)"
1018
+ }, n.size === "small" && {
1019
+ transform: "translate(12px, 13px) scale(1)"
1020
+ }, n.shrink && a({
1021
+ userSelect: "none",
1022
+ pointerEvents: "auto",
1023
+ transform: "translate(12px, 7px) scale(0.75)",
1024
+ maxWidth: "calc(133% - 24px)"
1025
+ }, n.size === "small" && {
1026
+ transform: "translate(12px, 4px) scale(0.75)"
1027
+ })), n.variant === "outlined" && a({
1028
+ // see comment above on filled.zIndex
1029
+ zIndex: 1,
1030
+ pointerEvents: "none",
1031
+ transform: "translate(14px, 16px) scale(1)",
1032
+ maxWidth: "calc(100% - 24px)"
1033
+ }, n.size === "small" && {
1034
+ transform: "translate(14px, 9px) scale(1)"
1035
+ }, n.shrink && {
1036
+ userSelect: "none",
1037
+ pointerEvents: "auto",
1038
+ // Theoretically, we should have (8+5)*2/0.75 = 34px
1039
+ // but it feels a better when it bleeds a bit on the left, so 32px.
1040
+ maxWidth: "calc(133% - 32px)",
1041
+ transform: "translate(14px, -9px) scale(0.75)"
1042
+ }))), wo = /* @__PURE__ */ i.forwardRef(function(n, r) {
1043
+ const t = oe({
1044
+ name: "MuiInputLabel",
1045
+ props: n
1046
+ }), {
1047
+ disableAnimation: s = !1,
1048
+ shrink: u,
1049
+ className: h
1050
+ } = t, g = G(t, xo), p = fe();
1051
+ let l = u;
1052
+ typeof l > "u" && p && (l = p.filled || p.focused || p.adornedStart);
1053
+ const b = me({
1054
+ props: t,
1055
+ muiFormControl: p,
1056
+ states: ["size", "variant", "required"]
1057
+ }), C = a({}, t, {
1058
+ disableAnimation: s,
1059
+ formControl: p,
1060
+ shrink: l,
1061
+ size: b.size,
1062
+ variant: b.variant,
1063
+ required: b.required
1064
+ }), w = Co(C);
1065
+ return /* @__PURE__ */ N(So, a({
1066
+ "data-shrink": l,
1067
+ ownerState: C,
1068
+ ref: r,
1069
+ className: V(w.root, h)
1070
+ }, g, {
1071
+ classes: w
1072
+ }));
1073
+ });
1074
+ process.env.NODE_ENV !== "production" && (wo.propTypes = {
1075
+ // ----------------------------- Warning --------------------------------
1076
+ // | These PropTypes are generated from the TypeScript type definitions |
1077
+ // | To update them edit the d.ts file and run "yarn proptypes" |
1078
+ // ----------------------------------------------------------------------
1079
+ /**
1080
+ * The content of the component.
1081
+ */
1082
+ children: e.node,
1083
+ /**
1084
+ * Override or extend the styles applied to the component.
1085
+ */
1086
+ classes: e.object,
1087
+ /**
1088
+ * @ignore
1089
+ */
1090
+ className: e.string,
1091
+ /**
1092
+ * The color of the component.
1093
+ * It supports both default and custom theme colors, which can be added as shown in the
1094
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
1095
+ */
1096
+ color: e.oneOfType([e.oneOf(["error", "info", "primary", "secondary", "success", "warning"]), e.string]),
1097
+ /**
1098
+ * If `true`, the transition animation is disabled.
1099
+ * @default false
1100
+ */
1101
+ disableAnimation: e.bool,
1102
+ /**
1103
+ * If `true`, the component is disabled.
1104
+ */
1105
+ disabled: e.bool,
1106
+ /**
1107
+ * If `true`, the label is displayed in an error state.
1108
+ */
1109
+ error: e.bool,
1110
+ /**
1111
+ * If `true`, the `input` of this label is focused.
1112
+ */
1113
+ focused: e.bool,
1114
+ /**
1115
+ * If `dense`, will adjust vertical spacing. This is normally obtained via context from
1116
+ * FormControl.
1117
+ */
1118
+ margin: e.oneOf(["dense"]),
1119
+ /**
1120
+ * if `true`, the label will indicate that the `input` is required.
1121
+ */
1122
+ required: e.bool,
1123
+ /**
1124
+ * If `true`, the label is shrunk.
1125
+ */
1126
+ shrink: e.bool,
1127
+ /**
1128
+ * The size of the component.
1129
+ * @default 'normal'
1130
+ */
1131
+ size: e.oneOfType([e.oneOf(["normal", "small"]), e.string]),
1132
+ /**
1133
+ * The system prop that allows defining system overrides as well as additional CSS styles.
1134
+ */
1135
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1136
+ /**
1137
+ * The variant to use.
1138
+ */
1139
+ variant: e.oneOf(["filled", "outlined", "standard"])
1140
+ });
1141
+ function Oo(o) {
1142
+ return re("MuiFormControl", o);
1143
+ }
1144
+ ee("MuiFormControl", ["root", "marginNone", "marginNormal", "marginDense", "fullWidth", "disabled"]);
1145
+ const To = ["children", "className", "color", "component", "disabled", "error", "focused", "fullWidth", "hiddenLabel", "margin", "required", "size", "variant"], Ro = (o) => {
1146
+ const {
1147
+ classes: n,
1148
+ margin: r,
1149
+ fullWidth: t
1150
+ } = o, s = {
1151
+ root: ["root", r !== "none" && `margin${K(r)}`, t && "fullWidth"]
1152
+ };
1153
+ return ne(s, Oo, n);
1154
+ }, Eo = _("div", {
1155
+ name: "MuiFormControl",
1156
+ slot: "Root",
1157
+ overridesResolver: ({
1158
+ ownerState: o
1159
+ }, n) => a({}, n.root, n[`margin${K(o.margin)}`], o.fullWidth && n.fullWidth)
1160
+ })(({
1161
+ ownerState: o
1162
+ }) => a({
1163
+ display: "inline-flex",
1164
+ flexDirection: "column",
1165
+ position: "relative",
1166
+ // Reset fieldset default style.
1167
+ minWidth: 0,
1168
+ padding: 0,
1169
+ margin: 0,
1170
+ border: 0,
1171
+ verticalAlign: "top"
1172
+ }, o.margin === "normal" && {
1173
+ marginTop: 16,
1174
+ marginBottom: 8
1175
+ }, o.margin === "dense" && {
1176
+ marginTop: 8,
1177
+ marginBottom: 4
1178
+ }, o.fullWidth && {
1179
+ width: "100%"
1180
+ })), No = /* @__PURE__ */ i.forwardRef(function(n, r) {
1181
+ const t = oe({
1182
+ props: n,
1183
+ name: "MuiFormControl"
1184
+ }), {
1185
+ children: s,
1186
+ className: u,
1187
+ color: h = "primary",
1188
+ component: g = "div",
1189
+ disabled: p = !1,
1190
+ error: l = !1,
1191
+ focused: b,
1192
+ fullWidth: C = !1,
1193
+ hiddenLabel: w = !1,
1194
+ margin: T = "none",
1195
+ required: E = !1,
1196
+ size: k = "medium",
1197
+ variant: F = "outlined"
1198
+ } = t, B = G(t, To), S = a({}, t, {
1199
+ color: h,
1200
+ component: g,
1201
+ disabled: p,
1202
+ error: l,
1203
+ fullWidth: C,
1204
+ hiddenLabel: w,
1205
+ margin: T,
1206
+ required: E,
1207
+ size: k,
1208
+ variant: F
1209
+ }), j = Ro(S), [W, d] = i.useState(() => {
1210
+ let O = !1;
1211
+ return s && i.Children.forEach(s, (v) => {
1212
+ if (!ce(v, ["Input", "Select"]))
1213
+ return;
1214
+ const M = ce(v, ["Select"]) ? v.props.input : v;
1215
+ M && ro(M.props) && (O = !0);
1216
+ }), O;
1217
+ }), [x, y] = i.useState(() => {
1218
+ let O = !1;
1219
+ return s && i.Children.forEach(s, (v) => {
1220
+ ce(v, ["Input", "Select"]) && Me(v.props, !0) && (O = !0);
1221
+ }), O;
1222
+ }), [f, I] = i.useState(!1);
1223
+ p && f && I(!1);
1224
+ const L = b !== void 0 && !p ? b : f;
1225
+ let A;
1226
+ if (process.env.NODE_ENV !== "production") {
1227
+ const O = i.useRef(!1);
1228
+ A = () => (O.current && console.error(["MUI: There are multiple `InputBase` components inside a FormControl.", "This creates visual inconsistencies, only use one `InputBase`."].join(`
1229
+ `)), O.current = !0, () => {
1230
+ O.current = !1;
1231
+ });
1232
+ }
1233
+ const P = i.useMemo(() => ({
1234
+ adornedStart: W,
1235
+ setAdornedStart: d,
1236
+ color: h,
1237
+ disabled: p,
1238
+ error: l,
1239
+ filled: x,
1240
+ focused: L,
1241
+ fullWidth: C,
1242
+ hiddenLabel: w,
1243
+ size: k,
1244
+ onBlur: () => {
1245
+ I(!1);
1246
+ },
1247
+ onEmpty: () => {
1248
+ y(!1);
1249
+ },
1250
+ onFilled: () => {
1251
+ y(!0);
1252
+ },
1253
+ onFocus: () => {
1254
+ I(!0);
1255
+ },
1256
+ registerEffect: A,
1257
+ required: E,
1258
+ variant: F
1259
+ }), [W, h, p, l, x, L, C, w, A, E, k, F]);
1260
+ return /* @__PURE__ */ N(Ee.Provider, {
1261
+ value: P,
1262
+ children: /* @__PURE__ */ N(Eo, a({
1263
+ as: g,
1264
+ ownerState: S,
1265
+ className: V(j.root, u),
1266
+ ref: r
1267
+ }, B, {
1268
+ children: s
1269
+ }))
1270
+ });
1271
+ });
1272
+ process.env.NODE_ENV !== "production" && (No.propTypes = {
1273
+ // ----------------------------- Warning --------------------------------
1274
+ // | These PropTypes are generated from the TypeScript type definitions |
1275
+ // | To update them edit the d.ts file and run "yarn proptypes" |
1276
+ // ----------------------------------------------------------------------
1277
+ /**
1278
+ * The content of the component.
1279
+ */
1280
+ children: e.node,
1281
+ /**
1282
+ * Override or extend the styles applied to the component.
1283
+ */
1284
+ classes: e.object,
1285
+ /**
1286
+ * @ignore
1287
+ */
1288
+ className: e.string,
1289
+ /**
1290
+ * The color of the component.
1291
+ * It supports both default and custom theme colors, which can be added as shown in the
1292
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
1293
+ * @default 'primary'
1294
+ */
1295
+ color: e.oneOfType([e.oneOf(["primary", "secondary", "error", "info", "success", "warning"]), e.string]),
1296
+ /**
1297
+ * The component used for the root node.
1298
+ * Either a string to use a HTML element or a component.
1299
+ */
1300
+ component: e.elementType,
1301
+ /**
1302
+ * If `true`, the label, input and helper text should be displayed in a disabled state.
1303
+ * @default false
1304
+ */
1305
+ disabled: e.bool,
1306
+ /**
1307
+ * If `true`, the label is displayed in an error state.
1308
+ * @default false
1309
+ */
1310
+ error: e.bool,
1311
+ /**
1312
+ * If `true`, the component is displayed in focused state.
1313
+ */
1314
+ focused: e.bool,
1315
+ /**
1316
+ * If `true`, the component will take up the full width of its container.
1317
+ * @default false
1318
+ */
1319
+ fullWidth: e.bool,
1320
+ /**
1321
+ * If `true`, the label is hidden.
1322
+ * This is used to increase density for a `FilledInput`.
1323
+ * Be sure to add `aria-label` to the `input` element.
1324
+ * @default false
1325
+ */
1326
+ hiddenLabel: e.bool,
1327
+ /**
1328
+ * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
1329
+ * @default 'none'
1330
+ */
1331
+ margin: e.oneOf(["dense", "none", "normal"]),
1332
+ /**
1333
+ * If `true`, the label will indicate that the `input` is required.
1334
+ * @default false
1335
+ */
1336
+ required: e.bool,
1337
+ /**
1338
+ * The size of the component.
1339
+ * @default 'medium'
1340
+ */
1341
+ size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
1342
+ /**
1343
+ * The system prop that allows defining system overrides as well as additional CSS styles.
1344
+ */
1345
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1346
+ /**
1347
+ * The variant to use.
1348
+ * @default 'outlined'
1349
+ */
1350
+ variant: e.oneOf(["filled", "outlined", "standard"])
1351
+ });
1352
+ export {
1353
+ No as F,
1354
+ wo as I,
1355
+ uo as a,
1356
+ co as b,
1357
+ ao as c,
1358
+ fo as d,
1359
+ Me as e,
1360
+ me as f,
1361
+ pe as i,
1362
+ io as r
1363
+ };