@omniviewdev/ui 0.1.9 → 0.1.11

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 (54) hide show
  1. package/dist/AppTheme-BakZ7ezV.cjs +1 -0
  2. package/dist/AppTheme-wAxlNjgN.js +291 -0
  3. package/dist/{CodeBlock-CIyG0DbW.cjs → CodeBlock-DTB_WsXQ.cjs} +1 -1
  4. package/dist/{CodeBlock-B1iQO7zU.js → CodeBlock-DV6CPG00.js} +1 -1
  5. package/dist/CopyButton-3fq1UAiv.cjs +1 -0
  6. package/dist/CopyButton-DWVcqdPe.js +78 -0
  7. package/dist/{ErrorState-CnIR-1xa.cjs → ErrorState-Cwwem5yh.cjs} +1 -1
  8. package/dist/{ErrorState-CexYrMpy.js → ErrorState-DNOrahZX.js} +1 -1
  9. package/dist/Select-BqA47TdK.cjs +1 -0
  10. package/dist/Select-D61fKI8Y.js +276 -0
  11. package/dist/{Tooltip-BEVuYuZ3.js → Tooltip-CZMOcjX7.js} +10 -10
  12. package/dist/Tooltip-oUFp4gNV.cjs +1 -0
  13. package/dist/buttons/IconButton.d.ts +1 -4
  14. package/dist/buttons.cjs +1 -1
  15. package/dist/buttons.js +2 -2
  16. package/dist/charts.cjs +1 -1
  17. package/dist/charts.js +2 -2
  18. package/dist/domain.cjs +1 -1
  19. package/dist/domain.js +3 -3
  20. package/dist/editors/index.d.ts +1 -1
  21. package/dist/editors/themes.d.ts +13 -0
  22. package/dist/editors.cjs +26 -26
  23. package/dist/editors.js +3860 -3791
  24. package/dist/feedback.cjs +1 -1
  25. package/dist/feedback.js +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/inputs.cjs +1 -1
  29. package/dist/inputs.js +1 -1
  30. package/dist/overlays.cjs +1 -1
  31. package/dist/overlays.js +1 -1
  32. package/dist/theme/AppTheme.d.ts +11 -2
  33. package/dist/theme/customizations/dataDisplay.d.ts +11 -0
  34. package/dist/theme/customizations/feedback.d.ts +6 -0
  35. package/dist/theme/customizations/inputs.d.ts +7 -0
  36. package/dist/theme/customizations/navigation.d.ts +7 -0
  37. package/dist/theme/index.d.ts +10 -5
  38. package/dist/theme/registry/init.d.ts +1 -0
  39. package/dist/theme/registry/registry.d.ts +9 -0
  40. package/dist/theme/registry/types.d.ts +19 -0
  41. package/dist/theme/registry/variants/default/index.d.ts +2 -0
  42. package/dist/theme/registry/variants/solarized/index.d.ts +2 -0
  43. package/dist/theme/registry/variants/solarized/palettes.d.ts +147 -0
  44. package/dist/theme.cjs +1 -1
  45. package/dist/theme.js +1250 -1275
  46. package/dist/tokens.css +116 -0
  47. package/dist/typography.cjs +1 -1
  48. package/dist/typography.js +1 -1
  49. package/package.json +1 -1
  50. package/dist/CopyButton-CACe3RCF.cjs +0 -1
  51. package/dist/CopyButton-DPBgL0K8.js +0 -77
  52. package/dist/Select-CnRBSc5w.cjs +0 -1
  53. package/dist/Select-DTUF31OP.js +0 -206
  54. package/dist/Tooltip-44-P5KfQ.cjs +0 -1
@@ -0,0 +1,276 @@
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import { useState as w, useMemo as K } from "react";
3
+ import R from "@mui/material/Select";
4
+ import M from "@mui/material/MenuItem";
5
+ import U from "@mui/material/FormControl";
6
+ import V from "@mui/material/InputLabel";
7
+ import G from "@mui/material/FormHelperText";
8
+ import _ from "@mui/material/ListItemIcon";
9
+ import q from "@mui/material/ListItemText";
10
+ import J from "@mui/material/CircularProgress";
11
+ import Q from "@mui/material/OutlinedInput";
12
+ import X from "@mui/material/InputBase";
13
+ import Y from "@mui/material/Chip";
14
+ import m from "@mui/material/Box";
15
+ import Z from "@mui/icons-material/Search";
16
+ import $ from "@mui/icons-material/Clear";
17
+ import { INPUT_HEIGHTS as oo, toMuiInputSize as eo, toMuiColor as to } from "./types.js";
18
+ function ro({
19
+ options: g,
20
+ value: h,
21
+ onChange: f,
22
+ size: v = "md",
23
+ color: E = "neutral",
24
+ label: u,
25
+ helperText: P,
26
+ placeholder: n,
27
+ searchable: c = !1,
28
+ multiple: x = !1,
29
+ loading: C = !1,
30
+ error: d,
31
+ fullWidth: H,
32
+ disabled: T,
33
+ clearable: L = !1,
34
+ sx: A
35
+ }) {
36
+ const [I, k] = w(""), [O, D] = w(!1), [a, l] = w(-1), F = eo(v), y = to(E), W = typeof d == "string" ? !!d : d, z = typeof d == "string" ? d : void 0, S = () => {
37
+ D(!1), l(-1), c && k("");
38
+ }, i = K(() => {
39
+ if (!c || !I) return g;
40
+ const o = I.toLowerCase();
41
+ return g.filter((e) => e.label.toLowerCase().includes(o));
42
+ }, [g, I, c]), N = (o) => {
43
+ f(o.target.value);
44
+ }, j = (o) => {
45
+ if (o.key === "Escape") {
46
+ S();
47
+ return;
48
+ }
49
+ if (o.key === "ArrowDown") {
50
+ if (o.preventDefault(), o.stopPropagation(), i.length === 0) return;
51
+ const e = a + 1;
52
+ l(e >= i.length ? 0 : e);
53
+ return;
54
+ }
55
+ if (o.key === "ArrowUp") {
56
+ o.preventDefault(), o.stopPropagation();
57
+ const e = a - 1;
58
+ l(e < 0 ? i.length - 1 : e);
59
+ return;
60
+ }
61
+ if (o.key === "Enter" && a >= 0 && a < i.length) {
62
+ o.preventDefault(), o.stopPropagation();
63
+ const e = i[a];
64
+ if (!e.disabled)
65
+ if (x) {
66
+ const r = Array.isArray(h) ? h : [], b = r.includes(e.value) ? r.filter((s) => s !== e.value) : [...r, e.value];
67
+ f(b);
68
+ } else
69
+ f(e.value), S();
70
+ return;
71
+ }
72
+ o.stopPropagation();
73
+ };
74
+ return /* @__PURE__ */ p(
75
+ U,
76
+ {
77
+ size: F,
78
+ fullWidth: H,
79
+ error: W,
80
+ disabled: T,
81
+ style: { "--ov-input-height": oo[v] },
82
+ sx: A,
83
+ children: [
84
+ u && /* @__PURE__ */ t(
85
+ V,
86
+ {
87
+ color: y === "default" || y === "inherit" ? void 0 : y,
88
+ shrink: !!n || void 0,
89
+ children: u
90
+ }
91
+ ),
92
+ /* @__PURE__ */ p(
93
+ R,
94
+ {
95
+ value: h,
96
+ onChange: N,
97
+ multiple: x,
98
+ displayEmpty: !!n,
99
+ label: u,
100
+ notched: u && !!n || void 0,
101
+ input: x ? /* @__PURE__ */ t(Q, { label: u }) : void 0,
102
+ open: O,
103
+ onOpen: () => {
104
+ D(!0), l(-1);
105
+ },
106
+ onClose: S,
107
+ renderValue: x ? (o) => {
108
+ const e = o;
109
+ return e.length === 0 && n ? /* @__PURE__ */ t(m, { sx: { color: "var(--ov-fg-faint)" }, children: n }) : /* @__PURE__ */ p(
110
+ m,
111
+ {
112
+ sx: {
113
+ display: "flex",
114
+ flexWrap: "nowrap",
115
+ gap: 0.5,
116
+ overflow: "hidden",
117
+ alignItems: "center"
118
+ },
119
+ children: [
120
+ e.map((r) => {
121
+ const b = g.find((s) => s.value === r);
122
+ return /* @__PURE__ */ t(
123
+ Y,
124
+ {
125
+ label: b?.label ?? r,
126
+ size: "small",
127
+ ...L ? {
128
+ onDelete: (s) => {
129
+ s.stopPropagation(), f(e.filter((B) => B !== r));
130
+ },
131
+ onMouseDown: (s) => {
132
+ s.stopPropagation();
133
+ }
134
+ } : {}
135
+ },
136
+ r
137
+ );
138
+ }),
139
+ L && e.length > 1 && /* @__PURE__ */ t(
140
+ "button",
141
+ {
142
+ type: "button",
143
+ "aria-label": "Clear all",
144
+ onClick: (r) => {
145
+ r.stopPropagation(), f([]);
146
+ },
147
+ style: {
148
+ display: "inline-flex",
149
+ alignItems: "center",
150
+ flexShrink: 0,
151
+ marginLeft: 2,
152
+ cursor: "pointer",
153
+ color: "var(--ov-fg-faint)",
154
+ lineHeight: 0,
155
+ background: "none",
156
+ border: "none",
157
+ padding: 0
158
+ },
159
+ children: /* @__PURE__ */ t($, { sx: { fontSize: 16 } })
160
+ }
161
+ )
162
+ ]
163
+ }
164
+ );
165
+ } : n && !h ? () => /* @__PURE__ */ t(m, { sx: { color: "var(--ov-fg-faint)" }, children: n }) : void 0,
166
+ MenuProps: {
167
+ PaperProps: {
168
+ sx: {
169
+ maxHeight: 300,
170
+ ...v === "xs" || v === "sm" ? {
171
+ "& .MuiMenuItem-root": {
172
+ fontSize: "0.8rem",
173
+ minHeight: 28,
174
+ padding: "3px 8px"
175
+ },
176
+ "& .MuiListItemText-root": {
177
+ margin: 0
178
+ },
179
+ "& .MuiListItemText-primary": {
180
+ fontSize: "0.8rem"
181
+ },
182
+ "& .MuiListItemIcon-root": {
183
+ minWidth: 22
184
+ }
185
+ } : {}
186
+ }
187
+ }
188
+ },
189
+ children: [
190
+ c && /* @__PURE__ */ t(
191
+ m,
192
+ {
193
+ sx: { px: 1, pb: 0.5, pt: 0.5 },
194
+ onClickCapture: (o) => o.stopPropagation(),
195
+ onMouseDown: (o) => o.stopPropagation(),
196
+ children: /* @__PURE__ */ p(
197
+ m,
198
+ {
199
+ sx: {
200
+ display: "flex",
201
+ alignItems: "center",
202
+ height: 28,
203
+ border: "1px solid var(--ov-border-default)",
204
+ borderRadius: "4px",
205
+ bgcolor: "var(--ov-bg-base)",
206
+ px: 0.75,
207
+ "&:focus-within": { borderColor: "var(--ov-accent)" }
208
+ },
209
+ children: [
210
+ /* @__PURE__ */ t(
211
+ Z,
212
+ {
213
+ sx: { fontSize: 14, color: "var(--ov-fg-faint)", mr: 0.5 }
214
+ }
215
+ ),
216
+ /* @__PURE__ */ t(
217
+ X,
218
+ {
219
+ autoFocus: !0,
220
+ fullWidth: !0,
221
+ placeholder: "Search...",
222
+ value: I,
223
+ onChange: (o) => {
224
+ k(o.target.value), l(-1);
225
+ },
226
+ onKeyDown: j,
227
+ sx: {
228
+ flex: 1,
229
+ fontSize: "0.75rem",
230
+ color: "var(--ov-fg-default)",
231
+ "& input": { py: 0, px: 0 },
232
+ "& input::placeholder": {
233
+ color: "var(--ov-fg-faint)",
234
+ opacity: 1
235
+ }
236
+ }
237
+ }
238
+ )
239
+ ]
240
+ }
241
+ )
242
+ }
243
+ ),
244
+ C && /* @__PURE__ */ p(M, { disabled: !0, children: [
245
+ /* @__PURE__ */ t(J, { size: 16, sx: { mr: 1 } }),
246
+ " Loading..."
247
+ ] }),
248
+ i.map((o, e) => /* @__PURE__ */ p(
249
+ M,
250
+ {
251
+ value: o.value,
252
+ disabled: o.disabled,
253
+ ...c ? {
254
+ onMouseEnter: () => l(e),
255
+ sx: e === a ? { bgcolor: "action.focus" } : void 0
256
+ } : {},
257
+ children: [
258
+ o.icon && /* @__PURE__ */ t(_, { sx: { minWidth: 28 }, children: o.icon }),
259
+ /* @__PURE__ */ t(q, { children: o.label })
260
+ ]
261
+ },
262
+ o.value
263
+ )),
264
+ i.length === 0 && !C && /* @__PURE__ */ t(M, { disabled: !0, children: "No options" })
265
+ ]
266
+ }
267
+ ),
268
+ (z || P) && /* @__PURE__ */ t(G, { children: z ?? P })
269
+ ]
270
+ }
271
+ );
272
+ }
273
+ ro.displayName = "Select";
274
+ export {
275
+ ro as S
276
+ };
@@ -1,20 +1,20 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import x from "@mui/material/Tooltip";
3
- import n from "@mui/material/Box";
3
+ import i from "@mui/material/Box";
4
4
  function a({
5
- title: e,
6
- content: l,
5
+ title: l,
6
+ content: n,
7
7
  variant: o = "default",
8
8
  placement: p = "top",
9
9
  delay: r,
10
10
  children: s
11
11
  }) {
12
- const i = e ?? l ?? "";
13
- return /* @__PURE__ */ t(
12
+ const t = l ?? n ?? "";
13
+ return /* @__PURE__ */ e(
14
14
  x,
15
15
  {
16
- title: o === "code" ? /* @__PURE__ */ t(
17
- n,
16
+ title: o === "code" ? /* @__PURE__ */ e(
17
+ i,
18
18
  {
19
19
  sx: {
20
20
  fontFamily: "var(--ov-font-mono)",
@@ -24,9 +24,9 @@ function a({
24
24
  py: 0.5,
25
25
  borderRadius: "3px"
26
26
  },
27
- children: i
27
+ children: t
28
28
  }
29
- ) : o === "rich" ? /* @__PURE__ */ t(n, { sx: { p: 1, maxWidth: 320 }, children: i }) : e,
29
+ ) : o === "rich" ? /* @__PURE__ */ e(i, { sx: { p: 1, maxWidth: 320 }, children: t }) : t,
30
30
  placement: p,
31
31
  enterDelay: r,
32
32
  enterNextDelay: r,
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("@mui/material/Tooltip"),i=require("@mui/material/Box");function s({title:n,content:l,variant:o="default",placement:c="top",delay:r,children:x}){const t=n??l??"",u=o==="code"?e.jsx(i,{sx:{fontFamily:"var(--ov-font-mono)",fontSize:"var(--ov-text-xs)",bgcolor:"var(--ov-bg-surface-inset)",px:1,py:.5,borderRadius:"3px"},children:t}):o==="rich"?e.jsx(i,{sx:{p:1,maxWidth:320},children:t}):t;return e.jsx(p,{title:u,placement:c,enterDelay:r,enterNextDelay:r,arrow:o==="default",children:x})}s.displayName="Tooltip";exports.Tooltip=s;
@@ -14,8 +14,5 @@ export interface IconButtonProps {
14
14
  title?: string;
15
15
  sx?: SxProps<Theme>;
16
16
  }
17
- declare function IconButton({ children, color, emphasis, size, shape, loading, disabled, onClick, title, sx, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
18
- declare namespace IconButton {
19
- var displayName: string;
20
- }
17
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
21
18
  export default IconButton;
package/dist/buttons.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Button-Dmu1cikC.cjs"),B=require("./CopyButton-CACe3RCF.cjs"),o=require("react/jsx-runtime"),g=require("react"),O=require("@mui/material/Popover"),m=require("@mui/material/Box"),z=require("@mui/material/Typography"),w=require("@mui/material/Menu"),N=require("@mui/material/MenuItem"),E=require("@mui/material/ListItemIcon"),$=require("@mui/material/ListItemText"),D=require("@mui/material/Divider"),K=require("@mui/icons-material/MoreVert"),W=require("@mui/material/ButtonGroup"),d=require("./types.cjs"),v=require("@mui/material/IconButton"),C=require("@mui/material/Tooltip"),F=require("@mui/material/ToggleButton"),U=require("@mui/material/ToggleButtonGroup"),V=require("@mui/material/InputBase"),P=require("@mui/icons-material/Search"),b=require("react-icons/lu");function q({onConfirm:n,confirmMessage:e="Are you sure?",children:c,...t}){const[s,i]=g.useState(!1),a=g.useRef(null);return o.jsxs(o.Fragment,{children:[o.jsx(m,{component:"span",ref:a,sx:{display:"inline-flex"},children:o.jsx(y.Button,{...t,onClick:()=>i(!0),children:c})}),o.jsxs(O,{open:s,anchorEl:a.current,onClose:()=>i(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},slotProps:{paper:{sx:{p:2,mt:.5,minWidth:200,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:[o.jsx(z,{variant:"body2",sx:{color:"var(--ov-fg-default)",mb:1.5},children:e}),o.jsxs(m,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[o.jsx(y.Button,{size:"xs",emphasis:"ghost",color:"neutral",onClick:()=>i(!1),children:"Cancel"}),o.jsx(y.Button,{size:"xs",emphasis:"solid",color:"danger",onClick:()=>{i(!1),n()},children:"Confirm"})]})]})]})}q.displayName="ConfirmButton";function S({items:n,trigger:e,size:c="sm"}){const[t,s]=g.useState(!1),i=g.useRef(null),a=()=>s(!1);return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:i,children:e?o.jsx("span",{onClick:()=>s(!0),style:{cursor:"pointer"},children:e}):o.jsx(B.IconButton,{size:c,color:"neutral",onClick:()=>s(!0),"aria-label":"Actions",children:o.jsx(K,{fontSize:"inherit"})})}),o.jsx(w,{open:t,anchorEl:i.current,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:n.map(r=>[o.jsxs(N,{disabled:r.disabled,onClick:()=>{a(),r.onClick()},sx:{fontSize:"var(--ov-text-sm)",color:r.color==="danger"||r.color==="error"?"var(--ov-danger-default)":"var(--ov-fg-default)"},children:[r.icon&&o.jsx(E,{sx:{color:"inherit",minWidth:28},children:r.icon}),o.jsx($,{children:r.label})]},r.key),r.dividerAfter&&o.jsx(D,{},`${r.key}-divider`)])})]})}S.displayName="ActionMenu";function k({children:n,emphasis:e="outline",size:c="sm",color:t="neutral",fullWidth:s,orientation:i="horizontal",disabled:a,sx:r}){const p=d.toMuiColor(t),u=d.toMuiVariant(e),l=d.toMuiSize(c);return o.jsx(W,{color:p,variant:u,size:l,fullWidth:s,orientation:i,disabled:a,sx:r,children:n})}k.displayName="ButtonGroup";const _={default:36,dense:28};function M({children:n,variant:e="default",dividers:c=!1,sx:t}){const s=_[e];return o.jsx(m,{sx:{display:"flex",alignItems:"center",height:s,gap:c?0:.5,px:.5,bgcolor:"var(--ov-bg-surface)",...c&&{"& > *:not(:last-child)::after":{content:'""',display:"block",width:"1px",height:"60%",bgcolor:"var(--ov-border-muted)",ml:.5,mr:.5,flexShrink:0}},...typeof t=="object"&&!Array.isArray(t)?t:{}},children:n})}M.displayName="Toolbar";function T({children:n,sx:e}){return o.jsx(m,{sx:{display:"flex",alignItems:"center",gap:"2px",...typeof e=="object"&&!Array.isArray(e)?e:{}},children:n})}T.displayName="ToolbarGroup";function A({selected:n,onChange:e,icon:c,label:t,size:s="sm",color:i="primary",disabled:a,sx:r}){const p=d.toMuiSize(s),u=d.toCssColor(i),l=o.jsx(v,{size:p,disabled:a,onClick:()=>e(!n),sx:{borderRadius:"4px",color:n?u:"var(--ov-fg-muted)",bgcolor:n?"var(--ov-state-hover)":"transparent","&:hover":{bgcolor:"var(--ov-state-hover)"},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:c});return t?o.jsx(C,{title:t,children:l}):l}A.displayName="ToggleButton";function I({value:n,onChange:e,options:c,exclusive:t=!0,size:s="sm",color:i="primary",sx:a}){const r=d.toMuiSize(s),p=d.toCssColor(i),u=(l,x)=>{x!==null&&e(x)};return o.jsx(U,{value:n,exclusive:t,onChange:u,size:r,sx:{"& .Mui-selected":{color:`${p} !important`,bgcolor:"var(--ov-state-hover) !important"},...typeof a=="object"&&!Array.isArray(a)?a:{}},children:c.map(l=>o.jsxs(F,{value:l.key,disabled:l.disabled,sx:{fontSize:"var(--ov-text-sm)",textTransform:"none",px:1.5,gap:.5},children:[l.icon,l.label]},l.key))})}I.displayName="ToggleGroup";const H={xs:24,sm:28,md:32,lg:36,xl:40};function G({value:n,onChange:e,placeholder:c="Search...",regex:t,caseSensitive:s,onRegexChange:i,onCaseSensitiveChange:a,matchCount:r,currentMatch:p,onNext:u,onPrev:l,size:x="sm",sx:j}){const R=H[x],h=x==="xs"?12:14,L=g.useCallback(f=>{f.key==="Enter"&&(f.shiftKey?l?.():u?.()),f.key==="Escape"&&f.target.blur()},[u,l]);return o.jsxs(m,{sx:{display:"flex",alignItems:"center",height:R,border:"1px solid var(--ov-border-default)",borderRadius:"4px",bgcolor:"var(--ov-bg-surface)",px:.5,gap:"2px","&:focus-within":{borderColor:"var(--ov-accent)"},...typeof j=="object"&&!Array.isArray(j)?j:{}},children:[o.jsx(P,{sx:{fontSize:h+2,color:"var(--ov-fg-muted)",ml:.25}}),o.jsx(V,{value:n,onChange:f=>e(f.target.value),onKeyDown:L,placeholder:c,sx:{flex:1,fontSize:x==="xs"?"var(--ov-text-xs)":"var(--ov-text-sm)",color:"var(--ov-fg-default)","& input":{py:0,px:.5},"& input::placeholder":{color:"var(--ov-fg-faint)",opacity:1}}}),a&&o.jsx(C,{title:"Match Case",children:o.jsx(v,{size:"small",onClick:()=>a(!s),sx:{borderRadius:"3px",p:"2px",color:s?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:s?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuCaseSensitive,{size:h})})}),i&&o.jsx(C,{title:"Use Regular Expression",children:o.jsx(v,{size:"small",onClick:()=>i(!t),sx:{borderRadius:"3px",p:"2px",color:t?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:t?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuRegex,{size:h})})}),r!==void 0&&o.jsx(z,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",whiteSpace:"nowrap",px:.5},children:r===0?"No results":`${(p??0)+1}/${r}`}),l&&o.jsx(v,{size:"small",onClick:l,sx:{p:"2px"},children:o.jsx(b.LuChevronUp,{size:h})}),u&&o.jsx(v,{size:"small",onClick:u,sx:{p:"2px"},children:o.jsx(b.LuChevronDown,{size:h})})]})}G.displayName="SearchBar";exports.Button=y.Button;exports.CopyButton=B.CopyButton;exports.IconButton=B.IconButton;exports.ActionMenu=S;exports.ButtonGroup=k;exports.ConfirmButton=q;exports.SearchBar=G;exports.ToggleButton=A;exports.ToggleGroup=I;exports.Toolbar=M;exports.ToolbarGroup=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./Button-Dmu1cikC.cjs"),B=require("./CopyButton-3fq1UAiv.cjs"),o=require("react/jsx-runtime"),g=require("react"),O=require("@mui/material/Popover"),m=require("@mui/material/Box"),z=require("@mui/material/Typography"),w=require("@mui/material/Menu"),N=require("@mui/material/MenuItem"),E=require("@mui/material/ListItemIcon"),$=require("@mui/material/ListItemText"),D=require("@mui/material/Divider"),K=require("@mui/icons-material/MoreVert"),W=require("@mui/material/ButtonGroup"),d=require("./types.cjs"),v=require("@mui/material/IconButton"),C=require("@mui/material/Tooltip"),F=require("@mui/material/ToggleButton"),U=require("@mui/material/ToggleButtonGroup"),V=require("@mui/material/InputBase"),P=require("@mui/icons-material/Search"),b=require("react-icons/lu");function q({onConfirm:n,confirmMessage:e="Are you sure?",children:c,...t}){const[s,i]=g.useState(!1),a=g.useRef(null);return o.jsxs(o.Fragment,{children:[o.jsx(m,{component:"span",ref:a,sx:{display:"inline-flex"},children:o.jsx(y.Button,{...t,onClick:()=>i(!0),children:c})}),o.jsxs(O,{open:s,anchorEl:a.current,onClose:()=>i(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},slotProps:{paper:{sx:{p:2,mt:.5,minWidth:200,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:[o.jsx(z,{variant:"body2",sx:{color:"var(--ov-fg-default)",mb:1.5},children:e}),o.jsxs(m,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[o.jsx(y.Button,{size:"xs",emphasis:"ghost",color:"neutral",onClick:()=>i(!1),children:"Cancel"}),o.jsx(y.Button,{size:"xs",emphasis:"solid",color:"danger",onClick:()=>{i(!1),n()},children:"Confirm"})]})]})]})}q.displayName="ConfirmButton";function S({items:n,trigger:e,size:c="sm"}){const[t,s]=g.useState(!1),i=g.useRef(null),a=()=>s(!1);return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:i,children:e?o.jsx("span",{onClick:()=>s(!0),style:{cursor:"pointer"},children:e}):o.jsx(B.IconButton,{size:c,color:"neutral",onClick:()=>s(!0),"aria-label":"Actions",children:o.jsx(K,{fontSize:"inherit"})})}),o.jsx(w,{open:t,anchorEl:i.current,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:n.map(r=>[o.jsxs(N,{disabled:r.disabled,onClick:()=>{a(),r.onClick()},sx:{fontSize:"var(--ov-text-sm)",color:r.color==="danger"||r.color==="error"?"var(--ov-danger-default)":"var(--ov-fg-default)"},children:[r.icon&&o.jsx(E,{sx:{color:"inherit",minWidth:28},children:r.icon}),o.jsx($,{children:r.label})]},r.key),r.dividerAfter&&o.jsx(D,{},`${r.key}-divider`)])})]})}S.displayName="ActionMenu";function k({children:n,emphasis:e="outline",size:c="sm",color:t="neutral",fullWidth:s,orientation:i="horizontal",disabled:a,sx:r}){const p=d.toMuiColor(t),u=d.toMuiVariant(e),l=d.toMuiSize(c);return o.jsx(W,{color:p,variant:u,size:l,fullWidth:s,orientation:i,disabled:a,sx:r,children:n})}k.displayName="ButtonGroup";const _={default:36,dense:28};function M({children:n,variant:e="default",dividers:c=!1,sx:t}){const s=_[e];return o.jsx(m,{sx:{display:"flex",alignItems:"center",height:s,gap:c?0:.5,px:.5,bgcolor:"var(--ov-bg-surface)",...c&&{"& > *:not(:last-child)::after":{content:'""',display:"block",width:"1px",height:"60%",bgcolor:"var(--ov-border-muted)",ml:.5,mr:.5,flexShrink:0}},...typeof t=="object"&&!Array.isArray(t)?t:{}},children:n})}M.displayName="Toolbar";function T({children:n,sx:e}){return o.jsx(m,{sx:{display:"flex",alignItems:"center",gap:"2px",...typeof e=="object"&&!Array.isArray(e)?e:{}},children:n})}T.displayName="ToolbarGroup";function A({selected:n,onChange:e,icon:c,label:t,size:s="sm",color:i="primary",disabled:a,sx:r}){const p=d.toMuiSize(s),u=d.toCssColor(i),l=o.jsx(v,{size:p,disabled:a,onClick:()=>e(!n),sx:{borderRadius:"4px",color:n?u:"var(--ov-fg-muted)",bgcolor:n?"var(--ov-state-hover)":"transparent","&:hover":{bgcolor:"var(--ov-state-hover)"},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:c});return t?o.jsx(C,{title:t,children:l}):l}A.displayName="ToggleButton";function I({value:n,onChange:e,options:c,exclusive:t=!0,size:s="sm",color:i="primary",sx:a}){const r=d.toMuiSize(s),p=d.toCssColor(i),u=(l,x)=>{x!==null&&e(x)};return o.jsx(U,{value:n,exclusive:t,onChange:u,size:r,sx:{"& .Mui-selected":{color:`${p} !important`,bgcolor:"var(--ov-state-hover) !important"},...typeof a=="object"&&!Array.isArray(a)?a:{}},children:c.map(l=>o.jsxs(F,{value:l.key,disabled:l.disabled,sx:{fontSize:"var(--ov-text-sm)",textTransform:"none",px:1.5,gap:.5},children:[l.icon,l.label]},l.key))})}I.displayName="ToggleGroup";const H={xs:24,sm:28,md:32,lg:36,xl:40};function G({value:n,onChange:e,placeholder:c="Search...",regex:t,caseSensitive:s,onRegexChange:i,onCaseSensitiveChange:a,matchCount:r,currentMatch:p,onNext:u,onPrev:l,size:x="sm",sx:j}){const R=H[x],h=x==="xs"?12:14,L=g.useCallback(f=>{f.key==="Enter"&&(f.shiftKey?l?.():u?.()),f.key==="Escape"&&f.target.blur()},[u,l]);return o.jsxs(m,{sx:{display:"flex",alignItems:"center",height:R,border:"1px solid var(--ov-border-default)",borderRadius:"4px",bgcolor:"var(--ov-bg-surface)",px:.5,gap:"2px","&:focus-within":{borderColor:"var(--ov-accent)"},...typeof j=="object"&&!Array.isArray(j)?j:{}},children:[o.jsx(P,{sx:{fontSize:h+2,color:"var(--ov-fg-muted)",ml:.25}}),o.jsx(V,{value:n,onChange:f=>e(f.target.value),onKeyDown:L,placeholder:c,sx:{flex:1,fontSize:x==="xs"?"var(--ov-text-xs)":"var(--ov-text-sm)",color:"var(--ov-fg-default)","& input":{py:0,px:.5},"& input::placeholder":{color:"var(--ov-fg-faint)",opacity:1}}}),a&&o.jsx(C,{title:"Match Case",children:o.jsx(v,{size:"small",onClick:()=>a(!s),sx:{borderRadius:"3px",p:"2px",color:s?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:s?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuCaseSensitive,{size:h})})}),i&&o.jsx(C,{title:"Use Regular Expression",children:o.jsx(v,{size:"small",onClick:()=>i(!t),sx:{borderRadius:"3px",p:"2px",color:t?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:t?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuRegex,{size:h})})}),r!==void 0&&o.jsx(z,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",whiteSpace:"nowrap",px:.5},children:r===0?"No results":`${(p??0)+1}/${r}`}),l&&o.jsx(v,{size:"small",onClick:l,sx:{p:"2px"},children:o.jsx(b.LuChevronUp,{size:h})}),u&&o.jsx(v,{size:"small",onClick:u,sx:{p:"2px"},children:o.jsx(b.LuChevronDown,{size:h})})]})}G.displayName="SearchBar";exports.Button=y.Button;exports.CopyButton=B.CopyButton;exports.IconButton=B.IconButton;exports.ActionMenu=S;exports.ButtonGroup=k;exports.ConfirmButton=q;exports.SearchBar=G;exports.ToggleButton=A;exports.ToggleGroup=I;exports.Toolbar=M;exports.ToolbarGroup=T;
package/dist/buttons.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { B as b } from "./Button-lr02bh_m.js";
2
- import { I } from "./CopyButton-DPBgL0K8.js";
3
- import { C as jo } from "./CopyButton-DPBgL0K8.js";
2
+ import { I } from "./CopyButton-DWVcqdPe.js";
3
+ import { C as jo } from "./CopyButton-DWVcqdPe.js";
4
4
  import { jsxs as f, Fragment as z, jsx as o } from "react/jsx-runtime";
5
5
  import { useState as k, useRef as B, useCallback as j } from "react";
6
6
  import G from "@mui/material/Popover";
package/dist/charts.cjs CHANGED
@@ -1 +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;
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-Cwwem5yh.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-BqA47TdK.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;
package/dist/charts.js CHANGED
@@ -9,7 +9,7 @@ import { ChartsReferenceLine as lt } from "@mui/x-charts/ChartsReferenceLine";
9
9
  import { useXScale as Mt, useDrawingArea as xt, useYScale as $t } from "@mui/x-charts/hooks";
10
10
  import { LuChartBar as At, LuRefreshCw as zt, LuEllipsisVertical as wt } from "react-icons/lu";
11
11
  import { S as st } from "./Skeleton-BUYyXUiC.js";
12
- import { a as Dt, E as Lt } from "./ErrorState-CexYrMpy.js";
12
+ import { a as Dt, E as Lt } from "./ErrorState-DNOrahZX.js";
13
13
  import { BarChart as Tt } from "@mui/x-charts/BarChart";
14
14
  import { PieChart as Ft } from "@mui/x-charts/PieChart";
15
15
  import { ScatterChart as Pt } from "@mui/x-charts/ScatterChart";
@@ -19,7 +19,7 @@ import { Gauge as Bt } from "@mui/x-charts/Gauge";
19
19
  import mt from "@mui/material/IconButton";
20
20
  import Nt from "@mui/material/MenuItem";
21
21
  import Ht from "@mui/material/Menu";
22
- import { S as Wt } from "./Select-DTUF31OP.js";
22
+ import { S as Wt } from "./Select-D61fKI8Y.js";
23
23
  const vt = {
24
24
  primary: "--ov-accent",
25
25
  secondary: "--ov-fg-muted",
package/dist/domain.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@mui/material/Box"),d=require("@mui/material/Typography"),g=require("@mui/material/Chip"),V=require("./StatusPill-C7yn7dSA.cjs"),F=require("./Tooltip-44-P5KfQ.cjs"),M=require("./CopyButton-CACe3RCF.cjs"),p=require("react"),S=require("./TabPanel-CkUSl6Bt.cjs"),z=require("./CodeBlock-CIyG0DbW.cjs"),K=require("@mui/material/CircularProgress"),k=require("./Skeleton-CfdQWLQM.cjs"),J=require("@mui/material/IconButton"),y=require("react-icons/lu"),G=require("./types.cjs"),U=require("@mui/material/Popover"),X=require("@mui/material/TextField"),Y=require("@mui/material/MenuItem"),_=require("@mui/material/Select"),C={xs:{fontSize:"0.6875rem",chipSize:"small"},sm:{fontSize:"0.75rem",chipSize:"small"},md:{fontSize:"0.8125rem",chipSize:"small"},lg:{fontSize:"0.875rem",chipSize:"medium"},xl:{fontSize:"1rem",chipSize:"medium"}};function I({kind:r,name:n,namespace:i,icon:l,onNavigate:o,size:a="sm",interactive:t=!1}){const u=C[a]||C.sm;return e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:t?"pointer":void 0,"&:hover":t?{"& .resource-name":{textDecoration:"underline"}}:void 0},onClick:t?o:void 0,children:[l&&e.jsx(s,{sx:{display:"flex",alignItems:"center",color:"var(--ov-fg-muted)",fontSize:u.fontSize},children:l}),e.jsx(g,{label:r,size:u.chipSize,variant:"outlined",sx:{height:"auto",fontSize:"0.625rem",fontWeight:600,color:"var(--ov-fg-muted)",borderColor:"var(--ov-border-default)",py:0,"& .MuiChip-label":{px:.5,py:0}}}),e.jsx(d,{className:"resource-name",variant:"body2",sx:{fontSize:u.fontSize,fontWeight:500,color:t?"var(--ov-accent-fg)":"var(--ov-fg-base)"},noWrap:!0,children:n}),i&&e.jsxs(d,{variant:"caption",sx:{color:"var(--ov-fg-faint)",fontSize:u.fontSize},children:["(",i,")"]})]})}I.displayName="ResourceRef";const Q={Running:"healthy",Active:"healthy",Bound:"healthy",Available:"healthy",Ready:"healthy",Succeeded:"healthy",Completed:"healthy",Pending:"pending",ContainerCreating:"pending",Terminating:"warning",Warning:"warning",Degraded:"degraded",CrashLoopBackOff:"error",Failed:"error",Error:"error",ImagePullBackOff:"error",ErrImagePull:"error",OOMKilled:"error",Unknown:"unknown"};function T({status:r,conditions:n,size:i="sm",showTooltip:l=!0}){const o=Q[r]??"unknown",a=e.jsx(V.StatusPill,{status:o,label:r,size:i});return l&&n&&n.length>0?e.jsx(F.Tooltip,{variant:"rich",title:e.jsxs(s,{sx:{maxWidth:360},children:[e.jsx(d,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:"Conditions"}),n.map((t,u)=>e.jsxs(s,{sx:{mb:.5},children:[e.jsxs(d,{variant:"caption",sx:{fontWeight:600},children:[t.type,": ",t.status]}),t.reason&&e.jsx(d,{variant:"caption",sx:{display:"block",color:"text.secondary"},children:t.reason}),t.message&&e.jsx(d,{variant:"caption",sx:{display:"block",color:"text.secondary",fontSize:"0.65rem"},children:t.message})]},u))]}),children:e.jsx(s,{sx:{display:"inline-flex"},children:a})}):a}T.displayName="ResourceStatus";const w={xs:{labelSize:"0.625rem",valueSize:"0.6875rem",gap:1},sm:{labelSize:"0.6875rem",valueSize:"0.75rem",gap:1.5},md:{labelSize:"0.75rem",valueSize:"0.8125rem",gap:2},lg:{labelSize:"0.8125rem",valueSize:"0.875rem",gap:2.5},xl:{labelSize:"0.875rem",valueSize:"1rem",gap:3}};function j({items:r,columns:n=1,size:i="md"}){const l=w[i]||w.md;return e.jsx(s,{sx:{display:"grid",gridTemplateColumns:`repeat(${n}, 1fr)`,gap:l.gap},children:r.map((o,a)=>e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.25},children:[o.icon&&e.jsx(s,{sx:{display:"flex",alignItems:"center",color:"var(--ov-fg-muted)"},children:o.icon}),e.jsx(d,{variant:"caption",sx:{fontSize:l.labelSize,fontWeight:600,color:"var(--ov-fg-muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:o.label})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(d,{variant:"body2",sx:{fontSize:l.valueSize,color:"var(--ov-fg-base)",wordBreak:"break-word"},children:o.value}),o.copyable&&e.jsx(M.CopyButton,{value:String(o.value),size:"xs"})]})]},a))})}j.displayName="DescriptionList";function A(r,n=""){const i=[];for(const[l,o]of Object.entries(r)){const a=n?`${n}.${l}`:l;o!==null&&typeof o=="object"&&!Array.isArray(o)?i.push(...A(o,a)):i.push({label:a,value:Array.isArray(o)?o.join(", "):String(o??"—"),copyable:!0})}return i}function W({data:r,title:n,tabs:i,defaultTab:l,sx:o}){const a=p.useMemo(()=>A(r),[r]),t=p.useMemo(()=>{try{return JSON.stringify(r,null,2)}catch{return"{}"}},[r]),u=p.useMemo(()=>[{key:"summary",label:"Summary",content:e.jsx(j,{items:a,columns:2})},{key:"yaml",label:"YAML",content:e.jsx(z.CodeBlock,{language:"yaml",lineNumbers:!0,children:t})},{key:"json",label:"JSON",content:e.jsx(z.CodeBlock,{language:"json",lineNumbers:!0,children:t})}],[a,t]),x=p.useMemo(()=>[...u,...i??[]],[u,i]),[m,b]=p.useState(l??x[0]?.key??"summary");return e.jsxs(s,{sx:{border:"1px solid var(--ov-border-default)",borderRadius:"6px",overflow:"hidden",...typeof o=="object"&&!Array.isArray(o)?o:{}},children:[n&&e.jsx(s,{sx:{px:2,py:1,borderBottom:"1px solid var(--ov-border-default)",bgcolor:"var(--ov-bg-surface)"},children:e.jsx(d,{variant:"subtitle2",sx:{fontWeight:600,color:"var(--ov-fg-base)"},children:n})}),e.jsx(s,{sx:{px:2,pt:1},children:e.jsx(S.Tabs,{tabs:x.map(h=>({key:h.key,label:h.label})),value:m,onChange:b,size:"sm"})}),e.jsx(s,{sx:{p:2},children:x.map(h=>e.jsx(S.TabPanel,{value:h.key,activeValue:m,children:h.content},h.key))})]})}W.displayName="ObjectInspector";function Z(r){if(!r)return"—";const n=Date.now()-new Date(r).getTime(),i=Math.floor(n/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function ee({event:r}){return e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,py:1,px:1.5,borderBottom:"1px solid var(--ov-border-muted)","&:last-child":{borderBottom:"none"}},children:[e.jsx(g,{label:r.type,size:"small",color:r.type==="Warning"?"warning":"info",variant:"outlined",sx:{fontSize:"0.625rem",height:20,flexShrink:0,mt:.25}}),e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(d,{variant:"body2",sx:{fontWeight:600,fontSize:"0.8125rem",color:"var(--ov-fg-base)"},children:r.reason}),e.jsx(d,{variant:"body2",sx:{fontSize:"0.75rem",color:"var(--ov-fg-default)",mt:.25},children:r.message}),r.involvedObject&&e.jsxs(d,{variant:"caption",sx:{color:"var(--ov-fg-muted)",mt:.25,display:"block"},children:[r.involvedObject.kind,"/",r.involvedObject.name,r.involvedObject.namespace?` (${r.involvedObject.namespace})`:""]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:[r.count!=null&&r.count>1&&e.jsx(g,{label:`×${r.count}`,size:"small",sx:{fontSize:"0.625rem",height:18}}),e.jsx(d,{variant:"caption",sx:{color:"var(--ov-fg-faint)",whiteSpace:"nowrap"},children:Z(r.lastTimestamp??r.firstTimestamp)})]})]})}function B({events:r,loading:n=!1}){return n?e.jsx(s,{sx:{display:"flex",justifyContent:"center",py:4},children:e.jsx(K,{size:24})}):r.length===0?e.jsx(s,{sx:{textAlign:"center",py:4,color:"var(--ov-fg-muted)"},children:e.jsx(d,{variant:"body2",children:"No events"})}):e.jsx(s,{children:r.map((i,l)=>e.jsx(ee,{event:i},l))})}B.displayName="EventsList";const re={info:"var(--ov-fg-default)",warn:"var(--ov-warning)",error:"var(--ov-danger)",debug:"var(--ov-fg-faint)"},R=20;function O({lines:r,follow:n=!1,wrap:i=!1,timestamps:l=!0,maxLines:o,severity:a}){const t=p.useRef(null),u=p.useMemo(()=>{let x=r;return a&&(x=x.filter(m=>m.severity===a)),o&&(x=x.slice(-o)),x},[r,a,o]);return p.useEffect(()=>{n&&t.current&&(t.current.scrollTop=t.current.scrollHeight)},[u.length,n]),e.jsx(s,{ref:t,sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.75rem",lineHeight:`${R}px`,bgcolor:"#0d1117",color:"var(--ov-fg-default)",border:"1px solid var(--ov-border-default)",borderRadius:"6px",overflow:"auto",maxHeight:400,p:1,whiteSpace:i?"pre-wrap":"pre",wordBreak:i?"break-all":void 0},children:u.length===0?e.jsx(d,{variant:"body2",sx:{color:"var(--ov-fg-muted)",fontFamily:"inherit",fontSize:"inherit",py:2,textAlign:"center"},children:"No log lines"}):u.map((x,m)=>e.jsxs(s,{sx:{display:"flex",gap:1,color:re[x.severity??"info"],minHeight:R,"&:hover":{bgcolor:"rgba(255,255,255,0.03)"}},children:[e.jsx(s,{sx:{color:"var(--ov-fg-faint)",userSelect:"none",width:40,textAlign:"right",flexShrink:0},children:m+1}),l&&x.timestamp&&e.jsx(s,{sx:{color:"var(--ov-fg-muted)",flexShrink:0},children:x.timestamp}),e.jsx(s,{sx:{flex:1},children:x.content})]},m))})}O.displayName="LogsViewer";const oe={up:"var(--ov-success)",down:"var(--ov-danger)",neutral:"var(--ov-fg-muted)"};function q({label:r,value:n,unit:i,delta:l,deltaDirection:o="neutral",sparkline:a,loading:t=!1}){return t?e.jsxs(s,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)"},children:[e.jsx(k.Skeleton,{variant:"text",width:"40%"}),e.jsx(k.Skeleton,{variant:"text",width:"60%",height:32})]}):e.jsxs(s,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)",display:"flex",flexDirection:"column",gap:.5},children:[e.jsx(d,{variant:"caption",sx:{fontSize:"0.6875rem",fontWeight:600,color:"var(--ov-fg-muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:r}),e.jsxs(s,{sx:{display:"flex",alignItems:"baseline",gap:.5},children:[e.jsx(d,{variant:"h5",sx:{fontWeight:700,color:"var(--ov-fg-base)",lineHeight:1},children:n}),i&&e.jsx(d,{variant:"body2",sx:{color:"var(--ov-fg-muted)",fontSize:"0.75rem"},children:i})]}),l!=null&&e.jsxs(d,{variant:"caption",sx:{color:oe[o],fontWeight:500,fontSize:"0.75rem"},children:[o==="up"&&"↑",o==="down"&&"↓",l>0?"+":"",l,"%"]}),a&&e.jsx(s,{sx:{mt:.5},children:a})]})}q.displayName="MetricCard";function L({value:r,revealed:n,onReveal:i,copyable:l=!1}){const[o,a]=p.useState(!1),t=n??o,u=()=>{i?i():a(x=>!x)};return e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.5},children:[e.jsx(d,{variant:"body2",sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.8125rem",color:t?"var(--ov-fg-base)":"var(--ov-fg-muted)",letterSpacing:t?void 0:"0.15em"},children:t?r:"••••••••"}),e.jsx(J,{size:"small",onClick:u,sx:{p:.25},children:t?e.jsx(y.LuEyeOff,{size:14}):e.jsx(y.LuEye,{size:14})}),l&&e.jsx(M.CopyButton,{value:r,size:"xs"})]})}L.displayName="SecretValueMask";const te={xs:"var(--ov-text-xs)",sm:"var(--ov-text-xs)",md:"var(--ov-text-sm)",lg:"var(--ov-text-sm)",xl:"var(--ov-text-sm)"};function E({segments:r,onNavigate:n,size:i="sm",sx:l}){const o=te[i];return e.jsx(s,{sx:{display:"flex",alignItems:"center",gap:.5,...typeof l=="object"&&!Array.isArray(l)?l:{}},children:r.map((a,t)=>e.jsxs(p.Fragment,{children:[t>0&&e.jsx(y.LuChevronRight,{size:12,color:"var(--ov-fg-faint)"}),e.jsxs(s,{onClick:n?()=>n(a,t):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.5,py:.125,borderRadius:"3px",cursor:n?"pointer":"default",...n&&{"&:hover":{bgcolor:"var(--ov-state-hover)"}}},children:[a.icon&&e.jsx(s,{sx:{display:"flex",color:"var(--ov-fg-muted)",flexShrink:0},children:a.icon}),e.jsx(d,{sx:{fontSize:o,color:t===r.length-1?"var(--ov-fg-base)":"var(--ov-fg-muted)",fontWeight:t===r.length-1?500:400,whiteSpace:"nowrap"},children:a.label})]})]},t))})}E.displayName="ResourceBreadcrumb";const se={xs:8,sm:10,md:12,lg:14,xl:16};function N({events:r,size:n="sm",sx:i}){const l=se[n];return e.jsx(s,{sx:{display:"flex",flexDirection:"column",...typeof i=="object"&&!Array.isArray(i)?i:{}},children:r.map((o,a)=>{const t=o.color?G.toCssColor(o.color):"var(--ov-fg-muted)",u=a===r.length-1;return e.jsxs(s,{sx:{display:"flex",gap:1.5},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:l+8,flexShrink:0},children:[o.icon?e.jsx(s,{sx:{color:t,display:"flex",mt:.25},children:o.icon}):e.jsx(s,{sx:{width:l,height:l,borderRadius:"50%",bgcolor:t,mt:.5,flexShrink:0}}),!u&&e.jsx(s,{sx:{width:2,flex:1,bgcolor:"var(--ov-border-muted)",minHeight:16}})]}),e.jsxs(s,{sx:{flex:1,pb:u?0:2,minWidth:0},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mb:.25},children:[e.jsx(d,{sx:{fontSize:n==="xs"?"var(--ov-text-xs)":"var(--ov-text-sm)",fontWeight:500,color:"var(--ov-fg-base)"},children:o.title}),e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-faint)",whiteSpace:"nowrap",ml:1,flexShrink:0},children:typeof o.timestamp=="string"?o.timestamp:o.timestamp.toLocaleTimeString()})]}),o.description&&e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",lineHeight:1.5},children:o.description})]})]},o.id)})})}N.displayName="Timeline";function P({filters:r,activeFilters:n,onChange:i,sx:l}){const[o,a]=p.useState(null),[t,u]=p.useState(null),[x,m]=p.useState(""),b=(c,f)=>{a(c.currentTarget),u(f);const v=n.find(H=>H.key===f.key);m(v?.value??"")},h=()=>{if(!t)return;const c=t.key,f=n.filter(v=>v.key!==c);x.trim()&&f.push({key:c,value:x.trim()}),i(f),a(null),u(null)},$=c=>{i(n.filter(f=>f.key!==c))},D=new Set(n.map(c=>c.key));return e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.75,flexWrap:"wrap",...typeof l=="object"&&!Array.isArray(l)?l:{}},children:[n.map(c=>{const f=r.find(v=>v.key===c.key);return e.jsx(g,{label:`${f?.label??c.key}: ${c.value}`,size:"small",onDelete:()=>$(c.key),deleteIcon:e.jsx(y.LuX,{size:12}),onClick:v=>f&&b(v,f),sx:{fontSize:"var(--ov-text-xs)",bgcolor:"var(--ov-accent-subtle)",color:"var(--ov-accent-fg)","& .MuiChip-deleteIcon":{color:"var(--ov-accent-fg)"}}},c.key)}),r.filter(c=>!D.has(c.key)).map(c=>e.jsx(g,{label:c.label,size:"small",icon:e.jsx(y.LuPlus,{size:10}),onClick:f=>b(f,c),variant:"outlined",sx:{fontSize:"var(--ov-text-xs)",borderColor:"var(--ov-border-default)",color:"var(--ov-fg-muted)",cursor:"pointer"}},c.key)),e.jsx(U,{open:!!o,anchorEl:o,onClose:()=>{a(null),u(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:2,minWidth:220,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:t&&e.jsxs(s,{children:[e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",fontWeight:600,color:"var(--ov-fg-muted)",mb:1},children:t.label}),t.type==="text"&&e.jsx(X,{autoFocus:!0,size:"small",fullWidth:!0,value:x,onChange:c=>m(c.target.value),onKeyDown:c=>{c.key==="Enter"&&h()},placeholder:t.placeholder,sx:{mb:1}}),t.type==="select"&&t.options&&e.jsx(_,{size:"small",fullWidth:!0,value:x,onChange:c=>m(c.target.value),sx:{mb:1},children:t.options.map(c=>e.jsx(Y,{value:c,children:c},c))}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end",gap:.5},children:e.jsx(g,{label:"Apply",size:"small",onClick:h,sx:{cursor:"pointer",bgcolor:"var(--ov-accent)",color:"#fff",fontSize:"var(--ov-text-xs)"}})})]})})]})}P.displayName="FilterBar";exports.DescriptionList=j;exports.EventsList=B;exports.FilterBar=P;exports.LogsViewer=O;exports.MetricCard=q;exports.ObjectInspector=W;exports.ResourceBreadcrumb=E;exports.ResourceRef=I;exports.ResourceStatus=T;exports.SecretValueMask=L;exports.Timeline=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@mui/material/Box"),d=require("@mui/material/Typography"),g=require("@mui/material/Chip"),V=require("./StatusPill-C7yn7dSA.cjs"),F=require("./Tooltip-oUFp4gNV.cjs"),M=require("./CopyButton-3fq1UAiv.cjs"),p=require("react"),S=require("./TabPanel-CkUSl6Bt.cjs"),z=require("./CodeBlock-DTB_WsXQ.cjs"),K=require("@mui/material/CircularProgress"),k=require("./Skeleton-CfdQWLQM.cjs"),J=require("@mui/material/IconButton"),y=require("react-icons/lu"),G=require("./types.cjs"),U=require("@mui/material/Popover"),X=require("@mui/material/TextField"),Y=require("@mui/material/MenuItem"),_=require("@mui/material/Select"),C={xs:{fontSize:"0.6875rem",chipSize:"small"},sm:{fontSize:"0.75rem",chipSize:"small"},md:{fontSize:"0.8125rem",chipSize:"small"},lg:{fontSize:"0.875rem",chipSize:"medium"},xl:{fontSize:"1rem",chipSize:"medium"}};function I({kind:r,name:n,namespace:i,icon:l,onNavigate:o,size:a="sm",interactive:t=!1}){const u=C[a]||C.sm;return e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.5,cursor:t?"pointer":void 0,"&:hover":t?{"& .resource-name":{textDecoration:"underline"}}:void 0},onClick:t?o:void 0,children:[l&&e.jsx(s,{sx:{display:"flex",alignItems:"center",color:"var(--ov-fg-muted)",fontSize:u.fontSize},children:l}),e.jsx(g,{label:r,size:u.chipSize,variant:"outlined",sx:{height:"auto",fontSize:"0.625rem",fontWeight:600,color:"var(--ov-fg-muted)",borderColor:"var(--ov-border-default)",py:0,"& .MuiChip-label":{px:.5,py:0}}}),e.jsx(d,{className:"resource-name",variant:"body2",sx:{fontSize:u.fontSize,fontWeight:500,color:t?"var(--ov-accent-fg)":"var(--ov-fg-base)"},noWrap:!0,children:n}),i&&e.jsxs(d,{variant:"caption",sx:{color:"var(--ov-fg-faint)",fontSize:u.fontSize},children:["(",i,")"]})]})}I.displayName="ResourceRef";const Q={Running:"healthy",Active:"healthy",Bound:"healthy",Available:"healthy",Ready:"healthy",Succeeded:"healthy",Completed:"healthy",Pending:"pending",ContainerCreating:"pending",Terminating:"warning",Warning:"warning",Degraded:"degraded",CrashLoopBackOff:"error",Failed:"error",Error:"error",ImagePullBackOff:"error",ErrImagePull:"error",OOMKilled:"error",Unknown:"unknown"};function T({status:r,conditions:n,size:i="sm",showTooltip:l=!0}){const o=Q[r]??"unknown",a=e.jsx(V.StatusPill,{status:o,label:r,size:i});return l&&n&&n.length>0?e.jsx(F.Tooltip,{variant:"rich",title:e.jsxs(s,{sx:{maxWidth:360},children:[e.jsx(d,{variant:"subtitle2",sx:{fontWeight:600,mb:.5},children:"Conditions"}),n.map((t,u)=>e.jsxs(s,{sx:{mb:.5},children:[e.jsxs(d,{variant:"caption",sx:{fontWeight:600},children:[t.type,": ",t.status]}),t.reason&&e.jsx(d,{variant:"caption",sx:{display:"block",color:"text.secondary"},children:t.reason}),t.message&&e.jsx(d,{variant:"caption",sx:{display:"block",color:"text.secondary",fontSize:"0.65rem"},children:t.message})]},u))]}),children:e.jsx(s,{sx:{display:"inline-flex"},children:a})}):a}T.displayName="ResourceStatus";const w={xs:{labelSize:"0.625rem",valueSize:"0.6875rem",gap:1},sm:{labelSize:"0.6875rem",valueSize:"0.75rem",gap:1.5},md:{labelSize:"0.75rem",valueSize:"0.8125rem",gap:2},lg:{labelSize:"0.8125rem",valueSize:"0.875rem",gap:2.5},xl:{labelSize:"0.875rem",valueSize:"1rem",gap:3}};function j({items:r,columns:n=1,size:i="md"}){const l=w[i]||w.md;return e.jsx(s,{sx:{display:"grid",gridTemplateColumns:`repeat(${n}, 1fr)`,gap:l.gap},children:r.map((o,a)=>e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.25},children:[o.icon&&e.jsx(s,{sx:{display:"flex",alignItems:"center",color:"var(--ov-fg-muted)"},children:o.icon}),e.jsx(d,{variant:"caption",sx:{fontSize:l.labelSize,fontWeight:600,color:"var(--ov-fg-muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:o.label})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(d,{variant:"body2",sx:{fontSize:l.valueSize,color:"var(--ov-fg-base)",wordBreak:"break-word"},children:o.value}),o.copyable&&e.jsx(M.CopyButton,{value:String(o.value),size:"xs"})]})]},a))})}j.displayName="DescriptionList";function A(r,n=""){const i=[];for(const[l,o]of Object.entries(r)){const a=n?`${n}.${l}`:l;o!==null&&typeof o=="object"&&!Array.isArray(o)?i.push(...A(o,a)):i.push({label:a,value:Array.isArray(o)?o.join(", "):String(o??"—"),copyable:!0})}return i}function W({data:r,title:n,tabs:i,defaultTab:l,sx:o}){const a=p.useMemo(()=>A(r),[r]),t=p.useMemo(()=>{try{return JSON.stringify(r,null,2)}catch{return"{}"}},[r]),u=p.useMemo(()=>[{key:"summary",label:"Summary",content:e.jsx(j,{items:a,columns:2})},{key:"yaml",label:"YAML",content:e.jsx(z.CodeBlock,{language:"yaml",lineNumbers:!0,children:t})},{key:"json",label:"JSON",content:e.jsx(z.CodeBlock,{language:"json",lineNumbers:!0,children:t})}],[a,t]),x=p.useMemo(()=>[...u,...i??[]],[u,i]),[m,b]=p.useState(l??x[0]?.key??"summary");return e.jsxs(s,{sx:{border:"1px solid var(--ov-border-default)",borderRadius:"6px",overflow:"hidden",...typeof o=="object"&&!Array.isArray(o)?o:{}},children:[n&&e.jsx(s,{sx:{px:2,py:1,borderBottom:"1px solid var(--ov-border-default)",bgcolor:"var(--ov-bg-surface)"},children:e.jsx(d,{variant:"subtitle2",sx:{fontWeight:600,color:"var(--ov-fg-base)"},children:n})}),e.jsx(s,{sx:{px:2,pt:1},children:e.jsx(S.Tabs,{tabs:x.map(h=>({key:h.key,label:h.label})),value:m,onChange:b,size:"sm"})}),e.jsx(s,{sx:{p:2},children:x.map(h=>e.jsx(S.TabPanel,{value:h.key,activeValue:m,children:h.content},h.key))})]})}W.displayName="ObjectInspector";function Z(r){if(!r)return"—";const n=Date.now()-new Date(r).getTime(),i=Math.floor(n/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60);return l<24?`${l}h`:`${Math.floor(l/24)}d`}function ee({event:r}){return e.jsxs(s,{sx:{display:"flex",alignItems:"flex-start",gap:1.5,py:1,px:1.5,borderBottom:"1px solid var(--ov-border-muted)","&:last-child":{borderBottom:"none"}},children:[e.jsx(g,{label:r.type,size:"small",color:r.type==="Warning"?"warning":"info",variant:"outlined",sx:{fontSize:"0.625rem",height:20,flexShrink:0,mt:.25}}),e.jsxs(s,{sx:{flex:1,minWidth:0},children:[e.jsx(d,{variant:"body2",sx:{fontWeight:600,fontSize:"0.8125rem",color:"var(--ov-fg-base)"},children:r.reason}),e.jsx(d,{variant:"body2",sx:{fontSize:"0.75rem",color:"var(--ov-fg-default)",mt:.25},children:r.message}),r.involvedObject&&e.jsxs(d,{variant:"caption",sx:{color:"var(--ov-fg-muted)",mt:.25,display:"block"},children:[r.involvedObject.kind,"/",r.involvedObject.name,r.involvedObject.namespace?` (${r.involvedObject.namespace})`:""]})]}),e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:[r.count!=null&&r.count>1&&e.jsx(g,{label:`×${r.count}`,size:"small",sx:{fontSize:"0.625rem",height:18}}),e.jsx(d,{variant:"caption",sx:{color:"var(--ov-fg-faint)",whiteSpace:"nowrap"},children:Z(r.lastTimestamp??r.firstTimestamp)})]})]})}function B({events:r,loading:n=!1}){return n?e.jsx(s,{sx:{display:"flex",justifyContent:"center",py:4},children:e.jsx(K,{size:24})}):r.length===0?e.jsx(s,{sx:{textAlign:"center",py:4,color:"var(--ov-fg-muted)"},children:e.jsx(d,{variant:"body2",children:"No events"})}):e.jsx(s,{children:r.map((i,l)=>e.jsx(ee,{event:i},l))})}B.displayName="EventsList";const re={info:"var(--ov-fg-default)",warn:"var(--ov-warning)",error:"var(--ov-danger)",debug:"var(--ov-fg-faint)"},R=20;function O({lines:r,follow:n=!1,wrap:i=!1,timestamps:l=!0,maxLines:o,severity:a}){const t=p.useRef(null),u=p.useMemo(()=>{let x=r;return a&&(x=x.filter(m=>m.severity===a)),o&&(x=x.slice(-o)),x},[r,a,o]);return p.useEffect(()=>{n&&t.current&&(t.current.scrollTop=t.current.scrollHeight)},[u.length,n]),e.jsx(s,{ref:t,sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.75rem",lineHeight:`${R}px`,bgcolor:"#0d1117",color:"var(--ov-fg-default)",border:"1px solid var(--ov-border-default)",borderRadius:"6px",overflow:"auto",maxHeight:400,p:1,whiteSpace:i?"pre-wrap":"pre",wordBreak:i?"break-all":void 0},children:u.length===0?e.jsx(d,{variant:"body2",sx:{color:"var(--ov-fg-muted)",fontFamily:"inherit",fontSize:"inherit",py:2,textAlign:"center"},children:"No log lines"}):u.map((x,m)=>e.jsxs(s,{sx:{display:"flex",gap:1,color:re[x.severity??"info"],minHeight:R,"&:hover":{bgcolor:"rgba(255,255,255,0.03)"}},children:[e.jsx(s,{sx:{color:"var(--ov-fg-faint)",userSelect:"none",width:40,textAlign:"right",flexShrink:0},children:m+1}),l&&x.timestamp&&e.jsx(s,{sx:{color:"var(--ov-fg-muted)",flexShrink:0},children:x.timestamp}),e.jsx(s,{sx:{flex:1},children:x.content})]},m))})}O.displayName="LogsViewer";const oe={up:"var(--ov-success)",down:"var(--ov-danger)",neutral:"var(--ov-fg-muted)"};function q({label:r,value:n,unit:i,delta:l,deltaDirection:o="neutral",sparkline:a,loading:t=!1}){return t?e.jsxs(s,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)"},children:[e.jsx(k.Skeleton,{variant:"text",width:"40%"}),e.jsx(k.Skeleton,{variant:"text",width:"60%",height:32})]}):e.jsxs(s,{sx:{p:2,border:"1px solid var(--ov-border-default)",borderRadius:"8px",bgcolor:"var(--ov-bg-surface)",display:"flex",flexDirection:"column",gap:.5},children:[e.jsx(d,{variant:"caption",sx:{fontSize:"0.6875rem",fontWeight:600,color:"var(--ov-fg-muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:r}),e.jsxs(s,{sx:{display:"flex",alignItems:"baseline",gap:.5},children:[e.jsx(d,{variant:"h5",sx:{fontWeight:700,color:"var(--ov-fg-base)",lineHeight:1},children:n}),i&&e.jsx(d,{variant:"body2",sx:{color:"var(--ov-fg-muted)",fontSize:"0.75rem"},children:i})]}),l!=null&&e.jsxs(d,{variant:"caption",sx:{color:oe[o],fontWeight:500,fontSize:"0.75rem"},children:[o==="up"&&"↑",o==="down"&&"↓",l>0?"+":"",l,"%"]}),a&&e.jsx(s,{sx:{mt:.5},children:a})]})}q.displayName="MetricCard";function L({value:r,revealed:n,onReveal:i,copyable:l=!1}){const[o,a]=p.useState(!1),t=n??o,u=()=>{i?i():a(x=>!x)};return e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.5},children:[e.jsx(d,{variant:"body2",sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.8125rem",color:t?"var(--ov-fg-base)":"var(--ov-fg-muted)",letterSpacing:t?void 0:"0.15em"},children:t?r:"••••••••"}),e.jsx(J,{size:"small",onClick:u,sx:{p:.25},children:t?e.jsx(y.LuEyeOff,{size:14}):e.jsx(y.LuEye,{size:14})}),l&&e.jsx(M.CopyButton,{value:r,size:"xs"})]})}L.displayName="SecretValueMask";const te={xs:"var(--ov-text-xs)",sm:"var(--ov-text-xs)",md:"var(--ov-text-sm)",lg:"var(--ov-text-sm)",xl:"var(--ov-text-sm)"};function E({segments:r,onNavigate:n,size:i="sm",sx:l}){const o=te[i];return e.jsx(s,{sx:{display:"flex",alignItems:"center",gap:.5,...typeof l=="object"&&!Array.isArray(l)?l:{}},children:r.map((a,t)=>e.jsxs(p.Fragment,{children:[t>0&&e.jsx(y.LuChevronRight,{size:12,color:"var(--ov-fg-faint)"}),e.jsxs(s,{onClick:n?()=>n(a,t):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.5,py:.125,borderRadius:"3px",cursor:n?"pointer":"default",...n&&{"&:hover":{bgcolor:"var(--ov-state-hover)"}}},children:[a.icon&&e.jsx(s,{sx:{display:"flex",color:"var(--ov-fg-muted)",flexShrink:0},children:a.icon}),e.jsx(d,{sx:{fontSize:o,color:t===r.length-1?"var(--ov-fg-base)":"var(--ov-fg-muted)",fontWeight:t===r.length-1?500:400,whiteSpace:"nowrap"},children:a.label})]})]},t))})}E.displayName="ResourceBreadcrumb";const se={xs:8,sm:10,md:12,lg:14,xl:16};function N({events:r,size:n="sm",sx:i}){const l=se[n];return e.jsx(s,{sx:{display:"flex",flexDirection:"column",...typeof i=="object"&&!Array.isArray(i)?i:{}},children:r.map((o,a)=>{const t=o.color?G.toCssColor(o.color):"var(--ov-fg-muted)",u=a===r.length-1;return e.jsxs(s,{sx:{display:"flex",gap:1.5},children:[e.jsxs(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:l+8,flexShrink:0},children:[o.icon?e.jsx(s,{sx:{color:t,display:"flex",mt:.25},children:o.icon}):e.jsx(s,{sx:{width:l,height:l,borderRadius:"50%",bgcolor:t,mt:.5,flexShrink:0}}),!u&&e.jsx(s,{sx:{width:2,flex:1,bgcolor:"var(--ov-border-muted)",minHeight:16}})]}),e.jsxs(s,{sx:{flex:1,pb:u?0:2,minWidth:0},children:[e.jsxs(s,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mb:.25},children:[e.jsx(d,{sx:{fontSize:n==="xs"?"var(--ov-text-xs)":"var(--ov-text-sm)",fontWeight:500,color:"var(--ov-fg-base)"},children:o.title}),e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-faint)",whiteSpace:"nowrap",ml:1,flexShrink:0},children:typeof o.timestamp=="string"?o.timestamp:o.timestamp.toLocaleTimeString()})]}),o.description&&e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",lineHeight:1.5},children:o.description})]})]},o.id)})})}N.displayName="Timeline";function P({filters:r,activeFilters:n,onChange:i,sx:l}){const[o,a]=p.useState(null),[t,u]=p.useState(null),[x,m]=p.useState(""),b=(c,f)=>{a(c.currentTarget),u(f);const v=n.find(H=>H.key===f.key);m(v?.value??"")},h=()=>{if(!t)return;const c=t.key,f=n.filter(v=>v.key!==c);x.trim()&&f.push({key:c,value:x.trim()}),i(f),a(null),u(null)},$=c=>{i(n.filter(f=>f.key!==c))},D=new Set(n.map(c=>c.key));return e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:.75,flexWrap:"wrap",...typeof l=="object"&&!Array.isArray(l)?l:{}},children:[n.map(c=>{const f=r.find(v=>v.key===c.key);return e.jsx(g,{label:`${f?.label??c.key}: ${c.value}`,size:"small",onDelete:()=>$(c.key),deleteIcon:e.jsx(y.LuX,{size:12}),onClick:v=>f&&b(v,f),sx:{fontSize:"var(--ov-text-xs)",bgcolor:"var(--ov-accent-subtle)",color:"var(--ov-accent-fg)","& .MuiChip-deleteIcon":{color:"var(--ov-accent-fg)"}}},c.key)}),r.filter(c=>!D.has(c.key)).map(c=>e.jsx(g,{label:c.label,size:"small",icon:e.jsx(y.LuPlus,{size:10}),onClick:f=>b(f,c),variant:"outlined",sx:{fontSize:"var(--ov-text-xs)",borderColor:"var(--ov-border-default)",color:"var(--ov-fg-muted)",cursor:"pointer"}},c.key)),e.jsx(U,{open:!!o,anchorEl:o,onClose:()=>{a(null),u(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:2,minWidth:220,bgcolor:"var(--ov-bg-surface)",border:"1px solid var(--ov-border-default)"}}},children:t&&e.jsxs(s,{children:[e.jsx(d,{sx:{fontSize:"var(--ov-text-xs)",fontWeight:600,color:"var(--ov-fg-muted)",mb:1},children:t.label}),t.type==="text"&&e.jsx(X,{autoFocus:!0,size:"small",fullWidth:!0,value:x,onChange:c=>m(c.target.value),onKeyDown:c=>{c.key==="Enter"&&h()},placeholder:t.placeholder,sx:{mb:1}}),t.type==="select"&&t.options&&e.jsx(_,{size:"small",fullWidth:!0,value:x,onChange:c=>m(c.target.value),sx:{mb:1},children:t.options.map(c=>e.jsx(Y,{value:c,children:c},c))}),e.jsx(s,{sx:{display:"flex",justifyContent:"flex-end",gap:.5},children:e.jsx(g,{label:"Apply",size:"small",onClick:h,sx:{cursor:"pointer",bgcolor:"var(--ov-accent)",color:"#fff",fontSize:"var(--ov-text-xs)"}})})]})})]})}P.displayName="FilterBar";exports.DescriptionList=j;exports.EventsList=B;exports.FilterBar=P;exports.LogsViewer=O;exports.MetricCard=q;exports.ObjectInspector=W;exports.ResourceBreadcrumb=E;exports.ResourceRef=I;exports.ResourceStatus=T;exports.SecretValueMask=L;exports.Timeline=N;
package/dist/domain.js CHANGED
@@ -3,11 +3,11 @@ import l from "@mui/material/Box";
3
3
  import f from "@mui/material/Typography";
4
4
  import x from "@mui/material/Chip";
5
5
  import { S as O } from "./StatusPill-C1NaiCzd.js";
6
- import { T as B } from "./Tooltip-BEVuYuZ3.js";
7
- import { C as R } from "./CopyButton-DPBgL0K8.js";
6
+ import { T as B } from "./Tooltip-CZMOcjX7.js";
7
+ import { C as R } from "./CopyButton-DWVcqdPe.js";
8
8
  import N, { useMemo as y, useState as b, useRef as E, useEffect as L } from "react";
9
9
  import { a as $, T as D } from "./TabPanel-DLHbgKpl.js";
10
- import { C as z } from "./CodeBlock-B1iQO7zU.js";
10
+ import { C as z } from "./CodeBlock-DV6CPG00.js";
11
11
  import H from "@mui/material/CircularProgress";
12
12
  import { S as k } from "./Skeleton-BUYyXUiC.js";
13
13
  import P from "@mui/material/IconButton";
@@ -8,4 +8,4 @@ export { default as CommandPalette } from './CommandPalette';
8
8
  export type { CommandPaletteProps, CommandItem } from './CommandPalette';
9
9
  export { default as MarkdownPreview } from './MarkdownPreview';
10
10
  export type { MarkdownPreviewProps } from './MarkdownPreview';
11
- export { registerOmniviewThemes, omniviewDark, omniviewLight } from './themes';
11
+ export { registerOmniviewThemes, resolveEditorTheme, omniviewDark, omniviewLight, solarizedDark, solarizedLight, MONACO_THEME_NAMES } from './themes';
@@ -1,4 +1,17 @@
1
1
  import { editor } from 'monaco-editor';
2
2
  export declare const omniviewDark: editor.IStandaloneThemeData;
3
3
  export declare const omniviewLight: editor.IStandaloneThemeData;
4
+ export declare const solarizedDark: editor.IStandaloneThemeData;
5
+ export declare const solarizedLight: editor.IStandaloneThemeData;
6
+ export declare const MONACO_THEME_NAMES: {
7
+ readonly omniviewDark: "omniview-dark";
8
+ readonly omniviewLight: "omniview-light";
9
+ readonly solarizedDark: "solarized-dark";
10
+ readonly solarizedLight: "solarized-light";
11
+ };
12
+ /**
13
+ * Resolve the Monaco editor theme name from app theme variant and color mode.
14
+ * Use in CodeEditor and DiffViewer to keep theme selection DRY.
15
+ */
16
+ export declare function resolveEditorTheme(variant: string, colorMode: string, explicit?: string): string;
4
17
  export declare function registerOmniviewThemes(monaco: typeof import('monaco-editor')): void;