sage-nexus-ui 1.4.5 → 1.5.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{GlassPaper as i}from"./GlassPaper.mjs";import{Box as n}from"./Box.mjs";import{H3 as l,Body2 as s}from"./Typography.mjs";import{LoadingSpinnerNexus as t}from"./LoadingSpinnerNexus.mjs";const o=({title:o,description:c,actions:d,isLoading:m,isError:x,errorMessage:h,children:a,...p})=>{if(m)return r(i,{...p,children:[r(n,{sx:{mb:2},children:[e(l,{children:o}),c&&e(s,{sx:{mt:.5},children:c})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(t,{})})]});if(x)return r(i,{...p,children:[r(n,{sx:{mb:2},children:[e(l,{children:o}),c&&e(s,{sx:{mt:.5},children:c})]}),e(n,{sx:{display:"flex",flexDirection:"column",mt:1},children:e(s,{color:"error",sx:{p:2},children:h??`Failed to load ${o}.`})})]});const f=o||c||d;return r(i,{...p,children:[f&&r(n,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1,mb:2.5},children:[r(n,{children:[e(l,{children:o}),c&&e(s,{sx:{mt:.5},children:c})]}),d&&e(n,{sx:{flexShrink:0},children:d})]}),a]})};export{o as GlassPaperAsync};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o="1.
|
|
1
|
+
const o="1.5.2";export{o as SAGE_NEXUS_UI_VERSION};
|
package/dist/index.d.ts
CHANGED
|
@@ -230,12 +230,16 @@ declare const Divider: ({ children, ...rest }: DividerProps) => react_jsx_runtim
|
|
|
230
230
|
|
|
231
231
|
type GlassPaperAsyncProps = Omit<GlassPaperProps, "children"> & {
|
|
232
232
|
title: string;
|
|
233
|
+
/** Optional supporting description rendered below the title. */
|
|
234
|
+
description?: ReactNode;
|
|
235
|
+
/** Optional actions (e.g. chip toggles, buttons) rendered in the top-right of the header. Hidden while loading or in error state. */
|
|
236
|
+
actions?: ReactNode;
|
|
233
237
|
isLoading: boolean;
|
|
234
238
|
isError: boolean;
|
|
235
239
|
errorMessage?: string;
|
|
236
240
|
children?: ReactNode;
|
|
237
241
|
};
|
|
238
|
-
declare const GlassPaperAsync: ({ title, isLoading, isError, errorMessage, children, ...rest }: GlassPaperAsyncProps) => react_jsx_runtime.JSX.Element;
|
|
242
|
+
declare const GlassPaperAsync: ({ title, description, actions, isLoading, isError, errorMessage, children, ...rest }: GlassPaperAsyncProps) => react_jsx_runtime.JSX.Element;
|
|
239
243
|
|
|
240
244
|
type GreenWaveBackgroundProps = BoxProps;
|
|
241
245
|
declare const GreenWaveBackground: ({ sx, children, ...rest }: GreenWaveBackgroundProps) => react_jsx_runtime.JSX.Element;
|
package/dist/theme/sageTheme.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createTheme as r,alpha as e}from"@mui/material/styles";import{getModeTokens as o,fontSageUI as t,colours as i,fontSageText as a,fontSageHeadline as n}from"./tokens.mjs";const d=(d="light")=>{const l=o(d),s=(r=>({h1:r.text.primary,h2:r.text.primary,h3:r.text.primary,h4:r.text.primary,body1:r.text.primary,body2:r.text.secondary,caption:r.text.secondary,actionBarTitle:i.brilliantGreen}))(l);return r({palette:{mode:d,primary:{main:i.brilliantGreen,dark:i.primaryGreenActive,contrastText:i.black},secondary:{main:i.teal,contrastText:i.white},success:{main:i.jade,contrastText:i.white},warning:{main:i.amber,contrastText:i.white},error:{main:i.cherry,contrastText:i.white},info:{main:i.navy,contrastText:i.white},background:{default:l.background.default,paper:l.background.paper},text:l.text,divider:l.border},shape:{borderRadius:8},typography:{fontFamily:a,h1:{fontFamily:n,fontSize:"clamp(2rem, 3vw, 2.75rem)",lineHeight:1.08,letterSpacing:"-0.01em",fontWeight:700},h2:{fontFamily:n,fontSize:"1.5rem",lineHeight:1.2,fontWeight:600},h3:{fontSize:"0.9rem",lineHeight:1.25,fontWeight:700},h4:{fontSize:"0.8rem",lineHeight:1.2,fontWeight:500},actionBarTitle:{fontFamily:n,fontSize:"1.6rem",color:i.brilliantGreen,fontWeight:700,lineHeight:1.2,textTransform:"none"},body1:{fontSize:"0.8rem",lineHeight:1.4},body2:{fontSize:"0.8rem",lineHeight:1.4},caption:{fontSize:"0.7rem",lineHeight:1.4},button:{fontFamily:t,fontSize:"0.95rem",fontWeight:600,textTransform:"none"}},shadows:["none","0 1px 2px rgba(0,0,0,0.08)","0 4px 12px rgba(0,0,0,0.10)","0 8px 24px rgba(0,0,0,0.12)","0 16px 48px rgba(0,0,0,0.18)",...Array(20).fill("none")],components:{MuiCssBaseline:{styleOverrides:{html:{backgroundColor:l.background.default},body:{backgroundColor:l.background.default,fontFamily:a,color:l.text.primary,transition:"background-color 200ms ease, color 200ms ease"},"#root":{minHeight:"100vh"},"::selection":{backgroundColor:e(i.brilliantGreen,.28),color:l.text.primary},a:{color:l.text.greens,"&:hover":{color:l.text.secondary}},aside:{marginRight:"10px",borderLeft:"2px solid",borderColor:l.text.secondary,padding:"0 8px"}}},MuiTypography:{styleOverrides:{root:({ownerState:r})=>({color:s[r.variant]??"inherit"})}},MuiPaper:{defaultProps:{elevation:1},styleOverrides:{root:({theme:r})=>({backgroundImage:"none",border:`1px solid ${l.border}`,borderRadius:r.shape.borderRadius,padding:r.spacing(1)})}},MuiCard:{styleOverrides:{root:({theme:r})=>({borderRadius:r.shape.borderRadius,boxShadow:l.shadow,border:`1px solid ${l.border}
|
|
1
|
+
import{createTheme as r,alpha as e}from"@mui/material/styles";import{getModeTokens as o,fontSageUI as t,colours as i,fontSageText as a,fontSageHeadline as n}from"./tokens.mjs";const d=(d="light")=>{const l=o(d),s=(r=>({h1:r.text.primary,h2:r.text.primary,h3:r.text.primary,h4:r.text.primary,body1:r.text.primary,body2:r.text.secondary,caption:r.text.secondary,actionBarTitle:i.brilliantGreen}))(l);return r({palette:{mode:d,primary:{main:i.brilliantGreen,dark:i.primaryGreenActive,contrastText:i.black},secondary:{main:i.teal,contrastText:i.white},success:{main:i.jade,contrastText:i.white},warning:{main:i.amber,contrastText:i.white},error:{main:i.cherry,contrastText:i.white},info:{main:i.navy,contrastText:i.white},background:{default:l.background.default,paper:l.background.paper},text:l.text,divider:l.border},shape:{borderRadius:8},typography:{fontFamily:a,h1:{fontFamily:n,fontSize:"clamp(2rem, 3vw, 2.75rem)",lineHeight:1.08,letterSpacing:"-0.01em",fontWeight:700},h2:{fontFamily:n,fontSize:"1.5rem",lineHeight:1.2,fontWeight:600},h3:{fontSize:"0.9rem",lineHeight:1.25,fontWeight:700},h4:{fontSize:"0.8rem",lineHeight:1.2,fontWeight:500},actionBarTitle:{fontFamily:n,fontSize:"1.6rem",color:i.brilliantGreen,fontWeight:700,lineHeight:1.2,textTransform:"none"},body1:{fontSize:"0.8rem",lineHeight:1.4},body2:{fontSize:"0.8rem",lineHeight:1.4},caption:{fontSize:"0.7rem",lineHeight:1.4},button:{fontFamily:t,fontSize:"0.95rem",fontWeight:600,textTransform:"none"}},shadows:["none","0 1px 2px rgba(0,0,0,0.08)","0 4px 12px rgba(0,0,0,0.10)","0 8px 24px rgba(0,0,0,0.12)","0 16px 48px rgba(0,0,0,0.18)",...Array(20).fill("none")],components:{MuiCssBaseline:{styleOverrides:{html:{backgroundColor:l.background.default},body:{backgroundColor:l.background.default,fontFamily:a,color:l.text.primary,transition:"background-color 200ms ease, color 200ms ease"},"#root":{minHeight:"100vh"},"::selection":{backgroundColor:e(i.brilliantGreen,.28),color:l.text.primary},a:{color:l.text.greens,"&:hover":{color:l.text.secondary}},aside:{marginRight:"10px",borderLeft:"2px solid",borderColor:l.text.secondary,padding:"0 8px"}}},MuiTypography:{styleOverrides:{root:({ownerState:r})=>({color:s[r.variant]??"inherit"})}},MuiPaper:{defaultProps:{elevation:1},styleOverrides:{root:({theme:r})=>({backgroundImage:"none",border:`1px solid ${l.border}`,borderRadius:r.shape.borderRadius,padding:r.spacing(1)})}},MuiCard:{styleOverrides:{root:({theme:r})=>({borderRadius:r.shape.borderRadius,boxShadow:l.shadow,border:`1px solid ${l.border}`,position:"relative",zIndex:1})}},MuiButton:{defaultProps:{disableElevation:!0}},MuiChip:{styleOverrides:{root:{borderRadius:999,fontFamily:t}}},MuiDivider:{styleOverrides:{root:{borderColor:l.border}}},MuiDataGrid:{styleOverrides:{root:({theme:r})=>({borderRadius:r.shape.borderRadius,border:`1px solid ${l.border}`,backgroundColor:l.background.paper,color:l.text.primary,"--DataGrid-rowBorderColor":l.border,"--DataGrid-containerBackground":l.background.paper,"--DataGrid-pinnedBackground":l.background.paper,"& .MuiDataGrid-toolbarContainer":{padding:"12px 16px 0",gap:8},"& .MuiDataGrid-toolbarContainer .MuiButton-root":{minHeight:36,paddingInline:12,color:l.text.secondary},"& .MuiDataGrid-toolbarContainer .MuiInputBase-root":{borderRadius:999,backgroundColor:e(i.brilliantGreen,"dark"===d?.08:.05)},"& .MuiDataGrid-toolbarContainer .MuiInputBase-input":{paddingBlock:8},"& .MuiDataGrid-overlay":{backgroundColor:"transparent"}}),columnHeaders:{backgroundColor:e(i.brilliantGreen,"dark"===d?.12:.08),borderBottom:`1px solid ${l.border}`},columnHeader:{"&:focus, &:focus-within":{outline:"none"}},columnHeaderTitle:{fontWeight:600},cell:{alignItems:"center",borderTop:`1px solid ${l.border}`,"&:focus, &:focus-within":{outline:"none"}},row:{"&:hover":{backgroundColor:e(i.brilliantGreen,"dark"===d?.08:.04)}},footerContainer:{borderTop:`1px solid ${l.border}`,backgroundColor:e(i.brilliantGreen,"dark"===d?.05:.03)},sortIcon:{color:i.brilliantGreen},menuIconButton:{color:l.text.secondary},withBorderColor:{borderColor:l.border}}},MuiListItemButton:{styleOverrides:{root:({theme:r})=>({borderRadius:r.shape.borderRadius,border:`1px solid ${l.border}`,backgroundColor:l.background.paper,color:l.text.primary})}},MuiAppBar:{defaultProps:{elevation:1},styleOverrides:{root:{backgroundColor:l.background.paper,backgroundImage:"none",borderBottom:`1px solid ${l.border}`,borderRadius:0,color:l.text.primary}}},MuiAccordion:{defaultProps:{disableGutters:!0,elevation:0},styleOverrides:{root:{backgroundColor:"transparent",border:`1px solid ${l.border}`,borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{borderColor:e(i.brilliantGreen,"dark"===d?.4:.3)}}}},MuiAccordionSummary:{styleOverrides:{root:({theme:r})=>({borderRadius:r.shape.borderRadius,minHeight:24,"&.Mui-expanded":{minHeight:24},"&:focus-visible":{outline:`2px solid ${l.outlinedPrimary}`,outlineOffset:2},padding:0}),content:{margin:"0","&.Mui-expanded":{margin:"0"}},expandIconWrapper:{color:l.text.secondary}}},MuiAccordionDetails:{styleOverrides:{root:{padding:0,borderTop:`1px solid ${l.border}`}}},MuiTabs:{styleOverrides:{root:{minHeight:40,borderBottom:`1px solid ${l.border}`},indicator:{backgroundColor:i.brilliantGreen,height:2}}},MuiTab:{styleOverrides:{root:{minHeight:40,fontFamily:t,fontWeight:600,fontSize:"0.85rem",letterSpacing:"0.01em",textTransform:"none",color:l.text.secondary,"&.Mui-selected":{color:l.text.primary},"&:focus-visible":{outline:`2px solid ${l.outlinedPrimary}`,outlineOffset:2}}}},MuiDialog:{styleOverrides:{paper:({theme:r})=>({backgroundColor:l.background.paper,backgroundImage:"none",border:`1px solid ${l.border}`,borderRadius:r.shape.borderRadius,boxShadow:l.shadow})}},MuiDialogTitle:{styleOverrides:{root:{paddingBottom:8}}},MuiDialogContent:{styleOverrides:{root:{paddingTop:"8px !important"}}}}})};export{d as createSageTheme};
|