@loopr-ai/craft 0.7.0 → 0.7.2

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 (34) hide show
  1. package/dist/Box-8cd400c2.js +58 -0
  2. package/dist/{ButtonBase-c303b1df.js → ButtonBase-fc1e48eb.js} +3 -3
  3. package/dist/{Grow-d188a215.js → Grow-a906cda2.js} +5 -5
  4. package/dist/{TextField-b13f5aff.js → TextField-a534df29.js} +7 -7
  5. package/dist/{TransitionGroupContext-7cd3ef83.js → TransitionGroupContext-ba502e63.js} +1 -1
  6. package/dist/{Typography-c0106ed0.js → Typography-65e5f8a8.js} +8 -8
  7. package/dist/{ZoomControllers-2e737c18.js → ZoomControllers-8a147df0.js} +1065 -1114
  8. package/dist/components/cell/AvatarGroup/index.js +3 -3
  9. package/dist/components/cell/Button/index.js +3 -3
  10. package/dist/components/cell/Chip/index.js +5 -5
  11. package/dist/components/cell/ProgressBar/index.js +3 -3
  12. package/dist/components/cell/Search/index.js +2 -2
  13. package/dist/components/cell/Typography/index.js +1 -1
  14. package/dist/components/organ/Form/FieldInput.js +115 -113
  15. package/dist/components/organ/Form/Form.interfaces.d.ts +2 -0
  16. package/dist/components/organ/Form/Form.styles.d.ts +2 -2
  17. package/dist/components/organ/Form/Form.styles.js +1 -1
  18. package/dist/components/organ/Form/Form.utils.d.ts +1 -0
  19. package/dist/components/organ/Form/Form.utils.js +20 -15
  20. package/dist/components/organ/Form/index.d.ts +3 -1
  21. package/dist/components/organ/Form/index.js +84 -72
  22. package/dist/components/organ/ZoomControlWithDrag/ZoomControllers.js +3 -2
  23. package/dist/components/organ/ZoomControlWithDrag/index.js +18 -17
  24. package/dist/{createSvgIcon-78477fc1.js → createSvgIcon-8e5d9dc7.js} +6 -6
  25. package/dist/{createSvgIcon-5180e4db.js → createSvgIcon-bb3d4825.js} +5 -5
  26. package/dist/{createTheme-54078d82.js → createTheme-ca1567c6.js} +4 -4
  27. package/dist/{dividerClasses-68f129df.js → dividerClasses-0233db5a.js} +2 -2
  28. package/dist/{exactProp-893ad662.js → exactProp-3d9df1ae.js} +1 -1
  29. package/dist/{extendSxProp-8c660b3a.js → extendSxProp-fc2654e5.js} +1 -1
  30. package/dist/global/theme.js +1 -1
  31. package/dist/providers/CraftThemeProvider.js +2 -2
  32. package/dist/{styled-2bc0b59e.js → styled-80b57810.js} +38 -38
  33. package/dist/{useTheme-e2efed29.js → useTheme-16446f25.js} +1 -1
  34. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  import { jsx as h, jsxs as G } from "react/jsx-runtime";
2
- import { g as I, a as l, _ as k, P as a } from "../../../createTheme-54078d82.js";
2
+ import { g as I, a as l, _ as k, P as a } from "../../../createTheme-ca1567c6.js";
3
3
  import * as g from "react";
4
- import { g as D, s as M, a as E, c as R, b as U, f as F } from "../../../styled-2bc0b59e.js";
5
- import { c as q } from "../../../createSvgIcon-5180e4db.js";
4
+ import { g as D, a as M, b as E, c as R, e as U, h as F } from "../../../styled-80b57810.js";
5
+ import { c as q } from "../../../createSvgIcon-bb3d4825.js";
6
6
  import { c as V } from "../../../chainPropTypes-004bf492.js";
7
7
  const B = q(/* @__PURE__ */ h("path", {
8
8
  d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"
@@ -1,9 +1,9 @@
1
1
  import { jsx as C, jsxs as F } from "react/jsx-runtime";
2
2
  import { getColorToHex as v } from "../../../global/colors.js";
3
- import { g as U, c as e, a as t, e as b, _ as D, P as a } from "../../../createTheme-54078d82.js";
3
+ import { g as U, b as e, a as t, f as b, _ as D, P as a } from "../../../createTheme-ca1567c6.js";
4
4
  import * as p from "react";
5
- import { g as H, s as y, r as A, e as q, a as J, c as R, b as K } from "../../../styled-2bc0b59e.js";
6
- import { B as Q } from "../../../ButtonBase-c303b1df.js";
5
+ import { g as H, a as y, r as A, f as q, b as J, c as R, e as K } from "../../../styled-80b57810.js";
6
+ import { B as Q } from "../../../ButtonBase-fc1e48eb.js";
7
7
  function X(o) {
8
8
  return U("MuiButton", o);
9
9
  }
@@ -1,11 +1,11 @@
1
1
  import { jsx as m, jsxs as Q } from "react/jsx-runtime";
2
2
  import * as v from "react";
3
3
  import { useMemo as L } from "react";
4
- import { g as X, c as r, a as f, e as b, _ as Y, P as l } from "../../../createTheme-54078d82.js";
5
- import { g as Z, s as U, a as w, c as k, b as oo } from "../../../styled-2bc0b59e.js";
6
- import { c as ao } from "../../../createSvgIcon-5180e4db.js";
7
- import { u as lo } from "../../../TransitionGroupContext-7cd3ef83.js";
8
- import { B as M } from "../../../ButtonBase-c303b1df.js";
4
+ import { g as X, b as r, a as f, f as b, _ as Y, P as l } from "../../../createTheme-ca1567c6.js";
5
+ import { g as Z, a as U, b as w, c as k, e as oo } from "../../../styled-80b57810.js";
6
+ import { c as ao } from "../../../createSvgIcon-bb3d4825.js";
7
+ import { u as lo } from "../../../TransitionGroupContext-ba502e63.js";
8
+ import { B as M } from "../../../ButtonBase-fc1e48eb.js";
9
9
  import { u as eo } from "../../../unsupportedProp-3dbf01f6.js";
10
10
  const ro = ao(/* @__PURE__ */ m("path", {
11
11
  d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
@@ -1,9 +1,9 @@
1
1
  import { jsxs as j, jsx as v } from "react/jsx-runtime";
2
2
  import { getColorToHex as $ } from "../../../global/colors.js";
3
- import { g as D, c as n, a as l, _ as q, P as o, l as E, b as U } from "../../../createTheme-54078d82.js";
3
+ import { g as D, b as n, a as l, _ as q, P as o, l as E, e as U } from "../../../createTheme-ca1567c6.js";
4
4
  import * as z from "react";
5
- import { g as w, s as h, a as A, c as F, b as K } from "../../../styled-2bc0b59e.js";
6
- import { u as V } from "../../../useTheme-e2efed29.js";
5
+ import { g as w, a as h, b as A, c as F, e as K } from "../../../styled-80b57810.js";
6
+ import { u as V } from "../../../useTheme-16446f25.js";
7
7
  import { k as P, c as x } from "../../../emotion-react.browser.esm-ff33c213.js";
8
8
  function S(r) {
9
9
  return D("MuiLinearProgress", r);
@@ -1,6 +1,6 @@
1
1
  import f, { jsx as r } from "react/jsx-runtime";
2
- import { r as c, i as p } from "../../../createSvgIcon-78477fc1.js";
3
- import { T as m } from "../../../TextField-b13f5aff.js";
2
+ import { r as c, i as p } from "../../../createSvgIcon-8e5d9dc7.js";
3
+ import { T as m } from "../../../TextField-a534df29.js";
4
4
  var e = {}, v = p;
5
5
  Object.defineProperty(e, "__esModule", {
6
6
  value: !0
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { getColorToHex as e } from "../../../global/colors.js";
3
3
  import { fontCustomizations as i } from "../../../global/theme.js";
4
- import { M as f } from "../../../Typography-c0106ed0.js";
4
+ import { M as f } from "../../../Typography-65e5f8a8.js";
5
5
  const c = ({
6
6
  type: o = "bodyText",
7
7
  textColor: r = "black",
@@ -1,24 +1,24 @@
1
- import { jsx as c, jsxs as W, Fragment as q } from "react/jsx-runtime";
1
+ import { jsx as c, jsxs as q, Fragment as H } from "react/jsx-runtime";
2
2
  import * as x from "react";
3
- import { useState as H, useCallback as J, useEffect as K } from "react";
4
- import { u as Q, F as X, L, T as Y } from "../../../TextField-b13f5aff.js";
5
- import { g as S, a as v, _ as B, P as t, c as N, e as M } from "../../../createTheme-54078d82.js";
6
- import { g as T, s as U, a as z, c as P, b as _, r as Z } from "../../../styled-2bc0b59e.js";
7
- import { M as ee } from "../../../Typography-c0106ed0.js";
8
- import { B as te } from "../../../ButtonBase-c303b1df.js";
9
- import { d as A } from "../../../dividerClasses-68f129df.js";
10
- import { a as oe, u as se } from "../../../TransitionGroupContext-7cd3ef83.js";
11
- function ne(e) {
12
- return S("MuiInputAdornment", e);
3
+ import { useState as J, useCallback as K, useEffect as Q } from "react";
4
+ import { u as X, F as Y, L as A, T as Z } from "../../../TextField-a534df29.js";
5
+ import { g as B, a as b, _ as U, P as t, b as P, f as M } from "../../../createTheme-ca1567c6.js";
6
+ import { g as T, a as z, b as _, c as F, e as D, r as ee } from "../../../styled-80b57810.js";
7
+ import { M as te } from "../../../Typography-65e5f8a8.js";
8
+ import { B as oe } from "../../../ButtonBase-fc1e48eb.js";
9
+ import { d as j } from "../../../dividerClasses-0233db5a.js";
10
+ import { a as se, u as ne } from "../../../TransitionGroupContext-ba502e63.js";
11
+ function ae(e) {
12
+ return B("MuiInputAdornment", e);
13
13
  }
14
- const ae = T("MuiInputAdornment", ["root", "filled", "standard", "outlined", "positionStart", "positionEnd", "disablePointerEvents", "hiddenLabel", "sizeSmall"]), j = ae;
15
- var R;
16
- const re = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"], ie = (e, o) => {
14
+ const re = T("MuiInputAdornment", ["root", "filled", "standard", "outlined", "positionStart", "positionEnd", "disablePointerEvents", "hiddenLabel", "sizeSmall"]), R = re;
15
+ var k;
16
+ const ie = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"], le = (e, o) => {
17
17
  const {
18
18
  ownerState: s
19
19
  } = e;
20
- return [o.root, o[`position${N(s.position)}`], s.disablePointerEvents === !0 && o.disablePointerEvents, o[s.variant]];
21
- }, le = (e) => {
20
+ return [o.root, o[`position${P(s.position)}`], s.disablePointerEvents === !0 && o.disablePointerEvents, o[s.variant]];
21
+ }, ce = (e) => {
22
22
  const {
23
23
  classes: o,
24
24
  disablePointerEvents: s,
@@ -27,17 +27,17 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
27
27
  size: d,
28
28
  variant: l
29
29
  } = e, m = {
30
- root: ["root", s && "disablePointerEvents", r && `position${N(r)}`, l, a && "hiddenLabel", d && `size${N(d)}`]
30
+ root: ["root", s && "disablePointerEvents", r && `position${P(r)}`, l, a && "hiddenLabel", d && `size${P(d)}`]
31
31
  };
32
- return _(m, ne, o);
33
- }, ce = U("div", {
32
+ return D(m, ae, o);
33
+ }, de = z("div", {
34
34
  name: "MuiInputAdornment",
35
35
  slot: "Root",
36
- overridesResolver: ie
36
+ overridesResolver: le
37
37
  })(({
38
38
  theme: e,
39
39
  ownerState: o
40
- }) => v({
40
+ }) => b({
41
41
  display: "flex",
42
42
  height: "0.01em",
43
43
  // Fix IE11 flexbox alignment. To remove at some point.
@@ -47,7 +47,7 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
47
47
  color: (e.vars || e).palette.action.active
48
48
  }, o.variant === "filled" && {
49
49
  // Styles applied to the root element if `variant="filled"`.
50
- [`&.${j.positionStart}&:not(.${j.hiddenLabel})`]: {
50
+ [`&.${R.positionStart}&:not(.${R.hiddenLabel})`]: {
51
51
  marginTop: 16
52
52
  }
53
53
  }, o.position === "start" && {
@@ -59,8 +59,8 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
59
59
  }, o.disablePointerEvents === !0 && {
60
60
  // Styles applied to the root element if `disablePointerEvents={true}`.
61
61
  pointerEvents: "none"
62
- })), D = /* @__PURE__ */ x.forwardRef(function(o, s) {
63
- const a = z({
62
+ })), G = /* @__PURE__ */ x.forwardRef(function(o, s) {
63
+ const a = _({
64
64
  props: o,
65
65
  name: "MuiInputAdornment"
66
66
  }), {
@@ -69,33 +69,33 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
69
69
  component: l = "div",
70
70
  disablePointerEvents: m = !1,
71
71
  disableTypography: u = !1,
72
- position: C,
72
+ position: I,
73
73
  variant: f
74
- } = a, p = B(a, re), i = Q() || {};
75
- let g = f;
76
- f && i.variant && process.env.NODE_ENV !== "production" && f === i.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), i && !g && (g = i.variant);
77
- const y = v({}, a, {
74
+ } = a, p = U(a, ie), i = X() || {};
75
+ let v = f;
76
+ f && i.variant && process.env.NODE_ENV !== "production" && f === i.variant && console.error("MUI: The `InputAdornment` variant infers the variant prop you do not have to provide one."), i && !v && (v = i.variant);
77
+ const g = b({}, a, {
78
78
  hiddenLabel: i.hiddenLabel,
79
79
  size: i.size,
80
80
  disablePointerEvents: m,
81
- position: C,
82
- variant: g
83
- }), b = le(y);
84
- return /* @__PURE__ */ c(X.Provider, {
81
+ position: I,
82
+ variant: v
83
+ }), C = ce(g);
84
+ return /* @__PURE__ */ c(Y.Provider, {
85
85
  value: null,
86
- children: /* @__PURE__ */ c(ce, v({
86
+ children: /* @__PURE__ */ c(de, b({
87
87
  as: l,
88
- ownerState: y,
89
- className: P(b.root, d),
88
+ ownerState: g,
89
+ className: F(C.root, d),
90
90
  ref: s
91
91
  }, p, {
92
- children: typeof r == "string" && !u ? /* @__PURE__ */ c(ee, {
92
+ children: typeof r == "string" && !u ? /* @__PURE__ */ c(te, {
93
93
  color: "text.secondary",
94
94
  children: r
95
- }) : /* @__PURE__ */ W(x.Fragment, {
96
- children: [C === "start" ? (
95
+ }) : /* @__PURE__ */ q(x.Fragment, {
96
+ children: [I === "start" ? (
97
97
  /* notranslate needed while Google Translate will not fix zero-width space issue */
98
- R || (R = /* @__PURE__ */ c("span", {
98
+ k || (k = /* @__PURE__ */ c("span", {
99
99
  className: "notranslate",
100
100
  children: "​"
101
101
  }))
@@ -104,7 +104,7 @@ const re = ["children", "className", "component", "disablePointerEvents", "disab
104
104
  }))
105
105
  });
106
106
  });
107
- process.env.NODE_ENV !== "production" && (D.propTypes = {
107
+ process.env.NODE_ENV !== "production" && (G.propTypes = {
108
108
  // ----------------------------- Warning --------------------------------
109
109
  // | These PropTypes are generated from the TypeScript type definitions |
110
110
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -152,16 +152,16 @@ process.env.NODE_ENV !== "production" && (D.propTypes = {
152
152
  */
153
153
  variant: t.oneOf(["filled", "outlined", "standard"])
154
154
  });
155
- const k = D, de = T("MuiListItemIcon", ["root", "alignItemsFlexStart"]), V = de, pe = T("MuiListItemText", ["root", "multiline", "dense", "inset", "primary", "secondary"]), w = pe;
156
- function ue(e) {
157
- return S("MuiMenuItem", e);
155
+ const V = G, pe = T("MuiListItemIcon", ["root", "alignItemsFlexStart"]), w = pe, ue = T("MuiListItemText", ["root", "multiline", "dense", "inset", "primary", "secondary"]), S = ue;
156
+ function me(e) {
157
+ return B("MuiMenuItem", e);
158
158
  }
159
- const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divider", "gutters", "selected"]), O = me, fe = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"], be = (e, o) => {
159
+ const fe = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divider", "gutters", "selected"]), h = fe, be = ["autoFocus", "component", "dense", "divider", "disableGutters", "focusVisibleClassName", "role", "tabIndex", "className"], ve = (e, o) => {
160
160
  const {
161
161
  ownerState: s
162
162
  } = e;
163
163
  return [o.root, s.dense && o.dense, s.divider && o.divider, !s.disableGutters && o.gutters];
164
- }, ve = (e) => {
164
+ }, ge = (e) => {
165
165
  const {
166
166
  disabled: o,
167
167
  dense: s,
@@ -169,19 +169,19 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
169
169
  disableGutters: r,
170
170
  selected: d,
171
171
  classes: l
172
- } = e, u = _({
172
+ } = e, u = D({
173
173
  root: ["root", s && "dense", o && "disabled", !r && "gutters", a && "divider", d && "selected"]
174
- }, ue, l);
175
- return v({}, l, u);
176
- }, ge = U(te, {
177
- shouldForwardProp: (e) => Z(e) || e === "classes",
174
+ }, me, l);
175
+ return b({}, l, u);
176
+ }, ye = z(oe, {
177
+ shouldForwardProp: (e) => ee(e) || e === "classes",
178
178
  name: "MuiMenuItem",
179
179
  slot: "Root",
180
- overridesResolver: be
180
+ overridesResolver: ve
181
181
  })(({
182
182
  theme: e,
183
183
  ownerState: o
184
- }) => v({}, e.typography.body1, {
184
+ }) => b({}, e.typography.body1, {
185
185
  display: "flex",
186
186
  justifyContent: "flex-start",
187
187
  alignItems: "center",
@@ -207,57 +207,57 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
207
207
  backgroundColor: "transparent"
208
208
  }
209
209
  },
210
- [`&.${O.selected}`]: {
210
+ [`&.${h.selected}`]: {
211
211
  backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : M(e.palette.primary.main, e.palette.action.selectedOpacity),
212
- [`&.${O.focusVisible}`]: {
212
+ [`&.${h.focusVisible}`]: {
213
213
  backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : M(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
214
214
  }
215
215
  },
216
- [`&.${O.selected}:hover`]: {
216
+ [`&.${h.selected}:hover`]: {
217
217
  backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : M(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
218
218
  // Reset on touch devices, it doesn't add specificity
219
219
  "@media (hover: none)": {
220
220
  backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : M(e.palette.primary.main, e.palette.action.selectedOpacity)
221
221
  }
222
222
  },
223
- [`&.${O.focusVisible}`]: {
223
+ [`&.${h.focusVisible}`]: {
224
224
  backgroundColor: (e.vars || e).palette.action.focus
225
225
  },
226
- [`&.${O.disabled}`]: {
226
+ [`&.${h.disabled}`]: {
227
227
  opacity: (e.vars || e).palette.action.disabledOpacity
228
228
  },
229
- [`& + .${A.root}`]: {
229
+ [`& + .${j.root}`]: {
230
230
  marginTop: e.spacing(1),
231
231
  marginBottom: e.spacing(1)
232
232
  },
233
- [`& + .${A.inset}`]: {
233
+ [`& + .${j.inset}`]: {
234
234
  marginLeft: 52
235
235
  },
236
- [`& .${w.root}`]: {
236
+ [`& .${S.root}`]: {
237
237
  marginTop: 0,
238
238
  marginBottom: 0
239
239
  },
240
- [`& .${w.inset}`]: {
240
+ [`& .${S.inset}`]: {
241
241
  paddingLeft: 36
242
242
  },
243
- [`& .${V.root}`]: {
243
+ [`& .${w.root}`]: {
244
244
  minWidth: 36
245
245
  }
246
246
  }, !o.dense && {
247
247
  [e.breakpoints.up("sm")]: {
248
248
  minHeight: "auto"
249
249
  }
250
- }, o.dense && v({
250
+ }, o.dense && b({
251
251
  minHeight: 32,
252
252
  // https://m2.material.io/components/menus#specs > Dense
253
253
  paddingTop: 4,
254
254
  paddingBottom: 4
255
255
  }, e.typography.body2, {
256
- [`& .${V.root} svg`]: {
256
+ [`& .${w.root} svg`]: {
257
257
  fontSize: "1.25rem"
258
258
  }
259
- }))), G = /* @__PURE__ */ x.forwardRef(function(o, s) {
260
- const a = z({
259
+ }))), W = /* @__PURE__ */ x.forwardRef(function(o, s) {
260
+ const a = _({
261
261
  props: o,
262
262
  name: "MuiMenuItem"
263
263
  }), {
@@ -266,39 +266,39 @@ const me = T("MuiMenuItem", ["root", "focusVisible", "dense", "disabled", "divid
266
266
  dense: l = !1,
267
267
  divider: m = !1,
268
268
  disableGutters: u = !1,
269
- focusVisibleClassName: C,
269
+ focusVisibleClassName: I,
270
270
  role: f = "menuitem",
271
271
  tabIndex: p,
272
272
  className: i
273
- } = a, g = B(a, fe), y = x.useContext(L), b = x.useMemo(() => ({
274
- dense: l || y.dense || !1,
273
+ } = a, v = U(a, be), g = x.useContext(A), C = x.useMemo(() => ({
274
+ dense: l || g.dense || !1,
275
275
  disableGutters: u
276
- }), [y.dense, l, u]), $ = x.useRef(null);
277
- oe(() => {
278
- r && ($.current ? $.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered."));
276
+ }), [g.dense, l, u]), y = x.useRef(null);
277
+ se(() => {
278
+ r && (y.current ? y.current.focus() : process.env.NODE_ENV !== "production" && console.error("MUI: Unable to set focus to a MenuItem whose component has not been rendered."));
279
279
  }, [r]);
280
- const E = v({}, a, {
281
- dense: b.dense,
280
+ const E = b({}, a, {
281
+ dense: C.dense,
282
282
  divider: m,
283
283
  disableGutters: u
284
- }), h = ve(a), n = se($, s);
285
- let I;
286
- return a.disabled || (I = p !== void 0 ? p : -1), /* @__PURE__ */ c(L.Provider, {
287
- value: b,
288
- children: /* @__PURE__ */ c(ge, v({
289
- ref: n,
284
+ }), $ = ge(a), N = ne(y, s);
285
+ let n;
286
+ return a.disabled || (n = p !== void 0 ? p : -1), /* @__PURE__ */ c(A.Provider, {
287
+ value: C,
288
+ children: /* @__PURE__ */ c(ye, b({
289
+ ref: N,
290
290
  role: f,
291
- tabIndex: I,
291
+ tabIndex: n,
292
292
  component: d,
293
- focusVisibleClassName: P(h.focusVisible, C),
294
- className: P(h.root, i)
295
- }, g, {
293
+ focusVisibleClassName: F($.focusVisible, I),
294
+ className: F($.root, i)
295
+ }, v, {
296
296
  ownerState: E,
297
- classes: h
297
+ classes: $
298
298
  }))
299
299
  });
300
300
  });
301
- process.env.NODE_ENV !== "production" && (G.propTypes = {
301
+ process.env.NODE_ENV !== "production" && (W.propTypes = {
302
302
  // ----------------------------- Warning --------------------------------
303
303
  // | These PropTypes are generated from the TypeScript type definitions |
304
304
  // | To update them edit the d.ts file and run "yarn proptypes" |
@@ -373,7 +373,7 @@ process.env.NODE_ENV !== "production" && (G.propTypes = {
373
373
  */
374
374
  tabIndex: t.number
375
375
  });
376
- const ye = G, Pe = ({
376
+ const Ie = W, Fe = ({
377
377
  name: e,
378
378
  label: o,
379
379
  type: s,
@@ -383,58 +383,60 @@ const ye = G, Pe = ({
383
383
  required: l,
384
384
  disabled: m,
385
385
  beforeField: u,
386
- afterField: C,
386
+ afterField: I,
387
387
  options: f,
388
388
  optionsResponseHandler: p,
389
389
  api_endpoint: i,
390
- error: g,
391
- helperText: y
390
+ error: v,
391
+ helperText: g,
392
+ autofocus: C
392
393
  }) => {
393
- const [b, $] = H([]);
394
- function E(n) {
394
+ const [y, E] = J([]);
395
+ function $(n) {
395
396
  r(e, n.target.value);
396
397
  }
397
- const h = J(async () => {
398
+ const N = K(async () => {
398
399
  var n;
399
- return s !== "select" ? [] : f || (i && p ? (n = (await (await fetch(i)).json())[p.key]) == null ? void 0 : n.map((F) => ({
400
- name: F[p.name],
401
- value: F[p.value]
400
+ return s !== "select" ? [] : f || (i && p ? (n = (await (await fetch(i)).json())[p.key]) == null ? void 0 : n.map((L) => ({
401
+ name: L[p.name],
402
+ value: L[p.value]
402
403
  })) : []);
403
404
  }, [s, p, i]);
404
- return K(() => {
405
- h().then((n) => $(n));
405
+ return Q(() => {
406
+ N().then((n) => E(n));
406
407
  }, []), s !== "custom" ? /* @__PURE__ */ c(
407
- Y,
408
+ Z,
408
409
  {
409
410
  label: o,
411
+ autoFocus: C,
410
412
  name: e,
411
413
  type: s,
412
414
  select: s === "select",
413
415
  value: a,
414
- onChange: E,
416
+ onChange: $,
415
417
  placeholder: d,
416
418
  required: l,
417
419
  disabled: m,
418
- error: g,
419
- helperText: y,
420
+ error: v,
421
+ helperText: g,
420
422
  InputProps: {
421
- startAdornment: /* @__PURE__ */ c(k, { position: "start", children: u }),
422
- endAdornment: /* @__PURE__ */ c(k, { position: "end", children: C })
423
+ startAdornment: /* @__PURE__ */ c(V, { position: "start", children: u }),
424
+ endAdornment: /* @__PURE__ */ c(V, { position: "end", children: I })
423
425
  },
424
- children: s === "select" && (b == null ? void 0 : b.map((n) => {
425
- const I = typeof n == "object";
426
+ children: s === "select" && (y == null ? void 0 : y.map((n) => {
427
+ const O = typeof n == "object";
426
428
  return /* @__PURE__ */ c(
427
- ye,
429
+ Ie,
428
430
  {
429
- value: I ? n.value : n,
430
- children: I ? n.name : n
431
+ value: O ? n.value : n,
432
+ children: O ? n.name : n
431
433
  },
432
- I ? n.name : n
434
+ O ? n.name : n
433
435
  );
434
436
  }))
435
437
  }
436
- ) : /* @__PURE__ */ c(q, {});
438
+ ) : /* @__PURE__ */ c(H, {});
437
439
  };
438
440
  export {
439
- Pe as default
441
+ Fe as default
440
442
  };
@@ -11,6 +11,7 @@ export interface InputField {
11
11
  beforeField?: string | React.ReactNode;
12
12
  afterField?: string | React.ReactNode;
13
13
  helperText?: string;
14
+ autofocus?: boolean;
14
15
  }
15
16
  export interface Option {
16
17
  name: string;
@@ -39,6 +40,7 @@ export interface ConfigField extends SelectField {
39
40
  validation?: Validation;
40
41
  customComponent?: string;
41
42
  submitDataKey?: string;
43
+ preFillWithDateTime?: boolean;
42
44
  }
43
45
  export interface CustomFieldProps {
44
46
  value: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const formStyles: {
2
+ declare const styles: {
3
3
  [key: string]: React.CSSProperties;
4
4
  };
5
- export default formStyles;
5
+ export default styles;
@@ -1,5 +1,5 @@
1
1
  const e = {
2
- form: {
2
+ alignVertical: {
3
3
  display: "flex",
4
4
  flexDirection: "column",
5
5
  gap: "1rem"
@@ -1,2 +1,3 @@
1
1
  export declare function createNestedObject(finalObjectKey: string, type: string, value: string): any;
2
2
  export declare function deepMergeObjects(finalObj: any, nestedObj: any): any;
3
+ export declare function getLocalDateTime(): string;
@@ -1,27 +1,32 @@
1
- function k(t, r, e) {
2
- const c = t.split("."), o = c.length - 1;
3
- let s = {};
4
- for (let n = o; n >= 0; n--) {
5
- const u = c[n];
6
- let y = {};
7
- n === o ? s[u] = r === "number" ? parseInt(e) : e : (y[u] = { ...s }, s = y);
1
+ function d(t, n, e) {
2
+ const o = t.split("."), c = o.length - 1;
3
+ let r = {};
4
+ for (let s = c; s >= 0; s--) {
5
+ const a = o[s];
6
+ let g = {};
7
+ s === c ? r[a] = n === "number" ? parseInt(e) : e : (g[a] = { ...r }, r = g);
8
8
  }
9
- return s;
9
+ return r;
10
10
  }
11
- function p(t, r) {
12
- const [e] = Object.keys(r);
11
+ function u(t, n) {
12
+ const [e] = Object.keys(n);
13
13
  return t.hasOwnProperty(e) ? {
14
14
  ...t,
15
- [e]: p(
15
+ [e]: u(
16
16
  t[e],
17
- r[e]
17
+ n[e]
18
18
  )
19
19
  } : {
20
20
  ...t,
21
- ...r
21
+ ...n
22
22
  };
23
23
  }
24
+ function i() {
25
+ const t = /* @__PURE__ */ new Date(), n = t.getFullYear(), e = String(t.getMonth() + 1).padStart(2, "0"), o = String(t.getDate()).padStart(2, "0"), c = String(t.getHours()).padStart(2, "0"), r = String(t.getMinutes()).padStart(2, "0"), s = String(t.getSeconds()).padStart(2, "0");
26
+ return `${n}-${e}-${o} ${c}:${r}:${s}`;
27
+ }
24
28
  export {
25
- k as createNestedObject,
26
- p as deepMergeObjects
29
+ d as createNestedObject,
30
+ u as deepMergeObjects,
31
+ i as getLocalDateTime
27
32
  };
@@ -1,3 +1,4 @@
1
+ import { SxProps } from "@mui/material";
1
2
  import React from "react";
2
3
  import { CraftFC } from "../../../global/interfaces";
3
4
  import { ConfigField, CustomFields, InvalidData } from "./Form.interfaces";
@@ -10,7 +11,8 @@ interface FormProps {
10
11
  handleCancel: () => void;
11
12
  onChange?: (key: string, value: string) => void;
12
13
  customFields?: CustomFields;
13
- style?: React.CSSProperties;
14
+ formStyles?: React.CSSProperties;
15
+ buttonWrapperStyles?: SxProps;
14
16
  }
15
17
  /**
16
18
  * Form component