@omniviewdev/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/dist/Button-Dmu1cikC.cjs +1 -0
- package/dist/Button-lr02bh_m.js +51 -0
- package/dist/CodeBlock-B1iQO7zU.js +73 -0
- package/dist/CodeBlock-CIyG0DbW.cjs +2 -0
- package/dist/CopyButton-CACe3RCF.cjs +1 -0
- package/dist/CopyButton-DPBgL0K8.js +77 -0
- package/dist/ErrorState-CexYrMpy.js +188 -0
- package/dist/ErrorState-CnIR-1xa.cjs +1 -0
- package/dist/HotkeyHint-6SOi-MaU.js +37 -0
- package/dist/HotkeyHint-DrTOTrIM.cjs +1 -0
- package/dist/Icon-CKdIOrjZ.cjs +1 -0
- package/dist/Icon-CuO9W7cA.js +27 -0
- package/dist/SearchInput-CFBBNdI2.cjs +1 -0
- package/dist/SearchInput-D3AsCI5H.js +41 -0
- package/dist/Select-CnRBSc5w.cjs +1 -0
- package/dist/Select-DTUF31OP.js +206 -0
- package/dist/Skeleton-BUYyXUiC.js +32 -0
- package/dist/Skeleton-CfdQWLQM.cjs +1 -0
- package/dist/StatusDot-CYyJxjJK.cjs +1 -0
- package/dist/StatusDot-CncykBAY.js +68 -0
- package/dist/StatusPill-C1NaiCzd.js +29 -0
- package/dist/StatusPill-C7yn7dSA.cjs +1 -0
- package/dist/TabPanel-CkUSl6Bt.cjs +1 -0
- package/dist/TabPanel-DLHbgKpl.js +124 -0
- package/dist/Text-By4P3in5.js +71 -0
- package/dist/Text-Mk6Uyg1w.cjs +1 -0
- package/dist/Tooltip-44-P5KfQ.cjs +1 -0
- package/dist/Tooltip-BEVuYuZ3.js +41 -0
- package/dist/_commonjsHelpers-CvWRHxnb.js +26 -0
- package/dist/_commonjsHelpers-D3HyQheV.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +21 -0
- package/dist/buttons/Button.d.ts +31 -0
- package/dist/buttons/ButtonGroup.d.ts +18 -0
- package/dist/buttons/ConfirmButton.d.ts +10 -0
- package/dist/buttons/CopyButton.d.ts +11 -0
- package/dist/buttons/IconButton.d.ts +21 -0
- package/dist/buttons/SearchBar.d.ts +22 -0
- package/dist/buttons/ToggleButton.d.ts +18 -0
- package/dist/buttons/ToggleGroup.d.ts +23 -0
- package/dist/buttons/Toolbar.d.ts +15 -0
- package/dist/buttons/ToolbarGroup.d.ts +11 -0
- package/dist/buttons/index.d.ts +22 -0
- package/dist/buttons.cjs +1 -0
- package/dist/buttons.js +430 -0
- package/dist/cells/BadgesCell.d.ts +19 -0
- package/dist/cells/ChipCell.d.ts +16 -0
- package/dist/cells/SelectBoxHeader.d.ts +11 -0
- package/dist/cells/SelectBoxRow.d.ts +11 -0
- package/dist/cells/TextCell.d.ts +25 -0
- package/dist/cells/index.d.ts +5 -0
- package/dist/cells.cjs +1 -0
- package/dist/cells.js +284 -0
- package/dist/charts/BarChart.d.ts +15 -0
- package/dist/charts/ChartContainer.d.ts +12 -0
- package/dist/charts/ChartLegend.d.ts +11 -0
- package/dist/charts/GaugeCard.d.ts +18 -0
- package/dist/charts/MetricsPanel.d.ts +61 -0
- package/dist/charts/PieChart.d.ts +13 -0
- package/dist/charts/ScatterChart.d.ts +25 -0
- package/dist/charts/Sparkline.d.ts +16 -0
- package/dist/charts/StackedAreaChart.d.ts +18 -0
- package/dist/charts/TimeSeriesChart.d.ts +43 -0
- package/dist/charts/formatters.d.ts +17 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/palette.d.ts +7 -0
- package/dist/charts/types.d.ts +67 -0
- package/dist/charts/useChartTheme.d.ts +13 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.js +967 -0
- package/dist/components/ActionCard.d.ts +22 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/Avatar.d.ts +19 -0
- package/dist/components/Badge.d.ts +22 -0
- package/dist/components/Card.d.ts +24 -0
- package/dist/components/Chip.d.ts +32 -0
- package/dist/components/ClipboardText.d.ts +14 -0
- package/dist/components/DetailsCard.d.ts +25 -0
- package/dist/components/EmptySearch.d.ts +12 -0
- package/dist/components/ExpandableSections.d.ts +51 -0
- package/dist/components/FileIcon.d.ts +12 -0
- package/dist/components/HotkeyHint.d.ts +8 -0
- package/dist/components/Icon.d.ts +7 -0
- package/dist/components/InlineEdit.d.ts +14 -0
- package/dist/components/KVCard.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/List.d.ts +29 -0
- package/dist/components/ListCard.d.ts +30 -0
- package/dist/components/ListItem.d.ts +27 -0
- package/dist/components/LoadingOverlay.d.ts +14 -0
- package/dist/components/MediaCard.d.ts +24 -0
- package/dist/components/MetricsSection.d.ts +37 -0
- package/dist/components/OverflowText.d.ts +12 -0
- package/dist/components/StatCard.d.ts +26 -0
- package/dist/components/StatusCard.d.ts +29 -0
- package/dist/components/TruncatedList.d.ts +13 -0
- package/dist/domain/DescriptionList.d.ts +12 -0
- package/dist/domain/EventsList.d.ts +11 -0
- package/dist/domain/FilterBar.d.ts +23 -0
- package/dist/domain/LogsViewer.d.ts +15 -0
- package/dist/domain/MetricCard.d.ts +14 -0
- package/dist/domain/ObjectInspector.d.ts +19 -0
- package/dist/domain/ResourceBreadcrumb.d.ts +19 -0
- package/dist/domain/ResourceRef.d.ts +15 -0
- package/dist/domain/ResourceStatus.d.ts +17 -0
- package/dist/domain/SecretValueMask.d.ts +11 -0
- package/dist/domain/Timeline.d.ts +21 -0
- package/dist/domain/index.d.ts +23 -0
- package/dist/domain/types.d.ts +25 -0
- package/dist/domain.cjs +1 -0
- package/dist/domain.js +871 -0
- package/dist/editors/CodeEditor.d.ts +19 -0
- package/dist/editors/CommandPalette.d.ts +22 -0
- package/dist/editors/DiffViewer.d.ts +14 -0
- package/dist/editors/MarkdownPreview.d.ts +9 -0
- package/dist/editors/Terminal.d.ts +18 -0
- package/dist/editors/index.d.ts +11 -0
- package/dist/editors/themes.d.ts +4 -0
- package/dist/editors.cjs +42 -0
- package/dist/editors.js +38396 -0
- package/dist/feedback/Alert.d.ts +21 -0
- package/dist/feedback/ConnectionIndicator.d.ts +15 -0
- package/dist/feedback/EmptyState.d.ts +17 -0
- package/dist/feedback/ErrorState.d.ts +12 -0
- package/dist/feedback/IDEStatusFooter.d.ts +104 -0
- package/dist/feedback/NotificationStack.d.ts +32 -0
- package/dist/feedback/ProgressBar.d.ts +16 -0
- package/dist/feedback/ProgressRing.d.ts +26 -0
- package/dist/feedback/RunButton.d.ts +17 -0
- package/dist/feedback/Skeleton.d.ts +13 -0
- package/dist/feedback/StatusBar.d.ts +12 -0
- package/dist/feedback/StatusBarItem.d.ts +18 -0
- package/dist/feedback/StatusDot.d.ts +14 -0
- package/dist/feedback/StatusPill.d.ts +13 -0
- package/dist/feedback/index.d.ts +29 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.js +1011 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +1632 -0
- package/dist/inputs/Autocomplete.d.ts +30 -0
- package/dist/inputs/Checkbox.d.ts +17 -0
- package/dist/inputs/ColorPicker.d.ts +13 -0
- package/dist/inputs/DebouncedInput.d.ts +10 -0
- package/dist/inputs/FormField.d.ts +15 -0
- package/dist/inputs/FormSection.d.ts +14 -0
- package/dist/inputs/KeyValueEditor.d.ts +17 -0
- package/dist/inputs/RadioGroup.d.ts +23 -0
- package/dist/inputs/SearchInput.d.ts +14 -0
- package/dist/inputs/Select.d.ts +32 -0
- package/dist/inputs/Slider.d.ts +24 -0
- package/dist/inputs/Switch.d.ts +17 -0
- package/dist/inputs/TagInput.d.ts +18 -0
- package/dist/inputs/TextArea.d.ts +26 -0
- package/dist/inputs/TextField.d.ts +39 -0
- package/dist/inputs/TimeRangePicker.d.ts +21 -0
- package/dist/inputs/index.d.ts +31 -0
- package/dist/inputs.cjs +21 -0
- package/dist/inputs.js +15834 -0
- package/dist/layout/AppShell.d.ts +18 -0
- package/dist/layout/DockLayout.d.ts +23 -0
- package/dist/layout/Inline.d.ts +15 -0
- package/dist/layout/Panel.d.ts +17 -0
- package/dist/layout/ResizableSplitPane.d.ts +18 -0
- package/dist/layout/Spacer.d.ts +9 -0
- package/dist/layout/Stack.d.ts +19 -0
- package/dist/layout/index.d.ts +16 -0
- package/dist/layout/useResizablePanel.d.ts +18 -0
- package/dist/layout.cjs +5 -0
- package/dist/layout.js +378 -0
- package/dist/menus/ContextMenu.d.ts +12 -0
- package/dist/menus/DropdownMenu.d.ts +20 -0
- package/dist/menus/MenuBar.d.ts +11 -0
- package/dist/menus/NestedMenuItem.d.ts +13 -0
- package/dist/menus/SplitButton.d.ts +15 -0
- package/dist/menus/index.d.ts +11 -0
- package/dist/menus/types.d.ts +24 -0
- package/dist/menus.cjs +1 -0
- package/dist/menus.js +355 -0
- package/dist/navigation/Breadcrumbs.d.ts +18 -0
- package/dist/navigation/DraggableTabs.d.ts +24 -0
- package/dist/navigation/Pagination.d.ts +15 -0
- package/dist/navigation/PersistentTabPanel.d.ts +13 -0
- package/dist/navigation/Stepper.d.ts +19 -0
- package/dist/navigation/TabPanel.d.ts +11 -0
- package/dist/navigation/Tabs.d.ts +26 -0
- package/dist/navigation/TreeView.d.ts +27 -0
- package/dist/navigation/index.d.ts +16 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.js +429 -0
- package/dist/overlays/Dialog.d.ts +18 -0
- package/dist/overlays/Drawer.d.ts +17 -0
- package/dist/overlays/ErrorOverlay.d.ts +21 -0
- package/dist/overlays/Modal.d.ts +14 -0
- package/dist/overlays/NotificationCenter.d.ts +31 -0
- package/dist/overlays/Popover.d.ts +15 -0
- package/dist/overlays/Spotlight.d.ts +24 -0
- package/dist/overlays/ToastProvider.d.ts +32 -0
- package/dist/overlays/Tooltip.d.ts +15 -0
- package/dist/overlays/index.d.ts +20 -0
- package/dist/overlays/useToast.d.ts +21 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.js +865 -0
- package/dist/sidebars/ActivityBar.d.ts +16 -0
- package/dist/sidebars/NavMenu.d.ts +27 -0
- package/dist/sidebars/NavMenu.test.d.ts +1 -0
- package/dist/sidebars/PropertyGrid.d.ts +16 -0
- package/dist/sidebars/SidebarGroup.d.ts +15 -0
- package/dist/sidebars/SidebarPanel.d.ts +19 -0
- package/dist/sidebars/SidebarTreeItem.d.ts +21 -0
- package/dist/sidebars/index.d.ts +13 -0
- package/dist/sidebars/types.d.ts +29 -0
- package/dist/sidebars.cjs +1 -0
- package/dist/sidebars.js +762 -0
- package/dist/table/ColumnFilter.d.ts +10 -0
- package/dist/table/DataTable.d.ts +23 -0
- package/dist/table/IDETable.d.ts +48 -0
- package/dist/table/TableEmptyState.d.ts +12 -0
- package/dist/table/TableSkeleton.d.ts +11 -0
- package/dist/table/TableToolbar.d.ts +15 -0
- package/dist/table/index.d.ts +12 -0
- package/dist/table/types.d.ts +4 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +580 -0
- package/dist/theme/AppTheme.d.ts +14 -0
- package/dist/theme/customizations/dataDisplay.d.ts +2 -0
- package/dist/theme/customizations/feedback.d.ts +2 -0
- package/dist/theme/customizations/inputs.d.ts +2 -0
- package/dist/theme/customizations/navigation.d.ts +2 -0
- package/dist/theme/index.d.ts +36 -0
- package/dist/theme/primitives.d.ts +234 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.js +1362 -0
- package/dist/tokens.css +252 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/maps.d.ts +25 -0
- package/dist/types/variants.d.ts +21 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +96 -0
- package/dist/typography/CodeBlock.d.ts +15 -0
- package/dist/typography/CodeInline.d.ts +10 -0
- package/dist/typography/Heading.d.ts +13 -0
- package/dist/typography/Link.d.ts +18 -0
- package/dist/typography/Text.d.ts +22 -0
- package/dist/typography/index.d.ts +10 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +120 -0
- package/dist/ui.css +1 -0
- package/dist/units-BuBKbqQ7.js +54 -0
- package/dist/units-CDpdlN1W.cjs +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/language.d.ts +4 -0
- package/dist/utils/time.d.ts +5 -0
- package/dist/utils/units.d.ts +7 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.js +78 -0
- package/package.json +261 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import M from "@mui/material/Button";
|
|
3
|
+
import j from "@mui/material/CircularProgress";
|
|
4
|
+
import { toBorderRadius as A, toMuiColor as O, toMuiVariant as R, toMuiSize as V, sizeOverrideSx as N } from "./types.js";
|
|
5
|
+
function $({
|
|
6
|
+
children: c,
|
|
7
|
+
color: a = "neutral",
|
|
8
|
+
emphasis: i = "ghost",
|
|
9
|
+
size: o = "sm",
|
|
10
|
+
shape: u = "rounded",
|
|
11
|
+
loading: r = !1,
|
|
12
|
+
loadingPosition: t = "center",
|
|
13
|
+
disabled: d,
|
|
14
|
+
startIcon: m,
|
|
15
|
+
startAdornment: l,
|
|
16
|
+
icon: p,
|
|
17
|
+
endIcon: I,
|
|
18
|
+
endAdornment: f,
|
|
19
|
+
fullWidth: v,
|
|
20
|
+
onClick: b,
|
|
21
|
+
type: S = "button",
|
|
22
|
+
href: B,
|
|
23
|
+
sx: e
|
|
24
|
+
}) {
|
|
25
|
+
const y = m ?? l ?? p, z = I ?? f, h = O(a), x = R(i), C = V(o), E = N(o), n = /* @__PURE__ */ s(j, { size: o === "xs" ? 12 : 16, color: "inherit" });
|
|
26
|
+
return /* @__PURE__ */ s(
|
|
27
|
+
M,
|
|
28
|
+
{
|
|
29
|
+
color: h,
|
|
30
|
+
variant: x,
|
|
31
|
+
size: C,
|
|
32
|
+
disabled: d || r && t === "center",
|
|
33
|
+
startIcon: r && t === "start" ? n : y,
|
|
34
|
+
endIcon: r && t === "end" ? n : z,
|
|
35
|
+
fullWidth: v,
|
|
36
|
+
onClick: b,
|
|
37
|
+
type: S,
|
|
38
|
+
href: B,
|
|
39
|
+
sx: {
|
|
40
|
+
borderRadius: A(u),
|
|
41
|
+
...E,
|
|
42
|
+
...typeof e == "object" && !Array.isArray(e) ? e : {}
|
|
43
|
+
},
|
|
44
|
+
children: r && t === "center" ? n : c
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
$.displayName = "Button";
|
|
49
|
+
export {
|
|
50
|
+
$ as B
|
|
51
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs as a, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import e from "@mui/material/Box";
|
|
3
|
+
import { C as f } from "./CopyButton-DPBgL0K8.js";
|
|
4
|
+
function v({
|
|
5
|
+
children: r,
|
|
6
|
+
lineNumbers: p = !1,
|
|
7
|
+
copy: i = !0,
|
|
8
|
+
maxHeight: d,
|
|
9
|
+
wrap: l = !1,
|
|
10
|
+
sx: t
|
|
11
|
+
}) {
|
|
12
|
+
const s = r.split(`
|
|
13
|
+
`);
|
|
14
|
+
return /* @__PURE__ */ a(
|
|
15
|
+
e,
|
|
16
|
+
{
|
|
17
|
+
sx: {
|
|
18
|
+
position: "relative",
|
|
19
|
+
bgcolor: "var(--ov-bg-surface-inset)",
|
|
20
|
+
borderRadius: "6px",
|
|
21
|
+
border: "1px solid var(--ov-border-muted)",
|
|
22
|
+
overflow: "hidden",
|
|
23
|
+
...typeof t == "object" && !Array.isArray(t) ? t : {}
|
|
24
|
+
},
|
|
25
|
+
children: [
|
|
26
|
+
i && /* @__PURE__ */ o(e, { sx: { position: "absolute", top: 4, right: 4, zIndex: 1 }, children: /* @__PURE__ */ o(f, { value: r, size: "xs" }) }),
|
|
27
|
+
/* @__PURE__ */ o(
|
|
28
|
+
e,
|
|
29
|
+
{
|
|
30
|
+
component: "pre",
|
|
31
|
+
sx: {
|
|
32
|
+
m: 0,
|
|
33
|
+
p: 1.5,
|
|
34
|
+
pr: i ? 5 : 1.5,
|
|
35
|
+
overflow: "auto",
|
|
36
|
+
maxHeight: d,
|
|
37
|
+
fontFamily: "var(--ov-font-mono)",
|
|
38
|
+
fontSize: "13px",
|
|
39
|
+
lineHeight: 1.6,
|
|
40
|
+
color: "var(--ov-fg-default)",
|
|
41
|
+
whiteSpace: l ? "pre-wrap" : "pre",
|
|
42
|
+
wordBreak: l ? "break-all" : void 0
|
|
43
|
+
},
|
|
44
|
+
children: p ? /* @__PURE__ */ o(e, { component: "table", sx: { borderCollapse: "collapse", width: "100%" }, children: /* @__PURE__ */ o("tbody", { children: s.map((c, n) => /* @__PURE__ */ a("tr", { children: [
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
e,
|
|
47
|
+
{
|
|
48
|
+
component: "td",
|
|
49
|
+
sx: {
|
|
50
|
+
pr: 2,
|
|
51
|
+
pl: 0.5,
|
|
52
|
+
textAlign: "right",
|
|
53
|
+
userSelect: "none",
|
|
54
|
+
color: "var(--ov-fg-faint)",
|
|
55
|
+
width: 1,
|
|
56
|
+
whiteSpace: "nowrap",
|
|
57
|
+
verticalAlign: "top"
|
|
58
|
+
},
|
|
59
|
+
children: n + 1
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ o("td", { children: c })
|
|
63
|
+
] }, n)) }) }) : /* @__PURE__ */ o("code", { children: r })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
v.displayName = "CodeBlock";
|
|
71
|
+
export {
|
|
72
|
+
v as C
|
|
73
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("@mui/material/Box"),x=require("./CopyButton-CACe3RCF.cjs");function l({children:r,lineNumbers:a=!1,copy:i=!0,maxHeight:d,wrap:n=!1,sx:t}){const c=r.split(`
|
|
2
|
+
`);return e.jsxs(o,{sx:{position:"relative",bgcolor:"var(--ov-bg-surface-inset)",borderRadius:"6px",border:"1px solid var(--ov-border-muted)",overflow:"hidden",...typeof t=="object"&&!Array.isArray(t)?t:{}},children:[i&&e.jsx(o,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:e.jsx(x.CopyButton,{value:r,size:"xs"})}),e.jsx(o,{component:"pre",sx:{m:0,p:1.5,pr:i?5:1.5,overflow:"auto",maxHeight:d,fontFamily:"var(--ov-font-mono)",fontSize:"13px",lineHeight:1.6,color:"var(--ov-fg-default)",whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-all":void 0},children:a?e.jsx(o,{component:"table",sx:{borderCollapse:"collapse",width:"100%"},children:e.jsx("tbody",{children:c.map((p,s)=>e.jsxs("tr",{children:[e.jsx(o,{component:"td",sx:{pr:2,pl:.5,textAlign:"right",userSelect:"none",color:"var(--ov-fg-faint)",width:1,whiteSpace:"nowrap",verticalAlign:"top"},children:s+1}),e.jsx("td",{children:p})]},s))})}):e.jsx("code",{children:r})})]})}l.displayName="CodeBlock";exports.CodeBlock=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),C=require("react"),S=require("@mui/icons-material/ContentCopy"),j=require("@mui/icons-material/Check"),q=require("@mui/material/IconButton"),b=require("@mui/material/CircularProgress"),a=require("./types.cjs");function l({children:n,color:t="neutral",emphasis:c,size:o="sm",shape:r="rounded",loading:s=!1,disabled:i,onClick:x,title:y,sx:u,...h}){const f=a.toMuiColor(t),B=a.toMuiSize(o),d={xs:24,sm:32,md:40,lg:48,xl:56},p={xs:14,sm:18,md:22,lg:26,xl:30};return e.jsx(q,{color:f,size:B,disabled:i||s,onClick:x,title:y,sx:{borderRadius:a.toBorderRadius(r),width:d[o],height:d[o],fontSize:p[o],...typeof u=="object"&&!Array.isArray(u)?u:{}},...h,children:s?e.jsx(b,{size:p[o]-4,color:"inherit"}):n})}l.displayName="IconButton";function m({value:n,size:t="sm",label:c}){const[o,r]=C.useState(!1),s=C.useCallback(()=>{navigator.clipboard.writeText(n).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},[n]),i=t==="xs"?12:t==="sm"?14:t==="md"?16:18;return e.jsx(l,{size:t,color:o?"success":"neutral",onClick:s,"aria-label":c??(o?"Copied":"Copy to clipboard"),title:c??(o?"Copied!":"Copy"),children:o?e.jsx(j,{sx:{fontSize:i}}):e.jsx(S,{sx:{fontSize:i}})})}m.displayName="CopyButton";exports.CopyButton=m;exports.IconButton=l;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useCallback as x } from "react";
|
|
3
|
+
import S from "@mui/icons-material/ContentCopy";
|
|
4
|
+
import b from "@mui/icons-material/Check";
|
|
5
|
+
import B from "@mui/material/IconButton";
|
|
6
|
+
import I from "@mui/material/CircularProgress";
|
|
7
|
+
import { toBorderRadius as M, toMuiColor as g, toMuiSize as k } from "./types.js";
|
|
8
|
+
function l({
|
|
9
|
+
children: i,
|
|
10
|
+
color: t = "neutral",
|
|
11
|
+
emphasis: c,
|
|
12
|
+
size: o = "sm",
|
|
13
|
+
shape: e = "rounded",
|
|
14
|
+
loading: n = !1,
|
|
15
|
+
disabled: s,
|
|
16
|
+
onClick: u,
|
|
17
|
+
title: d,
|
|
18
|
+
sx: a,
|
|
19
|
+
...C
|
|
20
|
+
}) {
|
|
21
|
+
const f = g(t), y = k(o), m = {
|
|
22
|
+
xs: 24,
|
|
23
|
+
sm: 32,
|
|
24
|
+
md: 40,
|
|
25
|
+
lg: 48,
|
|
26
|
+
xl: 56
|
|
27
|
+
}, p = {
|
|
28
|
+
xs: 14,
|
|
29
|
+
sm: 18,
|
|
30
|
+
md: 22,
|
|
31
|
+
lg: 26,
|
|
32
|
+
xl: 30
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ r(
|
|
35
|
+
B,
|
|
36
|
+
{
|
|
37
|
+
color: f,
|
|
38
|
+
size: y,
|
|
39
|
+
disabled: s || n,
|
|
40
|
+
onClick: u,
|
|
41
|
+
title: d,
|
|
42
|
+
sx: {
|
|
43
|
+
borderRadius: M(e),
|
|
44
|
+
width: m[o],
|
|
45
|
+
height: m[o],
|
|
46
|
+
fontSize: p[o],
|
|
47
|
+
...typeof a == "object" && !Array.isArray(a) ? a : {}
|
|
48
|
+
},
|
|
49
|
+
...C,
|
|
50
|
+
children: n ? /* @__PURE__ */ r(I, { size: p[o] - 4, color: "inherit" }) : i
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
l.displayName = "IconButton";
|
|
55
|
+
function z({ value: i, size: t = "sm", label: c }) {
|
|
56
|
+
const [o, e] = h(!1), n = x(() => {
|
|
57
|
+
navigator.clipboard.writeText(i).then(() => {
|
|
58
|
+
e(!0), setTimeout(() => e(!1), 1500);
|
|
59
|
+
});
|
|
60
|
+
}, [i]), s = t === "xs" ? 12 : t === "sm" ? 14 : t === "md" ? 16 : 18;
|
|
61
|
+
return /* @__PURE__ */ r(
|
|
62
|
+
l,
|
|
63
|
+
{
|
|
64
|
+
size: t,
|
|
65
|
+
color: o ? "success" : "neutral",
|
|
66
|
+
onClick: n,
|
|
67
|
+
"aria-label": c ?? (o ? "Copied" : "Copy to clipboard"),
|
|
68
|
+
title: c ?? (o ? "Copied!" : "Copy"),
|
|
69
|
+
children: o ? /* @__PURE__ */ r(b, { sx: { fontSize: s } }) : /* @__PURE__ */ r(S, { sx: { fontSize: s } })
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
z.displayName = "CopyButton";
|
|
74
|
+
export {
|
|
75
|
+
z as C,
|
|
76
|
+
l as I
|
|
77
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import a from "@mui/material/Box";
|
|
3
|
+
import i from "@mui/material/Typography";
|
|
4
|
+
import d from "@mui/icons-material/ErrorOutline";
|
|
5
|
+
import { B as f } from "./Button-lr02bh_m.js";
|
|
6
|
+
import { C as p } from "./CopyButton-DPBgL0K8.js";
|
|
7
|
+
const g = {
|
|
8
|
+
xs: 2,
|
|
9
|
+
sm: 3,
|
|
10
|
+
md: 4,
|
|
11
|
+
lg: 6,
|
|
12
|
+
xl: 8
|
|
13
|
+
};
|
|
14
|
+
function v({
|
|
15
|
+
icon: l,
|
|
16
|
+
title: s,
|
|
17
|
+
description: r,
|
|
18
|
+
primaryAction: c,
|
|
19
|
+
secondaryAction: m,
|
|
20
|
+
size: e = "md",
|
|
21
|
+
sx: n
|
|
22
|
+
}) {
|
|
23
|
+
const x = e === "xs" || e === "sm" ? 32 : e === "md" ? 40 : 48;
|
|
24
|
+
return /* @__PURE__ */ o(
|
|
25
|
+
a,
|
|
26
|
+
{
|
|
27
|
+
sx: {
|
|
28
|
+
display: "flex",
|
|
29
|
+
flexDirection: "column",
|
|
30
|
+
alignItems: "center",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
textAlign: "center",
|
|
33
|
+
py: g[e],
|
|
34
|
+
px: 2,
|
|
35
|
+
...typeof n == "object" && !Array.isArray(n) ? n : {}
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
l && /* @__PURE__ */ t(
|
|
39
|
+
a,
|
|
40
|
+
{
|
|
41
|
+
sx: {
|
|
42
|
+
mb: 2,
|
|
43
|
+
color: "var(--ov-fg-faint)",
|
|
44
|
+
fontSize: x,
|
|
45
|
+
display: "flex"
|
|
46
|
+
},
|
|
47
|
+
children: l
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ t(
|
|
51
|
+
i,
|
|
52
|
+
{
|
|
53
|
+
variant: e === "xs" || e === "sm" ? "subtitle2" : "h6",
|
|
54
|
+
sx: { color: "var(--ov-fg-default)", fontWeight: 600, mb: r ? 0.5 : 0 },
|
|
55
|
+
children: s
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
r && /* @__PURE__ */ t(
|
|
59
|
+
i,
|
|
60
|
+
{
|
|
61
|
+
variant: "body2",
|
|
62
|
+
sx: {
|
|
63
|
+
color: "var(--ov-fg-muted)",
|
|
64
|
+
maxWidth: 400,
|
|
65
|
+
lineHeight: 1.5
|
|
66
|
+
},
|
|
67
|
+
children: r
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
(c || m) && /* @__PURE__ */ o(a, { sx: { display: "flex", gap: 1, mt: 2.5 }, children: [
|
|
71
|
+
c,
|
|
72
|
+
m
|
|
73
|
+
] })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
v.displayName = "EmptyState";
|
|
79
|
+
function h({
|
|
80
|
+
message: l,
|
|
81
|
+
errorId: s,
|
|
82
|
+
onRetry: r,
|
|
83
|
+
variant: c = "panel"
|
|
84
|
+
}) {
|
|
85
|
+
const m = c === "inline", e = c === "page", n = e ? 56 : m ? 20 : 40;
|
|
86
|
+
return m ? /* @__PURE__ */ o(
|
|
87
|
+
a,
|
|
88
|
+
{
|
|
89
|
+
sx: {
|
|
90
|
+
display: "inline-flex",
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: 1,
|
|
93
|
+
color: "var(--ov-danger-default)"
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ t(d, { sx: { fontSize: n } }),
|
|
97
|
+
/* @__PURE__ */ t(i, { variant: "body2", sx: { color: "var(--ov-danger-default)" }, children: l }),
|
|
98
|
+
r && /* @__PURE__ */ t(f, { size: "xs", emphasis: "ghost", color: "danger", onClick: r, children: "Retry" })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
) : /* @__PURE__ */ o(
|
|
102
|
+
a,
|
|
103
|
+
{
|
|
104
|
+
sx: {
|
|
105
|
+
display: "flex",
|
|
106
|
+
flexDirection: "column",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
justifyContent: "center",
|
|
109
|
+
textAlign: "center",
|
|
110
|
+
py: e ? 8 : 4,
|
|
111
|
+
px: 2,
|
|
112
|
+
...e && { minHeight: "60vh" }
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
|
+
d,
|
|
117
|
+
{
|
|
118
|
+
sx: {
|
|
119
|
+
fontSize: n,
|
|
120
|
+
color: "var(--ov-danger-default)",
|
|
121
|
+
mb: 2
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ t(
|
|
126
|
+
i,
|
|
127
|
+
{
|
|
128
|
+
variant: e ? "h5" : "subtitle1",
|
|
129
|
+
sx: { color: "var(--ov-fg-default)", fontWeight: 600, mb: 0.5 },
|
|
130
|
+
children: "Something went wrong"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ t(
|
|
134
|
+
i,
|
|
135
|
+
{
|
|
136
|
+
variant: "body2",
|
|
137
|
+
sx: {
|
|
138
|
+
color: "var(--ov-fg-muted)",
|
|
139
|
+
maxWidth: 420,
|
|
140
|
+
lineHeight: 1.5,
|
|
141
|
+
mb: 1
|
|
142
|
+
},
|
|
143
|
+
children: l
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
s && /* @__PURE__ */ o(
|
|
147
|
+
a,
|
|
148
|
+
{
|
|
149
|
+
sx: {
|
|
150
|
+
display: "inline-flex",
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
gap: 0.5,
|
|
153
|
+
mb: 2,
|
|
154
|
+
px: 1.5,
|
|
155
|
+
py: 0.5,
|
|
156
|
+
borderRadius: "4px",
|
|
157
|
+
bgcolor: "var(--ov-bg-surface-inset)"
|
|
158
|
+
},
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ o(
|
|
161
|
+
i,
|
|
162
|
+
{
|
|
163
|
+
variant: "caption",
|
|
164
|
+
sx: {
|
|
165
|
+
fontFamily: "var(--ov-font-mono)",
|
|
166
|
+
color: "var(--ov-fg-muted)",
|
|
167
|
+
fontSize: "var(--ov-text-xs)"
|
|
168
|
+
},
|
|
169
|
+
children: [
|
|
170
|
+
"Error ID: ",
|
|
171
|
+
s
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
),
|
|
175
|
+
/* @__PURE__ */ t(p, { value: s, size: "xs" })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
r && /* @__PURE__ */ t(f, { emphasis: "outline", color: "primary", size: "sm", onClick: r, children: "Try again" })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
h.displayName = "ErrorState";
|
|
185
|
+
export {
|
|
186
|
+
v as E,
|
|
187
|
+
h as a
|
|
188
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),o=require("@mui/material/Box"),i=require("@mui/material/Typography"),c=require("@mui/icons-material/ErrorOutline"),d=require("./Button-Dmu1cikC.cjs"),g=require("./CopyButton-CACe3RCF.cjs"),p={xs:2,sm:3,md:4,lg:6,xl:8};function u({icon:s,title:a,description:n,primaryAction:l,secondaryAction:x,size:t="md",sx:r}){const f=t==="xs"||t==="sm"?32:t==="md"?40:48;return e.jsxs(o,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:p[t],px:2,...typeof r=="object"&&!Array.isArray(r)?r:{}},children:[s&&e.jsx(o,{sx:{mb:2,color:"var(--ov-fg-faint)",fontSize:f,display:"flex"},children:s}),e.jsx(i,{variant:t==="xs"||t==="sm"?"subtitle2":"h6",sx:{color:"var(--ov-fg-default)",fontWeight:600,mb:n?.5:0},children:a}),n&&e.jsx(i,{variant:"body2",sx:{color:"var(--ov-fg-muted)",maxWidth:400,lineHeight:1.5},children:n}),(l||x)&&e.jsxs(o,{sx:{display:"flex",gap:1,mt:2.5},children:[l,x]})]})}u.displayName="EmptyState";function m({message:s,errorId:a,onRetry:n,variant:l="panel"}){const x=l==="inline",t=l==="page",r=t?56:x?20:40;return x?e.jsxs(o,{sx:{display:"inline-flex",alignItems:"center",gap:1,color:"var(--ov-danger-default)"},children:[e.jsx(c,{sx:{fontSize:r}}),e.jsx(i,{variant:"body2",sx:{color:"var(--ov-danger-default)"},children:s}),n&&e.jsx(d.Button,{size:"xs",emphasis:"ghost",color:"danger",onClick:n,children:"Retry"})]}):e.jsxs(o,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:t?8:4,px:2,...t&&{minHeight:"60vh"}},children:[e.jsx(c,{sx:{fontSize:r,color:"var(--ov-danger-default)",mb:2}}),e.jsx(i,{variant:t?"h5":"subtitle1",sx:{color:"var(--ov-fg-default)",fontWeight:600,mb:.5},children:"Something went wrong"}),e.jsx(i,{variant:"body2",sx:{color:"var(--ov-fg-muted)",maxWidth:420,lineHeight:1.5,mb:1},children:s}),a&&e.jsxs(o,{sx:{display:"inline-flex",alignItems:"center",gap:.5,mb:2,px:1.5,py:.5,borderRadius:"4px",bgcolor:"var(--ov-bg-surface-inset)"},children:[e.jsxs(i,{variant:"caption",sx:{fontFamily:"var(--ov-font-mono)",color:"var(--ov-fg-muted)",fontSize:"var(--ov-text-xs)"},children:["Error ID: ",a]}),e.jsx(g.CopyButton,{value:a,size:"xs"})]}),n&&e.jsx(d.Button,{emphasis:"outline",color:"primary",size:"sm",onClick:n,children:"Try again"})]})}m.displayName="ErrorState";exports.EmptyState=u;exports.ErrorState=m;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import n from "@mui/material/Box";
|
|
3
|
+
const t = typeof navigator < "u" && /Mac/.test(navigator.userAgent);
|
|
4
|
+
function a(r) {
|
|
5
|
+
return r === "Meta" ? t ? "⌘" : "Ctrl" : r === "Control" ? t ? "⌃" : "Ctrl" : r === "Alt" ? t ? "⌥" : "Alt" : r === "Shift" ? "⇧" : r === "Enter" ? "⏎" : r === "Escape" ? "Esc" : r === "Backspace" ? "⌫" : r === "Delete" ? "Del" : r === "ArrowUp" ? "↑" : r === "ArrowDown" ? "↓" : r === "ArrowLeft" ? "←" : r === "ArrowRight" ? "→" : r;
|
|
6
|
+
}
|
|
7
|
+
function f({ keys: r }) {
|
|
8
|
+
return /* @__PURE__ */ e(n, { sx: { display: "inline-flex", alignItems: "center", gap: "2px" }, children: r.map((i, o) => /* @__PURE__ */ e(
|
|
9
|
+
n,
|
|
10
|
+
{
|
|
11
|
+
component: "kbd",
|
|
12
|
+
sx: {
|
|
13
|
+
display: "inline-flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
height: 20,
|
|
17
|
+
minWidth: 20,
|
|
18
|
+
px: "5px",
|
|
19
|
+
fontFamily: "var(--ov-font-ui)",
|
|
20
|
+
fontSize: "0.6875rem",
|
|
21
|
+
fontWeight: 500,
|
|
22
|
+
lineHeight: 1,
|
|
23
|
+
color: "var(--ov-fg-muted)",
|
|
24
|
+
bgcolor: "var(--ov-bg-subtle)",
|
|
25
|
+
border: "1px solid var(--ov-border-default)",
|
|
26
|
+
borderRadius: "4px",
|
|
27
|
+
boxShadow: "0 1px 0 var(--ov-border-muted)"
|
|
28
|
+
},
|
|
29
|
+
children: a(i)
|
|
30
|
+
},
|
|
31
|
+
o
|
|
32
|
+
)) });
|
|
33
|
+
}
|
|
34
|
+
f.displayName = "HotkeyHint";
|
|
35
|
+
export {
|
|
36
|
+
f as H
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),n=require("@mui/material/Box"),t=typeof navigator<"u"&&/Mac/.test(navigator.userAgent);function a(r){return r==="Meta"?t?"⌘":"Ctrl":r==="Control"?t?"⌃":"Ctrl":r==="Alt"?t?"⌥":"Alt":r==="Shift"?"⇧":r==="Enter"?"⏎":r==="Escape"?"Esc":r==="Backspace"?"⌫":r==="Delete"?"Del":r==="ArrowUp"?"↑":r==="ArrowDown"?"↓":r==="ArrowLeft"?"←":r==="ArrowRight"?"→":r}function i({keys:r}){return e.jsx(n,{sx:{display:"inline-flex",alignItems:"center",gap:"2px"},children:r.map((o,u)=>e.jsx(n,{component:"kbd",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:20,minWidth:20,px:"5px",fontFamily:"var(--ov-font-ui)",fontSize:"0.6875rem",fontWeight:500,lineHeight:1,color:"var(--ov-fg-muted)",bgcolor:"var(--ov-bg-subtle)",border:"1px solid var(--ov-border-default)",borderRadius:"4px",boxShadow:"0 1px 0 var(--ov-border-muted)"},children:a(o)},u))})}i.displayName="HotkeyHint";exports.HotkeyHint=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),c=require("react-icons/lu"),u=require("react-icons/si");function s(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const a=s(c),f=s(u),l={Si:f,Lu:a},d=t=>{const e=t.substring(0,2),n=t,r=l[e];if(!r)throw new Error(`Icon library "${e}" is not supported`);if(!r[n])throw new Error(`Icon "${n}" is not supported`);return r[n]},p=({name:t,...e})=>{t.substring(0,2)==="Lu"&&!e.strokeWidth&&(e.strokeWidth=1.5);let r;try{r=d(t)}catch(i){return console.error(i),o.jsx(c.LuFileQuestion,{...e})}return o.jsx(r,{...e})};exports.Icon=p;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react-icons/lu";
|
|
3
|
+
import { LuFileQuestion as c } from "react-icons/lu";
|
|
4
|
+
import * as u from "react-icons/si";
|
|
5
|
+
const f = {
|
|
6
|
+
Si: u,
|
|
7
|
+
Lu: e
|
|
8
|
+
}, m = (t) => {
|
|
9
|
+
const o = t.substring(0, 2), n = t, r = f[o];
|
|
10
|
+
if (!r)
|
|
11
|
+
throw new Error(`Icon library "${o}" is not supported`);
|
|
12
|
+
if (!r[n])
|
|
13
|
+
throw new Error(`Icon "${n}" is not supported`);
|
|
14
|
+
return r[n];
|
|
15
|
+
}, a = ({ name: t, ...o }) => {
|
|
16
|
+
t.substring(0, 2) === "Lu" && !o.strokeWidth && (o.strokeWidth = 1.5);
|
|
17
|
+
let r;
|
|
18
|
+
try {
|
|
19
|
+
r = m(t);
|
|
20
|
+
} catch (s) {
|
|
21
|
+
return console.error(s), /* @__PURE__ */ i(c, { ...o });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ i(r, { ...o });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
a as I
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),u=require("@mui/material/OutlinedInput"),o=require("@mui/material/InputAdornment"),d=require("@mui/material/IconButton"),p=require("@mui/icons-material/SearchRounded"),m=require("@mui/icons-material/Clear"),r=({placeholder:s,value:t,onChange:n})=>{const i=()=>{n("")},c=l.useMemo(()=>t!=="",[t]);return e.jsx(u,{size:"small",autoComplete:"off",type:"text",placeholder:s??"Search",startAdornment:e.jsx(o,{position:"start",children:e.jsx(p,{color:"primary"})}),endAdornment:c?e.jsx(o,{position:"end",children:e.jsx(d,{size:"small",onClick:i,edge:"end",children:e.jsx(m,{fontSize:"small"})})}):void 0,value:t,onChange:a=>{n(a.target.value)},sx:{flexBasis:"500px",display:"flex",boxShadow:"none",minWidth:{md:400,lg:400,xl:500}},inputProps:{autoCorrect:"off",autoComplete:"off"}})};r.displayName="SearchInput";exports.SearchInput=r;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import p from "@mui/material/OutlinedInput";
|
|
4
|
+
import r from "@mui/material/InputAdornment";
|
|
5
|
+
import d from "@mui/material/IconButton";
|
|
6
|
+
import s from "@mui/icons-material/SearchRounded";
|
|
7
|
+
import c from "@mui/icons-material/Clear";
|
|
8
|
+
const f = ({ placeholder: n, value: t, onChange: e }) => {
|
|
9
|
+
const i = () => {
|
|
10
|
+
e("");
|
|
11
|
+
}, a = l.useMemo(() => t !== "", [t]);
|
|
12
|
+
return /* @__PURE__ */ o(
|
|
13
|
+
p,
|
|
14
|
+
{
|
|
15
|
+
size: "small",
|
|
16
|
+
autoComplete: "off",
|
|
17
|
+
type: "text",
|
|
18
|
+
placeholder: n ?? "Search",
|
|
19
|
+
startAdornment: /* @__PURE__ */ o(r, { position: "start", children: /* @__PURE__ */ o(s, { color: "primary" }) }),
|
|
20
|
+
endAdornment: a ? /* @__PURE__ */ o(r, { position: "end", children: /* @__PURE__ */ o(d, { size: "small", onClick: i, edge: "end", children: /* @__PURE__ */ o(c, { fontSize: "small" }) }) }) : void 0,
|
|
21
|
+
value: t,
|
|
22
|
+
onChange: (m) => {
|
|
23
|
+
e(m.target.value);
|
|
24
|
+
},
|
|
25
|
+
sx: {
|
|
26
|
+
flexBasis: "500px",
|
|
27
|
+
display: "flex",
|
|
28
|
+
boxShadow: "none",
|
|
29
|
+
minWidth: { md: 400, lg: 400, xl: 500 }
|
|
30
|
+
},
|
|
31
|
+
inputProps: {
|
|
32
|
+
autoCorrect: "off",
|
|
33
|
+
autoComplete: "off"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
f.displayName = "SearchInput";
|
|
39
|
+
export {
|
|
40
|
+
f as S
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),M=require("react"),E=require("@mui/material/Select"),h=require("@mui/material/MenuItem"),F=require("@mui/material/FormControl"),N=require("@mui/material/InputLabel"),R=require("@mui/material/FormHelperText"),B=require("@mui/material/ListItemIcon"),O=require("@mui/material/ListItemText"),G=require("@mui/material/CircularProgress"),K=require("@mui/material/OutlinedInput"),U=require("@mui/material/InputBase"),V=require("@mui/material/Chip"),l=require("@mui/material/Box"),_=require("@mui/icons-material/Search"),A=require("@mui/icons-material/Clear"),m=require("./types.cjs");function b({options:u,value:v,onChange:f,size:c="md",color:P="neutral",label:i,helperText:j,placeholder:t,searchable:d=!1,multiple:p=!1,loading:I=!1,error:s,fullWidth:w,disabled:L,clearable:q=!1,sx:z}){const[x,S]=M.useState(""),D=m.toMuiInputSize(c),g=m.toMuiColor(P),H=typeof s=="string"?!!s:s,y=typeof s=="string"?s:void 0,C=M.useMemo(()=>{if(!d||!x)return u;const r=x.toLowerCase();return u.filter(n=>n.label.toLowerCase().includes(r))},[u,x,d]),T=r=>{f(r.target.value)};return e.jsxs(F,{size:D,fullWidth:w,error:H,disabled:L,style:{"--ov-input-height":m.INPUT_HEIGHTS[c]},sx:z,children:[i&&e.jsx(N,{color:g==="default"||g==="inherit"?void 0:g,shrink:!!t||void 0,children:i}),e.jsxs(E,{value:v,onChange:T,multiple:p,displayEmpty:!!t,label:i,notched:i&&!!t||void 0,input:p?e.jsx(K,{label:i}):void 0,onClose:()=>{d&&S("")},renderValue:p?r=>{const n=r;return n.length===0&&t?e.jsx(l,{sx:{color:"var(--ov-fg-faint)"},children:t}):e.jsxs(l,{sx:{display:"flex",flexWrap:"nowrap",gap:.5,overflow:"hidden",alignItems:"center"},children:[n.map(o=>{const W=u.find(a=>a.value===o);return e.jsx(V,{label:W?.label??o,size:"small",...q?{onDelete:a=>{a.stopPropagation(),f(n.filter(k=>k!==o))},onMouseDown:a=>{a.stopPropagation()}}:{}},o)}),q&&n.length>1&&e.jsx("span",{role:"button","aria-label":"Clear all",onMouseDown:o=>{o.stopPropagation(),o.preventDefault(),f([])},style:{display:"inline-flex",alignItems:"center",flexShrink:0,marginLeft:2,cursor:"pointer",color:"var(--ov-fg-faint)",lineHeight:0},children:e.jsx(A,{sx:{fontSize:16}})})]})}:t&&!v?()=>e.jsx(l,{sx:{color:"var(--ov-fg-faint)"},children:t}):void 0,MenuProps:{PaperProps:{sx:{maxHeight:300,...c==="xs"||c==="sm"?{"& .MuiMenuItem-root":{fontSize:"0.8rem",minHeight:28,padding:"3px 8px"},"& .MuiListItemText-root":{margin:0},"& .MuiListItemText-primary":{fontSize:"0.8rem"},"& .MuiListItemIcon-root":{minWidth:22}}:{}}}},children:[d&&e.jsx(l,{sx:{px:1,pb:.5,pt:.5},onKeyDown:r=>r.stopPropagation(),onClickCapture:r=>r.stopPropagation(),onMouseDown:r=>r.stopPropagation(),children:e.jsxs(l,{sx:{display:"flex",alignItems:"center",height:28,border:"1px solid var(--ov-border-default)",borderRadius:"4px",bgcolor:"var(--ov-bg-base)",px:.75,"&:focus-within":{borderColor:"var(--ov-accent)"}},children:[e.jsx(_,{sx:{fontSize:14,color:"var(--ov-fg-faint)",mr:.5}}),e.jsx(U,{autoFocus:!0,fullWidth:!0,placeholder:"Search...",value:x,onChange:r=>S(r.target.value),sx:{flex:1,fontSize:"0.75rem",color:"var(--ov-fg-default)","& input":{py:0,px:0},"& input::placeholder":{color:"var(--ov-fg-faint)",opacity:1}}})]})}),I&&e.jsxs(h,{disabled:!0,children:[e.jsx(G,{size:16,sx:{mr:1}})," Loading..."]}),C.map(r=>e.jsxs(h,{value:r.value,disabled:r.disabled,children:[r.icon&&e.jsx(B,{sx:{minWidth:28},children:r.icon}),e.jsx(O,{children:r.label})]},r.value)),C.length===0&&!I&&e.jsx(h,{disabled:!0,children:"No options"})]}),(y||j)&&e.jsx(R,{children:y??j})]})}b.displayName="Select";exports.Select=b;
|