@noxickon/onyx 0.0.4-dev.8 → 1.0.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 (67) hide show
  1. package/dist/chunks/hooks-DiKvsNs-.js +48 -0
  2. package/dist/chunks/hooks-bJFfbTks.js +8624 -0
  3. package/dist/chunks/query-BhvXa-m6.js +10 -0
  4. package/dist/chunks/query-iDn3qBGF.js +14 -0
  5. package/dist/chunks/ui-ChsTPgui.js +41 -0
  6. package/dist/chunks/ui-DxsSYHCv.js +20634 -0
  7. package/dist/chunks/useAuth-BFgXzu6Q.js +12 -0
  8. package/dist/chunks/useAuth-DxoDe3YA.js +1 -0
  9. package/dist/contexts/contexts.cjs.js +5 -0
  10. package/dist/contexts/contexts.es.js +156 -0
  11. package/dist/contexts.d.ts +117 -0
  12. package/dist/hooks/hooks.cjs.js +1 -6
  13. package/dist/hooks/hooks.es.js +11 -1916
  14. package/dist/hooks.d.ts +84 -22
  15. package/dist/index.d.ts +1782 -268
  16. package/dist/layouts/layouts.cjs.js +1 -0
  17. package/dist/layouts/layouts.es.js +688 -0
  18. package/dist/layouts.d.ts +430 -0
  19. package/dist/onyx.cjs.js +1 -1
  20. package/dist/onyx.es.js +53 -1395
  21. package/dist/pages/pages.cjs.js +2 -2
  22. package/dist/pages/pages.es.js +72 -70
  23. package/dist/pages.d.ts +4 -4
  24. package/dist/routes/routes.cjs.js +1 -0
  25. package/dist/routes/routes.es.js +31 -0
  26. package/dist/routes.d.ts +28 -0
  27. package/dist/shared.css +77 -48
  28. package/dist/ui.css +1 -0
  29. package/dist/utils/utils.cjs.js +1 -1
  30. package/dist/utils/utils.es.js +20 -6
  31. package/dist/utils.d.ts +109 -5
  32. package/package.json +39 -28
  33. package/dist/chunks/AuthContext-CaZKJMxQ.js +0 -2149
  34. package/dist/chunks/AuthContext-uU1aP9gj.js +0 -31
  35. package/dist/chunks/Button-D-v4l8ZE.js +0 -20
  36. package/dist/chunks/Button-bARrxYyo.js +0 -11053
  37. package/dist/chunks/Input-CLi1H63d.js +0 -1
  38. package/dist/chunks/Input-dfvmdIHi.js +0 -138
  39. package/dist/chunks/_commonjsHelpers-C6fGbg64.js +0 -6
  40. package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +0 -1
  41. package/dist/chunks/constants-B1_n9ezb.js +0 -1
  42. package/dist/chunks/constants-CDXq37n6.js +0 -4
  43. package/dist/chunks/errorHelper--G-SWQzN.js +0 -18
  44. package/dist/chunks/errorHelper-DaP_XxEx.js +0 -1
  45. package/dist/chunks/formatTimestamp-CMxOnPo1.js +0 -12
  46. package/dist/chunks/formatTimestamp-TTsNcy7u.js +0 -1
  47. package/dist/chunks/index-CPwC_oqh.js +0 -561
  48. package/dist/chunks/index-DY808_YF.js +0 -2
  49. package/dist/chunks/isObject-BDHKUJKN.js +0 -1
  50. package/dist/chunks/isObject-vmP43YLW.js +0 -6
  51. package/dist/chunks/jsx-runtime--oOP9f8K.js +0 -284
  52. package/dist/chunks/jsx-runtime-CITbqOLs.js +0 -22
  53. package/dist/chunks/tslib.es6-ci7D5hcx.js +0 -44
  54. package/dist/chunks/tslib.es6-nRfFZWHa.js +0 -1
  55. package/dist/chunks/useAuth-BsWbsZD5.js +0 -1
  56. package/dist/chunks/useAuth-CkaMowHd.js +0 -11
  57. package/dist/chunks/useForm-DfmfCtGn.js +0 -3070
  58. package/dist/chunks/useForm-OVVxm4qZ.js +0 -18
  59. package/dist/chunks/useQuery-Dh3SZN5S.js +0 -1482
  60. package/dist/chunks/useQuery-y4De9xeL.js +0 -2
  61. package/dist/context/context.cjs.js +0 -1
  62. package/dist/context/context.es.js +0 -39
  63. package/dist/context.d.ts +0 -47
  64. package/dist/index.css +0 -1
  65. package/dist/layout/layout.cjs.js +0 -1
  66. package/dist/layout/layout.es.js +0 -265
  67. package/dist/layout.d.ts +0 -90
@@ -1 +0,0 @@
1
- "use strict";const e=require("./jsx-runtime-CITbqOLs.js"),p=require("react"),x=require("./Button-D-v4l8ZE.js"),F=require("./isObject-BDHKUJKN.js"),N=({children:n,className:r,disabled:s=!1,htmlFor:t,required:l=!1})=>e.jsxRuntimeExports.jsxs("label",{id:`${t}-label`,className:x.twMerge("block text-sm font-medium text-neutral-300",s&&"cursor-not-allowed text-neutral-500",r),htmlFor:t,children:[n,l&&e.jsxRuntimeExports.jsx("span",{className:"ml-1 text-rose-400",children:"*"})]}),I=({children:n,className:r,disabled:s=!1,id:t})=>e.jsxRuntimeExports.jsx("p",{id:t,className:x.twMerge("text-xs text-neutral-400",s&&"text-neutral-500",r),children:n}),f=({children:n,className:r,icon:s="mdiAlertCircleOutline",id:t})=>n?e.jsxRuntimeExports.jsxs("div",{id:t,className:x.twMerge("flex max-w-full items-center gap-1 text-xs text-rose-400",r),role:"alert",children:[s?e.jsxRuntimeExports.jsx(x.OxIcon,{className:"flex-shrink-0",icon:s,size:.8}):null,e.jsxRuntimeExports.jsx("p",{className:"min-w-0 break-words",children:n})]}):null,S=({children:n,className:r,fullWidth:s=!1,noValidate:t=!0,...l})=>e.jsxRuntimeExports.jsx("form",{className:x.twMerge(s&&"w-full",r),noValidate:t,...l,children:n}),G=({className:n,description:r,disabled:s=!1,error:t=!1,errorMessage:l,icon:a="",iconPosition:c="left",id:y,label:j,name:L,onChange:v,placeholder:$="Input placeholder...",readOnly:M=!1,required:h=!1,showMaxLength:k=!1,type:q="text",value:i,...g})=>{const C=p.useId(),[z,E]=p.useState(typeof i=="string"?i.length:0),m=y||C,R=`${m}-input`,w=`${m}-description`,d=`${m}-error`,O=g.maxLength,b=t&&typeof l=="string",A=t&&F.isObject(l);p.useEffect(()=>{typeof i=="string"&&E(i.length)},[i]);const B=u=>{const o=u.target.value.length;E(o),v?.(u)},D=e.jsxRuntimeExports.jsxs("div",{className:"relative flex w-full items-center",children:[a!==""&&c==="left"?e.jsxRuntimeExports.jsx("div",{className:"absolute left-3 flex items-center",children:e.jsxRuntimeExports.jsx(x.OxIcon,{icon:a,size:.8})}):null,e.jsxRuntimeExports.jsx("input",{id:R,"aria-describedby":[r?w:"",b?d:""].filter(Boolean).join(" ")||void 0,"aria-invalid":t,"aria-required":h,className:x.twMerge("flex h-10 w-full rounded-lg bg-transparent px-2 py-2 text-sm text-white","default-outset-focus","placeholder:text-muted-foreground placeholder:text-neutral-500","default-disabled",a&&(c==="left"?"pl-10":"pr-10"),t?"default-error-border":"default-border",n),disabled:s,name:L,placeholder:$,readOnly:M,type:q,value:i,onChange:B,...g}),a!==""&&c==="right"?e.jsxRuntimeExports.jsx("div",{className:"absolute right-3 flex items-center",children:e.jsxRuntimeExports.jsx(x.OxIcon,{icon:a,size:.8})}):null]});return e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col gap-1",children:[j?e.jsxRuntimeExports.jsx(N,{disabled:s,htmlFor:R,required:h,children:j}):null,D,k&&typeof O=="number"?e.jsxRuntimeExports.jsxs("div",{className:"pointer-events-none mt-1 text-right text-xs text-neutral-400",children:[z,"/",O]}):null,r?e.jsxRuntimeExports.jsx(I,{id:w,disabled:s,children:r}):null,b?e.jsxRuntimeExports.jsx(f,{id:d,children:l}):null,A&&Array.isArray(l)?e.jsxRuntimeExports.jsx("div",{className:"mt-1 space-y-1",children:l.map((u,o)=>e.jsxRuntimeExports.jsx(f,{id:`${d}-${o}`,children:u},o))}):null]})};exports.OxDescription=I;exports.OxErrorMessage=f;exports.OxForm=S;exports.OxInput=G;exports.OxLabel=N;
@@ -1,138 +0,0 @@
1
- import { j as e } from "./jsx-runtime--oOP9f8K.js";
2
- import { useId as R, useState as S, useEffect as q } from "react";
3
- import { t as x, a as m } from "./Button-bARrxYyo.js";
4
- import { i as G } from "./isObject-vmP43YLW.js";
5
- const H = ({
6
- children: r,
7
- className: l,
8
- disabled: s = !1,
9
- htmlFor: t,
10
- required: a = !1
11
- }) => /* @__PURE__ */ e.jsxs(
12
- "label",
13
- {
14
- id: `${t}-label`,
15
- className: x(
16
- "block text-sm font-medium text-neutral-300",
17
- s && "cursor-not-allowed text-neutral-500",
18
- l
19
- ),
20
- htmlFor: t,
21
- children: [
22
- r,
23
- a && /* @__PURE__ */ e.jsx("span", { className: "ml-1 text-rose-400", children: "*" })
24
- ]
25
- }
26
- ), J = ({
27
- children: r,
28
- className: l,
29
- disabled: s = !1,
30
- id: t
31
- }) => /* @__PURE__ */ e.jsx(
32
- "p",
33
- {
34
- id: t,
35
- className: x("text-xs text-neutral-400", s && "text-neutral-500", l),
36
- children: r
37
- }
38
- ), O = ({
39
- children: r,
40
- className: l,
41
- icon: s = "mdiAlertCircleOutline",
42
- id: t
43
- }) => r ? /* @__PURE__ */ e.jsxs(
44
- "div",
45
- {
46
- id: t,
47
- className: x("flex max-w-full items-center gap-1 text-xs text-rose-400", l),
48
- role: "alert",
49
- children: [
50
- s ? /* @__PURE__ */ e.jsx(m, { className: "flex-shrink-0", icon: s, size: 0.8 }) : null,
51
- /* @__PURE__ */ e.jsx("p", { className: "min-w-0 break-words", children: r })
52
- ]
53
- }
54
- ) : null, U = ({
55
- children: r,
56
- className: l,
57
- fullWidth: s = !1,
58
- noValidate: t = !0,
59
- ...a
60
- }) => /* @__PURE__ */ e.jsx("form", { className: x(s && "w-full", l), noValidate: t, ...a, children: r }), V = ({
61
- className: r,
62
- description: l,
63
- disabled: s = !1,
64
- error: t = !1,
65
- errorMessage: a,
66
- icon: i = "",
67
- iconPosition: d = "left",
68
- id: I,
69
- label: h,
70
- name: v,
71
- onChange: E,
72
- placeholder: L = "Input placeholder...",
73
- readOnly: $ = !1,
74
- required: p = !1,
75
- showMaxLength: k = !1,
76
- type: C = "text",
77
- value: n,
78
- ...j
79
- }) => {
80
- const z = R(), [A, g] = S(
81
- typeof n == "string" ? n.length : 0
82
- ), u = I || z, b = `${u}-input`, N = `${u}-description`, f = `${u}-error`, w = j.maxLength, y = t && typeof a == "string", B = t && G(a);
83
- q(() => {
84
- typeof n == "string" && g(n.length);
85
- }, [n]);
86
- const D = (c) => {
87
- const o = c.target.value.length;
88
- g(o), E?.(c);
89
- }, F = /* @__PURE__ */ e.jsxs("div", { className: "relative flex w-full items-center", children: [
90
- i !== "" && d === "left" ? /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 flex items-center", children: /* @__PURE__ */ e.jsx(m, { icon: i, size: 0.8 }) }) : null,
91
- /* @__PURE__ */ e.jsx(
92
- "input",
93
- {
94
- id: b,
95
- "aria-describedby": [l ? N : "", y ? f : ""].filter(Boolean).join(" ") || void 0,
96
- "aria-invalid": t,
97
- "aria-required": p,
98
- className: x(
99
- "flex h-10 w-full rounded-lg bg-transparent px-2 py-2 text-sm text-white",
100
- "default-outset-focus",
101
- "placeholder:text-muted-foreground placeholder:text-neutral-500",
102
- "default-disabled",
103
- i && (d === "left" ? "pl-10" : "pr-10"),
104
- t ? "default-error-border" : "default-border",
105
- r
106
- ),
107
- disabled: s,
108
- name: v,
109
- placeholder: L,
110
- readOnly: $,
111
- type: C,
112
- value: n,
113
- onChange: D,
114
- ...j
115
- }
116
- ),
117
- i !== "" && d === "right" ? /* @__PURE__ */ e.jsx("div", { className: "absolute right-3 flex items-center", children: /* @__PURE__ */ e.jsx(m, { icon: i, size: 0.8 }) }) : null
118
- ] });
119
- return /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-col gap-1", children: [
120
- h ? /* @__PURE__ */ e.jsx(H, { disabled: s, htmlFor: b, required: p, children: h }) : null,
121
- F,
122
- k && typeof w == "number" ? /* @__PURE__ */ e.jsxs("div", { className: "pointer-events-none mt-1 text-right text-xs text-neutral-400", children: [
123
- A,
124
- "/",
125
- w
126
- ] }) : null,
127
- l ? /* @__PURE__ */ e.jsx(J, { id: N, disabled: s, children: l }) : null,
128
- y ? /* @__PURE__ */ e.jsx(O, { id: f, children: a }) : null,
129
- B && Array.isArray(a) ? /* @__PURE__ */ e.jsx("div", { className: "mt-1 space-y-1", children: a.map((c, o) => /* @__PURE__ */ e.jsx(O, { id: `${f}-${o}`, children: c }, o)) }) : null
130
- ] });
131
- };
132
- export {
133
- U as O,
134
- V as a,
135
- O as b,
136
- H as c,
137
- J as d
138
- };
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
- }
4
- export {
5
- e as g
6
- };
@@ -1 +0,0 @@
1
- "use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}exports.getDefaultExportFromCjs=e;
@@ -1 +0,0 @@
1
- "use strict";exports.MOBILE_BREAKPOINT=768;
@@ -1,4 +0,0 @@
1
- const o = 768;
2
- export {
3
- o as M
4
- };
@@ -1,18 +0,0 @@
1
- const n = (a) => a.map((s) => ({
2
- message: s.message,
3
- code: s.extensions?.code || "UNKNOWN_ERROR",
4
- field: s.extensions?.field,
5
- path: s.path
6
- })), o = (a, s) => {
7
- a.forEach((e) => {
8
- e.field ? s.setError(e.field, e.message) : s.setError("", e.message);
9
- });
10
- }, t = (a, s) => {
11
- const e = n(a);
12
- o(e, s);
13
- };
14
- export {
15
- n as O,
16
- o as a,
17
- t as b
18
- };
@@ -1 +0,0 @@
1
- "use strict";const a=r=>r.map(s=>({message:s.message,code:s.extensions?.code||"UNKNOWN_ERROR",field:s.extensions?.field,path:s.path})),o=(r,s)=>{r.forEach(e=>{e.field?s.setError(e.field,e.message):s.setError("",e.message)})},n=(r,s)=>{const e=a(r);o(e,s)};exports.OxHandleFormErrors=o;exports.OxHandleGraphQLFormErrors=n;exports.OxParseGraphQLErrors=a;
@@ -1,12 +0,0 @@
1
- const f = (n) => {
2
- const t = Math.floor(((/* @__PURE__ */ new Date()).getTime() - n.getTime()) / (1e3 * 60));
3
- if (t < 1) return "just now";
4
- if (t < 60) return `${t}m ago`;
5
- const o = Math.floor(t / 60);
6
- if (o < 24) return `${o}h ago`;
7
- const r = Math.floor(o / 24);
8
- return r < 7 ? `${r}d ago` : n.toLocaleDateString();
9
- };
10
- export {
11
- f
12
- };
@@ -1 +0,0 @@
1
- "use strict";const e=n=>{const t=Math.floor((new Date().getTime()-n.getTime())/(1e3*60));if(t<1)return"just now";if(t<60)return`${t}m ago`;const o=Math.floor(t/60);if(o<24)return`${o}h ago`;const r=Math.floor(o/24);return r<7?`${r}d ago`:n.toLocaleDateString()};exports.formatTimestamp=e;