@eutobias/serenojs 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +642 -2
- package/admin-dist/assets/index-B3EgqtT6.js +9 -0
- package/admin-dist/assets/index-D2m0Eb4k.css +2 -0
- package/admin-dist/index.html +17 -0
- package/dist/auth/auth.server.d.ts +31 -0
- package/dist/auth/auth.server.js +141 -0
- package/dist/auth/config.d.ts +32 -0
- package/dist/auth/config.js +25 -0
- package/dist/auth/cookies.server.d.ts +7 -0
- package/dist/auth/cookies.server.js +65 -0
- package/dist/auth/http.server.d.ts +8 -0
- package/dist/auth/http.server.js +30 -0
- package/dist/auth/password.server.d.ts +2 -0
- package/dist/auth/password.server.js +21 -0
- package/dist/auth/session.server.d.ts +2 -0
- package/dist/auth/session.server.js +14 -0
- package/dist/auth/users.server.d.ts +16 -0
- package/dist/auth/users.server.js +123 -0
- package/dist/config.d.ts +91 -0
- package/dist/config.js +39 -0
- package/dist/core/backup.server.d.ts +52 -0
- package/dist/core/backup.server.js +349 -0
- package/dist/core/db.server.d.ts +24 -0
- package/dist/core/db.server.js +526 -0
- package/dist/core/media.d.ts +22 -0
- package/dist/core/media.js +76 -0
- package/dist/core/media.server.d.ts +18 -0
- package/dist/core/media.server.js +102 -0
- package/dist/core/schema.d.ts +26 -0
- package/dist/core/schema.js +99 -0
- package/dist/core/types.d.ts +143 -0
- package/dist/core/types.js +1 -0
- package/dist/core/validation.d.ts +16 -0
- package/dist/core/validation.js +192 -0
- package/dist/locale.d.ts +2 -0
- package/dist/locale.js +14 -0
- package/dist/runtime.d.ts +8 -0
- package/dist/runtime.js +37 -0
- package/dist/server/app.d.ts +20 -0
- package/dist/server/app.js +661 -0
- package/dist/ui/admin/admin-shell.d.ts +16 -0
- package/dist/ui/admin/admin-shell.js +38 -0
- package/dist/ui/admin/backup-manager.d.ts +5 -0
- package/dist/ui/admin/backup-manager.js +165 -0
- package/dist/ui/admin/collection-icon.d.ts +22 -0
- package/dist/ui/admin/collection-icon.js +34 -0
- package/dist/ui/admin/collection-manager.d.ts +7 -0
- package/dist/ui/admin/collection-manager.js +212 -0
- package/dist/ui/admin/display.d.ts +7 -0
- package/dist/ui/admin/display.js +65 -0
- package/dist/ui/admin/field-control.d.ts +14 -0
- package/dist/ui/admin/field-control.js +58 -0
- package/dist/ui/admin/i18n.d.ts +27 -0
- package/dist/ui/admin/i18n.js +324 -0
- package/dist/ui/admin/item-form.d.ts +20 -0
- package/dist/ui/admin/item-form.js +60 -0
- package/dist/ui/admin/list-control.d.ts +13 -0
- package/dist/ui/admin/list-control.js +31 -0
- package/dist/ui/admin/locales.d.ts +4 -0
- package/dist/ui/admin/locales.js +8 -0
- package/dist/ui/admin/login-form.d.ts +3 -0
- package/dist/ui/admin/login-form.js +52 -0
- package/dist/ui/admin/media-control.d.ts +14 -0
- package/dist/ui/admin/media-control.js +74 -0
- package/dist/ui/admin/media-list-control.d.ts +14 -0
- package/dist/ui/admin/media-list-control.js +91 -0
- package/dist/ui/admin/pagination.d.ts +11 -0
- package/dist/ui/admin/pagination.js +14 -0
- package/dist/ui/admin/relation-control.d.ts +14 -0
- package/dist/ui/admin/relation-control.js +33 -0
- package/dist/ui/admin/router.d.ts +17 -0
- package/dist/ui/admin/router.js +58 -0
- package/dist/ui/admin/runtime.d.ts +28 -0
- package/dist/ui/admin/runtime.js +29 -0
- package/dist/ui/admin/sidebar.d.ts +13 -0
- package/dist/ui/admin/sidebar.js +29 -0
- package/dist/ui/admin/standalone-manager.d.ts +11 -0
- package/dist/ui/admin/standalone-manager.js +51 -0
- package/dist/ui/admin/table.d.ts +21 -0
- package/dist/ui/admin/table.js +23 -0
- package/dist/ui/admin/toast.d.ts +16 -0
- package/dist/ui/admin/toast.js +59 -0
- package/dist/ui/admin/users-manager.d.ts +6 -0
- package/dist/ui/admin/users-manager.js +157 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +14 -0
- package/dist/ui/box.d.ts +17 -0
- package/dist/ui/box.js +14 -0
- package/dist/ui/button.d.ts +25 -0
- package/dist/ui/button.js +28 -0
- package/dist/ui/card.d.ts +45 -0
- package/dist/ui/card.js +49 -0
- package/dist/ui/container.d.ts +13 -0
- package/dist/ui/container.js +13 -0
- package/dist/ui/drawer.d.ts +15 -0
- package/dist/ui/drawer.js +31 -0
- package/dist/ui/field-wrapper.d.ts +15 -0
- package/dist/ui/field-wrapper.js +11 -0
- package/dist/ui/index.d.ts +8 -0
- package/dist/ui/index.js +8 -0
- package/dist/ui/text.d.ts +19 -0
- package/dist/ui/text.js +40 -0
- package/package.json +81 -3
- package/src/admin/app.tsx +371 -0
- package/src/admin/index.html +16 -0
- package/src/admin/main.tsx +42 -0
- package/src/admin/styles.css +9 -0
- package/src/auth/auth.server.ts +203 -0
- package/src/auth/config.ts +46 -0
- package/src/auth/cookies.server.ts +84 -0
- package/src/auth/http.server.ts +32 -0
- package/src/auth/password.server.ts +25 -0
- package/src/auth/session.server.ts +16 -0
- package/src/auth/users.server.ts +159 -0
- package/src/config.ts +120 -0
- package/src/core/backup.server.ts +446 -0
- package/src/core/db.server.ts +685 -0
- package/src/core/media.server.ts +136 -0
- package/src/core/media.ts +91 -0
- package/src/core/schema.ts +126 -0
- package/src/core/types.ts +194 -0
- package/src/core/validation.ts +215 -0
- package/src/global.d.ts +1 -0
- package/src/locale.ts +16 -0
- package/src/runtime.ts +54 -0
- package/src/server/app.ts +737 -0
- package/src/ui/admin/admin-shell.tsx +106 -0
- package/src/ui/admin/backup-manager.tsx +327 -0
- package/src/ui/admin/collection-icon.tsx +69 -0
- package/src/ui/admin/collection-manager.tsx +408 -0
- package/src/ui/admin/display.tsx +138 -0
- package/src/ui/admin/field-control.tsx +214 -0
- package/src/ui/admin/i18n.tsx +401 -0
- package/src/ui/admin/item-form.tsx +200 -0
- package/src/ui/admin/list-control.tsx +121 -0
- package/src/ui/admin/locales.ts +12 -0
- package/src/ui/admin/login-form.tsx +98 -0
- package/src/ui/admin/media-control.tsx +161 -0
- package/src/ui/admin/media-list-control.tsx +242 -0
- package/src/ui/admin/pagination.tsx +58 -0
- package/src/ui/admin/relation-control.tsx +142 -0
- package/src/ui/admin/router.tsx +105 -0
- package/src/ui/admin/runtime.tsx +58 -0
- package/src/ui/admin/sidebar.tsx +178 -0
- package/src/ui/admin/standalone-manager.tsx +103 -0
- package/src/ui/admin/table.tsx +129 -0
- package/src/ui/admin/toast.tsx +126 -0
- package/src/ui/admin/users-manager.tsx +344 -0
- package/src/ui/badge.tsx +27 -0
- package/src/ui/box.tsx +33 -0
- package/src/ui/button.tsx +77 -0
- package/src/ui/card.tsx +92 -0
- package/src/ui/container.tsx +28 -0
- package/src/ui/drawer.tsx +104 -0
- package/src/ui/field-wrapper.tsx +54 -0
- package/src/ui/index.ts +8 -0
- package/src/ui/text.tsx +93 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { Badge } from "../badge.js";
|
|
5
|
+
import { Box } from "../box.js";
|
|
6
|
+
import { Button, IconButton } from "../button.js";
|
|
7
|
+
import { Drawer } from "../drawer.js";
|
|
8
|
+
import { FieldWrapper, inputClass } from "../field-wrapper.js";
|
|
9
|
+
import { Text } from "../text.js";
|
|
10
|
+
import { FiEdit2, FiTrash2 } from "react-icons/fi";
|
|
11
|
+
import { DataTable } from "./table.js";
|
|
12
|
+
import { useToast } from "./toast.js";
|
|
13
|
+
import { useI18n } from "./i18n.js";
|
|
14
|
+
import { useCmsUrls } from "./runtime.js";
|
|
15
|
+
/** Deterministic (UTC) date format to avoid hydration mismatches. */
|
|
16
|
+
function formatDateTime(value, locale) {
|
|
17
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2})/.exec(value);
|
|
18
|
+
if (!match)
|
|
19
|
+
return value || "—";
|
|
20
|
+
const date = locale === "en" ? `${match[2]}/${match[3]}/${match[1]}` : `${match[3]}/${match[2]}/${match[1]}`;
|
|
21
|
+
return `${date} ${match[4]}:${match[5]}`;
|
|
22
|
+
}
|
|
23
|
+
export const UsersManager = ({ initial, currentUserId }) => {
|
|
24
|
+
const toast = useToast();
|
|
25
|
+
const { auth } = useCmsUrls();
|
|
26
|
+
const { t, locale } = useI18n();
|
|
27
|
+
const [users, setUsers] = useState(initial);
|
|
28
|
+
const [drawer, setDrawer] = useState({ kind: "closed" });
|
|
29
|
+
const [email, setEmail] = useState("");
|
|
30
|
+
const [password, setPassword] = useState("");
|
|
31
|
+
const [submitting, setSubmitting] = useState(false);
|
|
32
|
+
const [errors, setErrors] = useState({});
|
|
33
|
+
const [formError, setFormError] = useState(null);
|
|
34
|
+
const reload = useCallback(async () => {
|
|
35
|
+
const response = await fetch(auth("users"));
|
|
36
|
+
if (!response.ok)
|
|
37
|
+
return;
|
|
38
|
+
const json = (await response.json());
|
|
39
|
+
if (json.users)
|
|
40
|
+
setUsers(json.users);
|
|
41
|
+
}, []);
|
|
42
|
+
const closeDrawer = () => {
|
|
43
|
+
setDrawer({ kind: "closed" });
|
|
44
|
+
setErrors({});
|
|
45
|
+
setFormError(null);
|
|
46
|
+
};
|
|
47
|
+
const openCreate = () => {
|
|
48
|
+
setEmail("");
|
|
49
|
+
setPassword("");
|
|
50
|
+
setErrors({});
|
|
51
|
+
setFormError(null);
|
|
52
|
+
setDrawer({ kind: "form", user: null });
|
|
53
|
+
};
|
|
54
|
+
const openEdit = (user) => {
|
|
55
|
+
setEmail(user.email);
|
|
56
|
+
setPassword("");
|
|
57
|
+
setErrors({});
|
|
58
|
+
setFormError(null);
|
|
59
|
+
setDrawer({ kind: "form", user });
|
|
60
|
+
};
|
|
61
|
+
const submit = async (event) => {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
if (drawer.kind !== "form")
|
|
64
|
+
return;
|
|
65
|
+
const editing = drawer.user;
|
|
66
|
+
setSubmitting(true);
|
|
67
|
+
setErrors({});
|
|
68
|
+
setFormError(null);
|
|
69
|
+
try {
|
|
70
|
+
const response = await fetch(editing ? auth(`users/${editing.id}`) : auth("users"), {
|
|
71
|
+
method: editing ? "PATCH" : "POST",
|
|
72
|
+
headers: { "Content-Type": "application/json" },
|
|
73
|
+
body: JSON.stringify({ email, password }),
|
|
74
|
+
});
|
|
75
|
+
const json = (await response.json());
|
|
76
|
+
if (!response.ok) {
|
|
77
|
+
setErrors(json.errors ?? {});
|
|
78
|
+
setFormError(json.message ?? t("users.saveError"));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
closeDrawer();
|
|
82
|
+
toast.success(editing ? t("users.updated") : t("users.created"));
|
|
83
|
+
await reload();
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
setFormError(t("users.networkSave"));
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
setSubmitting(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const confirmDelete = async () => {
|
|
93
|
+
if (drawer.kind !== "delete")
|
|
94
|
+
return;
|
|
95
|
+
setSubmitting(true);
|
|
96
|
+
try {
|
|
97
|
+
const response = await fetch(auth(`users/${drawer.user.id}`), {
|
|
98
|
+
method: "DELETE",
|
|
99
|
+
});
|
|
100
|
+
const json = (await response.json().catch(() => null));
|
|
101
|
+
if (!response.ok) {
|
|
102
|
+
toast.error(json?.message ?? t("users.removeError"));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
closeDrawer();
|
|
106
|
+
toast.success(t("users.removed"));
|
|
107
|
+
await reload();
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
toast.error(t("users.networkRemove"));
|
|
111
|
+
}
|
|
112
|
+
finally {
|
|
113
|
+
setSubmitting(false);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const columns = [
|
|
117
|
+
{
|
|
118
|
+
key: "id",
|
|
119
|
+
header: "ID",
|
|
120
|
+
width: "70px",
|
|
121
|
+
render: (user) => (_jsxs(Text, { as: "span", size: "caption", className: "text-gray-400", children: ["#", user.id] })),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "email",
|
|
125
|
+
header: t("common.email"),
|
|
126
|
+
render: (user) => (_jsxs(Box, { className: "items-center gap-2", children: [_jsx(Text, { as: "span", size: "caption", className: "font-medium text-gray-900", children: user.email }), user.id === currentUserId ? _jsx(Badge, { tone: "purple", children: t("users.you") }) : null] })),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: "createdAt",
|
|
130
|
+
header: t("common.createdAt"),
|
|
131
|
+
width: "150px",
|
|
132
|
+
render: (user) => (_jsx(Text, { as: "span", size: "caption", className: "whitespace-nowrap text-gray-500", children: formatDateTime(user.createdAt, locale) })),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
key: "updatedAt",
|
|
136
|
+
header: t("common.updatedAt"),
|
|
137
|
+
width: "150px",
|
|
138
|
+
render: (user) => (_jsx(Text, { as: "span", size: "caption", className: "whitespace-nowrap text-gray-500", children: formatDateTime(user.updatedAt, locale) })),
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "__actions",
|
|
142
|
+
header: "",
|
|
143
|
+
width: "110px",
|
|
144
|
+
align: "right",
|
|
145
|
+
render: (user) => (_jsxs(Box, { className: "items-center justify-end gap-1", children: [_jsx(IconButton, { type: "button", label: t("common.edit"), onClick: () => openEdit(user), children: _jsx(FiEdit2, { "aria-hidden": true }) }), user.id === currentUserId ? null : (_jsx(IconButton, { type: "button", label: t("common.remove"), className: "text-red-600 hover:bg-red-50 hover:text-red-700", onClick: () => setDrawer({ kind: "delete", user }), children: _jsx(FiTrash2, { "aria-hidden": true }) }))] })),
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
return (_jsxs(Box, { className: "flex-col gap-6 p-4 sm:p-6 lg:p-8", children: [_jsxs(Box, { className: "flex-col items-start justify-between gap-3 sm:flex-row sm:gap-4", children: [_jsxs(Box, { className: "flex-col gap-1", children: [_jsxs(Box, { className: "items-center gap-3", children: [_jsx(Text, { size: "title", className: "font-semibold text-gray-900", children: t("users.title") }), _jsx(Badge, { tone: "gray", children: users.length })] }), _jsx(Text, { size: "caption", className: "text-gray-500", children: t("users.subtitle") })] }), _jsx(Button, { type: "button", variant: "primary", onClick: openCreate, children: t("users.new") })] }), _jsx(DataTable, { columns: columns, rows: users, rowKey: (user) => user.id, empty: t("users.empty") }), _jsxs(Drawer, { open: drawer.kind !== "closed", onClose: closeDrawer, title: drawer.kind === "form"
|
|
149
|
+
? drawer.user
|
|
150
|
+
? t("users.editTitle", { id: drawer.user.id })
|
|
151
|
+
: t("users.createTitle")
|
|
152
|
+
: t("users.removeTitle"), description: drawer.kind === "delete"
|
|
153
|
+
? t("common.deleteWarning")
|
|
154
|
+
: undefined, children: [drawer.kind === "form" ? (_jsxs(Box, { as: "form", className: "flex-col gap-5", onSubmit: (event) => void submit(event), children: [formError ? (_jsx(Box, { className: "rounded-md border border-red-200 bg-red-50 px-3 py-2", children: _jsx(Text, { size: "caption", className: "text-red-700", children: formError }) })) : null, _jsx(FieldWrapper, { label: t("common.email"), htmlFor: "user-email", required: true, error: errors.email, children: _jsx("input", { id: "user-email", type: "email", autoComplete: "off", required: true, value: email, disabled: submitting, onChange: (event) => setEmail(event.target.value), className: `${inputClass} border-gray-300` }) }), _jsx(FieldWrapper, { label: drawer.user ? t("users.newPassword") : t("common.password"), htmlFor: "user-password", required: !drawer.user, help: drawer.user
|
|
155
|
+
? t("users.passwordHintKeep")
|
|
156
|
+
: t("users.passwordHintMin"), error: errors.password, children: _jsx("input", { id: "user-password", type: "password", autoComplete: "new-password", value: password, disabled: submitting, onChange: (event) => setPassword(event.target.value), className: `${inputClass} border-gray-300` }) }), _jsxs(Box, { className: "items-center justify-end gap-2 border-t border-gray-200 pt-4", children: [_jsx(Button, { type: "button", variant: "secondary", onClick: closeDrawer, disabled: submitting, children: t("common.cancel") }), _jsx(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? t("common.saving") : drawer.user ? t("common.saveChanges") : t("users.create") })] })] })) : null, drawer.kind === "delete" ? (_jsxs(Box, { className: "flex-col gap-6", children: [_jsx(Text, { className: "text-gray-700", children: t("users.removeConfirm", { email: drawer.user.email }) }), _jsxs(Box, { className: "items-center justify-end gap-2 border-t border-gray-200 pt-4", children: [_jsx(Button, { type: "button", variant: "secondary", onClick: closeDrawer, disabled: submitting, children: t("common.cancel") }), _jsx(Button, { type: "button", variant: "danger", onClick: () => void confirmDelete(), disabled: submitting, children: submitting ? t("common.removing") : t("common.remove") })] })] })) : null] })] }));
|
|
157
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type BoxProps } from "./box.js";
|
|
2
|
+
export type BadgeTone = "gray" | "green" | "amber" | "blue" | "red" | "purple";
|
|
3
|
+
export type BadgeProps = BoxProps<"span"> & {
|
|
4
|
+
tone?: BadgeTone;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Small pill label built on `Box`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const Badge: ({ tone, className, ...props }: BadgeProps) => import("react").JSX.Element;
|
package/dist/ui/badge.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
const tones = {
|
|
4
|
+
gray: "bg-gray-100 text-gray-700",
|
|
5
|
+
green: "bg-emerald-100 text-emerald-700",
|
|
6
|
+
amber: "bg-amber-100 text-amber-700",
|
|
7
|
+
blue: "bg-blue-100 text-blue-700",
|
|
8
|
+
red: "bg-red-100 text-red-700",
|
|
9
|
+
purple: "bg-purple-100 text-purple-700",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Small pill label built on `Box`.
|
|
13
|
+
*/
|
|
14
|
+
export const Badge = ({ tone = "gray", className = "", ...props }) => (_jsx(Box, { as: "span", className: `w-fit items-center rounded-full px-2 py-0.5 text-xs font-medium ${tones[tone]} ${className}`, ...props }));
|
package/dist/ui/box.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ElementType, type ComponentPropsWithoutRef, type ReactElement } from "react";
|
|
2
|
+
export type CustomComponentTag<T extends ElementType = "div"> = {
|
|
3
|
+
as?: T;
|
|
4
|
+
} & ComponentPropsWithoutRef<T>;
|
|
5
|
+
export type BoxProps<T extends ElementType = "div"> = {
|
|
6
|
+
className?: string;
|
|
7
|
+
} & CustomComponentTag<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Polymorphic layout component that renders as a flex container.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Box as="section" className="gap-4">
|
|
13
|
+
* <span>Item 1</span>
|
|
14
|
+
* <span>Item 2</span>
|
|
15
|
+
* </Box>
|
|
16
|
+
*/
|
|
17
|
+
export declare const Box: <T extends ElementType = "div">({ as, className, children, ...props }: BoxProps<T>) => ReactElement;
|
package/dist/ui/box.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Polymorphic layout component that renders as a flex container.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Box as="section" className="gap-4">
|
|
7
|
+
* <span>Item 1</span>
|
|
8
|
+
* <span>Item 2</span>
|
|
9
|
+
* </Box>
|
|
10
|
+
*/
|
|
11
|
+
export const Box = ({ as, className = "", children, ...props }) => {
|
|
12
|
+
const Tag = as ?? "div";
|
|
13
|
+
return (_jsx(Tag, { className: `flex ${className}`, ...props, children: children }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type BoxProps } from "./box.js";
|
|
3
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
4
|
+
export type ButtonSize = "sm" | "md" | "icon";
|
|
5
|
+
export type ButtonProps = BoxProps<"button"> & {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Button built on top of `Box`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <Button variant="primary" onClick={save}>Salvar</Button>
|
|
14
|
+
* <Button variant="ghost" size="sm">Cancelar</Button>
|
|
15
|
+
*/
|
|
16
|
+
export declare const Button: ({ variant, size, className, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
17
|
+
export type IconButtonProps = ButtonProps & {
|
|
18
|
+
label: string;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Square icon-only button. The label is exposed to assistive tech via
|
|
23
|
+
* `aria-label` and shown as a native tooltip via `title`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const IconButton: ({ label, children, variant, ...props }: IconButtonProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
const variants = {
|
|
4
|
+
primary: "border-gray-900 bg-gray-900 text-white hover:bg-gray-800 hover:border-gray-800",
|
|
5
|
+
secondary: "border-gray-300 bg-white text-gray-900 hover:bg-gray-50 hover:border-gray-400",
|
|
6
|
+
ghost: "border-transparent bg-transparent text-gray-700 hover:bg-gray-100 hover:text-gray-900",
|
|
7
|
+
danger: "border-red-600 bg-red-600 text-white hover:bg-red-500 hover:border-red-500",
|
|
8
|
+
};
|
|
9
|
+
const sizes = {
|
|
10
|
+
sm: "gap-1.5 px-2.5 py-1.5 text-xs",
|
|
11
|
+
md: "gap-2 px-3.5 py-2 text-sm",
|
|
12
|
+
icon: "h-8 w-8 p-0 text-base",
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Button built on top of `Box`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Button variant="primary" onClick={save}>Salvar</Button>
|
|
19
|
+
* <Button variant="ghost" size="sm">Cancelar</Button>
|
|
20
|
+
*/
|
|
21
|
+
export const Button = ({ variant = "primary", size = "md", className = "", ...props }) => {
|
|
22
|
+
return (_jsx(Box, { as: "button", type: "button", className: `cursor-pointer select-none items-center justify-center rounded-md border font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${variants[variant]} ${sizes[size]} ${className}`, ...props }));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Square icon-only button. The label is exposed to assistive tech via
|
|
26
|
+
* `aria-label` and shown as a native tooltip via `title`.
|
|
27
|
+
*/
|
|
28
|
+
export const IconButton = ({ label, children, variant = "ghost", ...props }) => (_jsx(Button, { "aria-label": label, title: label, variant: variant, size: "icon", ...props, children: children }));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ElementType } from "react";
|
|
2
|
+
import { type BoxProps } from "./box.js";
|
|
3
|
+
export type CardProps<T extends ElementType = "div"> = BoxProps<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Container component that groups card header, body, and footer.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Card className="shadow-md">
|
|
9
|
+
* <CardHeader>Title</CardHeader>
|
|
10
|
+
* <CardBody>Content</CardBody>
|
|
11
|
+
* <CardFooter>Actions</CardFooter>
|
|
12
|
+
* </Card>
|
|
13
|
+
*/
|
|
14
|
+
export declare const Card: ({ className, children, ...props }: CardProps) => import("react").JSX.Element;
|
|
15
|
+
export type CardHeaderProps<T extends ElementType = "div"> = BoxProps<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Header section of a Card, typically holding titles or actions.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <CardHeader className="border-b">
|
|
21
|
+
* <Text size="title">Title</Text>
|
|
22
|
+
* </CardHeader>
|
|
23
|
+
*/
|
|
24
|
+
export declare const CardHeader: ({ className, children, ...props }: CardHeaderProps) => import("react").JSX.Element;
|
|
25
|
+
export type CardBodyProps<T extends ElementType = "div"> = BoxProps<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Main content section of a Card.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* <CardBody className="gap-2">
|
|
31
|
+
* <Text>Content</Text>
|
|
32
|
+
* </CardBody>
|
|
33
|
+
*/
|
|
34
|
+
export declare const CardBody: ({ className, children, ...props }: CardBodyProps) => import("react").JSX.Element;
|
|
35
|
+
export type CardFooterProps<T extends ElementType = "div"> = BoxProps<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Footer section of a Card, typically holding actions.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <CardFooter className="justify-end gap-2">
|
|
41
|
+
* <button>Cancel</button>
|
|
42
|
+
* <button>Save</button>
|
|
43
|
+
* </CardFooter>
|
|
44
|
+
*/
|
|
45
|
+
export declare const CardFooter: ({ className, children, ...props }: CardFooterProps) => import("react").JSX.Element;
|
package/dist/ui/card.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
/**
|
|
4
|
+
* Container component that groups card header, body, and footer.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <Card className="shadow-md">
|
|
8
|
+
* <CardHeader>Title</CardHeader>
|
|
9
|
+
* <CardBody>Content</CardBody>
|
|
10
|
+
* <CardFooter>Actions</CardFooter>
|
|
11
|
+
* </Card>
|
|
12
|
+
*/
|
|
13
|
+
export const Card = ({ className = "", children, ...props }) => {
|
|
14
|
+
return (_jsx(Box, { className: `flex-col overflow-hidden rounded-lg border border-gray-200 bg-white ${className}`, ...props, children: children }));
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Header section of a Card, typically holding titles or actions.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <CardHeader className="border-b">
|
|
21
|
+
* <Text size="title">Title</Text>
|
|
22
|
+
* </CardHeader>
|
|
23
|
+
*/
|
|
24
|
+
export const CardHeader = ({ className = "", children, ...props }) => {
|
|
25
|
+
return (_jsx(Box, { className: `items-center gap-4 px-6 py-4 ${className}`, ...props, children: children }));
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Main content section of a Card.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <CardBody className="gap-2">
|
|
32
|
+
* <Text>Content</Text>
|
|
33
|
+
* </CardBody>
|
|
34
|
+
*/
|
|
35
|
+
export const CardBody = ({ className = "", children, ...props }) => {
|
|
36
|
+
return (_jsx(Box, { className: `flex-1 flex-col px-6 py-4 ${className}`, ...props, children: children }));
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Footer section of a Card, typically holding actions.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* <CardFooter className="justify-end gap-2">
|
|
43
|
+
* <button>Cancel</button>
|
|
44
|
+
* <button>Save</button>
|
|
45
|
+
* </CardFooter>
|
|
46
|
+
*/
|
|
47
|
+
export const CardFooter = ({ className = "", children, ...props }) => {
|
|
48
|
+
return (_jsx(Box, { className: `items-center gap-2 px-6 py-4 ${className}`, ...props, children: children }));
|
|
49
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CustomComponentTag } from "./box.js";
|
|
2
|
+
import { type ElementType } from "react";
|
|
3
|
+
export type ContainerProps<T extends ElementType = "div"> = {
|
|
4
|
+
className?: string;
|
|
5
|
+
} & CustomComponentTag<T>;
|
|
6
|
+
/**
|
|
7
|
+
* @example
|
|
8
|
+
* <Container as="main" className="gap-4">
|
|
9
|
+
* <span>Item 1</span>
|
|
10
|
+
* <span>Item 2</span>
|
|
11
|
+
* </Container>
|
|
12
|
+
*/
|
|
13
|
+
export declare const Container: <T extends ElementType = "div">({ as, className, children, ...props }: ContainerProps<T>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* <Container as="main" className="gap-4">
|
|
6
|
+
* <span>Item 1</span>
|
|
7
|
+
* <span>Item 2</span>
|
|
8
|
+
* </Container>
|
|
9
|
+
*/
|
|
10
|
+
export const Container = ({ as, className = "", children, ...props }) => {
|
|
11
|
+
const Tag = as ?? "div";
|
|
12
|
+
return (_jsx(Box, { as: Tag, className: `flex-col w-full min-h-screen ${className}`, ...props, children: children }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type DrawerProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string | undefined;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
footer?: ReactNode;
|
|
9
|
+
width?: "md" | "lg";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Right-side sliding panel used for create/edit forms and confirmations.
|
|
13
|
+
* Built on top of `Box`/`Text`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Drawer: ({ open, onClose, title, description, children, footer, width, }: DrawerProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { Box } from "./box.js";
|
|
5
|
+
import { Text } from "./text.js";
|
|
6
|
+
const widths = {
|
|
7
|
+
md: "max-w-md",
|
|
8
|
+
lg: "max-w-2xl",
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Right-side sliding panel used for create/edit forms and confirmations.
|
|
12
|
+
* Built on top of `Box`/`Text`.
|
|
13
|
+
*/
|
|
14
|
+
export const Drawer = ({ open, onClose, title, description, children, footer, width = "md", }) => {
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!open)
|
|
17
|
+
return;
|
|
18
|
+
const onKeyDown = (event) => {
|
|
19
|
+
if (event.key === "Escape")
|
|
20
|
+
onClose();
|
|
21
|
+
};
|
|
22
|
+
const previous = document.body.style.overflow;
|
|
23
|
+
document.body.style.overflow = "hidden";
|
|
24
|
+
window.addEventListener("keydown", onKeyDown);
|
|
25
|
+
return () => {
|
|
26
|
+
document.body.style.overflow = previous;
|
|
27
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
28
|
+
};
|
|
29
|
+
}, [open, onClose]);
|
|
30
|
+
return (_jsxs(Box, { "aria-hidden": !open, className: `fixed inset-0 z-50 ${open ? "" : "pointer-events-none"}`, children: [_jsx(Box, { onClick: onClose, className: `absolute inset-0 bg-gray-900/40 transition-opacity duration-200 ${open ? "opacity-100" : "opacity-0"}` }), _jsxs(Box, { as: "aside", className: `absolute right-0 top-0 h-full w-full flex-col bg-white shadow-2xl transition-transform duration-200 ease-out ${widths[width]} ${open ? "translate-x-0" : "translate-x-full"}`, children: [_jsxs(Box, { className: "items-start justify-between border-b border-gray-200 px-6 py-4", children: [_jsxs(Box, { className: "flex-col gap-0.5", children: [_jsx(Text, { size: "subtitle", className: "font-semibold text-gray-900", children: title }), description ? (_jsx(Text, { size: "caption", className: "text-gray-500", children: description })) : null] }), _jsx(Box, { as: "button", type: "button", onClick: onClose, "aria-label": "Fechar", className: "items-center justify-center rounded-md p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700", children: _jsx(Text, { as: "span", size: "subtitle", className: "leading-none", children: "\u00D7" }) })] }), _jsx(Box, { className: "flex-1 flex-col overflow-y-auto px-6 py-5", children: children }), footer ? (_jsx(Box, { className: "items-center justify-end gap-2 border-t border-gray-200 bg-gray-50 px-6 py-4", children: footer })) : null] })] }));
|
|
31
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
declare const inputClass = "w-full rounded-md border bg-white px-3 py-2 text-sm text-gray-900 outline-none transition-colors placeholder:text-gray-400 focus:border-gray-900 focus:ring-1 focus:ring-gray-900 disabled:bg-gray-50 disabled:text-gray-500";
|
|
3
|
+
export type FieldWrapperProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
htmlFor?: string | undefined;
|
|
6
|
+
required?: boolean | undefined;
|
|
7
|
+
help?: string | undefined;
|
|
8
|
+
error?: string | undefined;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Label + control + help/error wrapper built on `Box`/`Text`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FieldWrapper: ({ label, htmlFor, required, help, error, children, }: FieldWrapperProps) => import("react").JSX.Element;
|
|
15
|
+
export { inputClass };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "./box.js";
|
|
3
|
+
import { Text } from "./text.js";
|
|
4
|
+
const inputClass = "w-full rounded-md border bg-white px-3 py-2 text-sm text-gray-900 outline-none transition-colors placeholder:text-gray-400 focus:border-gray-900 focus:ring-1 focus:ring-gray-900 disabled:bg-gray-50 disabled:text-gray-500";
|
|
5
|
+
/**
|
|
6
|
+
* Label + control + help/error wrapper built on `Box`/`Text`.
|
|
7
|
+
*/
|
|
8
|
+
export const FieldWrapper = ({ label, htmlFor, required, help, error, children, }) => {
|
|
9
|
+
return (_jsxs(Box, { className: "flex-col gap-1.5", children: [_jsxs(Text, { as: "label", htmlFor: htmlFor, size: "caption", className: "font-medium text-gray-700", children: [label, required ? _jsx("span", { className: "text-red-500", children: " *" }) : null] }), children, error ? (_jsx(Text, { size: "caption", className: "text-red-600", children: error })) : help ? (_jsx(Text, { size: "caption", className: "text-gray-400", children: help })) : null] }));
|
|
10
|
+
};
|
|
11
|
+
export { inputClass };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Badge, type BadgeTone } from "./badge.js";
|
|
2
|
+
export { Box } from "./box.js";
|
|
3
|
+
export { Button, IconButton } from "./button.js";
|
|
4
|
+
export { Card } from "./card.js";
|
|
5
|
+
export { Container } from "./container.js";
|
|
6
|
+
export { Drawer } from "./drawer.js";
|
|
7
|
+
export { FieldWrapper, inputClass } from "./field-wrapper.js";
|
|
8
|
+
export { Text } from "./text.js";
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Badge } from "./badge.js";
|
|
2
|
+
export { Box } from "./box.js";
|
|
3
|
+
export { Button, IconButton } from "./button.js";
|
|
4
|
+
export { Card } from "./card.js";
|
|
5
|
+
export { Container } from "./container.js";
|
|
6
|
+
export { Drawer } from "./drawer.js";
|
|
7
|
+
export { FieldWrapper, inputClass } from "./field-wrapper.js";
|
|
8
|
+
export { Text } from "./text.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ElementType, type ComponentPropsWithoutRef, type ReactElement } from "react";
|
|
2
|
+
/** Design-system type scale (see docs/design.md). */
|
|
3
|
+
export type TextSize = "display" | "heading" | "subheading" | "cardTitle" | "lead" | "body" | "small" | "mono" | "monoSm" | "monoXs" | "title/xl" | "title/lg" | "title" | "subtitle" | "caption";
|
|
4
|
+
export type TextFont = "sans" | "mono";
|
|
5
|
+
export type TextProps<T extends ElementType = "span"> = {
|
|
6
|
+
size?: TextSize;
|
|
7
|
+
font?: TextFont;
|
|
8
|
+
as?: T;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & ComponentPropsWithoutRef<T>;
|
|
11
|
+
declare const sizeStyles: Record<TextSize, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Typography primitive driven by the design-system type scale.
|
|
14
|
+
*
|
|
15
|
+
* Colors and other surface decisions belong to the components that compose
|
|
16
|
+
* `Text` (passed through `className`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const Text: <T extends ElementType = "div">({ size, font, as, className, children, ...props }: TextProps<T>) => ReactElement;
|
|
19
|
+
export { sizeStyles };
|
package/dist/ui/text.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const sizeStyles = {
|
|
3
|
+
display: "text-[30px] leading-[1.2] tracking-[-0.02em] font-extrabold sm:text-[48px]",
|
|
4
|
+
heading: "text-[28px] leading-[1.3] tracking-[-0.01em] font-extrabold sm:text-[36px]",
|
|
5
|
+
subheading: "text-[24px] leading-[1.3] font-bold sm:text-[28px]",
|
|
6
|
+
cardTitle: "text-[20px] leading-[1.4] font-bold",
|
|
7
|
+
lead: "text-[18px] leading-[1.6] font-medium",
|
|
8
|
+
body: "text-[16px] leading-[1.6] font-medium",
|
|
9
|
+
small: "text-[14px] leading-[1.5] font-medium",
|
|
10
|
+
mono: "text-[14px] leading-[1.6] font-medium",
|
|
11
|
+
monoSm: "text-[12px] leading-[1.5] font-medium",
|
|
12
|
+
monoXs: "text-[10px] leading-[1.4] font-medium",
|
|
13
|
+
// Legacy
|
|
14
|
+
"title/xl": "text-[30px] leading-[1.2] font-extrabold sm:text-[48px]",
|
|
15
|
+
"title/lg": "text-[28px] leading-[1.3] font-extrabold sm:text-[36px]",
|
|
16
|
+
title: "text-[24px] leading-[1.3] font-bold sm:text-[28px]",
|
|
17
|
+
subtitle: "text-[20px] leading-[1.4] font-bold",
|
|
18
|
+
caption: "text-[14px] leading-[1.5]",
|
|
19
|
+
};
|
|
20
|
+
const monoFonts = new Set([
|
|
21
|
+
"mono",
|
|
22
|
+
"monoSm",
|
|
23
|
+
"monoXs",
|
|
24
|
+
"display",
|
|
25
|
+
"heading",
|
|
26
|
+
"subheading",
|
|
27
|
+
"cardTitle",
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Typography primitive driven by the design-system type scale.
|
|
31
|
+
*
|
|
32
|
+
* Colors and other surface decisions belong to the components that compose
|
|
33
|
+
* `Text` (passed through `className`).
|
|
34
|
+
*/
|
|
35
|
+
export const Text = ({ size = "body", font, as, className = "", children, ...props }) => {
|
|
36
|
+
const Tag = as ?? "p";
|
|
37
|
+
const family = font ?? (monoFonts.has(size) ? "mono" : "sans");
|
|
38
|
+
return (_jsx(Tag, { className: `${sizeStyles[size]} ${family === "mono" ? "font-mono" : "font-sans"} ${className}`, ...props, children: children }));
|
|
39
|
+
};
|
|
40
|
+
export { sizeStyles };
|
package/package.json
CHANGED
|
@@ -1,6 +1,84 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eutobias/serenojs",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SerenoJS — schema-driven CMS for Waku: auto-generated admin SPA + Hono REST API.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Tobias Taurian <eutobias@gmail.com>",
|
|
8
|
+
"homepage": "https://github.com/eutobias/my-mini-cms#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/eutobias/my-mini-cms.git",
|
|
12
|
+
"directory": "packages/serenojs"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/eutobias/my-mini-cms/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"cms",
|
|
19
|
+
"headless-cms",
|
|
20
|
+
"waku",
|
|
21
|
+
"react",
|
|
22
|
+
"react-server-components",
|
|
23
|
+
"rsc",
|
|
24
|
+
"hono",
|
|
25
|
+
"sqlite",
|
|
26
|
+
"admin-panel",
|
|
27
|
+
"schema-driven",
|
|
28
|
+
"typescript"
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "./dist/config.js",
|
|
32
|
+
"module": "./dist/config.js",
|
|
33
|
+
"types": "./dist/config.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": "./package.json",
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/config.d.ts",
|
|
38
|
+
"default": "./dist/config.js"
|
|
39
|
+
},
|
|
40
|
+
"./config": {
|
|
41
|
+
"types": "./dist/config.d.ts",
|
|
42
|
+
"default": "./dist/config.js"
|
|
43
|
+
},
|
|
44
|
+
"./runtime": {
|
|
45
|
+
"types": "./dist/runtime.d.ts",
|
|
46
|
+
"default": "./dist/runtime.js"
|
|
47
|
+
},
|
|
48
|
+
"./server": {
|
|
49
|
+
"types": "./dist/server/app.d.ts",
|
|
50
|
+
"default": "./dist/server/app.js"
|
|
51
|
+
},
|
|
52
|
+
"./ui": {
|
|
53
|
+
"types": "./dist/ui/index.d.ts",
|
|
54
|
+
"default": "./dist/ui/index.js"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"dist",
|
|
59
|
+
"src",
|
|
60
|
+
"admin-dist",
|
|
61
|
+
"README.md"
|
|
62
|
+
],
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=22.15"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"react": "~19.3.0",
|
|
68
|
+
"react-dom": "~19.3.0",
|
|
69
|
+
"waku": "1.0.0-rc.1"
|
|
70
|
+
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"hono": "^4.12.14",
|
|
73
|
+
"react-icons": "^5.7.0"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"access": "public"
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "tsc -p tsconfig.build.json",
|
|
80
|
+
"build:admin": "vite build --config vite.admin.config.ts",
|
|
81
|
+
"test": "tsc -p tsconfig.build.json && node --test tests/*.test.mjs",
|
|
82
|
+
"test:coverage": "tsc -p tsconfig.build.json && node --test --experimental-test-coverage tests/*.test.mjs"
|
|
83
|
+
}
|
|
6
84
|
}
|