@omniviewdev/ui 0.1.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.
- package/LICENSE +661 -0
- package/dist/Button-Dmu1cikC.cjs +1 -0
- package/dist/Button-lr02bh_m.js +51 -0
- package/dist/CodeBlock-B1iQO7zU.js +73 -0
- package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
- package/dist/CopyButton-CACe3RCF.cjs +1 -0
- package/dist/CopyButton-DPBgL0K8.js +77 -0
- package/dist/ErrorState-CexYrMpy.js +188 -0
- package/dist/ErrorState-CnIR-1xa.cjs +1 -0
- package/dist/HotkeyHint-6SOi-MaU.js +37 -0
- package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
- package/dist/Icon-CKdIOrjZ.cjs +1 -0
- package/dist/Icon-CuO9W7cA.js +27 -0
- package/dist/SearchInput-CFBBNdI2.cjs +1 -0
- package/dist/SearchInput-D3AsCI5H.js +41 -0
- package/dist/Select-CnRBSc5w.cjs +1 -0
- package/dist/Select-DTUF31OP.js +206 -0
- package/dist/Skeleton-BUYyXUiC.js +32 -0
- package/dist/Skeleton-CfdQWLQM.cjs +1 -0
- package/dist/StatusDot-CYyJxjJK.cjs +1 -0
- package/dist/StatusDot-CncykBAY.js +68 -0
- package/dist/StatusPill-C1NaiCzd.js +29 -0
- package/dist/StatusPill-C7yn7dSA.cjs +1 -0
- package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
- package/dist/TabPanel-DLHbgKpl.js +124 -0
- package/dist/Text-By4P3in5.js +71 -0
- package/dist/Text-Mk6Uyg1w.cjs +1 -0
- package/dist/Tooltip-44-P5KfQ.cjs +1 -0
- package/dist/Tooltip-BEVuYuZ3.js +41 -0
- package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
- package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +21 -0
- package/dist/buttons/Button.d.ts +31 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ConfirmButton.d.ts +10 -0
- package/dist/buttons/CopyButton.d.ts +11 -0
- package/dist/buttons/IconButton.d.ts +21 -0
- package/dist/buttons/SearchBar.d.ts +22 -0
- package/dist/buttons/ToggleButton.d.ts +18 -0
- package/dist/buttons/ToggleGroup.d.ts +23 -0
- package/dist/buttons/Toolbar.d.ts +15 -0
- package/dist/buttons/ToolbarGroup.d.ts +11 -0
- package/dist/buttons/index.d.ts +22 -0
- package/dist/buttons.cjs +1 -0
- package/dist/buttons.js +430 -0
- package/dist/cells/BadgesCell.d.ts +19 -0
- package/dist/cells/ChipCell.d.ts +16 -0
- package/dist/cells/SelectBoxHeader.d.ts +11 -0
- package/dist/cells/SelectBoxRow.d.ts +11 -0
- package/dist/cells/TextCell.d.ts +25 -0
- package/dist/cells/index.d.ts +5 -0
- package/dist/cells.cjs +1 -0
- package/dist/cells.js +284 -0
- package/dist/charts/BarChart.d.ts +15 -0
- package/dist/charts/ChartContainer.d.ts +12 -0
- package/dist/charts/ChartLegend.d.ts +11 -0
- package/dist/charts/GaugeCard.d.ts +18 -0
- package/dist/charts/MetricsPanel.d.ts +61 -0
- package/dist/charts/PieChart.d.ts +13 -0
- package/dist/charts/ScatterChart.d.ts +25 -0
- package/dist/charts/Sparkline.d.ts +16 -0
- package/dist/charts/StackedAreaChart.d.ts +18 -0
- package/dist/charts/TimeSeriesChart.d.ts +43 -0
- package/dist/charts/formatters.d.ts +17 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/palette.d.ts +7 -0
- package/dist/charts/types.d.ts +67 -0
- package/dist/charts/useChartTheme.d.ts +13 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +967 -0
- package/dist/components/ActionCard.d.ts +22 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Card.d.ts +24 -0
- package/dist/components/Chip.d.ts +32 -0
- package/dist/components/ClipboardText.d.ts +14 -0
- package/dist/components/DetailsCard.d.ts +25 -0
- package/dist/components/EmptySearch.d.ts +12 -0
- package/dist/components/ExpandableSections.d.ts +51 -0
- package/dist/components/FileIcon.d.ts +12 -0
- package/dist/components/HotkeyHint.d.ts +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/KVCard.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/List.d.ts +29 -0
- package/dist/components/ListCard.d.ts +30 -0
- package/dist/components/ListItem.d.ts +27 -0
- package/dist/components/LoadingOverlay.d.ts +14 -0
- package/dist/components/MediaCard.d.ts +24 -0
- package/dist/components/MetricsSection.d.ts +37 -0
- package/dist/components/OverflowText.d.ts +12 -0
- package/dist/components/StatCard.d.ts +26 -0
- package/dist/components/StatusCard.d.ts +29 -0
- package/dist/components/TruncatedList.d.ts +13 -0
- package/dist/domain/DescriptionList.d.ts +12 -0
- package/dist/domain/EventsList.d.ts +11 -0
- package/dist/domain/FilterBar.d.ts +23 -0
- package/dist/domain/LogsViewer.d.ts +15 -0
- package/dist/domain/MetricCard.d.ts +14 -0
- package/dist/domain/ObjectInspector.d.ts +19 -0
- package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
- package/dist/domain/ResourceRef.d.ts +15 -0
- package/dist/domain/ResourceStatus.d.ts +17 -0
- package/dist/domain/SecretValueMask.d.ts +11 -0
- package/dist/domain/Timeline.d.ts +21 -0
- package/dist/domain/index.d.ts +23 -0
- package/dist/domain/types.d.ts +25 -0
- package/dist/domain.cjs +1 -0
- package/dist/domain.js +871 -0
- package/dist/editors/CodeEditor.d.ts +19 -0
- package/dist/editors/CommandPalette.d.ts +22 -0
- package/dist/editors/DiffViewer.d.ts +14 -0
- package/dist/editors/MarkdownPreview.d.ts +9 -0
- package/dist/editors/Terminal.d.ts +18 -0
- package/dist/editors/index.d.ts +11 -0
- package/dist/editors/themes.d.ts +4 -0
- package/dist/editors.cjs +42 -0
- package/dist/editors.js +38396 -0
- package/dist/feedback/Alert.d.ts +21 -0
- package/dist/feedback/ConnectionIndicator.d.ts +15 -0
- package/dist/feedback/EmptyState.d.ts +17 -0
- package/dist/feedback/ErrorState.d.ts +12 -0
- package/dist/feedback/IDEStatusFooter.d.ts +104 -0
- package/dist/feedback/NotificationStack.d.ts +32 -0
- package/dist/feedback/ProgressBar.d.ts +16 -0
- package/dist/feedback/ProgressRing.d.ts +26 -0
- package/dist/feedback/RunButton.d.ts +17 -0
- package/dist/feedback/Skeleton.d.ts +13 -0
- package/dist/feedback/StatusBar.d.ts +12 -0
- package/dist/feedback/StatusBarItem.d.ts +18 -0
- package/dist/feedback/StatusDot.d.ts +14 -0
- package/dist/feedback/StatusPill.d.ts +13 -0
- package/dist/feedback/index.d.ts +29 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1011 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +1632 -0
- package/dist/inputs/Autocomplete.d.ts +30 -0
- package/dist/inputs/Checkbox.d.ts +17 -0
- package/dist/inputs/ColorPicker.d.ts +13 -0
- package/dist/inputs/DebouncedInput.d.ts +10 -0
- package/dist/inputs/FormField.d.ts +15 -0
- package/dist/inputs/FormSection.d.ts +14 -0
- package/dist/inputs/KeyValueEditor.d.ts +17 -0
- package/dist/inputs/RadioGroup.d.ts +23 -0
- package/dist/inputs/SearchInput.d.ts +14 -0
- package/dist/inputs/Select.d.ts +32 -0
- package/dist/inputs/Slider.d.ts +24 -0
- package/dist/inputs/Switch.d.ts +17 -0
- package/dist/inputs/TagInput.d.ts +18 -0
- package/dist/inputs/TextArea.d.ts +26 -0
- package/dist/inputs/TextField.d.ts +39 -0
- package/dist/inputs/TimeRangePicker.d.ts +21 -0
- package/dist/inputs/index.d.ts +31 -0
- package/dist/inputs.cjs +21 -0
- package/dist/inputs.js +15834 -0
- package/dist/layout/AppShell.d.ts +18 -0
- package/dist/layout/DockLayout.d.ts +23 -0
- package/dist/layout/Inline.d.ts +15 -0
- package/dist/layout/Panel.d.ts +17 -0
- package/dist/layout/ResizableSplitPane.d.ts +18 -0
- package/dist/layout/Spacer.d.ts +9 -0
- package/dist/layout/Stack.d.ts +19 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/useResizablePanel.d.ts +18 -0
- package/dist/layout.cjs +5 -0
- package/dist/layout.js +378 -0
- package/dist/menus/ContextMenu.d.ts +12 -0
- package/dist/menus/DropdownMenu.d.ts +20 -0
- package/dist/menus/MenuBar.d.ts +11 -0
- package/dist/menus/NestedMenuItem.d.ts +13 -0
- package/dist/menus/SplitButton.d.ts +15 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/types.d.ts +24 -0
- package/dist/menus.cjs +1 -0
- package/dist/menus.js +355 -0
- package/dist/navigation/Breadcrumbs.d.ts +18 -0
- package/dist/navigation/DraggableTabs.d.ts +24 -0
- package/dist/navigation/Pagination.d.ts +15 -0
- package/dist/navigation/PersistentTabPanel.d.ts +13 -0
- package/dist/navigation/Stepper.d.ts +19 -0
- package/dist/navigation/TabPanel.d.ts +11 -0
- package/dist/navigation/Tabs.d.ts +26 -0
- package/dist/navigation/TreeView.d.ts +27 -0
- package/dist/navigation/index.d.ts +16 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.js +429 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Drawer.d.ts +17 -0
- package/dist/overlays/ErrorOverlay.d.ts +21 -0
- package/dist/overlays/Modal.d.ts +14 -0
- package/dist/overlays/NotificationCenter.d.ts +31 -0
- package/dist/overlays/Popover.d.ts +15 -0
- package/dist/overlays/Spotlight.d.ts +24 -0
- package/dist/overlays/ToastProvider.d.ts +32 -0
- package/dist/overlays/Tooltip.d.ts +15 -0
- package/dist/overlays/index.d.ts +20 -0
- package/dist/overlays/useToast.d.ts +21 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.js +865 -0
- package/dist/sidebars/ActivityBar.d.ts +16 -0
- package/dist/sidebars/NavMenu.d.ts +27 -0
- package/dist/sidebars/NavMenu.test.d.ts +1 -0
- package/dist/sidebars/PropertyGrid.d.ts +16 -0
- package/dist/sidebars/SidebarGroup.d.ts +15 -0
- package/dist/sidebars/SidebarPanel.d.ts +19 -0
- package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
- package/dist/sidebars/index.d.ts +13 -0
- package/dist/sidebars/types.d.ts +29 -0
- package/dist/sidebars.cjs +1 -0
- package/dist/sidebars.js +762 -0
- package/dist/table/ColumnFilter.d.ts +10 -0
- package/dist/table/DataTable.d.ts +23 -0
- package/dist/table/IDETable.d.ts +48 -0
- package/dist/table/TableEmptyState.d.ts +12 -0
- package/dist/table/TableSkeleton.d.ts +11 -0
- package/dist/table/TableToolbar.d.ts +15 -0
- package/dist/table/index.d.ts +12 -0
- package/dist/table/types.d.ts +4 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +580 -0
- package/dist/theme/AppTheme.d.ts +14 -0
- package/dist/theme/customizations/dataDisplay.d.ts +2 -0
- package/dist/theme/customizations/feedback.d.ts +2 -0
- package/dist/theme/customizations/inputs.d.ts +2 -0
- package/dist/theme/customizations/navigation.d.ts +2 -0
- package/dist/theme/index.d.ts +36 -0
- package/dist/theme/primitives.d.ts +234 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1362 -0
- package/dist/tokens.css +252 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/maps.d.ts +25 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +96 -0
- package/dist/typography/CodeBlock.d.ts +15 -0
- package/dist/typography/CodeInline.d.ts +10 -0
- package/dist/typography/Heading.d.ts +13 -0
- package/dist/typography/Link.d.ts +18 -0
- package/dist/typography/Text.d.ts +22 -0
- package/dist/typography/index.d.ts +10 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +120 -0
- package/dist/ui.css +1 -0
- package/dist/units-BuBKbqQ7.js +54 -0
- package/dist/units-CDpdlN1W.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/language.d.ts +4 -0
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/units.d.ts +7 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +78 -0
- package/package.json +261 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ColorName = 'success' | 'warning' | 'danger' | 'primary' | 'neutral';
|
|
3
|
+
type Props = {
|
|
4
|
+
value: string;
|
|
5
|
+
color?: ColorName;
|
|
6
|
+
colorMap?: Record<string, ColorName>;
|
|
7
|
+
startDecorator?: string | React.ReactNode;
|
|
8
|
+
endDecorator?: string | React.ReactNode;
|
|
9
|
+
align?: 'left' | 'right' | 'center';
|
|
10
|
+
variant?: 'soft' | 'outlined';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Renders a row with a chip inside for the generic resource table.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ChipCell: React.FC<Props>;
|
|
16
|
+
export default ChipCell;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Table } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Render a selectbox for the header of the generic resource table.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SelectBoxHeader: {
|
|
6
|
+
({ table }: {
|
|
7
|
+
table: Table<any>;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default SelectBoxHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
|
2
|
+
/**
|
|
3
|
+
* Render a selectbox for a row of the generic resource table.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SelectBoxRow: {
|
|
6
|
+
({ row }: {
|
|
7
|
+
row: Row<any>;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default SelectBoxRow;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/** The text value to render */
|
|
4
|
+
value: any;
|
|
5
|
+
/** The color of the text. Default is 'neutral' */
|
|
6
|
+
color?: 'success' | 'warning' | 'danger' | 'primary' | 'neutral';
|
|
7
|
+
/** Specify mapping of values to colors that will change with the input */
|
|
8
|
+
colorMap?: Record<string, string>;
|
|
9
|
+
/** A decorator to render before the text */
|
|
10
|
+
startDecorator?: React.ReactNode;
|
|
11
|
+
/** A decorator to render after the text */
|
|
12
|
+
endDecorator?: React.ReactNode;
|
|
13
|
+
/** The horizontal alignment of the text. Default is 'left' */
|
|
14
|
+
align?: 'left' | 'right' | 'center';
|
|
15
|
+
/** Formatter for the text */
|
|
16
|
+
formatter?: string;
|
|
17
|
+
/** children */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Render a text cell for the generic resource table.
|
|
22
|
+
* Supports formatters: age, bytes, sum, count, avg, max, min.
|
|
23
|
+
*/
|
|
24
|
+
declare const TextCell: React.FC<Props>;
|
|
25
|
+
export default TextCell;
|
package/dist/cells.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("react"),l=require("@mui/material/Box"),N=require("@mui/material/Typography"),m=require("./units-CDpdlN1W.cjs"),I=require("@mui/material/Tooltip"),B=require("@mui/material/Chip"),x=require("./Icon-CKdIOrjZ.cjs"),p=require("@mui/material/Checkbox"),h={bytes:e=>m.convertByteUnits({from:e}),sum:e=>{let t=0;if(Array.isArray(e))for(const r of e)t+=Number(r);return typeof e=="string"&&e.split(",").forEach(r=>{t+=Number(r)}),typeof e=="number"&&(t+=e),t.toString()},count:e=>Array.isArray(e)?e.length.toString():typeof e=="string"?e.split(",").length.toString():typeof e=="number"?e.toString():"",avg:e=>{let t=0,r=0;if(Array.isArray(e))for(const i of e)t+=Number(i),r++;return(t/r).toString()},max:e=>{let t=0;if(Array.isArray(e))for(const r of e)t=Math.max(t,Number(r));return t.toString()},min:e=>{let t=Number.MAX_VALUE;if(Array.isArray(e))for(const r of e)t=Math.min(t,Number(r));return typeof e=="string"&&e.split(",").forEach(r=>{t=Math.min(t,Number(r))}),typeof e=="number"&&(t=Math.min(t,e)),t.toString()}},y=e=>{switch(e){case"success":return"success";case"warning":return"warning";case"danger":case"error":return"error";case"primary":return"primary";case"neutral":return"inherit";default:return}},T=({value:e,...t})=>{const r=g.useMemo(()=>{const s=new Date(e);return!e||isNaN(s.getTime())?"0s":m.formatTimeDifference(s)},[e]),[i,a]=g.useState(r);return g.useEffect(()=>{const s=new Date(e);if(isNaN(s.getTime()))return;const u=setInterval(()=>{a(m.formatTimeDifference(s))},1e3);return()=>{clearInterval(u)}},[e,r]),n.jsx(C,{value:i,...t})},C=({align:e,value:t,color:r,colorMap:i,startDecorator:a,endDecorator:s,formatter:c,children:u})=>{const d=()=>{if(i){const f=i[t]??i["*"]??void 0;return y(f)}return y(r)},o=()=>{switch(e){case"left":return"flex-start";case"right":return"flex-end";case"center":return"center";default:return"flex-start"}};return n.jsx(l,{display:"flex",flex:1,justifyContent:o(),alignItems:"center",sx:{overflowY:"hidden",overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},children:u??n.jsxs(l,{display:"flex",alignItems:"center",gap:.5,children:[a,n.jsx(N,{variant:"caption",color:d(),noWrap:!0,children:c&&h[c]?h[c](t):`${t}`}),s]})})},b=({formatter:e,...t})=>e?.toLowerCase()==="age"?n.jsx(T,{...t}):n.jsx(C,{...t,formatter:e?.toLowerCase()});b.displayName="TextCell";const q={success:"var(--ov-success-default)",warning:"var(--ov-warning-default)",danger:"var(--ov-danger-default)",primary:"var(--ov-accent)",neutral:"var(--ov-fg-muted)"},j=({align:e,values:t,colorMap:r,hoverMenu:i,hoverMenuDelay:a})=>{const s=o=>q[r[o]??"neutral"],c=()=>{switch(e){case"left":return"flex-start";case"right":return"flex-end";case"center":return"center";case"justify":return"space-between";default:return"flex-start"}},u=a??200,d=({color:o})=>n.jsx(l,{sx:{borderRadius:"2px",width:12,height:12,minWidth:12,minHeight:12,bgcolor:o}});return n.jsx(l,{display:"flex",flex:1,justifyContent:c(),alignItems:"center",gap:.25,children:t.map((o,f)=>i?n.jsx(I,{title:i(o),enterDelay:u,slotProps:{tooltip:{sx:{p:1,border:"1px solid var(--ov-border-default)",bgcolor:"var(--ov-bg-surface-overlay)",color:"var(--ov-fg-default)"}}},children:n.jsx(d,{color:s(o)})},`badge-${f}`):n.jsx(d,{color:s(o)},`badge-${f}`))})};j.displayName="BadgesCell";const v=e=>{switch(e){case"success":return"success";case"warning":return"warning";case"danger":return"error";case"primary":return"primary";case"neutral":return"default";default:return"default"}},R=e=>e==="outlined"?"outlined":"filled",w=({align:e,value:t,color:r,colorMap:i,startDecorator:a,endDecorator:s,variant:c})=>{const u=()=>i?i[t]||"neutral":r??"neutral",d=()=>{switch(e){case"left":return"flex-start";case"right":return"flex-end";case"center":return"center";default:return"flex-start"}},o=typeof a=="string"?n.jsx(x.Icon,{name:a,size:16}):a,f=typeof s=="string"?n.jsx(x.Icon,{name:s,size:16}):s;return n.jsx(l,{display:"flex",flex:1,justifyContent:d(),alignItems:"center",children:n.jsx(B,{size:"small",color:v(u()),variant:R(c),sx:{borderRadius:"4px"},icon:o,label:f?n.jsxs(l,{display:"flex",alignItems:"center",gap:.5,children:[t,f]}):t})})};w.displayName="ChipCell";const S=({table:e})=>n.jsx(l,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",maxWidth:24},children:n.jsx(p,{size:"small",checked:e.getIsAllPageRowsSelected(),onChange:t=>{e.toggleAllPageRowsSelected(t.target.checked)},"aria-label":"Select all rows"})});S.displayName="SelectBoxHeader";const A=({row:e})=>n.jsx(l,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",maxWidth:24},children:n.jsx(p,{size:"small",checked:e.getIsSelected(),onChange:t=>{e.toggleSelected(t.target.checked)},"aria-label":"Select row"})});A.displayName="SelectBoxRow";exports.BadgesCell=j;exports.ChipCell=w;exports.SelectBoxHeader=S;exports.SelectBoxRow=A;exports.TextCell=b;
|
package/dist/cells.js
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import c from "@mui/material/Box";
|
|
4
|
+
import C from "@mui/material/Typography";
|
|
5
|
+
import { f as m, c as A } from "./units-BuBKbqQ7.js";
|
|
6
|
+
import S from "@mui/material/Tooltip";
|
|
7
|
+
import N from "@mui/material/Chip";
|
|
8
|
+
import { I as p } from "./Icon-CuO9W7cA.js";
|
|
9
|
+
import b from "@mui/material/Checkbox";
|
|
10
|
+
const h = {
|
|
11
|
+
bytes: (e) => A({ from: e }),
|
|
12
|
+
sum: (e) => {
|
|
13
|
+
let t = 0;
|
|
14
|
+
if (Array.isArray(e))
|
|
15
|
+
for (const r of e)
|
|
16
|
+
t += Number(r);
|
|
17
|
+
return typeof e == "string" && e.split(",").forEach((r) => {
|
|
18
|
+
t += Number(r);
|
|
19
|
+
}), typeof e == "number" && (t += e), t.toString();
|
|
20
|
+
},
|
|
21
|
+
count: (e) => Array.isArray(e) ? e.length.toString() : typeof e == "string" ? e.split(",").length.toString() : typeof e == "number" ? e.toString() : "",
|
|
22
|
+
avg: (e) => {
|
|
23
|
+
let t = 0, r = 0;
|
|
24
|
+
if (Array.isArray(e))
|
|
25
|
+
for (const o of e)
|
|
26
|
+
t += Number(o), r++;
|
|
27
|
+
return (t / r).toString();
|
|
28
|
+
},
|
|
29
|
+
max: (e) => {
|
|
30
|
+
let t = 0;
|
|
31
|
+
if (Array.isArray(e))
|
|
32
|
+
for (const r of e)
|
|
33
|
+
t = Math.max(t, Number(r));
|
|
34
|
+
return t.toString();
|
|
35
|
+
},
|
|
36
|
+
min: (e) => {
|
|
37
|
+
let t = Number.MAX_VALUE;
|
|
38
|
+
if (Array.isArray(e))
|
|
39
|
+
for (const r of e)
|
|
40
|
+
t = Math.min(t, Number(r));
|
|
41
|
+
return typeof e == "string" && e.split(",").forEach((r) => {
|
|
42
|
+
t = Math.min(t, Number(r));
|
|
43
|
+
}), typeof e == "number" && (t = Math.min(t, e)), t.toString();
|
|
44
|
+
}
|
|
45
|
+
}, y = (e) => {
|
|
46
|
+
switch (e) {
|
|
47
|
+
case "success":
|
|
48
|
+
return "success";
|
|
49
|
+
case "warning":
|
|
50
|
+
return "warning";
|
|
51
|
+
case "danger":
|
|
52
|
+
case "error":
|
|
53
|
+
return "error";
|
|
54
|
+
case "primary":
|
|
55
|
+
return "primary";
|
|
56
|
+
case "neutral":
|
|
57
|
+
return "inherit";
|
|
58
|
+
default:
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}, I = ({ value: e, ...t }) => {
|
|
62
|
+
const r = g.useMemo(() => {
|
|
63
|
+
const s = new Date(e);
|
|
64
|
+
return !e || isNaN(s.getTime()) ? "0s" : m(s);
|
|
65
|
+
}, [e]), [o, a] = g.useState(r);
|
|
66
|
+
return g.useEffect(() => {
|
|
67
|
+
const s = new Date(e);
|
|
68
|
+
if (isNaN(s.getTime())) return;
|
|
69
|
+
const f = setInterval(() => {
|
|
70
|
+
a(m(s));
|
|
71
|
+
}, 1e3);
|
|
72
|
+
return () => {
|
|
73
|
+
clearInterval(f);
|
|
74
|
+
};
|
|
75
|
+
}, [e, r]), /* @__PURE__ */ n(w, { value: o, ...t });
|
|
76
|
+
}, w = ({ align: e, value: t, color: r, colorMap: o, startDecorator: a, endDecorator: s, formatter: l, children: f }) => {
|
|
77
|
+
const u = () => {
|
|
78
|
+
if (o) {
|
|
79
|
+
const d = o[t] ?? o["*"] ?? void 0;
|
|
80
|
+
return y(d);
|
|
81
|
+
}
|
|
82
|
+
return y(r);
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ n(
|
|
85
|
+
c,
|
|
86
|
+
{
|
|
87
|
+
display: "flex",
|
|
88
|
+
flex: 1,
|
|
89
|
+
justifyContent: (() => {
|
|
90
|
+
switch (e) {
|
|
91
|
+
case "left":
|
|
92
|
+
return "flex-start";
|
|
93
|
+
case "right":
|
|
94
|
+
return "flex-end";
|
|
95
|
+
case "center":
|
|
96
|
+
return "center";
|
|
97
|
+
default:
|
|
98
|
+
return "flex-start";
|
|
99
|
+
}
|
|
100
|
+
})(),
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
sx: {
|
|
103
|
+
overflowY: "hidden",
|
|
104
|
+
overflowX: "scroll",
|
|
105
|
+
scrollbarWidth: "none",
|
|
106
|
+
"&::-webkit-scrollbar": { display: "none" }
|
|
107
|
+
},
|
|
108
|
+
children: f ?? /* @__PURE__ */ x(c, { display: "flex", alignItems: "center", gap: 0.5, children: [
|
|
109
|
+
a,
|
|
110
|
+
/* @__PURE__ */ n(
|
|
111
|
+
C,
|
|
112
|
+
{
|
|
113
|
+
variant: "caption",
|
|
114
|
+
color: u(),
|
|
115
|
+
noWrap: !0,
|
|
116
|
+
children: l && h[l] ? h[l](t) : `${t}`
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
s
|
|
120
|
+
] })
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}, B = ({ formatter: e, ...t }) => e?.toLowerCase() === "age" ? /* @__PURE__ */ n(I, { ...t }) : /* @__PURE__ */ n(w, { ...t, formatter: e?.toLowerCase() });
|
|
124
|
+
B.displayName = "TextCell";
|
|
125
|
+
const T = {
|
|
126
|
+
success: "var(--ov-success-default)",
|
|
127
|
+
warning: "var(--ov-warning-default)",
|
|
128
|
+
danger: "var(--ov-danger-default)",
|
|
129
|
+
primary: "var(--ov-accent)",
|
|
130
|
+
neutral: "var(--ov-fg-muted)"
|
|
131
|
+
}, j = ({ align: e, values: t, colorMap: r, hoverMenu: o, hoverMenuDelay: a }) => {
|
|
132
|
+
const s = (i) => T[r[i] ?? "neutral"], l = () => {
|
|
133
|
+
switch (e) {
|
|
134
|
+
case "left":
|
|
135
|
+
return "flex-start";
|
|
136
|
+
case "right":
|
|
137
|
+
return "flex-end";
|
|
138
|
+
case "center":
|
|
139
|
+
return "center";
|
|
140
|
+
case "justify":
|
|
141
|
+
return "space-between";
|
|
142
|
+
default:
|
|
143
|
+
return "flex-start";
|
|
144
|
+
}
|
|
145
|
+
}, f = a ?? 200, u = ({ color: i }) => /* @__PURE__ */ n(
|
|
146
|
+
c,
|
|
147
|
+
{
|
|
148
|
+
sx: {
|
|
149
|
+
borderRadius: "2px",
|
|
150
|
+
width: 12,
|
|
151
|
+
height: 12,
|
|
152
|
+
minWidth: 12,
|
|
153
|
+
minHeight: 12,
|
|
154
|
+
bgcolor: i
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
return /* @__PURE__ */ n(
|
|
159
|
+
c,
|
|
160
|
+
{
|
|
161
|
+
display: "flex",
|
|
162
|
+
flex: 1,
|
|
163
|
+
justifyContent: l(),
|
|
164
|
+
alignItems: "center",
|
|
165
|
+
gap: 0.25,
|
|
166
|
+
children: t.map((i, d) => o ? /* @__PURE__ */ n(
|
|
167
|
+
S,
|
|
168
|
+
{
|
|
169
|
+
title: o(i),
|
|
170
|
+
enterDelay: f,
|
|
171
|
+
slotProps: {
|
|
172
|
+
tooltip: {
|
|
173
|
+
sx: {
|
|
174
|
+
p: 1,
|
|
175
|
+
border: "1px solid var(--ov-border-default)",
|
|
176
|
+
bgcolor: "var(--ov-bg-surface-overlay)",
|
|
177
|
+
color: "var(--ov-fg-default)"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
children: /* @__PURE__ */ n(u, { color: s(i) })
|
|
182
|
+
},
|
|
183
|
+
`badge-${d}`
|
|
184
|
+
) : /* @__PURE__ */ n(u, { color: s(i) }, `badge-${d}`))
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
};
|
|
188
|
+
j.displayName = "BadgesCell";
|
|
189
|
+
const v = (e) => {
|
|
190
|
+
switch (e) {
|
|
191
|
+
case "success":
|
|
192
|
+
return "success";
|
|
193
|
+
case "warning":
|
|
194
|
+
return "warning";
|
|
195
|
+
case "danger":
|
|
196
|
+
return "error";
|
|
197
|
+
case "primary":
|
|
198
|
+
return "primary";
|
|
199
|
+
case "neutral":
|
|
200
|
+
return "default";
|
|
201
|
+
default:
|
|
202
|
+
return "default";
|
|
203
|
+
}
|
|
204
|
+
}, R = (e) => e === "outlined" ? "outlined" : "filled", k = ({ align: e, value: t, color: r, colorMap: o, startDecorator: a, endDecorator: s, variant: l }) => {
|
|
205
|
+
const f = () => o ? o[t] || "neutral" : r ?? "neutral", u = () => {
|
|
206
|
+
switch (e) {
|
|
207
|
+
case "left":
|
|
208
|
+
return "flex-start";
|
|
209
|
+
case "right":
|
|
210
|
+
return "flex-end";
|
|
211
|
+
case "center":
|
|
212
|
+
return "center";
|
|
213
|
+
default:
|
|
214
|
+
return "flex-start";
|
|
215
|
+
}
|
|
216
|
+
}, i = typeof a == "string" ? /* @__PURE__ */ n(p, { name: a, size: 16 }) : a, d = typeof s == "string" ? /* @__PURE__ */ n(p, { name: s, size: 16 }) : s;
|
|
217
|
+
return /* @__PURE__ */ n(
|
|
218
|
+
c,
|
|
219
|
+
{
|
|
220
|
+
display: "flex",
|
|
221
|
+
flex: 1,
|
|
222
|
+
justifyContent: u(),
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
children: /* @__PURE__ */ n(
|
|
225
|
+
N,
|
|
226
|
+
{
|
|
227
|
+
size: "small",
|
|
228
|
+
color: v(f()),
|
|
229
|
+
variant: R(l),
|
|
230
|
+
sx: { borderRadius: "4px" },
|
|
231
|
+
icon: i,
|
|
232
|
+
label: d ? /* @__PURE__ */ x(c, { display: "flex", alignItems: "center", gap: 0.5, children: [
|
|
233
|
+
t,
|
|
234
|
+
d
|
|
235
|
+
] }) : t
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
};
|
|
241
|
+
k.displayName = "ChipCell";
|
|
242
|
+
const z = ({ table: e }) => /* @__PURE__ */ n(c, { sx: {
|
|
243
|
+
display: "flex",
|
|
244
|
+
justifyContent: "center",
|
|
245
|
+
alignItems: "center",
|
|
246
|
+
height: "100%",
|
|
247
|
+
maxWidth: 24
|
|
248
|
+
}, children: /* @__PURE__ */ n(
|
|
249
|
+
b,
|
|
250
|
+
{
|
|
251
|
+
size: "small",
|
|
252
|
+
checked: e.getIsAllPageRowsSelected(),
|
|
253
|
+
onChange: (t) => {
|
|
254
|
+
e.toggleAllPageRowsSelected(t.target.checked);
|
|
255
|
+
},
|
|
256
|
+
"aria-label": "Select all rows"
|
|
257
|
+
}
|
|
258
|
+
) });
|
|
259
|
+
z.displayName = "SelectBoxHeader";
|
|
260
|
+
const E = ({ row: e }) => /* @__PURE__ */ n(c, { sx: {
|
|
261
|
+
display: "flex",
|
|
262
|
+
justifyContent: "center",
|
|
263
|
+
alignItems: "center",
|
|
264
|
+
height: "100%",
|
|
265
|
+
maxWidth: 24
|
|
266
|
+
}, children: /* @__PURE__ */ n(
|
|
267
|
+
b,
|
|
268
|
+
{
|
|
269
|
+
size: "small",
|
|
270
|
+
checked: e.getIsSelected(),
|
|
271
|
+
onChange: (t) => {
|
|
272
|
+
e.toggleSelected(t.target.checked);
|
|
273
|
+
},
|
|
274
|
+
"aria-label": "Select row"
|
|
275
|
+
}
|
|
276
|
+
) });
|
|
277
|
+
E.displayName = "SelectBoxRow";
|
|
278
|
+
export {
|
|
279
|
+
j as BadgesCell,
|
|
280
|
+
k as ChipCell,
|
|
281
|
+
z as SelectBoxHeader,
|
|
282
|
+
E as SelectBoxRow,
|
|
283
|
+
B as TextCell
|
|
284
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
import { BaseChartProps, CategoricalDatum, MetricFormat } from './types';
|
|
3
|
+
export interface BarChartProps extends BaseChartProps {
|
|
4
|
+
data: CategoricalDatum[];
|
|
5
|
+
horizontal?: boolean;
|
|
6
|
+
valueFormat?: MetricFormat;
|
|
7
|
+
showLabels?: boolean;
|
|
8
|
+
stacked?: boolean;
|
|
9
|
+
colors?: (SemanticColor | string)[];
|
|
10
|
+
}
|
|
11
|
+
declare function BarChart({ data, horizontal, valueFormat, unit, valueFormatter: customFormatter, showLabels, colors, size, height: heightOverride, loading, error, onRetry, skipAnimation, sx, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare namespace BarChart {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
export default BarChart;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ChartContainerProps {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
onRetry?: () => void;
|
|
6
|
+
empty?: boolean;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
height: number;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export default function ChartContainer({ loading, error, onRetry, empty, width, height, children, }: ChartContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface LegendItem {
|
|
2
|
+
label: string;
|
|
3
|
+
color: string;
|
|
4
|
+
}
|
|
5
|
+
interface ChartLegendProps {
|
|
6
|
+
items: LegendItem[];
|
|
7
|
+
/** Compact mode: smaller dots/font, tighter spacing, left-aligned */
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export default function ChartLegend({ items, compact }: ChartLegendProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentSize, SemanticColor } from '../types';
|
|
2
|
+
export interface GaugeCardProps {
|
|
3
|
+
value: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
label: string;
|
|
7
|
+
unit?: string;
|
|
8
|
+
color?: SemanticColor;
|
|
9
|
+
/** [warningAt, dangerAt] thresholds for auto-coloring */
|
|
10
|
+
thresholds?: [number, number];
|
|
11
|
+
size?: ComponentSize;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function GaugeCard({ value, min, max, label, unit, color, thresholds, size, loading, }: GaugeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace GaugeCard {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export default GaugeCard;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SemanticColor } from '../types';
|
|
3
|
+
import { TimeSeriesDef, ChartTimeRange, ChartAnnotation, ChartEventMarker, MetricFormat, RefreshInterval } from './types';
|
|
4
|
+
import { ChartMargin } from './TimeSeriesChart';
|
|
5
|
+
import { TimeRangePreset } from '../inputs/TimeRangePicker';
|
|
6
|
+
export interface MetricsPanelMenuItem {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface MetricsPanelProps {
|
|
11
|
+
title: string;
|
|
12
|
+
/** Small icon rendered before the title for quick scanning */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
/** Muted subtitle below title (e.g. "From Kubernetes Metrics Server") */
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
series: TimeSeriesDef[];
|
|
17
|
+
timeRange: ChartTimeRange;
|
|
18
|
+
onTimeRangeChange?: (range: ChartTimeRange) => void;
|
|
19
|
+
refreshInterval?: RefreshInterval;
|
|
20
|
+
onRefresh?: () => void;
|
|
21
|
+
valueFormat?: MetricFormat;
|
|
22
|
+
unit?: string;
|
|
23
|
+
valueFormatter?: (value: number | null) => string;
|
|
24
|
+
annotations?: ChartAnnotation[];
|
|
25
|
+
/** Lens-style vertical event markers at specific timestamps */
|
|
26
|
+
eventMarkers?: ChartEventMarker[];
|
|
27
|
+
area?: boolean;
|
|
28
|
+
presets?: TimeRangePreset[];
|
|
29
|
+
colors?: (SemanticColor | string)[];
|
|
30
|
+
/** @deprecated Use `toolbar` instead */
|
|
31
|
+
headerActions?: React.ReactNode;
|
|
32
|
+
/** Slot for icon buttons rendered in the header row */
|
|
33
|
+
toolbar?: React.ReactNode;
|
|
34
|
+
/** Three-dot menu items (top-right) */
|
|
35
|
+
menuItems?: MetricsPanelMenuItem[];
|
|
36
|
+
/** Position of the y-axis. Default: 'none' */
|
|
37
|
+
yAxisPosition?: 'left' | 'right' | 'none';
|
|
38
|
+
/** Position of the x-axis. Default: 'none' */
|
|
39
|
+
xAxisPosition?: 'bottom' | 'top' | 'none';
|
|
40
|
+
/** Override chart margins (space between SVG edge and axes). Partial — unset keys use defaults. */
|
|
41
|
+
margin?: ChartMargin;
|
|
42
|
+
/** Override y-axis width (space for tick labels). */
|
|
43
|
+
yAxisWidth?: number;
|
|
44
|
+
/** Override x-axis height (space for tick labels). */
|
|
45
|
+
xAxisHeight?: number;
|
|
46
|
+
/** Render y-axis labels inside the chart area (Grafana/Lens style). Default: true */
|
|
47
|
+
yAxisInline?: boolean;
|
|
48
|
+
/** Which side to render inline y-axis labels. Default: 'right' */
|
|
49
|
+
yAxisInlinePosition?: 'left' | 'right';
|
|
50
|
+
/** 'compact' = minimal padding, no outer border. Default: 'default' */
|
|
51
|
+
variant?: 'default' | 'compact';
|
|
52
|
+
height?: number;
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
error?: string;
|
|
55
|
+
onRetry?: () => void;
|
|
56
|
+
}
|
|
57
|
+
declare function MetricsPanel({ title, icon, subtitle, series, timeRange, onTimeRangeChange, refreshInterval, onRefresh, valueFormat, unit, valueFormatter, annotations, eventMarkers, area, presets, colors, headerActions, toolbar, menuItems, yAxisPosition, xAxisPosition, margin, yAxisWidth, xAxisHeight, yAxisInline, yAxisInlinePosition, variant, height, loading, error, onRetry, }: MetricsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare namespace MetricsPanel {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
export default MetricsPanel;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
import { BaseChartProps, CategoricalDatum } from './types';
|
|
3
|
+
export interface PieChartProps extends BaseChartProps {
|
|
4
|
+
data: CategoricalDatum[];
|
|
5
|
+
innerRadius?: number;
|
|
6
|
+
showLabels?: boolean;
|
|
7
|
+
colors?: (SemanticColor | string)[];
|
|
8
|
+
}
|
|
9
|
+
declare function PieChart({ data, innerRadius, showLabels, colors, size, height: heightOverride, loading, error, onRetry, skipAnimation, sx, }: PieChartProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare namespace PieChart {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
export default PieChart;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
import { BaseChartProps, MetricFormat } from './types';
|
|
3
|
+
export interface ScatterSeriesDef {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
data: Array<{
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
id?: string | number;
|
|
10
|
+
}>;
|
|
11
|
+
color?: SemanticColor | string;
|
|
12
|
+
}
|
|
13
|
+
export interface ScatterChartProps extends BaseChartProps {
|
|
14
|
+
series: ScatterSeriesDef[];
|
|
15
|
+
xAxisLabel?: string;
|
|
16
|
+
yAxisLabel?: string;
|
|
17
|
+
xFormat?: MetricFormat;
|
|
18
|
+
yFormat?: MetricFormat;
|
|
19
|
+
colors?: (SemanticColor | string)[];
|
|
20
|
+
}
|
|
21
|
+
declare function ScatterChart({ series, xAxisLabel, yAxisLabel, xFormat, yFormat, colors, size, height: heightOverride, loading, error, onRetry, skipAnimation, sx, }: ScatterChartProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare namespace ScatterChart {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
25
|
+
export default ScatterChart;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
export interface SparklineProps {
|
|
3
|
+
data: number[];
|
|
4
|
+
plotType?: 'line' | 'bar';
|
|
5
|
+
area?: boolean;
|
|
6
|
+
color?: SemanticColor | string;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
showTooltip?: boolean;
|
|
10
|
+
skipAnimation?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function Sparkline({ data, plotType, area, color, height, width, showTooltip, skipAnimation, }: SparklineProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare namespace Sparkline {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
export default Sparkline;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
import { BaseChartProps, TimeSeriesDef, ChartTimeRange, MetricFormat } from './types';
|
|
3
|
+
export interface StackedAreaChartProps extends BaseChartProps {
|
|
4
|
+
series: TimeSeriesDef[];
|
|
5
|
+
/** Horizontal reference line for capacity/limit */
|
|
6
|
+
capacity?: number;
|
|
7
|
+
timeRange?: ChartTimeRange;
|
|
8
|
+
valueFormat?: MetricFormat;
|
|
9
|
+
stacked?: boolean;
|
|
10
|
+
colors?: (SemanticColor | string)[];
|
|
11
|
+
/** Position of the y-axis. Default: 'left' */
|
|
12
|
+
yAxisPosition?: 'left' | 'right' | 'none';
|
|
13
|
+
}
|
|
14
|
+
declare function StackedAreaChart({ series, capacity, timeRange, valueFormat, unit, valueFormatter: customFormatter, stacked, colors, yAxisPosition, size, height: heightOverride, loading, error, onRetry, skipAnimation, sx, }: StackedAreaChartProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare namespace StackedAreaChart {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export default StackedAreaChart;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
import { BaseChartProps, TimeSeriesDef, ChartTimeRange, ChartAnnotation, ChartEventMarker, MetricFormat } from './types';
|
|
3
|
+
export interface ChartMargin {
|
|
4
|
+
top?: number;
|
|
5
|
+
right?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
left?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TimeSeriesChartProps extends BaseChartProps {
|
|
10
|
+
series: TimeSeriesDef[];
|
|
11
|
+
timeRange?: ChartTimeRange;
|
|
12
|
+
yAxisLabel?: string;
|
|
13
|
+
valueFormat?: MetricFormat;
|
|
14
|
+
annotations?: ChartAnnotation[];
|
|
15
|
+
area?: boolean;
|
|
16
|
+
grid?: boolean;
|
|
17
|
+
showLegend?: boolean;
|
|
18
|
+
showMarks?: boolean;
|
|
19
|
+
colors?: (SemanticColor | string)[];
|
|
20
|
+
/** Position of the y-axis. Default: 'left' */
|
|
21
|
+
yAxisPosition?: 'left' | 'right' | 'none';
|
|
22
|
+
/** Position of the x-axis. Default: 'bottom' */
|
|
23
|
+
xAxisPosition?: 'bottom' | 'top' | 'none';
|
|
24
|
+
/** Compact mode hides axis lines for embedded use */
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
/** Override chart margins (space between SVG border and axes). Partial — unset keys use defaults. */
|
|
27
|
+
margin?: ChartMargin;
|
|
28
|
+
/** Override y-axis width (space for tick labels). Default: 30 in compact, 40 otherwise. */
|
|
29
|
+
yAxisWidth?: number;
|
|
30
|
+
/** Override x-axis height (space for tick labels). Default: 20 in compact, 24 otherwise. */
|
|
31
|
+
xAxisHeight?: number;
|
|
32
|
+
/** Render y-axis labels inside the chart area (Grafana/Lens style). Hides the external y-axis. */
|
|
33
|
+
yAxisInline?: boolean;
|
|
34
|
+
/** Which side to render inline y-axis labels. Default: 'right' */
|
|
35
|
+
yAxisInlinePosition?: 'left' | 'right';
|
|
36
|
+
/** Lens-style vertical event markers at specific timestamps */
|
|
37
|
+
eventMarkers?: ChartEventMarker[];
|
|
38
|
+
}
|
|
39
|
+
declare function TimeSeriesChart({ series, timeRange, yAxisLabel, valueFormat, unit, valueFormatter: customFormatter, annotations, area, grid, showLegend, showMarks, colors, yAxisPosition, xAxisPosition, compact, margin: marginOverride, yAxisWidth: yAxisWidthOverride, xAxisHeight: xAxisHeightOverride, yAxisInline, yAxisInlinePosition, eventMarkers, size, height: heightOverride, loading, error, onRetry, skipAnimation, sx, }: TimeSeriesChartProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare namespace TimeSeriesChart {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
export default TimeSeriesChart;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MetricFormat } from './types';
|
|
2
|
+
/** Format bytes with auto-scaling (B → TiB). */
|
|
3
|
+
export declare function formatBytes(n: number, unit?: string): string;
|
|
4
|
+
/** Format a value as a percentage. */
|
|
5
|
+
export declare function formatPercent(v: number, unit?: string): string;
|
|
6
|
+
/** Format a duration in ms with auto-scaling. */
|
|
7
|
+
export declare function formatDuration(ms: number, unit?: string): string;
|
|
8
|
+
/** Format a rate (/s) with SI prefix. */
|
|
9
|
+
export declare function formatRate(v: number, unit?: string): string;
|
|
10
|
+
/** Format with SI prefix (1.2k, 3.4M, etc.). */
|
|
11
|
+
export declare function formatSI(v: number, unit?: string): string;
|
|
12
|
+
/** Format a number with locale-aware commas. */
|
|
13
|
+
export declare function formatNumber(v: number, unit?: string): string;
|
|
14
|
+
/** Format a Date for axis tick labels (HH:mm). */
|
|
15
|
+
export declare function formatTimeAxisTick(date: Date): string;
|
|
16
|
+
/** Returns the formatter function for a given MetricFormat preset. Handles null for MUI X compat. */
|
|
17
|
+
export declare function getValueFormatter(format: MetricFormat, unit?: string): (v: number | null) => string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { TimeSeriesPoint, TimeSeriesDef, CategoricalDatum, ChartAnnotation, ChartEventMarker, MetricFormat, ChartTimeRange, RefreshInterval, BaseChartProps, } from './types';
|
|
2
|
+
export { resolveChartColor, chartPalette } from './palette';
|
|
3
|
+
export { formatBytes, formatPercent, formatDuration, formatRate, formatSI, formatNumber, formatTimeAxisTick, getValueFormatter, } from './formatters';
|
|
4
|
+
export { useChartTheme } from './useChartTheme';
|
|
5
|
+
export type { ChartTheme } from './useChartTheme';
|
|
6
|
+
export { default as TimeSeriesChart } from './TimeSeriesChart';
|
|
7
|
+
export type { TimeSeriesChartProps, ChartMargin } from './TimeSeriesChart';
|
|
8
|
+
export { default as BarChart } from './BarChart';
|
|
9
|
+
export type { BarChartProps } from './BarChart';
|
|
10
|
+
export { default as PieChart } from './PieChart';
|
|
11
|
+
export type { PieChartProps } from './PieChart';
|
|
12
|
+
export { default as ScatterChart } from './ScatterChart';
|
|
13
|
+
export type { ScatterChartProps, ScatterSeriesDef } from './ScatterChart';
|
|
14
|
+
export { default as Sparkline } from './Sparkline';
|
|
15
|
+
export type { SparklineProps } from './Sparkline';
|
|
16
|
+
export { default as GaugeCard } from './GaugeCard';
|
|
17
|
+
export type { GaugeCardProps } from './GaugeCard';
|
|
18
|
+
export { default as MetricsPanel } from './MetricsPanel';
|
|
19
|
+
export type { MetricsPanelProps, MetricsPanelMenuItem } from './MetricsPanel';
|
|
20
|
+
export { default as StackedAreaChart } from './StackedAreaChart';
|
|
21
|
+
export type { StackedAreaChartProps } from './StackedAreaChart';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SemanticColor } from '../types';
|
|
2
|
+
/** Resolves a SemanticColor or raw CSS color string to a concrete color value. */
|
|
3
|
+
export declare function resolveChartColor(color: SemanticColor | string): string;
|
|
4
|
+
/** Flush cached color values (call on theme change). */
|
|
5
|
+
export declare function clearColorCache(): void;
|
|
6
|
+
/** Returns an array of resolved color strings for chart series. */
|
|
7
|
+
export declare function chartPalette(colors?: (SemanticColor | string)[]): string[];
|