@code0-tech/pictor 0.16.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 (60) 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 -1
  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 -1
  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/command/Command.js +35 -38
  31. package/dist/components/form/DateInput.js +82 -86
  32. package/dist/components/form/EditorInput.d.ts +26 -10
  33. package/dist/components/form/EditorInput.js +520 -148
  34. package/dist/components/form/EmailInput.js +16 -15
  35. package/dist/components/form/Input.d.ts +0 -20
  36. package/dist/components/form/Input.js +47 -432
  37. package/dist/components/form/InputWrapper.d.ts +0 -1
  38. package/dist/components/form/InputWrapper.js +52 -48
  39. package/dist/components/form/NumberInput.js +17 -16
  40. package/dist/components/form/PasswordInput.js +23 -22
  41. package/dist/components/form/TagInput.d.ts +30 -0
  42. package/dist/components/form/TagInput.js +117 -0
  43. package/dist/components/form/TextInput.js +12 -11
  44. package/dist/components/form/index.d.ts +1 -2
  45. package/dist/components/form/index.js +77 -70
  46. package/dist/components/layout/Layout.js +37 -37
  47. package/dist/components/menu/Menu.d.ts +2 -2
  48. package/dist/components/menu/Menu.js +87 -87
  49. package/dist/components/scroll-area/ScrollArea.js +1 -1
  50. package/dist/index.js +220 -213
  51. package/dist/utils/index.js +11 -11
  52. package/dist/utils/size.d.ts +3 -3
  53. package/dist/utils/size.js +12 -6
  54. package/package.json +1 -1
  55. package/dist/components/form/Input.syntax.hook.d.ts +0 -10
  56. package/dist/components/form/Input.syntax.hook.js +0 -14
  57. package/dist/components/form/InputContentEditable.hook.d.ts +0 -52
  58. package/dist/components/form/InputContentEditable.hook.js +0 -449
  59. package/dist/components/form/InputSuggestion.d.ts +0 -27
  60. package/dist/components/form/InputSuggestion.js +0 -218
@@ -1,62 +1,66 @@
1
- import { jsxs as $, jsx as a, Fragment as R } from "react/jsx-runtime";
2
- import { c as j } from "../../_virtual/compiler-runtime.js";
1
+ import { jsxs as E, jsx as a, Fragment as L } from "react/jsx-runtime";
2
+ import { c as N } from "../../_virtual/compiler-runtime.js";
3
3
  import "../../utils/contextStore.js";
4
- import N from "react";
5
- import { mergeComponentProps as b } from "../../utils/component.js";
4
+ import g from "react";
5
+ import { mergeComponentProps as P } from "../../utils/component.js";
6
6
  import "js-md5";
7
- import { InputMessage as D } from "./InputMessage.js";
8
- import { InputLabel as E } from "./InputLabel.js";
9
- import { InputDescription as F } from "./InputDescription.js";
7
+ import { InputMessage as k } from "./InputMessage.js";
8
+ import { InputLabel as C } from "./InputLabel.js";
9
+ import { InputDescription as D } from "./InputDescription.js";
10
10
  import '../../assets/components/form/InputWrapper.style.css';/* empty css */
11
- const K = N.forwardRef((C, L) => {
12
- const e = j.c(29), {
13
- children: w,
14
- wrapperComponent: f,
15
- left: m,
16
- right: d,
17
- leftType: M,
18
- rightType: T,
19
- title: c,
20
- description: u,
21
- formValidation: h
22
- } = C;
23
- let g;
24
- e[0] !== f ? (g = f === void 0 ? {} : f, e[0] = f, e[1] = g) : g = e[1];
25
- const V = g, x = M === void 0 ? "icon" : M, y = T === void 0 ? "action" : T;
26
- let v;
27
- e[2] !== h ? (v = h === void 0 ? {
11
+ const S = g.forwardRef((F, W) => {
12
+ const e = N.c(22), {
13
+ children: v,
14
+ left: s,
15
+ right: p,
16
+ leftType: $,
17
+ rightType: x,
18
+ title: d,
19
+ description: c,
20
+ formValidation: m,
21
+ ...f
22
+ } = F, b = $ === void 0 ? "icon" : $, _ = x === void 0 ? "action" : x;
23
+ let u;
24
+ e[0] !== m ? (u = m === void 0 ? {
28
25
  valid: !0,
29
26
  notValidMessage: null,
30
27
  setValue: null
31
- } : h, e[2] = h, e[3] = v) : v = e[3];
32
- const t = v;
28
+ } : m, e[0] = m, e[1] = u) : u = e[1];
29
+ const t = u, R = g.useId(), I = f.id ?? R, M = `${I}-label`, T = d ? void 0 : f["aria-label"] ?? f.placeholder, j = {
30
+ id: I,
31
+ ...d ? {
32
+ "aria-labelledby": M
33
+ } : {},
34
+ ...T ? {
35
+ "aria-label": T
36
+ } : {}
37
+ }, V = d && /* @__PURE__ */ a(C, { htmlFor: I, id: M, children: d });
33
38
  let i;
34
- e[4] !== c ? (i = c && /* @__PURE__ */ a(E, { children: c }), e[4] = c, e[5] = i) : i = e[5];
35
- let r;
36
- e[6] !== u ? (r = u && /* @__PURE__ */ a(F, { children: u }), e[6] = u, e[7] = r) : r = e[7];
37
- const I = `input-wrapper ${t?.valid ? "" : "input-wrapper--not-valid"}`;
39
+ e[2] !== c ? (i = c && /* @__PURE__ */ a(D, { children: c }), e[2] = c, e[3] = i) : i = e[3];
40
+ const w = P(`input-wrapper ${t?.valid ? "" : "input-wrapper--not-valid"}`, f);
38
41
  let l;
39
- e[8] !== I || e[9] !== V ? (l = b(I, V), e[8] = I, e[9] = V, e[10] = l) : l = e[10];
42
+ e[4] !== s || e[5] !== b ? (l = s && /* @__PURE__ */ a("div", { className: `input-wrapper__left input__left--${b}`, children: s }), e[4] = s, e[5] = b, e[6] = l) : l = e[6];
43
+ const y = g.isValidElement(v) ? g.cloneElement(v, {
44
+ ...j
45
+ }) : v;
46
+ let r;
47
+ e[7] !== p || e[8] !== _ ? (r = p && /* @__PURE__ */ a("div", { className: `input-wrapper__right input-wrapper__right--${_}`, children: p }), e[7] = p, e[8] = _, e[9] = r) : r = e[9];
40
48
  let o;
41
- e[11] !== m || e[12] !== x ? (o = m && /* @__PURE__ */ a("div", { className: `input-wrapper__left input__left--${x}`, children: m }), e[11] = m, e[12] = x, e[13] = o) : o = e[13];
42
- let p;
43
- e[14] !== d || e[15] !== y ? (p = d && /* @__PURE__ */ a("div", { className: `input-wrapper__right input-wrapper__right--${y}`, children: d }), e[14] = d, e[15] = y, e[16] = p) : p = e[16];
49
+ e[10] !== w || e[11] !== l || e[12] !== y || e[13] !== r ? (o = /* @__PURE__ */ E("div", { ...w, children: [
50
+ l,
51
+ y,
52
+ r
53
+ ] }), e[10] = w, e[11] = l, e[12] = y, e[13] = r, e[14] = o) : o = e[14];
44
54
  let n;
45
- e[17] !== w || e[18] !== o || e[19] !== p || e[20] !== l ? (n = /* @__PURE__ */ $("div", { ...l, children: [
46
- o,
47
- w,
48
- p
49
- ] }), e[17] = w, e[18] = o, e[19] = p, e[20] = l, e[21] = n) : n = e[21];
50
- let s;
51
- e[22] !== t ? (s = !t?.valid && t?.notValidMessage && /* @__PURE__ */ a(D, { children: t.notValidMessage }), e[22] = t, e[23] = s) : s = e[23];
52
- let _;
53
- return e[24] !== n || e[25] !== s || e[26] !== i || e[27] !== r ? (_ = /* @__PURE__ */ $(R, { children: [
55
+ e[15] !== t ? (n = !t?.valid && t?.notValidMessage && /* @__PURE__ */ a(k, { children: t.notValidMessage }), e[15] = t, e[16] = n) : n = e[16];
56
+ let h;
57
+ return e[17] !== o || e[18] !== n || e[19] !== V || e[20] !== i ? (h = /* @__PURE__ */ E(L, { children: [
58
+ V,
54
59
  i,
55
- r,
56
- n,
57
- s
58
- ] }), e[24] = n, e[25] = s, e[26] = i, e[27] = r, e[28] = _) : _ = e[28], _;
60
+ o,
61
+ n
62
+ ] }), e[17] = o, e[18] = n, e[19] = V, e[20] = i, e[21] = h) : h = e[21], h;
59
63
  });
60
64
  export {
61
- K as InputWrapper
65
+ S as InputWrapper
62
66
  };
@@ -1,20 +1,21 @@
1
- import { jsx as n } 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 N = u.forwardRef((o, t) => {
7
- t = t || u.useRef(null);
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import o from "react";
3
+ import { Input as l } from "./Input.js";
4
+ import { IconMinus as a, IconPlus as p } from "@tabler/icons-react";
5
+ import { Button as u } from "../button/Button.js";
6
+ import { ButtonGroup as e } from "../button-group/ButtonGroup.js";
7
+ const g = o.forwardRef((c, r) => {
8
+ r = r || o.useRef(null);
8
9
  const {
9
- step: r = 1,
10
- ...c
11
- } = o;
12
- return /* @__PURE__ */ n(i, { className: "number-input", right: /* @__PURE__ */ n(e, { variant: "none", onClick: () => {
13
- t.current && (t.current.value || (t.current.value = "0"), t.current.value = (Number.parseInt(t.current.value) + r).toString());
14
- }, children: /* @__PURE__ */ n(l, { size: 13 }) }), left: /* @__PURE__ */ n(e, { variant: "none", onClick: () => {
15
- t.current && (t.current.value || (t.current.value = "0"), t.current.value = (Number.parseInt(t.current.value) - r).toString());
16
- }, children: /* @__PURE__ */ n(a, { size: 13 }) }), leftType: "action", type: "number", ref: t, ...c });
10
+ step: n = 1,
11
+ ...i
12
+ } = c;
13
+ return /* @__PURE__ */ t(l, { className: "number-input", right: /* @__PURE__ */ t(e, { color: "primary", children: /* @__PURE__ */ t(u, { color: "secondary", paddingSize: "xxs", onClick: () => {
14
+ r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) + n).toString());
15
+ }, children: /* @__PURE__ */ t(p, { size: 13 }) }) }), left: /* @__PURE__ */ t(e, { color: "primary", children: /* @__PURE__ */ t(u, { color: "secondary", paddingSize: "xxs", onClick: () => {
16
+ r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) - n).toString());
17
+ }, children: /* @__PURE__ */ t(a, { size: 13 }) }) }), leftType: "action", type: "number", ref: r, ...i });
17
18
  });
18
19
  export {
19
- N as NumberInput
20
+ g as NumberInput
20
21
  };
@@ -1,54 +1,55 @@
1
- import { jsxs as l, Fragment as y, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as w, jsx as s } from "react/jsx-runtime";
2
2
  import c from "react";
3
3
  import { Input as b } from "./Input.js";
4
4
  import { IconEye as I, IconX as R } from "@tabler/icons-react";
5
5
  import { Button as u } from "../button/Button.js";
6
- import { clearInputElement as P } from "./Input.utils.js";
7
- import { Flex as z } from "../flex/Flex.js";
6
+ import { clearInputElement as z } from "./Input.utils.js";
7
+ import { Flex as P } from "../flex/Flex.js";
8
8
  import { Progress as D } from "../progress/Progress.js";
9
9
  import { InputMessage as A } from "./InputMessage.js";
10
- const L = c.forwardRef((r, t) => {
10
+ import { ButtonGroup as B } from "../button-group/ButtonGroup.js";
11
+ const X = c.forwardRef((r, t) => {
11
12
  t = t || c.useRef(null);
12
13
  const {
13
14
  clearable: p = !0,
14
15
  visible: d = !0,
15
16
  right: m,
16
- formValidation: s,
17
+ formValidation: o,
17
18
  ...f
18
- } = r, h = (e) => (P(t.current), e.stopPropagation(), e.preventDefault(), !1), g = (e) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), e.stopPropagation(), e.preventDefault(), !1), o = [m];
19
- d && o.push(/* @__PURE__ */ n(u, { variant: "none", onClick: (e) => g(e), children: /* @__PURE__ */ n(I, { size: 13 }) })), p && o.push(/* @__PURE__ */ n(u, { variant: "none", onClick: (e) => h(e), children: /* @__PURE__ */ n(R, { size: 13 }) }));
20
- const a = s?.notValidMessage ?? "", i = /^[1-5]+$/.test(a), x = a.length, M = Math.max(0, 5 - x) / 5 * 100;
21
- return /* @__PURE__ */ l(y, { children: [
22
- /* @__PURE__ */ n(b, { right: o, rightType: "action", type: "password", ref: t, ...s ? {
23
- formValidation: i ? {
24
- setValue: s.setValue,
25
- valid: s.valid
26
- } : s
19
+ } = r, g = (e) => (z(t.current), e.stopPropagation(), e.preventDefault(), !1), h = (e) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), e.stopPropagation(), e.preventDefault(), !1), n = [m];
20
+ d && n.push(/* @__PURE__ */ s(u, { color: "secondary", paddingSize: "xxs", onClick: (e) => h(e), children: /* @__PURE__ */ s(I, { size: 13 }) })), p && n.push(/* @__PURE__ */ s(u, { color: "secondary", paddingSize: "xxs", onClick: (e) => g(e), children: /* @__PURE__ */ s(R, { size: 13 }) }));
21
+ const i = o?.notValidMessage ?? "", a = /^[1-5]+$/.test(i), x = i.length, y = Math.max(0, 5 - x) / 5 * 100;
22
+ return /* @__PURE__ */ l(w, { children: [
23
+ /* @__PURE__ */ s(b, { right: /* @__PURE__ */ s(B, { color: "primary", children: n }), rightType: "action", type: "password", ref: t, ...o ? {
24
+ formValidation: a ? {
25
+ setValue: o.setValue,
26
+ valid: o.valid
27
+ } : o
27
28
  } : {}, ...f }),
28
- i && !s?.valid && /* @__PURE__ */ l(z, { mt: 0.7, style: {
29
+ a && !o?.valid && /* @__PURE__ */ l(P, { mt: 0.7, style: {
29
30
  flexDirection: "column"
30
31
  }, children: [
31
- /* @__PURE__ */ n(D, { value: M, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
32
+ /* @__PURE__ */ s(D, { value: y, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
32
33
  (() => {
33
- const e = ["2", "3", "4", "5", "1"].find((w) => a.includes(w));
34
+ const e = ["2", "3", "4", "5", "1"].find((V) => i.includes(V));
34
35
  if (!e) return null;
35
- const V = {
36
+ const M = {
36
37
  1: "Must be at least 8 characters",
37
38
  2: "Must include a lowercase letter",
38
39
  3: "Must include an uppercase letter",
39
40
  4: "Must include a number",
40
41
  5: "Must include a special character"
41
42
  }[e];
42
- return /* @__PURE__ */ n(A, { children: V });
43
+ return /* @__PURE__ */ s(A, { children: M });
43
44
  })()
44
45
  ] })
45
46
  ] });
46
- }), X = (r) => {
47
+ }), _ = (r) => {
47
48
  if (!r) return "12345";
48
49
  let t = null;
49
50
  return r.length < 8 && (t = (t ?? "") + "1"), /[a-z]/.test(r) || (t = (t ?? "") + "2"), /[A-Z]/.test(r) || (t = (t ?? "") + "3"), /[0-9]/.test(r) || (t = (t ?? "") + "4"), /[^A-Za-z0-9]/.test(r) || (t = (t ?? "") + "5"), t;
50
51
  };
51
52
  export {
52
- L as PasswordInput,
53
- X as passwordValidation
53
+ X as PasswordInput,
54
+ _ as passwordValidation
54
55
  };
@@ -0,0 +1,30 @@
1
+ import { default as React } from 'react';
2
+ import { EditorInputMenuProps, EditorInputSubMenuProps, EditorInputTriggerProps, EditorInputValueProps, EditorInputMenuItemProps } from './EditorInput';
3
+ import { InputWrapperProps } from './InputWrapper';
4
+ import { ValidationProps } from './useForm';
5
+ export interface TagValue {
6
+ value: any;
7
+ valueData?: any;
8
+ }
9
+ export interface TagSuggestion {
10
+ value: any;
11
+ valueData?: any;
12
+ children: React.ReactNode;
13
+ }
14
+ export interface TagInputProps extends Omit<InputWrapperProps, "onChange">, ValidationProps<any> {
15
+ allowCustomValues?: boolean;
16
+ onChange?: (tags: TagValue[]) => void;
17
+ tagColor?: string;
18
+ children?: React.ReactNode;
19
+ }
20
+ export type TagInputTriggerProps = EditorInputTriggerProps;
21
+ export type TagInputSubMenuProps = EditorInputSubMenuProps;
22
+ export type TagInputMenuProps = EditorInputMenuProps;
23
+ export type TagInputMenuItemProps = EditorInputMenuItemProps;
24
+ export type TagInputValueProps = EditorInputValueProps;
25
+ export declare const TagInput: React.FC<TagInputProps>;
26
+ export declare const TagInputMenu: React.FC<TagInputMenuProps>;
27
+ export declare const TagInputSubMenu: React.FC<TagInputSubMenuProps>;
28
+ export declare const TagInputMenuItem: React.FC<TagInputMenuItemProps>;
29
+ export declare const TagInputValue: React.FC<TagInputValueProps>;
30
+ export declare const TagInputTrigger: React.FC<TagInputTriggerProps>;
@@ -0,0 +1,117 @@
1
+ import { jsx as l, Fragment as b } from "react/jsx-runtime";
2
+ import { c as I } from "../../_virtual/compiler-runtime.js";
3
+ import K, { useState as N, useRef as V, useReducer as j, useCallback as A, useEffect as _, useMemo as B, useContext as F } from "react";
4
+ import { EditorInput as L, EditorInputMenu as U, EditorInputMenuItem as q, EditorInputSubMenu as z, EditorInputTrigger as G, EditorInputValue as H } from "./EditorInput.js";
5
+ import { Badge as J } from "../badge/Badge.js";
6
+ import { Text as Q } from "../text/Text.js";
7
+ const h = "⟦", d = "⟧", k = new RegExp(`${h}([^${d}]+)${d}`, "g"), W = new RegExp(`(${h}[^${d}]+${d})|([^${h}${d}]+)`, "g"), w = (e) => `${h}${String(e)}${d}`, X = (e) => e.slice(h.length, -d.length), R = (e) => e.map((t) => w(t.value)).join(""), Y = (e) => e.replace(k, "").trim(), Z = (e, t) => {
8
+ let n = !1;
9
+ const r = e.replace(W, (s, o, c) => o || (!n && c.trim() ? (n = !0, t) : ""));
10
+ return n ? r : r + t;
11
+ }, v = K.createContext(null), y = () => {
12
+ const e = F(v);
13
+ if (!e)
14
+ throw new Error("TagInput.* components must be used inside <TagInput>");
15
+ return e;
16
+ }, ct = (e) => {
17
+ const {
18
+ allowCustomValues: t = !1,
19
+ onChange: n,
20
+ formValidation: r,
21
+ tagColor: s = "primary",
22
+ value: o,
23
+ initialValue: c,
24
+ defaultValue: f,
25
+ children: p,
26
+ ...g
27
+ } = e, u = o ?? c ?? f, [i, M] = N(() => R(u ?? [])), E = V(/* @__PURE__ */ new Map()), [, D] = j((a) => a + 1, 0), O = A((a, m) => {
28
+ E.current.set(a, m), D();
29
+ }, []), $ = V(u), S = (a) => {
30
+ const m = [...a.matchAll(k)].map(([, T]) => {
31
+ const C = E.current.get(T);
32
+ return {
33
+ value: C ? C.value : T,
34
+ valueData: C?.data
35
+ };
36
+ });
37
+ $.current = m, M(a), r?.setValue?.(m), n?.(m);
38
+ };
39
+ _(() => {
40
+ u !== $.current && ($.current = u, M(R(u ?? [])));
41
+ }, [u]);
42
+ const P = B(() => [{
43
+ pattern: k,
44
+ void: !0,
45
+ wrap: (a) => {
46
+ const m = X(a), T = E.current.get(m);
47
+ return T ? /* @__PURE__ */ l(b, { children: T.children }) : /* @__PURE__ */ l(J, { m: 0.01, color: s, children: /* @__PURE__ */ l(Q, { children: m }) });
48
+ }
49
+ }], [s]), x = {
50
+ search: Y(i),
51
+ allowCustomValues: t,
52
+ insertToken: (a) => S(Z(i, a)),
53
+ registerTag: O
54
+ };
55
+ return /* @__PURE__ */ l(v.Provider, { value: x, children: /* @__PURE__ */ l(L, { ...g, value: i, search: x.search, tokenRules: P, formValidation: r && {
56
+ valid: r.valid,
57
+ notValidMessage: r.notValidMessage
58
+ }, onChange: S, onSelect: (a) => x.insertToken(String(a)), children: p }) });
59
+ }, at = (e) => {
60
+ const t = I.c(2);
61
+ let n;
62
+ return t[0] !== e ? (n = /* @__PURE__ */ l(U, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
63
+ }, ut = (e) => {
64
+ const t = I.c(2);
65
+ let n;
66
+ return t[0] !== e ? (n = /* @__PURE__ */ l(z, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
67
+ }, it = ({
68
+ value: e,
69
+ data: t,
70
+ onlyOnce: n,
71
+ aliases: r,
72
+ children: s
73
+ }) => {
74
+ const {
75
+ registerTag: o
76
+ } = y(), c = V({
77
+ value: e,
78
+ data: t,
79
+ children: s
80
+ });
81
+ return c.current.value = e, c.current.data = t, c.current.children = s, _(() => o(String(e), c.current), [e, o]), /* @__PURE__ */ l(q, { value: w(e), data: t, onlyOnce: n, aliases: [String(e), ...r ?? []], children: s });
82
+ }, lt = (e) => {
83
+ const t = I.c(14);
84
+ let n, r;
85
+ t[0] !== e ? ({
86
+ onKeyDown: n,
87
+ ...r
88
+ } = e, t[0] = e, t[1] = n, t[2] = r) : (n = t[1], r = t[2]);
89
+ const {
90
+ search: s,
91
+ allowCustomValues: o,
92
+ insertToken: c
93
+ } = y();
94
+ let f;
95
+ t[3] !== o || t[4] !== c || t[5] !== s ? (f = () => {
96
+ o && s && c(w(s));
97
+ }, t[3] = o, t[4] = c, t[5] = s, t[6] = f) : f = t[6];
98
+ const p = f;
99
+ let g;
100
+ t[7] !== o || t[8] !== p || t[9] !== n ? (g = (i) => {
101
+ (i.key === "Enter" && !i.defaultPrevented || i.key === "," && o) && (i.preventDefault(), p()), n?.(i);
102
+ }, t[7] = o, t[8] = p, t[9] = n, t[10] = g) : g = t[10];
103
+ let u;
104
+ return t[11] !== r || t[12] !== g ? (u = /* @__PURE__ */ l(H, { ...r, onKeyDown: g }), t[11] = r, t[12] = g, t[13] = u) : u = t[13], u;
105
+ }, gt = (e) => {
106
+ const t = I.c(2);
107
+ let n;
108
+ return t[0] !== e ? (n = /* @__PURE__ */ l(G, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
109
+ };
110
+ export {
111
+ ct as TagInput,
112
+ at as TagInputMenu,
113
+ it as TagInputMenuItem,
114
+ ut as TagInputSubMenu,
115
+ gt as TagInputTrigger,
116
+ lt as TagInputValue
117
+ };
@@ -1,20 +1,21 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as r } from "react/jsx-runtime";
2
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";
3
+ import { Input as p } from "./Input.js";
4
+ import { IconX as u } from "@tabler/icons-react";
5
+ import { Button as f } from "../button/Button.js";
6
6
  import { clearInputElement as s } from "./Input.utils.js";
7
- const R = i.forwardRef((r, t) => {
7
+ import { ButtonGroup as d } from "../button-group/ButtonGroup.js";
8
+ const b = i.forwardRef((o, t) => {
8
9
  t = t || i.useRef(null);
9
10
  const {
10
11
  clearable: l = !1,
11
- right: a,
12
+ right: c,
12
13
  ...m
13
- } = r, c = (o) => {
14
- s(t.current), r.onClear && r.onClear(o);
15
- }, n = [a];
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, ...m });
14
+ } = o, a = (e) => {
15
+ s(t.current), o.onClear && o.onClear(e);
16
+ }, n = [c];
17
+ return l && n.push(/* @__PURE__ */ r(f, { color: "secondary", paddingSize: "xxs", onClick: (e) => a(e), children: /* @__PURE__ */ r(u, { size: 13 }) })), /* @__PURE__ */ r(p, { right: /* @__PURE__ */ r(d, { color: "primary", children: n }), type: "text", ref: t, ...m });
17
18
  });
18
19
  export {
19
- R as TextInput
20
+ b as TextInput
20
21
  };
@@ -8,7 +8,6 @@ export * from './Input';
8
8
  export * from './InputDescription';
9
9
  export * from './InputLabel';
10
10
  export * from './InputMessage';
11
- export * from './InputSuggestion';
12
11
  export * from './NumberInput';
13
12
  export * from './PasswordInput';
14
13
  export * from './PinInput';
@@ -16,7 +15,7 @@ export * from './RadioGroup';
16
15
  export * from './RadioInput';
17
16
  export * from './SelectInput';
18
17
  export * from './SwitchInput';
18
+ export * from './TagInput';
19
19
  export * from './TextAreaInput';
20
20
  export * from './TextInput';
21
21
  export * from './useForm';
22
- export * from './Input.syntax.hook';
@@ -1,80 +1,87 @@
1
- import { CheckboxInput as o } from "./CheckboxInput.js";
1
+ import { CheckboxInput as r } from "./CheckboxInput.js";
2
2
  import { ColorInput as p, ColorInputContent as n, ColorInputControl as u, ColorInputSwatch as I, ColorInputTrigger as i, ColorInputValueText as l } from "./ColorInput.js";
3
- import { DateInput as x, DateInputContent as a, DateInputControl as f, DateInputField as g, DateInputNextTrigger as F, DateInputPrevTrigger as d, DateInputTrigger as C } from "./DateInput.js";
4
- import { EditorInput as c } from "./EditorInput.js";
5
- import { EmailInput as s, emailValidation as D } from "./EmailInput.js";
6
- import { FileInput as w, FileInputContext as V, FileInputDropzone as b, FileInputHiddenInput as h, FileInputItem as v, FileInputItemDeleteTrigger as M, FileInputItemGroup as N, FileInputItemName as z, FileInputItemPreview as E, FileInputItemPreviewImage as G, FileInputItemSizeText as H, FileInputTrigger as R } from "./FileInput.js";
7
- import { Input as y } from "./Input.js";
8
- import { InputDescription as L } from "./InputDescription.js";
9
- import { InputLabel as q } from "./InputLabel.js";
10
- import { InputMessage as J } from "./InputMessage.js";
11
- import { InputSuggestionMenuContent as O, InputSuggestionMenuContentItems as Q } from "./InputSuggestion.js";
12
- import { NumberInput as W } from "./NumberInput.js";
13
- import { PasswordInput as Y, passwordValidation as Z } from "./PasswordInput.js";
14
- import { PinInput as $, PinInputField as tt, PinInputHiddenField as et } from "./PinInput.js";
15
- import { RadioGroup as rt } from "./RadioGroup.js";
16
- import { RadioInput as nt } from "./RadioInput.js";
17
- import { SelectContent as It, SelectInput as it, SelectItem as lt, SelectItemText as mt, SelectPortal as xt, SelectTrigger as at, SelectValue as ft, SelectViewport as gt } from "./SelectInput.js";
18
- import { SwitchInput as dt } from "./SwitchInput.js";
19
- import { TextAreaInput as St } from "./TextAreaInput.js";
20
- import { TextInput as Tt } from "./TextInput.js";
21
- import { useForm as Dt } from "./useForm.js";
22
- import { buildDefaultSyntax as wt } from "./Input.syntax.hook.js";
3
+ import { DateInput as a, DateInputContent as x, DateInputControl as g, DateInputField as f, DateInputNextTrigger as T, DateInputPrevTrigger as d, DateInputTrigger as F } from "./DateInput.js";
4
+ import { EditorInput as S, EditorInputMenu as c, EditorInputMenuItem as D, EditorInputSubMenu as s, EditorInputTrigger as P, EditorInputValue as w } from "./EditorInput.js";
5
+ import { EmailInput as M, emailValidation as V } from "./EmailInput.js";
6
+ import { FileInput as h, FileInputContext as v, FileInputDropzone as N, FileInputHiddenInput as z, FileInputItem as G, FileInputItemDeleteTrigger as H, FileInputItemGroup as R, FileInputItemName as k, FileInputItemPreview as A, FileInputItemPreviewImage as L, FileInputItemSizeText as j, FileInputTrigger as q } from "./FileInput.js";
7
+ import { Input as B } from "./Input.js";
8
+ import { InputDescription as K } from "./InputDescription.js";
9
+ import { InputLabel as Q } from "./InputLabel.js";
10
+ import { InputMessage as W } from "./InputMessage.js";
11
+ import { NumberInput as Y } from "./NumberInput.js";
12
+ import { PasswordInput as _, passwordValidation as $ } from "./PasswordInput.js";
13
+ import { PinInput as et, PinInputField as rt, PinInputHiddenField as ot } from "./PinInput.js";
14
+ import { RadioGroup as nt } from "./RadioGroup.js";
15
+ import { RadioInput as It } from "./RadioInput.js";
16
+ import { SelectContent as lt, SelectInput as mt, SelectItem as at, SelectItemText as xt, SelectPortal as gt, SelectTrigger as ft, SelectValue as Tt, SelectViewport as dt } from "./SelectInput.js";
17
+ import { SwitchInput as Ct } from "./SwitchInput.js";
18
+ import { TagInput as ct, TagInputMenu as Dt, TagInputMenuItem as st, TagInputSubMenu as Pt, TagInputTrigger as wt, TagInputValue as Et } from "./TagInput.js";
19
+ import { TextAreaInput as Vt } from "./TextAreaInput.js";
20
+ import { TextInput as ht } from "./TextInput.js";
21
+ import { useForm as Nt } from "./useForm.js";
23
22
  export {
24
- o as CheckboxInput,
23
+ r as CheckboxInput,
25
24
  p as ColorInput,
26
25
  n as ColorInputContent,
27
26
  u as ColorInputControl,
28
27
  I as ColorInputSwatch,
29
28
  i as ColorInputTrigger,
30
29
  l as ColorInputValueText,
31
- x as DateInput,
32
- a as DateInputContent,
33
- f as DateInputControl,
34
- g as DateInputField,
35
- F as DateInputNextTrigger,
30
+ a as DateInput,
31
+ x as DateInputContent,
32
+ g as DateInputControl,
33
+ f as DateInputField,
34
+ T as DateInputNextTrigger,
36
35
  d as DateInputPrevTrigger,
37
- C as DateInputTrigger,
38
- c as EditorInput,
39
- s as EmailInput,
40
- w as FileInput,
41
- V as FileInputContext,
42
- b as FileInputDropzone,
43
- h as FileInputHiddenInput,
44
- v as FileInputItem,
45
- M as FileInputItemDeleteTrigger,
46
- N as FileInputItemGroup,
47
- z as FileInputItemName,
48
- E as FileInputItemPreview,
49
- G as FileInputItemPreviewImage,
50
- H as FileInputItemSizeText,
51
- R as FileInputTrigger,
52
- y as Input,
53
- L as InputDescription,
54
- q as InputLabel,
55
- J as InputMessage,
56
- O as InputSuggestionMenuContent,
57
- Q as InputSuggestionMenuContentItems,
58
- W as NumberInput,
59
- Y as PasswordInput,
60
- $ as PinInput,
61
- tt as PinInputField,
62
- et as PinInputHiddenField,
63
- rt as RadioGroup,
64
- nt as RadioInput,
65
- It as SelectContent,
66
- it as SelectInput,
67
- lt as SelectItem,
68
- mt as SelectItemText,
69
- xt as SelectPortal,
70
- at as SelectTrigger,
71
- ft as SelectValue,
72
- gt as SelectViewport,
73
- dt as SwitchInput,
74
- St as TextAreaInput,
75
- Tt as TextInput,
76
- wt as buildDefaultSyntax,
77
- D as emailValidation,
78
- Z as passwordValidation,
79
- Dt as useForm
36
+ F as DateInputTrigger,
37
+ S as EditorInput,
38
+ c as EditorInputMenu,
39
+ D as EditorInputMenuItem,
40
+ s as EditorInputSubMenu,
41
+ P as EditorInputTrigger,
42
+ w as EditorInputValue,
43
+ M as EmailInput,
44
+ h as FileInput,
45
+ v as FileInputContext,
46
+ N as FileInputDropzone,
47
+ z as FileInputHiddenInput,
48
+ G as FileInputItem,
49
+ H as FileInputItemDeleteTrigger,
50
+ R as FileInputItemGroup,
51
+ k as FileInputItemName,
52
+ A as FileInputItemPreview,
53
+ L as FileInputItemPreviewImage,
54
+ j as FileInputItemSizeText,
55
+ q as FileInputTrigger,
56
+ B as Input,
57
+ K as InputDescription,
58
+ Q as InputLabel,
59
+ W as InputMessage,
60
+ Y as NumberInput,
61
+ _ as PasswordInput,
62
+ et as PinInput,
63
+ rt as PinInputField,
64
+ ot as PinInputHiddenField,
65
+ nt as RadioGroup,
66
+ It as RadioInput,
67
+ lt as SelectContent,
68
+ mt as SelectInput,
69
+ at as SelectItem,
70
+ xt as SelectItemText,
71
+ gt as SelectPortal,
72
+ ft as SelectTrigger,
73
+ Tt as SelectValue,
74
+ dt as SelectViewport,
75
+ Ct as SwitchInput,
76
+ ct as TagInput,
77
+ Dt as TagInputMenu,
78
+ st as TagInputMenuItem,
79
+ Pt as TagInputSubMenu,
80
+ wt as TagInputTrigger,
81
+ Et as TagInputValue,
82
+ Vt as TextAreaInput,
83
+ ht as TextInput,
84
+ V as emailValidation,
85
+ $ as passwordValidation,
86
+ Nt as useForm
80
87
  };