@bebopdev/admin 0.1.0-beta.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.
@@ -0,0 +1,2 @@
1
+ import { type RefObject } from "react";
2
+ export declare const AdminPortalContainer: import("react").Context<RefObject<HTMLDivElement | null> | null>;
@@ -0,0 +1 @@
1
+ export { cn } from "cn";
@@ -0,0 +1,48 @@
1
+ export type BebopAdminStoredFieldKind = "text" | "number" | "integer" | "boolean" | "date" | "json" | "select" | "relation";
2
+ export type BebopAdminFieldKind = BebopAdminStoredFieldKind | "join";
3
+ type BebopAdminFieldBase = {
4
+ name: string;
5
+ label: string;
6
+ };
7
+ type BebopAdminFieldOptions = {
8
+ admin?: {
9
+ position?: "main" | "sidebar";
10
+ input?: "textarea";
11
+ date?: {
12
+ pickerAppearance?: "dayOnly" | "dayAndTime";
13
+ };
14
+ defaultColumns?: readonly string[];
15
+ allowCreate?: boolean;
16
+ };
17
+ };
18
+ export type BebopAdminStoredField = BebopAdminFieldBase & BebopAdminFieldOptions & {
19
+ kind: BebopAdminStoredFieldKind;
20
+ storageName: string;
21
+ required: boolean;
22
+ options?: readonly string[];
23
+ optionLabels?: Readonly<Record<string, string>>;
24
+ relationTo?: string;
25
+ };
26
+ export type BebopAdminJoinField = BebopAdminFieldBase & BebopAdminFieldOptions & {
27
+ kind: "join";
28
+ required: false;
29
+ collection: string;
30
+ on: string;
31
+ };
32
+ export type BebopAdminField = BebopAdminStoredField | BebopAdminJoinField;
33
+ export type BebopAdminCollection = {
34
+ slug: string;
35
+ labels: {
36
+ singular: string;
37
+ plural: string;
38
+ };
39
+ fields: readonly BebopAdminField[];
40
+ timestamps: boolean;
41
+ useAsTitle?: string;
42
+ defaultColumns: readonly string[];
43
+ listSearchableFields: readonly string[];
44
+ };
45
+ export type BebopAdminManifest = {
46
+ collections: Readonly<Record<string, BebopAdminCollection>>;
47
+ };
48
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { MutationErrorEvent } from "jazz-tools";
2
+ import type { BebopAdminManifest } from "../types.js";
3
+ export type BebopAdminClient = object & {
4
+ onMutationError: (listener: (event: MutationErrorEvent) => void) => () => void;
5
+ };
6
+ export type BebopAdminUser = {
7
+ name?: string;
8
+ email?: string;
9
+ };
10
+ export type BebopAdminProps = {
11
+ app: object;
12
+ client: BebopAdminClient;
13
+ manifest: BebopAdminManifest;
14
+ /** The host decides who may enter the admin. Jazz policies still secure collection data. */
15
+ canAccessAdmin: boolean;
16
+ user?: BebopAdminUser;
17
+ createDefaults?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
18
+ relationOptions?: Readonly<Record<string, readonly {
19
+ id: string;
20
+ name: string;
21
+ }[]>>;
22
+ onLogout?: () => void | Promise<void>;
23
+ };
24
+ export declare function BebopAdmin({ app, client, manifest, canAccessAdmin, user, createDefaults, relationOptions, onLogout }: BebopAdminProps): import("react").JSX.Element | null;
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@bebopdev/admin",
3
+ "version": "0.1.0-beta.0",
4
+ "description": "First-party React admin UI for Bebop collections on Jazz.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/reezerdev/bebop.git",
9
+ "directory": "packages/admin"
10
+ },
11
+ "homepage": "https://github.com/reezerdev/bebop#readme",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "type": "module",
23
+ "main": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./styles.css": "./dist/index.css"
31
+ },
32
+ "peerDependencies": {
33
+ "react": ">=19",
34
+ "react-dom": ">=19",
35
+ "react-router-dom": ">=6",
36
+ "jazz-tools": "2.0.0-alpha.57"
37
+ },
38
+ "dependencies": {
39
+ "@base-ui/react": "^1.8.0",
40
+ "@fontsource-variable/noto-sans": "^5.3.0",
41
+ "@fontsource-variable/playfair-display": "^5.3.0",
42
+ "class-variance-authority": "^0.7.1",
43
+ "cn": "^0.4.0",
44
+ "lucide-react": "^0.468.0",
45
+ "react-hook-form": "^7.89.0"
46
+ },
47
+ "devDependencies": {
48
+ "jazz-tools": "2.0.0-alpha.57",
49
+ "@tailwindcss/vite": "^4.1.0",
50
+ "@types/react": "^19.3.0",
51
+ "@types/react-dom": "^19.3.0",
52
+ "@vitejs/plugin-react": "^6.1.1",
53
+ "shadcn": "^4.21.0",
54
+ "tailwindcss": "^4.1.0",
55
+ "tw-animate-css": "^1.4.0",
56
+ "typescript": "^5.9.3",
57
+ "vite": "^8.3.1"
58
+ },
59
+ "scripts": {
60
+ "build": "vite build && tsc -p tsconfig.types.json",
61
+ "check": "tsc --noEmit -p tsconfig.json",
62
+ "dev": "vite build --watch"
63
+ }
64
+ }