@coreframe/dashboard 0.3.25 → 0.3.27
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/README.md +3 -2
- package/dist/package/app/shell.js +1 -1
- package/dist/package/build.js +2 -2
- package/dist/package/config.d.ts +6 -0
- package/dist/package/plugins/diagnostics/index.d.ts +2 -0
- package/dist/package/plugins/diagnostics/index.js +1 -1
- package/dist/package/shell.css +148 -80
- package/dist/package/web/dashboard/dashboard.style.js +1 -1
- package/dist/package/web/ui/index.d.ts +1 -1
- package/dist/package/web-shell/shell.d.ts +6 -1
- package/dist/package/web-shell/shell.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -25,8 +25,9 @@ export default defineConfig({
|
|
|
25
25
|
Removing `diagnostics()` removes the feature's root navigation entry and its runtime operations.
|
|
26
26
|
Plugins are never discovered or installed at runtime.
|
|
27
27
|
|
|
28
|
-
Add app-owned routes at `dashboard/pages/<slug>/route.tsx`. An
|
|
29
|
-
define `title` and `description`.
|
|
28
|
+
Add app-owned routes at `dashboard/pages/<slug>/route.tsx`. An adjacent `page.yaml` must define `icon` as a Codicon name (for example,
|
|
29
|
+
`icon: settings-gear`) and may define `title` and `description`. Plugin navigation also requires
|
|
30
|
+
`icon`. The sidebar uses the application package name and `src/assets/favicon.svg`. Build-time composition validates slugs, metadata, route modules,
|
|
30
31
|
identifiers, and paths before generating the React Router route graph and navigation manifest.
|
|
31
32
|
|
|
32
33
|
The generated dashboard does not need route adapters, a document root, a query-client module, or an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DashboardErrorBoundary as e,DashboardShell as t}from"../web-shell/shell.js";import"../web-shell/index.js";import{jsx as n}from"react/jsx-runtime";import{dashboardManifest as
|
|
1
|
+
import{DashboardErrorBoundary as e,DashboardShell as t}from"../web-shell/shell.js";import"../web-shell/index.js";import{jsx as n}from"react/jsx-runtime";import{dashboardApplication as r,dashboardManifest as i}from"virtual:coreframe-internal/dashboard/manifest";const a=e;function o(){return n(t,{pages:i,application:r})}export{a as ErrorBoundary,o as default};
|
package/dist/package/build.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{getDashboardPluginBuild as e}from"./config.js";import{createRequire as t}from"node:module";import{readFile as n,readdir as r}from"node:fs/promises";import{isAbsolute as i,join as a,resolve as o}from"node:path";import{
|
|
1
|
+
import{getDashboardPluginBuild as e}from"./config.js";import{createRequire as t}from"node:module";import{readFile as n,readdir as r}from"node:fs/promises";import{isAbsolute as i,join as a,resolve as o}from"node:path";import{icons as s}from"@iconify-json/codicon";import{parseDocument as c}from"yaml";import{z as l}from"zod";const u=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,d=l.string().refine(e=>Object.hasOwn(s.icons,e),`must be a valid Codicon name`),f=l.object({icon:d,title:l.string().trim().min(1,`title must not be empty`).optional(),description:l.string().trim().min(1,`description must not be empty`).optional()}).strict(),p=l.object({id:l.string(),path:l.string(),icon:d,title:l.string(),description:l.string().optional(),routeModule:l.string(),environments:l.array(l.enum([`local`,`deployed`])).optional()}).strict(),m=l.string().trim().min(1,`module reference must not be empty`),h=l.object({path:l.string(),icon:d,title:l.string(),description:l.string().optional(),environments:l.array(l.enum([`local`,`deployed`])).optional()}).strict(),g=l.object({document:m.optional(),plugins:l.array(l.object({id:l.string(),navigation:h,pageModule:m,api:l.unknown().optional()}).strict()).optional()}).strict();async function _(e={}){let t=a(o(e.dashboardDirectory??a(process.cwd(),`dashboard`)),`pages`),i;try{i=await r(t,{withFileTypes:!0})}catch(e){if(F(e)&&e.code===`ENOENT`)return[];throw new w(t,`could not read the pages directory`,e)}let s=i.filter(e=>e.isDirectory()&&!e.name.startsWith(`.`)).sort((e,t)=>P(e.name,t.name));return Promise.all(s.map(async({name:e})=>{let r=a(t,e);M(e,r,`page directory`);let i=a(r,`route.tsx`);try{await n(i)}catch(e){throw F(e)&&e.code===`ENOENT`?new w(i,`missing required React Router route.tsx`):new w(i,`could not read route.tsx`,e)}let o=await T(a(r,`page.yaml`));return{id:e,path:e,icon:o.icon,title:o?.title??N(e),...o?.description?{description:o.description}:{},routeModule:`pages/${e}/route.tsx`}}))}function v(e,t,n={}){let r=n.environment??`local`,i=new Set,a=[],o=A(e);for(let e of o.plugins??[]){if(M(e.id,`dashboard.config.ts plugin "${e.id}"`,`plugin id`),i.has(e.id))throw new w(`dashboard.config.ts`,`duplicate plugin id "${e.id}"`);i.add(e.id);let t=D(e,`plugin`,r);t&&a.push(t)}let s=t.map(e=>({page:e,normalizedPage:E(e,`app`)})).sort((e,t)=>P(e.normalizedPage.path,t.normalizedPage.path));for(let{page:e,normalizedPage:t}of s)k(e,r)&&a.push(t);return O(a),a}function y(e,t){let n=A(e),r=new Set,i=[];for(let e of n.plugins??[]){if(M(e.id,`dashboard.config.ts plugin "${e.id}"`,`plugin id`),r.has(e.id))throw new w(`dashboard.config.ts`,`duplicate plugin id "${e.id}"`);if(r.add(e.id),!e.api)continue;let n=j(e,`dashboard API`),a=t===`local`?n.localImplementationModule:n.deployedImplementationModule;a&&i.push({pluginId:e.id,apiModule:n.apiModule,implementationModule:a})}return i}function b(e){let t=[],n=[];for(let[r,i]of e.entries())t.push(`import { api as api${r} } from ${JSON.stringify(i.apiModule)}`,`import { createImplementation as createImplementation${r} } from ${JSON.stringify(i.implementationModule)}`),n.push(`{ api: api${r}, createImplementation: createImplementation${r} }`);return`${t.join(`
|
|
2
2
|
`)}\n\nexport const dashboardPlugins = [\n${n.map(e=>` ${e},`).join(`
|
|
3
|
-
`)}\n]\n`}function
|
|
3
|
+
`)}\n]\n`}function x(e,t){let n=[e.length>0?{index:!0,file:t.indexRoute}:{index:!0,file:t.emptyRoute},...e.map(e=>({id:`dashboard-page-${e.id}`,path:e.path,file:e.routeModule})),...t.notFoundRoute?[{path:`*`,file:t.notFoundRoute}]:[]];return[{id:`dashboard-shell`,file:t.shellRoute,children:n}]}function S(e,t={}){let n=o(t.dashboardDirectory??a(process.cwd(),`dashboard`));return e.map(e=>({...e,routeModule:e.source===`app`?o(n,e.routeModule):C(e.routeModule,t)}))}function C(e,n={}){let r=o(n.dashboardDirectory??a(process.cwd(),`dashboard`)),s=t(a(o(n.projectRoot??a(r,`..`)),`package.json`));if(i(e)||e.startsWith(`.`))return o(r,e);try{return s.resolve(e)}catch(t){throw new w(e,`could not resolve dashboard module`,t)}}var w=class extends Error{file;constructor(e,t,n){super(`${e}: ${t}`,{cause:n}),this.name=`DashboardCompositionError`,this.file=e}};async function T(e){let t;try{t=await n(e,`utf8`)}catch(t){throw F(t)&&t.code===`ENOENT`?new w(e,`missing required page.yaml with a Codicon icon`):new w(e,`could not read page metadata`,t)}let r=c(t,{prettyErrors:!0,strict:!0,uniqueKeys:!0});if(r.errors.length>0)throw new w(e,r.errors[0]?.message??`invalid YAML`);let i=f.safeParse(r.toJS());if(!i.success)throw new w(e,l.prettifyError(i.error));return i.data}function E(e,t,n){let r=t===`plugin`?`dashboard.config.ts plugin "${n??`unknown`}" page "${e.id}"`:e.routeModule,i=p.safeParse(e);if(!i.success)throw new w(r,l.prettifyError(i.error));let a=i.data;M(a.id,r,`page id`),M(a.path,r,`page path`);let o=a.title.trim();if(!o)throw new w(r,`page title must not be empty`);if(!a.routeModule.trim())throw new w(r,`page routeModule must not be empty`);let s=a.description?.trim();if(a.description!==void 0&&!s)throw new w(r,`page description must not be empty`);return{id:a.id,path:a.path,title:o,icon:a.icon,...s?{description:s}:{},routeModule:a.routeModule,source:t,...n?{pluginId:n}:{}}}function D(e,t,n){let r=`dashboard.config.ts plugin "${e.id}"`,i=h.safeParse(e.navigation);if(!i.success)throw new w(r,l.prettifyError(i.error));let a=i.data;if(M(e.id,r,`plugin id`),M(a.path,r,`navigation path`),!a.title.trim())throw new w(r,`navigation title must not be empty`);if(a.description!==void 0&&!a.description.trim())throw new w(r,`navigation description must not be empty`);if(!e.pageModule.trim())throw new w(r,`pageModule must not be empty`);if(!(a.environments&&!a.environments.includes(n))){if(e.api){let t=j(e,`dashboard API`);if(n===`local`&&!t.localImplementationModule||n===`deployed`&&!t.deployedImplementationModule)return}return E({id:e.id,path:a.path,title:a.title,icon:a.icon,...a.description?{description:a.description}:{},routeModule:e.pageModule,...a.environments?{environments:a.environments}:{}},t,e.id)}}function O(e){let t=new Map,n=new Map;for(let r of e){let e=t.get(r.id);if(e)throw new w(r.routeModule,`duplicate page id "${r.id}" also contributed by ${e.routeModule}`);t.set(r.id,r);let i=n.get(r.path);if(i)throw new w(r.routeModule,`duplicate page path "${r.path}" also contributed by ${i.routeModule}`);n.set(r.path,r)}}function k(e,t){return e.environments?e.environments.includes(t):!0}function A(e){let t=g.safeParse(e);if(!t.success)throw new w(`dashboard.config.ts`,l.prettifyError(t.error));return e}function j(t,n){let r=e(t);if(!r)throw new w(`dashboard.config.ts plugin "${t.id}"`,`${n} is missing its package-owned build descriptor`);if(t.api&&t.api.id!==t.id)throw new w(`dashboard.config.ts plugin "${t.id}"`,`API id "${t.api.id}" does not match the plugin id`);for(let e of[`apiModule`,`localImplementationModule`]){let n=r[e];if(typeof n!=`string`||!n.trim())throw new w(`dashboard.config.ts plugin "${t.id}"`,`build descriptor field "${e}" must be a non-empty module reference`)}if(r.deployedImplementationModule!==void 0&&(typeof r.deployedImplementationModule!=`string`||!r.deployedImplementationModule.trim()))throw new w(`dashboard.config.ts plugin "${t.id}"`,`build descriptor field "deployedImplementationModule" must be a non-empty module reference`);return r}function M(e,t,n){if(!u.test(e))throw new w(t,`${n} "${e}" must contain only lowercase letters, numbers, and single hyphens`)}function N(e){let t=e.split(`-`).join(` `);return`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function P(e,t){return e<t?-1:+(e>t)}function F(e){return e instanceof Error&&`code`in e}export{w as DashboardCompositionError,v as composeDashboardManifest,y as composeDashboardPluginTarget,x as composeDashboardRoutes,_ as discoverDashboardPages,b as renderDashboardPluginTargetModule,C as resolveDashboardModuleReference,S as resolveDashboardRouteModules};
|
package/dist/package/config.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ interface DashboardPageContribution {
|
|
|
8
8
|
/** Top-level URL segment below `/__dashboard/`. */
|
|
9
9
|
path: string;
|
|
10
10
|
title: string;
|
|
11
|
+
/** Codicon name, for example `settings-gear`. */
|
|
12
|
+
icon: string;
|
|
11
13
|
description?: string;
|
|
12
14
|
/** React Router framework route module, resolved by the dashboard build. */
|
|
13
15
|
routeModule: string;
|
|
@@ -19,6 +21,8 @@ interface DashboardPluginNavigation {
|
|
|
19
21
|
/** Top-level URL segment below `/__dashboard/`. */
|
|
20
22
|
path: string;
|
|
21
23
|
title: string;
|
|
24
|
+
/** Codicon name, for example `settings-gear`. */
|
|
25
|
+
icon: string;
|
|
22
26
|
description?: string;
|
|
23
27
|
/** Environments where the feature is available. Defaults to both. */
|
|
24
28
|
environments?: readonly DashboardEnvironment[];
|
|
@@ -56,6 +60,8 @@ interface DashboardPageManifestEntry {
|
|
|
56
60
|
id: string;
|
|
57
61
|
path: string;
|
|
58
62
|
title: string;
|
|
63
|
+
/** Codicon name, for example `settings-gear`. */
|
|
64
|
+
icon: string;
|
|
59
65
|
description?: string;
|
|
60
66
|
routeModule: string;
|
|
61
67
|
source: "app" | "plugin";
|
|
@@ -5,6 +5,7 @@ declare const diagnosticsPlugin: {
|
|
|
5
5
|
readonly id: "diagnostics";
|
|
6
6
|
readonly navigation: {
|
|
7
7
|
readonly path: "diagnostics";
|
|
8
|
+
readonly icon: "checklist";
|
|
8
9
|
readonly title: "Production readiness";
|
|
9
10
|
readonly description: "Review launch readiness, deployment configuration, and project health.";
|
|
10
11
|
};
|
|
@@ -18,6 +19,7 @@ declare function diagnostics(): {
|
|
|
18
19
|
readonly id: "diagnostics";
|
|
19
20
|
readonly navigation: {
|
|
20
21
|
readonly path: "diagnostics";
|
|
22
|
+
readonly icon: "checklist";
|
|
21
23
|
readonly title: "Production readiness";
|
|
22
24
|
readonly description: "Review launch readiness, deployment configuration, and project health.";
|
|
23
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{definePlugin as e}from"../../config.js";import{diagnosticsApi as t}from"./api/contract.js";const n=e({id:`diagnostics`,navigation:{path:`diagnostics`,title:`Production readiness`,description:`Review launch readiness, deployment configuration, and project health.`},pageModule:`@coreframe/dashboard/plugins/diagnostics/web`,api:t},{apiModule:`@coreframe/dashboard/plugins/diagnostics/api/contract`,localImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/local`,deployedImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/worker`});function r(){return n}export{r as diagnostics,n as diagnosticsPlugin};
|
|
1
|
+
import{definePlugin as e}from"../../config.js";import{diagnosticsApi as t}from"./api/contract.js";const n=e({id:`diagnostics`,navigation:{path:`diagnostics`,icon:`checklist`,title:`Production readiness`,description:`Review launch readiness, deployment configuration, and project health.`},pageModule:`@coreframe/dashboard/plugins/diagnostics/web`,api:t},{apiModule:`@coreframe/dashboard/plugins/diagnostics/api/contract`,localImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/local`,deployedImplementationModule:`@coreframe/dashboard/plugins/diagnostics/api/worker`});function r(){return n}export{r as diagnostics,n as diagnosticsPlugin};
|
package/dist/package/shell.css
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
text-size-adjust: 100%;
|
|
21
21
|
overscroll-behavior-y: none;
|
|
22
22
|
|
|
23
|
-
color: #
|
|
24
|
-
background: #
|
|
23
|
+
color: var(--colors-dashboard-ink, #1f2937);
|
|
24
|
+
background: var(--colors-dashboard-panel, #ffffff);
|
|
25
25
|
font-family: "Inter Variable", Inter, system-ui, sans-serif;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
|
|
123
123
|
.coreframe-dashboard,
|
|
124
124
|
.coreframe-dashboard__state {
|
|
125
|
-
--dashboard-background: #
|
|
126
|
-
--dashboard-border: #dfe3e8;
|
|
127
|
-
--dashboard-foreground: #
|
|
128
|
-
--dashboard-muted: #68717d;
|
|
129
|
-
--dashboard-surface: #ffffff;
|
|
130
|
-
--dashboard-accent: #4f46e5;
|
|
125
|
+
--dashboard-background: var(--colors-dashboard-canvas, #f7f8fa);
|
|
126
|
+
--dashboard-border: var(--colors-dashboard-border, #dfe3e8);
|
|
127
|
+
--dashboard-foreground: var(--colors-dashboard-ink, #1f2937);
|
|
128
|
+
--dashboard-muted: var(--colors-dashboard-muted, #68717d);
|
|
129
|
+
--dashboard-surface: var(--colors-dashboard-panel, #ffffff);
|
|
130
|
+
--dashboard-accent: var(--colors-dashboard-accent, #4f46e5);
|
|
131
131
|
box-sizing: border-box;
|
|
132
132
|
color: var(--dashboard-foreground);
|
|
133
133
|
font-family: "Inter Variable", Inter, system-ui, sans-serif;
|
|
@@ -145,81 +145,122 @@
|
|
|
145
145
|
.coreframe-dashboard {
|
|
146
146
|
display: grid;
|
|
147
147
|
min-height: 100svh;
|
|
148
|
-
grid-template-columns:
|
|
149
|
-
background: var(--dashboard-
|
|
148
|
+
grid-template-columns: 14rem minmax(0, 1fr);
|
|
149
|
+
background: var(--dashboard-surface);
|
|
150
150
|
transition: grid-template-columns 160ms ease;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
.coreframe-dashboard[data-collapsed="true"] {
|
|
154
|
-
grid-template-columns:
|
|
154
|
+
grid-template-columns: 4rem minmax(0, 1fr);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
.coreframe-dashboard__sidebar {
|
|
158
158
|
z-index: 20;
|
|
159
159
|
border-right: 1px solid var(--dashboard-border);
|
|
160
|
-
background: var(--dashboard-
|
|
160
|
+
background: var(--dashboard-background);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
.coreframe-dashboard__navigation {
|
|
164
164
|
position: sticky;
|
|
165
165
|
top: 0;
|
|
166
166
|
height: 100svh;
|
|
167
|
-
padding: 1rem;
|
|
167
|
+
padding: 0 0.75rem 1rem;
|
|
168
168
|
overflow: hidden auto;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
.coreframe-dashboard__sidebar-header {
|
|
172
|
+
display: flex;
|
|
173
|
+
min-height: 4.5rem;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: space-between;
|
|
176
|
+
gap: 0.5rem;
|
|
177
|
+
padding-inline: 0.375rem;
|
|
178
|
+
}
|
|
179
|
+
|
|
171
180
|
.coreframe-dashboard__brand {
|
|
172
181
|
display: flex;
|
|
173
|
-
min-
|
|
182
|
+
min-width: 0;
|
|
174
183
|
align-items: center;
|
|
175
|
-
gap: 0.
|
|
176
|
-
font-
|
|
184
|
+
gap: 0.625rem;
|
|
185
|
+
font-size: 0.875rem;
|
|
186
|
+
font-weight: 600;
|
|
187
|
+
letter-spacing: -0.02em;
|
|
177
188
|
white-space: nowrap;
|
|
178
189
|
}
|
|
179
190
|
|
|
180
191
|
.coreframe-dashboard__mark {
|
|
181
192
|
display: grid;
|
|
182
|
-
width:
|
|
183
|
-
height:
|
|
193
|
+
width: 1.75rem;
|
|
194
|
+
height: 1.75rem;
|
|
184
195
|
flex: 0 0 auto;
|
|
185
196
|
place-items: center;
|
|
186
|
-
border-radius: 0.
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
border-radius: 0.375rem;
|
|
198
|
+
object-fit: contain;
|
|
199
|
+
font-size: 0.875rem;
|
|
200
|
+
font-weight: 700;
|
|
189
201
|
}
|
|
190
202
|
|
|
191
203
|
.coreframe-dashboard__navigation-list {
|
|
192
204
|
display: grid;
|
|
193
|
-
gap: 0.
|
|
194
|
-
margin:
|
|
205
|
+
gap: 0.1875rem;
|
|
206
|
+
margin: 0.5rem 0 0;
|
|
195
207
|
padding: 0;
|
|
196
208
|
list-style: none;
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
.coreframe-dashboard__navigation-link {
|
|
200
212
|
display: flex;
|
|
201
|
-
min-height: 2.
|
|
213
|
+
min-height: 2.25rem;
|
|
214
|
+
min-width: 0;
|
|
202
215
|
align-items: center;
|
|
203
|
-
gap: 0.
|
|
204
|
-
border-radius: 0.
|
|
216
|
+
gap: 0.625rem;
|
|
217
|
+
border-radius: 0.375rem;
|
|
205
218
|
color: var(--dashboard-muted);
|
|
206
|
-
padding: 0.5rem;
|
|
219
|
+
padding: 0.375rem 0.5rem;
|
|
220
|
+
font-size: 0.8125rem;
|
|
221
|
+
font-weight: 500;
|
|
222
|
+
line-height: 1.5rem;
|
|
207
223
|
text-decoration: none;
|
|
208
224
|
white-space: nowrap;
|
|
209
225
|
}
|
|
210
226
|
|
|
211
|
-
.coreframe-dashboard__navigation-link:hover
|
|
227
|
+
.coreframe-dashboard__navigation-link:hover {
|
|
228
|
+
background: color-mix(in srgb, var(--dashboard-foreground) 5%, var(--dashboard-background));
|
|
229
|
+
color: var(--dashboard-foreground);
|
|
230
|
+
}
|
|
231
|
+
|
|
212
232
|
.coreframe-dashboard__navigation-link[aria-current="page"] {
|
|
213
|
-
background:
|
|
214
|
-
color:
|
|
233
|
+
background: color-mix(in srgb, var(--dashboard-accent) 8%, var(--dashboard-background));
|
|
234
|
+
color: var(--dashboard-foreground);
|
|
215
235
|
}
|
|
216
236
|
|
|
217
|
-
.coreframe-dashboard__navigation-
|
|
218
|
-
|
|
219
|
-
|
|
237
|
+
.coreframe-dashboard__navigation-icon {
|
|
238
|
+
display: grid;
|
|
239
|
+
width: 1.5rem;
|
|
240
|
+
height: 1.5rem;
|
|
220
241
|
flex: 0 0 auto;
|
|
221
|
-
|
|
222
|
-
|
|
242
|
+
place-items: center;
|
|
243
|
+
border-radius: 0.25rem;
|
|
244
|
+
background: color-mix(in srgb, var(--dashboard-foreground) 5%, var(--dashboard-background));
|
|
245
|
+
font-size: 0.625rem;
|
|
246
|
+
font-weight: 600;
|
|
247
|
+
line-height: 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.coreframe-dashboard__navigation-link[aria-current="page"] .coreframe-dashboard__navigation-icon {
|
|
251
|
+
background: color-mix(in srgb, var(--dashboard-accent) 12%, var(--dashboard-background));
|
|
252
|
+
color: var(--dashboard-accent);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.coreframe-dashboard__navigation-text {
|
|
256
|
+
overflow: hidden;
|
|
257
|
+
text-overflow: ellipsis;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.coreframe-dashboard[data-collapsed="true"] .coreframe-dashboard__sidebar-header,
|
|
261
|
+
.coreframe-dashboard[data-collapsed="true"] .coreframe-dashboard__navigation-link {
|
|
262
|
+
justify-content: center;
|
|
263
|
+
padding-inline: 0;
|
|
223
264
|
}
|
|
224
265
|
|
|
225
266
|
.coreframe-dashboard[data-collapsed="true"] .coreframe-dashboard__navigation-text,
|
|
@@ -239,70 +280,75 @@
|
|
|
239
280
|
}
|
|
240
281
|
|
|
241
282
|
.coreframe-dashboard__toggle {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
283
|
+
flex: 0 0 auto;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.coreframe-dashboard__toggle,
|
|
287
|
+
.coreframe-dashboard__drawer-close {
|
|
246
288
|
display: grid;
|
|
247
289
|
width: 2rem;
|
|
248
290
|
height: 2rem;
|
|
249
291
|
place-items: center;
|
|
250
|
-
border:
|
|
251
|
-
border-radius: 0.
|
|
252
|
-
background:
|
|
253
|
-
color: var(--dashboard-
|
|
254
|
-
|
|
292
|
+
border: 0;
|
|
293
|
+
border-radius: 0.375rem;
|
|
294
|
+
background: transparent;
|
|
295
|
+
color: var(--dashboard-muted);
|
|
296
|
+
padding: 0;
|
|
255
297
|
}
|
|
256
298
|
|
|
257
|
-
.coreframe-
|
|
258
|
-
|
|
299
|
+
.coreframe-dashboard__toggle:hover,
|
|
300
|
+
.coreframe-dashboard__drawer-close:hover {
|
|
301
|
+
background: color-mix(in srgb, var(--dashboard-foreground) 5%, var(--dashboard-surface));
|
|
302
|
+
color: var(--dashboard-foreground);
|
|
259
303
|
}
|
|
260
304
|
|
|
261
305
|
.coreframe-dashboard__main {
|
|
262
|
-
|
|
263
|
-
width: min(100%, 80rem);
|
|
264
|
-
padding: 4rem clamp(1.25rem, 4vw, 4rem);
|
|
306
|
+
min-width: 0;
|
|
265
307
|
}
|
|
266
308
|
|
|
267
309
|
.coreframe-dashboard__page-header {
|
|
268
|
-
|
|
310
|
+
display: flex;
|
|
311
|
+
min-height: 4.5rem;
|
|
312
|
+
align-items: center;
|
|
313
|
+
gap: 0.875rem;
|
|
314
|
+
border-bottom: 1px solid var(--dashboard-border);
|
|
315
|
+
padding: 0.75rem 1.5rem;
|
|
269
316
|
}
|
|
270
317
|
|
|
271
|
-
.coreframe-dashboard__page-
|
|
272
|
-
|
|
318
|
+
.coreframe-dashboard__page-heading {
|
|
319
|
+
min-width: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.coreframe-dashboard__page-heading h1 {
|
|
273
323
|
margin: 0;
|
|
274
|
-
font-size:
|
|
275
|
-
|
|
324
|
+
font-size: 1rem;
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
letter-spacing: -0.02em;
|
|
327
|
+
line-height: 1.5;
|
|
276
328
|
}
|
|
277
329
|
|
|
278
|
-
.coreframe-dashboard__page-
|
|
279
|
-
.
|
|
280
|
-
max-width: 44rem;
|
|
281
|
-
margin: 0.65rem 0 0;
|
|
330
|
+
.coreframe-dashboard__page-heading > p {
|
|
331
|
+
margin: 0.125rem 0 0;
|
|
282
332
|
color: var(--dashboard-muted);
|
|
283
|
-
|
|
333
|
+
font-size: 0.8125rem;
|
|
334
|
+
line-height: 1.5;
|
|
284
335
|
}
|
|
285
336
|
|
|
286
|
-
.coreframe-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
font-size: 0.6875rem;
|
|
290
|
-
font-weight: 700;
|
|
291
|
-
letter-spacing: 0.08em;
|
|
292
|
-
text-transform: uppercase;
|
|
337
|
+
.coreframe-dashboard__content {
|
|
338
|
+
width: min(100%, 80rem);
|
|
339
|
+
padding: 1.5rem clamp(1.25rem, 3vw, 2rem) 3rem;
|
|
293
340
|
}
|
|
294
341
|
|
|
295
342
|
.coreframe-dashboard__pending {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
right: 1rem;
|
|
343
|
+
flex: 0 0 auto;
|
|
344
|
+
margin-left: auto;
|
|
299
345
|
color: var(--dashboard-muted);
|
|
300
|
-
font-size: 0.
|
|
346
|
+
font-size: 0.75rem;
|
|
301
347
|
}
|
|
302
348
|
|
|
303
349
|
.coreframe-dashboard__state {
|
|
304
350
|
display: flex;
|
|
305
|
-
width: min(44rem, calc(
|
|
351
|
+
width: min(44rem, calc(100% - 2.5rem));
|
|
306
352
|
min-height: 70svh;
|
|
307
353
|
flex-direction: column;
|
|
308
354
|
align-items: flex-start;
|
|
@@ -310,6 +356,29 @@
|
|
|
310
356
|
margin: 0 auto;
|
|
311
357
|
}
|
|
312
358
|
|
|
359
|
+
.coreframe-dashboard__state h1 {
|
|
360
|
+
margin: 0;
|
|
361
|
+
font-size: clamp(1.5rem, 4vw, 2rem);
|
|
362
|
+
letter-spacing: -0.025em;
|
|
363
|
+
line-height: 1.2;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.coreframe-dashboard__state > p:last-of-type {
|
|
367
|
+
max-width: 44rem;
|
|
368
|
+
margin: 0.65rem 0 0;
|
|
369
|
+
color: var(--dashboard-muted);
|
|
370
|
+
line-height: 1.6;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.coreframe-dashboard__eyebrow {
|
|
374
|
+
margin: 0 0 0.35rem;
|
|
375
|
+
color: var(--dashboard-muted);
|
|
376
|
+
font-size: 0.6875rem;
|
|
377
|
+
font-weight: 700;
|
|
378
|
+
letter-spacing: 0.08em;
|
|
379
|
+
text-transform: uppercase;
|
|
380
|
+
}
|
|
381
|
+
|
|
313
382
|
.coreframe-dashboard__button {
|
|
314
383
|
margin-top: 1rem;
|
|
315
384
|
border-radius: 0.375rem;
|
|
@@ -321,11 +390,12 @@
|
|
|
321
390
|
}
|
|
322
391
|
|
|
323
392
|
.coreframe-dashboard__toggle:focus-visible,
|
|
393
|
+
.coreframe-dashboard__drawer-close:focus-visible,
|
|
324
394
|
.coreframe-dashboard__backdrop:focus-visible,
|
|
325
395
|
.coreframe-dashboard__navigation:focus-visible,
|
|
326
396
|
.coreframe-dashboard__navigation-link:focus-visible,
|
|
327
397
|
.coreframe-dashboard__button:focus-visible {
|
|
328
|
-
outline:
|
|
398
|
+
outline: 2px solid var(--dashboard-accent);
|
|
329
399
|
outline-offset: 2px;
|
|
330
400
|
}
|
|
331
401
|
|
|
@@ -351,12 +421,6 @@
|
|
|
351
421
|
transform: translateX(0);
|
|
352
422
|
}
|
|
353
423
|
|
|
354
|
-
.coreframe-dashboard__toggle,
|
|
355
|
-
.coreframe-dashboard[data-collapsed="true"] .coreframe-dashboard__toggle {
|
|
356
|
-
top: 1rem;
|
|
357
|
-
left: 1rem;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
424
|
.coreframe-dashboard__backdrop {
|
|
361
425
|
position: fixed;
|
|
362
426
|
z-index: 10;
|
|
@@ -374,8 +438,12 @@
|
|
|
374
438
|
pointer-events: auto;
|
|
375
439
|
}
|
|
376
440
|
|
|
377
|
-
.coreframe-
|
|
378
|
-
padding-
|
|
441
|
+
.coreframe-dashboard__page-header {
|
|
442
|
+
padding-inline: 1rem;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.coreframe-dashboard__content {
|
|
446
|
+
padding: 1.25rem 1rem 2rem;
|
|
379
447
|
}
|
|
380
448
|
}
|
|
381
449
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css as e}from"../styled-system/css/css.js";import"../../styled-css.js";var t={page:e({width:`
|
|
1
|
+
import{css as e}from"../styled-system/css/css.js";import"../../styled-css.js";var t={page:e({width:`100%`,minWidth:`0`}),topbar:e({display:`flex`,alignItems:{base:`flex-start`,md:`center`},justifyContent:`space-between`,flexDirection:{base:`column`,md:`row`},gap:`1.25rem`,padding:`0 0.25rem 1.5rem`}),brand:e({display:`flex`,alignItems:`center`,gap:`0.875rem`}),brandMark:e({display:`grid`,width:`2.625rem`,height:`2.625rem`,placeItems:`center`,borderRadius:`0.75rem`,background:`gray.900`,color:`white`,fontSize:`1rem`,fontWeight:`750`,boxShadow:`0 5px 14px rgb(32 33 38 / 0.16)`}),topbarActions:e({display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:`0.625rem`}),eyebrow:e({margin:`0 0 0.2rem`,color:`gray.600`,fontSize:`0.65rem`,fontWeight:`700`,letterSpacing:`0.1em`,textTransform:`uppercase`}),title:e({margin:`0`,fontSize:`clamp(1.5rem, 4vw, 1.875rem)`,fontWeight:`700`,letterSpacing:`-0.035em`,lineHeight:`1.05`}),button:e({border:`1px solid token(colors.gray.300)`,borderRadius:`0.625rem`,background:`white`,color:`gray.900`,padding:`0.5625rem 0.75rem`,fontWeight:`600`,boxShadow:`0 1px 2px rgb(32 33 38 / 0.05)`,transition:`border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease`,"&:hover":{borderColor:`gray.500`,boxShadow:`0 3px 8px rgb(32 33 38 / 0.08)`,transform:`translateY(-1px)`},"&:focus-visible":{outline:`3px solid rgb(91 91 214 / 0.22)`,outlineOffset:`2px`},"&:disabled":{opacity:`0.55`}}),primaryButton:e({border:`1px solid token(colors.indigo.600)`,borderRadius:`0.625rem`,background:`indigo.600`,color:`white`,padding:`0.5625rem 0.75rem`,fontWeight:`600`,boxShadow:`0 4px 10px rgb(91 91 214 / 0.2)`,transition:`filter 150ms ease, transform 150ms ease`,"&:hover:not(:disabled)":{filter:`brightness(0.94)`,transform:`translateY(-1px)`},"&:focus-visible":{outline:`3px solid rgb(91 91 214 / 0.22)`,outlineOffset:`2px`},"&:disabled":{borderColor:`gray.300`,background:`gray.100`,color:`gray.500`,boxShadow:`none`,opacity:`1`}}),smallButton:e({border:`1px solid token(colors.gray.300)`,borderRadius:`0.5rem`,background:`white`,color:`gray.900`,padding:`0.4rem 0.625rem`,fontSize:`0.75rem`,fontWeight:`600`,transition:`border-color 150ms ease, background 150ms ease`,"&:hover":{borderColor:`indigo.600`,background:`gray.100`}}),status:e({display:`inline-flex`,alignItems:`center`,borderRadius:`999px`,gap:`0.4rem`,padding:`0.5rem 0.7rem`,fontSize:`0.75rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`,"&::before":{width:`0.4rem`,height:`0.4rem`,borderRadius:`50%`,background:`currentColor`,content:`''`}}),success:e({background:`green.50`,color:`green.700`}),warning:e({background:`yellow.50`,color:`yellow.700`}),danger:e({background:`red.50`,color:`red.700`}),neutral:e({background:`gray.100`,color:`gray.600`}),summary:e({position:`relative`,display:`grid`,gridTemplateColumns:{base:`1fr`,md:`minmax(0, 1.05fr) minmax(21rem, 0.95fr)`},alignItems:`center`,gap:{base:`1.5rem`,md:`2.5rem`},overflow:`hidden`,border:`1px solid token(colors.gray.200)`,borderRadius:`1rem`,background:`linear-gradient(135deg, #ffffff 20%, #f8f7ff 100%)`,padding:{base:`1.25rem`,md:`1.75rem 2rem`},boxShadow:`0 12px 35px rgb(32 33 38 / 0.055)`,"&::after":{position:`absolute`,top:`-5rem`,right:`-3rem`,width:`11rem`,height:`11rem`,borderRadius:`50%`,background:`rgb(91 91 214 / 0.06)`,content:`''`,pointerEvents:`none`}}),summaryTitle:e({margin:`0`,fontSize:`clamp(1.4rem, 3vw, 1.8rem)`,fontWeight:`680`,letterSpacing:`-0.025em`,lineHeight:`1.2`}),muted:e({maxWidth:`47.5rem`,margin:`0.5rem 0 0`,color:`gray.600`,fontSize:`0.875rem`,lineHeight:`1.55`}),summaryFacts:e({position:`relative`,zIndex:`1`,display:`grid`,gridTemplateColumns:{base:`1fr`,sm:`repeat(3, minmax(0, 1fr))`},gap:`0.625rem`,margin:`0`}),summaryFact:e({minWidth:`0`,border:`1px solid rgb(229 228 223 / 0.9)`,borderRadius:`0.75rem`,background:`rgb(255 255 255 / 0.8)`,padding:`0.875rem`,boxShadow:`0 2px 10px rgb(32 33 38 / 0.035)`,"& dt":{color:`gray.500`,fontSize:`0.625rem`,fontWeight:`700`,letterSpacing:`0.035em`,textTransform:`uppercase`},"& dd":{margin:`0.35rem 0 0`,fontSize:`0.925rem`,fontWeight:`650`,lineHeight:`1.3`}}),grid:e({display:`grid`,gridTemplateColumns:{base:`1fr`,md:`repeat(2, minmax(0, 1fr))`},gap:`1rem`,paddingTop:`1rem`}),section:e({minWidth:`0`,gridColumn:{base:`auto`,md:`1 / -1`},border:`1px solid token(colors.gray.200)`,borderRadius:`1rem`,background:`white`,padding:{base:`1.125rem`,md:`1.375rem 1.5rem`},boxShadow:`0 5px 18px rgb(32 33 38 / 0.035)`}),sectionHeader:e({marginBottom:`1rem`,"& h2":{margin:`0`,fontSize:`1.05rem`,fontWeight:`680`,letterSpacing:`-0.015em`},"& p":{margin:`0.3rem 0 0`,color:`gray.600`,fontSize:`0.8125rem`,lineHeight:`1.45`}}),environmentNotice:e({margin:`0.75rem 0`,borderRadius:`0.625rem`,background:`yellow.50`,color:`yellow.700`,padding:`0.625rem 0.75rem`,fontSize:`0.75rem`,lineHeight:`1.45`}),environmentTableFrame:e({overflowX:`auto`}),environmentTable:e({width:`100%`,borderCollapse:`collapse`,textAlign:`left`,"& th, & td":{borderTop:`1px solid token(colors.gray.200)`,padding:`0.75rem`,verticalAlign:`top`,fontSize:`0.75rem`},"& thead th":{borderTop:`0`,color:`gray.500`,fontSize:`0.65rem`,fontWeight:`700`,letterSpacing:`0.04em`,textTransform:`uppercase`},"& tbody th":{minWidth:`16rem`,fontWeight:`600`},"& code":{fontSize:`0.75rem`},"& tbody th span":{display:`block`,maxWidth:`28rem`,marginTop:`0.25rem`,color:`gray.600`,fontWeight:`400`,lineHeight:`1.4`}}),environmentState:e({display:`inline-flex`,borderRadius:`999px`,background:`gray.100`,color:`gray.600`,padding:`0.3125rem 0.5rem`,fontSize:`0.6875rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`}),environmentStateOk:e({background:`green.50`,color:`green.700`}),environmentStateMissing:e({background:`red.50`,color:`red.700`}),environmentStatePending:e({background:`yellow.50`,color:`yellow.800`}),list:e({listStyle:`none`,margin:`0`,padding:`0`}),empty:e({borderTop:`1px solid token(colors.gray.200)`,paddingTop:`0.875rem`,"& strong":{fontSize:`0.8125rem`},"& p":{margin:`0.25rem 0 0`,color:`gray.600`,fontSize:`0.8125rem`}}),error:e({margin:`0.75rem 0 0`,color:`red.700`,fontSize:`0.8125rem`}),findingRow:e({borderTop:`1px solid token(colors.gray.200)`,padding:`1.125rem 0`,"&:first-child":{borderTop:`0`,paddingTop:`0.125rem`},"&:last-child":{paddingBottom:`0.125rem`}}),findingTitle:e({display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`0.5rem`,"& h3":{margin:`0`,fontSize:`0.9rem`,fontWeight:`650`}}),findingArea:e({color:`gray.500`,fontSize:`0.6875rem`,fontWeight:`700`,letterSpacing:`0.04em`,textTransform:`uppercase`,whiteSpace:`nowrap`}),findingStatus:e({display:`inline-flex`,marginLeft:`auto`,borderRadius:`999px`,padding:`0.3125rem 0.5rem`,fontSize:`0.75rem`,fontWeight:`650`,lineHeight:`1`,whiteSpace:`nowrap`}),dot:e({width:`0.4375rem`,height:`0.4375rem`,flex:`0 0 auto`,borderRadius:`50%`}),successDot:e({background:`green.700`}),warningDot:e({background:`yellow.700`}),dangerDot:e({background:`red.700`}),evidence:e({display:`flex`,flexWrap:`wrap`,gap:`0.375rem 1.125rem`,margin:`0.625rem 0 0 0.9375rem`,"& > div":{display:`flex`,alignItems:`baseline`,gap:`0.3125rem`},"& dt":{color:`gray.500`,fontSize:`0.6875rem`,fontWeight:`700`,textTransform:`uppercase`},"& dd":{margin:`0`,fontSize:`0.75rem`,fontWeight:`600`}}),actions:e({display:`grid`,gap:`0.5rem`,margin:`0.75rem 0 0 0.9375rem`,"& a":{width:`fit-content`,color:`indigo.600`,fontSize:`0.8125rem`,fontWeight:`600`}}),action:e({display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:`0.5rem`,"& > span:first-child":{fontSize:`0.8125rem`,fontWeight:`600`}}),linkRow:e({borderTop:`1px solid token(colors.gray.200)`,"&:first-child":{borderTop:`0`},"& a":{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:`1rem`,padding:`0.6875rem 0`,color:`indigo.600`,fontWeight:`600`,textDecoration:`none`,"&:hover":{textDecoration:`underline`}}})};export{t as default};
|
|
@@ -2,7 +2,7 @@ import { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactElemen
|
|
|
2
2
|
|
|
3
3
|
//#region src/web/ui/index.d.ts
|
|
4
4
|
interface PageProps extends HTMLAttributes<HTMLDivElement> {}
|
|
5
|
-
/** Content layout for a dashboard route. The
|
|
5
|
+
/** Content layout for a dashboard route. The shell owns the heading and content insets. */
|
|
6
6
|
declare function Page({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
@@ -2,10 +2,15 @@ import { DashboardPageManifestEntry } from "../config.js";
|
|
|
2
2
|
|
|
3
3
|
//#region src/web-shell/shell.d.ts
|
|
4
4
|
interface DashboardShellProps {
|
|
5
|
+
application?: {
|
|
6
|
+
name: string;
|
|
7
|
+
favicon: string;
|
|
8
|
+
};
|
|
5
9
|
pages: readonly DashboardPageManifestEntry[];
|
|
6
10
|
}
|
|
7
11
|
declare function DashboardShell({
|
|
8
|
-
pages
|
|
12
|
+
pages,
|
|
13
|
+
application
|
|
9
14
|
}: DashboardShellProps): import("react").JSX.Element;
|
|
10
15
|
declare function DashboardIndexRedirect({
|
|
11
16
|
pages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as
|
|
1
|
+
import{icons as e}from"@iconify-json/codicon";import{useEffect as t,useRef as n,useState as r}from"react";import{Link as i,NavLink as a,Navigate as o,Outlet as s,isRouteErrorResponse as c,useLocation as l,useNavigation as u,useRouteError as d}from"react-router";import{jsx as f,jsxs as p}from"react/jsx-runtime";function m({pages:i,application:o}){let c=l(),d=u(),[m,h]=r(()=>globalThis.window!==void 0&&globalThis.matchMedia(`(max-width: 47.999rem)`).matches),[g,_]=r(!1),[y,b]=r(!1),x=n(null),S=n(null),C=n(!1),w=v(i,c.pathname);t(()=>{let e=globalThis.matchMedia(`(max-width: 47.999rem)`),t=()=>h(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),t(()=>{m&&(g?S.current?.focus():C.current&&x.current?.focus(),C.current=g)},[m,g]),t(()=>{if(!g)return;let e=e=>{e.key===`Escape`&&_(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[g]);let T=m?g:!y;return p(`div`,{className:`coreframe-dashboard`,"data-collapsed":!m&&y?`true`:`false`,"data-drawer-open":m&&g?`true`:`false`,children:[f(`button`,{type:`button`,className:`coreframe-dashboard__backdrop`,"aria-label":`Close dashboard navigation`,tabIndex:m&&g?0:-1,onClick:()=>_(!1)}),f(`aside`,{className:`coreframe-dashboard__sidebar`,role:m?`dialog`:void 0,"aria-label":m?`Dashboard navigation`:void 0,"aria-modal":m&&g?!0:void 0,"aria-hidden":m&&!g?!0:void 0,inert:m&&!g?!0:void 0,children:p(`nav`,{ref:S,id:`coreframe-dashboard-navigation`,className:`coreframe-dashboard__navigation`,"aria-label":`Dashboard`,tabIndex:m?-1:void 0,children:[p(`div`,{className:`coreframe-dashboard__sidebar-header`,children:[p(`div`,{className:`coreframe-dashboard__brand`,"aria-label":o?.name,children:[o?f(`img`,{src:o.favicon,alt:``,className:`coreframe-dashboard__mark`}):null,f(`span`,{className:`coreframe-dashboard__navigation-text`,children:o?.name})]}),m?f(`button`,{type:`button`,className:`coreframe-dashboard__drawer-close`,"aria-label":`Close dashboard navigation`,onClick:()=>_(!1),children:f(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,"aria-hidden":`true`,children:f(`path`,{d:`m6 6 12 12M6 18 18 6`})})}):null]}),i.length>0?f(`ul`,{className:`coreframe-dashboard__navigation-list`,children:i.map(t=>f(`li`,{children:p(a,{className:`coreframe-dashboard__navigation-link`,to:`/${t.path}`,title:t.title,onClick:()=>_(!1),children:[f(`svg`,{"aria-hidden":`true`,className:`coreframe-dashboard__navigation-icon`,width:`20`,height:`20`,viewBox:`0 0 ${e.width} ${e.height}`,fill:`currentColor`,dangerouslySetInnerHTML:{__html:e.icons[t.icon].body}}),f(`span`,{className:`coreframe-dashboard__navigation-text`,children:t.title})]})},t.id))}):f(`p`,{className:`coreframe-dashboard__navigation-empty`,children:`No pages`})]})}),p(`main`,{className:`coreframe-dashboard__main`,inert:m&&g?!0:void 0,children:[p(`header`,{className:`coreframe-dashboard__page-header`,children:[f(`button`,{ref:x,type:`button`,className:`coreframe-dashboard__toggle`,"aria-controls":`coreframe-dashboard-navigation`,"aria-expanded":T,"aria-label":T?`Collapse dashboard navigation`:`Expand dashboard navigation`,title:T?`Collapse dashboard navigation`:`Expand dashboard navigation`,onClick:()=>{m?_(e=>!e):b(e=>!e)},children:p(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[f(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`3`}),f(`path`,{d:`M9 3v18`}),f(`path`,{d:T?`m16 9-3 3 3 3`:`m13 9 3 3-3 3`})]})}),w?p(`div`,{className:`coreframe-dashboard__page-heading`,children:[f(`h1`,{children:w.title}),w.description?f(`p`,{children:w.description}):null]}):null,d.state===`idle`?null:f(`div`,{className:`coreframe-dashboard__pending`,role:`status`,children:`Loading page…`})]}),f(`div`,{className:`coreframe-dashboard__content`,children:f(s,{})})]})]})}function h({pages:e}){let t=e[0];return t?f(o,{replace:!0,to:`/${t.path}`}):f(g,{})}function g(){return p(`section`,{className:`coreframe-dashboard__state`,"aria-labelledby":`dashboard-empty-title`,children:[f(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Dashboard`}),f(`h1`,{id:`dashboard-empty-title`,children:`No dashboard pages yet`}),p(`p`,{children:[`Add a page under `,f(`code`,{children:`dashboard/pages/`}),` or register a plugin in`,` `,f(`code`,{children:`dashboard.config.ts`}),`.`]})]})}function _(){let e=d(),t=c(e)&&e.status===404,n=import.meta.env.DEV&&e instanceof Error?e.message:t?`The requested dashboard page does not exist.`:`The dashboard hit an unexpected error.`;return p(`main`,{className:`coreframe-dashboard__state`,children:[f(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),f(`h1`,{children:t?`Page not found`:`Dashboard unavailable`}),f(`p`,{children:n}),f(i,{className:`coreframe-dashboard__button`,to:`/`,children:`Go to dashboard`})]})}function v(e,t){let n=t.split(`/`).filter(Boolean)[0];return e.find(e=>e.path===n)??(n?void 0:e[0])}export{g as DashboardEmptyState,_ as DashboardErrorBoundary,h as DashboardIndexRedirect,m as DashboardShell};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreframe/dashboard",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.27",
|
|
4
4
|
"description": "Reusable dashboard composition, shell, plugin, and authenticated runtime for Coreframe apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@fontsource-variable/inter": "^5.2.8",
|
|
83
|
+
"@iconify-json/codicon": "^1.2.77",
|
|
83
84
|
"@tanstack/react-query": "^5.101.2",
|
|
84
85
|
"react": "19.2.8",
|
|
85
86
|
"react-dom": "19.2.8",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"typescript": "6.0.3",
|
|
105
106
|
"vite": "^8.1.4",
|
|
106
107
|
"vitest": "^4.1.10",
|
|
107
|
-
"@coreframe/panda": "0.1.
|
|
108
|
+
"@coreframe/panda": "0.1.11"
|
|
108
109
|
},
|
|
109
110
|
"scripts": {
|
|
110
111
|
"build": "pnpm --dir ../diagnostics build && pnpm build:server",
|