@code0-tech/pictor 0.7.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 (37) hide show
  1. package/dist/assets/components/form/FileInput.style.css +1 -0
  2. package/dist/assets/components/progress/Progress.style.css +1 -0
  3. package/dist/components/breadcrumb/Breadcrumb.js +7 -7
  4. package/dist/components/button/Button.js +11 -11
  5. package/dist/components/command/Command.js +19 -17
  6. package/dist/components/data-table/DataTable.js +15 -15
  7. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +15 -15
  8. package/dist/components/editor/Editor.js +13 -13
  9. package/dist/components/form/CheckboxInput.js +4 -4
  10. package/dist/components/form/EmailInput.js +9 -9
  11. package/dist/components/form/FileInput.d.ts +32 -0
  12. package/dist/components/form/FileInput.js +124 -0
  13. package/dist/components/form/InputContentEditable.hook.js +11 -11
  14. package/dist/components/form/InputWrapper.js +15 -15
  15. package/dist/components/form/NumberInput.js +9 -9
  16. package/dist/components/form/PasswordInput.js +4 -4
  17. package/dist/components/form/SwitchInput.js +7 -7
  18. package/dist/components/form/TextAreaInput.js +6 -6
  19. package/dist/components/form/TextInput.js +6 -6
  20. package/dist/components/form/index.d.ts +1 -0
  21. package/dist/components/form/index.js +58 -45
  22. package/dist/components/form/useForm.js +2 -2
  23. package/dist/components/fullscreen/FullScreen.js +2 -2
  24. package/dist/components/gantt/GanttGroup.js +17 -17
  25. package/dist/components/progress/Progress.d.ts +8 -0
  26. package/dist/components/progress/Progress.js +42 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +180 -165
  29. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +25 -0
  30. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +81 -0
  31. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +55 -0
  32. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
  33. package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +58 -0
  34. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +2 -2
  35. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +8 -8
  36. package/dist/utils/reactiveArrayService.js +4 -4
  37. package/package.json +12 -7
@@ -0,0 +1 @@
1
+ .file-input__item-group{margin:0;padding:0}.file-input__item-preview{max-width:50px;max-height:50px;width:100%;height:100%;overflow:hidden;display:flex;align-items:center;justify-content:center}.file-input__item-preview-image{object-fit:cover;width:100%;height:100%}
@@ -0,0 +1 @@
1
+ .progress{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;box-sizing:border-box;border-radius:1rem;width:100%;height:10px;position:relative;transform:translateZ(0)}.progress__dot{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:#393743;position:absolute;max-width:100%;aspect-ratio:1/1;height:200%;z-index:2;top:50%;transform:translate(50%) translateY(-50%);border-radius:50rem;right:calc(100% - 1% * (var(--progress, 0)));overflow:hidden}.progress__dot:after{content:"";position:absolute;top:50%;left:50%;border-radius:inherit;width:60%;height:60%;transform:translate(-50%,-50%);background:var(--color);background-repeat:no-repeat}.progress__indicator{position:absolute;background:var(--color);background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progress, 100)) 100%;width:100%;height:100%;z-index:1}.progress__indicator--prediction{background:repeating-linear-gradient(-45deg,rgba(0,0,0,.5),rgba(0,0,0,.5) 2.5px,transparent 2.5px,transparent 5px),var(--color);z-index:0;opacity:.5;background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progressPrediction, 100)) 100%}
@@ -5,17 +5,17 @@ import { mergeComponentProps as l } from "../../utils/component.js";
5
5
  import "js-md5";
6
6
  import '../../assets/components/breadcrumb/Breadcrumb.style.css';/* empty css */
7
7
  import { IconChevronRight as a } from "@tabler/icons-react";
8
- const j = (m) => {
8
+ const g = (m) => {
9
9
  const {
10
10
  splitter: n = /* @__PURE__ */ r(a, { size: 16 }),
11
- children: o,
11
+ children: e,
12
12
  ...i
13
- } = m, c = t.Children.count(o);
14
- return /* @__PURE__ */ r("div", { ...l("breadcrumb", i), children: t.Children.map(o, (p, e) => /* @__PURE__ */ s(t.Fragment, { children: [
13
+ } = m, c = t.Children.count(e);
14
+ return /* @__PURE__ */ r("div", { ...l("breadcrumb", i), children: t.Children.map(e, (p, o) => /* @__PURE__ */ s(t.Fragment, { children: [
15
15
  p,
16
- e < c - 1 ? /* @__PURE__ */ r("span", { className: "breadcrumb__splitter", children: n }) : null
17
- ] }, e)) });
16
+ o < c - 1 ? /* @__PURE__ */ r("span", { className: "breadcrumb__splitter", children: n }) : null
17
+ ] }, o)) });
18
18
  };
19
19
  export {
20
- j as Breadcrumb
20
+ g as Breadcrumb
21
21
  };
@@ -5,28 +5,28 @@ import z from "react";
5
5
  import "../../utils/contextStore.js";
6
6
  import { mergeComponentProps as S } from "../../utils/component.js";
7
7
  import "js-md5";
8
- const k = z.forwardRef((a, s) => {
8
+ const P = z.forwardRef((a, d) => {
9
9
  const t = h.c(11);
10
10
  let o, n, e, i;
11
- if (t[0] !== a || t[1] !== s) {
11
+ if (t[0] !== a || t[1] !== d) {
12
12
  const {
13
13
  children: f,
14
- variant: c,
15
- color: l,
14
+ variant: l,
15
+ color: c,
16
16
  paddingSize: m,
17
- active: b,
18
- disabled: u,
17
+ active: u,
18
+ disabled: b,
19
19
  ...p
20
20
  } = a;
21
21
  o = f;
22
- const v = c === void 0 ? "normal" : c, $ = l === void 0 ? "secondary" : l, g = m === void 0 ? "xs" : m, x = b === void 0 ? !1 : b;
23
- n = u === void 0 ? !1 : u, e = s, i = S(`button button--${$} ${x ? "button--active" : ""} ${n ? "button--disabled" : ""} button--${v} button--${g}`, p), t[0] = a, t[1] = s, t[2] = o, t[3] = n, t[4] = e, t[5] = i;
22
+ const v = l === void 0 ? "normal" : l, $ = c === void 0 ? "secondary" : c, g = m === void 0 ? "xs" : m, x = u === void 0 ? !1 : u;
23
+ n = b === void 0 ? !1 : b, e = d, i = S(`button button--${$} ${x ? "button--active" : ""} ${n ? "button--disabled" : ""} button--${v} button--${g}`, p), t[0] = a, t[1] = d, t[2] = o, t[3] = n, t[4] = e, t[5] = i;
24
24
  } else
25
25
  o = t[2], n = t[3], e = t[4], i = t[5];
26
- const d = n ? "true" : "false";
26
+ const s = n ? "true" : "false";
27
27
  let r;
28
- return t[6] !== o || t[7] !== e || t[8] !== i || t[9] !== d ? (r = /* @__PURE__ */ R("button", { ref: e, ...i, "aria-disabled": d, children: o }), t[6] = o, t[7] = e, t[8] = i, t[9] = d, t[10] = r) : r = t[10], r;
28
+ return t[6] !== o || t[7] !== e || t[8] !== i || t[9] !== s ? (r = /* @__PURE__ */ R("button", { ref: e, ...i, "aria-disabled": s, children: o }), t[6] = o, t[7] = e, t[8] = i, t[9] = s, t[10] = r) : r = t[10], r;
29
29
  });
30
30
  export {
31
- k as Button
31
+ P as Button
32
32
  };
@@ -6,7 +6,7 @@ import "react";
6
6
  import { mergeComponentProps as r } from "../../utils/component.js";
7
7
  import "js-md5";
8
8
  import { DialogPortal as u, DialogContent as h, Dialog as g, DialogOverlay as C } from "../dialog/Dialog.js";
9
- import '../../assets/components/form/SelectInput.style.css';import '../../assets/components/form/EditorInput.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/command/Command.style.css';/* empty css */
9
+ import '../../assets/components/form/SelectInput.style.css';import '../../assets/components/form/FileInput.style.css';import '../../assets/components/form/EditorInput.style.css';import '../../assets/components/form/Input.style.css';import '../../assets/components/command/Command.style.css';/* empty css */
10
10
  import { Badge as _ } from "../badge/Badge.js";
11
11
  import "@radix-ui/react-checkbox";
12
12
  import "@tabler/icons-react";
@@ -17,6 +17,8 @@ import "@uiw/codemirror-themes";
17
17
  import "../../node_modules/@lezer/highlight/dist/index.js";
18
18
  /* empty css */
19
19
  import "../form/EmailInput.js";
20
+ import "@ark-ui/react";
21
+ /* empty css */
20
22
  import "../form/Input.js";
21
23
  import "../form/InputSuggestion.js";
22
24
  import "../form/NumberInput.js";
@@ -35,7 +37,7 @@ const P = (e) => {
35
37
  const o = m;
36
38
  let n;
37
39
  return t[2] !== o ? (n = /* @__PURE__ */ i(a, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
38
- }, X = (e) => {
40
+ }, Z = (e) => {
39
41
  const t = c.c(11);
40
42
  let m;
41
43
  t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ i(C, {}), t[0] = m) : m = t[0];
@@ -48,14 +50,14 @@ const P = (e) => {
48
50
  ] }), t[3] = e.contentProps, t[4] = o, t[5] = n) : n = t[5];
49
51
  let l;
50
52
  return t[6] !== e.dialogProps || t[7] !== e.onOpenChange || t[8] !== e.open || t[9] !== n ? (l = /* @__PURE__ */ i(g, { ...e.dialogProps, open: e.open, onOpenChange: e.onOpenChange, children: n }), t[6] = e.dialogProps, t[7] = e.onOpenChange, t[8] = e.open, t[9] = n, t[10] = l) : l = t[10], l;
51
- }, Y = (e) => {
53
+ }, p = (e) => {
52
54
  const t = c.c(4);
53
55
  let m;
54
56
  t[0] !== e ? (m = r("command__list", e), t[0] = e, t[1] = m) : m = t[1];
55
57
  const o = m;
56
58
  let n;
57
59
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.List, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
58
- }, Z = (e) => {
60
+ }, tt = (e) => {
59
61
  const t = c.c(10);
60
62
  let m;
61
63
  t[0] !== e.value ? (m = e.value?.toString(), t[0] = e.value, t[1] = m) : m = t[1];
@@ -74,35 +76,35 @@ const P = (e) => {
74
76
  t[4] !== e ? (n = /* @__PURE__ */ i($, { className: "command__input", ...e }), t[4] = e, t[5] = n) : n = t[5];
75
77
  let l;
76
78
  return t[6] !== m || t[7] !== o || t[8] !== n ? (l = /* @__PURE__ */ i(a.Input, { value: m, onValueChange: o, asChild: !0, children: n }), t[6] = m, t[7] = o, t[8] = n, t[9] = l) : l = t[9], l;
77
- }, p = (e) => {
79
+ }, et = (e) => {
78
80
  const t = c.c(4);
79
81
  let m;
80
82
  t[0] !== e ? (m = r("command__empty", e), t[0] = e, t[1] = m) : m = t[1];
81
83
  const o = m;
82
84
  let n;
83
85
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Empty, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
84
- }, tt = (e) => {
86
+ }, nt = (e) => {
85
87
  const t = c.c(4);
86
88
  let m;
87
89
  t[0] !== e ? (m = r("command__group", e), t[0] = e, t[1] = m) : m = t[1];
88
90
  const o = m;
89
91
  let n;
90
92
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Group, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
91
- }, et = (e) => {
93
+ }, mt = (e) => {
92
94
  const t = c.c(4);
93
95
  let m;
94
96
  t[0] !== e ? (m = r("command__item", e), t[0] = e, t[1] = m) : m = t[1];
95
97
  const o = m;
96
98
  let n;
97
99
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Item, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
98
- }, nt = (e) => {
100
+ }, ot = (e) => {
99
101
  const t = c.c(4);
100
102
  let m;
101
103
  t[0] !== e ? (m = r("command__separator", e), t[0] = e, t[1] = m) : m = t[1];
102
104
  const o = m;
103
105
  let n;
104
106
  return t[2] !== o ? (n = /* @__PURE__ */ i(a.Separator, { ...o }), t[2] = o, t[3] = n) : n = t[3], n;
105
- }, mt = (e) => {
107
+ }, it = (e) => {
106
108
  const t = c.c(5);
107
109
  let m;
108
110
  t[0] !== e ? (m = r("command__shortcut", e), t[0] = e, t[1] = m) : m = t[1];
@@ -112,12 +114,12 @@ const P = (e) => {
112
114
  };
113
115
  export {
114
116
  P as Command,
115
- X as CommandDialog,
116
- p as CommandEmpty,
117
- tt as CommandGroup,
118
- Z as CommandInput,
119
- et as CommandItem,
120
- Y as CommandList,
121
- nt as CommandSeparator,
122
- mt as CommandShortcut
117
+ Z as CommandDialog,
118
+ et as CommandEmpty,
119
+ nt as CommandGroup,
120
+ tt as CommandInput,
121
+ mt as CommandItem,
122
+ p as CommandList,
123
+ ot as CommandSeparator,
124
+ it as CommandShortcut
123
125
  };
@@ -1,40 +1,40 @@
1
- import { jsxs as g, jsx as p } from "react/jsx-runtime";
2
- import h from "react";
1
+ import { jsxs as _, jsx as p } from "react/jsx-runtime";
2
+ import g from "react";
3
3
  import '../../assets/components/data-table/DataTable.style.css';/* empty css */
4
4
  import "../../utils/contextStore.js";
5
- import { mergeComponentProps as C } from "../../utils/component.js";
5
+ import { mergeComponentProps as h } from "../../utils/component.js";
6
6
  import "js-md5";
7
- const A = (l, m) => m.split(".").reduce((t, f) => {
7
+ const d = (l, m) => m.split(".").reduce((t, f) => {
8
8
  if (t != null)
9
- return Array.isArray(t) ? t.map((o) => o?.[f]).filter((o) => o !== void 0) : t[f];
9
+ return Array.isArray(t) ? t.map((a) => a?.[f]).filter((a) => a !== void 0) : t[f];
10
10
  }, l), w = (l) => {
11
11
  const {
12
12
  data: m,
13
13
  sort: t,
14
14
  filter: f,
15
- loading: o,
16
- loadingComponent: j,
17
- emptyComponent: d,
15
+ loading: a,
16
+ loadingComponent: C,
17
+ emptyComponent: A,
18
18
  onSelect: u,
19
19
  children: O,
20
20
  ...b
21
- } = l, y = m.filter((i) => Object.entries(f || {}).every(([a, {
21
+ } = l, y = m.filter((i) => Object.entries(f || {}).every(([o, {
22
22
  operator: n,
23
23
  value: r
24
24
  }]) => {
25
- const e = A(i, a);
25
+ const e = d(i, o);
26
26
  return n === "isOneOf" && !Array.isArray(r) && !Array.isArray(e) ? e === r : n === "isOneOf" && !Array.isArray(r) && Array.isArray(e) ? Array.from(e).includes(r) : n === "isOneOf" && Array.isArray(r) && !Array.isArray(e) ? Array.from(r).some((s) => s === e) : n === "isOneOf" && Array.isArray(r) && Array.isArray(e) ? Array.from(r).some((s) => Array.from(e).includes(s)) : !1;
27
- })), c = h.useMemo(() => t ? [...y].sort((i, a) => {
27
+ })), c = g.useMemo(() => t ? [...y].sort((i, o) => {
28
28
  for (const [n, r] of Object.entries(t)) {
29
- const e = A(i, n), s = A(a, n);
29
+ const e = d(i, n), s = d(o, n);
30
30
  if (e < s) return r === "asc" ? -1 : 1;
31
31
  if (e > s) return r === "asc" ? 1 : -1;
32
32
  }
33
33
  return 0;
34
34
  }) : y, [y, t]);
35
- return /* @__PURE__ */ g("table", { ...C("data-table", b), children: [
36
- c.map((i, a) => /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(i), children: O?.(i, a) })),
37
- c.length === 0 && !o && d ? /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: d }) : null
35
+ return /* @__PURE__ */ _("table", { ...h("data-table", b), children: [
36
+ c.map((i, o) => /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(i), children: O?.(i, o) })),
37
+ c.length === 0 && !a && A ? /* @__PURE__ */ p("tr", { className: "data-table__row", onClick: () => u?.(void 0), children: A }) : null
38
38
  ] });
39
39
  };
40
40
  export {
@@ -1,16 +1,16 @@
1
1
  import { jsx as f, jsxs as d } from "react/jsx-runtime";
2
- import { c as v } from "../../_virtual/compiler-runtime.js";
3
- import w from "react";
4
- import { MenuTrigger as y, MenuContent as _, Menu as g } from "../menu/Menu.js";
2
+ import { c as _ } from "../../_virtual/compiler-runtime.js";
3
+ import v from "react";
4
+ import { MenuTrigger as w, MenuContent as y, Menu as g } from "../menu/Menu.js";
5
5
  const T = (t) => {
6
- const e = v.c(11), {
7
- children: l,
8
- context: m
9
- } = t, [u, p] = w.useState(!0), h = _;
6
+ const e = _.c(11), {
7
+ children: c,
8
+ context: u
9
+ } = t, [m, p] = v.useState(!0), h = y;
10
10
  let r;
11
11
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = (a) => p(a), e[0] = r) : r = e[0];
12
12
  let i;
13
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ f(y, { asChild: !0, children: /* @__PURE__ */ f("div", { style: {
13
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ f(w, { asChild: !0, children: /* @__PURE__ */ f("div", { style: {
14
14
  position: "absolute",
15
15
  top: 0,
16
16
  left: 0,
@@ -18,9 +18,9 @@ const T = (t) => {
18
18
  height: 0
19
19
  } }) }), e[1] = i) : i = e[1];
20
20
  let n;
21
- e[2] !== m?.view ? (n = (a) => {
22
- ["Escape", "ArrowUp", "ArrowDown"].includes(a.key) || m?.view?.focus();
23
- }, e[2] = m?.view, e[3] = n) : n = e[3];
21
+ e[2] !== u?.view ? (n = (a) => {
22
+ ["Escape", "ArrowUp", "ArrowDown"].includes(a.key) || u?.view?.focus();
23
+ }, e[2] = u?.view, e[3] = n) : n = e[3];
24
24
  let s;
25
25
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
26
26
  position: "fixed",
@@ -29,12 +29,12 @@ const T = (t) => {
29
29
  pointerEvents: "auto"
30
30
  }, e[4] = s) : s = e[4];
31
31
  let o;
32
- e[5] !== l || e[6] !== n ? (o = /* @__PURE__ */ f(h, { miw: "200px", onInteractOutside: b, onOpenAutoFocus: D, onKeyDown: n, style: s, children: l }), e[5] = l, e[6] = n, e[7] = o) : o = e[7];
33
- let c;
34
- return e[8] !== u || e[9] !== o ? (c = /* @__PURE__ */ d(g, { open: u, onOpenChange: r, modal: !1, children: [
32
+ e[5] !== c || e[6] !== n ? (o = /* @__PURE__ */ f(h, { miw: "200px", onInteractOutside: b, onOpenAutoFocus: D, onKeyDown: n, style: s, children: c }), e[5] = c, e[6] = n, e[7] = o) : o = e[7];
33
+ let l;
34
+ return e[8] !== m || e[9] !== o ? (l = /* @__PURE__ */ d(g, { open: m, onOpenChange: r, modal: !1, children: [
35
35
  i,
36
36
  o
37
- ] }), e[8] = u, e[9] = o, e[10] = c) : c = e[10], c;
37
+ ] }), e[8] = m, e[9] = o, e[10] = l) : l = e[10], l;
38
38
  };
39
39
  function x(t) {
40
40
  return t;
@@ -1,10 +1,10 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
2
  import m, { isValidElement as me } from "react";
3
- import { createPortal as K } from "react-dom";
3
+ import { createPortal as H } from "react-dom";
4
4
  import "../../utils/contextStore.js";
5
5
  import { mergeComponentProps as he } from "../../utils/component.js";
6
6
  import { hashToColor as w } from "../../utils/color.js";
7
- import fe, { Prec as _, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
7
+ import fe, { Prec as K, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
8
8
  import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
9
9
  import { syntaxTree as L } from "@codemirror/language";
10
10
  import { linter as we } from "@codemirror/lint";
@@ -53,7 +53,7 @@ class X extends be {
53
53
  return t.type === this.type && t.rawValue === this.rawValue;
54
54
  }
55
55
  }
56
- const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), dr = (i) => {
56
+ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), dr = (i) => {
57
57
  const {
58
58
  language: t,
59
59
  tokenizer: f,
@@ -70,9 +70,9 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
70
70
  showValidation: U = !0,
71
71
  readonly: ee,
72
72
  basicSetup: re,
73
- customSuggestionComponent: D = !1,
73
+ customSuggestionComponent: _ = !1,
74
74
  ...te
75
- } = i, [oe, I] = m.useState(), R = m.useRef(null), [ne, ie] = m.useState(/* @__PURE__ */ new Map()), [u, se] = m.useState([]), [T, le] = m.useState(null), [g, y] = m.useState(null), H = m.useRef(null);
75
+ } = i, [oe, I] = m.useState(), R = m.useRef(null), [ne, ie] = m.useState(/* @__PURE__ */ new Map()), [u, se] = m.useState([]), [T, le] = m.useState(null), [g, y] = m.useState(null), D = m.useRef(null);
76
76
  m.useEffect(() => {
77
77
  (async () => {
78
78
  try {
@@ -92,7 +92,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
92
92
  if (V) {
93
93
  const n = (o) => {
94
94
  const c = V(o);
95
- if (c && De(c)) {
95
+ if (c && _e(c)) {
96
96
  const l = o.view?.coordsAtPos(o.pos);
97
97
  return l && y({
98
98
  component: c,
@@ -105,15 +105,15 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
105
105
  return y(null), c;
106
106
  };
107
107
  e.push(Be({
108
- ...D ? {
108
+ ..._ ? {
109
109
  override: [n]
110
110
  } : {
111
111
  override: [V]
112
112
  }
113
- })), e.push(_.highest(J.of([{
113
+ })), e.push(K.highest(J.of([{
114
114
  key: "Tab",
115
115
  run: Fe
116
- }]))), D && e.push(_.highest(J.of([{
116
+ }]))), _ && e.push(K.highest(J.of([{
117
117
  key: "ArrowUp",
118
118
  run: (o) => (g || E(o), !0)
119
119
  }, {
@@ -177,7 +177,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
177
177
  to: c
178
178
  });
179
179
  } else e.selectionSet && (y(null), E(e.view));
180
- const d = H.current?.querySelectorAll(".cm-react-anchor"), n = /* @__PURE__ */ new Map();
180
+ const d = D.current?.querySelectorAll(".cm-react-anchor"), n = /* @__PURE__ */ new Map();
181
181
  d?.forEach((o) => {
182
182
  n.set(o, {
183
183
  type: o.dataset.type,
@@ -291,7 +291,7 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
291
291
  ] }),
292
292
  /* @__PURE__ */ r(a, { children: "suggestions" })
293
293
  ] }) }),
294
- /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: H, ...he("editor", te), children: [
294
+ /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ s("div", { ref: D, ...he("editor", te), children: [
295
295
  /* @__PURE__ */ r(fe, { width: "100%", height: "100%", value: oe, theme: ue, readOnly: N || ee, editable: !N, extensions: ae, "aria-disabled": N, className: "editor__control", onChange: (e) => {
296
296
  if (I(e), t === "json")
297
297
  try {
@@ -304,13 +304,13 @@ const De = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
304
304
  }, onUpdate: ce, basicSetup: re }),
305
305
  p && Array.from(ne.entries()).map(([e, d]) => {
306
306
  const n = p[d.type];
307
- return n ? K(/* @__PURE__ */ r("div", { style: {
307
+ return n ? H(/* @__PURE__ */ r("div", { style: {
308
308
  display: "contents"
309
309
  }, children: n({
310
310
  content: d.value
311
311
  }) }, e.outerHTML + d.value), e) : null;
312
312
  }),
313
- g && K(/* @__PURE__ */ r("div", { ref: R, style: {
313
+ g && H(/* @__PURE__ */ r("div", { ref: R, style: {
314
314
  position: "fixed",
315
315
  top: g.position.top,
316
316
  left: g.position.left,
@@ -12,8 +12,8 @@ import '../../assets/components/form/Input.style.css';/* empty css
12
12
  import { IconMinus as T, IconCheck as q } from "@tabler/icons-react";
13
13
  const ee = (l) => {
14
14
  const e = $.c(40), {
15
- title: b,
16
- description: _,
15
+ title: _,
16
+ description: b,
17
17
  formValidation: k,
18
18
  ...N
19
19
  } = l;
@@ -31,9 +31,9 @@ const ee = (l) => {
31
31
  let v;
32
32
  e[5] !== t ? (v = [t], e[5] = t, e[6] = v) : v = e[6], z.useEffect(g, v);
33
33
  let o;
34
- e[7] !== b ? (o = b ? /* @__PURE__ */ n(F, { children: b }) : null, e[7] = b, e[8] = o) : o = e[8];
34
+ e[7] !== _ ? (o = _ ? /* @__PURE__ */ n(F, { children: _ }) : null, e[7] = _, e[8] = o) : o = e[8];
35
35
  let c;
36
- e[9] !== _ ? (c = _ ? /* @__PURE__ */ n(L, { children: _ }) : null, e[9] = _, e[10] = c) : c = e[10];
36
+ e[9] !== b ? (c = b ? /* @__PURE__ */ n(L, { children: b }) : null, e[9] = b, e[10] = c) : c = e[10];
37
37
  const V = `input ${i?.valid ? "" : "input--not-valid"} checkbox-input`;
38
38
  let r;
39
39
  e[11] !== V ? (r = E(V, {}), e[11] = V, e[12] = r) : r = e[12];
@@ -1,21 +1,21 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import r from "react";
3
- import { Input as m } from "./Input.js";
4
- import { IconX as l } from "@tabler/icons-react";
2
+ import e from "react";
3
+ import { Input as l } from "./Input.js";
4
+ import { IconX as m } from "@tabler/icons-react";
5
5
  import { Button as f } from "../button/Button.js";
6
6
  import { clearInputElement as s } from "./Input.utils.js";
7
- const p = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, d = (t) => p.test(t), R = r.forwardRef((t, x) => {
8
- x = x || r.useRef(null);
7
+ const p = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, I = (t) => p.test(t), _ = e.forwardRef((t, x) => {
8
+ x = x || e.useRef(null);
9
9
  const {
10
- clearable: e = !1,
10
+ clearable: r = !1,
11
11
  right: n,
12
12
  ...c
13
13
  } = t, i = () => {
14
14
  s(x.current);
15
15
  }, a = [n];
16
- return e && a.push(/* @__PURE__ */ o(f, { onClick: i, children: /* @__PURE__ */ o(l, { size: 13 }) })), /* @__PURE__ */ o(m, { right: a, type: "email", ref: x, ...c });
16
+ return r && a.push(/* @__PURE__ */ o(f, { onClick: i, children: /* @__PURE__ */ o(m, { size: 13 }) })), /* @__PURE__ */ o(l, { right: a, type: "email", ref: x, ...c });
17
17
  });
18
18
  export {
19
- R as EmailInput,
20
- d as emailValidation
19
+ _ as EmailInput,
20
+ I as emailValidation
21
21
  };
@@ -0,0 +1,32 @@
1
+ import { default as React } from 'react';
2
+ import { Code0Input } from './Input';
3
+ import { ValidationProps } from './useForm';
4
+ import { ComponentProps } from '../../utils';
5
+ import * as ArkUi from "@ark-ui/react";
6
+ export type FileInputProps = {
7
+ title?: React.ReactNode;
8
+ description?: React.ReactNode;
9
+ } & Code0Input & ValidationProps<ArkUi.FileUploadFileChangeDetails | undefined> & ArkUi.FileUploadRootProps;
10
+ export type FileInputDropzoneProps = ComponentProps & ArkUi.FileUploadDropzoneProps;
11
+ export type FileInputTriggerProps = ComponentProps & ArkUi.FileUploadTriggerProps;
12
+ export type FileInputItemGroupProps = ComponentProps & ArkUi.FileUploadItemGroupProps;
13
+ export type FileInputItemProps = ComponentProps & ArkUi.FileUploadItemProps;
14
+ export type FileInputItemPreviewProps = ComponentProps & ArkUi.FileUploadItemPreviewProps;
15
+ export type FileInputItemPreviewImageProps = ComponentProps & ArkUi.FileUploadItemPreviewImageProps;
16
+ export type FileInputItemNameProps = ComponentProps & ArkUi.FileUploadItemNameProps;
17
+ export type FileInputItemSizeTextProps = ComponentProps & ArkUi.FileUploadItemSizeTextProps;
18
+ export type FileInputItemDeleteTriggerProps = ComponentProps & ArkUi.FileUploadItemDeleteTriggerProps;
19
+ export type FileInputHiddenInputProps = ComponentProps & ArkUi.FileUploadHiddenInputProps;
20
+ export type FileInputContextProps = ArkUi.FileUploadContextProps;
21
+ export declare const FileInput: React.FC<FileInputProps>;
22
+ export declare const FileInputDropzone: React.FC<FileInputDropzoneProps>;
23
+ export declare const FileInputTrigger: React.FC<FileInputTriggerProps>;
24
+ export declare const FileInputItemGroup: React.FC<FileInputItemGroupProps>;
25
+ export declare const FileInputItem: React.FC<FileInputItemProps>;
26
+ export declare const FileInputItemPreview: React.FC<FileInputItemPreviewProps>;
27
+ export declare const FileInputItemPreviewImage: React.FC<FileInputItemPreviewImageProps>;
28
+ export declare const FileInputItemName: React.FC<FileInputItemNameProps>;
29
+ export declare const FileInputItemSizeText: React.FC<FileInputItemSizeTextProps>;
30
+ export declare const FileInputItemDeleteTrigger: React.FC<FileInputItemDeleteTriggerProps>;
31
+ export declare const FileInputHiddenInput: React.FC<FileInputHiddenInputProps>;
32
+ export declare const FileInputContext: React.FC<FileInputContextProps>;
@@ -0,0 +1,124 @@
1
+ import { jsx as n, jsxs as T } from "react/jsx-runtime";
2
+ import { c as r } from "../../_virtual/compiler-runtime.js";
3
+ import * as m from "@ark-ui/react";
4
+ import "../../utils/contextStore.js";
5
+ import "react";
6
+ import { mergeComponentProps as c } from "../../utils/component.js";
7
+ import "js-md5";
8
+ import { InputLabel as w } from "./InputLabel.js";
9
+ import { InputDescription as z } from "./InputDescription.js";
10
+ import { InputMessage as v } from "./InputMessage.js";
11
+ import '../../assets/components/form/FileInput.style.css';/* empty css */
12
+ const S = (l) => {
13
+ const e = r.c(20);
14
+ let t, i, o, s, a, f;
15
+ if (e[0] !== l) {
16
+ const {
17
+ title: U,
18
+ description: $,
19
+ formValidation: h,
20
+ children: x,
21
+ ..._
22
+ } = l;
23
+ f = U, o = $, s = h, i = x, t = m.FileUploadRoot, a = c("file-input", {
24
+ ..._,
25
+ onFileChange: (p) => {
26
+ console.log(p), s?.setValue?.(p), setTimeout(() => _.onFileChange?.(p), 1e3);
27
+ }
28
+ }), e[0] = l, e[1] = t, e[2] = i, e[3] = o, e[4] = s, e[5] = a, e[6] = f;
29
+ } else
30
+ t = e[1], i = e[2], o = e[3], s = e[4], a = e[5], f = e[6];
31
+ const g = a;
32
+ let u;
33
+ e[7] !== f ? (u = f && /* @__PURE__ */ n(w, { children: f }), e[7] = f, e[8] = u) : u = e[8];
34
+ let d;
35
+ e[9] !== o ? (d = o && /* @__PURE__ */ n(z, { children: o }), e[9] = o, e[10] = d) : d = e[10];
36
+ let I;
37
+ e[11] !== s ? (I = !s?.valid && s?.notValidMessage && /* @__PURE__ */ n(v, { children: s.notValidMessage }), e[11] = s, e[12] = I) : I = e[12];
38
+ let F;
39
+ return e[13] !== t || e[14] !== i || e[15] !== g || e[16] !== u || e[17] !== d || e[18] !== I ? (F = /* @__PURE__ */ T(t, { ...g, children: [
40
+ u,
41
+ d,
42
+ i,
43
+ I
44
+ ] }), e[13] = t, e[14] = i, e[15] = g, e[16] = u, e[17] = d, e[18] = I, e[19] = F) : F = e[19], F;
45
+ }, b = (l) => {
46
+ const e = r.c(4);
47
+ let t;
48
+ e[0] !== l ? (t = c("file-input__dropzone", l), e[0] = l, e[1] = t) : t = e[1];
49
+ let i;
50
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadDropzone, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
51
+ }, k = (l) => {
52
+ const e = r.c(4);
53
+ let t;
54
+ e[0] !== l ? (t = c("file-input__trigger", l), e[0] = l, e[1] = t) : t = e[1];
55
+ let i;
56
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadTrigger, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
57
+ }, A = (l) => {
58
+ const e = r.c(4);
59
+ let t;
60
+ e[0] !== l ? (t = c("file-input__item-group", l), e[0] = l, e[1] = t) : t = e[1];
61
+ let i;
62
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemGroup, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
63
+ }, E = (l) => {
64
+ const e = r.c(4);
65
+ let t;
66
+ e[0] !== l ? (t = c("file-input__item", l), e[0] = l, e[1] = t) : t = e[1];
67
+ const i = t;
68
+ let o;
69
+ return e[2] !== i ? (o = /* @__PURE__ */ n(m.FileUploadItem, { ...i }), e[2] = i, e[3] = o) : o = e[3], o;
70
+ }, L = (l) => {
71
+ const e = r.c(4);
72
+ let t;
73
+ e[0] !== l ? (t = c("file-input__item-preview", l), e[0] = l, e[1] = t) : t = e[1];
74
+ let i;
75
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemPreview, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
76
+ }, q = (l) => {
77
+ const e = r.c(4);
78
+ let t;
79
+ e[0] !== l ? (t = c("file-input__item-preview-image", l), e[0] = l, e[1] = t) : t = e[1];
80
+ let i;
81
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemPreviewImage, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
82
+ }, y = (l) => {
83
+ const e = r.c(4);
84
+ let t;
85
+ e[0] !== l ? (t = c("file-input__item-name", l), e[0] = l, e[1] = t) : t = e[1];
86
+ let i;
87
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemName, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
88
+ }, B = (l) => {
89
+ const e = r.c(4);
90
+ let t;
91
+ e[0] !== l ? (t = c("file-input__item-size-text", l), e[0] = l, e[1] = t) : t = e[1];
92
+ let i;
93
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemSizeText, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
94
+ }, J = (l) => {
95
+ const e = r.c(4);
96
+ let t;
97
+ e[0] !== l ? (t = c("file-input__item-delete-trigger", l), e[0] = l, e[1] = t) : t = e[1];
98
+ let i;
99
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadItemDeleteTrigger, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
100
+ }, K = (l) => {
101
+ const e = r.c(4);
102
+ let t;
103
+ e[0] !== l ? (t = c("file-input__hidden-input", l), e[0] = l, e[1] = t) : t = e[1];
104
+ let i;
105
+ return e[2] !== t ? (i = /* @__PURE__ */ n(m.FileUploadHiddenInput, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
106
+ }, O = (l) => {
107
+ const e = r.c(2);
108
+ let t;
109
+ return e[0] !== l ? (t = /* @__PURE__ */ n(m.FileUploadContext, { ...l }), e[0] = l, e[1] = t) : t = e[1], t;
110
+ };
111
+ export {
112
+ S as FileInput,
113
+ O as FileInputContext,
114
+ b as FileInputDropzone,
115
+ K as FileInputHiddenInput,
116
+ E as FileInputItem,
117
+ J as FileInputItemDeleteTrigger,
118
+ A as FileInputItemGroup,
119
+ y as FileInputItemName,
120
+ L as FileInputItemPreview,
121
+ q as FileInputItemPreviewImage,
122
+ B as FileInputItemSizeText,
123
+ k as FileInputTrigger
124
+ };