@colveor/create-admin 0.0.0-stage → 0.5.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.
Files changed (34) hide show
  1. package/LICENSE.md +106 -0
  2. package/index.js +77 -0
  3. package/package.json +24 -4
  4. package/template/README.md +19 -0
  5. package/template/TAILADMIN-LICENSE +21 -0
  6. package/template/TAILWINDADMIN-LICENSE +21 -0
  7. package/template/admin.config.ts +11 -0
  8. package/template/app/(admin)/(colveor)/audit/page.tsx +1 -0
  9. package/template/app/(admin)/(colveor)/ledger/page.tsx +1 -0
  10. package/template/app/(admin)/(colveor)/roles/page.tsx +1 -0
  11. package/template/app/(admin)/(colveor)/settings/page.tsx +1 -0
  12. package/template/app/(admin)/(colveor)/status/page.tsx +1 -0
  13. package/template/app/(admin)/(colveor)/support/page.tsx +1 -0
  14. package/template/app/(admin)/(colveor)/teams/page.tsx +1 -0
  15. package/template/app/(admin)/(colveor)/users/page.tsx +1 -0
  16. package/template/app/(admin)/(colveor)/webhooks/page.tsx +1 -0
  17. package/template/app/(admin)/(project)/.gitkeep +0 -0
  18. package/template/app/(admin)/account/page.tsx +1 -0
  19. package/template/app/(admin)/layout.tsx +7 -0
  20. package/template/app/(admin)/page.tsx +15 -0
  21. package/template/app/api/colveor/[...path]/route.ts +9 -0
  22. package/template/app/forgot-password/page.tsx +1 -0
  23. package/template/app/globals.css +283 -0
  24. package/template/app/layout.tsx +25 -0
  25. package/template/app/login/page.tsx +1 -0
  26. package/template/app/providers.tsx +14 -0
  27. package/template/components/frame.tsx +200 -0
  28. package/template/components/theme.tsx +41 -0
  29. package/template/env.example +2 -0
  30. package/template/gitignore +4 -0
  31. package/template/package.json +24 -0
  32. package/template/postcss.config.mjs +1 -0
  33. package/template/tsconfig.json +26 -0
  34. package/README.md +0 -3
package/LICENSE.md ADDED
@@ -0,0 +1,106 @@
1
+ # Colveor Go — Proprietary Software License
2
+
3
+ **Copyright © 2026. All rights reserved.**
4
+
5
+ - **Software:** Colveor Go
6
+ - **License Type:** Proprietary
7
+ - **Usage:** Restricted — All rights reserved
8
+
9
+ ---
10
+
11
+ ## 1. Ownership and Intellectual Property
12
+
13
+ Colveor Go, including its source code, object code, architecture, algorithms, documentation, and associated materials, is proprietary software.
14
+
15
+ All rights, title, and interest in the software remain with the respective copyright owner, except for rights expressly granted in a separate written agreement.
16
+
17
+ No ownership, copyright, or intellectual property rights are transferred to any user, licensee, client, organization, or third party by accessing or using the software.
18
+
19
+ ## 2. Limited Permission to Use
20
+
21
+ The copyright owner may grant specific individuals, organizations, or projects permission to access and use Colveor Go for authorized purposes.
22
+
23
+ Unless otherwise agreed in a separate written license, such permission is:
24
+
25
+ - **Limited** to the authorized purpose.
26
+ - **Non-exclusive**, meaning the copyright owner may authorize others.
27
+ - **Non-transferable**, meaning the recipient cannot transfer the permission to another party.
28
+ - **Revocable**, subject to applicable law and contractual obligations.
29
+
30
+ Access to the repository does not automatically grant permission to use the software for unrelated projects or purposes outside the authorized scope.
31
+
32
+ ## 3. Restrictions
33
+
34
+ Unless expressly authorized in writing by the copyright owner, no recipient may:
35
+
36
+ - Redistribute, publish, sublicense, sell, rent, lease, or commercially exploit the software or substantial portions of it.
37
+ - Copy or incorporate the software into another product for distribution outside the authorized scope.
38
+ - Modify, adapt, reverse engineer, decompile, or disassemble the software, except to the extent such restrictions are prohibited by applicable law or expressly permitted in writing.
39
+ - Remove or alter copyright notices, ownership notices, or license terms.
40
+ - Claim authorship or ownership of the original software or its proprietary components.
41
+ - Share repository access, credentials, source code, or copies with unauthorized persons.
42
+ - Use protected confidential information or materials to create or distribute an unauthorized competing implementation.
43
+
44
+ ## 4. Client Projects and Third-Party Access
45
+
46
+ Permission to access or use Colveor Go for one project does not automatically authorize its use in other projects.
47
+
48
+ Any client, contractor, organization, or third party must obtain the appropriate authorization before accessing or using the software.
49
+
50
+ A separate written agreement may specify:
51
+
52
+ - Permitted projects and users.
53
+ - Authorized deployment environments.
54
+ - Modification and distribution rights.
55
+ - Commercial usage terms.
56
+ - Ownership of customizations and derivative works.
57
+
58
+ The copyright owner retains ownership of Colveor Go unless a separate written agreement expressly states otherwise.
59
+
60
+ ## 5. Contributions and Modifications
61
+
62
+ No contribution, modification, enhancement, or derivative work automatically transfers ownership of the original Colveor Go software.
63
+
64
+ Ownership of contributions and derivative works will be determined by applicable law and any relevant written agreements between the parties.
65
+
66
+ Recipients may not assume that permission to modify the software grants permission to distribute their modifications.
67
+
68
+ ## 6. Confidentiality
69
+
70
+ Where the software or related materials are disclosed as confidential information under an applicable agreement or law, recipients must protect that information and must not disclose or use it beyond the authorized purpose.
71
+
72
+ This section does not independently make information confidential where it is not otherwise protected by applicable law or agreement.
73
+
74
+ ## 7. Termination
75
+
76
+ Permission to use the software may be terminated in accordance with the applicable license agreement and law, including where a recipient materially breaches its terms.
77
+
78
+ Upon termination, the recipient must stop using the software and, where legally required or contractually agreed, return or securely delete unauthorized copies, subject to applicable legal retention obligations.
79
+
80
+ Termination does not extinguish rights or obligations that accrued before termination or provisions that are intended to survive termination.
81
+
82
+ ## 8. Disclaimer of Warranty
83
+
84
+ To the maximum extent permitted by applicable law, the software is provided **"AS IS"** and **"AS AVAILABLE,"** without warranties of any kind, whether express or implied, including warranties of merchantability, fitness for a particular purpose, and non-infringement.
85
+
86
+ ## 9. Limitation of Liability
87
+
88
+ To the maximum extent permitted by applicable law, the copyright owner shall not be liable for indirect, incidental, special, consequential, or punitive damages arising from the use of or inability to use the software.
89
+
90
+ Nothing in this license excludes or limits liability that cannot lawfully be excluded or limited.
91
+
92
+ ## 10. Reservation of Rights
93
+
94
+ All rights not expressly granted in writing are reserved by the copyright owner.
95
+
96
+ Nothing in this license grants a patent license, trademark license, or other intellectual property license except as expressly stated.
97
+
98
+ ## 11. Governing Law
99
+
100
+ The governing law and dispute-resolution arrangements shall be those specified in a separately executed written agreement. In the absence of such an agreement, applicable law will determine the governing law and competent forum.
101
+
102
+ ---
103
+
104
+ ## All Rights Reserved
105
+
106
+ Unauthorized use, copying, modification, or distribution may violate applicable intellectual property laws and contractual obligations.
package/index.js ADDED
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ // npm create @colveor/admin <dir>: a new admin panel from the template
3
+ // (the package @colveor/create-admin)
4
+ // (docs/admin.md in colveor-go, Creating a panel).
5
+ //
6
+ // --admin <path> use a local @colveor/admin (a colveor-go checkout's
7
+ // admin/packages/admin) instead of the published one
8
+ // --no-install copy only
9
+
10
+ import { spawnSync } from "node:child_process";
11
+ import { cpSync, existsSync, readdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
12
+ import { basename, dirname, join, relative, resolve } from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
+
15
+ const here = dirname(fileURLToPath(import.meta.url));
16
+ const { version } = JSON.parse(readFileSync(join(here, "package.json"), "utf8"));
17
+
18
+ const args = process.argv.slice(2);
19
+ const flag = (name) => {
20
+ const i = args.indexOf(name);
21
+ return i === -1 ? undefined : (args.splice(i, name === "--admin" ? 2 : 1)[1] ?? "");
22
+ };
23
+ const localAdmin = flag("--admin");
24
+ const noInstall = flag("--no-install") !== undefined;
25
+ const [target] = args;
26
+
27
+ if (target === undefined || target.startsWith("-") || args.length > 1) {
28
+ console.error("usage: npm create @colveor/admin <dir> [-- --admin <path>] [--no-install]");
29
+ process.exit(2);
30
+ }
31
+ const dir = resolve(target);
32
+ if (existsSync(dir) && readdirSync(dir).length > 0) {
33
+ console.error(`${target} exists and is not empty`);
34
+ process.exit(1);
35
+ }
36
+
37
+ cpSync(join(here, "template"), dir, { recursive: true });
38
+ // npm leaves these out of a published package under their real names.
39
+ renameSync(join(dir, "gitignore"), join(dir, ".gitignore"));
40
+ renameSync(join(dir, "env.example"), join(dir, ".env.example"));
41
+
42
+ const name = basename(dir)
43
+ .toLowerCase()
44
+ .replace(/[^a-z0-9-]+/g, "-");
45
+ const title = basename(dir)
46
+ .split(/[-_\s]+/)
47
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
48
+ .join(" ");
49
+ // The package of the same release as this command, or a local one.
50
+ const admin = localAdmin ? `file:${relative(dir, resolve(localAdmin))}` : `~${version}`;
51
+
52
+ for (const file of ["package.json", "admin.config.ts", "README.md"]) {
53
+ const path = join(dir, file);
54
+ writeFileSync(
55
+ path,
56
+ readFileSync(path, "utf8")
57
+ .replaceAll("__NAME__", name)
58
+ .replaceAll("__TITLE__", `${title} Admin`)
59
+ .replaceAll("__ADMIN__", admin),
60
+ );
61
+ }
62
+
63
+ if (!noInstall) {
64
+ const npm = process.platform === "win32" ? "npm.cmd" : "npm";
65
+ const res = spawnSync(npm, ["install"], { cwd: dir, stdio: "inherit" });
66
+ if (res.status !== 0) {
67
+ console.error("npm install failed: run it again in the new folder");
68
+ process.exit(1);
69
+ }
70
+ }
71
+
72
+ console.log(`
73
+ Created ${target}. Next:
74
+ cd ${target}
75
+ cp .env.example .env.local # COLVEOR_API_URL: the API
76
+ npm run dev
77
+ `);
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@colveor/create-admin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.5.2",
4
+ "description": "Creates an admin panel for an app built on colveor-go.",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "type": "module",
7
+ "bin": {
8
+ "create-admin": "index.js"
9
+ },
10
+ "files": [
11
+ "index.js",
12
+ "template",
13
+ "LICENSE.md"
14
+ ],
15
+ "scripts": {
16
+ "test": "node --test test/*.test.js",
17
+ "check": "npm test",
18
+ "e2e": "sh test/e2e.sh"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ }
26
+ }
@@ -0,0 +1,19 @@
1
+ # **TITLE**
2
+
3
+ The admin panel of a colveor-go API, made with `npm create @colveor/admin`.
4
+
5
+ ```sh
6
+ cp .env.example .env.local # COLVEOR_API_URL: the API
7
+ npm run dev # http://localhost:3000
8
+ ```
9
+
10
+ - `admin.config.ts`: the panel's name, logo and your menu items.
11
+ - `app/(admin)/(project)/`: your own pages. They use the building blocks
12
+ of `@colveor/admin` (`api`, `useAction`, `DataTable`, `RequirePermission`).
13
+ - `app/(admin)/(colveor)/`: the framework's pages, each a one-line
14
+ re-export from `@colveor/admin`. `npm update @colveor/admin` updates them.
15
+ - `components/frame.tsx`: the menu and header. Yours to change.
16
+ - The API must trust this server's address in `SERVER_TRUSTED_PROXIES`, or
17
+ every admin shares one IP for its rate limits.
18
+
19
+ The look is TailAdmin's free Next.js template (MIT, `TAILADMIN-LICENSE`).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 TailAdmin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tailwindadmin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from "@colveor/admin";
2
+
3
+ // The panel's name, logo and the project's own menu items, after the
4
+ // framework's (docs/admin.md in colveor-go). An item is shown only to users
5
+ // holding its permission.
6
+ export default defineConfig({
7
+ name: "__TITLE__",
8
+ nav: [
9
+ // { label: "Invoices", href: "/invoices", permission: "invoices.read" },
10
+ ],
11
+ });
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/audit";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/ledger";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/roles";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/settings";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/status";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/support";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/teams";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/users";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/webhooks";
File without changes
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/account";
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ import Frame from "../../components/frame";
3
+
4
+ // Every page but sign-in: the menu and the header around it.
5
+ export default function AdminLayout({ children }: { children: ReactNode }) {
6
+ return <Frame>{children}</Frame>;
7
+ }
@@ -0,0 +1,15 @@
1
+ "use client";
2
+
3
+ import { useAdmin } from "@colveor/admin";
4
+
5
+ export default function Home() {
6
+ const { config } = useAdmin();
7
+ return (
8
+ <div className="rounded-2xl border border-gray-200 bg-white p-6 dark:border-gray-800 dark:bg-white/[0.03]">
9
+ <h1 className="text-xl font-medium text-gray-800 dark:text-white/90">{config.name}</h1>
10
+ <p className="mt-2 text-sm text-gray-500 dark:text-gray-400">
11
+ Pick a page in the menu. Your own pages go in app/(admin)/(project)/.
12
+ </p>
13
+ </div>
14
+ );
15
+ }
@@ -0,0 +1,9 @@
1
+ // Every call from the panel to the API goes through here, with the
2
+ // tokens kept in httpOnly cookies (docs/admin.md in colveor-go).
3
+ export {
4
+ handler as DELETE,
5
+ handler as GET,
6
+ handler as PATCH,
7
+ handler as POST,
8
+ handler as PUT,
9
+ } from "@colveor/admin/proxy";
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/forgot-password";
@@ -0,0 +1,283 @@
1
+ /* The theme of TailAdmin (free Next.js version, MIT: TAILADMIN-LICENSE),
2
+ from its src/app/globals.css: tokens, base styles and menu utilities.
3
+ The styles of charts, calendars and maps it doesn't use are left out. */
4
+ @import "tailwindcss";
5
+ @plugin "@tailwindcss/forms";
6
+
7
+ /* The @colveor/admin pages use these classes too. */
8
+ @source "../node_modules/@colveor/admin/dist";
9
+
10
+ @custom-variant dark (&:is(.dark *));
11
+
12
+ @theme {
13
+ --font-*: initial;
14
+ --font-rounded: "M PLUS Rounded 1c", sans-serif;
15
+
16
+ --breakpoint-*: initial;
17
+ --breakpoint-2xsm: 375px;
18
+ --breakpoint-xsm: 425px;
19
+ --breakpoint-3xl: 2000px;
20
+ --breakpoint-sm: 640px;
21
+ --breakpoint-md: 768px;
22
+ --breakpoint-lg: 1024px;
23
+ --breakpoint-xl: 1280px;
24
+ --breakpoint-2xl: 1536px;
25
+
26
+ --text-heading-one: 64px;
27
+ --text-heading-one--line-height: 80px;
28
+ --text-heading-two: 56px;
29
+ --text-heading-two--line-height: 72px;
30
+ --text-heading-three: 48px;
31
+ --text-heading-three--line-height: 60px;
32
+ --text-heading-four: 40px;
33
+ --text-heading-four--line-height: 48px;
34
+ --text-heading-five: 32px;
35
+ --text-heading-five--line-height: 40px;
36
+ --text-heading-six: 24px;
37
+ --text-heading-six--line-height: 32px;
38
+
39
+ --text-title-lg: 20px;
40
+ --text-title-lg--line-height: 30px;
41
+ --text-title-sm: 18px;
42
+ --text-title-sm--line-height: 28px;
43
+
44
+ --color-current: currentColor;
45
+ --color-transparent: transparent;
46
+ --color-white: #ffffff;
47
+ --color-black: #101828;
48
+
49
+ --color-brand-50: rgba(236, 243, 255, 1);
50
+ --color-brand-100: rgba(221, 233, 255, 1);
51
+ --color-brand-200: rgba(194, 214, 255, 1);
52
+ --color-brand-300: rgba(156, 185, 255, 1);
53
+ --color-brand-400: rgba(117, 146, 255, 1);
54
+ --color-brand-500: rgba(70, 95, 255, 1);
55
+ --color-brand-600: rgba(54, 65, 245, 1);
56
+ --color-brand-700: rgba(42, 49, 216, 1);
57
+ --color-brand-800: rgba(37, 45, 174, 1);
58
+ --color-brand-900: rgba(38, 46, 137, 1);
59
+ --color-brand-950: rgba(22, 25, 80, 1);
60
+
61
+ --shadow-theme-md:
62
+ 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06);
63
+ --shadow-theme-lg:
64
+ 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
65
+ --shadow-theme-sm: 0px 1px 3px 0px rgba(16, 24, 40, 0.1), 0px 1px 2px 0px rgba(16, 24, 40, 0.06);
66
+ --shadow-theme-xs: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
67
+ --shadow-theme-xl:
68
+ 0px 20px 24px -4px rgba(16, 24, 40, 0.08), 0px 8px 8px -4px rgba(16, 24, 40, 0.03);
69
+ --shadow-datepicker: -5px 0 0 #262d3c, 5px 0 0 #262d3c;
70
+ --shadow-focus-ring: 0px 0px 0px 4px rgba(70, 95, 255, 0.12);
71
+ --shadow-slider-navigation:
72
+ 0px 1px 2px 0px rgba(16, 24, 40, 0.1), 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
73
+ --shadow-tooltip:
74
+ 0px 4px 6px -2px rgba(16, 24, 40, 0.05), -8px 0px 20px 8px rgba(16, 24, 40, 0.05);
75
+
76
+ --drop-shadow-4xl: 0 35px 35px rgba(0, 0, 0, 0.25), 0 45px 65px rgba(0, 0, 0, 0.15);
77
+
78
+ --z-index-1: 1;
79
+ --z-index-9: 9;
80
+ --z-index-99: 99;
81
+ --z-index-999: 999;
82
+ --z-index-9999: 9999;
83
+ --z-index-99999: 99999;
84
+ --z-index-999999: 999999;
85
+
86
+ --animate-caret-blink: caret-blink 1.25s ease-out infinite;
87
+
88
+ @keyframes caret-blink {
89
+ 0%,
90
+ 70%,
91
+ 100% {
92
+ opacity: 1;
93
+ }
94
+ 20%,
95
+ 50% {
96
+ opacity: 0;
97
+ }
98
+ }
99
+ }
100
+
101
+ /*
102
+ The default border color has changed to `currentColor` in Tailwind CSS v4,
103
+ so we've added these compatibility styles to make sure everything still
104
+ looks the same as it did with Tailwind CSS v3.
105
+
106
+ If we ever want to remove these styles, we need to add an explicit border
107
+ color utility to any element that depends on these defaults.
108
+ */
109
+ @layer base {
110
+ *,
111
+ ::after,
112
+ ::before,
113
+ ::backdrop,
114
+ ::file-selector-button {
115
+ border-color: var(--color-gray-200, currentColor);
116
+ }
117
+
118
+ button:not(:disabled),
119
+ [role="button"]:not(:disabled) {
120
+ cursor: pointer;
121
+ }
122
+
123
+ body {
124
+ @apply relative z-1 bg-gray-50 font-rounded font-normal;
125
+ }
126
+ }
127
+
128
+ @utility menu-item {
129
+ @apply relative flex w-full items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium;
130
+ }
131
+
132
+ @utility menu-item-active {
133
+ @apply bg-brand-50 text-brand-500 dark:bg-brand-500/12 dark:text-brand-400;
134
+ }
135
+
136
+ @utility menu-item-inactive {
137
+ @apply text-gray-700 group-hover:text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-white/5 dark:hover:text-gray-300;
138
+ }
139
+
140
+ @utility menu-item-icon {
141
+ @apply text-gray-500 group-hover:text-gray-700 dark:text-gray-400;
142
+ }
143
+
144
+ @utility menu-item-icon-active {
145
+ @apply text-brand-500 dark:text-brand-400;
146
+ }
147
+
148
+ @utility menu-item-icon-inactive {
149
+ @apply text-gray-500 group-hover:text-gray-700 dark:text-gray-400 dark:group-hover:text-gray-300;
150
+ }
151
+
152
+ @utility menu-item-arrow {
153
+ @apply relative;
154
+ }
155
+
156
+ @utility menu-item-arrow-active {
157
+ @apply rotate-180 text-brand-500 dark:text-brand-400;
158
+ }
159
+
160
+ @utility menu-item-arrow-inactive {
161
+ @apply text-gray-500 group-hover:text-gray-700 dark:text-gray-400 dark:group-hover:text-gray-300;
162
+ }
163
+
164
+ @utility menu-dropdown-item {
165
+ @apply relative flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium;
166
+ }
167
+
168
+ @utility menu-dropdown-item-active {
169
+ @apply bg-brand-50 text-brand-500 dark:bg-brand-500/12 dark:text-brand-400;
170
+ }
171
+
172
+ @utility menu-dropdown-item-inactive {
173
+ @apply text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-white/5;
174
+ }
175
+
176
+ @utility menu-dropdown-badge {
177
+ @apply block rounded-full px-2.5 py-0.5 text-xs font-medium text-green-600 uppercase dark:text-green-500;
178
+ }
179
+
180
+ @utility menu-dropdown-badge-active {
181
+ @apply bg-green-100 dark:bg-green-500/20;
182
+ }
183
+
184
+ @utility menu-dropdown-badge-inactive {
185
+ @apply bg-green-50 group-hover:bg-green-100 dark:bg-green-500/15 dark:group-hover:bg-green-500/20;
186
+ }
187
+
188
+ @utility menu-dropdown-badge-pro {
189
+ @apply block rounded-full px-2.5 py-0.5 text-xs font-medium text-brand-600 uppercase dark:text-brand-500;
190
+ }
191
+
192
+ @utility menu-dropdown-badge-pro-active {
193
+ @apply bg-brand-100 dark:bg-brand-500/20;
194
+ }
195
+
196
+ @utility menu-dropdown-badge-pro-inactive {
197
+ @apply bg-brand-50 group-hover:bg-brand-100 dark:bg-brand-500/15 dark:group-hover:bg-brand-500/20;
198
+ }
199
+
200
+ @utility no-scrollbar {
201
+ /* Chrome, Safari and Opera */
202
+ &::-webkit-scrollbar {
203
+ display: none;
204
+ }
205
+
206
+ -ms-overflow-style: none; /* IE and Edge */
207
+ scrollbar-width: none; /* Firefox */
208
+ }
209
+
210
+ @utility custom-scrollbar {
211
+ &::-webkit-scrollbar {
212
+ @apply size-1.5;
213
+ }
214
+
215
+ &::-webkit-scrollbar-track {
216
+ @apply rounded-full;
217
+ }
218
+
219
+ &::-webkit-scrollbar-thumb {
220
+ @apply rounded-full bg-gray-200 dark:bg-gray-700;
221
+ }
222
+ }
223
+
224
+ .dark .custom-scrollbar::-webkit-scrollbar-thumb {
225
+ @apply bg-gray-700;
226
+ }
227
+
228
+ /* Motion for the panel and @colveor/admin: dropdowns, dialogs, menus. A
229
+ panel made before these existed simply doesn't animate. */
230
+ @theme {
231
+ --animate-fade-in: fade-in 150ms ease-out;
232
+ --animate-pop-in: pop-in 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
233
+ --animate-slide-down: slide-down 200ms ease-out;
234
+ --animate-slide-in: slide-in 220ms ease-out;
235
+
236
+ @keyframes fade-in {
237
+ from {
238
+ opacity: 0;
239
+ }
240
+ to {
241
+ opacity: 1;
242
+ }
243
+ }
244
+ @keyframes pop-in {
245
+ from {
246
+ opacity: 0;
247
+ transform: translateY(-6px) scale(0.97);
248
+ }
249
+ to {
250
+ opacity: 1;
251
+ transform: none;
252
+ }
253
+ }
254
+ @keyframes slide-down {
255
+ from {
256
+ opacity: 0;
257
+ transform: translateY(-4px);
258
+ }
259
+ to {
260
+ opacity: 1;
261
+ transform: none;
262
+ }
263
+ }
264
+ @keyframes slide-in {
265
+ from {
266
+ opacity: 0;
267
+ transform: translateX(12px);
268
+ }
269
+ to {
270
+ opacity: 1;
271
+ transform: none;
272
+ }
273
+ }
274
+ }
275
+
276
+ @media (prefers-reduced-motion: reduce) {
277
+ *,
278
+ ::before,
279
+ ::after {
280
+ animation-duration: 1ms !important;
281
+ transition-duration: 1ms !important;
282
+ }
283
+ }
@@ -0,0 +1,25 @@
1
+ import type { Metadata } from "next";
2
+ import { M_PLUS_Rounded_1c } from "next/font/google";
3
+ import type { ReactNode } from "react";
4
+ import config from "../admin.config";
5
+ import Providers from "./providers";
6
+ import "./globals.css";
7
+
8
+ // Not a variable font: each weight used is listed. It has no 600, so the
9
+ // panel uses font-medium where it would use font-semibold.
10
+ const font = M_PLUS_Rounded_1c({
11
+ subsets: ["latin"],
12
+ weight: ["400", "500", "700", "800"],
13
+ });
14
+
15
+ export const metadata: Metadata = { title: config.name };
16
+
17
+ export default function RootLayout({ children }: { children: ReactNode }) {
18
+ return (
19
+ <html lang="en" suppressHydrationWarning>
20
+ <body className={`${font.className} dark:bg-gray-900`}>
21
+ <Providers>{children}</Providers>
22
+ </body>
23
+ </html>
24
+ );
25
+ }
@@ -0,0 +1 @@
1
+ export { default } from "@colveor/admin/pages/sign-in";
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ import { NextAdmin } from "@colveor/admin/next";
4
+ import type { ReactNode } from "react";
5
+ import config from "../admin.config";
6
+ import { ThemeProvider } from "../components/theme";
7
+
8
+ export default function Providers({ children }: { children: ReactNode }) {
9
+ return (
10
+ <ThemeProvider>
11
+ <NextAdmin config={config}>{children}</NextAdmin>
12
+ </ThemeProvider>
13
+ );
14
+ }
@@ -0,0 +1,200 @@
1
+ "use client";
2
+
3
+ // The menu and the header, in the look of TailAdmin and TailwindAdmin (both
4
+ // MIT: TAILADMIN-LICENSE, TAILWINDADMIN-LICENSE).
5
+ // The menu is useNav(): the framework's pages, then admin.config.ts's
6
+ // items, each shown only to users holding its permission. On large screens
7
+ // it collapses to icons (and opens while hovered); on small ones it slides
8
+ // in over the page. This file is the project's: change it freely.
9
+
10
+ import {
11
+ iconButton,
12
+ NavSearch,
13
+ NotificationsMenu,
14
+ UserMenu,
15
+ useAdmin,
16
+ useNav,
17
+ } from "@colveor/admin";
18
+ import { type ReactNode, useEffect, useState } from "react";
19
+ import { useTheme } from "./theme";
20
+
21
+ export default function Frame({ children }: { children: ReactNode }) {
22
+ const { config, router } = useAdmin();
23
+ const nav = useNav();
24
+ const { theme, toggleTheme } = useTheme();
25
+ const [collapsed, setCollapsed] = useState(false);
26
+ const [hovered, setHovered] = useState(false);
27
+ const [mobileOpen, setMobileOpen] = useState(false);
28
+ const [scrolled, setScrolled] = useState(false);
29
+
30
+ // The header gains a shadow once the page scrolls under it.
31
+ useEffect(() => {
32
+ const onScroll = () => setScrolled(window.scrollY > 10);
33
+ window.addEventListener("scroll", onScroll, { passive: true });
34
+ return () => window.removeEventListener("scroll", onScroll);
35
+ }, []);
36
+ const { Link } = router;
37
+ const wide = !collapsed || hovered || mobileOpen;
38
+
39
+ // A page picked on a phone closes the menu.
40
+ useEffect(() => setMobileOpen(false), [router.pathname]);
41
+
42
+ const toggle = () => {
43
+ if (window.matchMedia("(min-width: 1280px)").matches) {
44
+ setCollapsed(!collapsed);
45
+ } else {
46
+ setMobileOpen(!mobileOpen);
47
+ }
48
+ };
49
+
50
+ return (
51
+ <div className="min-h-screen xl:flex">
52
+ {mobileOpen && (
53
+ <button
54
+ type="button"
55
+ aria-label="Close the menu"
56
+ onClick={() => setMobileOpen(false)}
57
+ className="fixed inset-0 z-40 animate-fade-in bg-gray-900/50 xl:hidden"
58
+ />
59
+ )}
60
+ <aside
61
+ onMouseEnter={() => setHovered(true)}
62
+ onMouseLeave={() => setHovered(false)}
63
+ className={`fixed top-0 left-0 z-50 flex h-screen flex-col border-r border-gray-200 bg-white px-5 transition-all duration-300 ease-in-out dark:border-gray-800 dark:bg-gray-900 ${
64
+ wide ? "w-72.5" : "w-22.5"
65
+ } ${mobileOpen ? "translate-x-0" : "-translate-x-full"} xl:translate-x-0`}
66
+ >
67
+ <div className={`flex items-center gap-3 py-8 ${wide ? "" : "justify-center"}`}>
68
+ {config.logo !== undefined ? (
69
+ <img src={config.logo} alt="" className="h-8" />
70
+ ) : (
71
+ <span className="flex size-8 shrink-0 items-center justify-center rounded-lg bg-brand-500 text-sm font-bold text-white">
72
+ {config.name.charAt(0)}
73
+ </span>
74
+ )}
75
+ {wide && (
76
+ <span className="animate-fade-in truncate text-title-sm font-medium text-gray-800 dark:text-white/90">
77
+ {config.name}
78
+ </span>
79
+ )}
80
+ </div>
81
+ <nav className="no-scrollbar flex flex-col gap-1 overflow-y-auto pb-6">
82
+ {nav.map((item, i) => {
83
+ const active =
84
+ router.pathname === item.href || router.pathname.startsWith(`${item.href}/`);
85
+ const heading = item.group !== undefined && item.group !== nav[i - 1]?.group;
86
+ return (
87
+ <div key={item.href}>
88
+ {heading && (
89
+ <h2
90
+ className={`mt-5 mb-2 text-xs font-bold text-gray-400 uppercase first:mt-0 ${
91
+ wide ? "px-3" : "text-center"
92
+ }`}
93
+ >
94
+ {wide ? item.group : "•••"}
95
+ </h2>
96
+ )}
97
+ <Link
98
+ href={item.href}
99
+ className={`group flex items-center gap-3 rounded-full px-3 py-2.5 text-sm font-medium transition-all duration-300 ease-in-out ${
100
+ active
101
+ ? "bg-brand-500 text-white shadow-sm"
102
+ : "text-gray-600 hover:translate-x-1 hover:bg-brand-50 hover:text-brand-500 dark:text-gray-300 dark:hover:bg-brand-500/10"
103
+ } ${wide ? "" : "justify-center hover:translate-x-0"}`}
104
+ >
105
+ <span className="shrink-0 transition-transform duration-300 group-hover:scale-110">
106
+ {item.icon ?? <Dot />}
107
+ </span>
108
+ {wide && <span className="animate-fade-in truncate">{item.label}</span>}
109
+ </Link>
110
+ </div>
111
+ );
112
+ })}
113
+ </nav>
114
+ </aside>
115
+
116
+ <div
117
+ className={`flex-1 transition-all duration-300 ease-in-out ${
118
+ collapsed ? "xl:ml-22.5" : "xl:ml-72.5"
119
+ }`}
120
+ >
121
+ <header
122
+ className={`sticky top-0 z-30 flex w-full items-center gap-4 bg-white/90 px-4 py-3 backdrop-blur transition-shadow duration-300 dark:bg-gray-900/90 xl:px-6 xl:py-4 ${
123
+ scrolled
124
+ ? "shadow-md dark:shadow-black/30"
125
+ : "border-b border-gray-200 dark:border-gray-800"
126
+ }`}
127
+ >
128
+ <button
129
+ type="button"
130
+ aria-label="Menu"
131
+ onClick={toggle}
132
+ className="flex size-11 items-center justify-center rounded-lg border border-gray-200 text-gray-500 transition-colors hover:bg-gray-100 dark:border-gray-800 dark:text-gray-400 dark:hover:bg-gray-800"
133
+ >
134
+ <svg width={20} height={20} viewBox="0 0 24 24" fill="none" aria-hidden="true">
135
+ <path
136
+ d="M4 6h16M4 12h10M4 18h16"
137
+ stroke="currentColor"
138
+ strokeWidth={1.8}
139
+ strokeLinecap="round"
140
+ />
141
+ </svg>
142
+ </button>
143
+ <NavSearch />
144
+ <div className="ml-auto flex items-center gap-2 sm:gap-4">
145
+ <button
146
+ type="button"
147
+ aria-label="Light or dark"
148
+ onClick={toggleTheme}
149
+ className={iconButton}
150
+ >
151
+ <span key={theme} className="animate-pop-in">
152
+ {theme === "dark" ? <SunIcon /> : <MoonIcon />}
153
+ </span>
154
+ </button>
155
+ <NotificationsMenu />
156
+ <UserMenu />
157
+ </div>
158
+ </header>
159
+ <main
160
+ key={router.pathname}
161
+ className="mx-auto max-w-(--breakpoint-2xl) animate-fade-in p-4 md:p-6"
162
+ >
163
+ {children}
164
+ </main>
165
+ </div>
166
+ </div>
167
+ );
168
+ }
169
+
170
+ function Dot() {
171
+ return <span className="mx-2 block size-1.5 rounded-full bg-current" />;
172
+ }
173
+
174
+ function MoonIcon() {
175
+ return (
176
+ <svg width={20} height={20} viewBox="0 0 20 20" fill="none" aria-hidden="true">
177
+ <path
178
+ d="M6.247 6.668a6.668 6.668 0 0011.207 4.885A7.708 7.708 0 118.03 2.129a6.645 6.645 0 00-1.783 4.54z"
179
+ stroke="currentColor"
180
+ strokeWidth={1.5}
181
+ strokeLinecap="round"
182
+ strokeLinejoin="round"
183
+ />
184
+ </svg>
185
+ );
186
+ }
187
+
188
+ function SunIcon() {
189
+ return (
190
+ <svg width={16} height={16} viewBox="0 0 24 24" fill="none" aria-hidden="true">
191
+ <circle cx={12} cy={12} r={4} stroke="currentColor" strokeWidth={1.5} />
192
+ <path
193
+ d="M12 2v2m0 16v2M4.22 4.22l1.42 1.42m12.72 12.72l1.42 1.42M2 12h2m16 0h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"
194
+ stroke="currentColor"
195
+ strokeWidth={1.5}
196
+ strokeLinecap="round"
197
+ />
198
+ </svg>
199
+ );
200
+ }
@@ -0,0 +1,41 @@
1
+ "use client";
2
+
3
+ // Light and dark mode, kept in localStorage (from TailAdmin's
4
+ // context/theme-context.tsx, MIT: TAILADMIN-LICENSE).
5
+
6
+ import { createContext, type ReactNode, useContext, useEffect, useState } from "react";
7
+
8
+ type Theme = "light" | "dark";
9
+
10
+ const ThemeContext = createContext<{ theme: Theme; toggleTheme(): void } | null>(null);
11
+
12
+ export function ThemeProvider({ children }: { children: ReactNode }) {
13
+ const [theme, setTheme] = useState<Theme | null>(null);
14
+
15
+ useEffect(() => {
16
+ setTheme(localStorage.getItem("theme") === "dark" ? "dark" : "light");
17
+ }, []);
18
+
19
+ useEffect(() => {
20
+ if (theme !== null) {
21
+ localStorage.setItem("theme", theme);
22
+ document.documentElement.classList.toggle("dark", theme === "dark");
23
+ }
24
+ }, [theme]);
25
+
26
+ const toggleTheme = () => setTheme((t) => (t === "dark" ? "light" : "dark"));
27
+
28
+ return (
29
+ <ThemeContext.Provider value={{ theme: theme ?? "light", toggleTheme }}>
30
+ {children}
31
+ </ThemeContext.Provider>
32
+ );
33
+ }
34
+
35
+ export function useTheme() {
36
+ const theme = useContext(ThemeContext);
37
+ if (theme === null) {
38
+ throw new Error("useTheme is used outside <ThemeProvider>");
39
+ }
40
+ return theme;
41
+ }
@@ -0,0 +1,2 @@
1
+ # The colveor-go API this panel talks to (copy to .env.local).
2
+ COLVEOR_API_URL=http://localhost:8080
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ .next/
3
+ next-env.d.ts
4
+ .env.local
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "__NAME__",
3
+ "private": true,
4
+ "scripts": {
5
+ "dev": "next dev",
6
+ "build": "next build",
7
+ "start": "next start"
8
+ },
9
+ "dependencies": {
10
+ "@colveor/admin": "__ADMIN__",
11
+ "next": "^16.0.0",
12
+ "react": "^19.0.0",
13
+ "react-dom": "^19.0.0"
14
+ },
15
+ "devDependencies": {
16
+ "@tailwindcss/forms": "^0.5.11",
17
+ "@tailwindcss/postcss": "^4.1.0",
18
+ "@types/node": "^24.0.0",
19
+ "@types/react": "^19.0.0",
20
+ "@types/react-dom": "^19.0.0",
21
+ "tailwindcss": "^4.1.0",
22
+ "typescript": "^5.9.0"
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ export default { plugins: { "@tailwindcss/postcss": {} } };
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["dom", "dom.iterable", "esnext"],
5
+ "allowJs": false,
6
+ "skipLibCheck": true,
7
+ "strict": true,
8
+ "noEmit": true,
9
+ "esModuleInterop": true,
10
+ "module": "esnext",
11
+ "moduleResolution": "bundler",
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "jsx": "react-jsx",
15
+ "incremental": true,
16
+ "plugins": [{ "name": "next" }]
17
+ },
18
+ "include": [
19
+ "next-env.d.ts",
20
+ "**/*.ts",
21
+ "**/*.tsx",
22
+ ".next/types/**/*.ts",
23
+ ".next/dev/types/**/*.ts"
24
+ ],
25
+ "exclude": ["node_modules"]
26
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.