@code0-tech/pictor 0.15.0 → 0.17.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 (73) hide show
  1. package/dist/assets/components/alert/Alert.style.css +1 -1
  2. package/dist/assets/components/avatar/Avatar.style.css +1 -1
  3. package/dist/assets/components/badge/Badge.style.css +1 -1
  4. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -1
  5. package/dist/assets/components/button/Button.style.css +1 -1
  6. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
  7. package/dist/assets/components/card/Card.style.css +1 -1
  8. package/dist/assets/components/chart/Chart.style.css +1 -0
  9. package/dist/assets/components/command/Command.style.css +1 -1
  10. package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
  11. package/dist/assets/components/data-table/DataTable.style.css +1 -1
  12. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  13. package/dist/assets/components/editor/Editor.styles.css +1 -1
  14. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
  15. package/dist/assets/components/form/ColorInput.style.css +1 -0
  16. package/dist/assets/components/form/DateInput.style.css +1 -1
  17. package/dist/assets/components/form/EditorInput.style.css +1 -1
  18. package/dist/assets/components/form/Input.style.css +1 -1
  19. package/dist/assets/components/form/InputWrapper.style.css +1 -1
  20. package/dist/assets/components/form/SelectInput.style.css +1 -1
  21. package/dist/assets/components/json-view/JsonView.style.css +1 -1
  22. package/dist/assets/components/menu/Menu.style.css +1 -1
  23. package/dist/assets/components/resizable/Resizable.style.css +1 -1
  24. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  25. package/dist/assets/components/spacing/Spacing.style.css +1 -1
  26. package/dist/assets/components/tab/Tab.style.css +1 -1
  27. package/dist/assets/components/text/Text.style.css +1 -1
  28. package/dist/assets/components/toast/Toast.style.css +1 -1
  29. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  30. package/dist/components/alert/Alert.js +33 -31
  31. package/dist/components/chart/Chart.d.ts +32 -0
  32. package/dist/components/chart/Chart.js +157 -0
  33. package/dist/components/chart/LineChart.d.ts +27 -0
  34. package/dist/components/chart/LineChart.js +76 -0
  35. package/dist/components/chart/index.d.ts +2 -0
  36. package/dist/components/chart/index.js +8 -0
  37. package/dist/components/command/Command.js +20 -22
  38. package/dist/components/form/ColorInput.d.ts +33 -0
  39. package/dist/components/form/ColorInput.js +355 -0
  40. package/dist/components/form/DateInput.js +82 -86
  41. package/dist/components/form/EditorInput.d.ts +26 -10
  42. package/dist/components/form/EditorInput.js +520 -148
  43. package/dist/components/form/EmailInput.js +16 -15
  44. package/dist/components/form/Input.d.ts +0 -20
  45. package/dist/components/form/Input.js +48 -425
  46. package/dist/components/form/InputLabel.d.ts +2 -1
  47. package/dist/components/form/InputLabel.js +20 -9
  48. package/dist/components/form/InputWrapper.d.ts +0 -1
  49. package/dist/components/form/InputWrapper.js +52 -48
  50. package/dist/components/form/NumberInput.js +17 -16
  51. package/dist/components/form/PasswordInput.js +23 -22
  52. package/dist/components/form/TagInput.d.ts +30 -0
  53. package/dist/components/form/TagInput.js +117 -0
  54. package/dist/components/form/TextInput.js +12 -11
  55. package/dist/components/form/index.d.ts +2 -2
  56. package/dist/components/form/index.js +83 -69
  57. package/dist/components/layout/Layout.js +37 -37
  58. package/dist/components/menu/Menu.d.ts +2 -2
  59. package/dist/components/menu/Menu.js +87 -87
  60. package/dist/components/scroll-area/ScrollArea.js +1 -1
  61. package/dist/components/toast/Toast.js +61 -61
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.js +247 -227
  64. package/dist/utils/index.js +11 -11
  65. package/dist/utils/size.d.ts +3 -3
  66. package/dist/utils/size.js +12 -6
  67. package/package.json +26 -20
  68. package/dist/components/form/Input.syntax.hook.d.ts +0 -10
  69. package/dist/components/form/Input.syntax.hook.js +0 -14
  70. package/dist/components/form/InputContentEditable.hook.d.ts +0 -52
  71. package/dist/components/form/InputContentEditable.hook.js +0 -449
  72. package/dist/components/form/InputSuggestion.d.ts +0 -27
  73. package/dist/components/form/InputSuggestion.js +0 -218
@@ -1,5 +1,5 @@
1
- import { jsx as n, jsxs as b, Fragment as H } from "react/jsx-runtime";
2
- import { c as T } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as n, jsxs as g, Fragment as H } from "react/jsx-runtime";
2
+ import { c as b } from "../../_virtual/compiler-runtime.js";
3
3
  import { DatePicker as a, DateInput as C } from "@ark-ui/react";
4
4
  import { toZoned as J, getLocalTimeZone as q, fromDate as K } from "@internationalized/date";
5
5
  import { IconChevronDown as Q } from "@tabler/icons-react";
@@ -12,28 +12,28 @@ import { Flex as ee } from "../flex/Flex.js";
12
12
  import { MenuTrigger as te, Menu as ne, MenuPortal as le, MenuContent as re } from "../menu/Menu.js";
13
13
  import { SelectPortal as ie, SelectContent as ae, SelectViewport as ce, SelectItem as oe, SelectItemText as se, SelectValue as ue, SelectTrigger as me, SelectInput as de } from "./SelectInput.js";
14
14
  import '../../assets/components/form/DateInput.style.css';/* empty css */
15
- import { Button as fe } from "../button/Button.js";
16
- const he = (t) => K(new Date(t * 1e3), q()), _e = (t) => Math.floor(J(t, q()).toDate().getTime() / 1e3), Y = (t) => {
15
+ import { Button as he } from "../button/Button.js";
16
+ const fe = (t) => K(new Date(t * 1e3), q()), _e = (t) => Math.floor(J(t, q()).toDate().getTime() / 1e3), Y = (t) => {
17
17
  const e = Array.isArray(t) ? t : [t], l = [];
18
18
  for (const r of e)
19
- r == null || r === "" || (typeof r == "number" ? Number.isNaN(r) || l.push(he(r)) : l.push(r));
19
+ r == null || r === "" || (typeof r == "number" ? Number.isNaN(r) || l.push(fe(r)) : l.push(r));
20
20
  return l;
21
21
  }, qe = (t) => {
22
- const e = T.c(43), {
22
+ const e = b.c(43), {
23
23
  title: l,
24
24
  description: r,
25
25
  left: i,
26
26
  leftType: c,
27
27
  rightType: o,
28
28
  right: s,
29
- formValidation: u,
30
- initialValue: m,
31
- defaultValue: h,
29
+ formValidation: m,
30
+ initialValue: u,
31
+ defaultValue: f,
32
32
  value: d,
33
- granularity: f,
33
+ granularity: h,
34
34
  closeOnSelect: _,
35
35
  name: p,
36
- disabled: g,
36
+ disabled: T,
37
37
  readOnly: k,
38
38
  locale: v,
39
39
  placeholderValue: A,
@@ -41,7 +41,7 @@ const he = (t) => K(new Date(t * 1e3), q()), _e = (t) => Math.floor(J(t, q()).to
41
41
  children: z
42
42
  } = t;
43
43
  let $;
44
- e[0] !== h || e[1] !== m || e[2] !== d ? ($ = () => Y(d ?? m ?? h), e[0] = h, e[1] = m, e[2] = d, e[3] = $) : $ = e[3];
44
+ e[0] !== f || e[1] !== u || e[2] !== d ? ($ = () => Y(d ?? u ?? f), e[0] = f, e[1] = u, e[2] = d, e[3] = $) : $ = e[3];
45
45
  const [w, L] = F.useState($);
46
46
  let R, M;
47
47
  e[4] !== d ? (R = () => {
@@ -49,41 +49,41 @@ const he = (t) => K(new Date(t * 1e3), q()), _e = (t) => Math.floor(J(t, q()).to
49
49
  }, M = [d], e[4] = d, e[5] = R, e[6] = M) : (R = e[5], M = e[6]), F.useEffect(R, M);
50
50
  const [y, W] = F.useState(!1);
51
51
  let O;
52
- e[7] !== u || e[8] !== G ? (O = (I) => {
53
- L(I.value), u?.setValue?.(I.value[0] ? _e(I.value[0]) : null), G?.(I);
54
- }, e[7] = u, e[8] = G, e[9] = O) : O = e[9];
55
- const N = O;
52
+ e[7] !== m || e[8] !== G ? (O = (I) => {
53
+ L(I.value), m?.setValue?.(I.value[0] ? _e(I.value[0]) : null), G?.(I);
54
+ }, e[7] = m, e[8] = G, e[9] = O) : O = e[9];
55
+ const V = O;
56
56
  let P;
57
- e[10] !== w || e[11] !== g || e[12] !== f || e[13] !== N || e[14] !== v || e[15] !== p || e[16] !== A || e[17] !== k ? (P = S("date-input", {
57
+ e[10] !== w || e[11] !== T || e[12] !== h || e[13] !== V || e[14] !== v || e[15] !== p || e[16] !== A || e[17] !== k ? (P = S("date-input", {
58
58
  value: w,
59
- onValueChange: N,
60
- granularity: f,
59
+ onValueChange: V,
60
+ granularity: h,
61
61
  name: p,
62
- disabled: g,
62
+ disabled: T,
63
63
  readOnly: k,
64
64
  locale: v,
65
65
  placeholderValue: A
66
- }), e[10] = w, e[11] = g, e[12] = f, e[13] = N, e[14] = v, e[15] = p, e[16] = A, e[17] = k, e[18] = P) : P = e[18];
66
+ }), e[10] = w, e[11] = T, e[12] = h, e[13] = V, e[14] = v, e[15] = p, e[16] = A, e[17] = k, e[18] = P) : P = e[18];
67
67
  const E = P;
68
68
  let j;
69
69
  e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = (I) => W(I.open), e[19] = j) : j = e[19];
70
- let V;
71
- e[20] !== z || e[21] !== r || e[22] !== u || e[23] !== i || e[24] !== c || e[25] !== s || e[26] !== o || e[27] !== l ? (V = /* @__PURE__ */ n(X, { title: l, description: r, left: i, leftType: c, right: s, rightType: o, formValidation: u, children: z }), e[20] = z, e[21] = r, e[22] = u, e[23] = i, e[24] = c, e[25] = s, e[26] = o, e[27] = l, e[28] = V) : V = e[28];
70
+ let N;
71
+ e[20] !== z || e[21] !== r || e[22] !== m || e[23] !== i || e[24] !== c || e[25] !== s || e[26] !== o || e[27] !== l ? (N = /* @__PURE__ */ n(X, { title: l, description: r, left: i, leftType: c, right: s, rightType: o, formValidation: m, children: z }), e[20] = z, e[21] = r, e[22] = m, e[23] = i, e[24] = c, e[25] = s, e[26] = o, e[27] = l, e[28] = N) : N = e[28];
72
72
  let x;
73
- e[29] !== y || e[30] !== V ? (x = /* @__PURE__ */ n(ne, { open: y, onOpenChange: W, children: V }), e[29] = y, e[30] = V, e[31] = x) : x = e[31];
73
+ e[29] !== y || e[30] !== N ? (x = /* @__PURE__ */ n(ne, { open: y, onOpenChange: W, children: N }), e[29] = y, e[30] = N, e[31] = x) : x = e[31];
74
74
  let D;
75
- e[32] !== _ || e[33] !== w || e[34] !== g || e[35] !== N || e[36] !== v || e[37] !== y || e[38] !== x ? (D = /* @__PURE__ */ n(a.Root, { value: w, onValueChange: N, open: y, onOpenChange: j, closeOnSelect: _, disabled: g, locale: v, children: x }), e[32] = _, e[33] = w, e[34] = g, e[35] = N, e[36] = v, e[37] = y, e[38] = x, e[39] = D) : D = e[39];
75
+ e[32] !== _ || e[33] !== w || e[34] !== T || e[35] !== V || e[36] !== v || e[37] !== y || e[38] !== x ? (D = /* @__PURE__ */ n(a.Root, { value: w, onValueChange: V, open: y, onOpenChange: j, closeOnSelect: _, disabled: T, locale: v, children: x }), e[32] = _, e[33] = w, e[34] = T, e[35] = V, e[36] = v, e[37] = y, e[38] = x, e[39] = D) : D = e[39];
76
76
  let B;
77
77
  return e[40] !== E || e[41] !== D ? (B = /* @__PURE__ */ n(C.Root, { ...E, children: D }), e[40] = E, e[41] = D, e[42] = B) : B = e[42], B;
78
78
  }, Je = (t) => {
79
- const e = T.c(4);
79
+ const e = b.c(4);
80
80
  let l;
81
81
  e[0] !== t ? (l = S("date-input__control", t), e[0] = t, e[1] = l) : l = e[1];
82
82
  const r = l;
83
83
  let i;
84
84
  return e[2] !== r ? (i = /* @__PURE__ */ n(C.Control, { ...r }), e[2] = r, e[3] = i) : i = e[3], i;
85
85
  }, Ke = (t) => {
86
- const e = T.c(8);
86
+ const e = b.c(8);
87
87
  let l;
88
88
  e[0] !== t ? (l = S("date-input__segment-group", t), e[0] = t, e[1] = l) : l = e[1];
89
89
  const r = l;
@@ -94,110 +94,106 @@ const he = (t) => K(new Date(t * 1e3), q()), _e = (t) => Math.floor(J(t, q()).to
94
94
  let o;
95
95
  e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ n(C.HiddenInput, {}), e[5] = o) : o = e[5];
96
96
  let s;
97
- return e[6] !== c ? (s = /* @__PURE__ */ b(H, { children: [
97
+ return e[6] !== c ? (s = /* @__PURE__ */ g(H, { children: [
98
98
  c,
99
99
  o
100
100
  ] }), e[6] = c, e[7] = s) : s = e[7], s;
101
101
  }, Qe = (t) => {
102
- const e = T.c(4);
102
+ const e = b.c(4);
103
103
  let l;
104
104
  e[0] !== t ? (l = S("date-input__trigger", t), e[0] = t, e[1] = l) : l = e[1];
105
105
  const r = l;
106
106
  let i;
107
107
  return e[2] !== r ? (i = /* @__PURE__ */ n(te, { ...r }), e[2] = r, e[3] = i) : i = e[3], i;
108
108
  }, pe = (t) => {
109
- const e = T.c(4);
109
+ const e = b.c(4);
110
110
  let l;
111
111
  e[0] !== t ? (l = S("date-input__prev-trigger", t), e[0] = t, e[1] = l) : l = e[1];
112
112
  const r = l;
113
113
  let i;
114
114
  return e[2] !== r ? (i = /* @__PURE__ */ n(a.PrevTrigger, { ...r }), e[2] = r, e[3] = i) : i = e[3], i;
115
115
  }, ge = (t) => {
116
- const e = T.c(4);
116
+ const e = b.c(4);
117
117
  let l;
118
118
  e[0] !== t ? (l = S("date-input__next-trigger", t), e[0] = t, e[1] = l) : l = e[1];
119
119
  const r = l;
120
120
  let i;
121
121
  return e[2] !== r ? (i = /* @__PURE__ */ n(a.NextTrigger, { ...r }), e[2] = r, e[3] = i) : i = e[3], i;
122
122
  }, Z = () => {
123
- const t = T.c(2);
123
+ const t = b.c(2);
124
124
  let e;
125
125
  t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(pe, { children: "‹" }), t[0] = e) : e = t[0];
126
126
  let l;
127
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ b(a.ViewControl, { className: "date-input__view-control", children: [
127
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ g(a.ViewControl, { className: "date-input__view-control", children: [
128
128
  e,
129
129
  /* @__PURE__ */ n(a.ViewTrigger, { className: "date-input__view-trigger", children: /* @__PURE__ */ n(a.RangeText, { className: "date-input__range-text" }) }),
130
130
  /* @__PURE__ */ n(ge, { children: "›" })
131
131
  ] }), t[1] = l) : l = t[1], l;
132
132
  }, Xe = (t) => {
133
- const e = T.c(20);
133
+ const e = b.c(20);
134
134
  let l, r, i, c, o, s;
135
135
  if (e[0] !== t) {
136
136
  const {
137
137
  withTime: p,
138
- ...g
138
+ ...T
139
139
  } = t;
140
- s = p, r = le, l = re, c = "end", o = 8, i = S("date-input__content", g), e[0] = t, e[1] = l, e[2] = r, e[3] = i, e[4] = c, e[5] = o, e[6] = s;
140
+ s = p, r = le, l = re, c = "end", o = 8, i = S("date-input__content", T), e[0] = t, e[1] = l, e[2] = r, e[3] = i, e[4] = c, e[5] = o, e[6] = s;
141
141
  } else
142
142
  l = e[1], r = e[2], i = e[3], c = e[4], o = e[5], s = e[6];
143
- const u = i;
144
- let m;
145
- e[7] !== s ? (m = /* @__PURE__ */ n(a.View, { view: "day", className: "date-input__view", children: /* @__PURE__ */ n(a.Context, { children: (p) => /* @__PURE__ */ b(H, { children: [
143
+ const m = i;
144
+ let u;
145
+ e[7] !== s ? (u = /* @__PURE__ */ n(a.View, { view: "day", className: "date-input__view", children: /* @__PURE__ */ n(a.Context, { children: (p) => /* @__PURE__ */ g(H, { children: [
146
146
  /* @__PURE__ */ n(Z, {}),
147
- /* @__PURE__ */ b(a.Table, { className: "date-input__table", children: [
147
+ /* @__PURE__ */ g(a.Table, { className: "date-input__table", children: [
148
148
  /* @__PURE__ */ n(a.TableHead, { children: /* @__PURE__ */ n(a.TableRow, { children: p.weekDays.map(Se) }) }),
149
149
  /* @__PURE__ */ n(a.TableBody, { children: p.weeks.map(we) })
150
150
  ] }),
151
151
  s && /* @__PURE__ */ n(be, {})
152
- ] }) }) }), e[7] = s, e[8] = m) : m = e[8];
153
- let h;
154
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ n(a.View, { view: "month", className: "date-input__view", children: /* @__PURE__ */ n(a.Context, { children: Ve }) }), e[9] = h) : h = e[9];
152
+ ] }) }) }), e[7] = s, e[8] = u) : u = e[8];
153
+ let f;
154
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ n(a.View, { view: "month", className: "date-input__view", children: /* @__PURE__ */ n(a.Context, { children: Ne }) }), e[9] = f) : f = e[9];
155
155
  let d;
156
156
  e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ n(a.View, { view: "year", className: "date-input__view", children: /* @__PURE__ */ n(a.Context, { children: Ie }) }), e[10] = d) : d = e[10];
157
- let f;
158
- e[11] !== l || e[12] !== c || e[13] !== o || e[14] !== u || e[15] !== m ? (f = /* @__PURE__ */ b(l, { align: c, sideOffset: o, ...u, children: [
159
- m,
160
- h,
157
+ let h;
158
+ e[11] !== l || e[12] !== c || e[13] !== o || e[14] !== m || e[15] !== u ? (h = /* @__PURE__ */ g(l, { align: c, sideOffset: o, ...m, children: [
159
+ u,
160
+ f,
161
161
  d
162
- ] }), e[11] = l, e[12] = c, e[13] = o, e[14] = u, e[15] = m, e[16] = f) : f = e[16];
162
+ ] }), e[11] = l, e[12] = c, e[13] = o, e[14] = m, e[15] = u, e[16] = h) : h = e[16];
163
163
  let _;
164
- return e[17] !== r || e[18] !== f ? (_ = /* @__PURE__ */ n(r, { children: f }), e[17] = r, e[18] = f, e[19] = _) : _ = e[19], _;
164
+ return e[17] !== r || e[18] !== h ? (_ = /* @__PURE__ */ n(r, { children: h }), e[17] = r, e[18] = h, e[19] = _) : _ = e[19], _;
165
165
  }, be = () => {
166
- const t = T.c(1);
166
+ const t = b.c(1);
167
167
  let e;
168
168
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(C.Context, { children: Me }), t[0] = e) : e = t[0], e;
169
169
  }, U = (t) => {
170
- const e = T.c(16), {
170
+ const e = b.c(15), {
171
171
  label: l,
172
172
  value: r,
173
173
  count: i,
174
174
  disabled: c,
175
175
  onValueChange: o
176
176
  } = t, s = String(r);
177
- let u;
178
- e[0] !== o ? (u = (g) => o(Number(g)), e[0] = o, e[1] = u) : u = e[1];
179
177
  let m;
180
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = {
181
- className: "date-input__time-select"
182
- }, e[2] = m) : m = e[2];
183
- let h;
184
- e[3] !== l ? (h = /* @__PURE__ */ n(ue, { "aria-label": l }), e[3] = l, e[4] = h) : h = e[4];
185
- let d;
186
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ n(Q, { size: 13 }), e[5] = d) : d = e[5];
178
+ e[0] !== o ? (m = (p) => o(Number(p)), e[0] = o, e[1] = m) : m = e[1];
179
+ let u;
180
+ e[2] !== l ? (u = /* @__PURE__ */ n(ue, { "aria-label": l }), e[2] = l, e[3] = u) : u = e[3];
187
181
  let f;
188
- e[6] !== h ? (f = /* @__PURE__ */ n(me, { asChild: !0, children: /* @__PURE__ */ n(fe, { paddingSize: "xxs", justify: "start", children: /* @__PURE__ */ b(ee, { justify: "space-between", w: "100%", align: "center", children: [
189
- h,
190
- d
191
- ] }) }) }), e[6] = h, e[7] = f) : f = e[7];
192
- let _;
193
- e[8] !== i ? (_ = /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(ae, { position: "item-aligned", children: /* @__PURE__ */ n(ce, { children: Array.from({
182
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ n(Q, { size: 13 }), e[4] = f) : f = e[4];
183
+ let d;
184
+ e[5] !== u ? (d = /* @__PURE__ */ n(me, { asChild: !0, children: /* @__PURE__ */ n(he, { paddingSize: "xxs", justify: "start", children: /* @__PURE__ */ g(ee, { justify: "space-between", w: "100%", align: "center", children: [
185
+ u,
186
+ f
187
+ ] }) }) }), e[5] = u, e[6] = d) : d = e[6];
188
+ let h;
189
+ e[7] !== i ? (h = /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(ae, { position: "item-aligned", children: /* @__PURE__ */ n(ce, { children: Array.from({
194
190
  length: i
195
- }, Oe) }) }) }), e[8] = i, e[9] = _) : _ = e[9];
196
- let p;
197
- return e[10] !== c || e[11] !== s || e[12] !== u || e[13] !== f || e[14] !== _ ? (p = /* @__PURE__ */ b(de, { value: s, disabled: c, onValueChange: u, wrapperComponent: m, children: [
198
- f,
199
- _
200
- ] }), e[10] = c, e[11] = s, e[12] = u, e[13] = f, e[14] = _, e[15] = p) : p = e[15], p;
191
+ }, Oe) }) }) }), e[7] = i, e[8] = h) : h = e[8];
192
+ let _;
193
+ return e[9] !== c || e[10] !== s || e[11] !== m || e[12] !== d || e[13] !== h ? (_ = /* @__PURE__ */ g(de, { value: s, disabled: c, onValueChange: m, children: [
194
+ d,
195
+ h
196
+ ] }), e[9] = c, e[10] = s, e[11] = m, e[12] = d, e[13] = h, e[14] = _) : _ = e[14], _;
201
197
  };
202
198
  function Te(t, e) {
203
199
  return /* @__PURE__ */ n(C.Segment, { segment: t, className: "date-input__segment" }, e);
@@ -217,16 +213,16 @@ function we(t, e) {
217
213
  function ye(t, e) {
218
214
  return /* @__PURE__ */ n(a.TableCell, { value: t.value, children: /* @__PURE__ */ n(a.TableCellTrigger, { className: "date-input__cell", children: t.label }) }, e);
219
215
  }
220
- function Ne(t, e) {
216
+ function Ve(t, e) {
221
217
  return /* @__PURE__ */ n(a.TableRow, { children: t.map(ye) }, e);
222
218
  }
223
- function Ve(t) {
224
- return /* @__PURE__ */ b(H, { children: [
219
+ function Ne(t) {
220
+ return /* @__PURE__ */ g(H, { children: [
225
221
  /* @__PURE__ */ n(Z, {}),
226
222
  /* @__PURE__ */ n(a.Table, { className: "date-input__table", children: /* @__PURE__ */ n(a.TableBody, { children: t.getMonthsGrid({
227
223
  columns: 4,
228
224
  format: "short"
229
- }).map(Ne) }) })
225
+ }).map(Ve) }) })
230
226
  ] });
231
227
  }
232
228
  function xe(t, e) {
@@ -236,7 +232,7 @@ function De(t, e) {
236
232
  return /* @__PURE__ */ n(a.TableRow, { children: t.map(xe) }, e);
237
233
  }
238
234
  function Ie(t) {
239
- return /* @__PURE__ */ b(H, { children: [
235
+ return /* @__PURE__ */ g(H, { children: [
240
236
  /* @__PURE__ */ n(Z, {}),
241
237
  /* @__PURE__ */ n(a.Table, { className: "date-input__table", children: /* @__PURE__ */ n(a.TableBody, { children: t.getYearsGrid({
242
238
  columns: 4
@@ -247,7 +243,7 @@ function $e(t) {
247
243
  return t.type;
248
244
  }
249
245
  function Re(t, e) {
250
- return /* @__PURE__ */ b(F.Fragment, { children: [
246
+ return /* @__PURE__ */ g(F.Fragment, { children: [
251
247
  e > 0 && /* @__PURE__ */ n("span", { className: "date-input__time-separator", children: ":" }),
252
248
  t
253
249
  ] }, e);
@@ -255,20 +251,20 @@ function Re(t, e) {
255
251
  function Me(t) {
256
252
  const e = new Set(t.getSegments().map($e));
257
253
  return /* @__PURE__ */ n(a.Context, { children: (l) => {
258
- const r = l.value[0], i = r?.hour ?? 0, c = r?.minute ?? 0, o = r?.second ?? 0, s = l.value.length === 0, u = [];
259
- return e.has("hour") && u.push(/* @__PURE__ */ n(U, { label: "Hour", value: i, count: 24, disabled: s, onValueChange: (m) => l.setTime({
260
- hour: m,
254
+ const r = l.value[0], i = r?.hour ?? 0, c = r?.minute ?? 0, o = r?.second ?? 0, s = l.value.length === 0, m = [];
255
+ return e.has("hour") && m.push(/* @__PURE__ */ n(U, { label: "Hour", value: i, count: 24, disabled: s, onValueChange: (u) => l.setTime({
256
+ hour: u,
261
257
  minute: c,
262
258
  second: o
263
- }) }, "hour")), e.has("minute") && u.push(/* @__PURE__ */ n(U, { label: "Minute", value: c, count: 60, disabled: s, onValueChange: (m) => l.setTime({
259
+ }) }, "hour")), e.has("minute") && m.push(/* @__PURE__ */ n(U, { label: "Minute", value: c, count: 60, disabled: s, onValueChange: (u) => l.setTime({
264
260
  hour: i,
265
- minute: m,
261
+ minute: u,
266
262
  second: o
267
- }) }, "minute")), e.has("second") && u.push(/* @__PURE__ */ n(U, { label: "Second", value: o, count: 60, disabled: s, onValueChange: (m) => l.setTime({
263
+ }) }, "minute")), e.has("second") && m.push(/* @__PURE__ */ n(U, { label: "Second", value: o, count: 60, disabled: s, onValueChange: (u) => l.setTime({
268
264
  hour: i,
269
265
  minute: c,
270
- second: m
271
- }) }, "second")), /* @__PURE__ */ n("div", { className: "date-input__time", children: u.map(Re) });
266
+ second: u
267
+ }) }, "second")), /* @__PURE__ */ n("div", { className: "date-input__time", children: m.map(Re) });
272
268
  } });
273
269
  }
274
270
  function Oe(t, e) {
@@ -1,27 +1,43 @@
1
1
  import { default as React } from 'react';
2
2
  import { ValidationProps } from './useForm';
3
3
  import { InputWrapperProps } from './InputWrapper';
4
- import { InputSuggestion } from './InputSuggestion';
4
+ import { Component } from '../../utils';
5
+ import { MenuContentProps, MenuItemProps } from '../menu/Menu';
5
6
  export interface EditorTokenRule {
6
7
  pattern: RegExp;
7
- /**
8
- * Wrap a matched token. `children` is Slate's leaf content — include it
9
- * somewhere so cursor positioning stays accurate.
10
- */
11
8
  wrap?: (matchedText: string, children: React.ReactNode, match: RegExpExecArray) => React.ReactNode;
12
9
  style?: React.CSSProperties;
13
10
  className?: string;
11
+ void?: boolean;
14
12
  }
15
- export interface EditorInputProps extends Omit<InputWrapperProps, "onChange">, ValidationProps<any> {
13
+ export interface EditorInputProps extends Omit<InputWrapperProps, "onChange" | "onSelect">, ValidationProps<any> {
14
+ wrapperComponent?: Component<HTMLDivElement>;
16
15
  tokenRules?: EditorTokenRule[];
17
- suggestions?: InputSuggestion[];
18
- suggestionsEmptyState?: React.ReactNode;
19
- onSuggestionSelect?: (suggestion: InputSuggestion) => void;
16
+ onSelect?: (value: any, data: any) => void;
17
+ search?: string;
20
18
  disabled?: boolean;
21
19
  readonly?: boolean;
22
- /** Render as a single-line input: Enter is blocked, newlines in pasted or external values become spaces. */
23
20
  singleLine?: boolean;
24
21
  onChange?: (value: string) => void;
25
22
  placeholder?: string;
23
+ children?: React.ReactNode;
24
+ }
25
+ export type EditorInputValueProps = Component<HTMLDivElement>;
26
+ export type EditorInputTriggerProps = Component<HTMLButtonElement>;
27
+ export type EditorInputMenuProps = MenuContentProps;
28
+ export type EditorInputMenuItemProps = MenuItemProps & {
29
+ value: any;
30
+ data?: any;
31
+ onlyOnce?: boolean;
32
+ aliases?: string[];
33
+ };
34
+ export interface EditorInputSubMenuProps {
35
+ label: React.ReactNode;
36
+ children: React.ReactNode;
26
37
  }
27
38
  export declare const EditorInput: React.FC<EditorInputProps>;
39
+ export declare const EditorInputValue: React.FC<EditorInputValueProps>;
40
+ export declare const EditorInputTrigger: React.FC<EditorInputTriggerProps>;
41
+ export declare const EditorInputMenu: React.FC<EditorInputMenuProps>;
42
+ export declare const EditorInputMenuItem: React.FC<EditorInputMenuItemProps>;
43
+ export declare const EditorInputSubMenu: React.FC<EditorInputSubMenuProps>;