@loopr-ai/craft 0.8.2 → 0.9.0

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 (53) hide show
  1. package/dist/Box-96e795c4.js +58 -0
  2. package/dist/{ButtonBase-08b16b61.js → ButtonBase-46c20f20.js} +3 -3
  3. package/dist/{TextField-f61d210a.js → TextField-df89b641.js} +373 -387
  4. package/dist/{TransitionGroupContext-0e899f4c.js → TransitionGroupContext-21923db7.js} +1 -1
  5. package/dist/ZoomControllers-657c8b74.js +3383 -0
  6. package/dist/components/cell/AvatarGroup/index.js +3 -3
  7. package/dist/components/cell/Button/index.js +3 -3
  8. package/dist/components/cell/Chip/index.js +5 -5
  9. package/dist/components/cell/ProgressBar/index.js +3 -3
  10. package/dist/components/cell/Search/index.js +2 -2
  11. package/dist/components/cell/Typography/index.js +1 -1
  12. package/dist/components/organ/Form/ErrorMessage/ErrorMessage.styles.d.ts +14 -0
  13. package/dist/components/organ/Form/ErrorMessage/ErrorMessage.styles.js +16 -0
  14. package/dist/components/organ/Form/ErrorMessage/index.d.ts +6 -0
  15. package/dist/components/organ/Form/ErrorMessage/index.js +14 -0
  16. package/dist/components/organ/Form/Form.interfaces.d.ts +4 -2
  17. package/dist/components/organ/Form/Form.styles.d.ts +6 -99
  18. package/dist/components/organ/Form/Form.styles.js +8 -102
  19. package/dist/components/organ/Form/FormInput.js +54 -1524
  20. package/dist/components/organ/Form/Label/Label.styles.d.ts +14 -0
  21. package/dist/components/organ/Form/Label/Label.styles.js +16 -0
  22. package/dist/components/organ/Form/Label/index.d.ts +10 -0
  23. package/dist/components/organ/Form/Label/index.js +17 -0
  24. package/dist/components/organ/Form/RadioInput/RadioInput.styles.d.ts +17 -0
  25. package/dist/components/organ/Form/RadioInput/RadioInput.styles.js +20 -0
  26. package/dist/components/organ/Form/RadioInput/index.d.ts +16 -0
  27. package/dist/components/organ/Form/RadioInput/index.js +1053 -0
  28. package/dist/components/organ/Form/TextfieldInput/TextfieldInput.styles.d.ts +75 -0
  29. package/dist/components/organ/Form/TextfieldInput/TextfieldInput.styles.js +66 -0
  30. package/dist/components/organ/Form/TextfieldInput/index.d.ts +23 -0
  31. package/dist/components/organ/Form/TextfieldInput/index.js +525 -0
  32. package/dist/components/organ/Form/index.js +136 -148
  33. package/dist/components/organ/ZoomControlWithDrag/ZoomControllers.js +2 -2
  34. package/dist/components/organ/ZoomControlWithDrag/index.js +29 -35
  35. package/dist/{createSvgIcon-45340b5e.js → createSvgIcon-59e7bc15.js} +3195 -3245
  36. package/dist/{createSvgIcon-5aac746d.js → createSvgIcon-b444ce70.js} +5 -5
  37. package/dist/{createTheme-759a022d.js → createTheme-d2329909.js} +4 -4
  38. package/dist/dividerClasses-9354a5c9.js +10 -0
  39. package/dist/{exactProp-23d6a154.js → exactProp-3ee21234.js} +1 -1
  40. package/dist/{extendSxProp-cf8fd923.js → extendSxProp-f6cb682b.js} +1 -1
  41. package/dist/global/colors.d.ts +1 -0
  42. package/dist/global/colors.js +5 -4
  43. package/dist/global/theme.js +1 -1
  44. package/dist/{index-c9c32237.js → index-ae3eb123.js} +8 -8
  45. package/dist/main.js +1 -1
  46. package/dist/providers/CraftThemeProvider.js +2 -2
  47. package/dist/{styled-78608e1f.js → styled-8f7db30d.js} +39 -39
  48. package/dist/useControlled-4e337b2f.js +54 -0
  49. package/dist/useFormControl-b25c5813.js +19 -0
  50. package/dist/{useTheme-8906bd79.js → useTheme-21caf71b.js} +1 -1
  51. package/package.json +1 -1
  52. package/dist/Tooltip-e797a425.js +0 -2022
  53. package/dist/ZoomControllers-d04c25f8.js +0 -1432
@@ -1,1530 +1,60 @@
1
- import ze, { jsx as c, jsxs as j, Fragment as Be } from "react/jsx-runtime";
2
- import { u as ge, c as Ve, a as Ue, r as _e, i as Ge } from "../../../createSvgIcon-45340b5e.js";
3
- import * as x from "react";
4
- import { useState as qe, useCallback as Qe, useEffect as We } from "react";
5
- import { customColors as K } from "../../../global/colors.js";
6
- import { M as X, T as V } from "../../../index-c9c32237.js";
7
- import O from "./Form.styles.js";
8
- import { d as te, B as L, T as Ze } from "../../../Tooltip-e797a425.js";
9
- import { P as e, h as He, a as f, j as se, r as J, k as Ye, m as Ke, n as Je, _ as D, o as ne, g as U, c as w, e as W } from "../../../createTheme-759a022d.js";
10
- import { r as A, c as Xe, u as ye } from "../../../TransitionGroupContext-0e899f4c.js";
11
- import { h as Ae, i as eo, c as E, b as _, g as z, s as P, a as G, r as ve } from "../../../styled-78608e1f.js";
12
- import { u as H, f as he, F as oo, L as le, T as ro } from "../../../TextField-f61d210a.js";
13
- import { e as ao } from "../../../extendSxProp-cf8fd923.js";
14
- import { B as Ce } from "../../../ButtonBase-08b16b61.js";
15
- import { c as xe } from "../../../createSvgIcon-5aac746d.js";
16
- const to = Ae(), so = to, no = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"], lo = He(), co = so("div", {
17
- name: "MuiStack",
18
- slot: "Root",
19
- overridesResolver: (o, r) => r.root
20
- });
21
- function io(o) {
22
- return eo({
23
- props: o,
24
- name: "MuiStack",
25
- defaultTheme: lo
26
- });
27
- }
28
- function uo(o, r) {
29
- const t = x.Children.toArray(o).filter(Boolean);
30
- return t.reduce((s, n, l) => (s.push(n), l < t.length - 1 && s.push(/* @__PURE__ */ x.cloneElement(r, {
31
- key: `separator-${l}`
32
- })), s), []);
33
- }
34
- const po = (o) => ({
35
- row: "Left",
36
- "row-reverse": "Right",
37
- column: "Top",
38
- "column-reverse": "Bottom"
39
- })[o], fo = ({
40
- ownerState: o,
41
- theme: r
42
- }) => {
43
- let t = f({
44
- display: "flex",
45
- flexDirection: "column"
46
- }, se({
47
- theme: r
48
- }, J({
49
- values: o.direction,
50
- breakpoints: r.breakpoints.values
51
- }), (s) => ({
52
- flexDirection: s
53
- })));
54
- if (o.spacing) {
55
- const s = Ye(r), n = Object.keys(r.breakpoints.values).reduce((i, d) => ((typeof o.spacing == "object" && o.spacing[d] != null || typeof o.direction == "object" && o.direction[d] != null) && (i[d] = !0), i), {}), l = J({
56
- values: o.direction,
57
- base: n
58
- }), p = J({
59
- values: o.spacing,
60
- base: n
61
- });
62
- typeof l == "object" && Object.keys(l).forEach((i, d, g) => {
63
- if (!l[i]) {
64
- const m = d > 0 ? l[g[d - 1]] : "column";
65
- l[i] = m;
66
- }
67
- }), t = Ke(t, se({
68
- theme: r
69
- }, p, (i, d) => o.useFlexGap ? {
70
- gap: ne(s, i)
71
- } : {
72
- // The useFlexGap={false} implement relies on each child to give up control of the margin.
73
- // We need to reset the margin to avoid double spacing.
74
- "& > :not(style):not(style)": {
75
- margin: 0
76
- },
77
- "& > :not(style) ~ :not(style)": {
78
- [`margin${po(d ? l[d] : o.direction)}`]: ne(s, i)
79
- }
80
- }));
81
- }
82
- return t = Je(r.breakpoints, t), t;
83
- };
84
- function bo(o = {}) {
85
- const {
86
- // This will allow adding custom styled fn (for example for custom sx style function)
87
- createStyledComponent: r = co,
88
- useThemeProps: t = io,
89
- componentName: s = "MuiStack"
90
- } = o, n = () => _({
91
- root: ["root"]
92
- }, (i) => U(s, i), {}), l = r(fo), p = /* @__PURE__ */ x.forwardRef(function(i, d) {
93
- const g = t(i), h = ao(g), {
94
- component: m = "div",
95
- direction: I = "column",
96
- spacing: a = 0,
97
- divider: v,
98
- children: b,
99
- className: M,
100
- useFlexGap: N = !1
101
- } = h, T = D(h, no), k = {
102
- direction: I,
103
- spacing: a,
104
- useFlexGap: N
105
- }, u = n();
106
- return /* @__PURE__ */ c(l, f({
107
- as: m,
108
- ownerState: k,
109
- ref: d,
110
- className: E(u.root, M)
111
- }, T, {
112
- children: v ? uo(b, v) : b
113
- }));
114
- });
115
- return process.env.NODE_ENV !== "production" && (p.propTypes = {
116
- children: e.node,
117
- direction: e.oneOfType([e.oneOf(["column-reverse", "column", "row-reverse", "row"]), e.arrayOf(e.oneOf(["column-reverse", "column", "row-reverse", "row"])), e.object]),
118
- divider: e.node,
119
- spacing: e.oneOfType([e.arrayOf(e.oneOfType([e.number, e.string])), e.number, e.object, e.string]),
120
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
121
- }), p;
122
- }
123
- function mo(o) {
124
- return U("PrivateSwitchBase", o);
125
- }
126
- z("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
127
- const go = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"], yo = (o) => {
128
- const {
129
- classes: r,
130
- checked: t,
131
- disabled: s,
132
- edge: n
133
- } = o, l = {
134
- root: ["root", t && "checked", s && "disabled", n && `edge${w(n)}`],
135
- input: ["input"]
136
- };
137
- return _(l, mo, r);
138
- }, vo = P(Ce)(({
139
- ownerState: o
140
- }) => f({
141
- padding: 9,
142
- borderRadius: "50%"
143
- }, o.edge === "start" && {
144
- marginLeft: o.size === "small" ? -3 : -12
145
- }, o.edge === "end" && {
146
- marginRight: o.size === "small" ? -3 : -12
147
- })), ho = P("input")({
148
- cursor: "inherit",
149
- position: "absolute",
150
- opacity: 0,
151
- width: "100%",
152
- height: "100%",
153
- top: 0,
154
- left: 0,
155
- margin: 0,
156
- padding: 0,
157
- zIndex: 1
158
- }), Ie = /* @__PURE__ */ x.forwardRef(function(r, t) {
159
- const {
160
- autoFocus: s,
161
- checked: n,
162
- checkedIcon: l,
163
- className: p,
164
- defaultChecked: y,
165
- disabled: i,
166
- disableFocusRipple: d = !1,
167
- edge: g = !1,
168
- icon: h,
169
- id: m,
170
- inputProps: I,
171
- inputRef: a,
172
- name: v,
173
- onBlur: b,
174
- onChange: M,
175
- onFocus: N,
176
- readOnly: T,
177
- required: k = !1,
178
- tabIndex: u,
179
- type: C,
180
- value: R
181
- } = r, $ = D(r, go), [B, Le] = ge({
182
- controlled: n,
183
- default: !!y,
184
- name: "SwitchBase",
185
- state: "checked"
186
- }), F = H(), we = (S) => {
187
- N && N(S), F && F.onFocus && F.onFocus(S);
188
- }, Ee = (S) => {
189
- b && b(S), F && F.onBlur && F.onBlur(S);
190
- }, Fe = (S) => {
191
- if (S.nativeEvent.defaultPrevented)
192
- return;
193
- const ae = S.target.checked;
194
- Le(ae), M && M(S, ae);
195
- };
196
- let q = i;
197
- F && typeof q > "u" && (q = F.disabled);
198
- const De = C === "checkbox" || C === "radio", Y = f({}, r, {
199
- checked: B,
200
- disabled: q,
201
- disableFocusRipple: d,
202
- edge: g
203
- }), re = yo(Y);
204
- return /* @__PURE__ */ j(vo, f({
205
- component: "span",
206
- className: E(re.root, p),
207
- centerRipple: !0,
208
- focusRipple: !d,
209
- disabled: q,
210
- tabIndex: null,
211
- role: void 0,
212
- onFocus: we,
213
- onBlur: Ee,
214
- ownerState: Y,
215
- ref: t
216
- }, $, {
217
- children: [/* @__PURE__ */ c(ho, f({
218
- autoFocus: s,
219
- checked: n,
220
- defaultChecked: y,
221
- className: re.input,
222
- disabled: q,
223
- id: De ? m : void 0,
224
- name: v,
225
- onChange: Fe,
226
- readOnly: T,
227
- ref: a,
228
- required: k,
229
- ownerState: Y,
230
- tabIndex: u,
231
- type: C
232
- }, C === "checkbox" && R === void 0 ? {} : {
233
- value: R
234
- }, I)), B ? l : h]
235
- }));
236
- });
237
- process.env.NODE_ENV !== "production" && (Ie.propTypes = {
238
- /**
239
- * If `true`, the `input` element is focused during the first mount.
240
- */
241
- autoFocus: e.bool,
242
- /**
243
- * If `true`, the component is checked.
244
- */
245
- checked: e.bool,
246
- /**
247
- * The icon to display when the component is checked.
248
- */
249
- checkedIcon: e.node.isRequired,
250
- /**
251
- * Override or extend the styles applied to the component.
252
- * See [CSS API](#css) below for more details.
253
- */
254
- classes: e.object,
255
- /**
256
- * @ignore
257
- */
258
- className: e.string,
259
- /**
260
- * @ignore
261
- */
262
- defaultChecked: e.bool,
263
- /**
264
- * If `true`, the component is disabled.
265
- */
266
- disabled: e.bool,
267
- /**
268
- * If `true`, the keyboard focus ripple is disabled.
269
- * @default false
270
- */
271
- disableFocusRipple: e.bool,
272
- /**
273
- * If given, uses a negative margin to counteract the padding on one
274
- * side (this is often helpful for aligning the left or right
275
- * side of the icon with content above or below, without ruining the border
276
- * size and shape).
277
- * @default false
278
- */
279
- edge: e.oneOf(["end", "start", !1]),
280
- /**
281
- * The icon to display when the component is unchecked.
282
- */
283
- icon: e.node.isRequired,
284
- /**
285
- * The id of the `input` element.
286
- */
287
- id: e.string,
288
- /**
289
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
290
- */
291
- inputProps: e.object,
292
- /**
293
- * Pass a ref to the `input` element.
294
- */
295
- inputRef: A,
296
- /*
297
- * @ignore
298
- */
299
- name: e.string,
300
- /**
301
- * @ignore
302
- */
303
- onBlur: e.func,
304
- /**
305
- * Callback fired when the state is changed.
306
- *
307
- * @param {object} event The event source of the callback.
308
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
309
- */
310
- onChange: e.func,
311
- /**
312
- * @ignore
313
- */
314
- onFocus: e.func,
315
- /**
316
- * It prevents the user from changing the value of the field
317
- * (not from interacting with the field).
318
- */
319
- readOnly: e.bool,
320
- /**
321
- * If `true`, the `input` element is required.
322
- */
323
- required: e.bool,
324
- /**
325
- * The system prop that allows defining system overrides as well as additional CSS styles.
326
- */
327
- sx: e.object,
328
- /**
329
- * @ignore
330
- */
331
- tabIndex: e.oneOfType([e.number, e.string]),
332
- /**
333
- * The input component prop `type`.
334
- */
335
- type: e.string.isRequired,
336
- /**
337
- * The value of the component.
338
- */
339
- value: e.any
340
- });
341
- const Co = Ie, Me = bo({
342
- createStyledComponent: P("div", {
343
- name: "MuiStack",
344
- slot: "Root",
345
- overridesResolver: (o, r) => r.root
346
- }),
347
- useThemeProps: (o) => G({
348
- props: o,
349
- name: "MuiStack"
350
- })
351
- });
352
- process.env.NODE_ENV !== "production" && (Me.propTypes = {
353
- // ----------------------------- Warning --------------------------------
354
- // | These PropTypes are generated from the TypeScript type definitions |
355
- // | To update them edit the d.ts file and run "yarn proptypes" |
356
- // ----------------------------------------------------------------------
357
- /**
358
- * The content of the component.
359
- */
360
- children: e.node,
361
- /**
362
- * The component used for the root node.
363
- * Either a string to use a HTML element or a component.
364
- */
365
- component: e.elementType,
366
- /**
367
- * Defines the `flex-direction` style property.
368
- * It is applied for all screen sizes.
369
- * @default 'column'
370
- */
371
- direction: e.oneOfType([e.oneOf(["column-reverse", "column", "row-reverse", "row"]), e.arrayOf(e.oneOf(["column-reverse", "column", "row-reverse", "row"])), e.object]),
372
- /**
373
- * Add an element between each child.
374
- */
375
- divider: e.node,
376
- /**
377
- * Defines the space between immediate children.
378
- * @default 0
379
- */
380
- spacing: e.oneOfType([e.arrayOf(e.oneOfType([e.number, e.string])), e.number, e.object, e.string]),
381
- /**
382
- * The system prop, which allows defining system overrides as well as additional CSS styles.
383
- */
384
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
385
- /**
386
- * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
387
- *
388
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
389
- * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
390
- *
391
- * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
392
- * @default false
393
- */
394
- useFlexGap: e.bool
395
- });
396
- const xo = Me;
397
- function Io(o) {
398
- return U("MuiFormControlLabel", o);
399
- }
400
- const Mo = z("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), Z = Mo, No = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"], Oo = (o) => {
401
- const {
402
- classes: r,
403
- disabled: t,
404
- labelPlacement: s,
405
- error: n,
406
- required: l
407
- } = o, p = {
408
- root: ["root", t && "disabled", `labelPlacement${w(s)}`, n && "error", l && "required"],
409
- label: ["label", t && "disabled"],
410
- asterisk: ["asterisk", n && "error"]
411
- };
412
- return _(p, Io, r);
413
- }, To = P("label", {
414
- name: "MuiFormControlLabel",
415
- slot: "Root",
416
- overridesResolver: (o, r) => {
417
- const {
418
- ownerState: t
419
- } = o;
420
- return [{
421
- [`& .${Z.label}`]: r.label
422
- }, r.root, r[`labelPlacement${w(t.labelPlacement)}`]];
423
- }
424
- })(({
425
- theme: o,
426
- ownerState: r
427
- }) => f({
428
- display: "inline-flex",
429
- alignItems: "center",
430
- cursor: "pointer",
431
- // For correct alignment with the text.
432
- verticalAlign: "middle",
433
- WebkitTapHighlightColor: "transparent",
434
- marginLeft: -11,
435
- marginRight: 16,
436
- // used for row presentation of radio/checkbox
437
- [`&.${Z.disabled}`]: {
438
- cursor: "default"
439
- }
440
- }, r.labelPlacement === "start" && {
441
- flexDirection: "row-reverse",
442
- marginLeft: 16,
443
- // used for row presentation of radio/checkbox
444
- marginRight: -11
445
- }, r.labelPlacement === "top" && {
446
- flexDirection: "column-reverse",
447
- marginLeft: 16
448
- }, r.labelPlacement === "bottom" && {
449
- flexDirection: "column",
450
- marginLeft: 16
451
- }, {
452
- [`& .${Z.label}`]: {
453
- [`&.${Z.disabled}`]: {
454
- color: (o.vars || o).palette.text.disabled
455
- }
456
- }
457
- })), ko = P("span", {
458
- name: "MuiFormControlLabel",
459
- slot: "Asterisk",
460
- overridesResolver: (o, r) => r.asterisk
461
- })(({
462
- theme: o
463
- }) => ({
464
- [`&.${Z.error}`]: {
465
- color: (o.vars || o).palette.error.main
466
- }
467
- })), Ne = /* @__PURE__ */ x.forwardRef(function(r, t) {
468
- var s, n;
469
- const l = G({
470
- props: r,
471
- name: "MuiFormControlLabel"
472
- }), {
473
- className: p,
474
- componentsProps: y = {},
475
- control: i,
476
- disabled: d,
477
- disableTypography: g,
478
- label: h,
479
- labelPlacement: m = "end",
480
- required: I,
481
- slotProps: a = {}
482
- } = l, v = D(l, No), b = H(), M = (s = d ?? i.props.disabled) != null ? s : b == null ? void 0 : b.disabled, N = I ?? i.props.required, T = {
483
- disabled: M,
484
- required: N
485
- };
486
- ["checked", "name", "onChange", "value", "inputRef"].forEach((B) => {
487
- typeof i.props[B] > "u" && typeof l[B] < "u" && (T[B] = l[B]);
488
- });
489
- const k = he({
490
- props: l,
491
- muiFormControl: b,
492
- states: ["error"]
493
- }), u = f({}, l, {
494
- disabled: M,
495
- labelPlacement: m,
496
- required: N,
497
- error: k.error
498
- }), C = Oo(u), R = (n = a.typography) != null ? n : y.typography;
499
- let $ = h;
500
- return $ != null && $.type !== X && !g && ($ = /* @__PURE__ */ c(X, f({
501
- component: "span"
502
- }, R, {
503
- className: E(C.label, R == null ? void 0 : R.className),
504
- children: $
505
- }))), /* @__PURE__ */ j(To, f({
506
- className: E(C.root, p),
507
- ownerState: u,
508
- ref: t
509
- }, v, {
510
- children: [/* @__PURE__ */ x.cloneElement(i, T), N ? /* @__PURE__ */ j(xo, {
511
- direction: "row",
512
- alignItems: "center",
513
- children: [$, /* @__PURE__ */ j(ko, {
514
- ownerState: u,
515
- "aria-hidden": !0,
516
- className: C.asterisk,
517
- children: [" ", "*"]
518
- })]
519
- }) : $]
520
- }));
521
- });
522
- process.env.NODE_ENV !== "production" && (Ne.propTypes = {
523
- // ----------------------------- Warning --------------------------------
524
- // | These PropTypes are generated from the TypeScript type definitions |
525
- // | To update them edit the d.ts file and run "yarn proptypes" |
526
- // ----------------------------------------------------------------------
527
- /**
528
- * If `true`, the component appears selected.
529
- */
530
- checked: e.bool,
531
- /**
532
- * Override or extend the styles applied to the component.
533
- */
534
- classes: e.object,
535
- /**
536
- * @ignore
537
- */
538
- className: e.string,
539
- /**
540
- * The props used for each slot inside.
541
- * @default {}
542
- */
543
- componentsProps: e.shape({
544
- typography: e.object
545
- }),
546
- /**
547
- * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
548
- */
549
- control: e.element.isRequired,
550
- /**
551
- * If `true`, the control is disabled.
552
- */
553
- disabled: e.bool,
554
- /**
555
- * If `true`, the label is rendered as it is passed without an additional typography node.
556
- */
557
- disableTypography: e.bool,
558
- /**
559
- * Pass a ref to the `input` element.
560
- */
561
- inputRef: A,
562
- /**
563
- * A text or an element to be used in an enclosing label element.
564
- */
565
- label: e.node,
566
- /**
567
- * The position of the label.
568
- * @default 'end'
569
- */
570
- labelPlacement: e.oneOf(["bottom", "end", "start", "top"]),
571
- /**
572
- * @ignore
573
- */
574
- name: e.string,
575
- /**
576
- * Callback fired when the state is changed.
577
- *
578
- * @param {React.SyntheticEvent} event The event source of the callback.
579
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
580
- */
581
- onChange: e.func,
582
- /**
583
- * If `true`, the label will indicate that the `input` is required.
584
- */
585
- required: e.bool,
586
- /**
587
- * The props used for each slot inside.
588
- * @default {}
589
- */
590
- slotProps: e.shape({
591
- typography: e.object
592
- }),
593
- /**
594
- * The system prop that allows defining system overrides as well as additional CSS styles.
595
- */
596
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
597
- /**
598
- * The value of the component.
599
- */
600
- value: e.any
601
- });
602
- const Ro = Ne;
603
- function $o(o) {
604
- return U("MuiFormGroup", o);
605
- }
606
- z("MuiFormGroup", ["root", "row", "error"]);
607
- const jo = ["className", "row"], Po = (o) => {
608
- const {
609
- classes: r,
610
- row: t,
611
- error: s
612
- } = o;
613
- return _({
614
- root: ["root", t && "row", s && "error"]
615
- }, $o, r);
616
- }, So = P("div", {
617
- name: "MuiFormGroup",
618
- slot: "Root",
619
- overridesResolver: (o, r) => {
620
- const {
621
- ownerState: t
622
- } = o;
623
- return [r.root, t.row && r.row];
624
- }
625
- })(({
626
- ownerState: o
627
- }) => f({
628
- display: "flex",
629
- flexDirection: "column",
630
- flexWrap: "wrap"
631
- }, o.row && {
632
- flexDirection: "row"
633
- })), Oe = /* @__PURE__ */ x.forwardRef(function(r, t) {
634
- const s = G({
635
- props: r,
636
- name: "MuiFormGroup"
637
- }), {
638
- className: n,
639
- row: l = !1
640
- } = s, p = D(s, jo), y = H(), i = he({
641
- props: s,
642
- muiFormControl: y,
643
- states: ["error"]
644
- }), d = f({}, s, {
645
- row: l,
646
- error: i.error
647
- }), g = Po(d);
648
- return /* @__PURE__ */ c(So, f({
649
- className: E(g.root, n),
650
- ownerState: d,
651
- ref: t
652
- }, p));
653
- });
654
- process.env.NODE_ENV !== "production" && (Oe.propTypes = {
655
- // ----------------------------- Warning --------------------------------
656
- // | These PropTypes are generated from the TypeScript type definitions |
657
- // | To update them edit the d.ts file and run "yarn proptypes" |
658
- // ----------------------------------------------------------------------
659
- /**
660
- * The content of the component.
661
- */
662
- children: e.node,
663
- /**
664
- * Override or extend the styles applied to the component.
665
- */
666
- classes: e.object,
667
- /**
668
- * @ignore
669
- */
670
- className: e.string,
671
- /**
672
- * Display group of elements in a compact row.
673
- * @default false
674
- */
675
- row: e.bool,
676
- /**
677
- * The system prop that allows defining system overrides as well as additional CSS styles.
678
- */
679
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
680
- });
681
- const Lo = Oe;
682
- function wo(o) {
683
- return U("MuiInputAdornment", o);
684
- }
685
- const Eo = z("MuiInputAdornment", ["root", "filled", "standard", "outlined", "positionStart", "positionEnd", "disablePointerEvents", "hiddenLabel", "sizeSmall"]), ce = Eo;
686
- var ie;
687
- const Fo = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"], Do = (o, r) => {
688
- const {
689
- ownerState: t
690
- } = o;
691
- return [r.root, r[`position${w(t.position)}`], t.disablePointerEvents === !0 && r.disablePointerEvents, r[t.variant]];
692
- }, zo = (o) => {
693
- const {
694
- classes: r,
695
- disablePointerEvents: t,
696
- hiddenLabel: s,
697
- position: n,
698
- size: l,
699
- variant: p
700
- } = o, y = {
701
- root: ["root", t && "disablePointerEvents", n && `position${w(n)}`, p, s && "hiddenLabel", l && `size${w(l)}`]
702
- };
703
- return _(y, wo, r);
704
- }, Bo = P("div", {
705
- name: "MuiInputAdornment",
706
- slot: "Root",
707
- overridesResolver: Do
708
- })(({
709
- theme: o,
710
- ownerState: r
711
- }) => f({
712
- display: "flex",
713
- height: "0.01em",
714
- // Fix IE11 flexbox alignment. To remove at some point.
715
- maxHeight: "2em",
716
- alignItems: "center",
717
- whiteSpace: "nowrap",
718
- color: (o.vars || o).palette.action.active
719
- }, r.variant === "filled" && {
720
- // Styles applied to the root element if `variant="filled"`.
721
- [`&.${ce.positionStart}&:not(.${ce.hiddenLabel})`]: {
722
- marginTop: 16
723
- }
724
- }, r.position === "start" && {
725
- // Styles applied to the root element if `position="start"`.
726
- marginRight: 8
727
- }, r.position === "end" && {
728
- // Styles applied to the root element if `position="end"`.
729
- marginLeft: 8
730
- }, r.disablePointerEvents === !0 && {
731
- // Styles applied to the root element if `disablePointerEvents={true}`.
732
- pointerEvents: "none"
733
- })), Te = /* @__PURE__ */ x.forwardRef(function(r, t) {
734
- const s = G({
735
- props: r,
736
- name: "MuiInputAdornment"
737
- }), {
738
- children: n,
739
- className: l,
740
- component: p = "div",
741
- disablePointerEvents: y = !1,
742
- disableTypography: i = !1,
743
- position: d,
744
- variant: g
745
- } = s, h = D(s, Fo), m = H() || {};
746
- let I = g;
747
- g && m.variant && process.env.NODE_ENV !== "production" && g === m.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), m && !I && (I = m.variant);
748
- const a = f({}, s, {
749
- hiddenLabel: m.hiddenLabel,
750
- size: m.size,
751
- disablePointerEvents: y,
752
- position: d,
753
- variant: I
754
- }), v = zo(a);
755
- return /* @__PURE__ */ c(oo.Provider, {
756
- value: null,
757
- children: /* @__PURE__ */ c(Bo, f({
758
- as: p,
759
- ownerState: a,
760
- className: E(v.root, l),
761
- ref: t
762
- }, h, {
763
- children: typeof n == "string" && !i ? /* @__PURE__ */ c(X, {
764
- color: "text.secondary",
765
- children: n
766
- }) : /* @__PURE__ */ j(x.Fragment, {
767
- children: [d === "start" ? (
768
- /* notranslate needed while Google Translate will not fix zero-width space issue */
769
- ie || (ie = /* @__PURE__ */ c("span", {
770
- className: "notranslate",
771
- children: "​"
772
- }))
773
- ) : null, n]
774
- })
775
- }))
776
- });
777
- });
778
- process.env.NODE_ENV !== "production" && (Te.propTypes = {
779
- // ----------------------------- Warning --------------------------------
780
- // | These PropTypes are generated from the TypeScript type definitions |
781
- // | To update them edit the d.ts file and run "yarn proptypes" |
782
- // ----------------------------------------------------------------------
783
- /**
784
- * The content of the component, normally an `IconButton` or string.
785
- */
786
- children: e.node,
787
- /**
788
- * Override or extend the styles applied to the component.
789
- */
790
- classes: e.object,
791
- /**
792
- * @ignore
793
- */
794
- className: e.string,
795
- /**
796
- * The component used for the root node.
797
- * Either a string to use a HTML element or a component.
798
- */
799
- component: e.elementType,
800
- /**
801
- * Disable pointer events on the root.
802
- * This allows for the content of the adornment to focus the `input` on click.
803
- * @default false
804
- */
805
- disablePointerEvents: e.bool,
806
- /**
807
- * If children is a string then disable wrapping in a Typography component.
808
- * @default false
809
- */
810
- disableTypography: e.bool,
811
- /**
812
- * The position this adornment should appear relative to the `Input`.
813
- */
814
- position: e.oneOf(["end", "start"]).isRequired,
815
- /**
816
- * The system prop that allows defining system overrides as well as additional CSS styles.
817
- */
818
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
819
- /**
820
- * The variant to use.
821
- * Note: If you are using the `TextField` component or the `FormControl` component
822
- * you do not have to set this manually.
823
- */
824
- variant: e.oneOf(["filled", "outlined", "standard"])
825
- });
826
- const de = Te, Vo = z("MuiListItemIcon", ["root", "alignItemsFlexStart"]), ue = Vo, Uo = z("MuiListItemText", ["root", "multiline", "dense", "inset", "primary", "secondary"]), pe = Uo;
827
- function _o(o) {
828
- return U("MuiMenuItem", o);
829
- }
830
- const Go = z("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divider", "gutters", "selected"]), Q = Go, qo = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"], Qo = (o, r) => {
831
- const {
832
- ownerState: t
833
- } = o;
834
- return [r.root, t.dense && r.dense, t.divider && r.divider, !t.disableGutters && r.gutters];
835
- }, Wo = (o) => {
836
- const {
837
- disabled: r,
838
- dense: t,
839
- divider: s,
840
- disableGutters: n,
841
- selected: l,
842
- classes: p
843
- } = o, i = _({
844
- root: ["root", t && "dense", r && "disabled", !n && "gutters", s && "divider", l && "selected"]
845
- }, _o, p);
846
- return f({}, p, i);
847
- }, Zo = P(Ce, {
848
- shouldForwardProp: (o) => ve(o) || o === "classes",
849
- name: "MuiMenuItem",
850
- slot: "Root",
851
- overridesResolver: Qo
852
- })(({
853
- theme: o,
854
- ownerState: r
855
- }) => f({}, o.typography.body1, {
856
- display: "flex",
857
- justifyContent: "flex-start",
858
- alignItems: "center",
859
- position: "relative",
860
- textDecoration: "none",
861
- minHeight: 48,
862
- paddingTop: 6,
863
- paddingBottom: 6,
864
- boxSizing: "border-box",
865
- whiteSpace: "nowrap"
866
- }, !r.disableGutters && {
867
- paddingLeft: 16,
868
- paddingRight: 16
869
- }, r.divider && {
870
- borderBottom: `1px solid ${(o.vars || o).palette.divider}`,
871
- backgroundClip: "padding-box"
872
- }, {
873
- "&:hover": {
874
- textDecoration: "none",
875
- backgroundColor: (o.vars || o).palette.action.hover,
876
- // Reset on touch devices, it doesn't add specificity
877
- "@media (hover: none)": {
878
- backgroundColor: "transparent"
879
- }
880
- },
881
- [`&.${Q.selected}`]: {
882
- backgroundColor: o.vars ? `rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})` : W(o.palette.primary.main, o.palette.action.selectedOpacity),
883
- [`&.${Q.focusVisible}`]: {
884
- backgroundColor: o.vars ? `rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))` : W(o.palette.primary.main, o.palette.action.selectedOpacity + o.palette.action.focusOpacity)
885
- }
886
- },
887
- [`&.${Q.selected}:hover`]: {
888
- backgroundColor: o.vars ? `rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))` : W(o.palette.primary.main, o.palette.action.selectedOpacity + o.palette.action.hoverOpacity),
889
- // Reset on touch devices, it doesn't add specificity
890
- "@media (hover: none)": {
891
- backgroundColor: o.vars ? `rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})` : W(o.palette.primary.main, o.palette.action.selectedOpacity)
892
- }
893
- },
894
- [`&.${Q.focusVisible}`]: {
895
- backgroundColor: (o.vars || o).palette.action.focus
896
- },
897
- [`&.${Q.disabled}`]: {
898
- opacity: (o.vars || o).palette.action.disabledOpacity
899
- },
900
- [`& + .${te.root}`]: {
901
- marginTop: o.spacing(1),
902
- marginBottom: o.spacing(1)
903
- },
904
- [`& + .${te.inset}`]: {
905
- marginLeft: 52
906
- },
907
- [`& .${pe.root}`]: {
908
- marginTop: 0,
909
- marginBottom: 0
910
- },
911
- [`& .${pe.inset}`]: {
912
- paddingLeft: 36
913
- },
914
- [`& .${ue.root}`]: {
915
- minWidth: 36
916
- }
917
- }, !r.dense && {
918
- [o.breakpoints.up("sm")]: {
919
- minHeight: "auto"
920
- }
921
- }, r.dense && f({
922
- minHeight: 32,
923
- // https://m2.material.io/components/menus#specs > Dense
924
- paddingTop: 4,
925
- paddingBottom: 4
926
- }, o.typography.body2, {
927
- [`& .${ue.root} svg`]: {
928
- fontSize: "1.25rem"
929
- }
930
- }))), ke = /* @__PURE__ */ x.forwardRef(function(r, t) {
931
- const s = G({
932
- props: r,
933
- name: "MuiMenuItem"
934
- }), {
935
- autoFocus: n = !1,
936
- component: l = "li",
937
- dense: p = !1,
938
- divider: y = !1,
939
- disableGutters: i = !1,
940
- focusVisibleClassName: d,
941
- role: g = "menuitem",
942
- tabIndex: h,
943
- className: m
944
- } = s, I = D(s, qo), a = x.useContext(le), v = x.useMemo(() => ({
945
- dense: p || a.dense || !1,
946
- disableGutters: i
947
- }), [a.dense, p, i]), b = x.useRef(null);
948
- Xe(() => {
949
- n && (b.current ? b.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered."));
950
- }, [n]);
951
- const M = f({}, s, {
952
- dense: v.dense,
953
- divider: y,
954
- disableGutters: i
955
- }), N = Wo(s), T = ye(b, t);
956
- let k;
957
- return s.disabled || (k = h !== void 0 ? h : -1), /* @__PURE__ */ c(le.Provider, {
958
- value: v,
959
- children: /* @__PURE__ */ c(Zo, f({
960
- ref: T,
961
- role: g,
962
- tabIndex: k,
963
- component: l,
964
- focusVisibleClassName: E(N.focusVisible, d),
965
- className: E(N.root, m)
966
- }, I, {
967
- ownerState: M,
968
- classes: N
969
- }))
970
- });
971
- });
972
- process.env.NODE_ENV !== "production" && (ke.propTypes = {
973
- // ----------------------------- Warning --------------------------------
974
- // | These PropTypes are generated from the TypeScript type definitions |
975
- // | To update them edit the d.ts file and run "yarn proptypes" |
976
- // ----------------------------------------------------------------------
977
- /**
978
- * If `true`, the list item is focused during the first mount.
979
- * Focus will also be triggered if the value changes from false to true.
980
- * @default false
981
- */
982
- autoFocus: e.bool,
983
- /**
984
- * The content of the component.
985
- */
986
- children: e.node,
987
- /**
988
- * Override or extend the styles applied to the component.
989
- */
990
- classes: e.object,
991
- /**
992
- * @ignore
993
- */
994
- className: e.string,
995
- /**
996
- * The component used for the root node.
997
- * Either a string to use a HTML element or a component.
998
- */
999
- component: e.elementType,
1000
- /**
1001
- * If `true`, compact vertical padding designed for keyboard and mouse input is used.
1002
- * The prop defaults to the value inherited from the parent Menu component.
1003
- * @default false
1004
- */
1005
- dense: e.bool,
1006
- /**
1007
- * @ignore
1008
- */
1009
- disabled: e.bool,
1010
- /**
1011
- * If `true`, the left and right padding is removed.
1012
- * @default false
1013
- */
1014
- disableGutters: e.bool,
1015
- /**
1016
- * If `true`, a 1px light border is added to the bottom of the menu item.
1017
- * @default false
1018
- */
1019
- divider: e.bool,
1020
- /**
1021
- * This prop can help identify which element has keyboard focus.
1022
- * The class name will be applied when the element gains the focus through keyboard interaction.
1023
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
1024
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
1025
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
1026
- * if needed.
1027
- */
1028
- focusVisibleClassName: e.string,
1029
- /**
1030
- * @ignore
1031
- */
1032
- role: e.string,
1033
- /**
1034
- * If `true`, the component is selected.
1035
- * @default false
1036
- */
1037
- selected: e.bool,
1038
- /**
1039
- * The system prop that allows defining system overrides as well as additional CSS styles.
1040
- */
1041
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1042
- /**
1043
- * @default 0
1044
- */
1045
- tabIndex: e.number
1046
- });
1047
- const Ho = ke, Yo = xe(/* @__PURE__ */ c("path", {
1048
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
1049
- }), "RadioButtonUnchecked"), Ko = xe(/* @__PURE__ */ c("path", {
1050
- d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
1051
- }), "RadioButtonChecked"), Jo = P("span")({
1052
- position: "relative",
1053
- display: "flex"
1054
- }), Xo = P(Yo)({
1055
- // Scale applied to prevent dot misalignment in Safari
1056
- transform: "scale(1)"
1057
- }), Ao = P(Ko)(({
1058
- theme: o,
1059
- ownerState: r
1060
- }) => f({
1061
- left: 0,
1062
- position: "absolute",
1063
- transform: "scale(0)",
1064
- transition: o.transitions.create("transform", {
1065
- easing: o.transitions.easing.easeIn,
1066
- duration: o.transitions.duration.shortest
1067
- })
1068
- }, r.checked && {
1069
- transform: "scale(1)",
1070
- transition: o.transitions.create("transform", {
1071
- easing: o.transitions.easing.easeOut,
1072
- duration: o.transitions.duration.shortest
1073
- })
1074
- }));
1075
- function ee(o) {
1076
- const {
1077
- checked: r = !1,
1078
- classes: t = {},
1079
- fontSize: s
1080
- } = o, n = f({}, o, {
1081
- checked: r
1082
- });
1083
- return /* @__PURE__ */ j(Jo, {
1084
- className: t.root,
1085
- ownerState: n,
1086
- children: [/* @__PURE__ */ c(Xo, {
1087
- fontSize: s,
1088
- className: t.background,
1089
- ownerState: n
1090
- }), /* @__PURE__ */ c(Ao, {
1091
- fontSize: s,
1092
- className: t.dot,
1093
- ownerState: n
1094
- })]
1095
- });
1096
- }
1097
- process.env.NODE_ENV !== "production" && (ee.propTypes = {
1098
- /**
1099
- * If `true`, the component is checked.
1100
- */
1101
- checked: e.bool,
1102
- /**
1103
- * Override or extend the styles applied to the component.
1104
- * See [CSS API](#css) below for more details.
1105
- */
1106
- classes: e.object,
1107
- /**
1108
- * The size of the component.
1109
- * `small` is equivalent to the dense radio styling.
1110
- */
1111
- fontSize: e.oneOf(["small", "medium"])
1112
- });
1113
- const Re = /* @__PURE__ */ x.createContext(void 0);
1114
- process.env.NODE_ENV !== "production" && (Re.displayName = "RadioGroupContext");
1115
- const $e = Re;
1116
- function er() {
1117
- return x.useContext($e);
1118
- }
1119
- function or(o) {
1120
- return U("MuiRadio", o);
1121
- }
1122
- const rr = z("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), fe = rr, ar = ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className"], tr = (o) => {
1123
- const {
1124
- classes: r,
1125
- color: t,
1126
- size: s
1127
- } = o, n = {
1128
- root: ["root", `color${w(t)}`, s !== "medium" && `size${w(s)}`]
1129
- };
1130
- return f({}, r, _(n, or, r));
1131
- }, sr = P(Co, {
1132
- shouldForwardProp: (o) => ve(o) || o === "classes",
1133
- name: "MuiRadio",
1134
- slot: "Root",
1135
- overridesResolver: (o, r) => {
1136
- const {
1137
- ownerState: t
1138
- } = o;
1139
- return [r.root, r[`color${w(t.color)}`]];
1140
- }
1141
- })(({
1142
- theme: o,
1143
- ownerState: r
1144
- }) => f({
1145
- color: (o.vars || o).palette.text.secondary
1146
- }, !r.disableRipple && {
1147
- "&:hover": {
1148
- backgroundColor: o.vars ? `rgba(${r.color === "default" ? o.vars.palette.action.activeChannel : o.vars.palette[r.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : W(r.color === "default" ? o.palette.action.active : o.palette[r.color].main, o.palette.action.hoverOpacity),
1149
- // Reset on touch devices, it doesn't add specificity
1150
- "@media (hover: none)": {
1151
- backgroundColor: "transparent"
1152
- }
1153
- }
1154
- }, r.color !== "default" && {
1155
- [`&.${fe.checked}`]: {
1156
- color: (o.vars || o).palette[r.color].main
1157
- }
1158
- }, {
1159
- [`&.${fe.disabled}`]: {
1160
- color: (o.vars || o).palette.action.disabled
1161
- }
1162
- }));
1163
- function nr(o, r) {
1164
- return typeof r == "object" && r !== null ? o === r : String(o) === String(r);
1165
- }
1166
- const be = /* @__PURE__ */ c(ee, {
1167
- checked: !0
1168
- }), me = /* @__PURE__ */ c(ee, {}), je = /* @__PURE__ */ x.forwardRef(function(r, t) {
1169
- var s, n;
1170
- const l = G({
1171
- props: r,
1172
- name: "MuiRadio"
1173
- }), {
1174
- checked: p,
1175
- checkedIcon: y = be,
1176
- color: i = "primary",
1177
- icon: d = me,
1178
- name: g,
1179
- onChange: h,
1180
- size: m = "medium",
1181
- className: I
1182
- } = l, a = D(l, ar), v = f({}, l, {
1183
- color: i,
1184
- size: m
1185
- }), b = tr(v), M = er();
1186
- let N = p;
1187
- const T = Ve(h, M && M.onChange);
1188
- let k = g;
1189
- return M && (typeof N > "u" && (N = nr(M.value, l.value)), typeof k > "u" && (k = M.name)), /* @__PURE__ */ c(sr, f({
1190
- type: "radio",
1191
- icon: /* @__PURE__ */ x.cloneElement(d, {
1192
- fontSize: (s = me.props.fontSize) != null ? s : m
1193
- }),
1194
- checkedIcon: /* @__PURE__ */ x.cloneElement(y, {
1195
- fontSize: (n = be.props.fontSize) != null ? n : m
1196
- }),
1197
- ownerState: v,
1198
- classes: b,
1199
- name: k,
1200
- checked: N,
1201
- onChange: T,
1202
- ref: t,
1203
- className: E(b.root, I)
1204
- }, a));
1205
- });
1206
- process.env.NODE_ENV !== "production" && (je.propTypes = {
1207
- // ----------------------------- Warning --------------------------------
1208
- // | These PropTypes are generated from the TypeScript type definitions |
1209
- // | To update them edit the d.ts file and run "yarn proptypes" |
1210
- // ----------------------------------------------------------------------
1211
- /**
1212
- * If `true`, the component is checked.
1213
- */
1214
- checked: e.bool,
1215
- /**
1216
- * The icon to display when the component is checked.
1217
- * @default <RadioButtonIcon checked />
1218
- */
1219
- checkedIcon: e.node,
1220
- /**
1221
- * Override or extend the styles applied to the component.
1222
- */
1223
- classes: e.object,
1224
- /**
1225
- * @ignore
1226
- */
1227
- className: e.string,
1228
- /**
1229
- * The color of the component.
1230
- * It supports both default and custom theme colors, which can be added as shown in the
1231
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
1232
- * @default 'primary'
1233
- */
1234
- color: e.oneOfType([e.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
1235
- /**
1236
- * If `true`, the component is disabled.
1237
- */
1238
- disabled: e.bool,
1239
- /**
1240
- * If `true`, the ripple effect is disabled.
1241
- * @default false
1242
- */
1243
- disableRipple: e.bool,
1244
- /**
1245
- * The icon to display when the component is unchecked.
1246
- * @default <RadioButtonIcon />
1247
- */
1248
- icon: e.node,
1249
- /**
1250
- * The id of the `input` element.
1251
- */
1252
- id: e.string,
1253
- /**
1254
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
1255
- */
1256
- inputProps: e.object,
1257
- /**
1258
- * Pass a ref to the `input` element.
1259
- */
1260
- inputRef: A,
1261
- /**
1262
- * Name attribute of the `input` element.
1263
- */
1264
- name: e.string,
1265
- /**
1266
- * Callback fired when the state is changed.
1267
- *
1268
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1269
- * You can pull out the new value by accessing `event.target.value` (string).
1270
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
1271
- */
1272
- onChange: e.func,
1273
- /**
1274
- * If `true`, the `input` element is required.
1275
- * @default false
1276
- */
1277
- required: e.bool,
1278
- /**
1279
- * The size of the component.
1280
- * `small` is equivalent to the dense radio styling.
1281
- * @default 'medium'
1282
- */
1283
- size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
1284
- /**
1285
- * The system prop that allows defining system overrides as well as additional CSS styles.
1286
- */
1287
- sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
1288
- /**
1289
- * The value of the component. The DOM API casts this to a string.
1290
- */
1291
- value: e.any
1292
- });
1293
- const lr = je, cr = ["actions", "children", "defaultValue", "name", "onChange", "value"], Pe = /* @__PURE__ */ x.forwardRef(function(r, t) {
1294
- const {
1295
- // private
1296
- // eslint-disable-next-line react/prop-types
1297
- actions: s,
1298
- children: n,
1299
- defaultValue: l,
1300
- name: p,
1301
- onChange: y,
1302
- value: i
1303
- } = r, d = D(r, cr), g = x.useRef(null), [h, m] = ge({
1304
- controlled: i,
1305
- default: l,
1306
- name: "RadioGroup"
1307
- });
1308
- x.useImperativeHandle(s, () => ({
1309
- focus: () => {
1310
- let b = g.current.querySelector("input:not(:disabled):checked");
1311
- b || (b = g.current.querySelector("input:not(:disabled)")), b && b.focus();
1312
- }
1313
- }), []);
1314
- const I = ye(t, g), a = Ue(p), v = x.useMemo(() => ({
1315
- name: a,
1316
- onChange(b) {
1317
- m(b.target.value), y && y(b, b.target.value);
1318
- },
1319
- value: h
1320
- }), [a, y, m, h]);
1321
- return /* @__PURE__ */ c($e.Provider, {
1322
- value: v,
1323
- children: /* @__PURE__ */ c(Lo, f({
1324
- role: "radiogroup",
1325
- ref: I
1326
- }, d, {
1327
- children: n
1328
- }))
1329
- });
1330
- });
1331
- process.env.NODE_ENV !== "production" && (Pe.propTypes = {
1332
- // ----------------------------- Warning --------------------------------
1333
- // | These PropTypes are generated from the TypeScript type definitions |
1334
- // | To update them edit the d.ts file and run "yarn proptypes" |
1335
- // ----------------------------------------------------------------------
1336
- /**
1337
- * The content of the component.
1338
- */
1339
- children: e.node,
1340
- /**
1341
- * The default value. Use when the component is not controlled.
1342
- */
1343
- defaultValue: e.any,
1344
- /**
1345
- * The name used to reference the value of the control.
1346
- * If you don't provide this prop, it falls back to a randomly generated name.
1347
- */
1348
- name: e.string,
1349
- /**
1350
- * Callback fired when a radio button is selected.
1351
- *
1352
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1353
- * @param {string} value The value of the selected radio button.
1354
- * You can pull out the new value by accessing `event.target.value` (string).
1355
- */
1356
- onChange: e.func,
1357
- /**
1358
- * Value of the selected radio button. The DOM API casts this to a string.
1359
- */
1360
- value: e.any
1361
- });
1362
- const ir = Pe;
1363
- var oe = {}, dr = Ge;
1364
- Object.defineProperty(oe, "__esModule", {
1365
- value: !0
1366
- });
1367
- var Se = oe.default = void 0, ur = dr(_e()), pr = ze, fr = (0, ur.default)(/* @__PURE__ */ (0, pr.jsx)("path", {
1368
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
1369
- }), "Error");
1370
- Se = oe.default = fr;
1371
- const br = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxNiAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEzLjg3NzggMy4yNTUzOUMxNC4yODc1IDIuODM3MzkgMTQuOTYwNiAyLjgzNzM5IDE1LjM3MDMgMy4yNTUzOUMxNS43NzggMy42NjczOSAxNS43ODM3IDQuMzMzMDkgMTUuMzg0NSA0Ljc1MjE5TDYuOTU1NjMgMTQuNzE2M0M2LjU1MTYzIDE1LjE2IDUuODU3OTIgMTUuMTczIDUuNDM3NTIgMTQuNzQ0OEwwLjMwODYyNSA5LjU0NzQ5Qy0wLjEwMjg3NSA5LjEyNzg5IC0wLjEwMjg3NSA4LjQ1NjA5IDAuMzA4NjI1IDguMDM2NDlDMC43MTgzMjUgNy42MTg0OSAxLjM5MTQyIDcuNjE4NDkgMS44MDExMiA4LjAzNjQ5TDYuMTUxNzIgMTIuNDQ1NUwxMy44NDkzIDMuMjg2NzlMMTMuODc3OCAzLjI1NTM5WiIgZmlsbD0iIzE2MjMyNCIvPgo8L3N2Zz4K", $r = ({
1372
- name: o,
1373
- label: r,
1374
- type: t,
1375
- value: s,
1376
- handleChange: n,
1377
- placeholder: l,
1378
- required: p,
1379
- disabled: y,
1380
- options: i,
1381
- optionsResponseHandler: d,
1382
- api_endpoint: g,
1383
- error: h,
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import j from "./RadioInput/index.js";
3
+ import C from "./TextfieldInput/index.js";
4
+ const v = ({
5
+ name: t,
6
+ label: u,
7
+ type: o,
8
+ value: f,
9
+ handleChange: d,
10
+ placeholder: p,
11
+ required: r,
12
+ disabled: g,
13
+ options: n,
14
+ optionsResponseHandler: l,
15
+ api_endpoint: s,
16
+ error: i,
1384
17
  helperText: m,
1385
- autofocus: I,
18
+ autofocus: x,
1386
19
  inputAdornments: a
1387
20
  }) => {
1388
- const [v, b] = qe([]);
1389
- function M(u) {
1390
- n(o, u.target.value);
1391
- }
1392
- const N = Qe(async () => {
1393
- var u;
1394
- return t !== "select" ? [] : i || (g && d ? (u = (await (await fetch(g)).json())[d.key]) == null ? void 0 : u.map(($) => ({
1395
- name: $[d.name],
1396
- value: $[d.value]
1397
- })) : []);
1398
- }, [t, d, g]);
1399
- We(() => {
1400
- N().then((u) => b(u));
1401
- }, []);
1402
- let T = {
1403
- ...O.textfield,
1404
- backgroundColor: h ? K.redLight : "transparent",
1405
- "& input::placeholder": {
1406
- color: h ? K.redMedium : "grey"
1407
- }
1408
- };
1409
- const k = {
1410
- "& .MuiSelect-select > span::before": {
1411
- content: `'${l || ""}'`,
1412
- color: h ? "rgba(254, 64, 76, 0.4)" : "rgba(153, 153, 153, 0.6)"
1413
- }
1414
- };
1415
- return t === "select" && (T = {
1416
- ...T,
1417
- ...k
1418
- }), t !== "custom" ? t === "radio" ? /* @__PURE__ */ j(L, { sx: O.formInputWrapper, children: [
1419
- /* @__PURE__ */ j(L, { sx: O.labelAdornmentBox, children: [
1420
- (a == null ? void 0 : a.beforeLabel) && /* @__PURE__ */ c(L, { children: typeof (a == null ? void 0 : a.beforeLabel) == "string" ? /* @__PURE__ */ c(V, { sx: O.label, children: a == null ? void 0 : a.beforeLabel }) : a == null ? void 0 : a.beforeLabel }),
1421
- /* @__PURE__ */ c("label", { htmlFor: `form-input-${o}`, children: /* @__PURE__ */ c(V, { sx: O.label, children: `${r} ${p ? "*" : ""}` }) }),
1422
- (a == null ? void 0 : a.afterLabel) && /* @__PURE__ */ c(L, { children: typeof (a == null ? void 0 : a.afterLabel) == "string" ? /* @__PURE__ */ c(V, { sx: O.label, children: a == null ? void 0 : a.afterLabel }) : a == null ? void 0 : a.afterLabel })
1423
- ] }),
1424
- /* @__PURE__ */ c(
1425
- ir,
1426
- {
1427
- row: !0,
1428
- name: "row-radio-buttons-group",
1429
- value: s,
1430
- onChange: M,
1431
- children: i == null ? void 0 : i.map((u) => {
1432
- const C = typeof u == "object";
1433
- return /* @__PURE__ */ c(
1434
- Ro,
1435
- {
1436
- value: C ? u.value : u,
1437
- control: /* @__PURE__ */ c(lr, {}),
1438
- label: C ? u.name : u,
1439
- sx: O.label
1440
- },
1441
- C ? u.name : u
1442
- );
1443
- })
1444
- }
1445
- )
1446
- ] }) : /* @__PURE__ */ j(L, { sx: O.formInputWrapper, children: [
1447
- /* @__PURE__ */ j(L, { sx: O.labelAdornmentBox, children: [
1448
- (a == null ? void 0 : a.beforeLabel) && /* @__PURE__ */ c(L, { children: typeof (a == null ? void 0 : a.beforeLabel) == "string" ? /* @__PURE__ */ c(V, { sx: O.label, children: a == null ? void 0 : a.beforeLabel }) : a == null ? void 0 : a.beforeLabel }),
1449
- /* @__PURE__ */ c("label", { htmlFor: `form-input-${o}`, children: /* @__PURE__ */ c(V, { sx: O.label, children: `${r} ${p ? "*" : ""}` }) }),
1450
- (a == null ? void 0 : a.afterLabel) && /* @__PURE__ */ c(L, { children: typeof (a == null ? void 0 : a.afterLabel) == "string" ? /* @__PURE__ */ c(V, { sx: O.label, children: a == null ? void 0 : a.afterLabel }) : a == null ? void 0 : a.afterLabel })
1451
- ] }),
1452
- /* @__PURE__ */ c(L, { sx: O.textfieldWrapper, children: /* @__PURE__ */ c(
1453
- Ze,
1454
- {
1455
- title: m && /* @__PURE__ */ j(V, { type: "subtitleSmall", textColor: "white", children: [
1456
- /* @__PURE__ */ c(Se, { sx: O.errorIcon }),
1457
- m
1458
- ] }),
1459
- placement: "bottom",
1460
- arrow: !0,
1461
- componentsProps: {
1462
- tooltip: {
1463
- sx: O.tooltip
1464
- },
1465
- popper: {
1466
- sx: O.tooltipPopper
1467
- }
1468
- },
1469
- children: /* @__PURE__ */ c(
1470
- ro,
1471
- {
1472
- id: `form-input-${o}`,
1473
- autoFocus: I,
1474
- name: o,
1475
- type: t,
1476
- select: t === "select",
1477
- value: s,
1478
- onChange: M,
1479
- placeholder: l,
1480
- required: p,
1481
- disabled: y,
1482
- error: h,
1483
- InputProps: {
1484
- startAdornment: /* @__PURE__ */ c(de, { position: "start", children: a == null ? void 0 : a.beforeInput }),
1485
- endAdornment: /* @__PURE__ */ c(de, { position: "end", children: a == null ? void 0 : a.afterInput })
1486
- },
1487
- SelectProps: {
1488
- renderValue: (u) => {
1489
- const C = v == null ? void 0 : v.find(
1490
- (R) => typeof R == "object" ? R.value === u : R === u
1491
- );
1492
- return typeof C == "object" ? C.name : C;
1493
- },
1494
- MenuProps: {
1495
- PaperProps: {
1496
- sx: O.selectDropdown
1497
- }
1498
- }
1499
- },
1500
- sx: T,
1501
- children: t === "select" && (v == null ? void 0 : v.map((u) => {
1502
- const C = typeof u == "object", R = C ? u.value === s : u === s, $ = {
1503
- display: "flex",
1504
- justifyContent: "space-between",
1505
- alignItems: "center",
1506
- color: R ? "black" : K.darkGrey,
1507
- gap: "1rem"
1508
- };
1509
- return /* @__PURE__ */ j(
1510
- Ho,
1511
- {
1512
- value: C ? u.value : u,
1513
- sx: $,
1514
- children: [
1515
- C ? u.name : u,
1516
- R && /* @__PURE__ */ c("img", { src: br, alt: "selected-option" })
1517
- ]
1518
- },
1519
- C ? u.name : u
1520
- );
1521
- }))
1522
- }
1523
- )
1524
- }
1525
- ) })
1526
- ] }) : /* @__PURE__ */ c(Be, {});
21
+ function I(h) {
22
+ d(t, h.target.value);
23
+ }
24
+ return o === "custom" ? null : o === "radio" ? /* @__PURE__ */ c(
25
+ j,
26
+ {
27
+ name: t,
28
+ label: u,
29
+ value: f,
30
+ options: n,
31
+ error: i,
32
+ helperText: m,
33
+ handleInputChange: I,
34
+ required: r,
35
+ inputAdornments: a
36
+ }
37
+ ) : /* @__PURE__ */ c(
38
+ C,
39
+ {
40
+ name: t,
41
+ label: u,
42
+ type: o,
43
+ value: f,
44
+ handleInputChange: I,
45
+ placeholder: p,
46
+ required: r,
47
+ disabled: g,
48
+ options: n,
49
+ optionsResponseHandler: l,
50
+ api_endpoint: s,
51
+ error: i,
52
+ helperText: m,
53
+ inputAdornments: a,
54
+ autofocus: x
55
+ }
56
+ );
1527
57
  };
1528
58
  export {
1529
- $r as default
59
+ v as default
1530
60
  };