@loopr-ai/craft 0.8.3 → 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 +2 -2
  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
@@ -0,0 +1,1053 @@
1
+ import { jsx as d, jsxs as j, Fragment as Ce } from "react/jsx-runtime";
2
+ import { M as K, T as Q } from "../../../../index-ae3eb123.js";
3
+ import Re from "../ErrorMessage/index.js";
4
+ import ke from "../Form.styles.js";
5
+ import Oe from "../Label/index.js";
6
+ import X from "./RadioInput.styles.js";
7
+ import { B as Pe } from "../../../../Box-96e795c4.js";
8
+ import { P as e, h as xe, a as u, j as Y, r as U, k as Se, m as Fe, n as Ne, _ as G, o as ee, g as _, b as I, f as Te } from "../../../../createTheme-d2329909.js";
9
+ import * as h from "react";
10
+ import { u as te, c as we, a as $e } from "../../../../useControlled-4e337b2f.js";
11
+ import { r as A, u as je } from "../../../../TransitionGroupContext-21923db7.js";
12
+ import { i as Be, j as Ie, c as E, e as q, g as z, s as O, b as L, r as Ee } from "../../../../styled-8f7db30d.js";
13
+ import { u as W, f as se } from "../../../../useFormControl-b25c5813.js";
14
+ import { e as Ge } from "../../../../extendSxProp-f6cb682b.js";
15
+ import { B as Me } from "../../../../ButtonBase-46c20f20.js";
16
+ import { c as ae } from "../../../../createSvgIcon-b444ce70.js";
17
+ const Ve = Be(), _e = Ve, qe = ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"], ze = xe(), Le = _e("div", {
18
+ name: "MuiStack",
19
+ slot: "Root",
20
+ overridesResolver: (o, r) => r.root
21
+ });
22
+ function De(o) {
23
+ return Ie({
24
+ props: o,
25
+ name: "MuiStack",
26
+ defaultTheme: ze
27
+ });
28
+ }
29
+ function Ue(o, r) {
30
+ const n = h.Children.toArray(o).filter(Boolean);
31
+ return n.reduce((t, s, a) => (t.push(s), a < n.length - 1 && t.push(/* @__PURE__ */ h.cloneElement(r, {
32
+ key: `separator-${a}`
33
+ })), t), []);
34
+ }
35
+ const Ae = (o) => ({
36
+ row: "Left",
37
+ "row-reverse": "Right",
38
+ column: "Top",
39
+ "column-reverse": "Bottom"
40
+ })[o], We = ({
41
+ ownerState: o,
42
+ theme: r
43
+ }) => {
44
+ let n = u({
45
+ display: "flex",
46
+ flexDirection: "column"
47
+ }, Y({
48
+ theme: r
49
+ }, U({
50
+ values: o.direction,
51
+ breakpoints: r.breakpoints.values
52
+ }), (t) => ({
53
+ flexDirection: t
54
+ })));
55
+ if (o.spacing) {
56
+ const t = Se(r), s = Object.keys(r.breakpoints.values).reduce((l, c) => ((typeof o.spacing == "object" && o.spacing[c] != null || typeof o.direction == "object" && o.direction[c] != null) && (l[c] = !0), l), {}), a = U({
57
+ values: o.direction,
58
+ base: s
59
+ }), f = U({
60
+ values: o.spacing,
61
+ base: s
62
+ });
63
+ typeof a == "object" && Object.keys(a).forEach((l, c, p) => {
64
+ if (!a[l]) {
65
+ const b = c > 0 ? a[p[c - 1]] : "column";
66
+ a[l] = b;
67
+ }
68
+ }), n = Fe(n, Y({
69
+ theme: r
70
+ }, f, (l, c) => o.useFlexGap ? {
71
+ gap: ee(t, l)
72
+ } : {
73
+ // The useFlexGap={false} implement relies on each child to give up control of the margin.
74
+ // We need to reset the margin to avoid double spacing.
75
+ "& > :not(style):not(style)": {
76
+ margin: 0
77
+ },
78
+ "& > :not(style) ~ :not(style)": {
79
+ [`margin${Ae(c ? a[c] : o.direction)}`]: ee(t, l)
80
+ }
81
+ }));
82
+ }
83
+ return n = Ne(r.breakpoints, n), n;
84
+ };
85
+ function He(o = {}) {
86
+ const {
87
+ // This will allow adding custom styled fn (for example for custom sx style function)
88
+ createStyledComponent: r = Le,
89
+ useThemeProps: n = De,
90
+ componentName: t = "MuiStack"
91
+ } = o, s = () => q({
92
+ root: ["root"]
93
+ }, (l) => _(t, l), {}), a = r(We), f = /* @__PURE__ */ h.forwardRef(function(l, c) {
94
+ const p = n(l), y = Ge(p), {
95
+ component: b = "div",
96
+ direction: R = "column",
97
+ spacing: k = 0,
98
+ divider: C,
99
+ children: i,
100
+ className: g,
101
+ useFlexGap: v = !1
102
+ } = y, S = G(y, qe), P = {
103
+ direction: R,
104
+ spacing: k,
105
+ useFlexGap: v
106
+ }, w = s();
107
+ return /* @__PURE__ */ d(a, u({
108
+ as: b,
109
+ ownerState: P,
110
+ ref: c,
111
+ className: E(w.root, g)
112
+ }, S, {
113
+ children: C ? Ue(i, C) : i
114
+ }));
115
+ });
116
+ return process.env.NODE_ENV !== "production" && (f.propTypes = {
117
+ children: e.node,
118
+ direction: e.oneOfType([e.oneOf(["column-reverse", "column", "row-reverse", "row"]), e.arrayOf(e.oneOf(["column-reverse", "column", "row-reverse", "row"])), e.object]),
119
+ divider: e.node,
120
+ spacing: e.oneOfType([e.arrayOf(e.oneOfType([e.number, e.string])), e.number, e.object, e.string]),
121
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
122
+ }), f;
123
+ }
124
+ function Ze(o) {
125
+ return _("PrivateSwitchBase", o);
126
+ }
127
+ z("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
128
+ const Je = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"], Ke = (o) => {
129
+ const {
130
+ classes: r,
131
+ checked: n,
132
+ disabled: t,
133
+ edge: s
134
+ } = o, a = {
135
+ root: ["root", n && "checked", t && "disabled", s && `edge${I(s)}`],
136
+ input: ["input"]
137
+ };
138
+ return q(a, Ze, r);
139
+ }, Qe = O(Me)(({
140
+ ownerState: o
141
+ }) => u({
142
+ padding: 9,
143
+ borderRadius: "50%"
144
+ }, o.edge === "start" && {
145
+ marginLeft: o.size === "small" ? -3 : -12
146
+ }, o.edge === "end" && {
147
+ marginRight: o.size === "small" ? -3 : -12
148
+ })), Xe = O("input")({
149
+ cursor: "inherit",
150
+ position: "absolute",
151
+ opacity: 0,
152
+ width: "100%",
153
+ height: "100%",
154
+ top: 0,
155
+ left: 0,
156
+ margin: 0,
157
+ padding: 0,
158
+ zIndex: 1
159
+ }), ce = /* @__PURE__ */ h.forwardRef(function(r, n) {
160
+ const {
161
+ autoFocus: t,
162
+ checked: s,
163
+ checkedIcon: a,
164
+ className: f,
165
+ defaultChecked: m,
166
+ disabled: l,
167
+ disableFocusRipple: c = !1,
168
+ edge: p = !1,
169
+ icon: y,
170
+ id: b,
171
+ inputProps: R,
172
+ inputRef: k,
173
+ name: C,
174
+ onBlur: i,
175
+ onChange: g,
176
+ onFocus: v,
177
+ readOnly: S,
178
+ required: P = !1,
179
+ tabIndex: w,
180
+ type: F,
181
+ value: B
182
+ } = r, N = G(r, Je), [$, be] = te({
183
+ controlled: s,
184
+ default: !!m,
185
+ name: "SwitchBase",
186
+ state: "checked"
187
+ }), T = W(), he = (x) => {
188
+ v && v(x), T && T.onFocus && T.onFocus(x);
189
+ }, ye = (x) => {
190
+ i && i(x), T && T.onBlur && T.onBlur(x);
191
+ }, ge = (x) => {
192
+ if (x.nativeEvent.defaultPrevented)
193
+ return;
194
+ const J = x.target.checked;
195
+ be(J), g && g(x, J);
196
+ };
197
+ let M = l;
198
+ T && typeof M > "u" && (M = T.disabled);
199
+ const ve = F === "checkbox" || F === "radio", D = u({}, r, {
200
+ checked: $,
201
+ disabled: M,
202
+ disableFocusRipple: c,
203
+ edge: p
204
+ }), Z = Ke(D);
205
+ return /* @__PURE__ */ j(Qe, u({
206
+ component: "span",
207
+ className: E(Z.root, f),
208
+ centerRipple: !0,
209
+ focusRipple: !c,
210
+ disabled: M,
211
+ tabIndex: null,
212
+ role: void 0,
213
+ onFocus: he,
214
+ onBlur: ye,
215
+ ownerState: D,
216
+ ref: n
217
+ }, N, {
218
+ children: [/* @__PURE__ */ d(Xe, u({
219
+ autoFocus: t,
220
+ checked: s,
221
+ defaultChecked: m,
222
+ className: Z.input,
223
+ disabled: M,
224
+ id: ve ? b : void 0,
225
+ name: C,
226
+ onChange: ge,
227
+ readOnly: S,
228
+ ref: k,
229
+ required: P,
230
+ ownerState: D,
231
+ tabIndex: w,
232
+ type: F
233
+ }, F === "checkbox" && B === void 0 ? {} : {
234
+ value: B
235
+ }, R)), $ ? a : y]
236
+ }));
237
+ });
238
+ process.env.NODE_ENV !== "production" && (ce.propTypes = {
239
+ /**
240
+ * If `true`, the `input` element is focused during the first mount.
241
+ */
242
+ autoFocus: e.bool,
243
+ /**
244
+ * If `true`, the component is checked.
245
+ */
246
+ checked: e.bool,
247
+ /**
248
+ * The icon to display when the component is checked.
249
+ */
250
+ checkedIcon: e.node.isRequired,
251
+ /**
252
+ * Override or extend the styles applied to the component.
253
+ * See [CSS API](#css) below for more details.
254
+ */
255
+ classes: e.object,
256
+ /**
257
+ * @ignore
258
+ */
259
+ className: e.string,
260
+ /**
261
+ * @ignore
262
+ */
263
+ defaultChecked: e.bool,
264
+ /**
265
+ * If `true`, the component is disabled.
266
+ */
267
+ disabled: e.bool,
268
+ /**
269
+ * If `true`, the keyboard focus ripple is disabled.
270
+ * @default false
271
+ */
272
+ disableFocusRipple: e.bool,
273
+ /**
274
+ * If given, uses a negative margin to counteract the padding on one
275
+ * side (this is often helpful for aligning the left or right
276
+ * side of the icon with content above or below, without ruining the border
277
+ * size and shape).
278
+ * @default false
279
+ */
280
+ edge: e.oneOf(["end", "start", !1]),
281
+ /**
282
+ * The icon to display when the component is unchecked.
283
+ */
284
+ icon: e.node.isRequired,
285
+ /**
286
+ * The id of the `input` element.
287
+ */
288
+ id: e.string,
289
+ /**
290
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
291
+ */
292
+ inputProps: e.object,
293
+ /**
294
+ * Pass a ref to the `input` element.
295
+ */
296
+ inputRef: A,
297
+ /*
298
+ * @ignore
299
+ */
300
+ name: e.string,
301
+ /**
302
+ * @ignore
303
+ */
304
+ onBlur: e.func,
305
+ /**
306
+ * Callback fired when the state is changed.
307
+ *
308
+ * @param {object} event The event source of the callback.
309
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
310
+ */
311
+ onChange: e.func,
312
+ /**
313
+ * @ignore
314
+ */
315
+ onFocus: e.func,
316
+ /**
317
+ * It prevents the user from changing the value of the field
318
+ * (not from interacting with the field).
319
+ */
320
+ readOnly: e.bool,
321
+ /**
322
+ * If `true`, the `input` element is required.
323
+ */
324
+ required: e.bool,
325
+ /**
326
+ * The system prop that allows defining system overrides as well as additional CSS styles.
327
+ */
328
+ sx: e.object,
329
+ /**
330
+ * @ignore
331
+ */
332
+ tabIndex: e.oneOfType([e.number, e.string]),
333
+ /**
334
+ * The input component prop `type`.
335
+ */
336
+ type: e.string.isRequired,
337
+ /**
338
+ * The value of the component.
339
+ */
340
+ value: e.any
341
+ });
342
+ const Ye = ce, le = He({
343
+ createStyledComponent: O("div", {
344
+ name: "MuiStack",
345
+ slot: "Root",
346
+ overridesResolver: (o, r) => r.root
347
+ }),
348
+ useThemeProps: (o) => L({
349
+ props: o,
350
+ name: "MuiStack"
351
+ })
352
+ });
353
+ process.env.NODE_ENV !== "production" && (le.propTypes = {
354
+ // ----------------------------- Warning --------------------------------
355
+ // | These PropTypes are generated from the TypeScript type definitions |
356
+ // | To update them edit the d.ts file and run "yarn proptypes" |
357
+ // ----------------------------------------------------------------------
358
+ /**
359
+ * The content of the component.
360
+ */
361
+ children: e.node,
362
+ /**
363
+ * The component used for the root node.
364
+ * Either a string to use a HTML element or a component.
365
+ */
366
+ component: e.elementType,
367
+ /**
368
+ * Defines the `flex-direction` style property.
369
+ * It is applied for all screen sizes.
370
+ * @default 'column'
371
+ */
372
+ direction: e.oneOfType([e.oneOf(["column-reverse", "column", "row-reverse", "row"]), e.arrayOf(e.oneOf(["column-reverse", "column", "row-reverse", "row"])), e.object]),
373
+ /**
374
+ * Add an element between each child.
375
+ */
376
+ divider: e.node,
377
+ /**
378
+ * Defines the space between immediate children.
379
+ * @default 0
380
+ */
381
+ spacing: e.oneOfType([e.arrayOf(e.oneOfType([e.number, e.string])), e.number, e.object, e.string]),
382
+ /**
383
+ * The system prop, which allows defining system overrides as well as additional CSS styles.
384
+ */
385
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
386
+ /**
387
+ * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
388
+ *
389
+ * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
390
+ * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
391
+ *
392
+ * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
393
+ * @default false
394
+ */
395
+ useFlexGap: e.bool
396
+ });
397
+ const eo = le;
398
+ function oo(o) {
399
+ return _("MuiFormControlLabel", o);
400
+ }
401
+ const ro = z("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), V = ro, no = ["checked", "className", "componentsProps", "control", "disabled", "disableTypography", "inputRef", "label", "labelPlacement", "name", "onChange", "required", "slotProps", "value"], to = (o) => {
402
+ const {
403
+ classes: r,
404
+ disabled: n,
405
+ labelPlacement: t,
406
+ error: s,
407
+ required: a
408
+ } = o, f = {
409
+ root: ["root", n && "disabled", `labelPlacement${I(t)}`, s && "error", a && "required"],
410
+ label: ["label", n && "disabled"],
411
+ asterisk: ["asterisk", s && "error"]
412
+ };
413
+ return q(f, oo, r);
414
+ }, so = O("label", {
415
+ name: "MuiFormControlLabel",
416
+ slot: "Root",
417
+ overridesResolver: (o, r) => {
418
+ const {
419
+ ownerState: n
420
+ } = o;
421
+ return [{
422
+ [`& .${V.label}`]: r.label
423
+ }, r.root, r[`labelPlacement${I(n.labelPlacement)}`]];
424
+ }
425
+ })(({
426
+ theme: o,
427
+ ownerState: r
428
+ }) => u({
429
+ display: "inline-flex",
430
+ alignItems: "center",
431
+ cursor: "pointer",
432
+ // For correct alignment with the text.
433
+ verticalAlign: "middle",
434
+ WebkitTapHighlightColor: "transparent",
435
+ marginLeft: -11,
436
+ marginRight: 16,
437
+ // used for row presentation of radio/checkbox
438
+ [`&.${V.disabled}`]: {
439
+ cursor: "default"
440
+ }
441
+ }, r.labelPlacement === "start" && {
442
+ flexDirection: "row-reverse",
443
+ marginLeft: 16,
444
+ // used for row presentation of radio/checkbox
445
+ marginRight: -11
446
+ }, r.labelPlacement === "top" && {
447
+ flexDirection: "column-reverse",
448
+ marginLeft: 16
449
+ }, r.labelPlacement === "bottom" && {
450
+ flexDirection: "column",
451
+ marginLeft: 16
452
+ }, {
453
+ [`& .${V.label}`]: {
454
+ [`&.${V.disabled}`]: {
455
+ color: (o.vars || o).palette.text.disabled
456
+ }
457
+ }
458
+ })), ao = O("span", {
459
+ name: "MuiFormControlLabel",
460
+ slot: "Asterisk",
461
+ overridesResolver: (o, r) => r.asterisk
462
+ })(({
463
+ theme: o
464
+ }) => ({
465
+ [`&.${V.error}`]: {
466
+ color: (o.vars || o).palette.error.main
467
+ }
468
+ })), ie = /* @__PURE__ */ h.forwardRef(function(r, n) {
469
+ var t, s;
470
+ const a = L({
471
+ props: r,
472
+ name: "MuiFormControlLabel"
473
+ }), {
474
+ className: f,
475
+ componentsProps: m = {},
476
+ control: l,
477
+ disabled: c,
478
+ disableTypography: p,
479
+ label: y,
480
+ labelPlacement: b = "end",
481
+ required: R,
482
+ slotProps: k = {}
483
+ } = a, C = G(a, no), i = W(), g = (t = c ?? l.props.disabled) != null ? t : i == null ? void 0 : i.disabled, v = R ?? l.props.required, S = {
484
+ disabled: g,
485
+ required: v
486
+ };
487
+ ["checked", "name", "onChange", "value", "inputRef"].forEach(($) => {
488
+ typeof l.props[$] > "u" && typeof a[$] < "u" && (S[$] = a[$]);
489
+ });
490
+ const P = se({
491
+ props: a,
492
+ muiFormControl: i,
493
+ states: ["error"]
494
+ }), w = u({}, a, {
495
+ disabled: g,
496
+ labelPlacement: b,
497
+ required: v,
498
+ error: P.error
499
+ }), F = to(w), B = (s = k.typography) != null ? s : m.typography;
500
+ let N = y;
501
+ return N != null && N.type !== K && !p && (N = /* @__PURE__ */ d(K, u({
502
+ component: "span"
503
+ }, B, {
504
+ className: E(F.label, B == null ? void 0 : B.className),
505
+ children: N
506
+ }))), /* @__PURE__ */ j(so, u({
507
+ className: E(F.root, f),
508
+ ownerState: w,
509
+ ref: n
510
+ }, C, {
511
+ children: [/* @__PURE__ */ h.cloneElement(l, S), v ? /* @__PURE__ */ j(eo, {
512
+ direction: "row",
513
+ alignItems: "center",
514
+ children: [N, /* @__PURE__ */ j(ao, {
515
+ ownerState: w,
516
+ "aria-hidden": !0,
517
+ className: F.asterisk,
518
+ children: [" ", "*"]
519
+ })]
520
+ }) : N]
521
+ }));
522
+ });
523
+ process.env.NODE_ENV !== "production" && (ie.propTypes = {
524
+ // ----------------------------- Warning --------------------------------
525
+ // | These PropTypes are generated from the TypeScript type definitions |
526
+ // | To update them edit the d.ts file and run "yarn proptypes" |
527
+ // ----------------------------------------------------------------------
528
+ /**
529
+ * If `true`, the component appears selected.
530
+ */
531
+ checked: e.bool,
532
+ /**
533
+ * Override or extend the styles applied to the component.
534
+ */
535
+ classes: e.object,
536
+ /**
537
+ * @ignore
538
+ */
539
+ className: e.string,
540
+ /**
541
+ * The props used for each slot inside.
542
+ * @default {}
543
+ */
544
+ componentsProps: e.shape({
545
+ typography: e.object
546
+ }),
547
+ /**
548
+ * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
549
+ */
550
+ control: e.element.isRequired,
551
+ /**
552
+ * If `true`, the control is disabled.
553
+ */
554
+ disabled: e.bool,
555
+ /**
556
+ * If `true`, the label is rendered as it is passed without an additional typography node.
557
+ */
558
+ disableTypography: e.bool,
559
+ /**
560
+ * Pass a ref to the `input` element.
561
+ */
562
+ inputRef: A,
563
+ /**
564
+ * A text or an element to be used in an enclosing label element.
565
+ */
566
+ label: e.node,
567
+ /**
568
+ * The position of the label.
569
+ * @default 'end'
570
+ */
571
+ labelPlacement: e.oneOf(["bottom", "end", "start", "top"]),
572
+ /**
573
+ * @ignore
574
+ */
575
+ name: e.string,
576
+ /**
577
+ * Callback fired when the state is changed.
578
+ *
579
+ * @param {React.SyntheticEvent} event The event source of the callback.
580
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
581
+ */
582
+ onChange: e.func,
583
+ /**
584
+ * If `true`, the label will indicate that the `input` is required.
585
+ */
586
+ required: e.bool,
587
+ /**
588
+ * The props used for each slot inside.
589
+ * @default {}
590
+ */
591
+ slotProps: e.shape({
592
+ typography: e.object
593
+ }),
594
+ /**
595
+ * The system prop that allows defining system overrides as well as additional CSS styles.
596
+ */
597
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
598
+ /**
599
+ * The value of the component.
600
+ */
601
+ value: e.any
602
+ });
603
+ const co = ie;
604
+ function lo(o) {
605
+ return _("MuiFormGroup", o);
606
+ }
607
+ z("MuiFormGroup", ["root", "row", "error"]);
608
+ const io = ["className", "row"], uo = (o) => {
609
+ const {
610
+ classes: r,
611
+ row: n,
612
+ error: t
613
+ } = o;
614
+ return q({
615
+ root: ["root", n && "row", t && "error"]
616
+ }, lo, r);
617
+ }, po = O("div", {
618
+ name: "MuiFormGroup",
619
+ slot: "Root",
620
+ overridesResolver: (o, r) => {
621
+ const {
622
+ ownerState: n
623
+ } = o;
624
+ return [r.root, n.row && r.row];
625
+ }
626
+ })(({
627
+ ownerState: o
628
+ }) => u({
629
+ display: "flex",
630
+ flexDirection: "column",
631
+ flexWrap: "wrap"
632
+ }, o.row && {
633
+ flexDirection: "row"
634
+ })), de = /* @__PURE__ */ h.forwardRef(function(r, n) {
635
+ const t = L({
636
+ props: r,
637
+ name: "MuiFormGroup"
638
+ }), {
639
+ className: s,
640
+ row: a = !1
641
+ } = t, f = G(t, io), m = W(), l = se({
642
+ props: t,
643
+ muiFormControl: m,
644
+ states: ["error"]
645
+ }), c = u({}, t, {
646
+ row: a,
647
+ error: l.error
648
+ }), p = uo(c);
649
+ return /* @__PURE__ */ d(po, u({
650
+ className: E(p.root, s),
651
+ ownerState: c,
652
+ ref: n
653
+ }, f));
654
+ });
655
+ process.env.NODE_ENV !== "production" && (de.propTypes = {
656
+ // ----------------------------- Warning --------------------------------
657
+ // | These PropTypes are generated from the TypeScript type definitions |
658
+ // | To update them edit the d.ts file and run "yarn proptypes" |
659
+ // ----------------------------------------------------------------------
660
+ /**
661
+ * The content of the component.
662
+ */
663
+ children: e.node,
664
+ /**
665
+ * Override or extend the styles applied to the component.
666
+ */
667
+ classes: e.object,
668
+ /**
669
+ * @ignore
670
+ */
671
+ className: e.string,
672
+ /**
673
+ * Display group of elements in a compact row.
674
+ * @default false
675
+ */
676
+ row: e.bool,
677
+ /**
678
+ * The system prop that allows defining system overrides as well as additional CSS styles.
679
+ */
680
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
681
+ });
682
+ const fo = de, mo = ae(/* @__PURE__ */ d("path", {
683
+ 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"
684
+ }), "RadioButtonUnchecked"), bo = ae(/* @__PURE__ */ d("path", {
685
+ 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"
686
+ }), "RadioButtonChecked"), ho = O("span")({
687
+ position: "relative",
688
+ display: "flex"
689
+ }), yo = O(mo)({
690
+ // Scale applied to prevent dot misalignment in Safari
691
+ transform: "scale(1)"
692
+ }), go = O(bo)(({
693
+ theme: o,
694
+ ownerState: r
695
+ }) => u({
696
+ left: 0,
697
+ position: "absolute",
698
+ transform: "scale(0)",
699
+ transition: o.transitions.create("transform", {
700
+ easing: o.transitions.easing.easeIn,
701
+ duration: o.transitions.duration.shortest
702
+ })
703
+ }, r.checked && {
704
+ transform: "scale(1)",
705
+ transition: o.transitions.create("transform", {
706
+ easing: o.transitions.easing.easeOut,
707
+ duration: o.transitions.duration.shortest
708
+ })
709
+ }));
710
+ function H(o) {
711
+ const {
712
+ checked: r = !1,
713
+ classes: n = {},
714
+ fontSize: t
715
+ } = o, s = u({}, o, {
716
+ checked: r
717
+ });
718
+ return /* @__PURE__ */ j(ho, {
719
+ className: n.root,
720
+ ownerState: s,
721
+ children: [/* @__PURE__ */ d(yo, {
722
+ fontSize: t,
723
+ className: n.background,
724
+ ownerState: s
725
+ }), /* @__PURE__ */ d(go, {
726
+ fontSize: t,
727
+ className: n.dot,
728
+ ownerState: s
729
+ })]
730
+ });
731
+ }
732
+ process.env.NODE_ENV !== "production" && (H.propTypes = {
733
+ /**
734
+ * If `true`, the component is checked.
735
+ */
736
+ checked: e.bool,
737
+ /**
738
+ * Override or extend the styles applied to the component.
739
+ * See [CSS API](#css) below for more details.
740
+ */
741
+ classes: e.object,
742
+ /**
743
+ * The size of the component.
744
+ * `small` is equivalent to the dense radio styling.
745
+ */
746
+ fontSize: e.oneOf(["small", "medium"])
747
+ });
748
+ const ue = /* @__PURE__ */ h.createContext(void 0);
749
+ process.env.NODE_ENV !== "production" && (ue.displayName = "RadioGroupContext");
750
+ const pe = ue;
751
+ function vo() {
752
+ return h.useContext(pe);
753
+ }
754
+ function Co(o) {
755
+ return _("MuiRadio", o);
756
+ }
757
+ const Ro = z("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), oe = Ro, ko = ["checked", "checkedIcon", "color", "icon", "name", "onChange", "size", "className"], Oo = (o) => {
758
+ const {
759
+ classes: r,
760
+ color: n,
761
+ size: t
762
+ } = o, s = {
763
+ root: ["root", `color${I(n)}`, t !== "medium" && `size${I(t)}`]
764
+ };
765
+ return u({}, r, q(s, Co, r));
766
+ }, Po = O(Ye, {
767
+ shouldForwardProp: (o) => Ee(o) || o === "classes",
768
+ name: "MuiRadio",
769
+ slot: "Root",
770
+ overridesResolver: (o, r) => {
771
+ const {
772
+ ownerState: n
773
+ } = o;
774
+ return [r.root, r[`color${I(n.color)}`]];
775
+ }
776
+ })(({
777
+ theme: o,
778
+ ownerState: r
779
+ }) => u({
780
+ color: (o.vars || o).palette.text.secondary
781
+ }, !r.disableRipple && {
782
+ "&:hover": {
783
+ backgroundColor: o.vars ? `rgba(${r.color === "default" ? o.vars.palette.action.activeChannel : o.vars.palette[r.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})` : Te(r.color === "default" ? o.palette.action.active : o.palette[r.color].main, o.palette.action.hoverOpacity),
784
+ // Reset on touch devices, it doesn't add specificity
785
+ "@media (hover: none)": {
786
+ backgroundColor: "transparent"
787
+ }
788
+ }
789
+ }, r.color !== "default" && {
790
+ [`&.${oe.checked}`]: {
791
+ color: (o.vars || o).palette[r.color].main
792
+ }
793
+ }, {
794
+ [`&.${oe.disabled}`]: {
795
+ color: (o.vars || o).palette.action.disabled
796
+ }
797
+ }));
798
+ function xo(o, r) {
799
+ return typeof r == "object" && r !== null ? o === r : String(o) === String(r);
800
+ }
801
+ const re = /* @__PURE__ */ d(H, {
802
+ checked: !0
803
+ }), ne = /* @__PURE__ */ d(H, {}), fe = /* @__PURE__ */ h.forwardRef(function(r, n) {
804
+ var t, s;
805
+ const a = L({
806
+ props: r,
807
+ name: "MuiRadio"
808
+ }), {
809
+ checked: f,
810
+ checkedIcon: m = re,
811
+ color: l = "primary",
812
+ icon: c = ne,
813
+ name: p,
814
+ onChange: y,
815
+ size: b = "medium",
816
+ className: R
817
+ } = a, k = G(a, ko), C = u({}, a, {
818
+ color: l,
819
+ size: b
820
+ }), i = Oo(C), g = vo();
821
+ let v = f;
822
+ const S = we(y, g && g.onChange);
823
+ let P = p;
824
+ return g && (typeof v > "u" && (v = xo(g.value, a.value)), typeof P > "u" && (P = g.name)), /* @__PURE__ */ d(Po, u({
825
+ type: "radio",
826
+ icon: /* @__PURE__ */ h.cloneElement(c, {
827
+ fontSize: (t = ne.props.fontSize) != null ? t : b
828
+ }),
829
+ checkedIcon: /* @__PURE__ */ h.cloneElement(m, {
830
+ fontSize: (s = re.props.fontSize) != null ? s : b
831
+ }),
832
+ ownerState: C,
833
+ classes: i,
834
+ name: P,
835
+ checked: v,
836
+ onChange: S,
837
+ ref: n,
838
+ className: E(i.root, R)
839
+ }, k));
840
+ });
841
+ process.env.NODE_ENV !== "production" && (fe.propTypes = {
842
+ // ----------------------------- Warning --------------------------------
843
+ // | These PropTypes are generated from the TypeScript type definitions |
844
+ // | To update them edit the d.ts file and run "yarn proptypes" |
845
+ // ----------------------------------------------------------------------
846
+ /**
847
+ * If `true`, the component is checked.
848
+ */
849
+ checked: e.bool,
850
+ /**
851
+ * The icon to display when the component is checked.
852
+ * @default <RadioButtonIcon checked />
853
+ */
854
+ checkedIcon: e.node,
855
+ /**
856
+ * Override or extend the styles applied to the component.
857
+ */
858
+ classes: e.object,
859
+ /**
860
+ * @ignore
861
+ */
862
+ className: e.string,
863
+ /**
864
+ * The color of the component.
865
+ * It supports both default and custom theme colors, which can be added as shown in the
866
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
867
+ * @default 'primary'
868
+ */
869
+ color: e.oneOfType([e.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), e.string]),
870
+ /**
871
+ * If `true`, the component is disabled.
872
+ */
873
+ disabled: e.bool,
874
+ /**
875
+ * If `true`, the ripple effect is disabled.
876
+ * @default false
877
+ */
878
+ disableRipple: e.bool,
879
+ /**
880
+ * The icon to display when the component is unchecked.
881
+ * @default <RadioButtonIcon />
882
+ */
883
+ icon: e.node,
884
+ /**
885
+ * The id of the `input` element.
886
+ */
887
+ id: e.string,
888
+ /**
889
+ * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
890
+ */
891
+ inputProps: e.object,
892
+ /**
893
+ * Pass a ref to the `input` element.
894
+ */
895
+ inputRef: A,
896
+ /**
897
+ * Name attribute of the `input` element.
898
+ */
899
+ name: e.string,
900
+ /**
901
+ * Callback fired when the state is changed.
902
+ *
903
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
904
+ * You can pull out the new value by accessing `event.target.value` (string).
905
+ * You can pull out the new checked state by accessing `event.target.checked` (boolean).
906
+ */
907
+ onChange: e.func,
908
+ /**
909
+ * If `true`, the `input` element is required.
910
+ * @default false
911
+ */
912
+ required: e.bool,
913
+ /**
914
+ * The size of the component.
915
+ * `small` is equivalent to the dense radio styling.
916
+ * @default 'medium'
917
+ */
918
+ size: e.oneOfType([e.oneOf(["medium", "small"]), e.string]),
919
+ /**
920
+ * The system prop that allows defining system overrides as well as additional CSS styles.
921
+ */
922
+ sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
923
+ /**
924
+ * The value of the component. The DOM API casts this to a string.
925
+ */
926
+ value: e.any
927
+ });
928
+ const So = fe, Fo = ["actions", "children", "defaultValue", "name", "onChange", "value"], me = /* @__PURE__ */ h.forwardRef(function(r, n) {
929
+ const {
930
+ // private
931
+ // eslint-disable-next-line react/prop-types
932
+ actions: t,
933
+ children: s,
934
+ defaultValue: a,
935
+ name: f,
936
+ onChange: m,
937
+ value: l
938
+ } = r, c = G(r, Fo), p = h.useRef(null), [y, b] = te({
939
+ controlled: l,
940
+ default: a,
941
+ name: "RadioGroup"
942
+ });
943
+ h.useImperativeHandle(t, () => ({
944
+ focus: () => {
945
+ let i = p.current.querySelector("input:not(:disabled):checked");
946
+ i || (i = p.current.querySelector("input:not(:disabled)")), i && i.focus();
947
+ }
948
+ }), []);
949
+ const R = je(n, p), k = $e(f), C = h.useMemo(() => ({
950
+ name: k,
951
+ onChange(i) {
952
+ b(i.target.value), m && m(i, i.target.value);
953
+ },
954
+ value: y
955
+ }), [k, m, b, y]);
956
+ return /* @__PURE__ */ d(pe.Provider, {
957
+ value: C,
958
+ children: /* @__PURE__ */ d(fo, u({
959
+ role: "radiogroup",
960
+ ref: R
961
+ }, c, {
962
+ children: s
963
+ }))
964
+ });
965
+ });
966
+ process.env.NODE_ENV !== "production" && (me.propTypes = {
967
+ // ----------------------------- Warning --------------------------------
968
+ // | These PropTypes are generated from the TypeScript type definitions |
969
+ // | To update them edit the d.ts file and run "yarn proptypes" |
970
+ // ----------------------------------------------------------------------
971
+ /**
972
+ * The content of the component.
973
+ */
974
+ children: e.node,
975
+ /**
976
+ * The default value. Use when the component is not controlled.
977
+ */
978
+ defaultValue: e.any,
979
+ /**
980
+ * The name used to reference the value of the control.
981
+ * If you don't provide this prop, it falls back to a randomly generated name.
982
+ */
983
+ name: e.string,
984
+ /**
985
+ * Callback fired when a radio button is selected.
986
+ *
987
+ * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
988
+ * @param {string} value The value of the selected radio button.
989
+ * You can pull out the new value by accessing `event.target.value` (string).
990
+ */
991
+ onChange: e.func,
992
+ /**
993
+ * Value of the selected radio button. The DOM API casts this to a string.
994
+ */
995
+ value: e.any
996
+ });
997
+ const No = me, Uo = ({
998
+ name: o,
999
+ label: r,
1000
+ value: n,
1001
+ handleInputChange: t,
1002
+ options: s,
1003
+ required: a = !1,
1004
+ error: f = !1,
1005
+ inputAdornments: m,
1006
+ helperText: l
1007
+ }) => /* @__PURE__ */ j(Pe, { sx: ke.inputWrapper, children: [
1008
+ /* @__PURE__ */ d(
1009
+ Oe,
1010
+ {
1011
+ name: o,
1012
+ label: r,
1013
+ required: a,
1014
+ inputAdornments: m
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ d(
1018
+ No,
1019
+ {
1020
+ row: !0,
1021
+ name: "row-radio-buttons-group",
1022
+ value: n,
1023
+ onChange: t,
1024
+ sx: X.radioGroup,
1025
+ children: s == null ? void 0 : s.map((c) => {
1026
+ const p = typeof c == "object", y = p ? c.name : c, b = p ? c.value : c;
1027
+ return /* @__PURE__ */ d(
1028
+ co,
1029
+ {
1030
+ value: b,
1031
+ control: /* @__PURE__ */ d(So, { size: "small" }),
1032
+ label: /* @__PURE__ */ j(Ce, { children: [
1033
+ /* @__PURE__ */ d(Q, { type: "subtitleNormal", children: y }),
1034
+ p && c.description && /* @__PURE__ */ d(
1035
+ Q,
1036
+ {
1037
+ type: "subtitleNormal",
1038
+ sx: X.description,
1039
+ children: c.description
1040
+ }
1041
+ )
1042
+ ] })
1043
+ },
1044
+ y
1045
+ );
1046
+ })
1047
+ }
1048
+ ),
1049
+ f && /* @__PURE__ */ d(Re, { message: l || "" })
1050
+ ] });
1051
+ export {
1052
+ Uo as default
1053
+ };