@omniviewdev/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/dist/Button-Dmu1cikC.cjs +1 -0
- package/dist/Button-lr02bh_m.js +51 -0
- package/dist/CodeBlock-B1iQO7zU.js +73 -0
- package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
- package/dist/CopyButton-CACe3RCF.cjs +1 -0
- package/dist/CopyButton-DPBgL0K8.js +77 -0
- package/dist/ErrorState-CexYrMpy.js +188 -0
- package/dist/ErrorState-CnIR-1xa.cjs +1 -0
- package/dist/HotkeyHint-6SOi-MaU.js +37 -0
- package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
- package/dist/Icon-CKdIOrjZ.cjs +1 -0
- package/dist/Icon-CuO9W7cA.js +27 -0
- package/dist/SearchInput-CFBBNdI2.cjs +1 -0
- package/dist/SearchInput-D3AsCI5H.js +41 -0
- package/dist/Select-CnRBSc5w.cjs +1 -0
- package/dist/Select-DTUF31OP.js +206 -0
- package/dist/Skeleton-BUYyXUiC.js +32 -0
- package/dist/Skeleton-CfdQWLQM.cjs +1 -0
- package/dist/StatusDot-CYyJxjJK.cjs +1 -0
- package/dist/StatusDot-CncykBAY.js +68 -0
- package/dist/StatusPill-C1NaiCzd.js +29 -0
- package/dist/StatusPill-C7yn7dSA.cjs +1 -0
- package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
- package/dist/TabPanel-DLHbgKpl.js +124 -0
- package/dist/Text-By4P3in5.js +71 -0
- package/dist/Text-Mk6Uyg1w.cjs +1 -0
- package/dist/Tooltip-44-P5KfQ.cjs +1 -0
- package/dist/Tooltip-BEVuYuZ3.js +41 -0
- package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
- package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +21 -0
- package/dist/buttons/Button.d.ts +31 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ConfirmButton.d.ts +10 -0
- package/dist/buttons/CopyButton.d.ts +11 -0
- package/dist/buttons/IconButton.d.ts +21 -0
- package/dist/buttons/SearchBar.d.ts +22 -0
- package/dist/buttons/ToggleButton.d.ts +18 -0
- package/dist/buttons/ToggleGroup.d.ts +23 -0
- package/dist/buttons/Toolbar.d.ts +15 -0
- package/dist/buttons/ToolbarGroup.d.ts +11 -0
- package/dist/buttons/index.d.ts +22 -0
- package/dist/buttons.cjs +1 -0
- package/dist/buttons.js +430 -0
- package/dist/cells/BadgesCell.d.ts +19 -0
- package/dist/cells/ChipCell.d.ts +16 -0
- package/dist/cells/SelectBoxHeader.d.ts +11 -0
- package/dist/cells/SelectBoxRow.d.ts +11 -0
- package/dist/cells/TextCell.d.ts +25 -0
- package/dist/cells/index.d.ts +5 -0
- package/dist/cells.cjs +1 -0
- package/dist/cells.js +284 -0
- package/dist/charts/BarChart.d.ts +15 -0
- package/dist/charts/ChartContainer.d.ts +12 -0
- package/dist/charts/ChartLegend.d.ts +11 -0
- package/dist/charts/GaugeCard.d.ts +18 -0
- package/dist/charts/MetricsPanel.d.ts +61 -0
- package/dist/charts/PieChart.d.ts +13 -0
- package/dist/charts/ScatterChart.d.ts +25 -0
- package/dist/charts/Sparkline.d.ts +16 -0
- package/dist/charts/StackedAreaChart.d.ts +18 -0
- package/dist/charts/TimeSeriesChart.d.ts +43 -0
- package/dist/charts/formatters.d.ts +17 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/palette.d.ts +7 -0
- package/dist/charts/types.d.ts +67 -0
- package/dist/charts/useChartTheme.d.ts +13 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +967 -0
- package/dist/components/ActionCard.d.ts +22 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Card.d.ts +24 -0
- package/dist/components/Chip.d.ts +32 -0
- package/dist/components/ClipboardText.d.ts +14 -0
- package/dist/components/DetailsCard.d.ts +25 -0
- package/dist/components/EmptySearch.d.ts +12 -0
- package/dist/components/ExpandableSections.d.ts +51 -0
- package/dist/components/FileIcon.d.ts +12 -0
- package/dist/components/HotkeyHint.d.ts +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/KVCard.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/List.d.ts +29 -0
- package/dist/components/ListCard.d.ts +30 -0
- package/dist/components/ListItem.d.ts +27 -0
- package/dist/components/LoadingOverlay.d.ts +14 -0
- package/dist/components/MediaCard.d.ts +24 -0
- package/dist/components/MetricsSection.d.ts +37 -0
- package/dist/components/OverflowText.d.ts +12 -0
- package/dist/components/StatCard.d.ts +26 -0
- package/dist/components/StatusCard.d.ts +29 -0
- package/dist/components/TruncatedList.d.ts +13 -0
- package/dist/domain/DescriptionList.d.ts +12 -0
- package/dist/domain/EventsList.d.ts +11 -0
- package/dist/domain/FilterBar.d.ts +23 -0
- package/dist/domain/LogsViewer.d.ts +15 -0
- package/dist/domain/MetricCard.d.ts +14 -0
- package/dist/domain/ObjectInspector.d.ts +19 -0
- package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
- package/dist/domain/ResourceRef.d.ts +15 -0
- package/dist/domain/ResourceStatus.d.ts +17 -0
- package/dist/domain/SecretValueMask.d.ts +11 -0
- package/dist/domain/Timeline.d.ts +21 -0
- package/dist/domain/index.d.ts +23 -0
- package/dist/domain/types.d.ts +25 -0
- package/dist/domain.cjs +1 -0
- package/dist/domain.js +871 -0
- package/dist/editors/CodeEditor.d.ts +19 -0
- package/dist/editors/CommandPalette.d.ts +22 -0
- package/dist/editors/DiffViewer.d.ts +14 -0
- package/dist/editors/MarkdownPreview.d.ts +9 -0
- package/dist/editors/Terminal.d.ts +18 -0
- package/dist/editors/index.d.ts +11 -0
- package/dist/editors/themes.d.ts +4 -0
- package/dist/editors.cjs +42 -0
- package/dist/editors.js +38396 -0
- package/dist/feedback/Alert.d.ts +21 -0
- package/dist/feedback/ConnectionIndicator.d.ts +15 -0
- package/dist/feedback/EmptyState.d.ts +17 -0
- package/dist/feedback/ErrorState.d.ts +12 -0
- package/dist/feedback/IDEStatusFooter.d.ts +104 -0
- package/dist/feedback/NotificationStack.d.ts +32 -0
- package/dist/feedback/ProgressBar.d.ts +16 -0
- package/dist/feedback/ProgressRing.d.ts +26 -0
- package/dist/feedback/RunButton.d.ts +17 -0
- package/dist/feedback/Skeleton.d.ts +13 -0
- package/dist/feedback/StatusBar.d.ts +12 -0
- package/dist/feedback/StatusBarItem.d.ts +18 -0
- package/dist/feedback/StatusDot.d.ts +14 -0
- package/dist/feedback/StatusPill.d.ts +13 -0
- package/dist/feedback/index.d.ts +29 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1011 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +1632 -0
- package/dist/inputs/Autocomplete.d.ts +30 -0
- package/dist/inputs/Checkbox.d.ts +17 -0
- package/dist/inputs/ColorPicker.d.ts +13 -0
- package/dist/inputs/DebouncedInput.d.ts +10 -0
- package/dist/inputs/FormField.d.ts +15 -0
- package/dist/inputs/FormSection.d.ts +14 -0
- package/dist/inputs/KeyValueEditor.d.ts +17 -0
- package/dist/inputs/RadioGroup.d.ts +23 -0
- package/dist/inputs/SearchInput.d.ts +14 -0
- package/dist/inputs/Select.d.ts +32 -0
- package/dist/inputs/Slider.d.ts +24 -0
- package/dist/inputs/Switch.d.ts +17 -0
- package/dist/inputs/TagInput.d.ts +18 -0
- package/dist/inputs/TextArea.d.ts +26 -0
- package/dist/inputs/TextField.d.ts +39 -0
- package/dist/inputs/TimeRangePicker.d.ts +21 -0
- package/dist/inputs/index.d.ts +31 -0
- package/dist/inputs.cjs +21 -0
- package/dist/inputs.js +15834 -0
- package/dist/layout/AppShell.d.ts +18 -0
- package/dist/layout/DockLayout.d.ts +23 -0
- package/dist/layout/Inline.d.ts +15 -0
- package/dist/layout/Panel.d.ts +17 -0
- package/dist/layout/ResizableSplitPane.d.ts +18 -0
- package/dist/layout/Spacer.d.ts +9 -0
- package/dist/layout/Stack.d.ts +19 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/useResizablePanel.d.ts +18 -0
- package/dist/layout.cjs +5 -0
- package/dist/layout.js +378 -0
- package/dist/menus/ContextMenu.d.ts +12 -0
- package/dist/menus/DropdownMenu.d.ts +20 -0
- package/dist/menus/MenuBar.d.ts +11 -0
- package/dist/menus/NestedMenuItem.d.ts +13 -0
- package/dist/menus/SplitButton.d.ts +15 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/types.d.ts +24 -0
- package/dist/menus.cjs +1 -0
- package/dist/menus.js +355 -0
- package/dist/navigation/Breadcrumbs.d.ts +18 -0
- package/dist/navigation/DraggableTabs.d.ts +24 -0
- package/dist/navigation/Pagination.d.ts +15 -0
- package/dist/navigation/PersistentTabPanel.d.ts +13 -0
- package/dist/navigation/Stepper.d.ts +19 -0
- package/dist/navigation/TabPanel.d.ts +11 -0
- package/dist/navigation/Tabs.d.ts +26 -0
- package/dist/navigation/TreeView.d.ts +27 -0
- package/dist/navigation/index.d.ts +16 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.js +429 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Drawer.d.ts +17 -0
- package/dist/overlays/ErrorOverlay.d.ts +21 -0
- package/dist/overlays/Modal.d.ts +14 -0
- package/dist/overlays/NotificationCenter.d.ts +31 -0
- package/dist/overlays/Popover.d.ts +15 -0
- package/dist/overlays/Spotlight.d.ts +24 -0
- package/dist/overlays/ToastProvider.d.ts +32 -0
- package/dist/overlays/Tooltip.d.ts +15 -0
- package/dist/overlays/index.d.ts +20 -0
- package/dist/overlays/useToast.d.ts +21 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.js +865 -0
- package/dist/sidebars/ActivityBar.d.ts +16 -0
- package/dist/sidebars/NavMenu.d.ts +27 -0
- package/dist/sidebars/NavMenu.test.d.ts +1 -0
- package/dist/sidebars/PropertyGrid.d.ts +16 -0
- package/dist/sidebars/SidebarGroup.d.ts +15 -0
- package/dist/sidebars/SidebarPanel.d.ts +19 -0
- package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
- package/dist/sidebars/index.d.ts +13 -0
- package/dist/sidebars/types.d.ts +29 -0
- package/dist/sidebars.cjs +1 -0
- package/dist/sidebars.js +762 -0
- package/dist/table/ColumnFilter.d.ts +10 -0
- package/dist/table/DataTable.d.ts +23 -0
- package/dist/table/IDETable.d.ts +48 -0
- package/dist/table/TableEmptyState.d.ts +12 -0
- package/dist/table/TableSkeleton.d.ts +11 -0
- package/dist/table/TableToolbar.d.ts +15 -0
- package/dist/table/index.d.ts +12 -0
- package/dist/table/types.d.ts +4 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +580 -0
- package/dist/theme/AppTheme.d.ts +14 -0
- package/dist/theme/customizations/dataDisplay.d.ts +2 -0
- package/dist/theme/customizations/feedback.d.ts +2 -0
- package/dist/theme/customizations/inputs.d.ts +2 -0
- package/dist/theme/customizations/navigation.d.ts +2 -0
- package/dist/theme/index.d.ts +36 -0
- package/dist/theme/primitives.d.ts +234 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1362 -0
- package/dist/tokens.css +252 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/maps.d.ts +25 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +96 -0
- package/dist/typography/CodeBlock.d.ts +15 -0
- package/dist/typography/CodeInline.d.ts +10 -0
- package/dist/typography/Heading.d.ts +13 -0
- package/dist/typography/Link.d.ts +18 -0
- package/dist/typography/Text.d.ts +22 -0
- package/dist/typography/index.d.ts +10 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +120 -0
- package/dist/ui.css +1 -0
- package/dist/units-BuBKbqQ7.js +54 -0
- package/dist/units-CDpdlN1W.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/language.d.ts +4 -0
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/units.d.ts +7 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +78 -0
- package/package.json +261 -0
package/dist/overlays.js
ADDED
|
@@ -0,0 +1,865 @@
|
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import X from "@mui/material/Dialog";
|
|
3
|
+
import U from "@mui/material/DialogTitle";
|
|
4
|
+
import _ from "@mui/material/DialogContent";
|
|
5
|
+
import K from "@mui/material/DialogActions";
|
|
6
|
+
import k from "@mui/material/IconButton";
|
|
7
|
+
import O from "@mui/icons-material/Close";
|
|
8
|
+
import s from "@mui/material/Box";
|
|
9
|
+
import h from "@mui/material/Typography";
|
|
10
|
+
import { B as W } from "./Button-lr02bh_m.js";
|
|
11
|
+
import L from "@mui/material/Modal";
|
|
12
|
+
import { useState as P, useRef as C, useCallback as M, useEffect as A, useReducer as Y, createContext as q, useContext as J, useMemo as Q } from "react";
|
|
13
|
+
import N from "@mui/material/Drawer";
|
|
14
|
+
import { T as _e } from "./Tooltip-BEVuYuZ3.js";
|
|
15
|
+
import G from "@mui/material/Popover";
|
|
16
|
+
import V from "@mui/material/Snackbar";
|
|
17
|
+
import Z from "@mui/material/Alert";
|
|
18
|
+
import { toMuiColor as ee, toCssColor as re } from "./types.js";
|
|
19
|
+
import { LuBell as F, LuCheck as oe, LuX as j, LuTriangleAlert as te } from "react-icons/lu";
|
|
20
|
+
import B from "@mui/material/Button";
|
|
21
|
+
import ne from "@mui/material/InputBase";
|
|
22
|
+
import ie from "@mui/icons-material/Search";
|
|
23
|
+
const ae = {
|
|
24
|
+
sm: "xs",
|
|
25
|
+
md: "sm",
|
|
26
|
+
lg: "md",
|
|
27
|
+
xl: "lg"
|
|
28
|
+
};
|
|
29
|
+
function le({
|
|
30
|
+
open: o,
|
|
31
|
+
onClose: r,
|
|
32
|
+
title: t,
|
|
33
|
+
icon: l,
|
|
34
|
+
size: d = "md",
|
|
35
|
+
variant: f = "default",
|
|
36
|
+
actions: c,
|
|
37
|
+
disableBackdropClose: n = !1,
|
|
38
|
+
children: u,
|
|
39
|
+
sx: a
|
|
40
|
+
}) {
|
|
41
|
+
const p = d === "fullscreen", x = (w, S) => {
|
|
42
|
+
S === "backdropClick" && n || r();
|
|
43
|
+
}, b = c || (f === "confirm" ? /* @__PURE__ */ i(D, { children: [
|
|
44
|
+
/* @__PURE__ */ e(W, { emphasis: "ghost", color: "neutral", size: "sm", onClick: r, children: "Cancel" }),
|
|
45
|
+
/* @__PURE__ */ e(W, { emphasis: "solid", color: "primary", size: "sm", onClick: r, children: "Confirm" })
|
|
46
|
+
] }) : f === "danger" ? /* @__PURE__ */ i(D, { children: [
|
|
47
|
+
/* @__PURE__ */ e(W, { emphasis: "ghost", color: "neutral", size: "sm", onClick: r, children: "Cancel" }),
|
|
48
|
+
/* @__PURE__ */ e(W, { emphasis: "solid", color: "danger", size: "sm", onClick: r, children: "Delete" })
|
|
49
|
+
] }) : null);
|
|
50
|
+
return /* @__PURE__ */ i(
|
|
51
|
+
X,
|
|
52
|
+
{
|
|
53
|
+
open: o,
|
|
54
|
+
onClose: x,
|
|
55
|
+
fullScreen: p,
|
|
56
|
+
maxWidth: p ? !1 : ae[d],
|
|
57
|
+
fullWidth: !0,
|
|
58
|
+
sx: a,
|
|
59
|
+
children: [
|
|
60
|
+
t && /* @__PURE__ */ i(U, { sx: { display: "flex", alignItems: "center", gap: 1, pr: 6 }, children: [
|
|
61
|
+
l && /* @__PURE__ */ e(s, { sx: { display: "flex", color: "var(--ov-fg-muted)" }, children: l }),
|
|
62
|
+
/* @__PURE__ */ e(h, { variant: "h6", component: "span", sx: { fontWeight: 600 }, children: t }),
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
k,
|
|
65
|
+
{
|
|
66
|
+
size: "small",
|
|
67
|
+
onClick: r,
|
|
68
|
+
sx: { position: "absolute", right: 8, top: 8, color: "var(--ov-fg-faint)" },
|
|
69
|
+
"aria-label": "Close",
|
|
70
|
+
children: /* @__PURE__ */ e(O, { fontSize: "small" })
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ e(_, { children: u }),
|
|
75
|
+
b && /* @__PURE__ */ e(K, { sx: { px: 3, pb: 2 }, children: b })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
le.displayName = "Dialog";
|
|
81
|
+
const se = {
|
|
82
|
+
sm: 400,
|
|
83
|
+
md: 600,
|
|
84
|
+
lg: 800,
|
|
85
|
+
xl: 1e3
|
|
86
|
+
};
|
|
87
|
+
function ce({
|
|
88
|
+
open: o,
|
|
89
|
+
onClose: r,
|
|
90
|
+
children: t,
|
|
91
|
+
size: l = "md",
|
|
92
|
+
backdrop: d = !0,
|
|
93
|
+
sx: f
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */ e(
|
|
96
|
+
L,
|
|
97
|
+
{
|
|
98
|
+
open: o,
|
|
99
|
+
onClose: r,
|
|
100
|
+
hideBackdrop: !d,
|
|
101
|
+
children: /* @__PURE__ */ e(
|
|
102
|
+
s,
|
|
103
|
+
{
|
|
104
|
+
sx: {
|
|
105
|
+
position: "absolute",
|
|
106
|
+
top: "50%",
|
|
107
|
+
left: "50%",
|
|
108
|
+
transform: "translate(-50%, -50%)",
|
|
109
|
+
width: se[l],
|
|
110
|
+
maxWidth: "90vw",
|
|
111
|
+
maxHeight: "90vh",
|
|
112
|
+
overflow: "auto",
|
|
113
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
114
|
+
border: "1px solid var(--ov-border-default)",
|
|
115
|
+
borderRadius: "8px",
|
|
116
|
+
boxShadow: 24,
|
|
117
|
+
p: 3,
|
|
118
|
+
...typeof f == "object" && !Array.isArray(f) ? f : {}
|
|
119
|
+
},
|
|
120
|
+
children: t
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
ce.displayName = "Modal";
|
|
127
|
+
function de({
|
|
128
|
+
open: o,
|
|
129
|
+
onClose: r,
|
|
130
|
+
anchor: t = "right",
|
|
131
|
+
size: l = 360,
|
|
132
|
+
resizable: d = !1,
|
|
133
|
+
persistent: f = !1,
|
|
134
|
+
children: c,
|
|
135
|
+
title: n,
|
|
136
|
+
sx: u
|
|
137
|
+
}) {
|
|
138
|
+
const a = t === "left" || t === "right", [p, x] = P(typeof l == "number" ? l : 360), g = C(!1), b = C(0), w = C(0), S = M((z) => {
|
|
139
|
+
g.current = !0, b.current = a ? z.clientX : z.clientY, w.current = p, z.preventDefault();
|
|
140
|
+
}, [a, p]);
|
|
141
|
+
return A(() => {
|
|
142
|
+
if (!d) return;
|
|
143
|
+
const z = (v) => {
|
|
144
|
+
if (!g.current) return;
|
|
145
|
+
const m = a ? t === "right" ? b.current - v.clientX : v.clientX - b.current : b.current - v.clientY;
|
|
146
|
+
x(Math.max(200, w.current + m));
|
|
147
|
+
}, I = () => {
|
|
148
|
+
g.current = !1;
|
|
149
|
+
};
|
|
150
|
+
return document.addEventListener("mousemove", z), document.addEventListener("mouseup", I), () => {
|
|
151
|
+
document.removeEventListener("mousemove", z), document.removeEventListener("mouseup", I);
|
|
152
|
+
};
|
|
153
|
+
}, [d, a, t]), /* @__PURE__ */ i(
|
|
154
|
+
N,
|
|
155
|
+
{
|
|
156
|
+
open: o,
|
|
157
|
+
onClose: r,
|
|
158
|
+
anchor: t,
|
|
159
|
+
variant: f ? "persistent" : "temporary",
|
|
160
|
+
slotProps: {
|
|
161
|
+
paper: {
|
|
162
|
+
sx: {
|
|
163
|
+
...a ? { width: d ? p : l } : { height: d ? p : l },
|
|
164
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
165
|
+
borderColor: "var(--ov-border-default)",
|
|
166
|
+
...typeof u == "object" && !Array.isArray(u) ? u : {}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
children: [
|
|
171
|
+
d && /* @__PURE__ */ e(
|
|
172
|
+
s,
|
|
173
|
+
{
|
|
174
|
+
onMouseDown: S,
|
|
175
|
+
sx: {
|
|
176
|
+
position: "absolute",
|
|
177
|
+
...a ? {
|
|
178
|
+
top: 0,
|
|
179
|
+
[t === "right" ? "left" : "right"]: 0,
|
|
180
|
+
width: 4,
|
|
181
|
+
height: "100%",
|
|
182
|
+
cursor: "col-resize"
|
|
183
|
+
} : {
|
|
184
|
+
left: 0,
|
|
185
|
+
top: 0,
|
|
186
|
+
height: 4,
|
|
187
|
+
width: "100%",
|
|
188
|
+
cursor: "row-resize"
|
|
189
|
+
},
|
|
190
|
+
zIndex: 1,
|
|
191
|
+
"&:hover": { bgcolor: "var(--ov-accent)" },
|
|
192
|
+
transition: "background-color 150ms"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
n && /* @__PURE__ */ i(
|
|
197
|
+
s,
|
|
198
|
+
{
|
|
199
|
+
sx: {
|
|
200
|
+
display: "flex",
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
justifyContent: "space-between",
|
|
203
|
+
px: 2,
|
|
204
|
+
py: 1.5,
|
|
205
|
+
borderBottom: "1px solid var(--ov-border-default)"
|
|
206
|
+
},
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ e(h, { variant: "subtitle1", sx: { fontWeight: 600, color: "var(--ov-fg-base)" }, children: n }),
|
|
209
|
+
/* @__PURE__ */ e(k, { size: "small", onClick: r, "aria-label": "Close", children: /* @__PURE__ */ e(O, { fontSize: "small" }) })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ e(s, { sx: { flex: 1, overflow: "auto", p: n ? 2 : 0 }, children: c })
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
de.displayName = "Drawer";
|
|
219
|
+
const fe = {
|
|
220
|
+
top: { anchorOrigin: { vertical: "top", horizontal: "center" }, transformOrigin: { vertical: "bottom", horizontal: "center" } },
|
|
221
|
+
bottom: { anchorOrigin: { vertical: "bottom", horizontal: "center" }, transformOrigin: { vertical: "top", horizontal: "center" } },
|
|
222
|
+
left: { anchorOrigin: { vertical: "center", horizontal: "left" }, transformOrigin: { vertical: "center", horizontal: "right" } },
|
|
223
|
+
right: { anchorOrigin: { vertical: "center", horizontal: "right" }, transformOrigin: { vertical: "center", horizontal: "left" } }
|
|
224
|
+
};
|
|
225
|
+
function pe({
|
|
226
|
+
open: o,
|
|
227
|
+
onClose: r,
|
|
228
|
+
anchorEl: t,
|
|
229
|
+
children: l,
|
|
230
|
+
width: d,
|
|
231
|
+
placement: f = "bottom",
|
|
232
|
+
sx: c
|
|
233
|
+
}) {
|
|
234
|
+
const n = fe[f];
|
|
235
|
+
return /* @__PURE__ */ e(
|
|
236
|
+
G,
|
|
237
|
+
{
|
|
238
|
+
open: o,
|
|
239
|
+
onClose: r,
|
|
240
|
+
anchorEl: t,
|
|
241
|
+
anchorOrigin: n.anchorOrigin,
|
|
242
|
+
transformOrigin: n.transformOrigin,
|
|
243
|
+
slotProps: {
|
|
244
|
+
paper: {
|
|
245
|
+
sx: {
|
|
246
|
+
width: d,
|
|
247
|
+
mt: f === "bottom" ? 0.5 : void 0,
|
|
248
|
+
mb: f === "top" ? 0.5 : void 0,
|
|
249
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
250
|
+
border: "1px solid var(--ov-border-default)",
|
|
251
|
+
...typeof c == "object" && !Array.isArray(c) ? c : {}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
children: l
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
pe.displayName = "Popover";
|
|
260
|
+
const R = q(null);
|
|
261
|
+
function ve(o, r) {
|
|
262
|
+
switch (r.type) {
|
|
263
|
+
case "ADD":
|
|
264
|
+
return o.some((t) => t.message === r.toast.message) ? o : [...o, r.toast];
|
|
265
|
+
case "DISMISS":
|
|
266
|
+
return o.filter((t) => t.id !== r.id);
|
|
267
|
+
case "DISMISS_ALL":
|
|
268
|
+
return [];
|
|
269
|
+
default:
|
|
270
|
+
return o;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
const ue = {
|
|
274
|
+
"top-right": { vertical: "top", horizontal: "right" },
|
|
275
|
+
"top-left": { vertical: "top", horizontal: "left" },
|
|
276
|
+
"bottom-right": { vertical: "bottom", horizontal: "right" },
|
|
277
|
+
"bottom-left": { vertical: "bottom", horizontal: "left" }
|
|
278
|
+
};
|
|
279
|
+
function me({
|
|
280
|
+
children: o,
|
|
281
|
+
maxVisible: r = 3,
|
|
282
|
+
position: t = "bottom-left"
|
|
283
|
+
}) {
|
|
284
|
+
const [l, d] = Y(ve, []), f = C(/* @__PURE__ */ new Map());
|
|
285
|
+
A(() => {
|
|
286
|
+
for (const a of l) {
|
|
287
|
+
if (f.current.has(a.id)) continue;
|
|
288
|
+
const p = a.duration ?? 5e3, x = setTimeout(() => {
|
|
289
|
+
d({ type: "DISMISS", id: a.id }), f.current.delete(a.id);
|
|
290
|
+
}, p);
|
|
291
|
+
f.current.set(a.id, x);
|
|
292
|
+
}
|
|
293
|
+
for (const [a, p] of f.current)
|
|
294
|
+
l.some((x) => x.id === a) || (clearTimeout(p), f.current.delete(a));
|
|
295
|
+
}, [l]), A(() => () => {
|
|
296
|
+
f.current.forEach((a) => clearTimeout(a));
|
|
297
|
+
}, []);
|
|
298
|
+
const c = ue[t], n = l.slice(-r), u = {
|
|
299
|
+
success: "success",
|
|
300
|
+
info: "info",
|
|
301
|
+
warning: "warning",
|
|
302
|
+
error: "error",
|
|
303
|
+
danger: "error",
|
|
304
|
+
primary: "info",
|
|
305
|
+
secondary: "info",
|
|
306
|
+
neutral: "info",
|
|
307
|
+
accent: "info",
|
|
308
|
+
muted: "info"
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ i(R.Provider, { value: { dispatch: d }, children: [
|
|
311
|
+
o,
|
|
312
|
+
/* @__PURE__ */ e(
|
|
313
|
+
V,
|
|
314
|
+
{
|
|
315
|
+
open: n.length > 0,
|
|
316
|
+
anchorOrigin: c,
|
|
317
|
+
children: /* @__PURE__ */ e(s, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: n.map((a) => {
|
|
318
|
+
const p = a.color ? ee(a.color) : "info", x = u[p] ?? "info";
|
|
319
|
+
return /* @__PURE__ */ e(
|
|
320
|
+
Z,
|
|
321
|
+
{
|
|
322
|
+
severity: x,
|
|
323
|
+
variant: "filled",
|
|
324
|
+
action: /* @__PURE__ */ i(D, { children: [
|
|
325
|
+
a.action,
|
|
326
|
+
/* @__PURE__ */ e(
|
|
327
|
+
k,
|
|
328
|
+
{
|
|
329
|
+
size: "small",
|
|
330
|
+
color: "inherit",
|
|
331
|
+
onClick: () => d({ type: "DISMISS", id: a.id }),
|
|
332
|
+
children: /* @__PURE__ */ e(O, { fontSize: "small" })
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
] }),
|
|
336
|
+
sx: { minWidth: 280, boxShadow: 6 },
|
|
337
|
+
children: a.message
|
|
338
|
+
},
|
|
339
|
+
a.id
|
|
340
|
+
);
|
|
341
|
+
}) })
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] });
|
|
345
|
+
}
|
|
346
|
+
me.displayName = "ToastProvider";
|
|
347
|
+
let he = 0;
|
|
348
|
+
function $e() {
|
|
349
|
+
const o = J(R);
|
|
350
|
+
if (!o) throw new Error("useToast must be used within a ToastProvider");
|
|
351
|
+
const { dispatch: r } = o, t = M(
|
|
352
|
+
(c) => {
|
|
353
|
+
r({
|
|
354
|
+
type: "ADD",
|
|
355
|
+
toast: {
|
|
356
|
+
id: `toast-${he++}`,
|
|
357
|
+
message: c.message,
|
|
358
|
+
color: c.color,
|
|
359
|
+
duration: c.duration,
|
|
360
|
+
action: c.action,
|
|
361
|
+
timestamp: Date.now()
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
[r]
|
|
366
|
+
), l = Q(() => {
|
|
367
|
+
const c = ((n) => t(n));
|
|
368
|
+
return c.success = (n) => t({ message: n, color: "success" }), c.error = (n) => t({ message: n, color: "error" }), c.warning = (n) => t({ message: n, color: "warning" }), c.info = (n) => t({ message: n, color: "info" }), c;
|
|
369
|
+
}, [t]), d = M(
|
|
370
|
+
(c) => r({ type: "DISMISS", id: c }),
|
|
371
|
+
[r]
|
|
372
|
+
), f = M(
|
|
373
|
+
() => r({ type: "DISMISS_ALL" }),
|
|
374
|
+
[r]
|
|
375
|
+
);
|
|
376
|
+
return { toast: l, dismiss: d, dismissAll: f };
|
|
377
|
+
}
|
|
378
|
+
function xe(o) {
|
|
379
|
+
const t = (/* @__PURE__ */ new Date()).getTime() - o.getTime(), l = Math.floor(t / 6e4);
|
|
380
|
+
if (l < 1) return "Just now";
|
|
381
|
+
if (l < 60) return `${l}m ago`;
|
|
382
|
+
const d = Math.floor(l / 60);
|
|
383
|
+
return d < 24 ? `${d}h ago` : `${Math.floor(d / 24)}d ago`;
|
|
384
|
+
}
|
|
385
|
+
function ge({
|
|
386
|
+
open: o,
|
|
387
|
+
onClose: r,
|
|
388
|
+
notifications: t,
|
|
389
|
+
onDismiss: l,
|
|
390
|
+
onMarkRead: d,
|
|
391
|
+
onClearAll: f,
|
|
392
|
+
width: c = 360,
|
|
393
|
+
sx: n
|
|
394
|
+
}) {
|
|
395
|
+
const u = t.filter((p) => !p.read), a = t.filter((p) => p.read);
|
|
396
|
+
return /* @__PURE__ */ i(
|
|
397
|
+
N,
|
|
398
|
+
{
|
|
399
|
+
anchor: "right",
|
|
400
|
+
open: o,
|
|
401
|
+
onClose: r,
|
|
402
|
+
slotProps: {
|
|
403
|
+
paper: {
|
|
404
|
+
sx: {
|
|
405
|
+
width: c,
|
|
406
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
407
|
+
borderLeft: "1px solid var(--ov-border-default)",
|
|
408
|
+
...typeof n == "object" && !Array.isArray(n) ? n : {}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ i(
|
|
414
|
+
s,
|
|
415
|
+
{
|
|
416
|
+
sx: {
|
|
417
|
+
display: "flex",
|
|
418
|
+
alignItems: "center",
|
|
419
|
+
justifyContent: "space-between",
|
|
420
|
+
px: 2,
|
|
421
|
+
py: 1.5,
|
|
422
|
+
borderBottom: "1px solid var(--ov-border-default)"
|
|
423
|
+
},
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ i(s, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
426
|
+
/* @__PURE__ */ e(F, { size: 16 }),
|
|
427
|
+
/* @__PURE__ */ e(h, { sx: { fontWeight: 600, fontSize: "var(--ov-text-sm)", color: "var(--ov-fg-base)" }, children: "Notifications" }),
|
|
428
|
+
u.length > 0 && /* @__PURE__ */ e(
|
|
429
|
+
s,
|
|
430
|
+
{
|
|
431
|
+
sx: {
|
|
432
|
+
px: 0.75,
|
|
433
|
+
py: 0.125,
|
|
434
|
+
borderRadius: 999,
|
|
435
|
+
bgcolor: "var(--ov-accent-subtle)",
|
|
436
|
+
color: "var(--ov-accent-fg)",
|
|
437
|
+
fontSize: "var(--ov-text-xs)",
|
|
438
|
+
fontWeight: 600
|
|
439
|
+
},
|
|
440
|
+
children: u.length
|
|
441
|
+
}
|
|
442
|
+
)
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ i(s, { sx: { display: "flex", gap: 0.5 }, children: [
|
|
445
|
+
f && t.length > 0 && /* @__PURE__ */ e(k, { size: "small", onClick: f, sx: { color: "var(--ov-fg-muted)" }, children: /* @__PURE__ */ e(oe, { size: 14 }) }),
|
|
446
|
+
/* @__PURE__ */ e(k, { size: "small", onClick: r, sx: { color: "var(--ov-fg-muted)" }, children: /* @__PURE__ */ e(j, { size: 14 }) })
|
|
447
|
+
] })
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
),
|
|
451
|
+
/* @__PURE__ */ i(s, { sx: { flex: 1, overflow: "auto" }, children: [
|
|
452
|
+
t.length === 0 && /* @__PURE__ */ e(s, { sx: { p: 4, textAlign: "center" }, children: /* @__PURE__ */ e(h, { sx: { color: "var(--ov-fg-faint)", fontSize: "var(--ov-text-sm)" }, children: "No notifications" }) }),
|
|
453
|
+
u.length > 0 && /* @__PURE__ */ i(D, { children: [
|
|
454
|
+
/* @__PURE__ */ e(h, { sx: { px: 2, pt: 1.5, pb: 0.5, fontSize: "var(--ov-text-xs)", fontWeight: 600, color: "var(--ov-fg-faint)", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "Unread" }),
|
|
455
|
+
u.map((p) => /* @__PURE__ */ e(E, { item: p, onDismiss: l, onMarkRead: d }, p.id))
|
|
456
|
+
] }),
|
|
457
|
+
a.length > 0 && /* @__PURE__ */ i(D, { children: [
|
|
458
|
+
/* @__PURE__ */ e(h, { sx: { px: 2, pt: 1.5, pb: 0.5, fontSize: "var(--ov-text-xs)", fontWeight: 600, color: "var(--ov-fg-faint)", textTransform: "uppercase", letterSpacing: "0.05em" }, children: "Earlier" }),
|
|
459
|
+
a.map((p) => /* @__PURE__ */ e(E, { item: p, onDismiss: l, onMarkRead: d }, p.id))
|
|
460
|
+
] })
|
|
461
|
+
] })
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
function E({
|
|
467
|
+
item: o,
|
|
468
|
+
onDismiss: r,
|
|
469
|
+
onMarkRead: t
|
|
470
|
+
}) {
|
|
471
|
+
return /* @__PURE__ */ i(
|
|
472
|
+
s,
|
|
473
|
+
{
|
|
474
|
+
sx: {
|
|
475
|
+
px: 2,
|
|
476
|
+
py: 1.5,
|
|
477
|
+
display: "flex",
|
|
478
|
+
gap: 1.5,
|
|
479
|
+
"&:hover": { bgcolor: "var(--ov-state-hover)" },
|
|
480
|
+
borderBottom: "1px solid var(--ov-border-muted)",
|
|
481
|
+
...!o.read && { bgcolor: "var(--ov-accent-subtle)", opacity: 1 }
|
|
482
|
+
},
|
|
483
|
+
onClick: () => t?.(o.id),
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ e(s, { sx: { pt: 0.25, color: o.color ? re(o.color) : "var(--ov-fg-muted)", flexShrink: 0 }, children: o.icon ?? /* @__PURE__ */ e(F, { size: 14 }) }),
|
|
486
|
+
/* @__PURE__ */ i(s, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
487
|
+
/* @__PURE__ */ i(s, { sx: { display: "flex", justifyContent: "space-between", alignItems: "baseline", mb: 0.25 }, children: [
|
|
488
|
+
/* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-sm)", fontWeight: 500, color: "var(--ov-fg-base)" }, children: o.title }),
|
|
489
|
+
/* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-xs)", color: "var(--ov-fg-faint)", whiteSpace: "nowrap", ml: 1 }, children: xe(o.timestamp) })
|
|
490
|
+
] }),
|
|
491
|
+
o.message && /* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-xs)", color: "var(--ov-fg-muted)", lineHeight: 1.4 }, children: o.message }),
|
|
492
|
+
/* @__PURE__ */ i(s, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 0.5 }, children: [
|
|
493
|
+
o.action && /* @__PURE__ */ e(
|
|
494
|
+
h,
|
|
495
|
+
{
|
|
496
|
+
onClick: (l) => {
|
|
497
|
+
l.stopPropagation(), o.action.onClick();
|
|
498
|
+
},
|
|
499
|
+
sx: { fontSize: "var(--ov-text-xs)", color: "var(--ov-accent-fg)", cursor: "pointer", "&:hover": { textDecoration: "underline" } },
|
|
500
|
+
children: o.action.label
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
r && /* @__PURE__ */ e(
|
|
504
|
+
k,
|
|
505
|
+
{
|
|
506
|
+
size: "small",
|
|
507
|
+
onClick: (l) => {
|
|
508
|
+
l.stopPropagation(), r(o.id);
|
|
509
|
+
},
|
|
510
|
+
sx: { p: "2px", color: "var(--ov-fg-faint)", "&:hover": { color: "var(--ov-fg-default)" } },
|
|
511
|
+
children: /* @__PURE__ */ e(j, { size: 12 })
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
] })
|
|
515
|
+
] })
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
ge.displayName = "NotificationCenter";
|
|
521
|
+
function be({
|
|
522
|
+
open: o,
|
|
523
|
+
onClose: r,
|
|
524
|
+
title: t = "Error",
|
|
525
|
+
message: l,
|
|
526
|
+
file: d,
|
|
527
|
+
line: f,
|
|
528
|
+
stack: c,
|
|
529
|
+
actions: n,
|
|
530
|
+
sx: u
|
|
531
|
+
}) {
|
|
532
|
+
return o ? /* @__PURE__ */ e(
|
|
533
|
+
s,
|
|
534
|
+
{
|
|
535
|
+
sx: {
|
|
536
|
+
position: "fixed",
|
|
537
|
+
inset: 0,
|
|
538
|
+
zIndex: 9999,
|
|
539
|
+
display: "flex",
|
|
540
|
+
alignItems: "center",
|
|
541
|
+
justifyContent: "center",
|
|
542
|
+
bgcolor: "rgba(0, 0, 0, 0.6)",
|
|
543
|
+
backdropFilter: "blur(4px)",
|
|
544
|
+
...typeof u == "object" && !Array.isArray(u) ? u : {}
|
|
545
|
+
},
|
|
546
|
+
children: /* @__PURE__ */ i(
|
|
547
|
+
s,
|
|
548
|
+
{
|
|
549
|
+
sx: {
|
|
550
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
551
|
+
border: "1px solid var(--ov-danger-default)",
|
|
552
|
+
borderRadius: "8px",
|
|
553
|
+
maxWidth: 560,
|
|
554
|
+
width: "90%",
|
|
555
|
+
maxHeight: "80vh",
|
|
556
|
+
overflow: "auto",
|
|
557
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
558
|
+
},
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ i(
|
|
561
|
+
s,
|
|
562
|
+
{
|
|
563
|
+
sx: {
|
|
564
|
+
display: "flex",
|
|
565
|
+
alignItems: "center",
|
|
566
|
+
justifyContent: "space-between",
|
|
567
|
+
px: 2.5,
|
|
568
|
+
py: 1.5,
|
|
569
|
+
borderBottom: "1px solid var(--ov-border-default)",
|
|
570
|
+
bgcolor: "var(--ov-danger-default)"
|
|
571
|
+
},
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ i(s, { sx: { display: "flex", alignItems: "center", gap: 1, color: "#fff" }, children: [
|
|
574
|
+
/* @__PURE__ */ e(te, { size: 16 }),
|
|
575
|
+
/* @__PURE__ */ e(h, { sx: { fontWeight: 600, fontSize: "var(--ov-text-sm)" }, children: t })
|
|
576
|
+
] }),
|
|
577
|
+
/* @__PURE__ */ e(k, { size: "small", onClick: r, sx: { color: "#fff" }, children: /* @__PURE__ */ e(j, { size: 16 }) })
|
|
578
|
+
]
|
|
579
|
+
}
|
|
580
|
+
),
|
|
581
|
+
/* @__PURE__ */ i(s, { sx: { px: 2.5, py: 2 }, children: [
|
|
582
|
+
/* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-sm)", color: "var(--ov-fg-base)", mb: 1.5, lineHeight: 1.5 }, children: l }),
|
|
583
|
+
d && /* @__PURE__ */ i(
|
|
584
|
+
s,
|
|
585
|
+
{
|
|
586
|
+
sx: {
|
|
587
|
+
display: "flex",
|
|
588
|
+
alignItems: "center",
|
|
589
|
+
gap: 0.5,
|
|
590
|
+
mb: 1.5,
|
|
591
|
+
fontFamily: "var(--ov-font-mono)",
|
|
592
|
+
fontSize: "var(--ov-text-xs)",
|
|
593
|
+
color: "var(--ov-fg-muted)"
|
|
594
|
+
},
|
|
595
|
+
children: [
|
|
596
|
+
/* @__PURE__ */ e("span", { children: d }),
|
|
597
|
+
f !== void 0 && /* @__PURE__ */ i("span", { children: [
|
|
598
|
+
":",
|
|
599
|
+
f
|
|
600
|
+
] })
|
|
601
|
+
]
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
c && /* @__PURE__ */ e(
|
|
605
|
+
s,
|
|
606
|
+
{
|
|
607
|
+
component: "pre",
|
|
608
|
+
sx: {
|
|
609
|
+
bgcolor: "var(--ov-bg-surface-inset)",
|
|
610
|
+
border: "1px solid var(--ov-border-muted)",
|
|
611
|
+
borderRadius: "4px",
|
|
612
|
+
p: 1.5,
|
|
613
|
+
fontSize: "var(--ov-text-xs)",
|
|
614
|
+
fontFamily: "var(--ov-font-mono)",
|
|
615
|
+
color: "var(--ov-fg-muted)",
|
|
616
|
+
overflow: "auto",
|
|
617
|
+
maxHeight: 200,
|
|
618
|
+
whiteSpace: "pre-wrap",
|
|
619
|
+
wordBreak: "break-all",
|
|
620
|
+
m: 0
|
|
621
|
+
},
|
|
622
|
+
children: c
|
|
623
|
+
}
|
|
624
|
+
)
|
|
625
|
+
] }),
|
|
626
|
+
n && n.length > 0 && /* @__PURE__ */ i(
|
|
627
|
+
s,
|
|
628
|
+
{
|
|
629
|
+
sx: {
|
|
630
|
+
display: "flex",
|
|
631
|
+
justifyContent: "flex-end",
|
|
632
|
+
gap: 1,
|
|
633
|
+
px: 2.5,
|
|
634
|
+
py: 1.5,
|
|
635
|
+
borderTop: "1px solid var(--ov-border-default)"
|
|
636
|
+
},
|
|
637
|
+
children: [
|
|
638
|
+
n.map((a) => /* @__PURE__ */ e(
|
|
639
|
+
B,
|
|
640
|
+
{
|
|
641
|
+
size: "small",
|
|
642
|
+
variant: "outlined",
|
|
643
|
+
onClick: a.onClick,
|
|
644
|
+
sx: { textTransform: "none", fontSize: "var(--ov-text-sm)" },
|
|
645
|
+
children: a.label
|
|
646
|
+
},
|
|
647
|
+
a.label
|
|
648
|
+
)),
|
|
649
|
+
/* @__PURE__ */ e(
|
|
650
|
+
B,
|
|
651
|
+
{
|
|
652
|
+
size: "small",
|
|
653
|
+
variant: "contained",
|
|
654
|
+
onClick: r,
|
|
655
|
+
sx: { textTransform: "none", fontSize: "var(--ov-text-sm)" },
|
|
656
|
+
children: "Dismiss"
|
|
657
|
+
}
|
|
658
|
+
)
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
)
|
|
662
|
+
]
|
|
663
|
+
}
|
|
664
|
+
)
|
|
665
|
+
}
|
|
666
|
+
) : null;
|
|
667
|
+
}
|
|
668
|
+
be.displayName = "ErrorOverlay";
|
|
669
|
+
function ye({
|
|
670
|
+
open: o,
|
|
671
|
+
onClose: r,
|
|
672
|
+
onSearch: t,
|
|
673
|
+
placeholder: l = "Search commands, files, settings...",
|
|
674
|
+
recentItems: d,
|
|
675
|
+
width: f = 560,
|
|
676
|
+
sx: c
|
|
677
|
+
}) {
|
|
678
|
+
const [n, u] = P(""), [a, p] = P([]), [x, g] = P(0), b = C(null);
|
|
679
|
+
A(() => {
|
|
680
|
+
o || (u(""), p([]), g(0));
|
|
681
|
+
}, [o]), A(() => {
|
|
682
|
+
if (!n.trim()) {
|
|
683
|
+
p([]), g(0);
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
let v = !1;
|
|
687
|
+
const m = t(n);
|
|
688
|
+
return m instanceof Promise ? m.then((y) => {
|
|
689
|
+
v || (p(y), g(0));
|
|
690
|
+
}) : (p(m), g(0)), () => {
|
|
691
|
+
v = !0;
|
|
692
|
+
};
|
|
693
|
+
}, [n, t]);
|
|
694
|
+
const w = n.trim() ? a : d ?? [], S = /* @__PURE__ */ new Map();
|
|
695
|
+
for (const v of w) {
|
|
696
|
+
const m = v.section ?? "";
|
|
697
|
+
S.has(m) || S.set(m, []), S.get(m).push(v);
|
|
698
|
+
}
|
|
699
|
+
const T = w, z = M((v) => {
|
|
700
|
+
if (v.key === "ArrowDown")
|
|
701
|
+
v.preventDefault(), g((m) => Math.min(m + 1, T.length - 1));
|
|
702
|
+
else if (v.key === "ArrowUp")
|
|
703
|
+
v.preventDefault(), g((m) => Math.max(m - 1, 0));
|
|
704
|
+
else if (v.key === "Enter") {
|
|
705
|
+
v.preventDefault();
|
|
706
|
+
const m = T[x];
|
|
707
|
+
m && (m.onSelect(), r());
|
|
708
|
+
} else v.key === "Escape" && r();
|
|
709
|
+
}, [T, x, r]);
|
|
710
|
+
let I = -1;
|
|
711
|
+
return /* @__PURE__ */ e(L, { open: o, onClose: r, slotProps: { backdrop: { sx: { bgcolor: "rgba(0,0,0,0.4)", backdropFilter: "blur(2px)" } } }, children: /* @__PURE__ */ i(
|
|
712
|
+
s,
|
|
713
|
+
{
|
|
714
|
+
sx: {
|
|
715
|
+
position: "absolute",
|
|
716
|
+
top: "20%",
|
|
717
|
+
left: "50%",
|
|
718
|
+
transform: "translateX(-50%)",
|
|
719
|
+
width: f,
|
|
720
|
+
maxHeight: "60vh",
|
|
721
|
+
bgcolor: "var(--ov-bg-surface)",
|
|
722
|
+
border: "1px solid var(--ov-border-default)",
|
|
723
|
+
borderRadius: "8px",
|
|
724
|
+
boxShadow: "0 16px 48px rgba(0,0,0,0.3)",
|
|
725
|
+
overflow: "hidden",
|
|
726
|
+
display: "flex",
|
|
727
|
+
flexDirection: "column",
|
|
728
|
+
...typeof c == "object" && !Array.isArray(c) ? c : {}
|
|
729
|
+
},
|
|
730
|
+
children: [
|
|
731
|
+
/* @__PURE__ */ i(
|
|
732
|
+
s,
|
|
733
|
+
{
|
|
734
|
+
sx: {
|
|
735
|
+
display: "flex",
|
|
736
|
+
alignItems: "center",
|
|
737
|
+
px: 2,
|
|
738
|
+
py: 1.5,
|
|
739
|
+
borderBottom: "1px solid var(--ov-border-default)",
|
|
740
|
+
gap: 1
|
|
741
|
+
},
|
|
742
|
+
children: [
|
|
743
|
+
/* @__PURE__ */ e(ie, { sx: { color: "var(--ov-fg-muted)", fontSize: 20 } }),
|
|
744
|
+
/* @__PURE__ */ e(
|
|
745
|
+
ne,
|
|
746
|
+
{
|
|
747
|
+
ref: b,
|
|
748
|
+
autoFocus: !0,
|
|
749
|
+
value: n,
|
|
750
|
+
onChange: (v) => u(v.target.value),
|
|
751
|
+
onKeyDown: z,
|
|
752
|
+
placeholder: l,
|
|
753
|
+
fullWidth: !0,
|
|
754
|
+
sx: {
|
|
755
|
+
fontSize: "var(--ov-text-sm)",
|
|
756
|
+
color: "var(--ov-fg-base)",
|
|
757
|
+
"& input::placeholder": { color: "var(--ov-fg-faint)", opacity: 1 }
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
)
|
|
761
|
+
]
|
|
762
|
+
}
|
|
763
|
+
),
|
|
764
|
+
/* @__PURE__ */ i(s, { sx: { overflow: "auto", maxHeight: 400 }, children: [
|
|
765
|
+
w.length === 0 && n.trim() && /* @__PURE__ */ e(s, { sx: { p: 3, textAlign: "center" }, children: /* @__PURE__ */ i(h, { sx: { color: "var(--ov-fg-faint)", fontSize: "var(--ov-text-sm)" }, children: [
|
|
766
|
+
"No results for “",
|
|
767
|
+
n,
|
|
768
|
+
"”"
|
|
769
|
+
] }) }),
|
|
770
|
+
Array.from(S.entries()).map(([v, m]) => /* @__PURE__ */ i(s, { children: [
|
|
771
|
+
v && /* @__PURE__ */ e(
|
|
772
|
+
h,
|
|
773
|
+
{
|
|
774
|
+
sx: {
|
|
775
|
+
px: 2,
|
|
776
|
+
pt: 1.5,
|
|
777
|
+
pb: 0.5,
|
|
778
|
+
fontSize: "var(--ov-text-xs)",
|
|
779
|
+
fontWeight: 600,
|
|
780
|
+
color: "var(--ov-fg-faint)",
|
|
781
|
+
textTransform: "uppercase",
|
|
782
|
+
letterSpacing: "0.05em"
|
|
783
|
+
},
|
|
784
|
+
children: v
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
m.map((y) => {
|
|
788
|
+
I++;
|
|
789
|
+
const H = I === x, $ = I;
|
|
790
|
+
return /* @__PURE__ */ i(
|
|
791
|
+
s,
|
|
792
|
+
{
|
|
793
|
+
onClick: () => {
|
|
794
|
+
y.onSelect(), r();
|
|
795
|
+
},
|
|
796
|
+
onMouseEnter: () => g($),
|
|
797
|
+
sx: {
|
|
798
|
+
display: "flex",
|
|
799
|
+
alignItems: "center",
|
|
800
|
+
gap: 1.5,
|
|
801
|
+
px: 2,
|
|
802
|
+
py: 1,
|
|
803
|
+
cursor: "pointer",
|
|
804
|
+
bgcolor: H ? "var(--ov-state-hover)" : "transparent",
|
|
805
|
+
"&:hover": { bgcolor: "var(--ov-state-hover)" }
|
|
806
|
+
},
|
|
807
|
+
children: [
|
|
808
|
+
y.icon && /* @__PURE__ */ e(s, { sx: { color: "var(--ov-fg-muted)", flexShrink: 0, display: "flex" }, children: y.icon }),
|
|
809
|
+
/* @__PURE__ */ i(s, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
810
|
+
/* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-sm)", color: "var(--ov-fg-base)" }, children: y.label }),
|
|
811
|
+
y.description && /* @__PURE__ */ e(h, { sx: { fontSize: "var(--ov-text-xs)", color: "var(--ov-fg-muted)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: y.description })
|
|
812
|
+
] })
|
|
813
|
+
]
|
|
814
|
+
},
|
|
815
|
+
y.id
|
|
816
|
+
);
|
|
817
|
+
})
|
|
818
|
+
] }, v))
|
|
819
|
+
] }),
|
|
820
|
+
/* @__PURE__ */ i(
|
|
821
|
+
s,
|
|
822
|
+
{
|
|
823
|
+
sx: {
|
|
824
|
+
display: "flex",
|
|
825
|
+
alignItems: "center",
|
|
826
|
+
gap: 2,
|
|
827
|
+
px: 2,
|
|
828
|
+
py: 1,
|
|
829
|
+
borderTop: "1px solid var(--ov-border-default)",
|
|
830
|
+
fontSize: "var(--ov-text-xs)",
|
|
831
|
+
color: "var(--ov-fg-faint)"
|
|
832
|
+
},
|
|
833
|
+
children: [
|
|
834
|
+
/* @__PURE__ */ i("span", { children: [
|
|
835
|
+
/* @__PURE__ */ e("kbd", { style: { fontFamily: "var(--ov-font-mono)" }, children: "↑↓" }),
|
|
836
|
+
" navigate"
|
|
837
|
+
] }),
|
|
838
|
+
/* @__PURE__ */ i("span", { children: [
|
|
839
|
+
/* @__PURE__ */ e("kbd", { style: { fontFamily: "var(--ov-font-mono)" }, children: "↵" }),
|
|
840
|
+
" select"
|
|
841
|
+
] }),
|
|
842
|
+
/* @__PURE__ */ i("span", { children: [
|
|
843
|
+
/* @__PURE__ */ e("kbd", { style: { fontFamily: "var(--ov-font-mono)" }, children: "esc" }),
|
|
844
|
+
" close"
|
|
845
|
+
] })
|
|
846
|
+
]
|
|
847
|
+
}
|
|
848
|
+
)
|
|
849
|
+
]
|
|
850
|
+
}
|
|
851
|
+
) });
|
|
852
|
+
}
|
|
853
|
+
ye.displayName = "Spotlight";
|
|
854
|
+
export {
|
|
855
|
+
le as Dialog,
|
|
856
|
+
de as Drawer,
|
|
857
|
+
be as ErrorOverlay,
|
|
858
|
+
ce as Modal,
|
|
859
|
+
ge as NotificationCenter,
|
|
860
|
+
pe as Popover,
|
|
861
|
+
ye as Spotlight,
|
|
862
|
+
me as ToastProvider,
|
|
863
|
+
_e as Tooltip,
|
|
864
|
+
$e as useToast
|
|
865
|
+
};
|