@loopr-ai/craft 0.7.2 → 0.7.3

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 (40) hide show
  1. package/dist/{ButtonBase-fc1e48eb.js → ButtonBase-85c9347b.js} +3 -3
  2. package/dist/{TextField-a534df29.js → TextField-fded06e5.js} +7 -7
  3. package/dist/Tooltip-b926c320.js +2022 -0
  4. package/dist/{TransitionGroupContext-ba502e63.js → TransitionGroupContext-fe9a562f.js} +3 -3
  5. package/dist/ZoomControllers-36e39bb0.js +1432 -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 +5 -19
  12. package/dist/components/organ/Form/Form.interfaces.d.ts +6 -6
  13. package/dist/components/organ/Form/Form.styles.d.ts +99 -2
  14. package/dist/components/organ/Form/Form.styles.js +99 -4
  15. package/dist/components/organ/Form/FormInput.js +517 -0
  16. package/dist/components/organ/Form/index.js +155 -107
  17. package/dist/components/organ/ZoomControlWithDrag/ZoomControllers.js +2 -2
  18. package/dist/components/organ/ZoomControlWithDrag/index.js +2 -2
  19. package/dist/{createSvgIcon-bb3d4825.js → createSvgIcon-58aa3adf.js} +5 -5
  20. package/dist/{Grow-a906cda2.js → createSvgIcon-f773ce57.js} +4020 -3944
  21. package/dist/{createTheme-ca1567c6.js → createTheme-a4db2989.js} +7 -7
  22. package/dist/{exactProp-3d9df1ae.js → exactProp-d79ccada.js} +1 -1
  23. package/dist/{extendSxProp-fc2654e5.js → extendSxProp-db8b9da5.js} +1 -1
  24. package/dist/global/colors.d.ts +5 -0
  25. package/dist/global/colors.js +11 -6
  26. package/dist/global/constants.d.ts +3 -0
  27. package/dist/global/constants.js +6 -1
  28. package/dist/global/theme.js +1 -1
  29. package/dist/{Typography-65e5f8a8.js → index-03287c17.js} +61 -45
  30. package/dist/main.js +10 -10
  31. package/dist/providers/CraftThemeProvider.js +2 -2
  32. package/dist/{styled-80b57810.js → styled-126c6a62.js} +49 -49
  33. package/dist/{useTheme-16446f25.js → useTheme-573c40a2.js} +1 -1
  34. package/package.json +1 -1
  35. package/dist/Box-8cd400c2.js +0 -58
  36. package/dist/ZoomControllers-8a147df0.js +0 -3390
  37. package/dist/components/organ/Form/FieldInput.js +0 -442
  38. package/dist/createSvgIcon-8e5d9dc7.js +0 -81
  39. package/dist/dividerClasses-0233db5a.js +0 -10
  40. /package/dist/components/organ/Form/{FieldInput.d.ts → FormInput.d.ts} +0 -0
@@ -1,442 +0,0 @@
1
- import { jsx as c, jsxs as q, Fragment as H } from "react/jsx-runtime";
2
- import * as x from "react";
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
- }
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
- const {
18
- ownerState: s
19
- } = e;
20
- return [o.root, o[`position${P(s.position)}`], s.disablePointerEvents === !0 && o.disablePointerEvents, o[s.variant]];
21
- }, ce = (e) => {
22
- const {
23
- classes: o,
24
- disablePointerEvents: s,
25
- hiddenLabel: a,
26
- position: r,
27
- size: d,
28
- variant: l
29
- } = e, m = {
30
- root: ["root", s && "disablePointerEvents", r && `position${P(r)}`, l, a && "hiddenLabel", d && `size${P(d)}`]
31
- };
32
- return D(m, ae, o);
33
- }, de = z("div", {
34
- name: "MuiInputAdornment",
35
- slot: "Root",
36
- overridesResolver: le
37
- })(({
38
- theme: e,
39
- ownerState: o
40
- }) => b({
41
- display: "flex",
42
- height: "0.01em",
43
- // Fix IE11 flexbox alignment. To remove at some point.
44
- maxHeight: "2em",
45
- alignItems: "center",
46
- whiteSpace: "nowrap",
47
- color: (e.vars || e).palette.action.active
48
- }, o.variant === "filled" && {
49
- // Styles applied to the root element if `variant="filled"`.
50
- [`&.${R.positionStart}&:not(.${R.hiddenLabel})`]: {
51
- marginTop: 16
52
- }
53
- }, o.position === "start" && {
54
- // Styles applied to the root element if `position="start"`.
55
- marginRight: 8
56
- }, o.position === "end" && {
57
- // Styles applied to the root element if `position="end"`.
58
- marginLeft: 8
59
- }, o.disablePointerEvents === !0 && {
60
- // Styles applied to the root element if `disablePointerEvents={true}`.
61
- pointerEvents: "none"
62
- })), G = /* @__PURE__ */ x.forwardRef(function(o, s) {
63
- const a = _({
64
- props: o,
65
- name: "MuiInputAdornment"
66
- }), {
67
- children: r,
68
- className: d,
69
- component: l = "div",
70
- disablePointerEvents: m = !1,
71
- disableTypography: u = !1,
72
- position: I,
73
- variant: f
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
- hiddenLabel: i.hiddenLabel,
79
- size: i.size,
80
- disablePointerEvents: m,
81
- position: I,
82
- variant: v
83
- }), C = ce(g);
84
- return /* @__PURE__ */ c(Y.Provider, {
85
- value: null,
86
- children: /* @__PURE__ */ c(de, b({
87
- as: l,
88
- ownerState: g,
89
- className: F(C.root, d),
90
- ref: s
91
- }, p, {
92
- children: typeof r == "string" && !u ? /* @__PURE__ */ c(te, {
93
- color: "text.secondary",
94
- children: r
95
- }) : /* @__PURE__ */ q(x.Fragment, {
96
- children: [I === "start" ? (
97
- /* notranslate needed while Google Translate will not fix zero-width space issue */
98
- k || (k = /* @__PURE__ */ c("span", {
99
- className: "notranslate",
100
- children: "​"
101
- }))
102
- ) : null, r]
103
- })
104
- }))
105
- });
106
- });
107
- process.env.NODE_ENV !== "production" && (G.propTypes = {
108
- // ----------------------------- Warning --------------------------------
109
- // | These PropTypes are generated from the TypeScript type definitions |
110
- // | To update them edit the d.ts file and run "yarn proptypes" |
111
- // ----------------------------------------------------------------------
112
- /**
113
- * The content of the component, normally an `IconButton` or string.
114
- */
115
- children: t.node,
116
- /**
117
- * Override or extend the styles applied to the component.
118
- */
119
- classes: t.object,
120
- /**
121
- * @ignore
122
- */
123
- className: t.string,
124
- /**
125
- * The component used for the root node.
126
- * Either a string to use a HTML element or a component.
127
- */
128
- component: t.elementType,
129
- /**
130
- * Disable pointer events on the root.
131
- * This allows for the content of the adornment to focus the `input` on click.
132
- * @default false
133
- */
134
- disablePointerEvents: t.bool,
135
- /**
136
- * If children is a string then disable wrapping in a Typography component.
137
- * @default false
138
- */
139
- disableTypography: t.bool,
140
- /**
141
- * The position this adornment should appear relative to the `Input`.
142
- */
143
- position: t.oneOf(["end", "start"]).isRequired,
144
- /**
145
- * The system prop that allows defining system overrides as well as additional CSS styles.
146
- */
147
- sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
148
- /**
149
- * The variant to use.
150
- * Note: If you are using the `TextField` component or the `FormControl` component
151
- * you do not have to set this manually.
152
- */
153
- variant: t.oneOf(["filled", "outlined", "standard"])
154
- });
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
- }
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
- const {
161
- ownerState: s
162
- } = e;
163
- return [o.root, s.dense && o.dense, s.divider && o.divider, !s.disableGutters && o.gutters];
164
- }, ge = (e) => {
165
- const {
166
- disabled: o,
167
- dense: s,
168
- divider: a,
169
- disableGutters: r,
170
- selected: d,
171
- classes: l
172
- } = e, u = D({
173
- root: ["root", s && "dense", o && "disabled", !r && "gutters", a && "divider", d && "selected"]
174
- }, me, l);
175
- return b({}, l, u);
176
- }, ye = z(oe, {
177
- shouldForwardProp: (e) => ee(e) || e === "classes",
178
- name: "MuiMenuItem",
179
- slot: "Root",
180
- overridesResolver: ve
181
- })(({
182
- theme: e,
183
- ownerState: o
184
- }) => b({}, e.typography.body1, {
185
- display: "flex",
186
- justifyContent: "flex-start",
187
- alignItems: "center",
188
- position: "relative",
189
- textDecoration: "none",
190
- minHeight: 48,
191
- paddingTop: 6,
192
- paddingBottom: 6,
193
- boxSizing: "border-box",
194
- whiteSpace: "nowrap"
195
- }, !o.disableGutters && {
196
- paddingLeft: 16,
197
- paddingRight: 16
198
- }, o.divider && {
199
- borderBottom: `1px solid ${(e.vars || e).palette.divider}`,
200
- backgroundClip: "padding-box"
201
- }, {
202
- "&:hover": {
203
- textDecoration: "none",
204
- backgroundColor: (e.vars || e).palette.action.hover,
205
- // Reset on touch devices, it doesn't add specificity
206
- "@media (hover: none)": {
207
- backgroundColor: "transparent"
208
- }
209
- },
210
- [`&.${h.selected}`]: {
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
- [`&.${h.focusVisible}`]: {
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
- }
215
- },
216
- [`&.${h.selected}:hover`]: {
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
- // Reset on touch devices, it doesn't add specificity
219
- "@media (hover: none)": {
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
- }
222
- },
223
- [`&.${h.focusVisible}`]: {
224
- backgroundColor: (e.vars || e).palette.action.focus
225
- },
226
- [`&.${h.disabled}`]: {
227
- opacity: (e.vars || e).palette.action.disabledOpacity
228
- },
229
- [`& + .${j.root}`]: {
230
- marginTop: e.spacing(1),
231
- marginBottom: e.spacing(1)
232
- },
233
- [`& + .${j.inset}`]: {
234
- marginLeft: 52
235
- },
236
- [`& .${S.root}`]: {
237
- marginTop: 0,
238
- marginBottom: 0
239
- },
240
- [`& .${S.inset}`]: {
241
- paddingLeft: 36
242
- },
243
- [`& .${w.root}`]: {
244
- minWidth: 36
245
- }
246
- }, !o.dense && {
247
- [e.breakpoints.up("sm")]: {
248
- minHeight: "auto"
249
- }
250
- }, o.dense && b({
251
- minHeight: 32,
252
- // https://m2.material.io/components/menus#specs > Dense
253
- paddingTop: 4,
254
- paddingBottom: 4
255
- }, e.typography.body2, {
256
- [`& .${w.root} svg`]: {
257
- fontSize: "1.25rem"
258
- }
259
- }))), W = /* @__PURE__ */ x.forwardRef(function(o, s) {
260
- const a = _({
261
- props: o,
262
- name: "MuiMenuItem"
263
- }), {
264
- autoFocus: r = !1,
265
- component: d = "li",
266
- dense: l = !1,
267
- divider: m = !1,
268
- disableGutters: u = !1,
269
- focusVisibleClassName: I,
270
- role: f = "menuitem",
271
- tabIndex: p,
272
- className: i
273
- } = a, v = U(a, be), g = x.useContext(A), C = x.useMemo(() => ({
274
- dense: l || g.dense || !1,
275
- disableGutters: u
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
- }, [r]);
280
- const E = b({}, a, {
281
- dense: C.dense,
282
- divider: m,
283
- disableGutters: u
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
- role: f,
291
- tabIndex: n,
292
- component: d,
293
- focusVisibleClassName: F($.focusVisible, I),
294
- className: F($.root, i)
295
- }, v, {
296
- ownerState: E,
297
- classes: $
298
- }))
299
- });
300
- });
301
- process.env.NODE_ENV !== "production" && (W.propTypes = {
302
- // ----------------------------- Warning --------------------------------
303
- // | These PropTypes are generated from the TypeScript type definitions |
304
- // | To update them edit the d.ts file and run "yarn proptypes" |
305
- // ----------------------------------------------------------------------
306
- /**
307
- * If `true`, the list item is focused during the first mount.
308
- * Focus will also be triggered if the value changes from false to true.
309
- * @default false
310
- */
311
- autoFocus: t.bool,
312
- /**
313
- * The content of the component.
314
- */
315
- children: t.node,
316
- /**
317
- * Override or extend the styles applied to the component.
318
- */
319
- classes: t.object,
320
- /**
321
- * @ignore
322
- */
323
- className: t.string,
324
- /**
325
- * The component used for the root node.
326
- * Either a string to use a HTML element or a component.
327
- */
328
- component: t.elementType,
329
- /**
330
- * If `true`, compact vertical padding designed for keyboard and mouse input is used.
331
- * The prop defaults to the value inherited from the parent Menu component.
332
- * @default false
333
- */
334
- dense: t.bool,
335
- /**
336
- * @ignore
337
- */
338
- disabled: t.bool,
339
- /**
340
- * If `true`, the left and right padding is removed.
341
- * @default false
342
- */
343
- disableGutters: t.bool,
344
- /**
345
- * If `true`, a 1px light border is added to the bottom of the menu item.
346
- * @default false
347
- */
348
- divider: t.bool,
349
- /**
350
- * This prop can help identify which element has keyboard focus.
351
- * The class name will be applied when the element gains the focus through keyboard interaction.
352
- * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
353
- * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
354
- * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
355
- * if needed.
356
- */
357
- focusVisibleClassName: t.string,
358
- /**
359
- * @ignore
360
- */
361
- role: t.string,
362
- /**
363
- * If `true`, the component is selected.
364
- * @default false
365
- */
366
- selected: t.bool,
367
- /**
368
- * The system prop that allows defining system overrides as well as additional CSS styles.
369
- */
370
- sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
371
- /**
372
- * @default 0
373
- */
374
- tabIndex: t.number
375
- });
376
- const Ie = W, Fe = ({
377
- name: e,
378
- label: o,
379
- type: s,
380
- value: a,
381
- handleChange: r,
382
- placeholder: d,
383
- required: l,
384
- disabled: m,
385
- beforeField: u,
386
- afterField: I,
387
- options: f,
388
- optionsResponseHandler: p,
389
- api_endpoint: i,
390
- error: v,
391
- helperText: g,
392
- autofocus: C
393
- }) => {
394
- const [y, E] = J([]);
395
- function $(n) {
396
- r(e, n.target.value);
397
- }
398
- const N = K(async () => {
399
- var n;
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]
403
- })) : []);
404
- }, [s, p, i]);
405
- return Q(() => {
406
- N().then((n) => E(n));
407
- }, []), s !== "custom" ? /* @__PURE__ */ c(
408
- Z,
409
- {
410
- label: o,
411
- autoFocus: C,
412
- name: e,
413
- type: s,
414
- select: s === "select",
415
- value: a,
416
- onChange: $,
417
- placeholder: d,
418
- required: l,
419
- disabled: m,
420
- error: v,
421
- helperText: g,
422
- InputProps: {
423
- startAdornment: /* @__PURE__ */ c(V, { position: "start", children: u }),
424
- endAdornment: /* @__PURE__ */ c(V, { position: "end", children: I })
425
- },
426
- children: s === "select" && (y == null ? void 0 : y.map((n) => {
427
- const O = typeof n == "object";
428
- return /* @__PURE__ */ c(
429
- Ie,
430
- {
431
- value: O ? n.value : n,
432
- children: O ? n.name : n
433
- },
434
- O ? n.name : n
435
- );
436
- }))
437
- }
438
- ) : /* @__PURE__ */ c(H, {});
439
- };
440
- export {
441
- Fe as default
442
- };
@@ -1,81 +0,0 @@
1
- import { a as _, C as g, b, h as E } from "./createTheme-ca1567c6.js";
2
- import { c as y } from "./createSvgIcon-bb3d4825.js";
3
- import { c as C, d as N, i as S, o as I, a as $, u as x, b as T } from "./Grow-a906cda2.js";
4
- import { s as q, a as P, b as w, u as D, c as O } from "./TransitionGroupContext-ba502e63.js";
5
- import { u as R } from "./unsupportedProp-3dbf01f6.js";
6
- function M(e, r) {
7
- return process.env.NODE_ENV === "production" ? () => null : (t, u, s, n, o) => {
8
- const a = s || "<<anonymous>>", i = o || u;
9
- return typeof t[u] < "u" ? new Error(`The ${n} \`${i}\` of \`${a}\` is deprecated. ${r}`) : null;
10
- };
11
- }
12
- function F(e, r) {
13
- if (process.env.NODE_ENV === "production")
14
- return () => null;
15
- const t = r ? _({}, r.propTypes) : null;
16
- return (s) => (n, o, a, i, l, ...v) => {
17
- const f = l || o, p = t == null ? void 0 : t[f];
18
- if (p) {
19
- const d = p(n, o, a, i, l, ...v);
20
- if (d)
21
- return d;
22
- }
23
- return typeof n[o] < "u" && !n[s] ? new Error(`The prop \`${f}\` of \`${e}\` can only be used together with the \`${s}\` prop.`) : null;
24
- };
25
- }
26
- const k = {
27
- configure: (e) => {
28
- process.env.NODE_ENV !== "production" && console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.", "", "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", "", "The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401", "", "The updated documentation: https://mui.com/guides/classname-generator/"].join(`
29
- `)), g.configure(e);
30
- }
31
- }, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
32
- __proto__: null,
33
- capitalize: b,
34
- createChainedFunction: C,
35
- createSvgIcon: y,
36
- debounce: N,
37
- deprecatedPropType: M,
38
- isMuiElement: S,
39
- ownerDocument: I,
40
- ownerWindow: $,
41
- requirePropFactory: F,
42
- setRef: q,
43
- unstable_ClassNameGenerator: k,
44
- unstable_useEnhancedEffect: P,
45
- unstable_useId: x,
46
- unsupportedProp: R,
47
- useControlled: T,
48
- useEventCallback: w,
49
- useForkRef: D,
50
- useIsFocusVisible: O
51
- }, Symbol.toStringTag, { value: "Module" }));
52
- var h = { exports: {} };
53
- (function(e) {
54
- function r(t) {
55
- return t && t.__esModule ? t : {
56
- default: t
57
- };
58
- }
59
- e.exports = r, e.exports.__esModule = !0, e.exports.default = e.exports;
60
- })(h);
61
- var Y = h.exports, c = {};
62
- const V = /* @__PURE__ */ E(G);
63
- var m;
64
- function B() {
65
- return m || (m = 1, function(e) {
66
- "use client";
67
- Object.defineProperty(e, "__esModule", {
68
- value: !0
69
- }), Object.defineProperty(e, "default", {
70
- enumerable: !0,
71
- get: function() {
72
- return r.createSvgIcon;
73
- }
74
- });
75
- var r = V;
76
- }(c)), c;
77
- }
78
- export {
79
- Y as i,
80
- B as r
81
- };
@@ -1,10 +0,0 @@
1
- import { g as t } from "./styled-80b57810.js";
2
- import { g as e } from "./createTheme-ca1567c6.js";
3
- function a(i) {
4
- return e("MuiDivider", i);
5
- }
6
- const r = t("MuiDivider", ["root", "absolute", "fullWidth", "inset", "middle", "flexItem", "light", "vertical", "withChildren", "withChildrenVertical", "textAlignRight", "textAlignLeft", "wrapper", "wrapperVertical"]), d = r;
7
- export {
8
- d,
9
- a as g
10
- };