@hollis-labs/kit-admin 0.0.0-stage → 0.2.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,93 @@
1
+ import { ReactNode } from 'react';
2
+ import { SettingsGroup, SettingsProvenanceRendererProps, SettingsProvenanceState, SettingsWizardProps } from '@hollis-labs/kit-settings';
3
+ import { HealthSummaryProps, StatObservation, DiagnosticPanelProps, ObservationUnit, ObservationKind } from '@hollis-labs/kit-observe';
4
+ import { SampleSeriesViewProps } from '@hollis-labs/kit-observe/charts';
5
+ /** View projections only. The host validates wire schemas, endpoints, auth and bounds. */
6
+ export interface AdminDeclaration {
7
+ readonly id: string;
8
+ readonly label: string;
9
+ readonly section: string;
10
+ }
11
+ export interface AdminObservationDeclaration extends AdminDeclaration {
12
+ readonly stale_after_ms: number;
13
+ }
14
+ export interface AdminSettingsDeclaration extends SettingsGroup {
15
+ readonly section: string;
16
+ readonly scope?: {
17
+ readonly kind: string;
18
+ readonly id?: string;
19
+ };
20
+ }
21
+ export interface AdminStatDeclaration extends AdminObservationDeclaration {
22
+ readonly unit: ObservationUnit;
23
+ readonly kind: ObservationKind;
24
+ }
25
+ export interface AdminSeriesDeclaration extends AdminStatDeclaration {
26
+ readonly max_points: number;
27
+ readonly max_window_seconds: number;
28
+ }
29
+ export interface AdminDiagnosticDeclaration extends AdminObservationDeclaration {
30
+ readonly schema: DiagnosticPanelProps['schema'];
31
+ }
32
+ export interface AdminManifest {
33
+ readonly contract_version: number;
34
+ readonly app: {
35
+ readonly id: string;
36
+ readonly label: string;
37
+ };
38
+ readonly revision: string;
39
+ readonly settings: readonly AdminSettingsDeclaration[];
40
+ readonly health: readonly AdminObservationDeclaration[];
41
+ readonly stats: readonly AdminStatDeclaration[];
42
+ readonly series: readonly AdminSeriesDeclaration[];
43
+ readonly diagnostics: readonly AdminDiagnosticDeclaration[];
44
+ }
45
+ export type AdminPage = 'dashboard' | 'settings' | 'status' | 'diagnostics';
46
+ export interface AdminTarget {
47
+ readonly page: AdminPage;
48
+ readonly groupId?: string;
49
+ }
50
+ export type AdminDestination = {
51
+ readonly href: string;
52
+ readonly onSelect?: never;
53
+ } | {
54
+ readonly onSelect: () => void;
55
+ readonly href?: never;
56
+ };
57
+ export interface AdminSelection extends AdminTarget {
58
+ readonly mode?: 'edit' | 'setup';
59
+ }
60
+ export interface AdminDiscovery {
61
+ readonly phase: 'loading' | 'ready' | 'error';
62
+ /** Must match the active authorized host context; never retain a prior principal. */
63
+ readonly contextKey: string;
64
+ readonly manifest?: AdminManifest;
65
+ readonly error?: string;
66
+ }
67
+ export interface AdminSettingsRead {
68
+ readonly phase: 'loading' | 'ready' | 'error';
69
+ readonly state?: SettingsProvenanceState;
70
+ readonly error?: string;
71
+ }
72
+ export interface AdminObservations {
73
+ readonly health?: Readonly<Record<string, Omit<HealthSummaryProps, 'label'> | undefined>>;
74
+ readonly stats?: Readonly<Record<string, Pick<StatObservation, 'value' | 'observation'> | undefined>>;
75
+ readonly series?: Readonly<Record<string, Omit<SampleSeriesViewProps, 'label' | 'unit' | 'kind' | 'bounds'> | undefined>>;
76
+ readonly diagnostics?: Readonly<Record<string, Omit<DiagnosticPanelProps, 'label' | 'schema'> | undefined>>;
77
+ }
78
+ export interface AdminContentProps {
79
+ readonly contextKey: string;
80
+ readonly discovery: AdminDiscovery;
81
+ readonly selection: AdminSelection;
82
+ /** Host maps canonical targets to its routes or controlled navigation callbacks. */
83
+ readonly destination: (target: AdminTarget) => AdminDestination;
84
+ readonly settings?: Readonly<Record<string, AdminSettingsRead | undefined>>;
85
+ readonly settingsActions?: Pick<SettingsProvenanceRendererProps, 'onDraftChange' | 'onSave' | 'onReset' | 'onValidate' | 'onApply'>;
86
+ readonly setup?: Omit<SettingsWizardProps, 'contractVersion' | 'groups' | 'states' | 'onDraftChange'>;
87
+ /** Context/metadata beside the Wizard; never a second editable form. */
88
+ readonly setupContext?: ReactNode;
89
+ readonly observations?: AdminObservations;
90
+ readonly nowMs: number;
91
+ /** Explicit opt-in: root imports no chart implementation. See /charts. */
92
+ readonly renderSeries?: (props: SampleSeriesViewProps) => ReactNode;
93
+ }
package/package.json CHANGED
@@ -1,6 +1,96 @@
1
1
  {
2
2
  "name": "@hollis-labs/kit-admin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "description": "Controlled manifest-driven admin navigation and page composition; host-owned data, routes and commands.",
9
+ "keywords": [
10
+ "react",
11
+ "admin",
12
+ "design-system"
13
+ ],
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/hollis-labs/frontend-support.git",
18
+ "directory": "ts/design-kit/packages/kit-admin"
19
+ },
20
+ "homepage": "https://github.com/hollis-labs/frontend-support/tree/main/ts/design-kit/packages/kit-admin#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/hollis-labs/frontend-support/issues"
23
+ },
24
+ "type": "module",
25
+ "sideEffects": [
26
+ "**/*.css"
27
+ ],
28
+ "files": [
29
+ "dist",
30
+ "src/styles",
31
+ "CHANGELOG.md"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/src/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ },
38
+ "./source.css": "./src/styles/source.css",
39
+ "./charts": {
40
+ "types": "./dist/src/charts.d.ts",
41
+ "import": "./dist/charts.js"
42
+ }
43
+ },
44
+ "main": "./dist/index.js",
45
+ "module": "./dist/index.js",
46
+ "types": "./dist/src/index.d.ts",
47
+ "scripts": {
48
+ "build": "tsc -p tsconfig.build.json && vite build",
49
+ "prepack": "npm run build",
50
+ "typecheck": "tsc --noEmit -p tsconfig.json",
51
+ "lint": "eslint .",
52
+ "test": "vitest",
53
+ "test:run": "vitest run",
54
+ "demo": "vite --config demo/vite.config.ts",
55
+ "demo:build": "vite build --config demo/vite.config.ts",
56
+ "prebuild": "node scripts/build-dependencies.mjs"
57
+ },
58
+ "peerDependencies": {
59
+ "tailwindcss": "^4.0.0",
60
+ "@base-ui/react": "^1.3.0",
61
+ "lucide-react": "^1.7.0",
62
+ "react": "^19.0.0",
63
+ "react-dom": "^19.0.0"
64
+ },
65
+ "dependencies": {
66
+ "@hollis-labs/design-components": "^0.5.0",
67
+ "@hollis-labs/design-tokens": "^0.5.0",
68
+ "@hollis-labs/kit-dashboard": "^0.6.0",
69
+ "@hollis-labs/kit-settings": "^0.2.0",
70
+ "@hollis-labs/kit-observe": "^0.1.1"
71
+ },
72
+ "devDependencies": {
73
+ "@base-ui/react": "^1.3.0",
74
+ "@eslint/js": "^9.39.4",
75
+ "@hollis-labs/eslint-config-design": "^0.5.0",
76
+ "@testing-library/react": "^16.3.2",
77
+ "@types/node": "^24.12.2",
78
+ "@types/react": "^19.2.14",
79
+ "@types/react-dom": "^19.2.3",
80
+ "@vitejs/plugin-react": "4.7.0",
81
+ "eslint": "^9.39.4",
82
+ "eslint-plugin-react-hooks": "^7.0.1",
83
+ "eslint-plugin-react-refresh": "^0.5.2",
84
+ "globals": "^17.4.0",
85
+ "jsdom": "^25.0.1",
86
+ "lucide-react": "^1.7.0",
87
+ "react": "^19.2.4",
88
+ "react-dom": "^19.2.4",
89
+ "typescript": "~6.0.2",
90
+ "vite": "5.4.21",
91
+ "vite-plugin-dts": "^4.5.4",
92
+ "vitest": "^2.1.9",
93
+ "@tailwindcss/vite": "^4.0.0",
94
+ "typescript-eslint": "^8.58.0"
95
+ }
96
+ }
@@ -0,0 +1 @@
1
+ @source "../../dist";