@code0-tech/pictor 0.17.0 → 0.17.2

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.
@@ -1,22 +1,24 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import a from "react";
3
- import { Input as l } from "./Input.js";
4
- import { IconX as m } from "@tabler/icons-react";
5
- import { Button as p } from "../button/Button.js";
6
- import { clearInputElement as f } from "./Input.utils.js";
7
- import { ButtonGroup as s } from "../button-group/ButtonGroup.js";
8
- const u = /(?:[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 = (o) => u.test(o), R = a.forwardRef((o, x) => {
9
- x = x || a.useRef(null);
3
+ import { Input as m } from "./Input.js";
4
+ import { IconX as s } from "@tabler/icons-react";
5
+ import { Button as f } from "../button/Button.js";
6
+ import { clearInputElement as p } from "./Input.utils.js";
7
+ import { ButtonGroup as u } from "../button-group/ButtonGroup.js";
8
+ 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])+)\])/, R = (x) => z.test(x), y = a.forwardRef((x, t) => {
9
+ t = t || a.useRef(null);
10
10
  const {
11
- clearable: e = !1,
12
- right: i,
13
- ...n
14
- } = o, c = () => {
15
- f(x.current);
16
- }, r = [i];
17
- return e && r.push(/* @__PURE__ */ t(p, { color: "secondary", paddingSize: "xxs", onClick: c, children: /* @__PURE__ */ t(m, { size: 13 }) })), /* @__PURE__ */ t(l, { right: /* @__PURE__ */ t(s, { color: "primary", children: r }), type: "email", ref: x, ...n });
11
+ clearable: i = !1,
12
+ right: n,
13
+ ...c
14
+ } = x, l = () => {
15
+ p(t.current);
16
+ }, r = [n];
17
+ i && r.push(/* @__PURE__ */ o(f, { color: "secondary", paddingSize: "xxs", onClick: l, children: /* @__PURE__ */ o(s, { size: 13 }) }));
18
+ const e = r.filter(Boolean);
19
+ return /* @__PURE__ */ o(m, { right: e.length > 0 ? /* @__PURE__ */ o(u, { color: "primary", children: e }) : void 0, type: "email", ref: t, ...c });
18
20
  });
19
21
  export {
20
- R as EmailInput,
21
- g as emailValidation
22
+ y as EmailInput,
23
+ R as emailValidation
22
24
  };
@@ -1,46 +1,46 @@
1
- import { jsxs as l, Fragment as w, jsx as s } from "react/jsx-runtime";
2
- import c from "react";
3
- import { Input as b } from "./Input.js";
4
- import { IconEye as I, IconX as R } from "@tabler/icons-react";
5
- import { Button as u } from "../button/Button.js";
6
- import { clearInputElement as z } from "./Input.utils.js";
7
- import { Flex as P } from "../flex/Flex.js";
8
- import { Progress as D } from "../progress/Progress.js";
9
- import { InputMessage as A } from "./InputMessage.js";
10
- import { ButtonGroup as B } from "../button-group/ButtonGroup.js";
11
- const X = c.forwardRef((r, t) => {
12
- t = t || c.useRef(null);
1
+ import { jsxs as c, Fragment as b, jsx as o } from "react/jsx-runtime";
2
+ import u from "react";
3
+ import { Input as I } from "./Input.js";
4
+ import { IconEye as R, IconX as z } from "@tabler/icons-react";
5
+ import { Button as p } from "../button/Button.js";
6
+ import { clearInputElement as P } from "./Input.utils.js";
7
+ import { Flex as A } from "../flex/Flex.js";
8
+ import { Progress as B } from "../progress/Progress.js";
9
+ import { InputMessage as D } from "./InputMessage.js";
10
+ import { ButtonGroup as C } from "../button-group/ButtonGroup.js";
11
+ const X = u.forwardRef((r, t) => {
12
+ t = t || u.useRef(null);
13
13
  const {
14
- clearable: p = !0,
15
- visible: d = !0,
16
- right: m,
17
- formValidation: o,
18
- ...f
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
28
- } : {}, ...f }),
29
- a && !o?.valid && /* @__PURE__ */ l(P, { mt: 0.7, style: {
14
+ clearable: d = !0,
15
+ visible: m = !0,
16
+ right: f,
17
+ formValidation: s,
18
+ ...g
19
+ } = r, h = (e) => (P(t.current), e.stopPropagation(), e.preventDefault(), !1), x = (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 = [f];
20
+ m && n.push(/* @__PURE__ */ o(p, { color: "secondary", paddingSize: "xxs", onClick: (e) => x(e), children: /* @__PURE__ */ o(R, { size: 13 }) })), d && n.push(/* @__PURE__ */ o(p, { color: "secondary", paddingSize: "xxs", onClick: (e) => h(e), children: /* @__PURE__ */ o(z, { size: 13 }) }));
21
+ const a = n.filter(Boolean), i = s?.notValidMessage ?? "", l = /^[1-5]+$/.test(i), y = i.length, M = Math.max(0, 5 - y) / 5 * 100;
22
+ return /* @__PURE__ */ c(b, { children: [
23
+ /* @__PURE__ */ o(I, { right: a.length > 0 ? /* @__PURE__ */ o(C, { color: "primary", children: a }) : void 0, rightType: "action", type: "password", ref: t, ...s ? {
24
+ formValidation: l ? {
25
+ setValue: s.setValue,
26
+ valid: s.valid
27
+ } : s
28
+ } : {}, ...g }),
29
+ l && !s?.valid && /* @__PURE__ */ c(A, { mt: 0.7, style: {
30
30
  flexDirection: "column"
31
31
  }, children: [
32
- /* @__PURE__ */ s(D, { value: y, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
32
+ /* @__PURE__ */ o(B, { value: M, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
33
33
  (() => {
34
- const e = ["2", "3", "4", "5", "1"].find((V) => i.includes(V));
34
+ const e = ["2", "3", "4", "5", "1"].find((w) => i.includes(w));
35
35
  if (!e) return null;
36
- const M = {
36
+ const V = {
37
37
  1: "Must be at least 8 characters",
38
38
  2: "Must include a lowercase letter",
39
39
  3: "Must include an uppercase letter",
40
40
  4: "Must include a number",
41
41
  5: "Must include a special character"
42
42
  }[e];
43
- return /* @__PURE__ */ s(A, { children: M });
43
+ return /* @__PURE__ */ o(D, { children: V });
44
44
  })()
45
45
  ] })
46
46
  ] });
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { EditorInputMenuProps, EditorInputSubMenuProps, EditorInputTriggerProps, EditorInputValueProps, EditorInputMenuItemProps } from './EditorInput';
2
+ import { EditorInputMenuProps, EditorInputSubMenuProps, EditorInputTriggerProps, EditorInputValueProps, EditorTokenRule, EditorInputMenuItemProps } from './EditorInput';
3
3
  import { InputWrapperProps } from './InputWrapper';
4
4
  import { ValidationProps } from './useForm';
5
5
  export interface TagValue {
@@ -14,7 +14,14 @@ export interface TagSuggestion {
14
14
  export interface TagInputProps extends Omit<InputWrapperProps, "onChange">, ValidationProps<any> {
15
15
  allowCustomValues?: boolean;
16
16
  onChange?: (tags: TagValue[]) => void;
17
- tagColor?: string;
17
+ /**
18
+ * Defines how a tag is rendered as a chip inside the input. Each rule's
19
+ * `pattern` is matched against the tag's value; the first match decides the
20
+ * chip via its `wrap`/`style`/`className`. Tags with no matching rule fall
21
+ * back to a plain badge. The chip rendering is token-defined only — a menu
22
+ * item's `children` is never reused here.
23
+ */
24
+ tokenRules?: EditorTokenRule[];
18
25
  children?: React.ReactNode;
19
26
  }
20
27
  export type TagInputTriggerProps = EditorInputTriggerProps;
@@ -1,117 +1,124 @@
1
- import { jsx as l, Fragment as b } from "react/jsx-runtime";
1
+ import { jsx as l } from "react/jsx-runtime";
2
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";
3
+ import b, { useState as K, useRef as k, useReducer as j, useCallback as A, useEffect as v, useMemo as B, useContext as L } from "react";
4
+ import { EditorInput as U, EditorInputMenu as q, EditorInputMenuItem as z, EditorInputSubMenu as F, EditorInputTrigger as G, EditorInputValue as H } from "./EditorInput.js";
5
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) => {
6
+ import { Text as $ } from "../text/Text.js";
7
+ const E = "⟦", d = "⟧", R = new RegExp(`${E}([^${d}]+)${d}`, "g"), Q = new RegExp(`(${E}[^${d}]+${d})|([^${E}${d}]+)`, "g"), V = (t) => `${E}${String(t)}${d}`, W = (t) => t.slice(E.length, -d.length), y = (t) => t.map((e) => V(e.value)).join(""), X = (t) => t.replace(R, "").trim(), Y = (t, e) => {
8
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)
9
+ const r = t.replace(Q, (a, o, c) => o || (!n && c.trim() ? (n = !0, e) : ""));
10
+ return n ? r : r + e;
11
+ }, _ = b.createContext(null), D = () => {
12
+ const t = L(_);
13
+ if (!t)
14
14
  throw new Error("TagInput.* components must be used inside <TagInput>");
15
- return e;
16
- }, ct = (e) => {
15
+ return t;
16
+ }, se = (t) => {
17
17
  const {
18
- allowCustomValues: t = !1,
18
+ allowCustomValues: e = !1,
19
19
  onChange: n,
20
20
  formValidation: r,
21
- tagColor: s = "primary",
21
+ tokenRules: a,
22
22
  value: o,
23
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);
24
+ defaultValue: T,
25
+ children: h,
26
+ ...p
27
+ } = t, i = o ?? c ?? T, [g, C] = K(() => y(i ?? [])), M = k(/* @__PURE__ */ new Map()), [, N] = j((u) => u + 1, 0), O = A((u, s) => {
28
+ M.current.set(u, s), N();
29
+ }, []), x = k(i), S = (u) => {
30
+ const s = [...u.matchAll(R)].map(([, m]) => {
31
+ const f = M.current.get(m);
32
32
  return {
33
- value: C ? C.value : T,
34
- valueData: C?.data
33
+ value: f ? f.value : m,
34
+ valueData: f?.data
35
35
  };
36
36
  });
37
- $.current = m, M(a), r?.setValue?.(m), n?.(m);
37
+ x.current = s, C(u), r?.setValue?.(s), n?.(s);
38
38
  };
39
- _(() => {
40
- u !== $.current && ($.current = u, M(R(u ?? [])));
41
- }, [u]);
39
+ v(() => {
40
+ i !== x.current && (x.current = i, C(y(i ?? [])));
41
+ }, [i]);
42
42
  const P = B(() => [{
43
- pattern: k,
43
+ pattern: R,
44
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 }) });
45
+ // The chip (input rendering) is defined by the token alone — the menu
46
+ // item's `children` is menu-only and must NOT be reused here. The tag's
47
+ // value is matched against the consumer's `tokenRules` to pick the chip.
48
+ wrap: (u) => {
49
+ const s = W(u), m = a?.find((f) => new RegExp(f.pattern.source, f.pattern.flags.replace("g", "")).test(s));
50
+ if (m?.wrap) {
51
+ const f = new RegExp(m.pattern.source, m.pattern.flags.replace("g", "")).exec(s);
52
+ return m.wrap(s, /* @__PURE__ */ l($, { children: s }), f ?? [s]);
53
+ }
54
+ return m ? /* @__PURE__ */ l("span", { style: m.style, className: m.className, children: /* @__PURE__ */ l($, { children: s }) }) : /* @__PURE__ */ l(J, { m: 0.01, children: /* @__PURE__ */ l($, { children: s }) });
48
55
  }
49
- }], [s]), x = {
50
- search: Y(i),
51
- allowCustomValues: t,
52
- insertToken: (a) => S(Z(i, a)),
56
+ }], [a]), w = {
57
+ search: X(g),
58
+ allowCustomValues: e,
59
+ insertToken: (u) => S(Y(g, u)),
53
60
  registerTag: O
54
61
  };
55
- return /* @__PURE__ */ l(v.Provider, { value: x, children: /* @__PURE__ */ l(L, { ...g, value: i, search: x.search, tokenRules: P, formValidation: r && {
62
+ return /* @__PURE__ */ l(_.Provider, { value: w, children: /* @__PURE__ */ l(U, { ...p, value: g, search: w.search, tokenRules: P, formValidation: r && {
56
63
  valid: r.valid,
57
64
  notValidMessage: r.notValidMessage
58
- }, onChange: S, onSelect: (a) => x.insertToken(String(a)), children: p }) });
59
- }, at = (e) => {
60
- const t = I.c(2);
65
+ }, onChange: S, onSelect: (u) => w.insertToken(String(u)), children: h }) });
66
+ }, ae = (t) => {
67
+ const e = I.c(2);
61
68
  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);
69
+ return e[0] !== t ? (n = /* @__PURE__ */ l(q, { ...t }), e[0] = t, e[1] = n) : n = e[1], n;
70
+ }, ce = (t) => {
71
+ const e = I.c(2);
65
72
  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,
73
+ return e[0] !== t ? (n = /* @__PURE__ */ l(F, { ...t }), e[0] = t, e[1] = n) : n = e[1], n;
74
+ }, ue = ({
75
+ value: t,
76
+ data: e,
70
77
  onlyOnce: n,
71
78
  aliases: r,
72
- children: s
79
+ children: a
73
80
  }) => {
74
81
  const {
75
82
  registerTag: o
76
- } = y(), c = V({
77
- value: e,
78
- data: t,
79
- children: s
83
+ } = D(), c = k({
84
+ value: t,
85
+ data: e,
86
+ children: a
80
87
  });
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);
88
+ return c.current.value = t, c.current.data = e, c.current.children = a, v(() => o(String(t), c.current), [t, o]), /* @__PURE__ */ l(z, { value: V(t), data: e, onlyOnce: n, aliases: [String(t), ...r ?? []], children: a });
89
+ }, le = (t) => {
90
+ const e = I.c(14);
84
91
  let n, r;
85
- t[0] !== e ? ({
92
+ e[0] !== t ? ({
86
93
  onKeyDown: n,
87
94
  ...r
88
- } = e, t[0] = e, t[1] = n, t[2] = r) : (n = t[1], r = t[2]);
95
+ } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
89
96
  const {
90
- search: s,
97
+ search: a,
91
98
  allowCustomValues: o,
92
99
  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);
100
+ } = D();
101
+ let T;
102
+ e[3] !== o || e[4] !== c || e[5] !== a ? (T = () => {
103
+ o && a && c(V(a));
104
+ }, e[3] = o, e[4] = c, e[5] = a, e[6] = T) : T = e[6];
105
+ const h = T;
106
+ let p;
107
+ e[7] !== o || e[8] !== h || e[9] !== n ? (p = (g) => {
108
+ (g.key === "Enter" && !g.defaultPrevented || g.key === "," && o) && (g.preventDefault(), h()), n?.(g);
109
+ }, e[7] = o, e[8] = h, e[9] = n, e[10] = p) : p = e[10];
110
+ let i;
111
+ return e[11] !== r || e[12] !== p ? (i = /* @__PURE__ */ l(H, { ...r, onKeyDown: p }), e[11] = r, e[12] = p, e[13] = i) : i = e[13], i;
112
+ }, ie = (t) => {
113
+ const e = I.c(2);
107
114
  let n;
108
- return t[0] !== e ? (n = /* @__PURE__ */ l(G, { ...e }), t[0] = e, t[1] = n) : n = t[1], n;
115
+ return e[0] !== t ? (n = /* @__PURE__ */ l(G, { ...t }), e[0] = t, e[1] = n) : n = e[1], n;
109
116
  };
110
117
  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
118
+ se as TagInput,
119
+ ae as TagInputMenu,
120
+ ue as TagInputMenuItem,
121
+ ce as TagInputSubMenu,
122
+ ie as TagInputTrigger,
123
+ le as TagInputValue
117
124
  };
@@ -1,19 +1,21 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import a from "react";
3
- import { Input as u } from "./Input.js";
4
- import { IconX as f } from "@tabler/icons-react";
3
+ import { Input as s } from "./Input.js";
4
+ import { IconX as u } from "@tabler/icons-react";
5
5
  import { Button as p } from "../button/Button.js";
6
- import { clearInputElement as s } from "./Input.utils.js";
7
- const R = a.forwardRef((r, t) => {
6
+ import { clearInputElement as h } from "./Input.utils.js";
7
+ const R = a.forwardRef((o, t) => {
8
8
  t = t || a.useRef(null);
9
9
  const {
10
- clearable: i = !1,
11
- right: l,
10
+ clearable: l = !1,
11
+ right: c,
12
12
  ...m
13
- } = r, c = (e) => {
14
- s(t.current), r.onClear && r.onClear(e);
15
- }, n = [l];
16
- return i && n.push(/* @__PURE__ */ o(p, { variant: "none", onClick: (e) => c(e), children: /* @__PURE__ */ o(f, { size: 13 }) })), /* @__PURE__ */ o(u, { right: n, type: "textarea", ref: t, ...m });
13
+ } = o, f = (r) => {
14
+ h(t.current), o.onClear && o.onClear(r);
15
+ }, n = [c];
16
+ l && n.push(/* @__PURE__ */ e(p, { variant: "none", onClick: (r) => f(r), children: /* @__PURE__ */ e(u, { size: 13 }) }));
17
+ const i = n.filter(Boolean);
18
+ return /* @__PURE__ */ e(s, { right: i.length > 0 ? i : void 0, type: "textarea", ref: t, ...m });
17
19
  });
18
20
  export {
19
21
  R as TextAreaInput
@@ -1,20 +1,22 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import i from "react";
3
- import { Input as p } from "./Input.js";
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import l from "react";
3
+ import { Input as s } from "./Input.js";
4
4
  import { IconX as u } from "@tabler/icons-react";
5
5
  import { Button as f } from "../button/Button.js";
6
- import { clearInputElement as s } from "./Input.utils.js";
7
- import { ButtonGroup as d } from "../button-group/ButtonGroup.js";
8
- const b = i.forwardRef((o, t) => {
9
- t = t || i.useRef(null);
6
+ import { clearInputElement as d } from "./Input.utils.js";
7
+ import { ButtonGroup as h } from "../button-group/ButtonGroup.js";
8
+ const b = l.forwardRef((r, t) => {
9
+ t = t || l.useRef(null);
10
10
  const {
11
- clearable: l = !1,
12
- right: c,
13
- ...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 });
11
+ clearable: c = !1,
12
+ right: m,
13
+ ...a
14
+ } = r, p = (e) => {
15
+ d(t.current), r.onClear && r.onClear(e);
16
+ }, n = [m];
17
+ c && n.push(/* @__PURE__ */ o(f, { color: "secondary", paddingSize: "xxs", onClick: (e) => p(e), children: /* @__PURE__ */ o(u, { size: 13 }) }));
18
+ const i = n.filter(Boolean);
19
+ return /* @__PURE__ */ o(s, { right: i.length > 0 ? /* @__PURE__ */ o(h, { color: "primary", children: i }) : void 0, type: "text", ref: t, ...a });
18
20
  });
19
21
  export {
20
22
  b as TextInput
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {