@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,142 +1,129 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { c as u } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { c as s } from "../../_virtual/compiler-runtime.js";
3
3
  import a from "react";
4
4
  import '../../assets/components/menu/Menu.style.css';/* empty css */
5
5
  import "../../utils/contextStore.js";
6
- import { mergeComponentProps as i } from "../../utils/component.js";
6
+ import { mergeComponentProps as l } from "../../utils/component.js";
7
+ import { useObservedOpen as d, usePopperMotion as f, popperTransformOrigin as _ } from "../../utils/motion.js";
7
8
  import "js-md5";
8
- import { DropdownMenuItem as w, DropdownMenuSubTrigger as b, DropdownMenu as g, DropdownMenuArrow as $, DropdownMenuCheckboxItem as D, DropdownMenuGroup as h, DropdownMenuItemIndicator as S, DropdownMenuLabel as I, DropdownMenuPortal as C, DropdownMenuSeparator as x, DropdownMenuSub as T, DropdownMenuTrigger as A, DropdownMenuContent as R, DropdownMenuSubContent as k } from "@radix-ui/react-dropdown-menu";
9
- import { AutoScrollArea as d } from "../scroll-area/ScrollArea.js";
10
- const z = (l) => {
11
- const e = u.c(4);
9
+ import { DropdownMenuItem as C, DropdownMenuSubTrigger as D, DropdownMenu as $, DropdownMenuArrow as O, DropdownMenuCheckboxItem as x, DropdownMenuContent as S, DropdownMenuGroup as v, DropdownMenuItemIndicator as P, DropdownMenuLabel as I, DropdownMenuPortal as R, DropdownMenuSeparator as A, DropdownMenuSub as T, DropdownMenuSubContent as y, DropdownMenuTrigger as k } from "@radix-ui/react-dropdown-menu";
10
+ import { AutoScrollArea as M } from "../scroll-area/ScrollArea.js";
11
+ import { motion as g } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
12
+ import { AnimatePresence as h } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
13
+ const w = a.createContext(!1), b = a.createContext(!1), K = (o) => {
14
+ const e = s.c(8), [n, r] = d(o.open, o.defaultOpen, o.onOpenChange);
12
15
  let t;
13
- e[0] !== l ? (t = i("menu", l), e[0] = l, e[1] = t) : t = e[1];
14
- const o = t;
16
+ e[0] !== o ? (t = l("menu", o), e[0] = o, e[1] = t) : t = e[1];
17
+ const c = t;
18
+ let i;
19
+ e[2] !== r || e[3] !== c ? (i = /* @__PURE__ */ u($, { ...c, onOpenChange: r }), e[2] = r, e[3] = c, e[4] = i) : i = e[4];
20
+ let m;
21
+ return e[5] !== n || e[6] !== i ? (m = /* @__PURE__ */ u(w.Provider, { value: n, children: i }), e[5] = n, e[6] = i, e[7] = m) : m = e[7], m;
22
+ }, Q = (o) => {
23
+ const e = s.c(4);
15
24
  let n;
16
- return e[2] !== o ? (n = /* @__PURE__ */ r(g, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
17
- }, B = (l) => {
18
- const e = u.c(4);
25
+ e[0] !== o ? (n = l("menu__trigger", o), e[0] = o, e[1] = n) : n = e[1];
26
+ const r = n;
19
27
  let t;
20
- e[0] !== l ? (t = i("menu__trigger", l), e[0] = l, e[1] = t) : t = e[1];
21
- const o = t;
28
+ return e[2] !== r ? (t = /* @__PURE__ */ u(k, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
29
+ }, U = (o) => {
30
+ const e = s.c(4);
22
31
  let n;
23
- return e[2] !== o ? (n = /* @__PURE__ */ r(A, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
24
- }, F = (l) => {
25
- const e = u.c(4);
32
+ e[0] !== o ? (n = l("menu__portal", o), e[0] = o, e[1] = n) : n = e[1];
33
+ const r = n;
26
34
  let t;
27
- e[0] !== l ? (t = i("menu__portal", l), e[0] = l, e[1] = t) : t = e[1];
28
- const o = t;
35
+ return e[2] !== r ? (t = /* @__PURE__ */ u(R, { forceMount: !0, ...r }), e[2] = r, e[3] = t) : t = e[3], t;
36
+ }, V = (o) => {
37
+ const {
38
+ children: e,
39
+ ...n
40
+ } = o, r = a.useContext(w), t = a.useRef(r), c = f();
41
+ return /* @__PURE__ */ u(h, { initial: !t.current, children: r && /* @__PURE__ */ u(S, { forceMount: !0, asChild: !0, align: o.align, ...l(`menu__content menu__content--${o.color ?? "primary"}`, n), children: /* @__PURE__ */ u(g.div, { ...c, style: _("dropdown-menu"), children: /* @__PURE__ */ u(M, { children: /* @__PURE__ */ u("div", { className: "menu__content-inner", children: e }) }) }) }, "menu__content") });
42
+ }, W = (o) => {
43
+ const e = s.c(4);
29
44
  let n;
30
- return e[2] !== o ? (n = /* @__PURE__ */ r(C, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
31
- }, H = (l) => {
32
- const e = u.c(12);
33
- let t, o, n, c;
34
- if (e[0] !== l) {
35
- const {
36
- children: _,
37
- ...M
38
- } = l;
39
- o = _, t = R, c = l.align, n = i(`menu__content menu__content--${l.color ?? "primary"}`, M), e[0] = l, e[1] = t, e[2] = o, e[3] = n, e[4] = c;
40
- } else
41
- t = e[1], o = e[2], n = e[3], c = e[4];
42
- const m = n;
43
- let s;
44
- e[5] !== o ? (s = /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r("div", { className: "menu__content-inner", children: o }) }), e[5] = o, e[6] = s) : s = e[6];
45
- let f;
46
- return e[7] !== t || e[8] !== c || e[9] !== m || e[10] !== s ? (f = /* @__PURE__ */ r(t, { align: c, ...m, children: s }), e[7] = t, e[8] = c, e[9] = m, e[10] = s, e[11] = f) : f = e[11], f;
47
- }, J = (l) => {
48
- const e = u.c(4);
45
+ e[0] !== o ? (n = l("menu__label", o), e[0] = o, e[1] = n) : n = e[1];
46
+ const r = n;
49
47
  let t;
50
- e[0] !== l ? (t = i("menu__label", l), e[0] = l, e[1] = t) : t = e[1];
51
- const o = t;
52
- let n;
53
- return e[2] !== o ? (n = /* @__PURE__ */ r(I, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
54
- }, K = a.forwardRef((l, e) => {
55
- const t = u.c(5);
56
- let o;
57
- t[0] !== l ? (o = i("menu__item", l), t[0] = l, t[1] = o) : o = t[1];
58
- const n = o;
48
+ return e[2] !== r ? (t = /* @__PURE__ */ u(I, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
49
+ }, X = a.forwardRef((o, e) => {
50
+ const n = s.c(5);
51
+ let r;
52
+ n[0] !== o ? (r = l("menu__item", o), n[0] = o, n[1] = r) : r = n[1];
53
+ const t = r;
59
54
  let c;
60
- return t[2] !== e || t[3] !== n ? (c = /* @__PURE__ */ r(w, { ref: e, ...n }), t[2] = e, t[3] = n, t[4] = c) : c = t[4], c;
61
- }), O = (l) => {
62
- const e = u.c(4);
63
- let t;
64
- e[0] !== l ? (t = i("menu__group", l), e[0] = l, e[1] = t) : t = e[1];
65
- const o = t;
55
+ return n[2] !== e || n[3] !== t ? (c = /* @__PURE__ */ u(C, { ref: e, ...t }), n[2] = e, n[3] = t, n[4] = c) : c = n[4], c;
56
+ }), Y = (o) => {
57
+ const e = s.c(4);
66
58
  let n;
67
- return e[2] !== o ? (n = /* @__PURE__ */ r(h, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
68
- }, Q = (l) => {
69
- const e = u.c(4);
59
+ e[0] !== o ? (n = l("menu__group", o), e[0] = o, e[1] = n) : n = e[1];
60
+ const r = n;
70
61
  let t;
71
- e[0] !== l ? (t = i("menu__sub", l), e[0] = l, e[1] = t) : t = e[1];
72
- const o = t;
73
- let n;
74
- return e[2] !== o ? (n = /* @__PURE__ */ r(T, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
75
- }, U = a.forwardRef((l, e) => {
76
- const t = u.c(5);
77
- let o;
78
- t[0] !== l ? (o = i("menu__sub-trigger", l), t[0] = l, t[1] = o) : o = t[1];
79
- const n = o;
80
- let c;
81
- return t[2] !== e || t[3] !== n ? (c = /* @__PURE__ */ r(b, { ref: e, ...n }), t[2] = e, t[3] = n, t[4] = c) : c = t[4], c;
82
- }), V = (l) => {
83
- const e = u.c(10);
84
- let t, o, n;
85
- if (e[0] !== l) {
86
- const {
87
- children: f,
88
- ..._
89
- } = l;
90
- o = f, t = k, n = i(`menu__sub-content menu__sub-content--${l.color ?? "primary"}`, _), e[0] = l, e[1] = t, e[2] = o, e[3] = n;
91
- } else
92
- t = e[1], o = e[2], n = e[3];
93
- const c = n;
94
- let m;
95
- e[4] !== o ? (m = /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r("div", { className: "menu__content-inner", children: o }) }), e[4] = o, e[5] = m) : m = e[5];
96
- let s;
97
- return e[6] !== t || e[7] !== c || e[8] !== m ? (s = /* @__PURE__ */ r(t, { ...c, children: m }), e[6] = t, e[7] = c, e[8] = m, e[9] = s) : s = e[9], s;
98
- }, W = (l) => {
99
- const e = u.c(4);
62
+ return e[2] !== r ? (t = /* @__PURE__ */ u(v, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
63
+ }, Z = (o) => {
64
+ const e = s.c(8), [n, r] = d(o.open, o.defaultOpen, o.onOpenChange);
100
65
  let t;
101
- e[0] !== l ? (t = i("menu__separator", l), e[0] = l, e[1] = t) : t = e[1];
102
- const o = t;
66
+ e[0] !== o ? (t = l("menu__sub", o), e[0] = o, e[1] = t) : t = e[1];
67
+ const c = t;
68
+ let i;
69
+ e[2] !== r || e[3] !== c ? (i = /* @__PURE__ */ u(T, { ...c, onOpenChange: r }), e[2] = r, e[3] = c, e[4] = i) : i = e[4];
70
+ let m;
71
+ return e[5] !== n || e[6] !== i ? (m = /* @__PURE__ */ u(b.Provider, { value: n, children: i }), e[5] = n, e[6] = i, e[7] = m) : m = e[7], m;
72
+ }, ee = a.forwardRef((o, e) => {
73
+ const n = s.c(5);
74
+ let r;
75
+ n[0] !== o ? (r = l("menu__sub-trigger", o), n[0] = o, n[1] = r) : r = n[1];
76
+ const t = r;
77
+ let c;
78
+ return n[2] !== e || n[3] !== t ? (c = /* @__PURE__ */ u(D, { ref: e, ...t }), n[2] = e, n[3] = t, n[4] = c) : c = n[4], c;
79
+ }), ne = (o) => {
80
+ const {
81
+ children: e,
82
+ ...n
83
+ } = o, r = a.useContext(b), t = a.useRef(r), c = f();
84
+ return /* @__PURE__ */ u(h, { initial: !t.current, children: r && /* @__PURE__ */ u(y, { forceMount: !0, asChild: !0, ...l(`menu__sub-content menu__sub-content--${o.color ?? "primary"}`, n), children: /* @__PURE__ */ u(g.div, { ...c, style: _("dropdown-menu"), children: /* @__PURE__ */ u(M, { children: /* @__PURE__ */ u("div", { className: "menu__content-inner", children: e }) }) }) }, "menu__sub-content") });
85
+ }, te = (o) => {
86
+ const e = s.c(4);
103
87
  let n;
104
- return e[2] !== o ? (n = /* @__PURE__ */ r(x, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
105
- }, X = (l) => {
106
- const e = u.c(4);
88
+ e[0] !== o ? (n = l("menu__separator", o), e[0] = o, e[1] = n) : n = e[1];
89
+ const r = n;
107
90
  let t;
108
- e[0] !== l ? (t = i("menu__checkbox-item", l), e[0] = l, e[1] = t) : t = e[1];
109
- const o = t;
91
+ return e[2] !== r ? (t = /* @__PURE__ */ u(A, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
92
+ }, oe = (o) => {
93
+ const e = s.c(4);
110
94
  let n;
111
- return e[2] !== o ? (n = /* @__PURE__ */ r(D, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
112
- }, Y = (l) => {
113
- const e = u.c(4);
95
+ e[0] !== o ? (n = l("menu__checkbox-item", o), e[0] = o, e[1] = n) : n = e[1];
96
+ const r = n;
114
97
  let t;
115
- e[0] !== l ? (t = i("menu__item-indicator", l), e[0] = l, e[1] = t) : t = e[1];
116
- const o = t;
98
+ return e[2] !== r ? (t = /* @__PURE__ */ u(x, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
99
+ }, re = (o) => {
100
+ const e = s.c(4);
117
101
  let n;
118
- return e[2] !== o ? (n = /* @__PURE__ */ r(S, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
119
- }, Z = (l) => {
120
- const e = u.c(4);
102
+ e[0] !== o ? (n = l("menu__item-indicator", o), e[0] = o, e[1] = n) : n = e[1];
103
+ const r = n;
121
104
  let t;
122
- e[0] !== l ? (t = i("menu__arrow", l), e[0] = l, e[1] = t) : t = e[1];
123
- const o = t;
105
+ return e[2] !== r ? (t = /* @__PURE__ */ u(P, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
106
+ }, ue = (o) => {
107
+ const e = s.c(4);
124
108
  let n;
125
- return e[2] !== o ? (n = /* @__PURE__ */ r($, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
109
+ e[0] !== o ? (n = l("menu__arrow", o), e[0] = o, e[1] = n) : n = e[1];
110
+ const r = n;
111
+ let t;
112
+ return e[2] !== r ? (t = /* @__PURE__ */ u(O, { ...r }), e[2] = r, e[3] = t) : t = e[3], t;
126
113
  };
127
114
  export {
128
- z as Menu,
129
- Z as MenuArrow,
130
- X as MenuCheckboxItem,
131
- H as MenuContent,
132
- O as MenuGroup,
133
- K as MenuItem,
134
- Y as MenuItemIndicator,
135
- J as MenuLabel,
136
- F as MenuPortal,
137
- W as MenuSeparator,
138
- Q as MenuSub,
139
- V as MenuSubContent,
140
- U as MenuSubTrigger,
141
- B as MenuTrigger
115
+ K as Menu,
116
+ ue as MenuArrow,
117
+ oe as MenuCheckboxItem,
118
+ V as MenuContent,
119
+ Y as MenuGroup,
120
+ X as MenuItem,
121
+ re as MenuItemIndicator,
122
+ W as MenuLabel,
123
+ U as MenuPortal,
124
+ te as MenuSeparator,
125
+ Z as MenuSub,
126
+ ne as MenuSubContent,
127
+ ee as MenuSubTrigger,
128
+ Q as MenuTrigger
142
129
  };
@@ -1,26 +1,27 @@
1
1
  import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
2
  import "../../utils/contextStore.js";
3
3
  import "react";
4
- import { mergeComponentProps as m } from "../../utils/component.js";
4
+ import { mergeComponentProps as d } from "../../utils/component.js";
5
+ import "../../_virtual/compiler-runtime.js";
5
6
  import "js-md5";
6
7
  import { ProgressRoot as f, ProgressCircle as _, ProgressCircleTrack as P, ProgressCircleRange as c } from "@ark-ui/react";
7
8
  import '../../assets/components/progress/Progress.style.css';/* empty css */
8
- const u = (l) => {
9
+ const b = (l) => {
9
10
  const {
10
11
  color: n = "white",
11
12
  predictionValue: a = 0,
12
13
  dot: p,
13
14
  value: h,
14
15
  max: g = 100,
15
- size: d = 64,
16
+ size: m = 64,
16
17
  thickness: i,
17
18
  ...t
18
19
  } = l, o = (e) => typeof e == "number" ? `${e}px` : e;
19
- return /* @__PURE__ */ s(f, { value: h, max: g, ...m("progress-circle", {
20
+ return /* @__PURE__ */ s(f, { value: h, max: g, ...d("progress-circle", {
20
21
  ...t,
21
22
  style: {
22
23
  ...t.style,
23
- "--size": o(d),
24
+ "--size": o(m),
24
25
  "--thickness": i !== void 0 ? o(i) : "calc(var(--size) / 8)",
25
26
  "--color": n
26
27
  }
@@ -45,5 +46,5 @@ const u = (l) => {
45
46
  ] });
46
47
  };
47
48
  export {
48
- u as ProgressCircle
49
+ b as ProgressCircle
49
50
  };
@@ -2,16 +2,17 @@ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import "../../utils/contextStore.js";
3
3
  import "react";
4
4
  import { mergeComponentProps as d } from "../../utils/component.js";
5
+ import "../../_virtual/compiler-runtime.js";
5
6
  import "js-md5";
6
7
  import * as o from "@radix-ui/react-progress";
7
8
  import '../../assets/components/progress/Progress.style.css';/* empty css */
8
- const _ = (r) => {
9
+ const y = (r) => {
9
10
  const {
10
11
  color: a = "white",
11
12
  predictionValue: g,
12
13
  dot: l,
13
14
  ...i
14
- } = r, t = Math.min(r.value ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, c = `translateX(-${100 - t}%)`, s = Math.min(r.predictionValue ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, m = `translateX(-${100 - s}%)`;
15
+ } = r, t = Math.min(r.value ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, m = `translateX(-${100 - t}%)`, s = Math.min(r.predictionValue ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, c = `translateX(-${100 - s}%)`;
15
16
  return /* @__PURE__ */ n(o.Progress, { ...d("progress-linear", {
16
17
  ...i,
17
18
  style: {
@@ -30,14 +31,14 @@ const _ = (r) => {
30
31
  position: "relative"
31
32
  }, children: [
32
33
  /* @__PURE__ */ e(o.ProgressIndicator, { className: "progress-linear__indicator", style: {
33
- transform: c
34
+ transform: m
34
35
  } }),
35
36
  typeof r.predictionValue == "number" && /* @__PURE__ */ e(o.ProgressIndicator, { className: "progress-linear__indicator progress-linear__indicator--prediction", style: {
36
- transform: m
37
+ transform: c
37
38
  } })
38
39
  ] })
39
40
  ] });
40
41
  };
41
42
  export {
42
- _ as ProgressLinear
43
+ y as ProgressLinear
43
44
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { ComponentProps, Color } from '../../utils';
3
- import { ToggleGroupSingleProps, ToggleGroupItemProps } from '@radix-ui/react-toggle-group';
2
+ import { Color, ComponentProps } from '../../utils';
3
+ import { ToggleGroupItemProps, ToggleGroupSingleProps } from '@radix-ui/react-toggle-group';
4
4
  type SegmentedControlProps = ComponentProps & ToggleGroupSingleProps & {
5
5
  color?: Color;
6
6
  };
@@ -1,27 +1,51 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { c as i } from "../../_virtual/compiler-runtime.js";
3
- import { Root as s, Item as f } from "@radix-ui/react-toggle-group";
1
+ import { jsx as d, jsxs as C } from "react/jsx-runtime";
2
+ import { c as f } from "../../_virtual/compiler-runtime.js";
3
+ import u from "react";
4
4
  import "../../utils/contextStore.js";
5
- import "react";
6
- import { mergeComponentProps as l } from "../../utils/component.js";
5
+ import { mergeComponentProps as g } from "../../utils/component.js";
6
+ import { useObservedValue as v, useReducedMotionSafe as x, springs as I } from "../../utils/motion.js";
7
7
  import "js-md5";
8
+ import { Root as h, Item as y } from "@radix-ui/react-toggle-group";
8
9
  import '../../assets/components/segmented-control/SegmentedControl.style.css';/* empty css */
9
- const I = (e) => {
10
- const t = i.c(5), o = `segmented-control segmented-control--${e.color ?? "secondary"}`;
11
- let m;
12
- t[0] !== e || t[1] !== o ? (m = l(o, e), t[0] = e, t[1] = o, t[2] = m) : m = t[2];
13
- const n = m;
14
- let r;
15
- return t[3] !== n ? (r = /* @__PURE__ */ c(s, { ...n }), t[3] = n, t[4] = r) : r = t[4], r;
16
- }, R = (e) => {
17
- const t = i.c(4);
18
- let o;
19
- t[0] !== e ? (o = l("segmented-control__item", e), t[0] = e, t[1] = o) : o = t[1];
20
- const m = o;
10
+ import { motion as R } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
11
+ const _ = u.createContext({
12
+ layoutId: "segmented-control__indicator"
13
+ }), M = (o) => {
14
+ const e = f.c(12), [a, i] = v(o.value, o.defaultValue, o.onValueChange), m = u.useId();
21
15
  let n;
22
- return t[2] !== m ? (n = /* @__PURE__ */ c(f, { ...m }), t[2] = m, t[3] = n) : n = t[3], n;
16
+ e[0] !== m || e[1] !== a ? (n = {
17
+ value: a,
18
+ layoutId: m
19
+ }, e[0] = m, e[1] = a, e[2] = n) : n = e[2];
20
+ const l = `segmented-control segmented-control--${o.color ?? "secondary"}`;
21
+ let r;
22
+ e[3] !== o || e[4] !== l ? (r = g(l, o), e[3] = o, e[4] = l, e[5] = r) : r = e[5];
23
+ const c = r;
24
+ let t;
25
+ e[6] !== i || e[7] !== c ? (t = /* @__PURE__ */ d(h, { ...c, onValueChange: i }), e[6] = i, e[7] = c, e[8] = t) : t = e[8];
26
+ let s;
27
+ return e[9] !== n || e[10] !== t ? (s = /* @__PURE__ */ d(_.Provider, { value: n, children: t }), e[9] = n, e[10] = t, e[11] = s) : s = e[11], s;
28
+ }, O = (o) => {
29
+ const e = f.c(11), {
30
+ value: a,
31
+ layoutId: i
32
+ } = u.useContext(_), m = x(), n = a === o.value;
33
+ let l;
34
+ e[0] !== i || e[1] !== m || e[2] !== n ? (l = n && /* @__PURE__ */ d(R.span, { layoutId: i, className: "segmented-control__indicator", "aria-hidden": !0, transition: m ? {
35
+ duration: 0
36
+ } : I.ui }), e[0] = i, e[1] = m, e[2] = n, e[3] = l) : l = e[3];
37
+ let r;
38
+ e[4] !== o ? (r = g("segmented-control__item", o), e[4] = o, e[5] = r) : r = e[5];
39
+ const c = r;
40
+ let t;
41
+ e[6] !== c ? (t = /* @__PURE__ */ d(y, { ...c }), e[6] = c, e[7] = t) : t = e[7];
42
+ let s;
43
+ return e[8] !== l || e[9] !== t ? (s = /* @__PURE__ */ C("span", { className: "segmented-control__item-wrapper", children: [
44
+ l,
45
+ t
46
+ ] }), e[8] = l, e[9] = t, e[10] = s) : s = e[10], s;
23
47
  };
24
48
  export {
25
- I as SegmentedControl,
26
- R as SegmentedControlItem
49
+ M as SegmentedControl,
50
+ O as SegmentedControlItem
27
51
  };
@@ -1,41 +1,67 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { c as s } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as u, jsxs as h } from "react/jsx-runtime";
2
+ import { c as b } from "../../_virtual/compiler-runtime.js";
3
+ import g from "react";
3
4
  import "../../utils/contextStore.js";
4
- import "react";
5
- import { mergeComponentProps as r } from "../../utils/component.js";
5
+ import { mergeComponentProps as _ } from "../../utils/component.js";
6
+ import { useObservedValue as C, useReducedMotionSafe as T, springs as x } from "../../utils/motion.js";
6
7
  import "js-md5";
7
- import { Tabs as c, Content as m, List as b, Trigger as f } from "@radix-ui/react-tabs";
8
+ import { Tabs as V, Content as I, List as $, Trigger as y } from "@radix-ui/react-tabs";
8
9
  import '../../assets/components/tab/Tab.style.css';/* empty css */
9
- const C = (a) => {
10
- const t = s.c(4);
11
- let e;
12
- t[0] !== a ? (e = r("tab", a), t[0] = a, t[1] = e) : e = t[1];
10
+ import { motion as N } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
11
+ const v = g.createContext({
12
+ layoutId: "tab__indicator",
13
+ orientation: "horizontal"
14
+ }), k = (e) => {
15
+ const t = b.c(12), [a, n] = C(e.value, e.defaultValue, e.onValueChange), o = g.useId(), c = e.orientation ?? "horizontal";
13
16
  let l;
14
- return t[2] !== e ? (l = /* @__PURE__ */ n(c, { "data-slot": "tabs", ...e }), t[2] = e, t[3] = l) : l = t[3], l;
15
- }, L = (a) => {
16
- const t = s.c(4);
17
- let e;
18
- t[0] !== a ? (e = r("tab__list", a), t[0] = a, t[1] = e) : e = t[1];
19
- let l;
20
- return t[2] !== e ? (l = /* @__PURE__ */ n(b, { "data-slot": "tabs", ...e }), t[2] = e, t[3] = l) : l = t[3], l;
21
- }, j = (a) => {
22
- const t = s.c(5), e = a.value;
23
- let l;
24
- t[0] !== a ? (l = r("tab__trigger", a), t[0] = a, t[1] = l) : l = t[1];
25
- const o = l;
17
+ t[0] !== o || t[1] !== c || t[2] !== a ? (l = {
18
+ value: a,
19
+ layoutId: o,
20
+ orientation: c
21
+ }, t[0] = o, t[1] = c, t[2] = a, t[3] = l) : l = t[3];
22
+ let s;
23
+ t[4] !== e ? (s = _("tab", e), t[4] = e, t[5] = s) : s = t[5];
24
+ let i;
25
+ t[6] !== n || t[7] !== s ? (i = /* @__PURE__ */ u(V, { "data-slot": "tabs", ...s, onValueChange: n }), t[6] = n, t[7] = s, t[8] = i) : i = t[8];
26
+ let r;
27
+ return t[9] !== l || t[10] !== i ? (r = /* @__PURE__ */ u(v.Provider, { value: l, children: i }), t[9] = l, t[10] = i, t[11] = r) : r = t[11], r;
28
+ }, q = (e) => {
29
+ const t = b.c(4);
30
+ let a;
31
+ t[0] !== e ? (a = _("tab__list", e), t[0] = e, t[1] = a) : a = t[1];
32
+ let n;
33
+ return t[2] !== a ? (n = /* @__PURE__ */ u($, { "data-slot": "tabs", ...a }), t[2] = a, t[3] = n) : n = t[3], n;
34
+ }, A = (e) => {
35
+ const t = b.c(13), {
36
+ value: a,
37
+ layoutId: n,
38
+ orientation: o
39
+ } = g.useContext(v), c = T(), l = a !== void 0 && a === e.value, s = e.value;
26
40
  let i;
27
- return t[2] !== a.value || t[3] !== o ? (i = /* @__PURE__ */ n(f, { "data-slot": "tabs", "data-value": e, ...o }), t[2] = a.value, t[3] = o, t[4] = i) : i = t[4], i;
28
- }, E = (a) => {
29
- const t = s.c(4);
30
- let e;
31
- t[0] !== a ? (e = r("tab__content", a), t[0] = a, t[1] = e) : e = t[1];
32
- const l = e;
41
+ t[0] !== e ? (i = _("tab__trigger", e), t[0] = e, t[1] = i) : i = t[1];
42
+ const r = i;
43
+ let d;
44
+ t[2] !== e.value || t[3] !== r ? (d = /* @__PURE__ */ u(y, { "data-slot": "tabs", "data-value": s, ...r }), t[2] = e.value, t[3] = r, t[4] = d) : d = t[4];
45
+ let m;
46
+ t[5] !== n || t[6] !== c || t[7] !== l ? (m = l && /* @__PURE__ */ u(N.span, { layoutId: n, className: "tab__indicator", "aria-hidden": !0, transition: c ? {
47
+ duration: 0
48
+ } : x.ui, children: /* @__PURE__ */ u("span", { className: "tab__indicator-bar" }) }), t[5] = n, t[6] = c, t[7] = l, t[8] = m) : m = t[8];
49
+ let f;
50
+ return t[9] !== o || t[10] !== d || t[11] !== m ? (f = /* @__PURE__ */ h("span", { className: "tab__trigger-wrapper", "data-orientation": o, children: [
51
+ d,
52
+ m
53
+ ] }), t[9] = o, t[10] = d, t[11] = m, t[12] = f) : f = t[12], f;
54
+ }, B = (e) => {
55
+ const t = b.c(4);
56
+ let a;
57
+ t[0] !== e ? (a = _("tab__content", e), t[0] = e, t[1] = a) : a = t[1];
58
+ const n = a;
33
59
  let o;
34
- return t[2] !== l ? (o = /* @__PURE__ */ n(m, { "data-slot": "tabs", ...l }), t[2] = l, t[3] = o) : o = t[3], o;
60
+ return t[2] !== n ? (o = /* @__PURE__ */ u(I, { "data-slot": "tabs", ...n }), t[2] = n, t[3] = o) : o = t[3], o;
35
61
  };
36
62
  export {
37
- C as Tab,
38
- E as TabContent,
39
- L as TabList,
40
- j as TabTrigger
63
+ k as Tab,
64
+ B as TabContent,
65
+ q as TabList,
66
+ A as TabTrigger
41
67
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Component, Color } from '../../utils';
2
+ import { Color, Component } from '../../utils';
3
3
  export interface ToastProps extends Omit<Component<HTMLDivElement>, "title" | "id"> {
4
4
  children?: React.ReactNode | React.ReactNode[];
5
5
  id: string | number;