@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.
Files changed (257) hide show
  1. package/LICENSE +661 -0
  2. package/dist/Button-Dmu1cikC.cjs +1 -0
  3. package/dist/Button-lr02bh_m.js +51 -0
  4. package/dist/CodeBlock-B1iQO7zU.js +73 -0
  5. package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
  6. package/dist/CopyButton-CACe3RCF.cjs +1 -0
  7. package/dist/CopyButton-DPBgL0K8.js +77 -0
  8. package/dist/ErrorState-CexYrMpy.js +188 -0
  9. package/dist/ErrorState-CnIR-1xa.cjs +1 -0
  10. package/dist/HotkeyHint-6SOi-MaU.js +37 -0
  11. package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
  12. package/dist/Icon-CKdIOrjZ.cjs +1 -0
  13. package/dist/Icon-CuO9W7cA.js +27 -0
  14. package/dist/SearchInput-CFBBNdI2.cjs +1 -0
  15. package/dist/SearchInput-D3AsCI5H.js +41 -0
  16. package/dist/Select-CnRBSc5w.cjs +1 -0
  17. package/dist/Select-DTUF31OP.js +206 -0
  18. package/dist/Skeleton-BUYyXUiC.js +32 -0
  19. package/dist/Skeleton-CfdQWLQM.cjs +1 -0
  20. package/dist/StatusDot-CYyJxjJK.cjs +1 -0
  21. package/dist/StatusDot-CncykBAY.js +68 -0
  22. package/dist/StatusPill-C1NaiCzd.js +29 -0
  23. package/dist/StatusPill-C7yn7dSA.cjs +1 -0
  24. package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
  25. package/dist/TabPanel-DLHbgKpl.js +124 -0
  26. package/dist/Text-By4P3in5.js +71 -0
  27. package/dist/Text-Mk6Uyg1w.cjs +1 -0
  28. package/dist/Tooltip-44-P5KfQ.cjs +1 -0
  29. package/dist/Tooltip-BEVuYuZ3.js +41 -0
  30. package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
  31. package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
  32. package/dist/buttons/ActionMenu.d.ts +21 -0
  33. package/dist/buttons/Button.d.ts +31 -0
  34. package/dist/buttons/ButtonGroup.d.ts +18 -0
  35. package/dist/buttons/ConfirmButton.d.ts +10 -0
  36. package/dist/buttons/CopyButton.d.ts +11 -0
  37. package/dist/buttons/IconButton.d.ts +21 -0
  38. package/dist/buttons/SearchBar.d.ts +22 -0
  39. package/dist/buttons/ToggleButton.d.ts +18 -0
  40. package/dist/buttons/ToggleGroup.d.ts +23 -0
  41. package/dist/buttons/Toolbar.d.ts +15 -0
  42. package/dist/buttons/ToolbarGroup.d.ts +11 -0
  43. package/dist/buttons/index.d.ts +22 -0
  44. package/dist/buttons.cjs +1 -0
  45. package/dist/buttons.js +430 -0
  46. package/dist/cells/BadgesCell.d.ts +19 -0
  47. package/dist/cells/ChipCell.d.ts +16 -0
  48. package/dist/cells/SelectBoxHeader.d.ts +11 -0
  49. package/dist/cells/SelectBoxRow.d.ts +11 -0
  50. package/dist/cells/TextCell.d.ts +25 -0
  51. package/dist/cells/index.d.ts +5 -0
  52. package/dist/cells.cjs +1 -0
  53. package/dist/cells.js +284 -0
  54. package/dist/charts/BarChart.d.ts +15 -0
  55. package/dist/charts/ChartContainer.d.ts +12 -0
  56. package/dist/charts/ChartLegend.d.ts +11 -0
  57. package/dist/charts/GaugeCard.d.ts +18 -0
  58. package/dist/charts/MetricsPanel.d.ts +61 -0
  59. package/dist/charts/PieChart.d.ts +13 -0
  60. package/dist/charts/ScatterChart.d.ts +25 -0
  61. package/dist/charts/Sparkline.d.ts +16 -0
  62. package/dist/charts/StackedAreaChart.d.ts +18 -0
  63. package/dist/charts/TimeSeriesChart.d.ts +43 -0
  64. package/dist/charts/formatters.d.ts +17 -0
  65. package/dist/charts/index.d.ts +21 -0
  66. package/dist/charts/palette.d.ts +7 -0
  67. package/dist/charts/types.d.ts +67 -0
  68. package/dist/charts/useChartTheme.d.ts +13 -0
  69. package/dist/charts.cjs +1 -0
  70. package/dist/charts.js +967 -0
  71. package/dist/components/ActionCard.d.ts +22 -0
  72. package/dist/components/AspectRatio.d.ts +13 -0
  73. package/dist/components/Avatar.d.ts +19 -0
  74. package/dist/components/Badge.d.ts +22 -0
  75. package/dist/components/Card.d.ts +24 -0
  76. package/dist/components/Chip.d.ts +32 -0
  77. package/dist/components/ClipboardText.d.ts +14 -0
  78. package/dist/components/DetailsCard.d.ts +25 -0
  79. package/dist/components/EmptySearch.d.ts +12 -0
  80. package/dist/components/ExpandableSections.d.ts +51 -0
  81. package/dist/components/FileIcon.d.ts +12 -0
  82. package/dist/components/HotkeyHint.d.ts +8 -0
  83. package/dist/components/Icon.d.ts +7 -0
  84. package/dist/components/InlineEdit.d.ts +14 -0
  85. package/dist/components/KVCard.d.ts +12 -0
  86. package/dist/components/Kbd.d.ts +8 -0
  87. package/dist/components/List.d.ts +29 -0
  88. package/dist/components/ListCard.d.ts +30 -0
  89. package/dist/components/ListItem.d.ts +27 -0
  90. package/dist/components/LoadingOverlay.d.ts +14 -0
  91. package/dist/components/MediaCard.d.ts +24 -0
  92. package/dist/components/MetricsSection.d.ts +37 -0
  93. package/dist/components/OverflowText.d.ts +12 -0
  94. package/dist/components/StatCard.d.ts +26 -0
  95. package/dist/components/StatusCard.d.ts +29 -0
  96. package/dist/components/TruncatedList.d.ts +13 -0
  97. package/dist/domain/DescriptionList.d.ts +12 -0
  98. package/dist/domain/EventsList.d.ts +11 -0
  99. package/dist/domain/FilterBar.d.ts +23 -0
  100. package/dist/domain/LogsViewer.d.ts +15 -0
  101. package/dist/domain/MetricCard.d.ts +14 -0
  102. package/dist/domain/ObjectInspector.d.ts +19 -0
  103. package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
  104. package/dist/domain/ResourceRef.d.ts +15 -0
  105. package/dist/domain/ResourceStatus.d.ts +17 -0
  106. package/dist/domain/SecretValueMask.d.ts +11 -0
  107. package/dist/domain/Timeline.d.ts +21 -0
  108. package/dist/domain/index.d.ts +23 -0
  109. package/dist/domain/types.d.ts +25 -0
  110. package/dist/domain.cjs +1 -0
  111. package/dist/domain.js +871 -0
  112. package/dist/editors/CodeEditor.d.ts +19 -0
  113. package/dist/editors/CommandPalette.d.ts +22 -0
  114. package/dist/editors/DiffViewer.d.ts +14 -0
  115. package/dist/editors/MarkdownPreview.d.ts +9 -0
  116. package/dist/editors/Terminal.d.ts +18 -0
  117. package/dist/editors/index.d.ts +11 -0
  118. package/dist/editors/themes.d.ts +4 -0
  119. package/dist/editors.cjs +42 -0
  120. package/dist/editors.js +38396 -0
  121. package/dist/feedback/Alert.d.ts +21 -0
  122. package/dist/feedback/ConnectionIndicator.d.ts +15 -0
  123. package/dist/feedback/EmptyState.d.ts +17 -0
  124. package/dist/feedback/ErrorState.d.ts +12 -0
  125. package/dist/feedback/IDEStatusFooter.d.ts +104 -0
  126. package/dist/feedback/NotificationStack.d.ts +32 -0
  127. package/dist/feedback/ProgressBar.d.ts +16 -0
  128. package/dist/feedback/ProgressRing.d.ts +26 -0
  129. package/dist/feedback/RunButton.d.ts +17 -0
  130. package/dist/feedback/Skeleton.d.ts +13 -0
  131. package/dist/feedback/StatusBar.d.ts +12 -0
  132. package/dist/feedback/StatusBarItem.d.ts +18 -0
  133. package/dist/feedback/StatusDot.d.ts +14 -0
  134. package/dist/feedback/StatusPill.d.ts +13 -0
  135. package/dist/feedback/index.d.ts +29 -0
  136. package/dist/feedback.cjs +1 -0
  137. package/dist/feedback.js +1011 -0
  138. package/dist/index.cjs +1 -0
  139. package/dist/index.d.ts +54 -0
  140. package/dist/index.js +1632 -0
  141. package/dist/inputs/Autocomplete.d.ts +30 -0
  142. package/dist/inputs/Checkbox.d.ts +17 -0
  143. package/dist/inputs/ColorPicker.d.ts +13 -0
  144. package/dist/inputs/DebouncedInput.d.ts +10 -0
  145. package/dist/inputs/FormField.d.ts +15 -0
  146. package/dist/inputs/FormSection.d.ts +14 -0
  147. package/dist/inputs/KeyValueEditor.d.ts +17 -0
  148. package/dist/inputs/RadioGroup.d.ts +23 -0
  149. package/dist/inputs/SearchInput.d.ts +14 -0
  150. package/dist/inputs/Select.d.ts +32 -0
  151. package/dist/inputs/Slider.d.ts +24 -0
  152. package/dist/inputs/Switch.d.ts +17 -0
  153. package/dist/inputs/TagInput.d.ts +18 -0
  154. package/dist/inputs/TextArea.d.ts +26 -0
  155. package/dist/inputs/TextField.d.ts +39 -0
  156. package/dist/inputs/TimeRangePicker.d.ts +21 -0
  157. package/dist/inputs/index.d.ts +31 -0
  158. package/dist/inputs.cjs +21 -0
  159. package/dist/inputs.js +15834 -0
  160. package/dist/layout/AppShell.d.ts +18 -0
  161. package/dist/layout/DockLayout.d.ts +23 -0
  162. package/dist/layout/Inline.d.ts +15 -0
  163. package/dist/layout/Panel.d.ts +17 -0
  164. package/dist/layout/ResizableSplitPane.d.ts +18 -0
  165. package/dist/layout/Spacer.d.ts +9 -0
  166. package/dist/layout/Stack.d.ts +19 -0
  167. package/dist/layout/index.d.ts +16 -0
  168. package/dist/layout/useResizablePanel.d.ts +18 -0
  169. package/dist/layout.cjs +5 -0
  170. package/dist/layout.js +378 -0
  171. package/dist/menus/ContextMenu.d.ts +12 -0
  172. package/dist/menus/DropdownMenu.d.ts +20 -0
  173. package/dist/menus/MenuBar.d.ts +11 -0
  174. package/dist/menus/NestedMenuItem.d.ts +13 -0
  175. package/dist/menus/SplitButton.d.ts +15 -0
  176. package/dist/menus/index.d.ts +11 -0
  177. package/dist/menus/types.d.ts +24 -0
  178. package/dist/menus.cjs +1 -0
  179. package/dist/menus.js +355 -0
  180. package/dist/navigation/Breadcrumbs.d.ts +18 -0
  181. package/dist/navigation/DraggableTabs.d.ts +24 -0
  182. package/dist/navigation/Pagination.d.ts +15 -0
  183. package/dist/navigation/PersistentTabPanel.d.ts +13 -0
  184. package/dist/navigation/Stepper.d.ts +19 -0
  185. package/dist/navigation/TabPanel.d.ts +11 -0
  186. package/dist/navigation/Tabs.d.ts +26 -0
  187. package/dist/navigation/TreeView.d.ts +27 -0
  188. package/dist/navigation/index.d.ts +16 -0
  189. package/dist/navigation.cjs +1 -0
  190. package/dist/navigation.js +429 -0
  191. package/dist/overlays/Dialog.d.ts +18 -0
  192. package/dist/overlays/Drawer.d.ts +17 -0
  193. package/dist/overlays/ErrorOverlay.d.ts +21 -0
  194. package/dist/overlays/Modal.d.ts +14 -0
  195. package/dist/overlays/NotificationCenter.d.ts +31 -0
  196. package/dist/overlays/Popover.d.ts +15 -0
  197. package/dist/overlays/Spotlight.d.ts +24 -0
  198. package/dist/overlays/ToastProvider.d.ts +32 -0
  199. package/dist/overlays/Tooltip.d.ts +15 -0
  200. package/dist/overlays/index.d.ts +20 -0
  201. package/dist/overlays/useToast.d.ts +21 -0
  202. package/dist/overlays.cjs +1 -0
  203. package/dist/overlays.js +865 -0
  204. package/dist/sidebars/ActivityBar.d.ts +16 -0
  205. package/dist/sidebars/NavMenu.d.ts +27 -0
  206. package/dist/sidebars/NavMenu.test.d.ts +1 -0
  207. package/dist/sidebars/PropertyGrid.d.ts +16 -0
  208. package/dist/sidebars/SidebarGroup.d.ts +15 -0
  209. package/dist/sidebars/SidebarPanel.d.ts +19 -0
  210. package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
  211. package/dist/sidebars/index.d.ts +13 -0
  212. package/dist/sidebars/types.d.ts +29 -0
  213. package/dist/sidebars.cjs +1 -0
  214. package/dist/sidebars.js +762 -0
  215. package/dist/table/ColumnFilter.d.ts +10 -0
  216. package/dist/table/DataTable.d.ts +23 -0
  217. package/dist/table/IDETable.d.ts +48 -0
  218. package/dist/table/TableEmptyState.d.ts +12 -0
  219. package/dist/table/TableSkeleton.d.ts +11 -0
  220. package/dist/table/TableToolbar.d.ts +15 -0
  221. package/dist/table/index.d.ts +12 -0
  222. package/dist/table/types.d.ts +4 -0
  223. package/dist/table.cjs +1 -0
  224. package/dist/table.js +580 -0
  225. package/dist/theme/AppTheme.d.ts +14 -0
  226. package/dist/theme/customizations/dataDisplay.d.ts +2 -0
  227. package/dist/theme/customizations/feedback.d.ts +2 -0
  228. package/dist/theme/customizations/inputs.d.ts +2 -0
  229. package/dist/theme/customizations/navigation.d.ts +2 -0
  230. package/dist/theme/index.d.ts +36 -0
  231. package/dist/theme/primitives.d.ts +234 -0
  232. package/dist/theme.cjs +1 -0
  233. package/dist/theme.js +1362 -0
  234. package/dist/tokens.css +252 -0
  235. package/dist/types/index.d.ts +7 -0
  236. package/dist/types/maps.d.ts +25 -0
  237. package/dist/types/variants.d.ts +21 -0
  238. package/dist/types.cjs +1 -0
  239. package/dist/types.js +96 -0
  240. package/dist/typography/CodeBlock.d.ts +15 -0
  241. package/dist/typography/CodeInline.d.ts +10 -0
  242. package/dist/typography/Heading.d.ts +13 -0
  243. package/dist/typography/Link.d.ts +18 -0
  244. package/dist/typography/Text.d.ts +22 -0
  245. package/dist/typography/index.d.ts +10 -0
  246. package/dist/typography.cjs +1 -0
  247. package/dist/typography.js +120 -0
  248. package/dist/ui.css +1 -0
  249. package/dist/units-BuBKbqQ7.js +54 -0
  250. package/dist/units-CDpdlN1W.cjs +1 -0
  251. package/dist/utils/index.d.ts +4 -0
  252. package/dist/utils/language.d.ts +4 -0
  253. package/dist/utils/time.d.ts +5 -0
  254. package/dist/utils/units.d.ts +7 -0
  255. package/dist/utils.cjs +1 -0
  256. package/dist/utils.js +78 -0
  257. package/package.json +261 -0
@@ -0,0 +1,67 @@
1
+ import { ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ import { SemanticColor, ComponentSize } from '../types';
4
+ /** A time-stamped data point */
5
+ export interface TimeSeriesPoint {
6
+ timestamp: number;
7
+ value: number;
8
+ }
9
+ /** A named series */
10
+ export interface TimeSeriesDef {
11
+ id: string;
12
+ label: string;
13
+ data: TimeSeriesPoint[];
14
+ color?: SemanticColor | string;
15
+ area?: boolean;
16
+ lineStyle?: 'solid' | 'dashed' | 'dotted';
17
+ }
18
+ /** Categorical data item for bar/pie */
19
+ export interface CategoricalDatum {
20
+ id: string;
21
+ label: string;
22
+ value: number;
23
+ color?: SemanticColor | string;
24
+ }
25
+ /** Vertical event marker at a specific timestamp (Lens-style) */
26
+ export interface ChartEventMarker {
27
+ /** Epoch ms or Date — position on the x-axis */
28
+ timestamp: number | Date;
29
+ /** Short label shown above the caret (e.g. "Deploy", "Restart") */
30
+ label?: string;
31
+ /** Semantic color or CSS color. Default: 'muted' */
32
+ color?: SemanticColor | string;
33
+ /** Line style. Default: 'dashed' */
34
+ lineStyle?: 'solid' | 'dashed';
35
+ /** Tooltip content shown on hover. Pass any ReactNode. */
36
+ tooltip?: ReactNode;
37
+ }
38
+ /** Horizontal reference/threshold line */
39
+ export interface ChartAnnotation {
40
+ value: number;
41
+ label?: string;
42
+ color?: SemanticColor | string;
43
+ lineStyle?: 'solid' | 'dashed';
44
+ }
45
+ /** Built-in value format presets (domain-agnostic) */
46
+ export type MetricFormat = 'bytes' | 'percent' | 'duration' | 'rate' | 'si' | 'number';
47
+ /** Time range */
48
+ export interface ChartTimeRange {
49
+ from: Date;
50
+ to: Date;
51
+ }
52
+ /** Auto-refresh intervals */
53
+ export type RefreshInterval = 0 | 5000 | 10000 | 15000 | 30000 | 60000;
54
+ /** Common props shared by all chart wrappers */
55
+ export interface BaseChartProps {
56
+ size?: ComponentSize;
57
+ height?: number;
58
+ loading?: boolean;
59
+ error?: string;
60
+ onRetry?: () => void;
61
+ skipAnimation?: boolean;
62
+ /** Custom unit suffix appended to formatted values (e.g., "MiB", "req/s") */
63
+ unit?: string;
64
+ /** Full custom value formatter, overrides valueFormat + unit */
65
+ valueFormatter?: (value: number | null) => string;
66
+ sx?: SxProps<Theme>;
67
+ }
@@ -0,0 +1,13 @@
1
+ export interface ChartTheme {
2
+ axisLineColor: string;
3
+ gridColor: string;
4
+ tooltipBg: string;
5
+ tooltipFg: string;
6
+ fontFamily: string;
7
+ fontSize: number;
8
+ areaOpacity: number;
9
+ }
10
+ /** Flush cached token values (call on theme change). */
11
+ export declare function clearTokenCache(): void;
12
+ /** Returns chart axis/grid/tooltip styling derived from --ov-* tokens. */
13
+ export declare function useChartTheme(): ChartTheme;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),De=require("@mui/material/styles"),o=require("react/jsx-runtime"),Le=require("react-dom"),j=require("@mui/material/Box"),Te=require("@mui/material/Popper"),xe=require("@mui/x-charts/LineChart"),ie=require("@mui/x-charts/ChartsReferenceLine"),Z=require("@mui/x-charts/hooks"),se=require("react-icons/lu"),le=require("./Skeleton-CfdQWLQM.cjs"),fe=require("./ErrorState-CnIR-1xa.cjs"),Fe=require("@mui/x-charts/BarChart"),Pe=require("@mui/x-charts/PieChart"),qe=require("@mui/x-charts/ScatterChart"),Ee=require("@mui/x-charts/SparkLineChart"),ce=require("@mui/material/Typography"),Be=require("@mui/x-charts/Gauge"),me=require("@mui/material/IconButton"),Ne=require("@mui/material/MenuItem"),He=require("@mui/material/Menu"),Ge=require("./Select-CnRBSc5w.cjs"),ge={primary:"--ov-accent",secondary:"--ov-fg-muted",success:"--ov-success-default",warning:"--ov-warning-default",error:"--ov-danger-default",info:"--ov-info-default",neutral:"--ov-fg-default",accent:"--ov-accent",danger:"--ov-danger-default",muted:"--ov-fg-muted"},Ie=new Set(Object.keys(ge)),ue=new Map;function $(e){const t=ue.get(e);if(t!==void 0)return t;let a;if(Ie.has(e)){const r=ge[e];typeof document<"u"?a=getComputedStyle(document.documentElement).getPropertyValue(r).trim()||`var(${r})`:a=`var(${r})`}else a=e;return ue.set(e,a),a}function We(){ue.clear()}const Ve=["primary","success","warning","info","error","secondary","accent","neutral"];function N(e){return(e&&e.length>0?e:Ve).map($)}const w=new Intl.NumberFormat(void 0,{maximumFractionDigits:1}),Oe=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"});function pe(e,t){const a=Math.abs(e);return a<1024?`${e} ${t??"B"}`:a<1024**2?`${w.format(e/1024)} ${t??"KiB"}`:a<1024**3?`${w.format(e/1024**2)} ${t??"MiB"}`:a<1024**4?`${w.format(e/1024**3)} ${t??"GiB"}`:`${w.format(e/1024**4)} ${t??"TiB"}`}function ve(e,t){return`${w.format(e)}${t??"%"}`}function ye(e,t){const a=Math.abs(e);return t?`${w.format(e)} ${t}`:a<1e3?`${w.format(e)} ms`:a<6e4?`${w.format(e/1e3)} s`:a<36e5?`${w.format(e/6e4)} m`:`${w.format(e/36e5)} h`}const Y=["","k","M","G","T","P"];function be(e,t){const a=Math.abs(e);let r=0,n=a;for(;n>=1e3&&r<Y.length-1;)n/=1e3,r++;return`${e<0?"-":""}${w.format(n)} ${Y[r]}${t??"/s"}`}function Ce(e,t){const a=Math.abs(e);let r=0,n=a;for(;n>=1e3&&r<Y.length-1;)n/=1e3,r++;const i=e<0?"-":"",s=t?` ${t}`:Y[r]?` ${Y[r]}`:"";return`${i}${w.format(n)}${s}`}function Se(e,t){const a=new Intl.NumberFormat(void 0).format(e);return t?`${a} ${t}`:a}function Re(e){return Oe.format(e)}function B(e,t){const a=(()=>{switch(e){case"bytes":return r=>pe(r,t);case"percent":return r=>ve(r,t);case"duration":return r=>ye(r,t);case"rate":return r=>be(r,t);case"si":return r=>Ce(r,t);case"number":return r=>Se(r,t)}})();return r=>r==null?"–":a(r)}const de=new Map;function R(e,t){if(typeof document>"u")return t;const a=de.get(e);if(a!==void 0)return a;const n=getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t;return de.set(e,n),n}function K(){const e=De.useTheme(),t=e.palette.mode==="dark";return l.useEffect(()=>{de.clear(),We()},[t]),l.useMemo(()=>({axisLineColor:R("--ov-border-default",t?"#3a3a3a":"#d4d4d4"),gridColor:R("--ov-border-subtle",t?"#2a2a2a":"#e8e8e8"),tooltipBg:R("--ov-bg-surface",t?"#1e1e1e":"#ffffff"),tooltipFg:R("--ov-fg-default",t?"#e0e0e0":"#1a1a1a"),fontFamily:R("--ov-font-sans",e.typography.fontFamily??"sans-serif"),fontSize:11,areaOpacity:.15}),[t,e.typography.fontFamily])}function X({loading:e,error:t,onRetry:a,empty:r,width:n,height:i,children:s}){return e?o.jsx(j,{sx:{width:n??"100%",height:i},children:o.jsx(le.Skeleton,{variant:"rectangular",width:"100%",height:i})}):t?o.jsx(j,{sx:{width:n??"100%",height:i,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(fe.ErrorState,{message:t,onRetry:a,variant:"panel"})}):r?o.jsx(j,{sx:{width:n??"100%",height:i,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(fe.EmptyState,{icon:o.jsx(se.LuChartBar,{size:32}),title:"No data",description:"There is no data to display.",size:"sm"})}):o.jsx(o.Fragment,{children:s})}const Ye={xs:120,sm:180,md:260,lg:360,xl:480};function Ke({markers:e}){const t=Z.useXScale(),{top:a}=Z.useDrawingArea(),[r,n]=l.useState(null),i=l.useCallback((c,m)=>{const v=m.currentTarget.getBoundingClientRect();n({index:c,anchor:{getBoundingClientRect:()=>v}})},[]),s=l.useCallback(()=>n(null),[]),d=r!=null?e[r.index]:null;return o.jsxs("g",{children:[e.map((c,m)=>{const v=c.timestamp instanceof Date?c.timestamp:new Date(c.timestamp),x=t(v);if(x==null||isNaN(x))return null;const y=$(c.color??"muted"),f=!!c.tooltip;return o.jsxs("g",{style:f?{cursor:"pointer"}:void 0,onPointerEnter:f?h=>i(m,h):void 0,onPointerLeave:f?s:void 0,children:[f&&o.jsx("rect",{x:x-16,y:a-(c.label?20:12),width:32,height:c.label?20:12,fill:"transparent"}),o.jsx("text",{x,y:a-1,textAnchor:"middle",fill:y,fontSize:8,children:"▼"}),c.label&&o.jsx("text",{x,y:a-9,textAnchor:"middle",fill:y,fontSize:9,fontWeight:500,children:c.label})]},`evt-${m}`)}),r&&d?.tooltip&&Le.createPortal(o.jsx(Te,{open:!0,anchorEl:r.anchor,placement:"top",modifiers:[{name:"offset",options:{offset:[0,6]}}],sx:{zIndex:1500,pointerEvents:"none"},children:o.jsx(j,{sx:{bgcolor:"var(--ov-bg-elevated, #1e1e2e)",color:"var(--ov-fg-default, #cdd6f4)",border:"1px solid var(--ov-border-subtle, #45475a)",borderRadius:"6px",px:1.25,py:.75,fontSize:"0.75rem",lineHeight:1.4,maxWidth:260,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:d.tooltip})}),document.body)]})}function Xe({formatter:e,color:t,position:a="right"}){const r=Z.useYScale(),{left:n,top:i,width:s,height:d}=Z.useDrawingArea(),c=r.ticks?.()??[],m=a==="right",v=m?n+s-4:n+4,x=m?"end":"start";return o.jsx("g",{children:c.map(y=>{const f=r(y);if(f==null||isNaN(f)||f<i-2||f>i+d+2)return null;const h=e(y);return o.jsx("text",{x:v,y:f-4,textAnchor:x,fill:t,fontSize:10,opacity:.7,children:h},y)})})}function he({series:e,timeRange:t,yAxisLabel:a,valueFormat:r="number",unit:n,valueFormatter:i,annotations:s,area:d=!1,grid:c=!0,showLegend:m=!1,showMarks:v=!1,colors:x,yAxisPosition:y="left",xAxisPosition:f="bottom",compact:h=!1,margin:g,yAxisWidth:p,xAxisHeight:A,yAxisInline:k=!1,yAxisInlinePosition:D="right",eventMarkers:b,size:F="md",height:S,loading:C,error:q,onRetry:H,skipAnimation:_=!1,sx:ee}){const L=K(),J=S??Ye[F],G=l.useMemo(()=>N(x),[x]),P=l.useMemo(()=>i??B(r,n),[i,r,n]),I=e.length===0||e.every(u=>u.data.length===0),{xData:te,alignedValues:W}=l.useMemo(()=>{if(e.length===0||e.every(z=>z.data.length===0))return{xData:[],alignedValues:e.map(()=>[])};const u=new Set;for(const z of e)for(const E of z.data)u.add(E.timestamp);const T=Array.from(u).sort((z,E)=>z-E),M=T.map(z=>new Date(z)),ne=e.map(z=>{const E=new Map;for(const U of z.data)E.set(U.timestamp,U.value);return T.map(U=>E.get(U)??null)});return{xData:M,alignedValues:ne}},[e]),V=l.useMemo(()=>e.map((u,T)=>({id:u.id,label:u.label,data:W[T]??[],color:u.color?$(u.color):G[T%G.length],area:u.area??d,showMark:v,valueFormatter:P,...u.lineStyle==="dashed"?{strokeDasharray:"6 3"}:{},...u.lineStyle==="dotted"?{strokeDasharray:"2 2"}:{}})),[e,W,d,v,P,G]),Q=h?{top:4,right:2,bottom:2,left:2}:{top:8,right:8,bottom:8,left:8},re=b?.length?b.some(u=>u.label)?20:10:0,oe={...Q,...g,top:(g?.top??Q.top)+re},O=k?0:p??(h?30:40),ae=A??(h?20:24);return o.jsx(j,{sx:ee,children:o.jsx(X,{loading:C,error:q,onRetry:H,empty:I,height:J,children:o.jsxs(xe.LineChart,{height:J,series:V,xAxis:[{data:te,scaleType:"time",height:ae,position:f,...t&&{min:t.from,max:t.to}}],yAxis:[{label:a,valueFormatter:P,position:y,width:O}],grid:c?{horizontal:!0}:void 0,skipAnimation:_,hideLegend:!m,margin:oe,sx:{"& .MuiChartsAxis-line":h?{display:"none"}:{stroke:L.axisLineColor},"& .MuiChartsAxis-tick":h?{display:"none"}:{stroke:L.axisLineColor},"& .MuiChartsAxis-tickLabel":{fill:L.tooltipFg,fontSize:L.fontSize},...k&&{"& .MuiChartsAxis-left, & .MuiChartsAxis-right":{display:"none"}},"& .MuiChartsGrid-line":{stroke:L.gridColor,opacity:.5},"& .MuiAreaElement-root":{opacity:L.areaOpacity}},children:[s?.map((u,T)=>o.jsx(ie.ChartsReferenceLine,{y:u.value,label:u.label,lineStyle:{stroke:u.color?$(u.color):"var(--ov-fg-muted)",strokeDasharray:u.lineStyle==="dashed"?"6 3":void 0},labelStyle:{fill:L.tooltipFg,fontSize:L.fontSize}},`ann-${T}`)),b?.map((u,T)=>o.jsx(ie.ChartsReferenceLine,{x:u.timestamp instanceof Date?u.timestamp:new Date(u.timestamp),lineStyle:{stroke:$(u.color??"muted"),strokeDasharray:u.lineStyle==="solid"?void 0:"4 3",strokeWidth:1}},`evt-line-${T}`)),b?.length&&o.jsx(Ke,{markers:b}),k&&o.jsx(Xe,{formatter:P,color:L.tooltipFg,position:D})]})})})}he.displayName="TimeSeriesChart";const Je={xs:120,sm:180,md:260,lg:360,xl:480};function Me({data:e,horizontal:t=!1,valueFormat:a="number",unit:r,valueFormatter:n,showLabels:i=!1,colors:s,size:d="md",height:c,loading:m,error:v,onRetry:x,skipAnimation:y=!1,sx:f}){const h=K(),g=c??Je[d],p=l.useMemo(()=>N(s),[s]),A=l.useMemo(()=>n??B(a,r),[n,a,r]),k=e.length===0,D=l.useMemo(()=>e.map((S,C)=>S.color?$(S.color):p[C%p.length]),[e,p]),b=l.useMemo(()=>e.map(S=>S.label),[e]),F=l.useMemo(()=>e.map(S=>S.value),[e]);return o.jsx(j,{sx:f,children:o.jsx(X,{loading:m,error:v,onRetry:x,empty:k,height:g,children:o.jsx(Fe.BarChart,{height:g,layout:t?"horizontal":"vertical",series:[{data:F,valueFormatter:A,label:i?"Value":void 0}],xAxis:t?[{valueFormatter:A}]:[{data:b,scaleType:"band"}],yAxis:t?[{data:b,scaleType:"band"}]:[{valueFormatter:A}],colors:D,skipAnimation:y,hideLegend:!0,sx:{"& .MuiChartsAxis-line":{stroke:h.axisLineColor},"& .MuiChartsAxis-tick":{stroke:h.axisLineColor},"& .MuiChartsAxis-tickLabel":{fill:h.tooltipFg,fontSize:h.fontSize}}})})})}Me.displayName="BarChart";const Qe={xs:120,sm:180,md:260,lg:360,xl:480};function je({data:e,innerRadius:t,showLabels:a=!1,colors:r,size:n="md",height:i,loading:s,error:d,onRetry:c,skipAnimation:m=!1,sx:v}){const x=i??Qe[n],y=l.useMemo(()=>N(r),[r]),f=e.length===0,h=l.useMemo(()=>e.map((g,p)=>({id:g.id,value:g.value,label:g.label,color:g.color?$(g.color):y[p%y.length]})),[e,y]);return o.jsx(j,{sx:v,children:o.jsx(X,{loading:s,error:d,onRetry:c,empty:f,height:x,children:o.jsx(Pe.PieChart,{height:x,series:[{data:h,innerRadius:t??0,arcLabel:a?g=>g.label??"":void 0}],skipAnimation:m})})})}je.displayName="PieChart";const Ue={xs:120,sm:180,md:260,lg:360,xl:480};function ke({series:e,xAxisLabel:t,yAxisLabel:a,xFormat:r="number",yFormat:n="number",colors:i,size:s="md",height:d,loading:c,error:m,onRetry:v,skipAnimation:x=!1,sx:y}){const f=K(),h=d??Ue[s],g=l.useMemo(()=>N(i),[i]),p=e.length===0||e.every(b=>b.data.length===0),A=l.useMemo(()=>B(r),[r]),k=l.useMemo(()=>B(n),[n]),D=l.useMemo(()=>e.map((b,F)=>({id:b.id,label:b.label,data:b.data.map((S,C)=>({x:S.x,y:S.y,id:S.id??C})),color:b.color?$(b.color):g[F%g.length]})),[e,g]);return o.jsx(j,{sx:y,children:o.jsx(X,{loading:c,error:m,onRetry:v,empty:p,height:h,children:o.jsx(qe.ScatterChart,{height:h,series:D,xAxis:[{label:t,valueFormatter:A}],yAxis:[{label:a,valueFormatter:k}],skipAnimation:x,sx:{"& .MuiChartsAxis-line":{stroke:f.axisLineColor},"& .MuiChartsAxis-tick":{stroke:f.axisLineColor},"& .MuiChartsAxis-tickLabel":{fill:f.tooltipFg,fontSize:f.fontSize}}})})})}ke.displayName="ScatterChart";const Ze={top:2,bottom:2,left:2,right:2};function Ae({data:e,plotType:t="line",area:a=!1,color:r="primary",height:n=40,width:i="100%",showTooltip:s=!1,skipAnimation:d=!1}){const c=$(r);return o.jsx(Ee.SparkLineChart,{data:e,plotType:t,area:a,height:n,width:typeof i=="number"?i:void 0,color:c,curve:"natural",margin:Ze,showTooltip:s,skipAnimation:d,sx:typeof i=="string"?{width:i}:void 0})}Ae.displayName="Sparkline";const _e={xs:80,sm:100,md:140,lg:180,xl:220};function et(e,t,a,r){const n=(e-t)/(a-t)*100;return n<r[0]?"success":n<r[1]?"warning":"danger"}function $e({value:e,min:t=0,max:a=100,label:r,unit:n,color:i,thresholds:s=[60,85],size:d="md",loading:c=!1}){const m=_e[d],v=l.useMemo(()=>$(i??et(e,t,a,s)),[i,e,t,a,s]);return c?o.jsxs(j,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)",display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[o.jsx(le.Skeleton,{variant:"circular",width:m,height:m}),o.jsx(le.Skeleton,{variant:"text",width:"60%"})]}):o.jsxs(j,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)",display:"flex",flexDirection:"column",alignItems:"center",gap:.5},children:[o.jsx(Be.Gauge,{value:e,valueMin:t,valueMax:a,startAngle:-110,endAngle:110,width:m,height:m,sx:{"& .MuiGauge-valueArc":{fill:v},"& .MuiGauge-referenceArc":{fill:"var(--ov-bg-surface-inset)"}},text:n?`${e}${n}`:`${e}`}),o.jsx(ce,{variant:"caption",sx:{fontSize:"0.6875rem",fontWeight:600,color:"var(--ov-fg-muted)",textTransform:"uppercase",letterSpacing:"0.04em",textAlign:"center"},children:r})]})}$e.displayName="GaugeCard";const tt=[{label:"15m",duration:900*1e3},{label:"1h",duration:3600*1e3},{label:"6h",duration:360*60*1e3},{label:"24h",duration:1440*60*1e3},{label:"7d",duration:10080*60*1e3}];function rt(e,t){const a=e.to.getTime()-e.from.getTime();let r=t[0],n=Math.abs(a-r.duration);for(const i of t){const s=Math.abs(a-i.duration);s<n&&(r=i,n=s)}return String(r.duration)}function ze({title:e,icon:t,subtitle:a,series:r,timeRange:n,onTimeRangeChange:i,refreshInterval:s=0,onRefresh:d,valueFormat:c="number",unit:m,valueFormatter:v,annotations:x,eventMarkers:y,area:f=!1,presets:h=tt,colors:g,headerActions:p,toolbar:A,menuItems:k,yAxisPosition:D="none",xAxisPosition:b="none",margin:F,yAxisWidth:S,xAxisHeight:C,yAxisInline:q=!0,yAxisInlinePosition:H,variant:_="default",height:ee=260,loading:L,error:J,onRetry:G}){const P=l.useRef(null),[I,te]=l.useState(s>0),[W,V]=l.useState(null),Q=_==="compact",re=l.useMemo(()=>rt(n,h),[n,h]),oe=l.useMemo(()=>h.map(M=>({value:String(M.duration),label:M.label})),[h]),O=l.useCallback(()=>{P.current&&(clearInterval(P.current),P.current=null)},[]);l.useEffect(()=>(O(),I&&s>0&&d&&(P.current=setInterval(d,s)),O),[I,s,d,O]);const ae=M=>{if(!i)return;const ne=Number(Array.isArray(M)?M[0]:M),z=new Date;i({from:new Date(z.getTime()-ne),to:z})},u=i||A||p||d,T=k&&k.length>0;return o.jsxs(j,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",...Q?{bgcolor:"transparent"}:{bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)",borderRadius:"8px"}},children:[o.jsxs(j,{sx:{display:"flex",alignItems:"center",gap:.75,px:1,py:.5,minHeight:32},children:[t&&o.jsx(j,{sx:{display:"flex",alignItems:"center",color:"var(--ov-fg-muted)",flexShrink:0},children:t}),o.jsxs(j,{sx:{minWidth:0,flex:1},children:[o.jsx(ce,{variant:"subtitle2",noWrap:!0,sx:{fontWeight:600,color:"var(--ov-fg-default)",fontSize:"0.75rem",lineHeight:1.2},children:e}),a&&o.jsx(ce,{variant:"caption",noWrap:!0,sx:{color:"var(--ov-fg-muted)",fontSize:"0.625rem",lineHeight:1.2,display:"block"},children:a})]}),u&&o.jsxs(j,{sx:{display:"flex",alignItems:"center",gap:.25,flexShrink:0},children:[i&&o.jsx(Ge.Select,{options:oe,value:re,onChange:ae,size:"xs"}),A,p,d&&o.jsx(me,{size:"small",onClick:()=>{s>0?te(M=>!M):d()},sx:{color:I?"var(--ov-accent)":"var(--ov-fg-muted)",p:.25},children:o.jsx(se.LuRefreshCw,{size:12})})]}),T&&o.jsxs(o.Fragment,{children:[o.jsx(me,{size:"small",onClick:M=>V(M.currentTarget),sx:{color:"var(--ov-fg-muted)",p:.25,flexShrink:0},children:o.jsx(se.LuEllipsisVertical,{size:13})}),o.jsx(He,{anchorEl:W,open:!!W,onClose:()=>V(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-subtle)",minWidth:140}}},children:k.map(M=>o.jsx(Ne,{onClick:()=>{V(null),M.onClick()},sx:{fontSize:"0.8125rem"},children:M.label},M.label))})]})]}),o.jsx(he,{series:r,timeRange:n,valueFormat:c,unit:m,valueFormatter:v,annotations:x,eventMarkers:y,area:f,colors:g,height:ee,loading:L,error:J,onRetry:G,skipAnimation:!0,yAxisPosition:D,xAxisPosition:b,margin:F,yAxisWidth:S,xAxisHeight:C,yAxisInline:q,yAxisInlinePosition:H,compact:!0,grid:!0})]})}ze.displayName="MetricsPanel";const ot={xs:120,sm:180,md:260,lg:360,xl:480};function we({series:e,capacity:t,timeRange:a,valueFormat:r="number",unit:n,valueFormatter:i,stacked:s=!0,colors:d,yAxisPosition:c="left",size:m="md",height:v,loading:x,error:y,onRetry:f,skipAnimation:h=!1,sx:g}){const p=K(),A=v??ot[m],k=l.useMemo(()=>N(d),[d]),D=l.useMemo(()=>i??B(r,n),[i,r,n]),b=e.length===0||e.every(C=>C.data.length===0),F=l.useMemo(()=>{for(const C of e)if(C.data.length>0)return C.data.map(q=>new Date(q.timestamp));return[]},[e]),S=l.useMemo(()=>e.map((C,q)=>({id:C.id,label:C.label,data:C.data.map(H=>H.value),color:C.color?$(C.color):k[q%k.length],area:!0,showMark:!1,stack:s?"total":void 0,valueFormatter:D})),[e,s,D,k]);return o.jsx(j,{sx:g,children:o.jsx(X,{loading:x,error:y,onRetry:f,empty:b,height:A,children:o.jsx(xe.LineChart,{height:A,series:S,xAxis:[{data:F,scaleType:"time",...a&&{min:a.from,max:a.to}}],yAxis:[{valueFormatter:D,position:c}],grid:{horizontal:!0},skipAnimation:h,hideLegend:!0,sx:{"& .MuiChartsAxis-line":{stroke:p.axisLineColor},"& .MuiChartsAxis-tick":{stroke:p.axisLineColor},"& .MuiChartsAxis-tickLabel":{fill:p.tooltipFg,fontSize:p.fontSize},"& .MuiChartsGrid-line":{stroke:p.gridColor},"& .MuiAreaElement-root":{opacity:p.areaOpacity}},children:t!=null&&o.jsx(ie.ChartsReferenceLine,{y:t,label:"Capacity",lineStyle:{stroke:$("danger"),strokeDasharray:"6 3"},labelStyle:{fill:p.tooltipFg,fontSize:p.fontSize}})})})})}we.displayName="StackedAreaChart";exports.BarChart=Me;exports.GaugeCard=$e;exports.MetricsPanel=ze;exports.PieChart=je;exports.ScatterChart=ke;exports.Sparkline=Ae;exports.StackedAreaChart=we;exports.TimeSeriesChart=he;exports.chartPalette=N;exports.formatBytes=pe;exports.formatDuration=ye;exports.formatNumber=Se;exports.formatPercent=ve;exports.formatRate=be;exports.formatSI=Ce;exports.formatTimeAxisTick=Re;exports.getValueFormatter=B;exports.resolveChartColor=$;exports.useChartTheme=K;