@code0-tech/pictor 0.2.3 → 0.4.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 (232) hide show
  1. package/dist/_virtual/compiler-runtime.js +5 -0
  2. package/dist/_virtual/compiler-runtime2.js +4 -0
  3. package/dist/_virtual/react-compiler-runtime.development.js +4 -0
  4. package/dist/_virtual/react-compiler-runtime.production.js +4 -0
  5. package/dist/assets/components/alert/Alert.style.css +1 -0
  6. package/dist/assets/components/aurora/Aurora.style.css +1 -0
  7. package/dist/assets/components/avatar/Avatar.style.css +1 -0
  8. package/dist/assets/components/badge/Badge.style.css +1 -0
  9. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +1 -0
  10. package/dist/assets/components/button/Button.style.css +1 -0
  11. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -0
  12. package/dist/assets/components/card/Card.style.css +1 -0
  13. package/dist/assets/components/col/Col.style.css +1 -0
  14. package/dist/assets/components/command/Command.style.css +1 -0
  15. package/dist/assets/components/container/Container.style.css +1 -0
  16. package/dist/assets/components/context-menu/ContextMenu.style.css +1 -0
  17. package/dist/assets/components/data-table/DataTable.style.css +1 -0
  18. package/dist/assets/components/dialog/Dialog.style.css +1 -0
  19. package/dist/assets/components/editor/Editor.styles.css +1 -0
  20. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -0
  21. package/dist/assets/components/flex/Flex.style.css +1 -0
  22. package/dist/assets/components/form/Input.style.css +1 -0
  23. package/dist/assets/components/fullscreen/FullScreen.style.css +1 -0
  24. package/dist/assets/components/layout/Layout.style.css +1 -0
  25. package/dist/assets/components/menu/Menu.style.css +1 -0
  26. package/dist/assets/components/quote/Quote.style.css +1 -0
  27. package/dist/assets/components/resizable/Resizable.style.css +1 -0
  28. package/dist/assets/components/row/Row.style.css +1 -0
  29. package/dist/assets/components/scroll-area/ScrollArea.style.css +1 -0
  30. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -0
  31. package/dist/assets/components/spacing/Spacing.style.css +1 -0
  32. package/dist/assets/components/tab/Tab.style.css +1 -0
  33. package/dist/assets/components/text/Text.style.css +1 -0
  34. package/dist/assets/components/toast/Toast.style.css +1 -0
  35. package/dist/assets/components/tooltip/Tooltip.style.css +1 -0
  36. package/dist/components/alert/Alert.d.ts +7 -0
  37. package/dist/components/alert/Alert.js +39 -0
  38. package/dist/components/aurora/Aurora.d.ts +5 -0
  39. package/dist/components/aurora/Aurora.js +23 -0
  40. package/dist/components/avatar/Avatar.d.ts +10 -0
  41. package/dist/components/avatar/Avatar.js +53 -0
  42. package/dist/components/badge/Badge.d.ts +8 -0
  43. package/dist/components/badge/Badge.js +63 -0
  44. package/dist/components/breadcrumb/Breadcrumb.d.ts +7 -0
  45. package/dist/components/breadcrumb/Breadcrumb.js +19 -0
  46. package/dist/components/button/Button.d.ts +11 -0
  47. package/dist/components/button/Button.js +31 -0
  48. package/dist/components/button-group/ButtonGroup.d.ts +8 -0
  49. package/dist/components/button-group/ButtonGroup.js +28 -0
  50. package/dist/components/card/Card.d.ts +15 -0
  51. package/dist/components/card/Card.js +42 -0
  52. package/dist/components/card/CardSection.d.ts +10 -0
  53. package/dist/components/card/CardSection.js +28 -0
  54. package/dist/{esm/components → components}/col/Col.d.ts +3 -5
  55. package/dist/components/col/Col.js +27 -0
  56. package/dist/components/command/Command.d.ts +30 -0
  57. package/dist/components/command/Command.js +103 -0
  58. package/dist/components/container/Container.d.ts +6 -0
  59. package/dist/components/container/Container.js +21 -0
  60. package/dist/components/context-menu/ContextMenu.d.ts +31 -0
  61. package/dist/components/context-menu/ContextMenu.js +106 -0
  62. package/dist/components/data-table/DataTable.d.ts +23 -0
  63. package/dist/components/data-table/DataTable.js +41 -0
  64. package/dist/components/data-table/DataTableColumn.d.ts +6 -0
  65. package/dist/components/data-table/DataTableColumn.js +22 -0
  66. package/dist/components/data-table/DataTableFilterInput.d.ts +18 -0
  67. package/dist/components/data-table/DataTableFilterInput.js +212 -0
  68. package/dist/components/data-table/DataTableFilterSuggestionMenu.d.ts +7 -0
  69. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +53 -0
  70. package/dist/components/data-table/index.d.ts +4 -0
  71. package/dist/components/data-table/index.js +11 -0
  72. package/dist/components/dialog/Dialog.d.ts +29 -0
  73. package/dist/components/dialog/Dialog.js +102 -0
  74. package/dist/components/editor/Editor.d.ts +29 -0
  75. package/dist/components/editor/Editor.js +337 -0
  76. package/dist/components/file-tabs/FileTabs.d.ts +17 -0
  77. package/dist/components/file-tabs/FileTabs.js +71 -0
  78. package/dist/components/file-tabs/FileTabs.service.d.ts +17 -0
  79. package/dist/components/file-tabs/FileTabs.service.js +88 -0
  80. package/dist/components/file-tabs/FileTabs.view.d.ts +10 -0
  81. package/dist/components/file-tabs/FileTabs.view.js +1 -0
  82. package/dist/components/file-tabs/index.d.ts +3 -0
  83. package/dist/components/file-tabs/index.js +9 -0
  84. package/dist/components/flex/Flex.d.ts +7 -0
  85. package/dist/components/flex/Flex.js +21 -0
  86. package/dist/components/form/CheckboxInput.d.ts +5 -0
  87. package/dist/components/form/CheckboxInput.js +76 -0
  88. package/dist/components/form/EmailInput.d.ts +8 -0
  89. package/dist/components/form/EmailInput.js +21 -0
  90. package/dist/components/form/Input.d.ts +35 -0
  91. package/dist/components/form/Input.js +434 -0
  92. package/dist/components/form/Input.syntax.hook.d.ts +10 -0
  93. package/dist/components/form/Input.syntax.hook.js +14 -0
  94. package/dist/components/form/Input.utils.d.ts +10 -0
  95. package/dist/components/form/Input.utils.js +38 -0
  96. package/dist/components/form/InputContentEditable.hook.d.ts +52 -0
  97. package/dist/components/form/InputContentEditable.hook.js +449 -0
  98. package/dist/components/form/InputDescription.d.ts +5 -0
  99. package/dist/components/form/InputDescription.js +12 -0
  100. package/dist/components/form/InputLabel.d.ts +5 -0
  101. package/dist/components/form/InputLabel.js +12 -0
  102. package/dist/components/form/InputMessage.d.ts +5 -0
  103. package/dist/components/form/InputMessage.js +18 -0
  104. package/dist/components/form/InputSuggestion.d.ts +27 -0
  105. package/dist/components/form/InputSuggestion.js +218 -0
  106. package/dist/components/form/NumberInput.d.ts +6 -0
  107. package/dist/components/form/NumberInput.js +20 -0
  108. package/dist/components/form/PasswordInput.d.ts +8 -0
  109. package/dist/components/form/PasswordInput.js +19 -0
  110. package/dist/components/form/PinInput.d.ts +11 -0
  111. package/dist/components/form/PinInput.js +66 -0
  112. package/dist/components/form/RadioGroup.d.ts +5 -0
  113. package/dist/components/form/RadioGroup.js +48 -0
  114. package/dist/components/form/RadioInput.d.ts +7 -0
  115. package/dist/components/form/RadioInput.js +27 -0
  116. package/dist/components/form/SwitchInput.d.ts +6 -0
  117. package/dist/components/form/SwitchInput.js +19 -0
  118. package/dist/components/form/TextAreaInput.d.ts +7 -0
  119. package/dist/components/form/TextAreaInput.js +20 -0
  120. package/dist/components/form/TextInput.d.ts +7 -0
  121. package/dist/components/form/TextInput.js +20 -0
  122. package/dist/components/form/index.d.ts +17 -0
  123. package/dist/components/form/index.js +40 -0
  124. package/dist/components/form/useForm.d.ts +30 -0
  125. package/dist/components/form/useForm.js +78 -0
  126. package/dist/components/fullscreen/FullScreen.d.ts +6 -0
  127. package/dist/components/fullscreen/FullScreen.js +26 -0
  128. package/dist/components/layout/Layout.d.ts +12 -0
  129. package/dist/components/layout/Layout.js +75 -0
  130. package/dist/components/menu/Menu.d.ts +35 -0
  131. package/dist/components/menu/Menu.js +120 -0
  132. package/dist/components/quote/Quote.d.ts +10 -0
  133. package/dist/components/quote/Quote.js +44 -0
  134. package/dist/components/resizable/Resizable.d.ts +12 -0
  135. package/dist/components/resizable/Resizable.js +34 -0
  136. package/dist/components/row/Row.d.ts +6 -0
  137. package/dist/components/row/Row.js +21 -0
  138. package/dist/components/scroll-area/ScrollArea.d.ts +13 -0
  139. package/dist/components/scroll-area/ScrollArea.js +43 -0
  140. package/dist/components/segmented-control/SegmentedControl.d.ts +10 -0
  141. package/dist/components/segmented-control/SegmentedControl.js +26 -0
  142. package/dist/components/spacing/Spacing.d.ts +6 -0
  143. package/dist/components/spacing/Spacing.js +23 -0
  144. package/dist/components/tab/Tab.d.ts +11 -0
  145. package/dist/components/tab/Tab.js +40 -0
  146. package/dist/components/text/Text.d.ts +8 -0
  147. package/dist/components/text/Text.js +23 -0
  148. package/dist/components/toast/Toast.d.ts +13 -0
  149. package/dist/components/toast/Toast.js +66 -0
  150. package/dist/components/tooltip/Tooltip.d.ts +17 -0
  151. package/dist/components/tooltip/Tooltip.js +48 -0
  152. package/dist/index.d.ts +33 -300
  153. package/dist/index.js +191 -0
  154. package/dist/node_modules/@lezer/common/dist/index.js +146 -0
  155. package/dist/node_modules/@lezer/highlight/dist/index.js +543 -0
  156. package/dist/node_modules/prettier/plugins/babel.js +7157 -0
  157. package/dist/node_modules/prettier/plugins/estree.js +4453 -0
  158. package/dist/node_modules/prettier/standalone.js +2429 -0
  159. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -0
  160. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +14 -0
  161. package/dist/node_modules/react/compiler-runtime.js +10 -0
  162. package/dist/utils/arrayService.d.ts +10 -0
  163. package/dist/utils/arrayService.js +1 -0
  164. package/dist/utils/contextStore.d.ts +62 -0
  165. package/dist/utils/contextStore.js +60 -0
  166. package/dist/utils/index.d.ts +8 -0
  167. package/dist/utils/index.js +25 -0
  168. package/dist/utils/inspection.d.ts +15 -0
  169. package/dist/utils/inspection.js +29 -0
  170. package/dist/utils/nonReactiveArrayService.d.ts +19 -0
  171. package/dist/utils/nonReactiveArrayService.js +54 -0
  172. package/dist/utils/objectStore.d.ts +12 -0
  173. package/dist/utils/objectStore.js +34 -0
  174. package/dist/utils/reactiveArrayService.d.ts +23 -0
  175. package/dist/utils/reactiveArrayService.js +90 -0
  176. package/dist/{cjs/utils → utils}/types.d.ts +4 -4
  177. package/dist/utils/types.js +4 -0
  178. package/dist/utils/utils.d.ts +55 -0
  179. package/dist/utils/utils.js +159 -0
  180. package/dist/utils/view.d.ts +8 -0
  181. package/dist/utils/view.js +28 -0
  182. package/package.json +130 -54
  183. package/dist/cjs/components/Text/Text.d.ts +0 -10
  184. package/dist/cjs/components/alert/Alert.d.ts +0 -16
  185. package/dist/cjs/components/badge/Badge.d.ts +0 -9
  186. package/dist/cjs/components/button/Button.d.ts +0 -17
  187. package/dist/cjs/components/button-group/ButtonGroup.d.ts +0 -9
  188. package/dist/cjs/components/card/Card.d.ts +0 -20
  189. package/dist/cjs/components/col/Col.d.ts +0 -15
  190. package/dist/cjs/components/container/Container.d.ts +0 -8
  191. package/dist/cjs/components/dropdown/Dropdown.d.ts +0 -24
  192. package/dist/cjs/components/dropdown/DropdownFooter.d.ts +0 -13
  193. package/dist/cjs/components/dropdown/DropdownHeader.d.ts +0 -13
  194. package/dist/cjs/components/dropdown/DropdownItem.d.ts +0 -12
  195. package/dist/cjs/components/dropdown/DropdownItemGroup.d.ts +0 -12
  196. package/dist/cjs/components/input/Input.d.ts +0 -37
  197. package/dist/cjs/components/list-group/ListGroup.d.ts +0 -12
  198. package/dist/cjs/components/menu/InternalMenu.d.ts +0 -4
  199. package/dist/cjs/components/menu/Menu.d.ts +0 -41
  200. package/dist/cjs/components/popover/InternalPopover.d.ts +0 -10
  201. package/dist/cjs/components/popover/Popover.d.ts +0 -16
  202. package/dist/cjs/components/quote/Quote.d.ts +0 -12
  203. package/dist/cjs/components/row/Row.d.ts +0 -8
  204. package/dist/cjs/components/tooltip/Tooltip.d.ts +0 -18
  205. package/dist/cjs/index.d.ts +0 -16
  206. package/dist/cjs/index.js +0 -9275
  207. package/dist/cjs/utils/utils.d.ts +0 -18
  208. package/dist/esm/components/Text/Text.d.ts +0 -10
  209. package/dist/esm/components/alert/Alert.d.ts +0 -16
  210. package/dist/esm/components/badge/Badge.d.ts +0 -9
  211. package/dist/esm/components/button/Button.d.ts +0 -17
  212. package/dist/esm/components/button-group/ButtonGroup.d.ts +0 -9
  213. package/dist/esm/components/card/Card.d.ts +0 -20
  214. package/dist/esm/components/container/Container.d.ts +0 -8
  215. package/dist/esm/components/dropdown/Dropdown.d.ts +0 -24
  216. package/dist/esm/components/dropdown/DropdownFooter.d.ts +0 -13
  217. package/dist/esm/components/dropdown/DropdownHeader.d.ts +0 -13
  218. package/dist/esm/components/dropdown/DropdownItem.d.ts +0 -12
  219. package/dist/esm/components/dropdown/DropdownItemGroup.d.ts +0 -12
  220. package/dist/esm/components/input/Input.d.ts +0 -37
  221. package/dist/esm/components/list-group/ListGroup.d.ts +0 -12
  222. package/dist/esm/components/menu/InternalMenu.d.ts +0 -4
  223. package/dist/esm/components/menu/Menu.d.ts +0 -41
  224. package/dist/esm/components/popover/InternalPopover.d.ts +0 -10
  225. package/dist/esm/components/popover/Popover.d.ts +0 -16
  226. package/dist/esm/components/quote/Quote.d.ts +0 -12
  227. package/dist/esm/components/row/Row.d.ts +0 -8
  228. package/dist/esm/components/tooltip/Tooltip.d.ts +0 -18
  229. package/dist/esm/index.d.ts +0 -16
  230. package/dist/esm/index.js +0 -9251
  231. package/dist/esm/utils/types.d.ts +0 -57
  232. package/dist/esm/utils/utils.d.ts +0 -18
@@ -0,0 +1,218 @@
1
+ import { jsx as I, jsxs as B } from "react/jsx-runtime";
2
+ import { c as x } from "../../_virtual/compiler-runtime.js";
3
+ import { MenuItem as L, MenuContent as F, MenuLabel as k } from "../menu/Menu.js";
4
+ import i from "react";
5
+ import { ScrollArea as N, ScrollAreaViewport as O, ScrollAreaScrollbar as T, ScrollAreaThumb as j } from "../scroll-area/ScrollArea.js";
6
+ import { IconChevronDown as $, IconChevronUp as z } from "@tabler/icons-react";
7
+ const D = i.memo((l) => {
8
+ const e = x.c(17), {
9
+ suggestion: n,
10
+ visibleIndex: u,
11
+ isActive: p,
12
+ inputRef: d,
13
+ onSelect: v,
14
+ onActivate: c,
15
+ itemRef: f
16
+ } = l;
17
+ if (u === null)
18
+ return null;
19
+ let m;
20
+ if (e[0] !== d || e[1] !== c || e[2] !== u) {
21
+ const b = () => {
22
+ c(u), d?.current?.focus({
23
+ preventScroll: !0
24
+ });
25
+ };
26
+ m = (M) => {
27
+ M.preventDefault(), b();
28
+ }, e[0] = d, e[1] = c, e[2] = u, e[3] = m;
29
+ } else
30
+ m = e[3];
31
+ const g = m;
32
+ let a;
33
+ e[4] !== c || e[5] !== u ? (a = (b) => {
34
+ b.preventDefault(), b.stopPropagation(), c(u);
35
+ }, e[4] = c, e[5] = u, e[6] = a) : a = e[6];
36
+ const y = a;
37
+ let C;
38
+ e[7] !== v || e[8] !== n ? (C = () => setTimeout(() => v(n), 0), e[7] = v, e[8] = n, e[9] = C) : C = e[9];
39
+ let o;
40
+ return e[10] !== g || e[11] !== y || e[12] !== p || e[13] !== f || e[14] !== n.children || e[15] !== C ? (o = /* @__PURE__ */ I(L, { textValue: "", onPointerDown: g, onPointerMove: y, onSelect: C, "data-focus": p, ref: f, children: n.children }), e[10] = g, e[11] = y, e[12] = p, e[13] = f, e[14] = n.children, e[15] = C, e[16] = o) : o = e[16], o;
41
+ }, (l, e) => l.suggestion === e.suggestion && l.visibleIndex === e.visibleIndex && l.isActive === e.isActive && l.inputRef === e.inputRef && l.onSelect === e.onSelect && l.onActivate === e.onActivate && l.itemRef === e.itemRef);
42
+ D.displayName = "SuggestionMenuItem";
43
+ const P = i.forwardRef((l, e) => {
44
+ const n = x.c(12);
45
+ let u, p, d;
46
+ n[0] !== l ? ({
47
+ children: u,
48
+ inputRef: p,
49
+ ...d
50
+ } = l, n[0] = l, n[1] = u, n[2] = p, n[3] = d) : (u = n[1], p = n[2], d = n[3]);
51
+ const v = i.useRef(null);
52
+ let c, f;
53
+ n[4] !== p ? (c = (g) => {
54
+ g.preventDefault(), p?.current?.focus({
55
+ preventScroll: !0
56
+ });
57
+ }, f = () => p?.current?.focus({
58
+ preventScroll: !0
59
+ }), n[4] = p, n[5] = c, n[6] = f) : (c = n[5], f = n[6]);
60
+ let m;
61
+ return n[7] !== u || n[8] !== d || n[9] !== c || n[10] !== f ? (m = /* @__PURE__ */ I(F, { ref: v, onContextMenuCapture: H, onInteractOutside: U, onCloseAutoFocus: q, onOpenAutoFocus: c, onFocusCapture: f, align: "start", sideOffset: 8, ...d, children: u }), n[7] = u, n[8] = d, n[9] = c, n[10] = f, n[11] = m) : m = n[11], m;
62
+ });
63
+ P.displayName = "InputSuggestionMenuContent";
64
+ const Z = i.memo(P), V = i.forwardRef((l, e) => {
65
+ const {
66
+ suggestions: n,
67
+ onSuggestionSelect: u = () => {
68
+ },
69
+ inputRef: p,
70
+ ...d
71
+ } = l, v = i.useRef([]), c = i.useRef(/* @__PURE__ */ new Map()), [f, m] = i.useState({}), g = i.useRef(null), a = i.useCallback((t, r) => {
72
+ const s = g.current;
73
+ if (!(!r?.force && s === t) && (s !== null && v.current[s]?.removeAttribute("data-focus"), g.current = t, t !== null)) {
74
+ const h = v.current[t];
75
+ h && (h.setAttribute("data-focus", "true"), r?.scrollIntoView && h.scrollIntoView({
76
+ block: "nearest"
77
+ }));
78
+ }
79
+ }, []);
80
+ i.useEffect(() => {
81
+ if (!n) {
82
+ m({});
83
+ return;
84
+ }
85
+ m((t) => {
86
+ const r = {};
87
+ return n.forEach((s) => {
88
+ s.groupBy && (t.hasOwnProperty(s.groupBy) ? r[s.groupBy] = t[s.groupBy] : r[s.groupBy] = !1);
89
+ }), r;
90
+ });
91
+ }, [n]);
92
+ const {
93
+ groupLabelCount: y,
94
+ visibleSuggestionCount: C,
95
+ visibleSuggestions: o
96
+ } = i.useMemo(() => {
97
+ if (!n) return {
98
+ groupLabelCount: 0,
99
+ visibleSuggestionCount: 0,
100
+ visibleSuggestions: []
101
+ };
102
+ let t = 0, r = 0;
103
+ const s = [];
104
+ return n.forEach((h, A, R) => {
105
+ const S = A > 0 ? R[A - 1]?.groupBy : void 0;
106
+ h.groupBy && h.groupBy !== S && (t += 1), h.groupBy && f[h.groupBy] || (r += 1, s.push(h));
107
+ }), {
108
+ groupLabelCount: t,
109
+ visibleSuggestionCount: r,
110
+ visibleSuggestions: s
111
+ };
112
+ }, [f, n]);
113
+ i.useEffect(() => {
114
+ const t = g.current;
115
+ if (t !== null) {
116
+ if (t > o.length - 1) {
117
+ a(o.length ? o.length - 1 : null, {
118
+ force: !0
119
+ });
120
+ return;
121
+ }
122
+ a(t, {
123
+ force: !0
124
+ });
125
+ }
126
+ }, [a, o]), i.useImperativeHandle(e, () => ({
127
+ focusFirstItem: () => {
128
+ if (o.length)
129
+ return a(0, {
130
+ scrollIntoView: !0
131
+ }), o[0];
132
+ },
133
+ focusLastItem: () => {
134
+ if (!o.length) return;
135
+ const t = o.length - 1;
136
+ return a(t, {
137
+ scrollIntoView: !0
138
+ }), o[t];
139
+ },
140
+ highlightNextItem: () => {
141
+ if (!o.length) return;
142
+ const t = g.current, r = t === null ? 0 : Math.min(t + 1, o.length - 1);
143
+ return a(r, {
144
+ scrollIntoView: !0
145
+ }), o[r];
146
+ },
147
+ highlightPreviousItem: () => {
148
+ if (!o.length) return;
149
+ const t = g.current, r = t === null ? o.length - 1 : Math.max(t - 1, 0);
150
+ return a(r, {
151
+ scrollIntoView: !0
152
+ }), o[r];
153
+ },
154
+ selectActiveItem: () => {
155
+ const t = g.current;
156
+ if (t === null || !o[t]) return;
157
+ const r = o[t];
158
+ return setTimeout(() => u(r), 0), r;
159
+ },
160
+ clearActiveItem: () => a(null)
161
+ }), [u, a, o]);
162
+ const b = (t) => {
163
+ m((r) => ({
164
+ ...r,
165
+ [t]: !r[t]
166
+ }));
167
+ }, M = i.useCallback((t) => {
168
+ let r = c.current.get(t);
169
+ return r || (r = (s) => {
170
+ v.current[t] = s;
171
+ }, c.current.set(t, r)), r;
172
+ }, []);
173
+ let E = -1;
174
+ return /* @__PURE__ */ B(N, { h: `${Math.max(C + y, 1) * 27}px`, mah: "calc(var(--radix-popper-available-height) - 3rem - 69px)", ...d, children: [
175
+ /* @__PURE__ */ I(O, { children: n?.map((t, r, s) => {
176
+ const h = r > 0 ? s[r - 1]?.groupBy : void 0, A = t.groupBy && t.groupBy !== h, R = t.groupBy ? f[t.groupBy] : !1, S = R ? null : ++E, w = S !== null && g.current === S;
177
+ return /* @__PURE__ */ B(i.Fragment, { children: [
178
+ A && t.groupBy && /* @__PURE__ */ B(k, { onPointerDown: (G) => G.preventDefault(), onClick: () => b(t.groupBy), style: {
179
+ display: "flex",
180
+ alignItems: "center",
181
+ justifyContent: "space-between",
182
+ cursor: "pointer"
183
+ }, children: [
184
+ /* @__PURE__ */ I("span", { children: t.groupBy }),
185
+ R ? /* @__PURE__ */ I($, { size: 16 }) : /* @__PURE__ */ I(z, { size: 16 })
186
+ ] }),
187
+ !R && /* @__PURE__ */ I(
188
+ D,
189
+ {
190
+ suggestion: t,
191
+ visibleIndex: S,
192
+ isActive: w,
193
+ inputRef: p,
194
+ onSelect: u,
195
+ onActivate: a,
196
+ itemRef: S !== null ? M(S) : void 0
197
+ }
198
+ )
199
+ ] }, r);
200
+ }) }),
201
+ /* @__PURE__ */ I(T, { orientation: "vertical", children: /* @__PURE__ */ I(j, {}) })
202
+ ] });
203
+ });
204
+ V.displayName = "InputSuggestionMenuContentItems";
205
+ const _ = i.memo(V);
206
+ function H(l) {
207
+ return l.stopPropagation();
208
+ }
209
+ function U(l) {
210
+ return l.target instanceof HTMLInputElement && l.preventDefault();
211
+ }
212
+ function q(l) {
213
+ return l.preventDefault();
214
+ }
215
+ export {
216
+ Z as InputSuggestionMenuContent,
217
+ _ as InputSuggestionMenuContentItems
218
+ };
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ interface NumberInputProps extends Omit<InputProps<string | null>, "wrapperComponent" | "type" | "left" | "right" | "leftType" | "rightType"> {
4
+ }
5
+ export declare const NumberInput: React.ForwardRefExoticComponent<NumberInputProps>;
6
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { Input as i } from "./Input.js";
4
+ import { IconMinus as a, IconPlus as l } from "@tabler/icons-react";
5
+ import { Button as e } from "../button/Button.js";
6
+ const d = u.forwardRef((o, n) => {
7
+ n = n || u.useRef(null);
8
+ const {
9
+ step: r = 1,
10
+ ...c
11
+ } = o;
12
+ return /* @__PURE__ */ t(i, { className: "number-input", right: /* @__PURE__ */ t(e, { variant: "none", onClick: () => {
13
+ n.current && (n.current.value || (n.current.value = "0"), n.current.value = (Number.parseInt(n.current.value) + r).toString());
14
+ }, children: /* @__PURE__ */ t(l, { size: 13 }) }), left: /* @__PURE__ */ t(e, { variant: "none", onClick: () => {
15
+ n.current && (n.current.value || (n.current.value = "0"), n.current.value = (Number.parseInt(n.current.value) - r).toString());
16
+ }, children: /* @__PURE__ */ t(a, { size: 13 }) }), leftType: "action", type: "number", ref: n, ...c });
17
+ });
18
+ export {
19
+ d as NumberInput
20
+ };
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ interface PasswordInputProps extends Omit<InputProps<string | null>, "wrapperComponent" | "type"> {
4
+ clearable?: boolean;
5
+ visible?: boolean;
6
+ }
7
+ export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps>;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import n from "react";
3
+ import { Input as f } from "./Input.js";
4
+ import { IconEye as h, IconX as d } from "@tabler/icons-react";
5
+ import { Button as i } from "../button/Button.js";
6
+ import { clearInputElement as y } from "./Input.utils.js";
7
+ const C = n.forwardRef((p, t) => {
8
+ t = t || n.useRef(null);
9
+ const {
10
+ clearable: s = !0,
11
+ visible: a = !0,
12
+ right: c,
13
+ ...u
14
+ } = p, l = (r) => (y(t.current), r.stopPropagation(), r.preventDefault(), !1), m = (r) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), r.stopPropagation(), r.preventDefault(), !1), o = [c];
15
+ return a && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => m(r), children: /* @__PURE__ */ e(h, { size: 13 }) })), s && o.push(/* @__PURE__ */ e(i, { variant: "none", onClick: (r) => l(r), children: /* @__PURE__ */ e(d, { size: 13 }) })), /* @__PURE__ */ e(f, { right: o, rightType: "action", type: "password", ref: t, ...u });
16
+ });
17
+ export {
18
+ C as PasswordInput
19
+ };
@@ -0,0 +1,11 @@
1
+ import { OneTimePasswordFieldHiddenInputProps, OneTimePasswordFieldInputProps, OneTimePasswordFieldProps } from '@radix-ui/react-one-time-password-field';
2
+ import { Code0ComponentProps } from '../../utils/types';
3
+ import { default as React } from 'react';
4
+ import { InputProps } from './Input';
5
+ type PinInputProps = Omit<InputProps<string | null>, "wrapperComponent" | "type" | "left" | "right" | "leftType" | "rightType"> & OneTimePasswordFieldProps;
6
+ type PinInputFieldProps = Code0ComponentProps & OneTimePasswordFieldInputProps;
7
+ type PinInputHiddenFieldProps = Code0ComponentProps & OneTimePasswordFieldHiddenInputProps;
8
+ export declare const PinInput: React.FC<PinInputProps>;
9
+ export declare const PinInputField: React.FC<PinInputFieldProps>;
10
+ export declare const PinInputHiddenField: React.FC<PinInputHiddenFieldProps>;
11
+ export {};
@@ -0,0 +1,66 @@
1
+ import { jsx as d, jsxs as F, Fragment as x } from "react/jsx-runtime";
2
+ import { c as I } from "../../_virtual/compiler-runtime.js";
3
+ import { OneTimePasswordFieldInput as C, OneTimePasswordFieldHiddenInput as M, OneTimePasswordField as T } from "@radix-ui/react-one-time-password-field";
4
+ import { mergeCode0Props as V } from "../../utils/utils.js";
5
+ import { InputLabel as _ } from "./InputLabel.js";
6
+ import { InputDescription as $ } from "./InputDescription.js";
7
+ import { InputMessage as w } from "./InputMessage.js";
8
+ import '../../assets/components/form/Input.style.css';/* empty css */
9
+ const y = (l) => {
10
+ const e = I.c(26);
11
+ let t, i, r, n, o, s;
12
+ if (e[0] !== l) {
13
+ const {
14
+ title: c,
15
+ description: p,
16
+ disabled: b,
17
+ formValidation: P,
18
+ ...g
19
+ } = l;
20
+ i = P === void 0 ? {
21
+ valid: !0,
22
+ notValidMessage: null,
23
+ setValue: O
24
+ } : P, e[7] !== c ? (o = c ? /* @__PURE__ */ d(_, { children: c }) : null, e[7] = c, e[8] = o) : o = e[8], e[9] !== p ? (s = p ? /* @__PURE__ */ d($, { children: p }) : null, e[9] = p, e[10] = s) : s = e[10];
25
+ const h = `${i?.valid ? "" : "input--not-valid"}`;
26
+ e[11] !== h ? (n = V(h, {}), e[11] = h, e[12] = n) : n = e[12], t = T, r = V("pin-input", {
27
+ ...g,
28
+ onValueChange: (v) => {
29
+ g.onValueChange && g.onValueChange(v), i.setValue(v);
30
+ }
31
+ }), e[0] = l, e[1] = t, e[2] = i, e[3] = r, e[4] = n, e[5] = o, e[6] = s;
32
+ } else
33
+ t = e[1], i = e[2], r = e[3], n = e[4], o = e[5], s = e[6];
34
+ let a;
35
+ e[13] !== t || e[14] !== r ? (a = /* @__PURE__ */ d(t, { ...r }), e[13] = t, e[14] = r, e[15] = a) : a = e[15];
36
+ let u;
37
+ e[16] !== n || e[17] !== a ? (u = /* @__PURE__ */ d("div", { ...n, children: a }), e[16] = n, e[17] = a, e[18] = u) : u = e[18];
38
+ let f;
39
+ e[19] !== i ? (f = !i?.valid && i?.notValidMessage ? /* @__PURE__ */ d(w, { children: i.notValidMessage }) : null, e[19] = i, e[20] = f) : f = e[20];
40
+ let m;
41
+ return e[21] !== o || e[22] !== s || e[23] !== u || e[24] !== f ? (m = /* @__PURE__ */ F(x, { children: [
42
+ o,
43
+ s,
44
+ u,
45
+ f
46
+ ] }), e[21] = o, e[22] = s, e[23] = u, e[24] = f, e[25] = m) : m = e[25], m;
47
+ }, z = (l) => {
48
+ const e = I.c(4);
49
+ let t;
50
+ e[0] !== l ? (t = V("input pin-input__field", l), e[0] = l, e[1] = t) : t = e[1];
51
+ let i;
52
+ return e[2] !== t ? (i = /* @__PURE__ */ d(C, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
53
+ }, A = (l) => {
54
+ const e = I.c(4);
55
+ let t;
56
+ e[0] !== l ? (t = V("pin-input__hidden-field", l), e[0] = l, e[1] = t) : t = e[1];
57
+ let i;
58
+ return e[2] !== t ? (i = /* @__PURE__ */ d(M, { ...t }), e[2] = t, e[3] = i) : i = e[3], i;
59
+ };
60
+ function O(l) {
61
+ }
62
+ export {
63
+ y as PinInput,
64
+ z as PinInputField,
65
+ A as PinInputHiddenField
66
+ };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
4
+ export type RadioGroupProps = Omit<InputProps<string | null>, "wrapperComponent" | "type" | "left" | "right" | "leftType" | "rightType"> & RadixRadioGroup.RadioGroupProps;
5
+ export declare const RadioGroup: React.FC<RadioGroupProps>;
@@ -0,0 +1,48 @@
1
+ import { jsx as p, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
+ import { c as C } from "../../_virtual/compiler-runtime.js";
3
+ import * as M from "@radix-ui/react-radio-group";
4
+ import { mergeCode0Props as v } from "../../utils/utils.js";
5
+ import { InputLabel as G } from "./InputLabel.js";
6
+ import { InputDescription as I } from "./InputDescription.js";
7
+ import { InputMessage as j } from "./InputMessage.js";
8
+ import '../../assets/components/form/Input.style.css';/* empty css */
9
+ const k = (u) => {
10
+ const e = C.c(22);
11
+ let o, t, a, r, l, i;
12
+ if (e[0] !== u) {
13
+ const {
14
+ title: d,
15
+ description: f,
16
+ initialValue: h,
17
+ formValidation: V,
18
+ ...c
19
+ } = u;
20
+ t = V === void 0 ? {
21
+ valid: !0,
22
+ notValidMessage: null,
23
+ setValue: b
24
+ } : V, e[7] !== d ? (l = d ? /* @__PURE__ */ p(G, { children: d }) : null, e[7] = d, e[8] = l) : l = e[8], e[9] !== f ? (i = f ? /* @__PURE__ */ p(I, { children: f }) : null, e[9] = f, e[10] = i) : i = e[10], o = M.RadioGroup, a = h ?? u.defaultValue, r = v("radio-group", {
25
+ ...c,
26
+ onValueChange: (g) => {
27
+ c.onValueChange && c.onValueChange(g), t.setValue(g);
28
+ }
29
+ }), e[0] = u, e[1] = o, e[2] = t, e[3] = a, e[4] = r, e[5] = l, e[6] = i;
30
+ } else
31
+ o = e[1], t = e[2], a = e[3], r = e[4], l = e[5], i = e[6];
32
+ let n;
33
+ e[11] !== o || e[12] !== a || e[13] !== r ? (n = /* @__PURE__ */ p(o, { defaultValue: a, ...r }), e[11] = o, e[12] = a, e[13] = r, e[14] = n) : n = e[14];
34
+ let s;
35
+ e[15] !== t ? (s = !t?.valid && t?.notValidMessage ? /* @__PURE__ */ p(j, { children: t.notValidMessage }) : null, e[15] = t, e[16] = s) : s = e[16];
36
+ let m;
37
+ return e[17] !== l || e[18] !== i || e[19] !== n || e[20] !== s ? (m = /* @__PURE__ */ x(R, { children: [
38
+ l,
39
+ i,
40
+ n,
41
+ s
42
+ ] }), e[17] = l, e[18] = i, e[19] = n, e[20] = s, e[21] = m) : m = e[21], m;
43
+ };
44
+ function b(u) {
45
+ }
46
+ export {
47
+ k as RadioGroup
48
+ };
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { Code0ComponentProps } from '../../utils/types';
3
+ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
4
+ export type RadioInputProps = Code0ComponentProps & RadixRadioGroup.RadioGroupItemProps & {
5
+ label: React.ReactNode;
6
+ };
7
+ export declare const RadioInput: React.FC<RadioInputProps>;
@@ -0,0 +1,27 @@
1
+ import { jsx as c, jsxs as u } from "react/jsx-runtime";
2
+ import { c as f } from "../../_virtual/compiler-runtime.js";
3
+ import * as s from "@radix-ui/react-radio-group";
4
+ import { mergeCode0Props as d } from "../../utils/utils.js";
5
+ import '../../assets/components/form/Input.style.css';/* empty css */
6
+ const R = (t) => {
7
+ const e = f.c(11);
8
+ let l;
9
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = d("input radio-input", {}), e[0] = l) : l = e[0];
10
+ let r;
11
+ e[1] !== t ? (r = d("radio-input__button", t), e[1] = t, e[2] = r) : r = e[2];
12
+ const m = r;
13
+ let a;
14
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ c(s.RadioGroupIndicator, { className: "radio-input__indicator" }), e[3] = a) : a = e[3];
15
+ let i;
16
+ e[4] !== m ? (i = /* @__PURE__ */ c(s.RadioGroupItem, { ...m, children: a }), e[4] = m, e[5] = i) : i = e[5];
17
+ let o;
18
+ e[6] !== t.label ? (o = /* @__PURE__ */ c("div", { className: "input__right input__right--action}", children: t.label }), e[6] = t.label, e[7] = o) : o = e[7];
19
+ let n;
20
+ return e[8] !== i || e[9] !== o ? (n = /* @__PURE__ */ u("div", { ...l, children: [
21
+ i,
22
+ o
23
+ ] }), e[8] = i, e[9] = o, e[10] = n) : n = e[10], n;
24
+ };
25
+ export {
26
+ R as RadioInput
27
+ };
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ interface SwitchInputProps extends Omit<InputProps<boolean | null>, "wrapperComponent" | "type" | "left" | "leftType"> {
4
+ }
5
+ export declare const SwitchInput: React.ForwardRefExoticComponent<SwitchInputProps>;
6
+ export {};
@@ -0,0 +1,19 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import e from "react";
3
+ import { Input as p } from "./Input.js";
4
+ const m = e.forwardRef((r, t) => {
5
+ t = t || e.useRef(null);
6
+ const {
7
+ value: o,
8
+ initialValue: l,
9
+ ...n
10
+ } = r;
11
+ return /* @__PURE__ */ u(p, { wrapperComponent: {
12
+ className: "switch-input"
13
+ }, type: "checkbox", right: null, left: null, ref: t, value: o, ...l ? {
14
+ defaultChecked: !0
15
+ } : {}, ...n });
16
+ });
17
+ export {
18
+ m as SwitchInput
19
+ };
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ export interface TextAreaInputProps extends Omit<InputProps<string | null>, "wrapperComponent" | "type"> {
4
+ clearable?: boolean;
5
+ onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
6
+ }
7
+ export declare const TextAreaInput: React.ForwardRefExoticComponent<TextAreaInputProps>;
@@ -0,0 +1,20 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { Input as u } from "./Input.js";
4
+ import { IconX as f } from "@tabler/icons-react";
5
+ import { Button as p } from "../button/Button.js";
6
+ import { clearInputElement as s } from "./Input.utils.js";
7
+ const b = a.forwardRef((r, t) => {
8
+ t = t || a.useRef(null);
9
+ const {
10
+ clearable: i = !1,
11
+ right: l,
12
+ ...m
13
+ } = r, c = (o) => {
14
+ s(t.current), r.onClear && r.onClear(o);
15
+ }, n = [l];
16
+ return i && n.push(/* @__PURE__ */ e(p, { variant: "none", onClick: (o) => c(o), children: /* @__PURE__ */ e(f, { size: 13 }) })), /* @__PURE__ */ e(u, { right: n, type: "textarea", ref: t, ...m });
17
+ });
18
+ export {
19
+ b as TextAreaInput
20
+ };
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { InputProps } from './Input';
3
+ export interface TextInputProps extends Omit<InputProps<string | null>, "wrapperComponent" | "type"> {
4
+ clearable?: boolean;
5
+ onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
6
+ }
7
+ export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps>;
@@ -0,0 +1,20 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import i from "react";
3
+ import { Input as u } from "./Input.js";
4
+ import { IconX as f } from "@tabler/icons-react";
5
+ import { Button as p } from "../button/Button.js";
6
+ import { clearInputElement as s } from "./Input.utils.js";
7
+ const b = i.forwardRef((r, t) => {
8
+ t = t || i.useRef(null);
9
+ const {
10
+ clearable: l = !1,
11
+ right: m,
12
+ ...a
13
+ } = r, c = (o) => {
14
+ s(t.current), r.onClear && r.onClear(o);
15
+ }, n = [m];
16
+ return l && n.push(/* @__PURE__ */ e(p, { variant: "none", onClick: (o) => c(o), children: /* @__PURE__ */ e(f, { size: 13 }) })), /* @__PURE__ */ e(u, { right: n, type: "text", ref: t, ...a });
17
+ });
18
+ export {
19
+ b as TextInput
20
+ };
@@ -0,0 +1,17 @@
1
+ export * from './CheckboxInput';
2
+ export * from './EmailInput';
3
+ export * from './Input';
4
+ export * from './InputDescription';
5
+ export * from './InputLabel';
6
+ export * from './InputMessage';
7
+ export * from './InputSuggestion';
8
+ export * from './NumberInput';
9
+ export * from './PasswordInput';
10
+ export * from './PinInput';
11
+ export * from './RadioGroup';
12
+ export * from './RadioInput';
13
+ export * from './SwitchInput';
14
+ export * from './TextAreaInput';
15
+ export * from './TextInput';
16
+ export * from './useForm';
17
+ export * from './Input.syntax.hook';
@@ -0,0 +1,40 @@
1
+ import { CheckboxInput as r } from "./CheckboxInput.js";
2
+ import { EmailInput as p, emailValidation as n } from "./EmailInput.js";
3
+ import { Input as m } from "./Input.js";
4
+ import { InputDescription as f } from "./InputDescription.js";
5
+ import { InputLabel as I } from "./InputLabel.js";
6
+ import { InputMessage as d } from "./InputMessage.js";
7
+ import { InputSuggestionMenuContent as l, InputSuggestionMenuContentItems as g } from "./InputSuggestion.js";
8
+ import { NumberInput as P } from "./NumberInput.js";
9
+ import { PasswordInput as c } from "./PasswordInput.js";
10
+ import { PinInput as F, PinInputField as M, PinInputHiddenField as h } from "./PinInput.js";
11
+ import { RadioGroup as D } from "./RadioGroup.js";
12
+ import { RadioInput as T } from "./RadioInput.js";
13
+ import { SwitchInput as y } from "./SwitchInput.js";
14
+ import { TextAreaInput as E } from "./TextAreaInput.js";
15
+ import { TextInput as H } from "./TextInput.js";
16
+ import { useForm as N } from "./useForm.js";
17
+ import { buildDefaultSyntax as j } from "./Input.syntax.hook.js";
18
+ export {
19
+ r as CheckboxInput,
20
+ p as EmailInput,
21
+ m as Input,
22
+ f as InputDescription,
23
+ I as InputLabel,
24
+ d as InputMessage,
25
+ l as InputSuggestionMenuContent,
26
+ g as InputSuggestionMenuContentItems,
27
+ P as NumberInput,
28
+ c as PasswordInput,
29
+ F as PinInput,
30
+ M as PinInputField,
31
+ h as PinInputHiddenField,
32
+ D as RadioGroup,
33
+ T as RadioInput,
34
+ y as SwitchInput,
35
+ E as TextAreaInput,
36
+ H as TextInput,
37
+ j as buildDefaultSyntax,
38
+ n as emailValidation,
39
+ N as useForm
40
+ };
@@ -0,0 +1,30 @@
1
+ export type Validations<Values> = Partial<{
2
+ [Key in keyof Values]: (value: Values[Key], values?: Values) => string | null;
3
+ }>;
4
+ export interface FormValidationProps<Values> {
5
+ initialValues: Values;
6
+ validate?: Validations<Values>;
7
+ truthyValidationBeforeSubmit?: boolean;
8
+ useInitialValidation?: boolean;
9
+ onSubmit?: (values: Values) => void;
10
+ }
11
+ export interface ValidationProps<Value> {
12
+ initialValue?: Value | undefined;
13
+ defaultValue?: Value | undefined;
14
+ value?: Value | undefined;
15
+ required?: boolean;
16
+ formValidation?: {
17
+ setValue: (value: any) => void;
18
+ valid?: boolean;
19
+ notValidMessage?: string | null;
20
+ };
21
+ }
22
+ export type ValidationsProps<Values> = Partial<{
23
+ [Key in keyof Values]: ValidationProps<Values[Key]>;
24
+ }>;
25
+ export type FormValidationReturn<Values> = [IValidation<Values>, () => void];
26
+ export interface IValidation<Values> {
27
+ getInputProps<Key extends keyof Values>(key: Key): ValidationProps<Values[Key]>;
28
+ isValid(): boolean;
29
+ }
30
+ export declare const useForm: <Values extends Record<string, any> = Record<string, any>>(props: FormValidationProps<Values>) => FormValidationReturn<Values>;