@code0-tech/pictor 0.0.0-mvp.22 → 0.0.0-mvp.24

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 (100) hide show
  1. package/dist/assets/components/aurora/Aurora.style.css +1 -0
  2. package/dist/assets/components/badge/Badge.style.css +1 -1
  3. package/dist/assets/components/button/Button.style.css +1 -1
  4. package/dist/assets/components/button-group/ButtonGroup.style.css +1 -1
  5. package/dist/assets/components/card/Card.style.css +1 -1
  6. package/dist/assets/components/command/Command.style.css +1 -1
  7. package/dist/assets/components/d-flow/folder/DFlowFolder.style.css +1 -1
  8. package/dist/assets/components/d-flow/function/DFlowFunctionDefaultCard.style.css +1 -1
  9. package/dist/assets/components/dialog/Dialog.style.css +1 -1
  10. package/dist/assets/components/file-tabs/FileTabs.style.css +1 -1
  11. package/dist/assets/components/form/Input.style.css +1 -1
  12. package/dist/assets/components/menu/Menu.style.css +1 -1
  13. package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
  14. package/dist/assets/components/tab/Tab.style.css +1 -1
  15. package/dist/assets/components/text/Text.style.css +1 -1
  16. package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
  17. package/dist/components/aurora/Aurora.d.ts +5 -0
  18. package/dist/components/aurora/Aurora.js +23 -0
  19. package/dist/components/badge/Badge.d.ts +1 -0
  20. package/dist/components/badge/Badge.js +12 -11
  21. package/dist/components/button/Button.d.ts +1 -1
  22. package/dist/components/d-flow/DFlow.view.d.ts +6 -2
  23. package/dist/components/d-flow/DFlow.view.js +52 -17
  24. package/dist/components/d-flow/control/DFlowControl.js +38 -38
  25. package/dist/components/d-flow/data-type/DFlowDataType.service.js +1 -1
  26. package/dist/components/d-flow/export/DFlowExport.d.ts +6 -0
  27. package/dist/components/d-flow/export/DFlowExport.js +24 -0
  28. package/dist/components/d-flow/input/DFlowInputDataType.js +32 -32
  29. package/dist/components/d-flow/suggestion/DFlowSuggestion.hook.js +1 -1
  30. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.js +22 -22
  31. package/dist/components/d-flow/suggestion/DFlowSuggestionMenu.util.js +11 -11
  32. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.d.ts +1 -1
  33. package/dist/components/d-flow/suggestion/DFlowSuggestionSearchInput.js +29 -16
  34. package/dist/components/d-flow/tab/DFlowTabDefault.js +59 -53
  35. package/dist/components/d-flow/type/DFlowType.view.d.ts +1 -1
  36. package/dist/components/d-member/DNamespaceMember.view.js +13 -11
  37. package/dist/components/d-member/DNamespaceMemberCard.d.ts +10 -0
  38. package/dist/components/d-member/DNamespaceMemberCard.js +16 -0
  39. package/dist/components/d-member/DNamespaceMemberContent.d.ts +10 -0
  40. package/dist/components/d-member/DNamespaceMemberContent.js +176 -0
  41. package/dist/components/d-member/DNamespaceMemberList.d.ts +12 -0
  42. package/dist/components/d-member/DNamespaceMemberList.js +23 -0
  43. package/dist/components/d-member/index.d.ts +2 -0
  44. package/dist/components/d-member/index.js +6 -2
  45. package/dist/components/d-organization/DOrganizatonContent.js +29 -14
  46. package/dist/components/d-organization/index.js +22 -7
  47. package/dist/components/d-project/DNamespaceProjectContent.js +36 -42
  48. package/dist/components/d-role/DNamespaceRole.view.d.ts +4 -1
  49. package/dist/components/d-role/DNamespaceRole.view.js +6 -3
  50. package/dist/components/d-role/DNamespaceRoleCard.d.ts +11 -0
  51. package/dist/components/d-role/DNamespaceRoleCard.js +17 -0
  52. package/dist/components/d-role/DNamespaceRoleContent.d.ts +10 -0
  53. package/dist/components/d-role/DNamespaceRoleContent.js +156 -0
  54. package/dist/components/d-role/DNamespaceRoleList.d.ts +12 -0
  55. package/dist/components/d-role/DNamespaceRoleList.js +24 -0
  56. package/dist/components/d-role/DNamespaceRolePermissions.d.ts +5 -0
  57. package/dist/components/d-role/DNamespaceRolePermissions.js +129 -0
  58. package/dist/components/d-role/index.d.ts +2 -0
  59. package/dist/components/d-role/index.js +6 -2
  60. package/dist/components/d-runtime/DRuntimeCard.d.ts +1 -0
  61. package/dist/components/d-runtime/DRuntimeCard.js +13 -12
  62. package/dist/components/d-runtime/DRuntimeContent.d.ts +1 -0
  63. package/dist/components/d-runtime/DRuntimeContent.js +25 -20
  64. package/dist/components/d-runtime/DRuntimeList.d.ts +2 -1
  65. package/dist/components/d-runtime/DRuntimeList.js +17 -14
  66. package/dist/components/d-user/DUser.service.d.ts +1 -0
  67. package/dist/components/d-user/DUser.service.js +5 -2
  68. package/dist/components/d-user/DUserContent.js +25 -25
  69. package/dist/components/d-user/DUserInput.d.ts +7 -0
  70. package/dist/components/d-user/DUserInput.js +98 -0
  71. package/dist/components/d-user/DUserMenu.js +7 -6
  72. package/dist/components/d-user/index.d.ts +1 -0
  73. package/dist/components/d-user/index.js +11 -9
  74. package/dist/components/dialog/Dialog.d.ts +2 -1
  75. package/dist/components/dialog/Dialog.js +67 -59
  76. package/dist/components/form/EmailInput.js +12 -11
  77. package/dist/components/form/Input.d.ts +17 -5
  78. package/dist/components/form/Input.js +420 -137
  79. package/dist/components/form/Input.selection.hook.d.ts +17 -0
  80. package/dist/components/form/Input.selection.hook.js +78 -0
  81. package/dist/components/form/Input.syntax.hook.d.ts +27 -0
  82. package/dist/components/form/Input.syntax.hook.js +80 -0
  83. package/dist/components/form/Input.utils.d.ts +11 -0
  84. package/dist/components/form/Input.utils.js +33 -0
  85. package/dist/components/form/InputSuggestion.d.ts +14 -6
  86. package/dist/components/form/InputSuggestion.js +126 -72
  87. package/dist/components/form/InputSyntax.d.ts +19 -0
  88. package/dist/components/form/InputSyntax.js +52 -0
  89. package/dist/components/form/PasswordInput.js +11 -10
  90. package/dist/components/form/TextInput.js +11 -10
  91. package/dist/components/form/index.js +26 -27
  92. package/dist/components/form/inputSyntaxMapping.d.ts +3 -0
  93. package/dist/components/form/inputSyntaxMapping.js +42 -0
  94. package/dist/components/menu/Menu.d.ts +7 -3
  95. package/dist/components/menu/Menu.js +22 -22
  96. package/dist/components/tooltip/Tooltip.js +33 -33
  97. package/dist/index.d.ts +1 -0
  98. package/dist/index.js +250 -239
  99. package/dist/utils/generics.js +1 -1
  100. package/package.json +17 -17
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ import { TextInputProps } from '../form';
3
+ import { DUserView } from './DUser.view';
4
+ export interface DUserInputProps extends TextInputProps {
5
+ filter?: (user: DUserView, index: number) => boolean;
6
+ }
7
+ export declare const DUserInput: React.FC<DUserInputProps>;
@@ -0,0 +1,98 @@
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import x from "react";
3
+ import "../../_virtual/compiler-runtime.js";
4
+ import "@radix-ui/react-checkbox";
5
+ import "merge-props";
6
+ import { IconArrowUp as S, IconArrowDown as b, IconCornerDownLeft as I } from "@tabler/icons-react";
7
+ import '../../assets/components/form/Input.style.css';/* empty css */
8
+ import "../form/EmailInput.js";
9
+ import "../form/Input.js";
10
+ import "../form/InputSuggestion.js";
11
+ import "../form/NumberInput.js";
12
+ import "../form/PasswordInput.js";
13
+ import "@radix-ui/react-one-time-password-field";
14
+ import "@radix-ui/react-radio-group";
15
+ import "../form/SwitchInput.js";
16
+ import { TextInput as L } from "../form/TextInput.js";
17
+ import { Badge as m } from "../badge/Badge.js";
18
+ import { Text as l } from "../text/Text.js";
19
+ import { useService as U, useStore as D } from "../../utils/contextStore.js";
20
+ import { DUserReactiveService as g } from "./DUser.service.js";
21
+ import { MenuLabel as w, MenuItem as z } from "../menu/Menu.js";
22
+ import { Flex as s } from "../flex/Flex.js";
23
+ import { Spacing as B } from "../spacing/Spacing.js";
24
+ const P = (p) => {
25
+ const {
26
+ filter: h = () => !0,
27
+ ...d
28
+ } = p, u = U(g), f = D(g), y = x.useMemo(() => u.values().filter(h).map((r) => ({
29
+ value: r.username || "",
30
+ children: /* @__PURE__ */ o(s, { align: "end", style: {
31
+ gap: "0.35rem"
32
+ }, children: [
33
+ /* @__PURE__ */ e(l, { children: r.username }),
34
+ /* @__PURE__ */ e(l, { size: "xs", hierarchy: "tertiary", children: r.email })
35
+ ] }),
36
+ insertMode: "insert",
37
+ valueData: r,
38
+ groupBy: "Users"
39
+ })), [f]);
40
+ return /* @__PURE__ */ e(L, { placeholder: "Enter users", suggestionsEmptyState: /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(l, { children: "No user found" }) }), onLastTokenChange: (r) => {
41
+ u.getByUsername(r);
42
+ }, suggestionsFooter: /* @__PURE__ */ e(w, { children: /* @__PURE__ */ o(s, { style: {
43
+ gap: ".35rem"
44
+ }, children: [
45
+ /* @__PURE__ */ o(s, { align: "center", style: {
46
+ gap: "0.35rem"
47
+ }, children: [
48
+ /* @__PURE__ */ o(s, { children: [
49
+ /* @__PURE__ */ e(m, { border: !0, children: /* @__PURE__ */ e(S, { size: 12 }) }),
50
+ /* @__PURE__ */ e(m, { border: !0, children: /* @__PURE__ */ e(b, { size: 12 }) })
51
+ ] }),
52
+ "move"
53
+ ] }),
54
+ /* @__PURE__ */ e(B, { spacing: "xxs" }),
55
+ /* @__PURE__ */ o(s, { align: "center", style: {
56
+ gap: ".35rem"
57
+ }, children: [
58
+ /* @__PURE__ */ e(m, { border: !0, children: /* @__PURE__ */ e(I, { size: 12 }) }),
59
+ "insert"
60
+ ] })
61
+ ] }) }), filterSuggestionsByLastToken: !0, enforceUniqueSuggestions: !0, transformSyntax: (r, a = []) => {
62
+ let t = 0;
63
+ return a.map((i, v) => {
64
+ if (typeof i == "object") {
65
+ const c = {
66
+ type: "block",
67
+ start: t,
68
+ end: t + i.value.length,
69
+ visualLength: 1,
70
+ content: /* @__PURE__ */ e(m, { color: "info", border: !0, children: /* @__PURE__ */ o(l, { style: {
71
+ color: "inherit"
72
+ }, children: [
73
+ "@",
74
+ i.value
75
+ ] }) })
76
+ };
77
+ return t += i.value.length, c;
78
+ }
79
+ const n = i ?? "";
80
+ if (n.length) {
81
+ if (v == a.length - 1) {
82
+ const c = {
83
+ type: "text",
84
+ start: t,
85
+ end: t + n.length,
86
+ visualLength: n.length,
87
+ content: n
88
+ };
89
+ return t += n.length, c;
90
+ }
91
+ return t += n.length, {};
92
+ }
93
+ });
94
+ }, ...d, suggestions: y });
95
+ };
96
+ export {
97
+ P as DUserInput
98
+ };
@@ -2,17 +2,18 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import o from "react";
3
3
  import { Menu as l, MenuTrigger as u, MenuPortal as d, MenuContent as h } from "../menu/Menu.js";
4
4
  import { DUserReactiveService as s } from "./DUser.service.js";
5
- import { useService as f, useStore as x } from "../../utils/contextStore.js";
6
- import { Avatar as y } from "../avatar/Avatar.js";
5
+ import { useService as f, useStore as p } from "../../utils/contextStore.js";
6
+ import "merge-props";
7
+ import { Avatar as x } from "../avatar/Avatar.js";
7
8
  import { Text as c } from "../text/Text.js";
8
9
  import { Flex as m } from "../flex/Flex.js";
9
- const z = (t) => {
10
- const n = f(s), a = x(s), r = o.useMemo(() => n.getById(t.userId), [a, n]);
10
+ const C = (t) => {
11
+ const n = f(s), a = p(s), r = o.useMemo(() => n.getById(t.userId), [a, n]);
11
12
  return o.useMemo(() => /* @__PURE__ */ i(l, { ...t, children: [
12
13
  /* @__PURE__ */ e(u, { asChild: !0, children: /* @__PURE__ */ i(m, { align: "center", style: {
13
14
  gap: ".5rem"
14
15
  }, children: [
15
- /* @__PURE__ */ e(y, { src: r?.avatarPath ?? "", identifier: r?.username ?? "" }),
16
+ /* @__PURE__ */ e(x, { src: r?.avatarPath ?? "", identifier: r?.username ?? "" }),
16
17
  /* @__PURE__ */ i(m, { style: {
17
18
  flexDirection: "column"
18
19
  }, children: [
@@ -24,5 +25,5 @@ const z = (t) => {
24
25
  ] }), [r]);
25
26
  };
26
27
  export {
27
- z as default
28
+ C as default
28
29
  };
@@ -3,4 +3,5 @@ export * from './DUser.view';
3
3
  export * from './DUserMenu';
4
4
  export * from './DUserCard';
5
5
  export * from './DUserList';
6
+ export * from './DUserInput';
6
7
  export * from './DUser.session.hook';
@@ -1,5 +1,5 @@
1
- import { DUserReactiveService as a } from "./DUser.service.js";
2
- import { DUserView as n } from "./DUser.view.js";
1
+ import { DUserReactiveService as S } from "./DUser.service.js";
2
+ import { DUserView as c } from "./DUser.view.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "../../_virtual/compiler-runtime.js";
@@ -11,14 +11,16 @@ import "js-md5";
11
11
  /* empty css */
12
12
  /* empty css */
13
13
  /* empty css */
14
- import { DUserCard as d } from "./DUserCard.js";
14
+ import { DUserCard as v } from "./DUserCard.js";
15
15
  import { DUserList as w } from "./DUserList.js";
16
- import { setUserSession as L, useUserSession as R } from "./DUser.session.hook.js";
16
+ import { DUserInput as I } from "./DUserInput.js";
17
+ import { setUserSession as R, useUserSession as V } from "./DUser.session.hook.js";
17
18
  export {
18
- d as DUserCard,
19
+ v as DUserCard,
20
+ I as DUserInput,
19
21
  w as DUserList,
20
- a as DUserReactiveService,
21
- n as DUserView,
22
- L as setUserSession,
23
- R as useUserSession
22
+ S as DUserReactiveService,
23
+ c as DUserView,
24
+ R as setUserSession,
25
+ V as useUserSession
24
26
  };
@@ -1,4 +1,4 @@
1
- import { Code0Component, Code0ComponentProps } from '../../utils/types';
1
+ import { Code0Component, Code0ComponentProps } from '../../utils';
2
2
  import { default as React } from 'react';
3
3
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
4
  export type DialogProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Root>;
@@ -12,6 +12,7 @@ export type DialogHeaderProps = Code0ComponentProps & React.ComponentProps<"div"
12
12
  export type DialogFooterProps = Code0ComponentProps & React.ComponentProps<"div">;
13
13
  export type DialogContentProps = Code0ComponentProps & React.ComponentProps<typeof DialogPrimitive.Content> & {
14
14
  showCloseButton?: boolean;
15
+ title?: string;
15
16
  };
16
17
  export type DialogStickyContentProps = Code0Component<HTMLDivElement> & {
17
18
  children: React.ReactNode | React.ReactNode[];
@@ -1,99 +1,107 @@
1
1
  import { jsx as n, jsxs as g } from "react/jsx-runtime";
2
2
  import { c } from "../../_virtual/compiler-runtime.js";
3
- import * as r from "@radix-ui/react-dialog";
4
- import { mergeCode0Props as s } from "../../utils/utils.js";
5
- import { IconX as d } from "@tabler/icons-react";
3
+ import * as s from "@radix-ui/react-dialog";
4
+ import "../../utils/contextStore.js";
5
+ import "react";
6
+ import { mergeCode0Props as r } from "../../utils/utils.js";
7
+ import { IconX as m } from "@tabler/icons-react";
6
8
  import '../../assets/components/dialog/Dialog.style.css';/* empty css */
7
- const v = (i) => {
9
+ import { Button as d } from "../button/Button.js";
10
+ import { Flex as _ } from "../flex/Flex.js";
11
+ import { Text as h } from "../text/Text.js";
12
+ const b = (l) => {
8
13
  const t = c.c(4);
9
14
  let e;
10
- t[0] !== i ? (e = s("dialog", i), t[0] = i, t[1] = e) : e = t[1];
15
+ t[0] !== l ? (e = r("dialog", l), t[0] = l, t[1] = e) : e = t[1];
11
16
  const o = e;
12
- let l;
13
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Root, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
14
- }, P = (i) => {
17
+ let i;
18
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Root, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
19
+ }, z = (l) => {
15
20
  const t = c.c(4);
16
21
  let e;
17
- t[0] !== i ? (e = s("dialog__trigger", i), t[0] = i, t[1] = e) : e = t[1];
22
+ t[0] !== l ? (e = r("dialog__trigger", l), t[0] = l, t[1] = e) : e = t[1];
18
23
  const o = e;
19
- let l;
20
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Trigger, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
21
- }, x = (i) => {
24
+ let i;
25
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Trigger, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
26
+ }, F = (l) => {
22
27
  const t = c.c(4);
23
28
  let e;
24
- t[0] !== i ? (e = s("dialog__portal", i), t[0] = i, t[1] = e) : e = t[1];
29
+ t[0] !== l ? (e = r("dialog__portal", l), t[0] = l, t[1] = e) : e = t[1];
25
30
  const o = e;
26
- let l;
27
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Portal, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
28
- }, _ = (i) => {
31
+ let i;
32
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Portal, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
33
+ }, u = (l) => {
29
34
  const t = c.c(4);
30
35
  let e;
31
- t[0] !== i ? (e = s("dialog__close", i), t[0] = i, t[1] = e) : e = t[1];
36
+ t[0] !== l ? (e = r("dialog__close", l), t[0] = l, t[1] = e) : e = t[1];
32
37
  const o = e;
33
- let l;
34
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Close, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
35
- }, m = (i) => {
38
+ let i;
39
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Close, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
40
+ }, D = (l) => {
36
41
  const t = c.c(4);
37
42
  let e;
38
- t[0] !== i ? (e = s("dialog__overlay", i), t[0] = i, t[1] = e) : e = t[1];
43
+ t[0] !== l ? (e = r("dialog__overlay", l), t[0] = l, t[1] = e) : e = t[1];
39
44
  const o = e;
40
- let l;
41
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Overlay, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
42
- }, y = (i) => {
43
- const t = c.c(9);
45
+ let i;
46
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Overlay, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
47
+ }, O = (l) => {
48
+ const t = c.c(10);
44
49
  let e;
45
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(m, {}), t[0] = e) : e = t[0];
50
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(D, {}), t[0] = e) : e = t[0];
46
51
  let o;
47
- t[1] !== i ? (o = s("dialog__content", i), t[1] = i, t[2] = o) : o = t[2];
48
- const l = o;
52
+ t[1] !== l ? (o = r("dialog__content", l), t[1] = l, t[2] = o) : o = t[2];
53
+ const i = o;
49
54
  let a;
50
- t[3] !== i.showCloseButton ? (a = i.showCloseButton && /* @__PURE__ */ n(_, { children: /* @__PURE__ */ n(d, { size: 16 }) }), t[3] = i.showCloseButton, t[4] = a) : a = t[4];
55
+ t[3] !== l.showCloseButton || t[4] !== l.title ? (a = l.showCloseButton && /* @__PURE__ */ g(_, { align: "center", justify: "space-between", children: [
56
+ /* @__PURE__ */ n(h, { hierarchy: "primary", size: "xl", children: l.title }),
57
+ /* @__PURE__ */ n(u, { asChild: !0, children: /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(m, { size: 16 }) }) })
58
+ ] }), t[3] = l.showCloseButton, t[4] = l.title, t[5] = a) : a = t[5];
51
59
  let f;
52
- return t[5] !== i.children || t[6] !== l || t[7] !== a ? (f = /* @__PURE__ */ g(r.Portal, { children: [
60
+ return t[6] !== l.children || t[7] !== i || t[8] !== a ? (f = /* @__PURE__ */ g(s.Portal, { children: [
53
61
  e,
54
- /* @__PURE__ */ g(r.Content, { ...l, children: [
62
+ /* @__PURE__ */ g(s.Content, { ...i, children: [
55
63
  a,
56
- i.children
64
+ l.children
57
65
  ] })
58
- ] }), t[5] = i.children, t[6] = l, t[7] = a, t[8] = f) : f = t[8], f;
59
- }, T = (i) => {
66
+ ] }), t[6] = l.children, t[7] = i, t[8] = a, t[9] = f) : f = t[9], f;
67
+ }, R = (l) => {
60
68
  const t = c.c(4);
61
69
  let e;
62
- t[0] !== i ? (e = s("dialog__title", i), t[0] = i, t[1] = e) : e = t[1];
70
+ t[0] !== l ? (e = r("dialog__title", l), t[0] = l, t[1] = e) : e = t[1];
63
71
  const o = e;
64
- let l;
65
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Title, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
66
- }, w = (i) => {
72
+ let i;
73
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Title, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
74
+ }, E = (l) => {
67
75
  const t = c.c(4);
68
76
  let e;
69
- t[0] !== i ? (e = s("dialog__description", i), t[0] = i, t[1] = e) : e = t[1];
77
+ t[0] !== l ? (e = r("dialog__description", l), t[0] = l, t[1] = e) : e = t[1];
70
78
  const o = e;
71
- let l;
72
- return t[2] !== o ? (l = /* @__PURE__ */ n(r.Description, { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
73
- }, B = (i) => {
79
+ let i;
80
+ return t[2] !== o ? (i = /* @__PURE__ */ n(s.Description, { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
81
+ }, H = (l) => {
74
82
  const t = c.c(4);
75
83
  let e;
76
- t[0] !== i ? (e = s("dialog__header", i), t[0] = i, t[1] = e) : e = t[1];
84
+ t[0] !== l ? (e = r("dialog__header", l), t[0] = l, t[1] = e) : e = t[1];
77
85
  const o = e;
78
- let l;
79
- return t[2] !== o ? (l = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
80
- }, j = (i) => {
86
+ let i;
87
+ return t[2] !== o ? (i = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
88
+ }, I = (l) => {
81
89
  const t = c.c(4);
82
90
  let e;
83
- t[0] !== i ? (e = s("dialog__footer", i), t[0] = i, t[1] = e) : e = t[1];
91
+ t[0] !== l ? (e = r("dialog__footer", l), t[0] = l, t[1] = e) : e = t[1];
84
92
  const o = e;
85
- let l;
86
- return t[2] !== o ? (l = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = l) : l = t[3], l;
93
+ let i;
94
+ return t[2] !== o ? (i = /* @__PURE__ */ n("div", { ...o }), t[2] = o, t[3] = i) : i = t[3], i;
87
95
  };
88
96
  export {
89
- v as Dialog,
90
- _ as DialogClose,
91
- y as DialogContent,
92
- w as DialogDescription,
93
- j as DialogFooter,
94
- B as DialogHeader,
95
- m as DialogOverlay,
96
- x as DialogPortal,
97
- T as DialogTitle,
98
- P as DialogTrigger
97
+ b as Dialog,
98
+ u as DialogClose,
99
+ O as DialogContent,
100
+ E as DialogDescription,
101
+ I as DialogFooter,
102
+ H as DialogHeader,
103
+ D as DialogOverlay,
104
+ F as DialogPortal,
105
+ R as DialogTitle,
106
+ z as DialogTrigger
99
107
  };
@@ -1,20 +1,21 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import o from "react";
3
- import { Input as l, setElementKey as m } from "./Input.js";
4
- import { IconX as s } from "@tabler/icons-react";
5
- import { Button as f } from "../button/Button.js";
6
- const z = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, d = (t) => z.test(t), g = o.forwardRef((t, x) => {
7
- x = x || o.useRef(null);
2
+ import a from "react";
3
+ import { Input as m } from "./Input.js";
4
+ import { IconX as l } from "@tabler/icons-react";
5
+ import { Button as s } from "../button/Button.js";
6
+ import { setElementKey as f } from "./Input.utils.js";
7
+ const p = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/, g = (t) => p.test(t), I = a.forwardRef((t, x) => {
8
+ x = x || a.useRef(null);
8
9
  const {
9
10
  clearable: r = !1,
10
11
  right: n,
11
12
  ...c
12
13
  } = t, i = () => {
13
- x.current && m(x.current, "value", "", "change");
14
- }, a = [n];
15
- return r && a.push(/* @__PURE__ */ e(f, { onClick: i, children: /* @__PURE__ */ e(s, { size: 13 }) })), /* @__PURE__ */ e(l, { right: a, type: "email", ref: x, ...c });
14
+ x.current && f(x.current, "value", "", "change");
15
+ }, o = [n];
16
+ return r && o.push(/* @__PURE__ */ e(s, { onClick: i, children: /* @__PURE__ */ e(l, { size: 13 }) })), /* @__PURE__ */ e(m, { right: o, type: "email", ref: x, ...c });
16
17
  });
17
18
  export {
18
- g as EmailInput,
19
- d as emailValidation
19
+ I as EmailInput,
20
+ g as emailValidation
20
21
  };
@@ -1,16 +1,21 @@
1
- import { default as React, ForwardRefExoticComponent } from 'react';
2
- import { Code0Component } from '../../utils/types';
1
+ import { default as React } from 'react';
2
+ import { Code0Component } from '../../utils';
3
3
  import { ValidationProps } from './useForm';
4
4
  import { InputSuggestion } from './InputSuggestion';
5
- export declare const setElementKey: (element: HTMLElement, key: string, value: any, event: string) => void;
5
+ import { InputSyntaxSegment } from './Input.syntax.hook';
6
6
  export type Code0Input = Omit<Omit<Omit<Code0Component<HTMLInputElement>, "left">, "right">, "title">;
7
7
  export interface InputProps<T> extends Code0Input, ValidationProps<T> {
8
8
  suggestions?: InputSuggestion[];
9
9
  suggestionsHeader?: React.ReactNode;
10
10
  suggestionsFooter?: React.ReactNode;
11
11
  onSuggestionSelect?: (suggestion: InputSuggestion) => void;
12
- transformValue?: (value: T) => React.ReactNode | T;
12
+ transformSyntax?: (value: T, appliedSyntaxParts?: (InputSuggestion | any)[]) => InputSyntaxSegment[];
13
+ validationUsesSuggestions?: boolean;
13
14
  disableOnValue?: (value: T) => boolean;
15
+ filterSuggestionsByLastToken?: boolean;
16
+ onLastTokenChange?: (token: string | null) => void;
17
+ enforceUniqueSuggestions?: boolean;
18
+ suggestionsEmptyState?: React.ReactNode;
14
19
  wrapperComponent?: Code0Component<HTMLDivElement>;
15
20
  right?: React.ReactNode;
16
21
  left?: React.ReactNode;
@@ -19,4 +24,11 @@ export interface InputProps<T> extends Code0Input, ValidationProps<T> {
19
24
  title?: React.ReactNode;
20
25
  description?: React.ReactNode;
21
26
  }
22
- export declare const Input: ForwardRefExoticComponent<InputProps<any>>;
27
+ export type InputActiveSuggestionSpan = {
28
+ id: number;
29
+ suggestion: InputSuggestion;
30
+ text: string;
31
+ start: number;
32
+ end: number;
33
+ };
34
+ export declare const Input: React.FC<InputProps<any>>;