@code0-tech/pictor 0.18.2 → 1.0.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 (39) hide show
  1. package/dist/assets/components/button/Button.style.css +1 -1
  2. package/dist/assets/components/command/Command.style.css +1 -1
  3. package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
  4. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  5. package/dist/assets/components/form/Input.style.css +1 -1
  6. package/dist/assets/components/form/SelectInput.style.css +1 -1
  7. package/dist/assets/components/menu/Menu.style.css +1 -1
  8. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  9. package/dist/assets/components/tab/Tab.style.css +1 -1
  10. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  11. package/dist/components/breadcrumb/Breadcrumb.js +9 -8
  12. package/dist/components/context-menu/ContextMenu.d.ts +1 -1
  13. package/dist/components/context-menu/ContextMenu.js +89 -102
  14. package/dist/components/data-table/DataTable.js +11 -10
  15. package/dist/components/dialog/Dialog.js +75 -80
  16. package/dist/components/editor/Editor.js +3 -2
  17. package/dist/components/form/EditorInput.js +490 -460
  18. package/dist/components/form/Input.js +18 -17
  19. package/dist/components/form/NumberInput.js +4 -4
  20. package/dist/components/form/PasswordInput.js +15 -15
  21. package/dist/components/form/TextInput.js +7 -7
  22. package/dist/components/gantt/GanttGroup.js +40 -39
  23. package/dist/components/json-view/JsonView.js +3 -3
  24. package/dist/components/menu/Menu.js +104 -117
  25. package/dist/components/progress/ProgressCircle.js +7 -6
  26. package/dist/components/progress/ProgressLinear.js +6 -5
  27. package/dist/components/segmented-control/SegmentedControl.d.ts +2 -2
  28. package/dist/components/segmented-control/SegmentedControl.js +44 -20
  29. package/dist/components/tab/Tab.js +58 -32
  30. package/dist/components/toast/Toast.d.ts +1 -1
  31. package/dist/components/toast/Toast.js +64 -65
  32. package/dist/components/tooltip/Tooltip.js +46 -51
  33. package/dist/index.js +181 -170
  34. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +12 -0
  35. package/dist/utils/index.d.ts +1 -0
  36. package/dist/utils/index.js +25 -14
  37. package/dist/utils/motion.d.ts +55 -0
  38. package/dist/utils/motion.js +115 -0
  39. package/package.json +8 -8
@@ -1,103 +1,98 @@
1
- import { jsx as n, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as g } from "react/jsx-runtime";
2
2
  import { c } from "../../_virtual/compiler-runtime.js";
3
3
  import * as s from "@radix-ui/react-dialog";
4
4
  import "../../utils/contextStore.js";
5
- import "react";
5
+ import f from "react";
6
6
  import { mergeComponentProps as r } from "../../utils/component.js";
7
+ import { useObservedOpen as C, useSurfaceMotion as D, useScrimMotion as v } from "../../utils/motion.js";
7
8
  import "js-md5";
8
- import { IconX as g } from "@tabler/icons-react";
9
+ import { IconX as x } from "@tabler/icons-react";
9
10
  import '../../assets/components/dialog/Dialog.style.css';/* empty css */
10
- import { Button as m } from "../button/Button.js";
11
- import { Flex as d } from "../flex/Flex.js";
12
- import { Text as _ } from "../text/Text.js";
13
- const j = (i) => {
14
- const t = c.c(4);
15
- let l;
16
- t[0] !== i ? (l = r("dialog", i), t[0] = i, t[1] = l) : l = t[1];
17
- const o = l;
18
- let e;
19
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Root, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
20
- }, z = (i) => {
21
- const t = c.c(4);
22
- let l;
23
- t[0] !== i ? (l = r("dialog__trigger", i), t[0] = i, t[1] = l) : l = t[1];
24
- const o = l;
25
- let e;
26
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Trigger, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
27
- }, F = (i) => {
11
+ import { Button as O } from "../button/Button.js";
12
+ import { Flex as y } from "../flex/Flex.js";
13
+ import { Text as P } from "../text/Text.js";
14
+ import { AnimatePresence as _ } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
15
+ import { motion as h } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
16
+ const d = f.createContext(!1), X = (o) => {
17
+ const t = c.c(8), [e, i] = C(o.open, o.defaultOpen, o.onOpenChange);
18
+ let n;
19
+ t[0] !== o ? (n = r("dialog", o), t[0] = o, t[1] = n) : n = t[1];
20
+ const u = n;
21
+ let a;
22
+ t[2] !== i || t[3] !== u ? (a = /* @__PURE__ */ l(s.Root, { ...u, onOpenChange: i }), t[2] = i, t[3] = u, t[4] = a) : a = t[4];
23
+ let m;
24
+ return t[5] !== e || t[6] !== a ? (m = /* @__PURE__ */ l(d.Provider, { value: e, children: a }), t[5] = e, t[6] = a, t[7] = m) : m = t[7], m;
25
+ }, k = (o) => {
28
26
  const t = c.c(4);
29
- let l;
30
- t[0] !== i ? (l = r("dialog__portal", i), t[0] = i, t[1] = l) : l = t[1];
31
- const o = l;
32
27
  let e;
33
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Portal, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
34
- }, u = (i) => {
28
+ t[0] !== o ? (e = r("dialog__trigger", o), t[0] = o, t[1] = e) : e = t[1];
29
+ const i = e;
30
+ let n;
31
+ return t[2] !== i ? (n = /* @__PURE__ */ l(s.Trigger, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
32
+ }, q = (o) => {
35
33
  const t = c.c(4);
36
- let l;
37
- t[0] !== i ? (l = r("dialog__close", i), t[0] = i, t[1] = l) : l = t[1];
38
- const o = l;
39
34
  let e;
40
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Close, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
41
- }, O = (i) => {
35
+ t[0] !== o ? (e = r("dialog__portal", o), t[0] = o, t[1] = e) : e = t[1];
36
+ const i = e;
37
+ let n;
38
+ return t[2] !== i ? (n = /* @__PURE__ */ l(s.Portal, { forceMount: !0, ...i }), t[2] = i, t[3] = n) : n = t[3], n;
39
+ }, $ = (o) => {
42
40
  const t = c.c(4);
43
- let l;
44
- t[0] !== i ? (l = r("dialog__overlay", i), t[0] = i, t[1] = l) : l = t[1];
45
- const o = l;
46
- let e;
47
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Overlay, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
48
- }, R = (i) => {
49
- const t = c.c(9);
50
- let l;
51
- t[0] !== i ? (l = r("dialog__content", i), t[0] = i, t[1] = l) : l = t[1];
52
- const o = l;
53
41
  let e;
54
- t[2] !== i.showCloseButton || t[3] !== i.title ? (e = i.showCloseButton && /* @__PURE__ */ f(d, { align: "center", justify: "space-between", children: [
55
- /* @__PURE__ */ n(_, { hierarchy: "primary", size: "xl", children: i.title }),
56
- /* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(m, { variant: "none", color: "tertiary", children: /* @__PURE__ */ n(g, { size: 16 }) }) })
57
- ] }), t[2] = i.showCloseButton, t[3] = i.title, t[4] = e) : e = t[4];
58
- let a;
59
- return t[5] !== i.children || t[6] !== o || t[7] !== e ? (a = /* @__PURE__ */ f(s.Content, { ...o, children: [
60
- e,
61
- i.children
62
- ] }), t[5] = i.children, t[6] = o, t[7] = e, t[8] = a) : a = t[8], a;
63
- }, b = (i) => {
42
+ t[0] !== o ? (e = r("dialog__close", o), t[0] = o, t[1] = e) : e = t[1];
43
+ const i = e;
44
+ let n;
45
+ return t[2] !== i ? (n = /* @__PURE__ */ l(s.Close, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
46
+ }, G = (o) => {
47
+ const t = f.useContext(d), e = f.useRef(t), i = v();
48
+ return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Overlay, { forceMount: !0, asChild: !0, ...r("dialog__overlay", o), children: /* @__PURE__ */ l(h.div, { ...i }) }, "dialog__overlay") });
49
+ }, J = (o) => {
50
+ const t = f.useContext(d), e = f.useRef(t), i = D();
51
+ return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Content, { forceMount: !0, asChild: !0, ...r("dialog__content", o), children: /* @__PURE__ */ g(h.div, { ...i, children: [
52
+ o.showCloseButton && /* @__PURE__ */ g(y, { align: "center", justify: "space-between", children: [
53
+ /* @__PURE__ */ l(P, { hierarchy: "primary", size: "xl", children: o.title }),
54
+ /* @__PURE__ */ l($, { asChild: !0, children: /* @__PURE__ */ l(O, { variant: "none", color: "tertiary", children: /* @__PURE__ */ l(x, { size: 16 }) }) })
55
+ ] }),
56
+ o.children
57
+ ] }) }, "dialog__content") });
58
+ }, K = (o) => {
64
59
  const t = c.c(4);
65
- let l;
66
- t[0] !== i ? (l = r("dialog__title", i), t[0] = i, t[1] = l) : l = t[1];
67
- const o = l;
68
60
  let e;
69
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Title, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
70
- }, E = (i) => {
61
+ t[0] !== o ? (e = r("dialog__title", o), t[0] = o, t[1] = e) : e = t[1];
62
+ const i = e;
63
+ let n;
64
+ return t[2] !== i ? (n = /* @__PURE__ */ l(s.Title, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
65
+ }, L = (o) => {
71
66
  const t = c.c(4);
72
- let l;
73
- t[0] !== i ? (l = r("dialog__description", i), t[0] = i, t[1] = l) : l = t[1];
74
- const o = l;
75
67
  let e;
76
- return t[2] !== o ? (e = /* @__PURE__ */ n(s.Description, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
77
- }, H = (i) => {
68
+ t[0] !== o ? (e = r("dialog__description", o), t[0] = o, t[1] = e) : e = t[1];
69
+ const i = e;
70
+ let n;
71
+ return t[2] !== i ? (n = /* @__PURE__ */ l(s.Description, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
72
+ }, N = (o) => {
78
73
  const t = c.c(4);
79
- let l;
80
- t[0] !== i ? (l = r("dialog__header", i), t[0] = i, t[1] = l) : l = t[1];
81
- const o = l;
82
74
  let e;
83
- return t[2] !== o ? (e = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
84
- }, I = (i) => {
75
+ t[0] !== o ? (e = r("dialog__header", o), t[0] = o, t[1] = e) : e = t[1];
76
+ const i = e;
77
+ let n;
78
+ return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
79
+ }, Q = (o) => {
85
80
  const t = c.c(4);
86
- let l;
87
- t[0] !== i ? (l = r("dialog__footer", i), t[0] = i, t[1] = l) : l = t[1];
88
- const o = l;
89
81
  let e;
90
- return t[2] !== o ? (e = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
82
+ t[0] !== o ? (e = r("dialog__footer", o), t[0] = o, t[1] = e) : e = t[1];
83
+ const i = e;
84
+ let n;
85
+ return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
91
86
  };
92
87
  export {
93
- j as Dialog,
94
- u as DialogClose,
95
- R as DialogContent,
96
- E as DialogDescription,
97
- I as DialogFooter,
98
- H as DialogHeader,
99
- O as DialogOverlay,
100
- F as DialogPortal,
101
- b as DialogTitle,
102
- z as DialogTrigger
88
+ X as Dialog,
89
+ $ as DialogClose,
90
+ J as DialogContent,
91
+ L as DialogDescription,
92
+ Q as DialogFooter,
93
+ N as DialogHeader,
94
+ G as DialogOverlay,
95
+ q as DialogPortal,
96
+ K as DialogTitle,
97
+ k as DialogTrigger
103
98
  };
@@ -3,6 +3,7 @@ import m, { isValidElement as me } from "react";
3
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
+ import "../../_virtual/compiler-runtime.js";
6
7
  import { hashToColor as w } from "../../utils/color.js";
7
8
  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
9
  import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
@@ -53,7 +54,7 @@ class X extends be {
53
54
  return t.type === this.type && t.rawValue === this.rawValue;
54
55
  }
55
56
  }
56
- const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), dr = (i) => {
57
+ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), mr = (i) => {
57
58
  const {
58
59
  language: t,
59
60
  tokenizer: f,
@@ -322,5 +323,5 @@ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
322
323
  ] });
323
324
  };
324
325
  export {
325
- dr as Editor
326
+ mr as Editor
326
327
  };