@noxickon/onyx 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/Button-CLMaoxRW.js +11054 -0
- package/dist/chunks/Button-CZYAHivj.js +20 -0
- package/dist/chunks/Input-BQQT5eZ0.js +138 -0
- package/dist/chunks/Input-DJZcvJdP.js +1 -0
- package/dist/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/chunks/_commonjsHelpers-DwGv2jUC.js +1 -0
- package/dist/chunks/constants-B1_n9ezb.js +1 -0
- package/dist/chunks/constants-CDXq37n6.js +4 -0
- package/dist/chunks/index-1-zQ3RaM.js +601 -0
- package/dist/chunks/index-BgUMV1hv.js +2129 -0
- package/dist/chunks/index-CjVXr8mh.js +2 -0
- package/dist/chunks/index-XTQUUzZ1.js +22 -0
- package/dist/chunks/isObject-BDHKUJKN.js +1 -0
- package/dist/chunks/isObject-vmP43YLW.js +6 -0
- package/dist/chunks/jsx-runtime-C5mzlN2N.js +284 -0
- package/dist/chunks/jsx-runtime-DUiatUiq.js +22 -0
- package/dist/chunks/useAuth-C-TIgBfr.js +61 -0
- package/dist/chunks/useAuth-CfKOZqhG.js +10 -0
- package/dist/chunks/useForm-BIKRbGHj.js +3085 -0
- package/dist/chunks/useForm-BZEaiRaa.js +26 -0
- package/dist/chunks/useQuery-B_ce5e8f.js +2 -0
- package/dist/chunks/useQuery-CJdYhuQu.js +1481 -0
- package/dist/context/context.cjs.js +1 -0
- package/dist/context/context.es.js +6 -0
- package/dist/context.d.ts +44 -0
- package/dist/hooks/hooks.cjs.js +6 -0
- package/dist/hooks/hooks.es.js +1917 -0
- package/dist/hooks.d.ts +130 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +148 -110
- package/dist/layout/layout.cjs.js +1 -0
- package/dist/layout/layout.es.js +264 -0
- package/dist/layout.d.ts +89 -0
- package/dist/onyx.cjs.js +12 -0
- package/dist/onyx.es.js +2523 -9494
- package/dist/pages/pages.cjs.js +7 -0
- package/dist/pages/pages.es.js +93 -0
- package/dist/pages.d.ts +14 -0
- package/dist/shared.css +104 -0
- package/package.json +41 -16
- package/dist/onyx.umd.js +0 -42
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/jsx-runtime-DUiatUiq.js");require("react");const i=require("../chunks/Button-CZYAHivj.js"),t=require("../chunks/Input-DJZcvJdP.js"),p=require("../chunks/useForm-BZEaiRaa.js"),m=require("../chunks/index-XTQUUzZ1.js"),c=m.gql`
|
|
2
|
+
mutation Login($input: LoginInput!) {
|
|
3
|
+
login(input: $input) {
|
|
4
|
+
isAuthenticated
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`,g=({className:o,mutation:a=c,onSubmit:n,subtitle:u="",title:d="noxickon"})=>{const e=p.useForm({initialData:{username:"",password:""},validationRules:{username:["required"],password:["required"]},operation:a}),l=async s=>{s.preventDefault(),e.submit({onSuccess:x=>{n==null||n(x)}})};return r.jsxRuntimeExports.jsx("div",{className:i.twMerge("w-80",o),children:r.jsxRuntimeExports.jsxs("div",{className:"rounded-lg border border-neutral-700 bg-zinc-900/50 p-6 backdrop-blur-xl",children:[r.jsxRuntimeExports.jsxs("div",{className:"mb-4 text-center",children:[r.jsxRuntimeExports.jsx("h1",{className:"px-2 font-mono text-2xl text-white",children:d}),r.jsxRuntimeExports.jsx("p",{className:"px-2 py-1 font-mono text-xs text-neutral-400",children:u})]}),r.jsxRuntimeExports.jsxs(t.OxForm,{className:"space-y-6",onSubmit:l,children:[r.jsxRuntimeExports.jsx(t.OxInput,{autoComplete:"off",disabled:e.isLoading,error:e.hasError("username"),icon:"mdiAccount",label:"username",name:"username",placeholder:"Enter your username",required:!0,type:"text",value:e.data.username,onChange:s=>e.setData("username",s.target.value)}),r.jsxRuntimeExports.jsx(t.OxInput,{autoComplete:"off",disabled:e.isLoading,error:e.hasError("password"),icon:"mdiLockOutline",label:"password",name:"password",placeholder:"Enter your password",required:!0,type:"password",value:e.data.password,onChange:s=>e.setData("password",s.target.value)}),e.hasErrors&&r.jsxRuntimeExports.jsx(t.OxErrorMessage,{icon:"mdiAlertCircleOutline",children:"username or password is wrong"}),r.jsxRuntimeExports.jsx(i.OxButton,{disabled:e.isLoading,fullWidth:!0,isLoading:e.isLoading,size:"md",type:"submit",variant:"primary",children:e.isLoading?"Signing in...":"Sign In"})]})]})})};exports.OxLogin=g;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { j as r } from "../chunks/jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { t as m, O as p } from "../chunks/Button-CLMaoxRW.js";
|
|
4
|
+
import { O as c, a as o, b as x } from "../chunks/Input-BQQT5eZ0.js";
|
|
5
|
+
import { u as g } from "../chunks/useForm-BIKRbGHj.js";
|
|
6
|
+
import { g as h } from "../chunks/index-BgUMV1hv.js";
|
|
7
|
+
const f = h`
|
|
8
|
+
mutation Login($input: LoginInput!) {
|
|
9
|
+
login(input: $input) {
|
|
10
|
+
isAuthenticated
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`, y = ({
|
|
14
|
+
className: t,
|
|
15
|
+
mutation: n = f,
|
|
16
|
+
onSubmit: a,
|
|
17
|
+
subtitle: i = "",
|
|
18
|
+
title: d = "noxickon"
|
|
19
|
+
}) => {
|
|
20
|
+
const e = g({
|
|
21
|
+
initialData: {
|
|
22
|
+
username: "",
|
|
23
|
+
password: ""
|
|
24
|
+
},
|
|
25
|
+
validationRules: {
|
|
26
|
+
username: ["required"],
|
|
27
|
+
password: ["required"]
|
|
28
|
+
},
|
|
29
|
+
operation: n
|
|
30
|
+
}), l = async (s) => {
|
|
31
|
+
s.preventDefault(), e.submit({
|
|
32
|
+
onSuccess: (u) => {
|
|
33
|
+
a == null || a(u);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ r.jsx("div", { className: m("w-80", t), children: /* @__PURE__ */ r.jsxs("div", { className: "rounded-lg border border-neutral-700 bg-zinc-900/50 p-6 backdrop-blur-xl", children: [
|
|
38
|
+
/* @__PURE__ */ r.jsxs("div", { className: "mb-4 text-center", children: [
|
|
39
|
+
/* @__PURE__ */ r.jsx("h1", { className: "px-2 font-mono text-2xl text-white", children: d }),
|
|
40
|
+
/* @__PURE__ */ r.jsx("p", { className: "px-2 py-1 font-mono text-xs text-neutral-400", children: i })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ r.jsxs(c, { className: "space-y-6", onSubmit: l, children: [
|
|
43
|
+
/* @__PURE__ */ r.jsx(
|
|
44
|
+
o,
|
|
45
|
+
{
|
|
46
|
+
autoComplete: "off",
|
|
47
|
+
disabled: e.isLoading,
|
|
48
|
+
error: e.hasError("username"),
|
|
49
|
+
icon: "mdiAccount",
|
|
50
|
+
label: "username",
|
|
51
|
+
name: "username",
|
|
52
|
+
placeholder: "Enter your username",
|
|
53
|
+
required: !0,
|
|
54
|
+
type: "text",
|
|
55
|
+
value: e.data.username,
|
|
56
|
+
onChange: (s) => e.setData("username", s.target.value)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ r.jsx(
|
|
60
|
+
o,
|
|
61
|
+
{
|
|
62
|
+
autoComplete: "off",
|
|
63
|
+
disabled: e.isLoading,
|
|
64
|
+
error: e.hasError("password"),
|
|
65
|
+
icon: "mdiLockOutline",
|
|
66
|
+
label: "password",
|
|
67
|
+
name: "password",
|
|
68
|
+
placeholder: "Enter your password",
|
|
69
|
+
required: !0,
|
|
70
|
+
type: "password",
|
|
71
|
+
value: e.data.password,
|
|
72
|
+
onChange: (s) => e.setData("password", s.target.value)
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
e.hasErrors && /* @__PURE__ */ r.jsx(x, { icon: "mdiAlertCircleOutline", children: "username or password is wrong" }),
|
|
76
|
+
/* @__PURE__ */ r.jsx(
|
|
77
|
+
p,
|
|
78
|
+
{
|
|
79
|
+
disabled: e.isLoading,
|
|
80
|
+
fullWidth: !0,
|
|
81
|
+
isLoading: e.isLoading,
|
|
82
|
+
size: "md",
|
|
83
|
+
type: "submit",
|
|
84
|
+
variant: "primary",
|
|
85
|
+
children: e.isLoading ? "Signing in..." : "Sign In"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] })
|
|
89
|
+
] }) });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
y as OxLogin
|
|
93
|
+
};
|
package/dist/pages.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import { DocumentNode } from 'graphql';
|
|
3
|
+
|
|
4
|
+
export declare const OxLogin: default_2.FC<OxLoginProps>;
|
|
5
|
+
|
|
6
|
+
export declare interface OxLoginProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
mutation?: DocumentNode;
|
|
9
|
+
onSubmit: (response: unknown) => void;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { }
|
package/dist/shared.css
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
--font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
3
|
+
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
|
|
4
|
+
|
|
5
|
+
--color-zinc-1000: #09090b;
|
|
6
|
+
|
|
7
|
+
--container-8xl: 88rem;
|
|
8
|
+
--container-9xl: 96rem;
|
|
9
|
+
--container-10xl: 104rem;
|
|
10
|
+
--container-12xl: 120rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@layer components {
|
|
14
|
+
.default-border {
|
|
15
|
+
@apply border border-neutral-700 transition-colors duration-150;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.default-error-border {
|
|
19
|
+
@apply border !border-rose-400;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.default-outset-focus {
|
|
23
|
+
@apply focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-700 focus-visible:ring-offset-1 focus-visible:ring-offset-zinc-900;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.default-inset-focus {
|
|
27
|
+
@apply focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-700 focus-visible:ring-inset;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.secondary-outset-focus {
|
|
31
|
+
@apply focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-500 focus-visible:ring-offset-1 focus-visible:ring-offset-zinc-900;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.secondary-inset-focus {
|
|
35
|
+
@apply focus:outline-none focus-visible:ring-2 focus-visible:ring-neutral-500 focus-visible:ring-inset;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.default-disabled {
|
|
39
|
+
@apply disabled:cursor-not-allowed disabled:text-neutral-500 disabled:hover:bg-transparent disabled:focus-visible:ring-0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
* {
|
|
43
|
+
scrollbar-width: thin;
|
|
44
|
+
scrollbar-color: color-mix(in oklab, var(--color-white) 25%, transparent) transparent;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
*::-webkit-scrollbar {
|
|
48
|
+
width: 12px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
*::-webkit-scrollbar-track {
|
|
52
|
+
background: transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
*::-webkit-scrollbar-thumb {
|
|
56
|
+
background-color: color-mix(in oklab, var(--color-white) 25%, transparent);
|
|
57
|
+
border-radius: 6px;
|
|
58
|
+
border: 3px solid transparent;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
62
|
+
background-color: color-mix(in oklab, var(--color-white) 40%, transparent);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@layer utilities {
|
|
67
|
+
@keyframes dropdownInBottom {
|
|
68
|
+
0% {
|
|
69
|
+
opacity: 0;
|
|
70
|
+
transform: translateY(-4px);
|
|
71
|
+
}
|
|
72
|
+
100% {
|
|
73
|
+
opacity: 1;
|
|
74
|
+
transform: translateY(0);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes dropdownInTop {
|
|
79
|
+
0% {
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transform: translateY(4px);
|
|
82
|
+
}
|
|
83
|
+
100% {
|
|
84
|
+
opacity: 1;
|
|
85
|
+
transform: translateY(0);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.animate-dropdown-in-bottom {
|
|
90
|
+
animation: dropdownInBottom 150ms ease-out forwards;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.animate-dropdown-in-top {
|
|
94
|
+
animation: dropdownInTop 150ms ease-out forwards;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
input:-webkit-autofill,
|
|
99
|
+
input:-webkit-autofill:hover,
|
|
100
|
+
input:-webkit-autofill:focus,
|
|
101
|
+
input:-webkit-autofill:active {
|
|
102
|
+
transition: background-color 5000s ease-in-out 0s;
|
|
103
|
+
-webkit-text-fill-color: white !important;
|
|
104
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noxickon/onyx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/onyx.umd.js",
|
|
6
6
|
"module": "./dist/onyx.es.js",
|
|
@@ -8,10 +8,27 @@
|
|
|
8
8
|
"style": "./dist/onyx.css",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/onyx.es.js"
|
|
13
13
|
},
|
|
14
|
-
"./
|
|
14
|
+
"./hooks": {
|
|
15
|
+
"types": "./dist/hooks.d.ts",
|
|
16
|
+
"import": "./dist/hooks/hooks.es.js"
|
|
17
|
+
},
|
|
18
|
+
"./pages": {
|
|
19
|
+
"types": "./dist/pages.d.ts",
|
|
20
|
+
"import": "./dist/pages/pages.es.js"
|
|
21
|
+
},
|
|
22
|
+
"./context": {
|
|
23
|
+
"types": "./dist/context.d.ts",
|
|
24
|
+
"import": "./dist/context/context.es.js"
|
|
25
|
+
},
|
|
26
|
+
"./layout": {
|
|
27
|
+
"types": "./dist/layout.d.ts",
|
|
28
|
+
"import": "./dist/layout/layout.es.js"
|
|
29
|
+
},
|
|
30
|
+
"./styles": "./dist/onyx.css",
|
|
31
|
+
"./shared": "./dist/shared.css"
|
|
15
32
|
},
|
|
16
33
|
"files": [
|
|
17
34
|
"dist"
|
|
@@ -19,32 +36,39 @@
|
|
|
19
36
|
"scripts": {
|
|
20
37
|
"dev": "storybook dev -p 6006",
|
|
21
38
|
"build": "tsc -b && vite build",
|
|
22
|
-
"prepublishOnly": "npm run test && npm run build",
|
|
39
|
+
"prepublishOnly": "npm run test:coverage && npm run build",
|
|
23
40
|
"lint": "eslint .",
|
|
24
41
|
"preview": "vite preview",
|
|
25
|
-
"build:storybook": "storybook build",
|
|
42
|
+
"build:storybook": "npm run build && storybook build",
|
|
26
43
|
"preview:storybook": "vite preview --outDir storybook-static",
|
|
27
44
|
"format": "prettier --write .",
|
|
28
45
|
"test": "vitest run",
|
|
29
|
-
"test:coverage": "vitest run --coverage"
|
|
46
|
+
"test:coverage": "vitest run --coverage",
|
|
47
|
+
"coverage:preview": "vite preview --outDir coverage"
|
|
30
48
|
},
|
|
31
49
|
"dependencies": {
|
|
50
|
+
"@apollo/client": "^3.13.8",
|
|
32
51
|
"@mdi/js": "^7.4.47",
|
|
33
52
|
"@mdi/react": "^1.6.1",
|
|
34
53
|
"@tailwindcss/vite": "^4.1.7",
|
|
35
|
-
"
|
|
54
|
+
"axios": "^1.10.0",
|
|
55
|
+
"es-toolkit": "^1.39.6",
|
|
56
|
+
"graphql": "^16.11.0",
|
|
36
57
|
"react": "^19.1.0",
|
|
37
58
|
"react-dom": "^19.1.0",
|
|
59
|
+
"react-router-dom": "^7.7.0",
|
|
38
60
|
"recharts": "^2.15.3",
|
|
39
|
-
"
|
|
61
|
+
"tailwind-merge": "^3.3.1",
|
|
62
|
+
"tailwindcss": "^4.1.7",
|
|
63
|
+
"zod": "^3.25.76"
|
|
40
64
|
},
|
|
41
65
|
"devDependencies": {
|
|
42
|
-
"@chromatic-com/storybook": "^4.0.
|
|
66
|
+
"@chromatic-com/storybook": "^4.0.1",
|
|
43
67
|
"@eslint/js": "^9.25.0",
|
|
44
|
-
"@storybook/addon-docs": "^9.0.
|
|
45
|
-
"@storybook/addon-onboarding": "^9.0.
|
|
46
|
-
"@storybook/addon-vitest": "^9.0.
|
|
47
|
-
"@storybook/react-vite": "^9.0.
|
|
68
|
+
"@storybook/addon-docs": "^9.0.18",
|
|
69
|
+
"@storybook/addon-onboarding": "^9.0.18",
|
|
70
|
+
"@storybook/addon-vitest": "^9.0.18",
|
|
71
|
+
"@storybook/react-vite": "^9.0.18",
|
|
48
72
|
"@tailwindcss/typography": "^0.5.16",
|
|
49
73
|
"@testing-library/jest-dom": "^6.6.3",
|
|
50
74
|
"@testing-library/react": "^16.3.0",
|
|
@@ -58,10 +82,11 @@
|
|
|
58
82
|
"@vitest/coverage-v8": "^3.1.4",
|
|
59
83
|
"canvas": "^3.1.0",
|
|
60
84
|
"eslint": "^9.25.0",
|
|
85
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
61
86
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
62
87
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
63
88
|
"eslint-plugin-sort-destructure-keys": "^2.0.0",
|
|
64
|
-
"eslint-plugin-storybook": "^9.0.
|
|
89
|
+
"eslint-plugin-storybook": "^9.0.18",
|
|
65
90
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
66
91
|
"globals": "^16.0.0",
|
|
67
92
|
"jest-axe": "^10.0.0",
|
|
@@ -69,7 +94,7 @@
|
|
|
69
94
|
"playwright": "^1.52.0",
|
|
70
95
|
"prettier": "^3.5.3",
|
|
71
96
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
72
|
-
"storybook": "^9.0.
|
|
97
|
+
"storybook": "^9.0.18",
|
|
73
98
|
"typescript": "~5.8.3",
|
|
74
99
|
"typescript-eslint": "^8.30.1",
|
|
75
100
|
"vite": "^6.3.5",
|