@coreframe/dashboard 0.3.28 → 0.3.30
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 +98 -8
- package/dist/package/app-client.d.ts +4 -3
- package/dist/package/app-client.js +1 -1
- package/dist/package/build.js +2 -2
- package/dist/package/config.d.ts +6 -1
- package/dist/package/shell.css +1611 -204
- 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/index.d.ts +2 -1
- package/dist/package/web-shell/index.js +1 -1
- package/dist/package/web-shell/menu.d.ts +19 -0
- package/dist/package/web-shell/menu.js +1 -0
- package/dist/package/web-shell/shell.d.ts +2 -8
- package/dist/package/web-shell/shell.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{css as e}from"../styled-system/css/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};
|
|
1
|
+
import{css as e}from"../styled-system/css/css.js";var t={page:e({width:`100%`,maxWidth:`80rem`,minWidth:`0`,margin:`0 auto`,padding:`5rem clamp(1rem, 3vw, 2rem) 2rem`}),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
|
-
/**
|
|
5
|
+
/** Optional content layout for a dashboard route. Pages own their headings and content insets. */
|
|
6
6
|
declare function Page({
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { DashboardMenu, DashboardMenuProps } from "./menu.js";
|
|
1
2
|
import { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, DashboardShellProps } from "./shell.js";
|
|
2
|
-
export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardShell, type DashboardShellProps };
|
|
3
|
+
export { DashboardEmptyState, DashboardErrorBoundary, DashboardIndexRedirect, DashboardMenu, type DashboardMenuProps, DashboardShell, type DashboardShellProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DashboardEmptyState as
|
|
1
|
+
import{DashboardMenu as e}from"./menu.js";import{DashboardEmptyState as t,DashboardErrorBoundary as n,DashboardIndexRedirect as r,DashboardShell as i}from"./shell.js";export{t as DashboardEmptyState,n as DashboardErrorBoundary,r as DashboardIndexRedirect,e as DashboardMenu,i as DashboardShell};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardPageManifestEntry } from "../config.js";
|
|
2
|
+
|
|
3
|
+
//#region src/web-shell/menu.d.ts
|
|
4
|
+
interface DashboardNavigation {
|
|
5
|
+
application?: {
|
|
6
|
+
name: string;
|
|
7
|
+
favicon: string;
|
|
8
|
+
};
|
|
9
|
+
pages: readonly DashboardPageManifestEntry[];
|
|
10
|
+
}
|
|
11
|
+
interface DashboardMenuProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Logo and navigation popover. Place inside a dashboard page to own its position. */
|
|
15
|
+
declare function DashboardMenu({
|
|
16
|
+
className
|
|
17
|
+
}: DashboardMenuProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DashboardMenu, DashboardMenuProps, DashboardNavigation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{icons as e}from"@iconify-json/codicon";import{NavLink as t,useLocation as n}from"react-router";import{createContext as r,useContext as i,useEffect as a,useId as o,useRef as s,useState as c}from"react";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=r(void 0);function f({className:e}){let t=i(d),r=n();if(!t)throw Error(`DashboardMenu must be rendered inside a dashboard page.`);return l(p,{navigation:t,className:e},r.key)}function p({navigation:n,className:r}){let i=o(),d=s(null),f=s(null),p=s(null),m=s(void 0),[h,g]=c(!1);a(()=>{if(!h)return;if(m.current){let e=p.current?.querySelectorAll(`a`);(m.current===`first`?e?.[0]:e?.[e.length-1])?.focus(),m.current=void 0}function e(e){e.target instanceof Node&&!d.current?.contains(e.target)&&g(!1)}function t(e){e.key===`Escape`&&(g(!1),d.current?.contains(document.activeElement)&&f.current?.focus())}return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[h]);let{application:_,pages:v}=n;return u(`div`,{ref:d,className:[`coreframe-dashboard__menu`,r].filter(Boolean).join(` `),onPointerEnter:e=>{e.pointerType!==`touch`&&g(!0)},onPointerLeave:()=>{d.current?.contains(document.activeElement)||g(!1)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||g(!1)},children:[l(`button`,{ref:f,type:`button`,className:`coreframe-dashboard__logo`,"aria-label":`Dashboard navigation`,"aria-controls":i,"aria-expanded":h,onClick:()=>g(e=>!e),onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=e.key===`ArrowDown`?`first`:`last`;if(h){let e=p.current?.querySelectorAll(`a`);(t===`first`?e?.[0]:e?.[e.length-1])?.focus()}else m.current=t,g(!0)},children:_?l(`img`,{src:_.favicon,alt:``,className:`coreframe-dashboard__mark`}):l(`span`,{"aria-hidden":`true`,children:`C`})}),h?l(`div`,{className:`coreframe-dashboard__popover`,children:u(`nav`,{ref:p,id:i,className:`coreframe-dashboard__navigation`,"aria-label":`Dashboard`,children:[_?l(`p`,{className:`coreframe-dashboard__application`,children:_.name}):null,v.length>0?l(`ul`,{className:`coreframe-dashboard__navigation-list`,children:v.map(n=>l(`li`,{children:u(t,{className:`coreframe-dashboard__navigation-link`,to:`/${n.path}`,onClick:()=>{g(!1),f.current?.focus()},children:[l(`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[n.icon].body}}),l(`span`,{className:`coreframe-dashboard__navigation-text`,children:n.title})]})},n.id))}):l(`p`,{className:`coreframe-dashboard__navigation-empty`,children:`No pages`})]})}):null]})}export{f as DashboardMenu,d as DashboardNavigationContext};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DashboardNavigation } from "./menu.js";
|
|
2
2
|
|
|
3
3
|
//#region src/web-shell/shell.d.ts
|
|
4
|
-
interface DashboardShellProps {
|
|
5
|
-
application?: {
|
|
6
|
-
name: string;
|
|
7
|
-
favicon: string;
|
|
8
|
-
};
|
|
9
|
-
pages: readonly DashboardPageManifestEntry[];
|
|
10
|
-
}
|
|
4
|
+
interface DashboardShellProps extends DashboardNavigation {}
|
|
11
5
|
declare function DashboardShell({
|
|
12
6
|
pages,
|
|
13
7
|
application
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DashboardMenu as e,DashboardNavigationContext as t}from"./menu.js";import{Link as n,Navigate as r,Outlet as i,isRouteErrorResponse as a,useLocation as o,useRouteError as s}from"react-router";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({pages:n,application:r}){let a=o().pathname.split(`/`).filter(Boolean)[0],s=n.find(e=>e.path===a)??(a?void 0:n[0]);return l(t,{value:{pages:n,application:r},children:[s?.layout===`standalone`?null:c(e,{className:`coreframe-dashboard__floating-navigation`}),c(i,{})]})}function d({pages:e}){let t=e[0];return t?c(r,{replace:!0,to:`/${t.path}`}):c(f,{})}function f(){return l(`section`,{className:`coreframe-dashboard__state`,"aria-labelledby":`dashboard-empty-title`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Dashboard`}),c(`h1`,{id:`dashboard-empty-title`,children:`No dashboard pages yet`}),l(`p`,{children:[`Add a page under `,c(`code`,{children:`dashboard/pages/`}),` or register a plugin in`,` `,c(`code`,{children:`dashboard.config.ts`}),`.`]})]})}function p(){let e=s(),t=a(e)&&e.status===404,r=import.meta.env.DEV&&e instanceof Error?e.message:t?`The requested dashboard page does not exist.`:`The dashboard hit an unexpected error.`;return l(`main`,{className:`coreframe-dashboard__state`,children:[c(`p`,{className:`coreframe-dashboard__eyebrow`,children:`Coreframe Dashboard`}),c(`h1`,{children:t?`Page not found`:`Dashboard unavailable`}),c(`p`,{children:r}),c(n,{className:`coreframe-dashboard__button`,to:`/`,children:`Go to dashboard`})]})}export{f as DashboardEmptyState,p as DashboardErrorBoundary,d as DashboardIndexRedirect,u 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.30",
|
|
4
4
|
"description": "Reusable dashboard composition, shell, plugin, and authenticated runtime for Coreframe apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"scripts": {
|
|
111
111
|
"build": "pnpm --dir ../diagnostics build && pnpm build:server",
|
|
112
112
|
"codegen": "panda codegen",
|
|
113
|
-
"build:server": "tsdown && node scripts/copy-package-assets.mjs",
|
|
113
|
+
"build:server": "panda cssgen --outfile .coreframe/dashboard.css && tsdown && node scripts/copy-package-assets.mjs",
|
|
114
114
|
"test": "vitest run --reporter=minimal",
|
|
115
115
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
116
116
|
"format": "oxlint --fix && oxfmt",
|