it-data-nexus-ui-library 2.9.1 → 2.9.3

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{jsx as e,jsxs as r}from"react/jsx-runtime";import{Caption as i,Body2 as l}from"../Typography.mjs";import{Stack as o}from"../_Primitives/Stack.mjs";import{ChartFrame as t}from"./chartFrame.mjs";function a({rows:a,columns:n,cells:s,statusMap:d,sx:c,title:m,titleComponent:p,titleSx:x,titleHidden:b,description:h,actions:g,isLoading:u,isError:f,errorMessage:$,paperSx:w}){const y=new Map(s.map(e=>[`${e.rowId}:${e.columnId}`,e]));return e(t,{title:m,titleComponent:p,titleSx:x,titleHidden:b,description:h,actions:g,isLoading:u,isError:f,errorMessage:$,paperSx:w,children:r(o,{sx:[{gap:.5},...Array.isArray(c)?c:c?[c]:[]],role:"table","aria-label":m??"Heatmap",children:[r(o,{direction:"row",role:"row",sx:{gap:.5},children:[e(o,{sx:{flex:"0 0 120px"}}),n.map(r=>e(o,{role:"columnheader",sx:{flex:1,alignItems:"center",minWidth:0},children:e(i,{sx:{textAlign:"center"},children:r.label})},r.id))]}),a.map(i=>r(o,{direction:"row",role:"row",sx:{gap:.5},children:[e(o,{role:"rowheader",sx:{flex:"0 0 120px",justifyContent:"center",minWidth:0},children:e(l,{children:i.label})}),n.map(r=>{const l=y.get(`${i.id}:${r.id}`),t=l?d[l.status]:void 0,a=l?.label??t?.label??"No data";if(!t)return e(o,{role:"cell","aria-label":`${a}: ${i.label}, ${r.label}`,sx:{flex:1,minHeight:40,border:1,borderColor:"divider",borderRadius:.5,bgcolor:"action.hover"}},r.id);const{Icon:n,color:s}=t;return e(o,{role:"cell",sx:{flex:1,minHeight:40,alignItems:"center",justifyContent:"center",border:1,borderColor:"divider",borderRadius:.5,bgcolor:"action.hover"},children:e(n,{"aria-label":`${a}: ${i.label}, ${r.label}`,titleAccess:`${a}: ${i.label}, ${r.label}`,sx:{color:s,fontSize:22}})},r.id)})]},i.id))]})})}a.displayName="NexusHeatmap";export{a as NexusHeatmap};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Caption as i,Body2 as l}from"../Typography.mjs";import{Stack as o}from"../_Primitives/Stack.mjs";import{ChartFrame as t}from"./chartFrame.mjs";function a({rows:a,columns:n,cells:s,statusMap:d,cellMinHeight:c=40,cellIconSize:m=22,sx:p,title:x,titleComponent:b,titleSx:h,titleHidden:g,description:u,actions:f,isLoading:$,isError:w,errorMessage:y,paperSx:H}){const S=new Map(s.map(e=>[`${e.rowId}:${e.columnId}`,e]));return e(t,{title:x,titleComponent:b,titleSx:h,titleHidden:g,description:u,actions:f,isLoading:$,isError:w,errorMessage:y,paperSx:H,children:r(o,{sx:[{gap:.5},...Array.isArray(p)?p:p?[p]:[]],role:"table","aria-label":x??"Heatmap",children:[r(o,{direction:"row",role:"row",sx:{gap:.5},children:[e(o,{sx:{flex:"0 0 120px"}}),n.map(r=>e(o,{role:"columnheader",sx:{flex:1,alignItems:"center",minWidth:0},children:e(i,{sx:{textAlign:"center"},children:r.label})},r.id))]}),a.map(i=>r(o,{direction:"row",role:"row",sx:{gap:.5},children:[e(o,{role:"rowheader",sx:{flex:"0 0 120px",justifyContent:"center",minWidth:0},children:e(l,{children:i.label})}),n.map(r=>{const l=S.get(`${i.id}:${r.id}`),t=l?d[l.status]:void 0,a=l?.label??t?.label??"No data";if(!t)return e(o,{role:"cell","aria-label":`${a}: ${i.label}, ${r.label}`,sx:{flex:1,minHeight:c,border:1,borderColor:"divider",borderRadius:.5,bgcolor:"action.hover"}},r.id);const{Icon:n,color:s}=t;return e(o,{role:"cell",sx:{flex:1,minHeight:c,alignItems:"center",justifyContent:"center",border:1,borderColor:"divider",borderRadius:.5,bgcolor:"action.hover"},children:e(n,{"aria-label":`${a}: ${i.label}, ${r.label}`,titleAccess:`${a}: ${i.label}, ${r.label}`,sx:{color:s,fontSize:m}})},r.id)})]},i.id))]})})}a.displayName="NexusHeatmap";export{a as NexusHeatmap};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{Card as l,CardContent as a}from"@mui/material";import{MetricStat as r}from"./MetricStat.mjs";const e={xs:0,sm:.3,md:.5,lg:1},i=({label:i,value:t,delta:m,deltaColor:n,valueColor:s,size:d,icon:c,iconColor:x,labelGap:b,alignValueToBottom:p,cardSx:u,sx:C})=>{const h=e[d??"md"];return o(l,{sx:[{boxShadow:"none"},...Array.isArray(u)?u:u?[u]:[]],children:o(a,{sx:{p:h,...p?{height:"100%",boxSizing:"border-box"}:{},"&:last-child":{pb:h}},children:o(r,{label:i,value:t,delta:m,deltaColor:n,valueColor:s,size:d,icon:c,iconColor:x,labelGap:b,alignValueToBottom:p,sx:C})})})};i.displayName="MetricCard";export{i as MetricCard};
1
+ import{jsx as o}from"react/jsx-runtime";import{Card as l,CardContent as a}from"@mui/material";import{MetricStat as e}from"./MetricStat.mjs";const r={xs:0,sm:.3,md:.5,lg:1},i=({label:i,value:t,delta:n,deltaColor:m,valueColor:c,size:s,icon:d,iconColor:p,iconSize:u,valueRowGap:x,labelGap:b,alignValueToBottom:C,cardSx:h,sx:v})=>{const S=r[s??"md"];return o(l,{sx:[{boxShadow:"none"},...Array.isArray(h)?h:h?[h]:[]],children:o(a,{sx:{p:S,...C?{height:"100%",boxSizing:"border-box"}:{},"&:last-child":{pb:S}},children:o(e,{label:i,value:t,delta:n,deltaColor:m,valueColor:c,size:s,icon:d,iconColor:p,iconSize:u,valueRowGap:x,labelGap:b,alignValueToBottom:C,sx:v})})})};i.displayName="MetricCard";export{i as MetricCard};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{Stack as r}from"./_Primitives/Stack.mjs";import{H4 as i,MetricValue as t,Caption as l}from"./Typography.mjs";const a=({label:a,value:n,delta:s,deltaColor:c,valueColor:m,size:d,icon:p,iconColor:x,labelGap:h=.25,alignValueToBottom:g=!1,sx:f})=>e(r,{sx:[{gap:h,...g?{height:"100%",justifyContent:"space-between"}:{}},...Array.isArray(f)?f:f?[f]:[]],children:[o(i,{sx:{color:"text.secondary"},children:a}),e(r,{direction:"row",sx:{alignItems:"center",gap:1},children:[p&&o(p,{"aria-hidden":"true",sx:{color:x,fontSize:"lg"===d?40:"sm"===d?28:"xs"===d?22:34}}),o(t,{size:d,sx:m?{color:m}:void 0,children:n}),s&&o(l,{component:"span",sx:[{alignSelf:"flex-end",pb:.25},...c?[{color:c}]:[]],children:s})]})]});a.displayName="MetricStat";export{a as MetricStat};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{Stack as r}from"./_Primitives/Stack.mjs";import{H4 as i,MetricValue as l,Caption as t}from"./Typography.mjs";const a=({label:a,value:n,delta:s,deltaColor:c,valueColor:m,size:p,icon:d,iconColor:x,iconSize:h,valueRowGap:g=1,labelGap:f=.25,alignValueToBottom:u=!1,sx:y})=>e(r,{sx:[{gap:f,...u?{height:"100%",justifyContent:"space-between"}:{}},...Array.isArray(y)?y:y?[y]:[]],children:[o(i,{sx:{color:"text.secondary"},children:a}),e(r,{direction:"row",sx:{alignItems:"center",gap:g},children:[d&&o(d,{"aria-hidden":"true",sx:{color:x,fontSize:h??("lg"===p?40:"sm"===p?28:"xs"===p?22:34)}}),o(l,{size:p,sx:m?{color:m}:void 0,children:n}),s&&o(t,{component:"span",sx:[{alignSelf:"flex-end",pb:.25},...c?[{color:c}]:[]],children:s})]})]});a.displayName="MetricStat";export{a as MetricStat};
@@ -1 +1 @@
1
- const o="2.9.1";export{o as SAGE_NEXUS_UI_VERSION};
1
+ const o="2.9.3";export{o as SAGE_NEXUS_UI_VERSION};
package/dist/index.d.ts CHANGED
@@ -635,6 +635,10 @@ interface MetricStatProps {
635
635
  icon?: typeof SvgIcon;
636
636
  /** MUI theme colour token for the icon. Omit for default text colour. */
637
637
  iconColor?: string;
638
+ /** Optional icon size in pixels. Defaults to the size associated with the metric value. */
639
+ iconSize?: number;
640
+ /** Gap between the icon, value, and delta row items. Defaults to 1. */
641
+ valueRowGap?: number | string;
638
642
  /** Gap between the metric label and the value row. Defaults to 0.25. */
639
643
  labelGap?: number | string;
640
644
  /** Align the value row to the bottom when the metric has a constrained height. */
@@ -653,7 +657,7 @@ interface MetricStatProps {
653
657
  * large p — not a heading), and the delta is a Caption.
654
658
  */
655
659
  declare const MetricStat: {
656
- ({ label, value, delta, deltaColor, valueColor, size, icon: Icon, iconColor, labelGap, alignValueToBottom, sx, }: MetricStatProps): react.JSX.Element;
660
+ ({ label, value, delta, deltaColor, valueColor, size, icon: Icon, iconColor, iconSize, valueRowGap, labelGap, alignValueToBottom, sx, }: MetricStatProps): react.JSX.Element;
657
661
  displayName: string;
658
662
  };
659
663
 
@@ -672,7 +676,7 @@ interface MetricCardProps extends MetricStatProps {
672
676
  * ```
673
677
  */
674
678
  declare const MetricCard: {
675
- ({ label, value, delta, deltaColor, valueColor, size, icon, iconColor, labelGap, alignValueToBottom, cardSx, sx, }: MetricCardProps): react.JSX.Element;
679
+ ({ label, value, delta, deltaColor, valueColor, size, icon, iconColor, iconSize, valueRowGap, labelGap, alignValueToBottom, cardSx, sx, }: MetricCardProps): react.JSX.Element;
676
680
  displayName: string;
677
681
  };
678
682
 
@@ -1377,9 +1381,13 @@ interface NexusHeatmapProps extends ChartAsyncProps {
1377
1381
  columns: NexusHeatmapAxisItem[];
1378
1382
  cells: NexusHeatmapCell[];
1379
1383
  statusMap: Record<string, NexusHeatmapStatus>;
1384
+ /** Minimum height of each heatmap cell. Defaults to 40. */
1385
+ cellMinHeight?: number;
1386
+ /** Icon size in px for populated heatmap cells. Defaults to 22. */
1387
+ cellIconSize?: number;
1380
1388
  sx?: SxProps<Theme>;
1381
1389
  }
1382
- declare function NexusHeatmap({ rows, columns, cells, statusMap, sx, title, titleComponent, titleSx, titleHidden, description, actions, isLoading, isError, errorMessage, paperSx, }: NexusHeatmapProps): react.JSX.Element;
1390
+ declare function NexusHeatmap({ rows, columns, cells, statusMap, cellMinHeight, cellIconSize, sx, title, titleComponent, titleSx, titleHidden, description, actions, isLoading, isError, errorMessage, paperSx, }: NexusHeatmapProps): react.JSX.Element;
1383
1391
  declare namespace NexusHeatmap {
1384
1392
  var displayName: string;
1385
1393
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "it-data-nexus-ui-library",
3
- "version": "2.9.1",
3
+ "version": "2.9.3",
4
4
  "description": "Nexus core components",
5
5
  "license": "ISC",
6
6
  "author": "emsmart-sage",