@noxickon/onyx 1.0.4 → 1.0.5
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.
- package/dist/chunks/hooks-B6Ov6Z0O.js +6487 -0
- package/dist/chunks/hooks-BGvU5VHk.js +27 -0
- package/dist/chunks/{query-D4FW3HN6.js → query-CIsrxNi-.js} +1 -1
- package/dist/chunks/{query-v272k9Fk.js → query-D2S9cFBP.js} +1 -1
- package/dist/chunks/ui-CZGrB58H.js +20 -0
- package/dist/chunks/ui-Dmzl3_Y3.js +20368 -0
- package/dist/contexts/contexts.cjs.js +2 -2
- package/dist/contexts/contexts.es.js +88 -86
- package/dist/hooks/hooks.cjs.js +1 -1
- package/dist/hooks/hooks.es.js +1 -1
- package/dist/layouts/layouts.cjs.js +1 -1
- package/dist/layouts/layouts.es.js +250 -249
- package/dist/onyx.cjs.js +1 -1
- package/dist/onyx.es.js +1 -1
- package/dist/pages/pages.cjs.js +2 -2
- package/dist/pages/pages.es.js +58 -56
- package/dist/routes/routes.cjs.js +1 -1
- package/dist/routes/routes.es.js +2 -2
- package/dist/utils/utils.cjs.js +1 -1
- package/dist/utils/utils.es.js +1 -1
- package/package.json +11 -5
- package/dist/chunks/hooks-BswtWYGK.js +0 -8624
- package/dist/chunks/hooks-DB942JYB.js +0 -48
- package/dist/chunks/ui-CWzo2o31.js +0 -20648
- package/dist/chunks/ui-DRaffjpU.js +0 -41
package/dist/onyx.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunks/ui-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./chunks/ui-CZGrB58H.js");exports.OxAccordion=x.OxAccordion;exports.OxAlert=x.OxAlert;exports.OxAvatar=x.OxAvatar;exports.OxBadge=x.OxBadge;exports.OxBreadcrumb=x.OxBreadcrumb;exports.OxButton=x.OxButton;exports.OxCalendar=x.OxCalendar;exports.OxCard=x.OxCard;exports.OxCheckbox=x.OxCheckbox;exports.OxDateInput=x.OxDateInput;exports.OxDescription=x.OxDescription;exports.OxDescriptionList=x.OxDescriptionList;exports.OxDialog=x.OxDialog;exports.OxDrawer=x.OxDrawer;exports.OxDropdown=x.OxDropdown;exports.OxError=x.OxError;exports.OxFileUpload=x.OxFileUpload;exports.OxFloating=x.OxFloating;exports.OxForm=x.OxForm;exports.OxHeading=x.OxHeading;exports.OxIcon=x.OxIcon;exports.OxJsonField=x.OxJsonField;exports.OxLabel=x.OxLabel;exports.OxLegend=x.OxLegend;exports.OxLink=x.OxLink;exports.OxNotifications=x.OxNotifications;exports.OxNumberInput=x.OxNumberInput;exports.OxOtpInput=x.OxOtpInput;exports.OxPagination=x.OxPagination;exports.OxPopover=x.OxPopover;exports.OxProgress=x.OxProgress;exports.OxRadio=x.OxRadio;exports.OxSelect=x.OxSelect;exports.OxSeparator=x.OxSeparator;exports.OxSkeleton=x.OxSkeleton;exports.OxSkeletonText=x.OxSkeletonText;exports.OxSlider=x.OxSlider;exports.OxSpinner=x.OxSpinner;exports.OxStatusDisplay=x.OxStatusDisplay;exports.OxStepper=x.OxStepper;exports.OxSwitch=x.OxSwitch;exports.OxTable=x.OxTable;exports.OxTabs=x.OxTabs;exports.OxTextInput=x.OxTextInput;exports.OxTextarea=x.OxTextarea;exports.OxTimeInput=x.OxTimeInput;exports.OxTimeline=x.OxTimeline;exports.OxToast=x.OxToast;exports.OxToastProvider=x.OxToastProvider;exports.OxToggle=x.OxToggle;exports.OxTooltip=x.OxTooltip;exports.useOxToast=x.useOxToast;
|
package/dist/onyx.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as x, a as O, b as e, c as o, d as t, e as r, f as i, g as n, I as p, L as l, V as d, h as T, o as c, i as u, j as g, W as S, J as D, k as b, K as m, X as I, l as k, m as F, Y as L, Z as P, n as v, p as w, M as A, N as B, q as C, r as f, s as h, R as N, S as y, t as E, u as H, v as J, w as R, x as U, y as j, z as q, T as z, A as G, B as K, P as M, U as Q, Q as V, C as W, F as X, D as Y, G as Z, H as _, E as $ } from "./chunks/ui-
|
|
1
|
+
import { O as x, a as O, b as e, c as o, d as t, e as r, f as i, g as n, I as p, L as l, V as d, h as T, o as c, i as u, j as g, W as S, J as D, k as b, K as m, X as I, l as k, m as F, Y as L, Z as P, n as v, p as w, M as A, N as B, q as C, r as f, s as h, R as N, S as y, t as E, u as H, v as J, w as R, x as U, y as j, z as q, T as z, A as G, B as K, P as M, U as Q, Q as V, C as W, F as X, D as Y, G as Z, H as _, E as $ } from "./chunks/ui-Dmzl3_Y3.js";
|
|
2
2
|
export {
|
|
3
3
|
x as OxAccordion,
|
|
4
4
|
O as OxAlert,
|
package/dist/pages/pages.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/ui-CZGrB58H.js"),e=require("react/jsx-runtime"),m=require("@apollo/client");require("react");const p=require("../chunks/hooks-BGvU5VHk.js"),g=require("../chunks/query-CIsrxNi-.js"),h=m.gql`
|
|
2
2
|
mutation Login($input: LoginInput!) {
|
|
3
3
|
login(input: $input) {
|
|
4
4
|
success
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
`,j=({cacheQuery:
|
|
13
|
+
`,j=({cacheQuery:a=g.DEFAULT_GET_CURRENT_USER,className:t,mutation:u=h,onSubmit:l,subtitle:o="",title:d="noxickon",...c})=>{const s=p.useForm({initialData:{username:"",password:""},validationRules:{username:["required"],password:["required"]},operation:u,options:{update:(i,{data:n})=>{n?.login.success&&i.writeQuery({query:a,data:{me:n.login.me}})}}}),x=async i=>{i.preventDefault(),s.submit({onError:n=>{r.handleGraphQLFormErrors(n,s)},onSuccess:n=>{n.data&&n.data.login.success?l?.(n):console.error("Login failed: Invalid credentials")}})};return e.jsx("div",{className:r.cn("w-80",t),...c,children:e.jsxs("div",{className:"ox-gray-border rounded-lg bg-gray-50 p-6",children:[e.jsxs("div",{className:"mb-4 text-center",children:[e.jsx("h1",{className:"text-gray-1200 px-2 font-mono text-2xl",children:d}),o?e.jsx("p",{className:"px-2 py-1 font-mono text-xs",children:o}):null]}),e.jsxs(r.OxForm,{className:"space-y-6",onSubmit:x,children:[e.jsxs(r.OxForm.Field,{children:[e.jsx(r.OxLabel,{children:"username"}),e.jsxs(r.OxTextInput.Container,{disabled:s.isLoading,error:s.hasError("username"),required:!0,value:s.data.username,onChange:i=>s.setData("username",i),children:[e.jsx(r.OxTextInput.Icon,{path:"mdiAccount"}),e.jsx(r.OxTextInput,{autoComplete:"off",name:"username",placeholder:"Enter your username"})]})]}),e.jsxs(r.OxForm.Field,{children:[e.jsx(r.OxLabel,{children:"password"}),e.jsxs(r.OxTextInput.Container,{disabled:s.isLoading,error:s.hasError("password"),required:!0,type:"password",value:s.data.password,onChange:i=>s.setData("password",i),children:[e.jsx(r.OxTextInput.Icon,{path:"mdiLockOutline"}),e.jsx(r.OxTextInput,{autoComplete:"off",name:"password",placeholder:"Enter your password"}),e.jsx(r.OxTextInput.VisibilityButton,{})]})]}),s.hasErrors?e.jsx(r.OxError,{icon:"mdiAlertCircleOutline",children:"username or password is wrong"}):null,e.jsx(r.OxButton,{disabled:s.isLoading,fullWidth:!0,isLoading:s.isLoading,size:"sm",type:"submit",variant:"primary",children:s.isLoading?"Signing in...":"Sign In"})]})]})})};exports.OxLogin=j;
|
package/dist/pages/pages.es.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as x, K as s, Y as d, P as i, W as f, e as L, $ as y } from "../chunks/ui-Dmzl3_Y3.js";
|
|
2
|
+
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import { gql as w } from "@apollo/client";
|
|
2
4
|
import "react";
|
|
3
|
-
import { l as
|
|
4
|
-
import { D as
|
|
5
|
-
const
|
|
5
|
+
import { l as E } from "../chunks/hooks-B6Ov6Z0O.js";
|
|
6
|
+
import { D as b } from "../chunks/query-D2S9cFBP.js";
|
|
7
|
+
const O = w`
|
|
6
8
|
mutation Login($input: LoginInput!) {
|
|
7
9
|
login(input: $input) {
|
|
8
10
|
success
|
|
@@ -14,16 +16,16 @@ const E = y`
|
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
`,
|
|
18
|
-
cacheQuery:
|
|
19
|
-
className:
|
|
20
|
-
mutation: u =
|
|
21
|
-
onSubmit:
|
|
22
|
-
subtitle:
|
|
23
|
-
title:
|
|
24
|
-
...
|
|
19
|
+
`, F = ({
|
|
20
|
+
cacheQuery: l = b,
|
|
21
|
+
className: m,
|
|
22
|
+
mutation: u = O,
|
|
23
|
+
onSubmit: c,
|
|
24
|
+
subtitle: t = "",
|
|
25
|
+
title: p = "noxickon",
|
|
26
|
+
...h
|
|
25
27
|
}) => {
|
|
26
|
-
const
|
|
28
|
+
const e = E({
|
|
27
29
|
initialData: {
|
|
28
30
|
username: "",
|
|
29
31
|
password: ""
|
|
@@ -34,81 +36,81 @@ const E = y`
|
|
|
34
36
|
},
|
|
35
37
|
operation: u,
|
|
36
38
|
options: {
|
|
37
|
-
update: (
|
|
38
|
-
|
|
39
|
-
query:
|
|
40
|
-
data: { me:
|
|
39
|
+
update: (n, { data: a }) => {
|
|
40
|
+
a?.login.success && n.writeQuery({
|
|
41
|
+
query: l,
|
|
42
|
+
data: { me: a.login.me }
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
onError: (
|
|
47
|
-
|
|
46
|
+
}), g = async (n) => {
|
|
47
|
+
n.preventDefault(), e.submit({
|
|
48
|
+
onError: (a) => {
|
|
49
|
+
y(a, e);
|
|
48
50
|
},
|
|
49
|
-
onSuccess: (
|
|
50
|
-
|
|
51
|
+
onSuccess: (a) => {
|
|
52
|
+
a.data && a.data.login.success ? c?.(a) : console.error("Login failed: Invalid credentials");
|
|
51
53
|
}
|
|
52
54
|
});
|
|
53
55
|
};
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
56
|
+
return /* @__PURE__ */ r("div", { className: x("w-80", m), ...h, children: /* @__PURE__ */ o("div", { className: "ox-gray-border rounded-lg bg-gray-50 p-6", children: [
|
|
57
|
+
/* @__PURE__ */ o("div", { className: "mb-4 text-center", children: [
|
|
58
|
+
/* @__PURE__ */ r("h1", { className: "text-gray-1200 px-2 font-mono text-2xl", children: p }),
|
|
59
|
+
t ? /* @__PURE__ */ r("p", { className: "px-2 py-1 font-mono text-xs", children: t }) : null
|
|
58
60
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
61
|
+
/* @__PURE__ */ o(s, { className: "space-y-6", onSubmit: g, children: [
|
|
62
|
+
/* @__PURE__ */ o(s.Field, { children: [
|
|
63
|
+
/* @__PURE__ */ r(d, { children: "username" }),
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
i.Container,
|
|
64
66
|
{
|
|
65
|
-
disabled:
|
|
66
|
-
error:
|
|
67
|
+
disabled: e.isLoading,
|
|
68
|
+
error: e.hasError("username"),
|
|
67
69
|
required: !0,
|
|
68
|
-
value:
|
|
69
|
-
onChange: (
|
|
70
|
+
value: e.data.username,
|
|
71
|
+
onChange: (n) => e.setData("username", n),
|
|
70
72
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ r(i.Icon, { path: "mdiAccount" }),
|
|
74
|
+
/* @__PURE__ */ r(i, { autoComplete: "off", name: "username", placeholder: "Enter your username" })
|
|
73
75
|
]
|
|
74
76
|
}
|
|
75
77
|
)
|
|
76
78
|
] }),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
79
|
+
/* @__PURE__ */ o(s.Field, { children: [
|
|
80
|
+
/* @__PURE__ */ r(d, { children: "password" }),
|
|
81
|
+
/* @__PURE__ */ o(
|
|
82
|
+
i.Container,
|
|
81
83
|
{
|
|
82
|
-
disabled:
|
|
83
|
-
error:
|
|
84
|
+
disabled: e.isLoading,
|
|
85
|
+
error: e.hasError("password"),
|
|
84
86
|
required: !0,
|
|
85
87
|
type: "password",
|
|
86
|
-
value:
|
|
87
|
-
onChange: (
|
|
88
|
+
value: e.data.password,
|
|
89
|
+
onChange: (n) => e.setData("password", n),
|
|
88
90
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ r(i.Icon, { path: "mdiLockOutline" }),
|
|
92
|
+
/* @__PURE__ */ r(i, { autoComplete: "off", name: "password", placeholder: "Enter your password" }),
|
|
93
|
+
/* @__PURE__ */ r(i.VisibilityButton, {})
|
|
92
94
|
]
|
|
93
95
|
}
|
|
94
96
|
)
|
|
95
97
|
] }),
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
98
|
+
e.hasErrors ? /* @__PURE__ */ r(f, { icon: "mdiAlertCircleOutline", children: "username or password is wrong" }) : null,
|
|
99
|
+
/* @__PURE__ */ r(
|
|
100
|
+
L,
|
|
99
101
|
{
|
|
100
|
-
disabled:
|
|
102
|
+
disabled: e.isLoading,
|
|
101
103
|
fullWidth: !0,
|
|
102
|
-
isLoading:
|
|
104
|
+
isLoading: e.isLoading,
|
|
103
105
|
size: "sm",
|
|
104
106
|
type: "submit",
|
|
105
107
|
variant: "primary",
|
|
106
|
-
children:
|
|
108
|
+
children: e.isLoading ? "Signing in..." : "Sign In"
|
|
107
109
|
}
|
|
108
110
|
)
|
|
109
111
|
] })
|
|
110
112
|
] }) });
|
|
111
113
|
};
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
F as OxLogin
|
|
114
116
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/ui-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../chunks/ui-CZGrB58H.js");const o=require("../chunks/useAuth-DxoDe3YA.js"),s=require("../chunks/hooks-BGvU5VHk.js"),i=({children:t,onAuthenticated:u=null,onLoading:n=null})=>{const{isLoggedIn:e,loading:r}=o.useOxAuth();return r?n:e?u:t},c=({children:t,onLoading:u=null,onUnauthenticated:n=null})=>{const{isLoggedIn:e,loading:r}=o.useOxAuth();return r?u:e?t:n},d=({children:t,onLoading:u=null,onUnauthorized:n=null,roles:e=["admin"]})=>{const{loading:r,user:l}=o.useOxAuth();return r?u:!l||s.isEmpty(e)||!e.includes(l.role)?n:t};exports.OxGuestRoute=i;exports.OxProtectedRoute=c;exports.OxRoleRoute=d;
|
package/dist/routes/routes.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../chunks/ui-
|
|
1
|
+
import "../chunks/ui-Dmzl3_Y3.js";
|
|
2
2
|
import { u as o } from "../chunks/useAuth-BFgXzu6Q.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as l } from "../chunks/hooks-B6Ov6Z0O.js";
|
|
4
4
|
const f = ({
|
|
5
5
|
children: t,
|
|
6
6
|
onAuthenticated: r = null,
|
package/dist/utils/utils.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/ui-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/ui-CZGrB58H.js");exports.buildMailTo=r.buildMailTo;exports.buildUrl=r.buildUrl;exports.cn=r.cn;exports.copyToClipboard=r.copyToClipboard;exports.createId=r.createId;exports.formatBytes=r.formatBytes;exports.formatCurrency=r.formatCurrency;exports.formatDate=r.formatDate;exports.formatNumber=r.formatNumber;exports.formatTimestamp=r.formatTimestamp;exports.generateRandomString=r.generateRandomString;exports.handleFormErrors=r.handleFormErrors;exports.handleGraphQLFormErrors=r.handleGraphQLFormErrors;exports.hasDataSlot=r.hasDataSlot;exports.parseGraphQLErrors=r.parseGraphQLErrors;exports.scrollToElement=r.scrollToElement;exports.validateEmail=r.validateEmail;exports.validatePhone=r.validatePhone;exports.validateUrl=r.validateUrl;
|
package/dist/utils/utils.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a3 as s, a2 as e, _ as o, a4 as t, a5 as l, a9 as m, aa as d, ab as i, ac as n, ad as f, a6 as h, a7 as p, $ as c, ae as b, a8 as E, af as u, ag as T, ai as g, ah as v } from "../chunks/ui-Dmzl3_Y3.js";
|
|
2
2
|
export {
|
|
3
3
|
s as buildMailTo,
|
|
4
4
|
e as buildUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxickon/onyx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/onyx.umd.js",
|
|
6
6
|
"module": "./dist/onyx.es.js",
|
|
@@ -61,8 +61,13 @@
|
|
|
61
61
|
"test:coverage": "vitest run --coverage",
|
|
62
62
|
"coverage:preview": "vite preview --outDir coverage"
|
|
63
63
|
},
|
|
64
|
-
"
|
|
64
|
+
"peerDependencies": {
|
|
65
65
|
"@apollo/client": "^4.0.0",
|
|
66
|
+
"graphql": "^16.0.0",
|
|
67
|
+
"react": "^19.0.0",
|
|
68
|
+
"react-dom": "^19.0.0"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
66
71
|
"@mdi/js": "^7.4.47",
|
|
67
72
|
"@mdi/react": "^1.6.1",
|
|
68
73
|
"@tailwindcss/vite": "^4.1.11",
|
|
@@ -71,15 +76,13 @@
|
|
|
71
76
|
"colord": "^2.9.3",
|
|
72
77
|
"date-fns": "^4.1.0",
|
|
73
78
|
"es-toolkit": "^1.39.8",
|
|
74
|
-
"graphql": "^16.11.0",
|
|
75
|
-
"react": "^19.1.1",
|
|
76
|
-
"react-dom": "^19.1.1",
|
|
77
79
|
"recharts": "^3.1.0",
|
|
78
80
|
"tailwind-merge": "^3.3.1",
|
|
79
81
|
"tailwindcss": "^4.1.11",
|
|
80
82
|
"zod": "^4.0.14"
|
|
81
83
|
},
|
|
82
84
|
"devDependencies": {
|
|
85
|
+
"@apollo/client": "^4.0.0",
|
|
83
86
|
"@chromatic-com/storybook": "^4.1.1",
|
|
84
87
|
"@eslint/js": "^9.32.0",
|
|
85
88
|
"@storybook/addon-docs": "^9.1.10",
|
|
@@ -104,11 +107,14 @@
|
|
|
104
107
|
"eslint-plugin-storybook": "^9.1.10",
|
|
105
108
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
106
109
|
"globals": "^16.3.0",
|
|
110
|
+
"graphql": "^16.11.0",
|
|
107
111
|
"jest-axe": "^10.0.0",
|
|
108
112
|
"jsdom": "^27.0.0",
|
|
109
113
|
"playwright": "^1.54.2",
|
|
110
114
|
"prettier": "^3.6.2",
|
|
111
115
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
116
|
+
"react": "^19.1.1",
|
|
117
|
+
"react-dom": "^19.1.1",
|
|
112
118
|
"storybook": "^9.1.10",
|
|
113
119
|
"typescript": "^5.9.2",
|
|
114
120
|
"typescript-eslint": "^8.38.0",
|