@noxickon/onyx 4.0.1 → 4.0.3

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../chunks/ui-B0Ma5GdK.js"),s=require("react/jsx-runtime"),Q=require("../chunks/hooks-CNgb50x1.js");require("react");const X=require("lucide-react"),se=Y=>{const e=Q.compilerRuntimeExports.c(63),{className:Z,error:y,isLoading:V,loadingLabel:W,onSubmit:N,passwordLabel:$,passwordPlaceholder:z,submitLabel:A,subtitle:G,title:H,usernameLabel:J,usernamePlaceholder:K}=Y,r=V===void 0?!1:V,ee=W===void 0?"Signing in...":W,T=$===void 0?"password":$,P=z===void 0?"Enter your password":z,te=A===void 0?"Sign In":A,S=G===void 0?"":G,D=H===void 0?"noxickon":H,R=J===void 0?"username":J,k=K===void 0?"Enter your username":K;let q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q={initialData:{password:"",username:""},validationRules:{password:["required"],username:["required"]}},e[0]=q):q=e[0];const t=Q.useFormState(q);let I;e[1]!==t||e[2]!==N?(I=async L=>{L.preventDefault(),t.validate()&&await N(t.data)},e[1]=t,e[2]=N,e[3]=I):I=e[3];const B=I,M=Z??"w-80";let a;e[4]!==D?(a=s.jsx("h1",{className:"px-2 font-mono text-2xl text-foreground",children:D}),e[4]=D,e[5]=a):a=e[5];let o;e[6]!==S?(o=S?s.jsx("p",{className:"px-2 py-1 font-mono text-xs text-muted-foreground",children:S}):null,e[6]=S,e[7]=o):o=e[7];let i;e[8]!==a||e[9]!==o?(i=s.jsxs("div",{className:"mb-4 text-center",children:[a,o]}),e[8]=a,e[9]=o,e[10]=i):i=e[10];let n;e[11]!==R?(n=s.jsx(l.OxLabel,{children:R}),e[11]=R,e[12]=n):n=e[12];let d;e[13]!==t?(d=t.hasError("username"),e[13]=t,e[14]=d):d=e[14];let c;e[15]!==t?(c=L=>t.setData("username",L),e[15]=t,e[16]=c):c=e[16];let _;e[17]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(l.OxIcon,{icon:X.User}),e[17]=_):_=e[17];let u;e[18]!==k?(u=s.jsx(l.OxTextInput,{autoComplete:"off",name:"username",placeholder:k}),e[18]=k,e[19]=u):u=e[19];let m;e[20]!==t.data.username||e[21]!==d||e[22]!==c||e[23]!==u?(m=s.jsxs(l.OxTextInput.Container,{error:d,value:t.data.username,onChange:c,children:[_,u]}),e[20]=t.data.username,e[21]=d,e[22]=c,e[23]=u,e[24]=m):m=e[24];let x;e[25]!==r||e[26]!==n||e[27]!==m?(x=s.jsxs(l.OxForm.Field,{disabled:r,required:!0,children:[n,m]}),e[25]=r,e[26]=n,e[27]=m,e[28]=x):x=e[28];let f;e[29]!==T?(f=s.jsx(l.OxLabel,{children:T}),e[29]=T,e[30]=f):f=e[30];let p;e[31]!==t?(p=t.hasError("password"),e[31]=t,e[32]=p):p=e[32];let h;e[33]!==t?(h=L=>t.setData("password",L),e[33]=t,e[34]=h):h=e[34];let C;e[35]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(l.OxIcon,{icon:X.Lock}),e[35]=C):C=e[35];let b;e[36]!==P?(b=s.jsx(l.OxTextInput,{autoComplete:"off",name:"password",placeholder:P}),e[36]=P,e[37]=b):b=e[37];let E;e[38]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(l.OxTextInput.VisibilityButton,{}),e[38]=E):E=e[38];let j;e[39]!==t.data.password||e[40]!==p||e[41]!==h||e[42]!==b?(j=s.jsxs(l.OxTextInput.Container,{error:p,type:"password",value:t.data.password,onChange:h,children:[C,b,E]}),e[39]=t.data.password,e[40]=p,e[41]=h,e[42]=b,e[43]=j):j=e[43];let O;e[44]!==r||e[45]!==f||e[46]!==j?(O=s.jsxs(l.OxForm.Field,{disabled:r,required:!0,children:[f,j]}),e[44]=r,e[45]=f,e[46]=j,e[47]=O):O=e[47];let v;e[48]!==y?(v=y?s.jsx(l.OxError,{children:y}):null,e[48]=y,e[49]=v):v=e[49];const U=r?ee:te;let w;e[50]!==r||e[51]!==U?(w=s.jsx(l.OxButton,{disabled:r,fullWidth:!0,isLoading:r,type:"submit",variant:"gradient",children:U}),e[50]=r,e[51]=U,e[52]=w):w=e[52];let g;e[53]!==B||e[54]!==x||e[55]!==O||e[56]!==v||e[57]!==w?(g=s.jsxs(l.OxForm,{className:"space-y-6",onSubmit:B,children:[x,O,v,w]}),e[53]=B,e[54]=x,e[55]=O,e[56]=v,e[57]=w,e[58]=g):g=e[58];let F;return e[59]!==M||e[60]!==i||e[61]!==g?(F=s.jsxs(l.OxCard,{className:M,children:[i,g]}),e[59]=M,e[60]=i,e[61]=g,e[62]=F):F=e[62],F};exports.OxLogin=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../chunks/ui-B0Ma5GdK.js"),s=require("react/jsx-runtime"),Q=require("../chunks/hooks-CNgb50x1.js");require("react");const X=require("lucide-react"),se=Y=>{const e=Q.compilerRuntimeExports.c(65),{className:Z,error:a,isLoading:V,loadingLabel:W,onSubmit:N,passwordLabel:$,passwordPlaceholder:z,submitLabel:A,subtitle:G,title:H,usernameLabel:J,usernamePlaceholder:K}=Y,r=V===void 0?!1:V,ee=W===void 0?"Signing in...":W,T=$===void 0?"password":$,P=z===void 0?"Enter your password":z,te=A===void 0?"Sign In":A,S=G===void 0?"":G,D=H===void 0?"noxickon":H,R=J===void 0?"username":J,k=K===void 0?"Enter your username":K;let q;e[0]===Symbol.for("react.memo_cache_sentinel")?(q={initialData:{password:"",username:""},validationRules:{password:["required"],username:["required"]}},e[0]=q):q=e[0];const t=Q.useFormState(q);let I;e[1]!==t||e[2]!==N?(I=async y=>{y.preventDefault(),t.validate()&&await N(t.data)},e[1]=t,e[2]=N,e[3]=I):I=e[3];const B=I,M=Z??"w-80";let o;e[4]!==D?(o=s.jsx("h1",{className:"px-2 font-mono text-2xl text-foreground",children:D}),e[4]=D,e[5]=o):o=e[5];let i;e[6]!==S?(i=S?s.jsx("p",{className:"px-2 py-1 font-mono text-xs text-muted-foreground",children:S}):null,e[6]=S,e[7]=i):i=e[7];let n;e[8]!==o||e[9]!==i?(n=s.jsxs("div",{className:"mb-4 text-center",children:[o,i]}),e[8]=o,e[9]=i,e[10]=n):n=e[10];let d;e[11]!==R?(d=s.jsx(l.OxLabel,{children:R}),e[11]=R,e[12]=d):d=e[12];let c;e[13]!==a||e[14]!==t?(c=t.hasError("username")||!!a,e[13]=a,e[14]=t,e[15]=c):c=e[15];let u;e[16]!==t?(u=y=>t.setData("username",y),e[16]=t,e[17]=u):u=e[17];let _;e[18]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx(l.OxIcon,{icon:X.User}),e[18]=_):_=e[18];let m;e[19]!==k?(m=s.jsx(l.OxTextInput,{autoComplete:"off",name:"username",placeholder:k}),e[19]=k,e[20]=m):m=e[20];let x;e[21]!==t.data.username||e[22]!==c||e[23]!==u||e[24]!==m?(x=s.jsxs(l.OxTextInput.Container,{error:c,value:t.data.username,onChange:u,children:[_,m]}),e[21]=t.data.username,e[22]=c,e[23]=u,e[24]=m,e[25]=x):x=e[25];let f;e[26]!==r||e[27]!==d||e[28]!==x?(f=s.jsxs(l.OxForm.Field,{disabled:r,required:!0,children:[d,x]}),e[26]=r,e[27]=d,e[28]=x,e[29]=f):f=e[29];let p;e[30]!==T?(p=s.jsx(l.OxLabel,{children:T}),e[30]=T,e[31]=p):p=e[31];let h;e[32]!==a||e[33]!==t?(h=t.hasError("password")||!!a,e[32]=a,e[33]=t,e[34]=h):h=e[34];let b;e[35]!==t?(b=y=>t.setData("password",y),e[35]=t,e[36]=b):b=e[36];let C;e[37]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(l.OxIcon,{icon:X.Lock}),e[37]=C):C=e[37];let j;e[38]!==P?(j=s.jsx(l.OxTextInput,{autoComplete:"off",name:"password",placeholder:P}),e[38]=P,e[39]=j):j=e[39];let E;e[40]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(l.OxTextInput.VisibilityButton,{}),e[40]=E):E=e[40];let O;e[41]!==t.data.password||e[42]!==h||e[43]!==b||e[44]!==j?(O=s.jsxs(l.OxTextInput.Container,{error:h,type:"password",value:t.data.password,onChange:b,children:[C,j,E]}),e[41]=t.data.password,e[42]=h,e[43]=b,e[44]=j,e[45]=O):O=e[45];let v;e[46]!==r||e[47]!==p||e[48]!==O?(v=s.jsxs(l.OxForm.Field,{disabled:r,required:!0,children:[p,O]}),e[46]=r,e[47]=p,e[48]=O,e[49]=v):v=e[49];let w;e[50]!==a?(w=a?s.jsx(l.OxError,{children:a}):null,e[50]=a,e[51]=w):w=e[51];const U=r?ee:te;let g;e[52]!==r||e[53]!==U?(g=s.jsx(l.OxButton,{disabled:r,fullWidth:!0,isLoading:r,type:"submit",variant:"gradient",children:U}),e[52]=r,e[53]=U,e[54]=g):g=e[54];let L;e[55]!==B||e[56]!==f||e[57]!==v||e[58]!==w||e[59]!==g?(L=s.jsxs(l.OxForm,{className:"space-y-6",onSubmit:B,children:[f,v,w,g]}),e[55]=B,e[56]=f,e[57]=v,e[58]=w,e[59]=g,e[60]=L):L=e[60];let F;return e[61]!==M||e[62]!==n||e[63]!==L?(F=s.jsxs(l.OxCard,{className:M,children:[n,L]}),e[61]=M,e[62]=n,e[63]=L,e[64]=F):F=e[64],F};exports.OxLogin=se;
@@ -1,12 +1,12 @@
1
- import { a4 as O, a0 as W, ad as Y, r as Z, ab as le, g as re, i as oe } from "../chunks/ui-DrKTwQ0M.js";
2
- import { jsxs as l, jsx as a } from "react/jsx-runtime";
1
+ import { a4 as _, a0 as W, ad as Y, r as Z, ab as le, g as re, i as oe } from "../chunks/ui-DrKTwQ0M.js";
2
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
3
3
  import { d as ie, z as ne } from "../chunks/hooks-6tQOArBm.js";
4
4
  import "react";
5
5
  import { User as de, Lock as ce } from "lucide-react";
6
6
  const be = (ee) => {
7
- const e = ie.c(63), {
7
+ const e = ie.c(65), {
8
8
  className: te,
9
- error: _,
9
+ error: l,
10
10
  isLoading: $,
11
11
  loadingLabel: A,
12
12
  onSubmit: I,
@@ -31,79 +31,79 @@ const be = (ee) => {
31
31
  }, e[0] = E) : E = e[0];
32
32
  const t = ne(E);
33
33
  let N;
34
- e[1] !== t || e[2] !== I ? (N = async (S) => {
35
- S.preventDefault(), t.validate() && await I(t.data);
34
+ e[1] !== t || e[2] !== I ? (N = async (O) => {
35
+ O.preventDefault(), t.validate() && await I(t.data);
36
36
  }, e[1] = t, e[2] = I, e[3] = N) : N = e[3];
37
37
  const T = N, U = te ?? "w-80";
38
- let r;
39
- e[4] !== B ? (r = /* @__PURE__ */ a("h1", { className: "px-2 font-mono text-2xl text-foreground", children: B }), e[4] = B, e[5] = r) : r = e[5];
40
38
  let o;
41
- e[6] !== C ? (o = C ? /* @__PURE__ */ a("p", { className: "px-2 py-1 font-mono text-xs text-muted-foreground", children: C }) : null, e[6] = C, e[7] = o) : o = e[7];
39
+ e[4] !== B ? (o = /* @__PURE__ */ a("h1", { className: "px-2 font-mono text-2xl text-foreground", children: B }), e[4] = B, e[5] = o) : o = e[5];
42
40
  let i;
43
- e[8] !== r || e[9] !== o ? (i = /* @__PURE__ */ l("div", { className: "mb-4 text-center", children: [
44
- r,
45
- o
46
- ] }), e[8] = r, e[9] = o, e[10] = i) : i = e[10];
41
+ e[6] !== C ? (i = C ? /* @__PURE__ */ a("p", { className: "px-2 py-1 font-mono text-xs text-muted-foreground", children: C }) : null, e[6] = C, e[7] = i) : i = e[7];
47
42
  let n;
48
- e[11] !== R ? (n = /* @__PURE__ */ a(Y, { children: R }), e[11] = R, e[12] = n) : n = e[12];
43
+ e[8] !== o || e[9] !== i ? (n = /* @__PURE__ */ r("div", { className: "mb-4 text-center", children: [
44
+ o,
45
+ i
46
+ ] }), e[8] = o, e[9] = i, e[10] = n) : n = e[10];
49
47
  let d;
50
- e[13] !== t ? (d = t.hasError("username"), e[13] = t, e[14] = d) : d = e[14];
48
+ e[11] !== R ? (d = /* @__PURE__ */ a(Y, { children: R }), e[11] = R, e[12] = d) : d = e[12];
51
49
  let c;
52
- e[15] !== t ? (c = (S) => t.setData("username", S), e[15] = t, e[16] = c) : c = e[16];
53
- let q;
54
- e[17] === Symbol.for("react.memo_cache_sentinel") ? (q = /* @__PURE__ */ a(Z, { icon: de }), e[17] = q) : q = e[17];
50
+ e[13] !== l || e[14] !== t ? (c = t.hasError("username") || !!l, e[13] = l, e[14] = t, e[15] = c) : c = e[15];
55
51
  let m;
56
- e[18] !== z ? (m = /* @__PURE__ */ a(O, { autoComplete: "off", name: "username", placeholder: z }), e[18] = z, e[19] = m) : m = e[19];
52
+ e[16] !== t ? (m = (O) => t.setData("username", O), e[16] = t, e[17] = m) : m = e[17];
53
+ let q;
54
+ e[18] === Symbol.for("react.memo_cache_sentinel") ? (q = /* @__PURE__ */ a(Z, { icon: de }), e[18] = q) : q = e[18];
57
55
  let u;
58
- e[20] !== t.data.username || e[21] !== d || e[22] !== c || e[23] !== m ? (u = /* @__PURE__ */ l(O.Container, { error: d, value: t.data.username, onChange: c, children: [
59
- q,
60
- m
61
- ] }), e[20] = t.data.username, e[21] = d, e[22] = c, e[23] = m, e[24] = u) : u = e[24];
56
+ e[19] !== z ? (u = /* @__PURE__ */ a(_, { autoComplete: "off", name: "username", placeholder: z }), e[19] = z, e[20] = u) : u = e[20];
62
57
  let f;
63
- e[25] !== s || e[26] !== n || e[27] !== u ? (f = /* @__PURE__ */ l(W.Field, { disabled: s, required: !0, children: [
64
- n,
58
+ e[21] !== t.data.username || e[22] !== c || e[23] !== m || e[24] !== u ? (f = /* @__PURE__ */ r(_.Container, { error: c, value: t.data.username, onChange: m, children: [
59
+ q,
65
60
  u
66
- ] }), e[25] = s, e[26] = n, e[27] = u, e[28] = f) : f = e[28];
61
+ ] }), e[21] = t.data.username, e[22] = c, e[23] = m, e[24] = u, e[25] = f) : f = e[25];
67
62
  let p;
68
- e[29] !== j ? (p = /* @__PURE__ */ a(Y, { children: j }), e[29] = j, e[30] = p) : p = e[30];
63
+ e[26] !== s || e[27] !== d || e[28] !== f ? (p = /* @__PURE__ */ r(W.Field, { disabled: s, required: !0, children: [
64
+ d,
65
+ f
66
+ ] }), e[26] = s, e[27] = d, e[28] = f, e[29] = p) : p = e[29];
69
67
  let h;
70
- e[31] !== t ? (h = t.hasError("password"), e[31] = t, e[32] = h) : h = e[32];
68
+ e[30] !== j ? (h = /* @__PURE__ */ a(Y, { children: j }), e[30] = j, e[31] = h) : h = e[31];
71
69
  let b;
72
- e[33] !== t ? (b = (S) => t.setData("password", S), e[33] = t, e[34] = b) : b = e[34];
73
- let D;
74
- e[35] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ a(Z, { icon: ce }), e[35] = D) : D = e[35];
70
+ e[32] !== l || e[33] !== t ? (b = t.hasError("password") || !!l, e[32] = l, e[33] = t, e[34] = b) : b = e[34];
75
71
  let x;
76
- e[36] !== k ? (x = /* @__PURE__ */ a(O, { autoComplete: "off", name: "password", placeholder: k }), e[36] = k, e[37] = x) : x = e[37];
77
- let F;
78
- e[38] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ a(O.VisibilityButton, {}), e[38] = F) : F = e[38];
72
+ e[35] !== t ? (x = (O) => t.setData("password", O), e[35] = t, e[36] = x) : x = e[36];
73
+ let D;
74
+ e[37] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ a(Z, { icon: ce }), e[37] = D) : D = e[37];
79
75
  let w;
80
- e[39] !== t.data.password || e[40] !== h || e[41] !== b || e[42] !== x ? (w = /* @__PURE__ */ l(O.Container, { error: h, type: "password", value: t.data.password, onChange: b, children: [
76
+ e[38] !== k ? (w = /* @__PURE__ */ a(_, { autoComplete: "off", name: "password", placeholder: k }), e[38] = k, e[39] = w) : w = e[39];
77
+ let F;
78
+ e[40] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ a(_.VisibilityButton, {}), e[40] = F) : F = e[40];
79
+ let v;
80
+ e[41] !== t.data.password || e[42] !== b || e[43] !== x || e[44] !== w ? (v = /* @__PURE__ */ r(_.Container, { error: b, type: "password", value: t.data.password, onChange: x, children: [
81
81
  D,
82
- x,
82
+ w,
83
83
  F
84
- ] }), e[39] = t.data.password, e[40] = h, e[41] = b, e[42] = x, e[43] = w) : w = e[43];
85
- let v;
86
- e[44] !== s || e[45] !== p || e[46] !== w ? (v = /* @__PURE__ */ l(W.Field, { disabled: s, required: !0, children: [
87
- p,
88
- w
89
- ] }), e[44] = s, e[45] = p, e[46] = w, e[47] = v) : v = e[47];
84
+ ] }), e[41] = t.data.password, e[42] = b, e[43] = x, e[44] = w, e[45] = v) : v = e[45];
90
85
  let g;
91
- e[48] !== _ ? (g = _ ? /* @__PURE__ */ a(le, { children: _ }) : null, e[48] = _, e[49] = g) : g = e[49];
92
- const V = s ? se : ae;
86
+ e[46] !== s || e[47] !== h || e[48] !== v ? (g = /* @__PURE__ */ r(W.Field, { disabled: s, required: !0, children: [
87
+ h,
88
+ v
89
+ ] }), e[46] = s, e[47] = h, e[48] = v, e[49] = g) : g = e[49];
93
90
  let L;
94
- e[50] !== s || e[51] !== V ? (L = /* @__PURE__ */ a(re, { disabled: s, fullWidth: !0, isLoading: s, type: "submit", variant: "gradient", children: V }), e[50] = s, e[51] = V, e[52] = L) : L = e[52];
91
+ e[50] !== l ? (L = l ? /* @__PURE__ */ a(le, { children: l }) : null, e[50] = l, e[51] = L) : L = e[51];
92
+ const V = s ? se : ae;
95
93
  let y;
96
- e[53] !== T || e[54] !== f || e[55] !== v || e[56] !== g || e[57] !== L ? (y = /* @__PURE__ */ l(W, { className: "space-y-6", onSubmit: T, children: [
97
- f,
98
- v,
94
+ e[52] !== s || e[53] !== V ? (y = /* @__PURE__ */ a(re, { disabled: s, fullWidth: !0, isLoading: s, type: "submit", variant: "gradient", children: V }), e[52] = s, e[53] = V, e[54] = y) : y = e[54];
95
+ let S;
96
+ e[55] !== T || e[56] !== p || e[57] !== g || e[58] !== L || e[59] !== y ? (S = /* @__PURE__ */ r(W, { className: "space-y-6", onSubmit: T, children: [
97
+ p,
99
98
  g,
100
- L
101
- ] }), e[53] = T, e[54] = f, e[55] = v, e[56] = g, e[57] = L, e[58] = y) : y = e[58];
102
- let P;
103
- return e[59] !== U || e[60] !== i || e[61] !== y ? (P = /* @__PURE__ */ l(oe, { className: U, children: [
104
- i,
99
+ L,
105
100
  y
106
- ] }), e[59] = U, e[60] = i, e[61] = y, e[62] = P) : P = e[62], P;
101
+ ] }), e[55] = T, e[56] = p, e[57] = g, e[58] = L, e[59] = y, e[60] = S) : S = e[60];
102
+ let P;
103
+ return e[61] !== U || e[62] !== n || e[63] !== S ? (P = /* @__PURE__ */ r(oe, { className: U, children: [
104
+ n,
105
+ S
106
+ ] }), e[61] = U, e[62] = n, e[63] = S, e[64] = P) : P = e[64], P;
107
107
  };
108
108
  export {
109
109
  be as OxLogin
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@noxickon/onyx",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/onyx.umd.js",
6
6
  "module": "./dist/onyx.es.js",
7
7
  "types": "./dist/index.d.ts",
8
- "style": "./dist/onyx.css",
8
+ "style": "./dist/ui.css",
9
9
  "sideEffects": [
10
10
  "*.css",
11
11
  "**/*.css"
@@ -43,9 +43,7 @@
43
43
  "types": "./dist/legacy/index.d.ts",
44
44
  "import": "./dist/legacy/legacy.es.js"
45
45
  },
46
- "./styles": "./dist/onyx.css",
47
- "./shared": "./dist/shared.css",
48
- "./animations": "./dist/animations.css"
46
+ "./styles": "./dist/ui.css"
49
47
  },
50
48
  "files": [
51
49
  "dist",