@code0-tech/pictor 0.5.1 → 0.6.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.
@@ -1 +1 @@
1
- .input{display:flex;z-index:1;align-items:center;box-sizing:border-box}.input{background:#191825;box-shadow:inset 0 1px 1px #ffffff1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.input:hover{background:#bfbfbf26;box-shadow:inset 0 1px 1px #ffffff1a}.input:active,.input:focus,.input[aria-selected=true],.input[data-state=open]{background:#bfbfbf33;box-shadow:inset 0 1px 1px #ffffff1a;outline:none}.input{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border-radius:1rem}.input:has(.input__control:focus),.input:has(.input__control[contenteditable=true]:focus){background:#bfbfbf33;box-shadow:inset 0 1px 1px #ffffff1a;outline:none}.input--not-valid{background:#1c0516;box-shadow:inset 0 1px 1px #d904291a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.input__left,.input__right{display:flex;align-items:stretch;margin:.175rem;gap:.7rem}.input__left>button,.input__right>button{height:100%;padding-left:0;padding-right:0}.input__left--action,.input__right--action{padding:0}.input__left--placeholder,.input__right--placeholder{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border-radius:.825rem;padding:.7rem;box-shadow:none}.input__left{padding-left:.7rem}.input__left--icon{align-items:center}.input__right{padding-right:.7rem}.input__right--icon{align-items:center}.input__control{background:none;box-shadow:none;border:none;outline:none;margin:.7rem;vertical-align:middle;flex:1;width:100%;font-size:.8rem;box-sizing:border-box;color:#ffffff80}.input__control{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__token{display:inline-flex;align-items:center;vertical-align:middle;user-select:none;-webkit-user-select:none;-moz-user-select:none}.input__label{text-transform:uppercase;color:#ffffff80;font-size:.7rem;display:block}.input__label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__description{color:#ffffff80;font-size:.8rem;margin:.35rem 0 .7rem;display:block}.input__description{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__message{padding:.7rem;z-index:0;display:flex;align-items:center;font-size:.7rem;gap:.35rem;margin-top:.7rem}.input__message{background:#1c0516;box-shadow:inset 0 1px 1px #d904291a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;box-shadow:none}.input__message>svg{width:.8rem;height:.8rem}.pin-input{display:flex;justify-content:space-between;gap:.7rem;position:relative;background:transparent}.pin-input__field{flex:1;width:100%;aspect-ratio:1/1;text-align:center}.number-input::-webkit-outer-spin-button,.number-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number-input[type=number]{-moz-appearance:textfield}.radio-input{background:transparent!important;box-shadow:none!important;display:flex;align-items:center;box-sizing:border-box;gap:.35rem;position:relative}.radio-input__button{top:-1px;width:18px;height:18px;padding:.35rem}.radio-input__button{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.radio-input__button:active,.radio-input__button:focus,.radio-input__button[aria-selected=true],.radio-input__button[data-state=open]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.radio-input__button{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.radio-input__button:disabled,.radio-input__button[data-disabled],.radio-input__button[aria-disabled=true],.radio-input__button--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.radio-input__button{border-radius:1rem}.radio-input__button[data-state=checked]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.radio-input__indicator{height:100%;position:relative;display:block;aspect-ratio:1/1}.radio-input__indicator[data-state=checked]{background-color:#70ffb2}.radio-input__indicator[data-state=checked]{border-radius:1rem}.radio-button{padding:0;display:inline-flex}.checkbox-input{background:transparent!important;box-shadow:none!important;align-items:center;box-sizing:border-box;gap:.35rem}.checkbox-input__button{aspect-ratio:1/1;width:1.3rem;height:1.3rem;display:flex;align-items:center;justify-content:center;border-radius:.35rem;cursor:pointer}.checkbox-input__button{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.checkbox-input__button:active,.checkbox-input__button:focus,.checkbox-input__button[aria-selected=true],.checkbox-input__button[data-state=open]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.checkbox-input__button{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.checkbox-input__button:disabled,.checkbox-input__button[data-disabled],.checkbox-input__button[aria-disabled=true],.checkbox-input__button--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.checkbox-input__indicator{position:relative;display:flex;align-items:center;justify-content:center;top:1px;color:#70ffb2}.switch-input{box-shadow:none!important;background:transparent!important;width:fit-content}.switch-input .input__control{position:relative;box-sizing:border-box;padding:0;margin:0;height:16px;width:0;appearance:none;outline:none;cursor:pointer;background-color:transparent;border-radius:50%}.switch-input .input__control:checked:after{-webkit-transform:translateX(22px);-ms-transform:translateX(22px);transform:translate(22px);-webkit-transition:.4s;transition:.4s}.switch-input .input__control:checked:before{background:#121e24;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;position:absolute;width:2.6rem;height:1.25rem}.switch-input .input__control:after{width:.9rem;height:.9rem;background-color:#fff;border-radius:50%;position:absolute;content:"";-webkit-transition:.4s;transition:.4s}.switch-input .input__control:before{content:"";z-index:-1;-webkit-transition:.4s;transition:.4s;top:-.175rem;left:-.175rem}.switch-input .input__control:before{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;position:absolute;width:2.6rem;height:1.25rem}
1
+ .input{display:flex;z-index:1;align-items:center;box-sizing:border-box}.input{background:#201e2c;box-shadow:inset 0 1px 1px #ffffff1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.input:hover{background:#bfbfbf26;box-shadow:inset 0 1px 1px #ffffff1a}.input:active,.input:focus,.input[aria-selected=true],.input[data-state=open]{background:#bfbfbf33;box-shadow:inset 0 1px 1px #ffffff1a;outline:none}.input{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border-radius:1rem}.input:has(.input__control:focus),.input:has(.input__control[contenteditable=true]:focus){background:#bfbfbf33;box-shadow:inset 0 1px 1px #ffffff1a;outline:none}.input--not-valid{background:#1c0516;box-shadow:inset 0 1px 1px #d904291a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.input__left,.input__right{display:flex;align-items:stretch;margin:.175rem;gap:.7rem}.input__left>button,.input__right>button{height:100%;padding-left:0;padding-right:0}.input__left--action,.input__right--action{padding:0}.input__left--placeholder,.input__right--placeholder{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;border-radius:.825rem;padding:.7rem;box-shadow:none}.input__left{padding-left:.7rem}.input__left--icon{align-items:center}.input__right{padding-right:.7rem}.input__right--icon{align-items:center}.input__control{background:none;box-shadow:none;border:none;outline:none;margin:.7rem;vertical-align:middle;flex:1;width:100%;font-size:.8rem;box-sizing:border-box;color:#ffffff80}.input__control{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__token{display:inline-flex;align-items:center;vertical-align:middle;user-select:none;-webkit-user-select:none;-moz-user-select:none}.input__label{text-transform:uppercase;color:#ffffff80;font-size:.7rem;display:block}.input__label{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__description{color:#ffffff80;font-size:.8rem;margin:.35rem 0 .7rem;display:block}.input__description{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.input__message{z-index:0;display:flex;align-items:center;font-size:.8rem;gap:.35rem;margin-top:.7rem}.input__message{border-radius:1rem;font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px;box-shadow:none}.input__message>svg{width:1rem;height:1rem}.pin-input{display:flex;justify-content:space-between;gap:.7rem;position:relative;background:transparent}.pin-input__field{flex:1;width:100%;aspect-ratio:1/1;text-align:center}.number-input::-webkit-outer-spin-button,.number-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.number-input[type=number]{-moz-appearance:textfield}.radio-input{background:transparent!important;box-shadow:none!important;display:flex;align-items:center;box-sizing:border-box;gap:.35rem;position:relative}.radio-input__button{top:-1px;width:18px;height:18px;padding:.35rem}.radio-input__button{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.radio-input__button:active,.radio-input__button:focus,.radio-input__button[aria-selected=true],.radio-input__button[data-state=open]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.radio-input__button{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.radio-input__button:disabled,.radio-input__button[data-disabled],.radio-input__button[aria-disabled=true],.radio-input__button--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.radio-input__button{border-radius:1rem}.radio-input__button[data-state=checked]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.radio-input__indicator{height:100%;position:relative;display:block;aspect-ratio:1/1}.radio-input__indicator[data-state=checked]{background-color:#70ffb2}.radio-input__indicator[data-state=checked]{border-radius:1rem}.radio-button{padding:0;display:inline-flex}.checkbox-input{background:transparent!important;box-shadow:none!important;align-items:center;box-sizing:border-box;gap:.35rem}.checkbox-input__button{aspect-ratio:1/1;width:1.3rem;height:1.3rem;display:flex;align-items:center;justify-content:center;border-radius:.35rem;cursor:pointer}.checkbox-input__button{font-family:Inter,sans-serif;font-weight:400;letter-spacing:-.5px}.checkbox-input__button:active,.checkbox-input__button:focus,.checkbox-input__button[aria-selected=true],.checkbox-input__button[data-state=open]{background:#2c2a36;box-shadow:inset 0 1px 1px #bfbfbf1a;outline:none}.checkbox-input__button{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box}.checkbox-input__button:disabled,.checkbox-input__button[data-disabled],.checkbox-input__button[aria-disabled=true],.checkbox-input__button--disabled{cursor:not-allowed;opacity:25%;pointer-events:unset}.checkbox-input__indicator{position:relative;display:flex;align-items:center;justify-content:center;top:1px;color:#70ffb2}.switch-input{box-shadow:none!important;background:transparent!important;width:fit-content}.switch-input .input__control{position:relative;box-sizing:border-box;padding:0;margin:0;height:16px;width:0;appearance:none;outline:none;cursor:pointer;background-color:transparent;border-radius:50%}.switch-input .input__control:checked:after{-webkit-transform:translateX(22px);-ms-transform:translateX(22px);transform:translate(22px);-webkit-transition:.4s;transition:.4s}.switch-input .input__control:checked:before{background:#121e24;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;position:absolute;width:2.6rem;height:1.25rem}.switch-input .input__control:after{width:.9rem;height:.9rem;background-color:#fff;border-radius:50%;position:absolute;content:"";-webkit-transition:.4s;transition:.4s}.switch-input .input__control:before{content:"";z-index:-1;-webkit-transition:.4s;transition:.4s;top:-.175rem;left:-.175rem}.switch-input .input__control:before{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;position:absolute;width:2.6rem;height:1.25rem}
@@ -1,17 +1,17 @@
1
- import { jsx as c, jsxs as i } from "react/jsx-runtime";
2
- import { c as m } from "../../_virtual/compiler-runtime.js";
3
- import { IconExclamationCircle as n } from "@tabler/icons-react";
1
+ import { jsx as c, jsxs as m } from "react/jsx-runtime";
2
+ import { c as n } from "../../_virtual/compiler-runtime.js";
3
+ import { IconX as i } from "@tabler/icons-react";
4
4
  const f = (r) => {
5
- const e = m.c(3), {
6
- children: o
5
+ const e = n.c(3), {
6
+ children: t
7
7
  } = r;
8
8
  let s;
9
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ c(n, { size: 16 }), e[0] = s) : s = e[0];
10
- let t;
11
- return e[1] !== o ? (t = /* @__PURE__ */ i("span", { className: "input__message", children: [
9
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ c(i, { size: 16, color: "#D90429" }), e[0] = s) : s = e[0];
10
+ let o;
11
+ return e[1] !== t ? (o = /* @__PURE__ */ m("span", { className: "input__message", children: [
12
12
  s,
13
- o
14
- ] }), e[1] = o, e[2] = t) : t = e[2], t;
13
+ t
14
+ ] }), e[1] = t, e[2] = o) : o = e[2], o;
15
15
  };
16
16
  export {
17
17
  f as InputMessage
@@ -5,4 +5,5 @@ interface PasswordInputProps extends Omit<InputProps<string | null>, "wrapperCom
5
5
  visible?: boolean;
6
6
  }
7
7
  export declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps>;
8
+ export declare const passwordValidation: (value: string | null) => string | null;
8
9
  export {};
@@ -1,19 +1,68 @@
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);
1
+ import { jsxs as l, Fragment as M, jsx as t } from "react/jsx-runtime";
2
+ import p from "react";
3
+ import { Input as V } from "./Input.js";
4
+ import { IconX as s, IconCheck as c, IconEye as x } from "@tabler/icons-react";
5
+ import { Button as u } from "../button/Button.js";
6
+ import { clearInputElement as D } from "./Input.utils.js";
7
+ import { Flex as o } from "../flex/Flex.js";
8
+ import { Text as a } from "../text/Text.js";
9
+ const E = p.forwardRef((n, e) => {
10
+ e = e || p.useRef(null);
9
11
  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
- });
12
+ clearable: m = !0,
13
+ visible: g = !0,
14
+ right: h,
15
+ formValidation: r,
16
+ ...f
17
+ } = n, z = (i) => (D(e.current), i.stopPropagation(), i.preventDefault(), !1), y = (i) => (e.current instanceof HTMLInputElement && (e.current.type === "password" ? e.current.type = "text" : e.current.type === "text" && (e.current.type = "password")), i.stopPropagation(), i.preventDefault(), !1), d = [h];
18
+ return g && d.push(/* @__PURE__ */ t(u, { variant: "none", onClick: (i) => y(i), children: /* @__PURE__ */ t(x, { size: 13 }) })), m && d.push(/* @__PURE__ */ t(u, { variant: "none", onClick: (i) => z(i), children: /* @__PURE__ */ t(s, { size: 13 }) })), /* @__PURE__ */ l(M, { children: [
19
+ /* @__PURE__ */ t(V, { right: d, rightType: "action", type: "password", ref: e, ...r ? {
20
+ formValidation: {
21
+ setValue: r.setValue,
22
+ valid: r.valid
23
+ }
24
+ } : {}, ...f }),
25
+ !r?.valid && /* @__PURE__ */ l(o, { mt: 0.7, style: {
26
+ flexDirection: "column"
27
+ }, children: [
28
+ /* @__PURE__ */ l(o, { align: "center", style: {
29
+ gap: "0.35rem"
30
+ }, children: [
31
+ r?.notValidMessage?.includes("1") ? /* @__PURE__ */ t(s, { color: "#D90429", size: 16 }) : /* @__PURE__ */ t(c, { color: "#29BF12", size: 16 }),
32
+ /* @__PURE__ */ t(a, { children: "Must be at least 8 characters" })
33
+ ] }),
34
+ /* @__PURE__ */ l(o, { align: "center", style: {
35
+ gap: "0.35rem"
36
+ }, children: [
37
+ r?.notValidMessage?.includes("2") ? /* @__PURE__ */ t(s, { color: "#D90429", size: 16 }) : /* @__PURE__ */ t(c, { color: "#29BF12", size: 16 }),
38
+ /* @__PURE__ */ t(a, { children: "Must include a lowercase letter" })
39
+ ] }),
40
+ /* @__PURE__ */ l(o, { align: "center", style: {
41
+ gap: "0.35rem"
42
+ }, children: [
43
+ r?.notValidMessage?.includes("3") ? /* @__PURE__ */ t(s, { color: "#D90429", size: 16 }) : /* @__PURE__ */ t(c, { color: "#29BF12", size: 16 }),
44
+ /* @__PURE__ */ t(a, { children: "Must include an uppercase letter" })
45
+ ] }),
46
+ /* @__PURE__ */ l(o, { align: "center", style: {
47
+ gap: "0.35rem"
48
+ }, children: [
49
+ r?.notValidMessage?.includes("4") ? /* @__PURE__ */ t(s, { color: "#D90429", size: 16 }) : /* @__PURE__ */ t(c, { color: "#29BF12", size: 16 }),
50
+ /* @__PURE__ */ t(a, { children: "Must include a number" })
51
+ ] }),
52
+ /* @__PURE__ */ l(o, { align: "center", style: {
53
+ gap: "0.35rem"
54
+ }, children: [
55
+ r?.notValidMessage?.includes("5") ? /* @__PURE__ */ t(s, { color: "#D90429", size: 16 }) : /* @__PURE__ */ t(c, { color: "#29BF12", size: 16 }),
56
+ /* @__PURE__ */ t(a, { children: "Must include a special character" })
57
+ ] })
58
+ ] })
59
+ ] });
60
+ }), P = (n) => {
61
+ if (!n) return "12345";
62
+ let e = null;
63
+ return n.length < 8 && (e = (e ?? "") + "1"), /[a-z]/.test(n) || (e = (e ?? "") + "2"), /[A-Z]/.test(n) || (e = (e ?? "") + "3"), /[0-9]/.test(n) || (e = (e ?? "") + "4"), /[^A-Za-z0-9]/.test(n) || (e = (e ?? "") + "5"), e;
64
+ };
17
65
  export {
18
- C as PasswordInput
66
+ E as PasswordInput,
67
+ P as passwordValidation
19
68
  };
@@ -1,25 +1,25 @@
1
1
  import { CheckboxInput as r } from "./CheckboxInput.js";
2
2
  import { EmailInput as p, emailValidation as n } from "./EmailInput.js";
3
3
  import { Input as m } from "./Input.js";
4
- import { InputDescription as f } from "./InputDescription.js";
4
+ import { InputDescription as i } from "./InputDescription.js";
5
5
  import { InputLabel as I } from "./InputLabel.js";
6
6
  import { InputMessage as d } from "./InputMessage.js";
7
7
  import { InputSuggestionMenuContent as l, InputSuggestionMenuContentItems as g } from "./InputSuggestion.js";
8
8
  import { NumberInput as P } from "./NumberInput.js";
9
- import { PasswordInput as c } from "./PasswordInput.js";
9
+ import { PasswordInput as c, passwordValidation as w } from "./PasswordInput.js";
10
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";
11
+ import { RadioGroup as R } from "./RadioGroup.js";
12
+ import { RadioInput as V } from "./RadioInput.js";
13
13
  import { SwitchInput as y } from "./SwitchInput.js";
14
14
  import { TextAreaInput as E } from "./TextAreaInput.js";
15
15
  import { TextInput as H } from "./TextInput.js";
16
16
  import { useForm as N } from "./useForm.js";
17
- import { buildDefaultSyntax as j } from "./Input.syntax.hook.js";
17
+ import { buildDefaultSyntax as q } from "./Input.syntax.hook.js";
18
18
  export {
19
19
  r as CheckboxInput,
20
20
  p as EmailInput,
21
21
  m as Input,
22
- f as InputDescription,
22
+ i as InputDescription,
23
23
  I as InputLabel,
24
24
  d as InputMessage,
25
25
  l as InputSuggestionMenuContent,
@@ -29,12 +29,13 @@ export {
29
29
  F as PinInput,
30
30
  M as PinInputField,
31
31
  h as PinInputHiddenField,
32
- D as RadioGroup,
33
- T as RadioInput,
32
+ R as RadioGroup,
33
+ V as RadioInput,
34
34
  y as SwitchInput,
35
35
  E as TextAreaInput,
36
36
  H as TextInput,
37
- j as buildDefaultSyntax,
37
+ q as buildDefaultSyntax,
38
38
  n as emailValidation,
39
+ w as passwordValidation,
39
40
  N as useForm
40
41
  };
@@ -22,7 +22,7 @@ export interface ValidationProps<Value> {
22
22
  export type ValidationsProps<Values> = Partial<{
23
23
  [Key in keyof Values]: ValidationProps<Values[Key]>;
24
24
  }>;
25
- export type FormValidationReturn<Values> = [IValidation<Values>, () => void];
25
+ export type FormValidationReturn<Values> = [IValidation<Values>, <Key extends keyof Values>(key?: Key | any) => void];
26
26
  export interface IValidation<Values> {
27
27
  getInputProps<Key extends keyof Values>(key: Key): ValidationProps<Values[Key]>;
28
28
  isValid(): boolean;
@@ -1,24 +1,24 @@
1
- import { useState as v, useRef as w, useEffect as S, useCallback as m, useMemo as F } from "react";
2
- function c(r, t, e) {
3
- return (t = _(t)) in r ? Object.defineProperty(r, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = e, r;
1
+ import { useState as g, useRef as p, useCallback as m, useEffect as j } from "react";
2
+ function o(i, t, e) {
3
+ return (t = P(t)) in i ? Object.defineProperty(i, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : i[t] = e, i;
4
4
  }
5
- function _(r) {
6
- var t = j(r, "string");
5
+ function P(i) {
6
+ var t = y(i, "string");
7
7
  return typeof t == "symbol" ? t : t + "";
8
8
  }
9
- function j(r, t) {
10
- if (typeof r != "object" || !r) return r;
11
- var e = r[Symbol.toPrimitive];
9
+ function y(i, t) {
10
+ if (typeof i != "object" || !i) return i;
11
+ var e = i[Symbol.toPrimitive];
12
12
  if (e !== void 0) {
13
- var i = e.call(r, t);
14
- if (typeof i != "object") return i;
13
+ var a = e.call(i, t);
14
+ if (typeof a != "object") return a;
15
15
  throw new TypeError("@@toPrimitive must return a primitive value.");
16
16
  }
17
- return (t === "string" ? String : Number)(r);
17
+ return (t === "string" ? String : Number)(i);
18
18
  }
19
- class g {
20
- constructor(t, e, i, n = !0) {
21
- c(this, "changeValue", void 0), c(this, "currentValues", void 0), c(this, "currentValidations", void 0), c(this, "shouldValidate", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = i, this.shouldValidate = n;
19
+ class b {
20
+ constructor(t, e, a, u = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map()) {
21
+ o(this, "changeValue", void 0), o(this, "currentValues", void 0), o(this, "currentValidations", void 0), o(this, "shouldValidate", void 0), o(this, "cachedMessages", void 0), this.changeValue = t, this.currentValues = e, this.currentValidations = a, this.shouldValidate = u, this.cachedMessages = r;
22
22
  }
23
23
  isValid() {
24
24
  if (!this.currentValidations) return !0;
@@ -30,17 +30,18 @@ class g {
30
30
  return !0;
31
31
  }
32
32
  getInputProps(t) {
33
- const e = this.currentValues[t], i = e ?? null, n = t, u = this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (s) => null, a = this.shouldValidate ? u(e, this.currentValues) : null;
34
- return {
33
+ const e = this.currentValues[t], a = e ?? null, u = t, r = this.currentValidations && this.currentValidations[t] ? this.currentValidations[t] : (l) => null;
34
+ let s = null;
35
+ return this.shouldValidate.has(t) ? (s = r(e, this.currentValues), this.cachedMessages.set(t, s)) : s = this.cachedMessages.get(t) ?? null, {
35
36
  // @ts-ignore – z.B. wenn dein Input `defaultValue` kennt
36
- defaultValue: i,
37
- initialValue: i ?? void 0,
37
+ defaultValue: a,
38
+ initialValue: a ?? void 0,
38
39
  formValidation: {
39
- setValue: (s) => {
40
- this.changeValue(n, s);
40
+ setValue: (l) => {
41
+ this.changeValue(u, l);
41
42
  },
42
- notValidMessage: a,
43
- valid: a === null
43
+ notValidMessage: s,
44
+ valid: s === null
44
45
  },
45
46
  ...this.currentValidations && this.currentValidations[t] ? {
46
47
  required: !0
@@ -48,31 +49,31 @@ class g {
48
49
  };
49
50
  }
50
51
  }
51
- const E = (r) => {
52
+ const F = (i) => {
52
53
  const {
53
54
  initialValues: t,
54
55
  validate: e = {},
55
- truthyValidationBeforeSubmit: i = !0,
56
- useInitialValidation: n = !0,
57
- onSubmit: u
58
- } = r, [a, s] = v(t), [V, h] = v(!1), o = w(t);
59
- S(() => {
60
- s(t), h(!1), o.current = t;
61
- }, [t]);
62
- const l = m((d, y) => {
63
- h(!0), s((P) => {
64
- const f = {
65
- ...P,
66
- [d]: y
56
+ truthyValidationBeforeSubmit: a = !0,
57
+ useInitialValidation: u = !0,
58
+ onSubmit: r
59
+ } = i, [s, l] = g(t), c = p(t), v = p(/* @__PURE__ */ new Map()), V = m((n, f) => {
60
+ l((d) => {
61
+ const h = {
62
+ ...d,
63
+ [n]: f
67
64
  };
68
- return o.current = f, f;
65
+ return c.current = h, h;
69
66
  });
70
- }, []), b = F(() => new g(l, a, e, n || V), [l, a, e, n, V]), p = m(() => {
71
- const d = new g(l, o.current, e, !0);
72
- u && (!i || d.isValid()) && u(o.current);
73
- }, [l, e, u, i]);
74
- return [b, p];
67
+ }, []), [w, M] = g(new b(V, s, e, u ? new Map(Object.keys(t).map((n) => [n, !0])) : /* @__PURE__ */ new Map(), v.current));
68
+ j(() => {
69
+ l(t), c.current = t;
70
+ }, [t]);
71
+ const S = m((n) => {
72
+ const f = n && new Set(Object.keys(t)).has(String(n)) ? /* @__PURE__ */ new Map([[n, !0]]) : new Map(Object.keys(t).map((h) => [String(h), !0])), d = new b(V, c.current, e, f, v.current);
73
+ M(d), !new Set(Object.keys(t)).has(String(n)) && r && (!a || d.isValid()) && r(c.current);
74
+ }, [V, e, r, a, t]);
75
+ return [w, S];
75
76
  };
76
77
  export {
77
- E as useForm
78
+ F as useForm
78
79
  };
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import { Breadcrumb as x } from "./components/breadcrumb/Breadcrumb.js";
6
6
  import { Button as f } from "./components/button/Button.js";
7
7
  import { ButtonGroup as g } from "./components/button-group/ButtonGroup.js";
8
8
  import { Card as b } from "./components/card/Card.js";
9
- import { Col as T } from "./components/col/Col.js";
10
- import { Command as s, CommandDialog as M, CommandEmpty as I, CommandGroup as D, CommandInput as A, CommandItem as v, CommandList as F, CommandSeparator as P, CommandShortcut as R } from "./components/command/Command.js";
11
- import { Container as L } from "./components/container/Container.js";
12
- import { ContextMenu as w, ContextMenuArrow as G, ContextMenuContent as z, ContextMenuGroup as B, ContextMenuItem as O, ContextMenuLabel as k, ContextMenuPortal as E, ContextMenuSeparator as H, ContextMenuSub as N, ContextMenuSubContent as j, ContextMenuSubTrigger as Q, ContextMenuTrigger as V } from "./components/context-menu/ContextMenu.js";
9
+ import { Col as d } from "./components/col/Col.js";
10
+ import { Command as T, CommandDialog as M, CommandEmpty as I, CommandGroup as D, CommandInput as A, CommandItem as v, CommandList as F, CommandSeparator as P, CommandShortcut as R } from "./components/command/Command.js";
11
+ import { Container as w } from "./components/container/Container.js";
12
+ import { ContextMenu as h, ContextMenuArrow as G, ContextMenuContent as z, ContextMenuGroup as B, ContextMenuItem as O, ContextMenuLabel as k, ContextMenuPortal as E, ContextMenuSeparator as H, ContextMenuSub as N, ContextMenuSubContent as V, ContextMenuSubTrigger as j, ContextMenuTrigger as Q } from "./components/context-menu/ContextMenu.js";
13
13
  import { DataTable as q } from "./components/data-table/DataTable.js";
14
14
  import { DataTableColumn as K } from "./components/data-table/DataTableColumn.js";
15
15
  import { DataTableFilterInput as W, createFilterQueryLanguage as X } from "./components/data-table/DataTableFilterInput.js";
@@ -17,44 +17,44 @@ import { DataTableFilterSuggestionMenu as _ } from "./components/data-table/Data
17
17
  import { Dialog as ee, DialogClose as oe, DialogContent as re, DialogDescription as te, DialogFooter as ne, DialogHeader as ae, DialogOverlay as pe, DialogPortal as me, DialogTitle as ue, DialogTrigger as ie } from "./components/dialog/Dialog.js";
18
18
  import { Editor as le } from "./components/editor/Editor.js";
19
19
  import { FileTabsService as Ce } from "./components/file-tabs/FileTabs.service.js";
20
- import { FileTabs as Se, FileTabsContent as be, FileTabsList as ce, FileTabsTrigger as Te } from "./components/file-tabs/FileTabs.js";
21
- import { Flex as se } from "./components/flex/Flex.js";
20
+ import { FileTabs as Se, FileTabsContent as be, FileTabsList as ce, FileTabsTrigger as de } from "./components/file-tabs/FileTabs.js";
21
+ import { Flex as Te } from "./components/flex/Flex.js";
22
22
  import { CheckboxInput as Ie } from "./components/form/CheckboxInput.js";
23
23
  import { EmailInput as Ae, emailValidation as ve } from "./components/form/EmailInput.js";
24
24
  import { Input as Pe } from "./components/form/Input.js";
25
25
  import { InputDescription as ye } from "./components/form/InputDescription.js";
26
- import { InputLabel as he } from "./components/form/InputLabel.js";
26
+ import { InputLabel as Le } from "./components/form/InputLabel.js";
27
27
  import { InputMessage as Ge } from "./components/form/InputMessage.js";
28
28
  import { InputSuggestionMenuContent as Be, InputSuggestionMenuContentItems as Oe } from "./components/form/InputSuggestion.js";
29
29
  import { NumberInput as Ee } from "./components/form/NumberInput.js";
30
- import { PasswordInput as Ne } from "./components/form/PasswordInput.js";
31
- import { PinInput as Qe, PinInputField as Ve, PinInputHiddenField as Ze } from "./components/form/PinInput.js";
32
- import { RadioGroup as Je } from "./components/form/RadioGroup.js";
33
- import { RadioInput as Ue } from "./components/form/RadioInput.js";
34
- import { SwitchInput as Xe } from "./components/form/SwitchInput.js";
35
- import { TextAreaInput as _e } from "./components/form/TextAreaInput.js";
36
- import { TextInput as eo } from "./components/form/TextInput.js";
37
- import { useForm as ro } from "./components/form/useForm.js";
38
- import { buildDefaultSyntax as no } from "./components/form/Input.syntax.hook.js";
39
- import { FullScreen as po } from "./components/fullscreen/FullScreen.js";
40
- import { Layout as uo } from "./components/layout/Layout.js";
41
- import { Menu as xo, MenuArrow as lo, MenuCheckboxItem as fo, MenuContent as Co, MenuGroup as go, MenuItem as So, MenuItemIndicator as bo, MenuLabel as co, MenuPortal as To, MenuSeparator as so, MenuSub as Mo, MenuSubContent as Io, MenuSubTrigger as Do, MenuTrigger as Ao } from "./components/menu/Menu.js";
42
- import { Quote as Fo } from "./components/quote/Quote.js";
43
- import { ResizableHandle as Ro, ResizablePanel as yo, ResizablePanelGroup as Lo } from "./components/resizable/Resizable.js";
44
- import { Row as wo } from "./components/row/Row.js";
45
- import { ScrollArea as zo, ScrollAreaCorner as Bo, ScrollAreaScrollbar as Oo, ScrollAreaThumb as ko, ScrollAreaViewport as Eo } from "./components/scroll-area/ScrollArea.js";
46
- import { SegmentedControl as No, SegmentedControlItem as jo } from "./components/segmented-control/SegmentedControl.js";
47
- import { Spacing as Vo } from "./components/spacing/Spacing.js";
48
- import { Tab as qo, TabContent as Jo, TabList as Ko, TabTrigger as Uo } from "./components/tab/Tab.js";
49
- import { Text as Xo } from "./components/text/Text.js";
50
- import { Toast as _o, toast as $o } from "./components/toast/Toast.js";
51
- import { Tooltip as or, TooltipArrow as rr, TooltipContent as tr, TooltipPortal as nr, TooltipTrigger as ar } from "./components/tooltip/Tooltip.js";
52
- import { ContextStore as mr, ContextStoreProvider as ur, useService as ir, useStore as xr } from "./utils/contextStore.js";
53
- import { NonReactiveArrayService as fr, createNonReactiveArrayService as Cr } from "./utils/nonReactiveArrayService.js";
54
- import { ObjectService as Sr, createObjectService as br } from "./utils/objectStore.js";
55
- import { ReactiveArrayService as Tr, useReactiveArrayService as dr } from "./utils/reactiveArrayService.js";
56
- import { Colors as Mr } from "./utils/types.js";
57
- import { getDOMSizeFromCodeZeroSize as Dr, hashToColor as Ar, mergeCode0Props as vr } from "./utils/utils.js";
30
+ import { PasswordInput as Ne, passwordValidation as Ve } from "./components/form/PasswordInput.js";
31
+ import { PinInput as Qe, PinInputField as Ze, PinInputHiddenField as qe } from "./components/form/PinInput.js";
32
+ import { RadioGroup as Ke } from "./components/form/RadioGroup.js";
33
+ import { RadioInput as We } from "./components/form/RadioInput.js";
34
+ import { SwitchInput as Ye } from "./components/form/SwitchInput.js";
35
+ import { TextAreaInput as $e } from "./components/form/TextAreaInput.js";
36
+ import { TextInput as oo } from "./components/form/TextInput.js";
37
+ import { useForm as to } from "./components/form/useForm.js";
38
+ import { buildDefaultSyntax as ao } from "./components/form/Input.syntax.hook.js";
39
+ import { FullScreen as mo } from "./components/fullscreen/FullScreen.js";
40
+ import { Layout as io } from "./components/layout/Layout.js";
41
+ import { Menu as lo, MenuArrow as fo, MenuCheckboxItem as Co, MenuContent as go, MenuGroup as So, MenuItem as bo, MenuItemIndicator as co, MenuLabel as so, MenuPortal as To, MenuSeparator as Mo, MenuSub as Io, MenuSubContent as Do, MenuSubTrigger as Ao, MenuTrigger as vo } from "./components/menu/Menu.js";
42
+ import { Quote as Po } from "./components/quote/Quote.js";
43
+ import { ResizableHandle as yo, ResizablePanel as wo, ResizablePanelGroup as Lo } from "./components/resizable/Resizable.js";
44
+ import { Row as Go } from "./components/row/Row.js";
45
+ import { ScrollArea as Bo, ScrollAreaCorner as Oo, ScrollAreaScrollbar as ko, ScrollAreaThumb as Eo, ScrollAreaViewport as Ho } from "./components/scroll-area/ScrollArea.js";
46
+ import { SegmentedControl as Vo, SegmentedControlItem as jo } from "./components/segmented-control/SegmentedControl.js";
47
+ import { Spacing as Zo } from "./components/spacing/Spacing.js";
48
+ import { Tab as Jo, TabContent as Ko, TabList as Uo, TabTrigger as Wo } from "./components/tab/Tab.js";
49
+ import { Text as Yo } from "./components/text/Text.js";
50
+ import { Toast as $o, toast as er } from "./components/toast/Toast.js";
51
+ import { Tooltip as rr, TooltipArrow as tr, TooltipContent as nr, TooltipPortal as ar, TooltipTrigger as pr } from "./components/tooltip/Tooltip.js";
52
+ import { ContextStore as ur, ContextStoreProvider as ir, useService as xr, useStore as lr } from "./utils/contextStore.js";
53
+ import { NonReactiveArrayService as Cr, createNonReactiveArrayService as gr } from "./utils/nonReactiveArrayService.js";
54
+ import { ObjectService as br, createObjectService as cr } from "./utils/objectStore.js";
55
+ import { ReactiveArrayService as sr, useReactiveArrayService as Tr } from "./utils/reactiveArrayService.js";
56
+ import { Colors as Ir } from "./utils/types.js";
57
+ import { getDOMSizeFromCodeZeroSize as Ar, hashToColor as vr, mergeCode0Props as Fr } from "./utils/utils.js";
58
58
  export {
59
59
  r as Alert,
60
60
  n as AuroraBackground,
@@ -65,9 +65,9 @@ export {
65
65
  g as ButtonGroup,
66
66
  b as Card,
67
67
  Ie as CheckboxInput,
68
- T as Col,
69
- Mr as Colors,
70
- s as Command,
68
+ d as Col,
69
+ Ir as Colors,
70
+ T as Command,
71
71
  M as CommandDialog,
72
72
  I as CommandEmpty,
73
73
  D as CommandGroup,
@@ -76,8 +76,8 @@ export {
76
76
  F as CommandList,
77
77
  P as CommandSeparator,
78
78
  R as CommandShortcut,
79
- L as Container,
80
- w as ContextMenu,
79
+ w as Container,
80
+ h as ContextMenu,
81
81
  G as ContextMenuArrow,
82
82
  z as ContextMenuContent,
83
83
  B as ContextMenuGroup,
@@ -86,11 +86,11 @@ export {
86
86
  E as ContextMenuPortal,
87
87
  H as ContextMenuSeparator,
88
88
  N as ContextMenuSub,
89
- j as ContextMenuSubContent,
90
- Q as ContextMenuSubTrigger,
91
- V as ContextMenuTrigger,
92
- mr as ContextStore,
93
- ur as ContextStoreProvider,
89
+ V as ContextMenuSubContent,
90
+ j as ContextMenuSubTrigger,
91
+ Q as ContextMenuTrigger,
92
+ ur as ContextStore,
93
+ ir as ContextStoreProvider,
94
94
  q as DataTable,
95
95
  K as DataTableColumn,
96
96
  W as DataTableFilterInput,
@@ -111,78 +111,79 @@ export {
111
111
  be as FileTabsContent,
112
112
  ce as FileTabsList,
113
113
  Ce as FileTabsService,
114
- Te as FileTabsTrigger,
115
- se as Flex,
116
- po as FullScreen,
114
+ de as FileTabsTrigger,
115
+ Te as Flex,
116
+ mo as FullScreen,
117
117
  Pe as Input,
118
118
  ye as InputDescription,
119
- he as InputLabel,
119
+ Le as InputLabel,
120
120
  Ge as InputMessage,
121
121
  Be as InputSuggestionMenuContent,
122
122
  Oe as InputSuggestionMenuContentItems,
123
- uo as Layout,
124
- xo as Menu,
125
- lo as MenuArrow,
126
- fo as MenuCheckboxItem,
127
- Co as MenuContent,
128
- go as MenuGroup,
129
- So as MenuItem,
130
- bo as MenuItemIndicator,
131
- co as MenuLabel,
123
+ io as Layout,
124
+ lo as Menu,
125
+ fo as MenuArrow,
126
+ Co as MenuCheckboxItem,
127
+ go as MenuContent,
128
+ So as MenuGroup,
129
+ bo as MenuItem,
130
+ co as MenuItemIndicator,
131
+ so as MenuLabel,
132
132
  To as MenuPortal,
133
- so as MenuSeparator,
134
- Mo as MenuSub,
135
- Io as MenuSubContent,
136
- Do as MenuSubTrigger,
137
- Ao as MenuTrigger,
138
- fr as NonReactiveArrayService,
133
+ Mo as MenuSeparator,
134
+ Io as MenuSub,
135
+ Do as MenuSubContent,
136
+ Ao as MenuSubTrigger,
137
+ vo as MenuTrigger,
138
+ Cr as NonReactiveArrayService,
139
139
  Ee as NumberInput,
140
- Sr as ObjectService,
140
+ br as ObjectService,
141
141
  Ne as PasswordInput,
142
142
  Qe as PinInput,
143
- Ve as PinInputField,
144
- Ze as PinInputHiddenField,
145
- Fo as Quote,
146
- Je as RadioGroup,
147
- Ue as RadioInput,
148
- Tr as ReactiveArrayService,
149
- Ro as ResizableHandle,
150
- yo as ResizablePanel,
143
+ Ze as PinInputField,
144
+ qe as PinInputHiddenField,
145
+ Po as Quote,
146
+ Ke as RadioGroup,
147
+ We as RadioInput,
148
+ sr as ReactiveArrayService,
149
+ yo as ResizableHandle,
150
+ wo as ResizablePanel,
151
151
  Lo as ResizablePanelGroup,
152
- wo as Row,
153
- zo as ScrollArea,
154
- Bo as ScrollAreaCorner,
155
- Oo as ScrollAreaScrollbar,
156
- ko as ScrollAreaThumb,
157
- Eo as ScrollAreaViewport,
158
- No as SegmentedControl,
152
+ Go as Row,
153
+ Bo as ScrollArea,
154
+ Oo as ScrollAreaCorner,
155
+ ko as ScrollAreaScrollbar,
156
+ Eo as ScrollAreaThumb,
157
+ Ho as ScrollAreaViewport,
158
+ Vo as SegmentedControl,
159
159
  jo as SegmentedControlItem,
160
- Vo as Spacing,
161
- Xe as SwitchInput,
162
- qo as Tab,
163
- Jo as TabContent,
164
- Ko as TabList,
165
- Uo as TabTrigger,
166
- Xo as Text,
167
- _e as TextAreaInput,
168
- eo as TextInput,
169
- _o as Toast,
170
- or as Tooltip,
171
- rr as TooltipArrow,
172
- tr as TooltipContent,
173
- nr as TooltipPortal,
174
- ar as TooltipTrigger,
175
- no as buildDefaultSyntax,
160
+ Zo as Spacing,
161
+ Ye as SwitchInput,
162
+ Jo as Tab,
163
+ Ko as TabContent,
164
+ Uo as TabList,
165
+ Wo as TabTrigger,
166
+ Yo as Text,
167
+ $e as TextAreaInput,
168
+ oo as TextInput,
169
+ $o as Toast,
170
+ rr as Tooltip,
171
+ tr as TooltipArrow,
172
+ nr as TooltipContent,
173
+ ar as TooltipPortal,
174
+ pr as TooltipTrigger,
175
+ ao as buildDefaultSyntax,
176
176
  X as createFilterQueryLanguage,
177
- Cr as createNonReactiveArrayService,
178
- br as createObjectService,
177
+ gr as createNonReactiveArrayService,
178
+ cr as createObjectService,
179
179
  ve as emailValidation,
180
- Dr as getDOMSizeFromCodeZeroSize,
181
- Ar as hashToColor,
182
- vr as mergeCode0Props,
183
- $o as toast,
184
- ro as useForm,
185
- dr as useReactiveArrayService,
186
- ir as useService,
187
- xr as useStore
180
+ Ar as getDOMSizeFromCodeZeroSize,
181
+ vr as hashToColor,
182
+ Fr as mergeCode0Props,
183
+ Ve as passwordValidation,
184
+ er as toast,
185
+ to as useForm,
186
+ Tr as useReactiveArrayService,
187
+ xr as useService,
188
+ lr as useStore
188
189
  };
@@ -1,13 +1,13 @@
1
- import a, { startTransition as i } from "react";
2
- import { View as h } from "./view.js";
3
- function p(t, e, r) {
4
- return (e = y(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
1
+ import a from "react";
2
+ import { View as d } from "./view.js";
3
+ function h(t, e, r) {
4
+ return (e = p(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
5
5
  }
6
- function y(t) {
7
- var e = m(t, "string");
6
+ function p(t) {
7
+ var e = y(t, "string");
8
8
  return typeof e == "symbol" ? e : e + "";
9
9
  }
10
- function m(t, e) {
10
+ function y(t, e) {
11
11
  if (typeof t != "object" || !t) return t;
12
12
  var r = t[Symbol.toPrimitive];
13
13
  if (r !== void 0) {
@@ -17,26 +17,20 @@ function m(t, e) {
17
17
  }
18
18
  return (e === "string" ? String : Number)(t);
19
19
  }
20
- class w {
20
+ class g {
21
21
  constructor(e) {
22
- p(this, "access", void 0), this.access = e;
22
+ h(this, "access", void 0), this.access = e;
23
23
  }
24
24
  delete(e) {
25
- i(() => {
26
- this.access.setState((r) => r.filter((s, c) => c !== e));
27
- });
25
+ this.access.setState((r) => r.filter((s, c) => c !== e));
28
26
  }
29
27
  add(e) {
30
- i(() => {
31
- this.access.setState((r) => [...r, e]);
32
- });
28
+ this.access.setState((r) => [...r, e]);
33
29
  }
34
30
  set(e, r) {
35
- i(() => {
36
- this.access.setState((s) => {
37
- const c = s.slice();
38
- return c[e] = r, c;
39
- });
31
+ this.access.setState((s) => {
32
+ const c = s.slice();
33
+ return c[e] = r, c;
40
34
  });
41
35
  }
42
36
  has(e) {
@@ -50,41 +44,37 @@ class w {
50
44
  return this.access.getState().map((r) => r.payload);
51
45
  }
52
46
  update() {
53
- i(() => {
54
- this.access.setState((e) => [...e]);
55
- });
47
+ this.access.setState((e) => [...e]);
56
48
  }
57
49
  clear() {
58
- i(() => {
59
- this.access.setState(() => []);
60
- });
50
+ this.access.setState(() => []);
61
51
  }
62
52
  }
63
- function P(t, e = []) {
53
+ function w(t, e = []) {
64
54
  const [r, s] = a.useState([]), c = a.useRef([]);
65
55
  c.current = r;
66
- const u = a.useCallback(() => c.current, []), o = a.useMemo(() => {
56
+ const o = a.useCallback(() => c.current, []), i = a.useMemo(() => {
67
57
  const n = {
68
- getState: u,
58
+ getState: o,
69
59
  setState: s
70
- }, v = {
71
- construct: () => v
60
+ }, l = {
61
+ construct: () => l
72
62
  };
73
- return ((d) => {
63
+ return ((v) => {
74
64
  try {
75
- return !!new new Proxy(d, v)();
65
+ return !!new new Proxy(v, l)();
76
66
  } catch {
77
67
  return !1;
78
68
  }
79
69
  })(t) ? new t(n) : t(n);
80
- }, [t, u]), f = a.useCallback((n) => new h(n), []), l = a.useRef(!1);
70
+ }, [t, o]), u = a.useCallback((n) => new d(n), []), f = a.useRef(!1);
81
71
  return a.useEffect(() => {
82
- l.current || (l.current = !0, o.clear(), e.forEach((n) => {
83
- o.add(f(n));
72
+ f.current || (f.current = !0, i.clear(), e.forEach((n) => {
73
+ i.add(u(n));
84
74
  }));
85
- }, [o, e, f]), [r, o];
75
+ }, [i, e, u]), [r, i];
86
76
  }
87
77
  export {
88
- w as ReactiveArrayService,
89
- P as useReactiveArrayService
78
+ g as ReactiveArrayService,
79
+ w as useReactiveArrayService
90
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -24,7 +24,7 @@
24
24
  "@codemirror/language": "^6.12.3",
25
25
  "@codemirror/lint": "^6.9.5",
26
26
  "@codemirror/state": "^6.6.0",
27
- "@codemirror/view": "^6.40.0",
27
+ "@codemirror/view": "^6.41.0",
28
28
  "@dagrejs/dagre": "^2.0.4",
29
29
  "@lezer/common": "^1.5.1",
30
30
  "@mdx-js/react": "^3.1.1",
@@ -59,8 +59,8 @@
59
59
  "@uiw/codemirror-themes": "^4.25.9",
60
60
  "@uiw/react-codemirror": "^4.25.8",
61
61
  "@vitejs/plugin-react": "^5.2.0",
62
- "@vitest/browser-playwright": "^4.0.18",
63
- "@vitest/coverage-v8": "^4.0.18",
62
+ "@vitest/browser-playwright": "^4.1.2",
63
+ "@vitest/coverage-v8": "^4.1.2",
64
64
  "@xyflow/react": "^12.10.1",
65
65
  "axe-playwright": "^2.2.2",
66
66
  "babel-loader": "^10.1.1",
@@ -76,21 +76,21 @@
76
76
  "playwright": "1.58.1",
77
77
  "react": "^19.2.4",
78
78
  "react-dom": "^19.2.4",
79
- "react-resizable-panels": "^4.7.6",
79
+ "react-resizable-panels": "^4.9.0",
80
80
  "react-zoom-pan-pinch": "^3.7.0",
81
81
  "rimraf": "^6.1.3",
82
- "sass": "^1.98.0",
82
+ "sass": "^1.99.0",
83
83
  "sass-loader": "^16.0.7",
84
84
  "sonner": "^2.0.7",
85
85
  "storybook": "^10.3.3",
86
86
  "style-loader": "^4.0.0",
87
- "ts-jest": "^29.4.6",
87
+ "ts-jest": "^29.4.9",
88
88
  "ts-node": "^10.9.2",
89
89
  "typescript": "^5.9.3",
90
90
  "vite": "^7.3.1",
91
91
  "vite-plugin-dts": "^4.5.4",
92
92
  "vite-plugin-lib-inject-css": "^2.2.2",
93
- "vitest": "^4.0.18",
93
+ "vitest": "^4.1.2",
94
94
  "avvvatars-react": "^0.4.2"
95
95
  },
96
96
  "main": "dist/index.js",