@omniviewdev/ui 0.1.10 → 0.2.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/dist/AppTheme-BakZ7ezV.cjs +1 -0
- package/dist/AppTheme-wAxlNjgN.js +291 -0
- package/dist/Select-Dg7Xdulg.js +282 -0
- package/dist/Select-mxLKNk8-.cjs +1 -0
- package/dist/buttons/ActionMenu.d.ts +3 -1
- package/dist/buttons.cjs +1 -1
- package/dist/buttons.js +102 -101
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +1 -1
- package/dist/editors/CodeEditor.d.ts +4 -1
- package/dist/editors/DiffViewer.d.ts +17 -1
- package/dist/editors/index.d.ts +1 -1
- package/dist/editors/themes.d.ts +13 -0
- package/dist/editors.cjs +26 -26
- package/dist/editors.js +4194 -4096
- package/dist/index.cjs +1 -1
- package/dist/index.js +175 -163
- package/dist/inputs.cjs +1 -1
- package/dist/inputs.js +1 -1
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.js +66 -57
- package/dist/theme/AppTheme.d.ts +11 -2
- package/dist/theme/customizations/dataDisplay.d.ts +11 -0
- package/dist/theme/customizations/feedback.d.ts +6 -0
- package/dist/theme/customizations/inputs.d.ts +7 -0
- package/dist/theme/customizations/navigation.d.ts +7 -0
- package/dist/theme/index.d.ts +10 -5
- package/dist/theme/registry/init.d.ts +1 -0
- package/dist/theme/registry/registry.d.ts +9 -0
- package/dist/theme/registry/types.d.ts +19 -0
- package/dist/theme/registry/variants/default/index.d.ts +2 -0
- package/dist/theme/registry/variants/solarized/index.d.ts +2 -0
- package/dist/theme/registry/variants/solarized/palettes.d.ts +147 -0
- package/dist/theme.cjs +1 -1
- package/dist/theme.js +1250 -1275
- package/dist/tokens.css +116 -0
- package/package.json +1 -1
- package/dist/Select-CnRBSc5w.cjs +0 -1
- package/dist/Select-DTUF31OP.js +0 -206
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),p=require("@mui/material"),d=require("react"),b=require("@mui/material/styles"),r=b.createTheme(),s={50:"hsl(210, 100%, 95%)",100:"hsl(210, 100%, 92%)",200:"hsl(210, 100%, 80%)",300:"hsl(210, 100%, 65%)",400:"hsl(210, 98%, 48%)",500:"hsl(210, 98%, 42%)",600:"hsl(210, 98%, 55%)",700:"hsl(210, 100%, 35%)",800:"hsl(210, 100%, 16%)",900:"hsl(210, 100%, 21%)"},u={50:"#ECF0F6",100:"#CBD5E1",200:"#ABB8CC",300:"#8B9BB5",400:"#6B7D96",500:"#3E4F66",600:"#2D3D52",700:"#1F2937",800:"#151B23",900:"#0D1117"},n={50:"hsl(120, 80%, 98%)",100:"hsl(120, 75%, 94%)",200:"hsl(120, 75%, 87%)",300:"hsl(120, 61%, 77%)",400:"hsl(120, 44%, 53%)",500:"hsl(120, 59%, 30%)",600:"hsl(120, 70%, 25%)",700:"hsl(120, 75%, 16%)",800:"hsl(120, 84%, 10%)",900:"hsl(120, 87%, 6%)"},i={50:"hsl(45, 100%, 97%)",100:"hsl(45, 92%, 90%)",200:"hsl(45, 94%, 80%)",300:"hsl(45, 90%, 65%)",400:"hsl(45, 90%, 40%)",500:"hsl(45, 90%, 35%)",600:"hsl(45, 91%, 25%)",700:"hsl(45, 94%, 20%)",800:"hsl(45, 95%, 16%)",900:"hsl(45, 93%, 12%)"},l={50:"hsl(0, 100%, 97%)",100:"hsl(0, 92%, 90%)",200:"hsl(0, 94%, 80%)",300:"hsl(0, 90%, 65%)",400:"hsl(0, 90%, 40%)",500:"hsl(0, 90%, 30%)",600:"hsl(0, 91%, 25%)",700:"hsl(0, 94%, 18%)",800:"hsl(0, 95%, 12%)",900:"hsl(0, 93%, 6%)"},h={50:"hsl(270, 100%, 97%)",100:"hsl(270, 92%, 90%)",200:"hsl(270, 80%, 80%)",300:"hsl(270, 70%, 65%)",400:"hsl(270, 70%, 50%)",500:"hsl(270, 70%, 42%)",600:"hsl(270, 70%, 35%)",700:"hsl(270, 75%, 25%)",800:"hsl(270, 80%, 16%)",900:"hsl(270, 85%, 10%)"},S=e=>({palette:{mode:e,primary:{light:s[200],main:s[400],dark:s[700],contrastText:s[50],...e==="dark"&&{contrastText:s[50],light:s[300],main:s[400],dark:s[700]}},info:{light:s[100],main:s[300],dark:s[600],contrastText:u[50],...e==="dark"&&{contrastText:s[300],light:s[500],main:s[700],dark:s[900]}},warning:{light:i[300],main:i[400],dark:i[800],...e==="dark"&&{light:i[400],main:i[500],dark:i[700]}},error:{light:l[300],main:l[400],dark:l[800],...e==="dark"&&{light:l[400],main:l[500],dark:l[700]}},success:{light:n[300],main:n[400],dark:n[800],...e==="dark"&&{light:n[400],main:n[500],dark:n[700]}},secondary:{light:h[300],main:h[400],dark:h[700],contrastText:h[50],...e==="dark"&&{light:h[300],main:h[400],dark:h[800]}},grey:u,divider:e==="dark"?"rgba(62, 79, 102, 0.6)":"rgba(208, 215, 222, 0.6)",background:{default:e==="dark"?"#0D1117":"#FFFFFF",paper:e==="dark"?"#151B23":"#F6F8FA"},text:{primary:e==="dark"?"rgba(236, 240, 246, 0.92)":"rgba(31, 35, 40, 0.92)",secondary:e==="dark"?"rgba(236, 240, 246, 0.64)":"rgba(31, 35, 40, 0.64)"},action:{hover:e==="dark"?"rgba(255, 255, 255, 0.04)":"rgba(31, 35, 40, 0.04)",selected:e==="dark"?"rgba(88, 166, 255, 0.10)":"rgba(9, 105, 218, 0.10)"},baseShadow:e==="dark"?"0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25)":"0 4px 12px rgba(31, 35, 40, 0.12), 0 2px 4px rgba(31, 35, 40, 0.08)"}}),x={fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"','"Noto Sans"',"Helvetica","Arial","sans-serif"].join(","),h1:{fontSize:r.typography.pxToRem(48),fontWeight:600,lineHeight:1.2,letterSpacing:-.5},h2:{fontSize:r.typography.pxToRem(36),fontWeight:600,lineHeight:1.2},h3:{fontSize:r.typography.pxToRem(30),fontWeight:600,lineHeight:1.2},h4:{fontSize:r.typography.pxToRem(24),fontWeight:600,lineHeight:1.5},h5:{fontSize:r.typography.pxToRem(20),fontWeight:600},h6:{fontSize:r.typography.pxToRem(18),fontWeight:600},subtitle1:{fontSize:r.typography.pxToRem(18)},subtitle2:{fontSize:r.typography.pxToRem(14),fontWeight:500},body1:{fontSize:r.typography.pxToRem(14)},body2:{fontSize:r.typography.pxToRem(14),fontWeight:400},caption:{fontSize:r.typography.pxToRem(12),fontWeight:400},button:{textTransform:"none",fontWeight:600},overline:{fontSize:r.typography.pxToRem(12),fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"}},f={borderRadius:8},R=e=>{const t=e==="dark"?"0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25)":"0 4px 12px rgba(31, 35, 40, 0.12), 0 2px 4px rgba(31, 35, 40, 0.08)",a=[...r.shadows];return a[1]=t,a};class F{themes=new Map;register(t,a){this.themes.set(t,a)}get(t){return this.themes.get(t)??this.themes.get("default")}getVariants(){return Array.from(this.themes.keys())}}const k=new F,y=d.createContext({variant:"default",colorMode:"dark"});function z(){return d.useContext(y)}function C({mode:e}){const{setMode:t}=p.useColorScheme();return d.useEffect(()=>{t&&t(e)},[e,t]),null}function B({variant:e}){const{mode:t,systemMode:a}=p.useColorScheme();return d.useEffect(()=>{const c=t==="system"?a??"dark":t??"dark",g=e==="default"?c:`${e}-${c}`;document.documentElement.setAttribute("data-ov-theme",g)},[e,t,a]),null}function w({children:e,disableCustomTheme:t,themeComponents:a,defaultMode:c="dark",variant:g="default"}){const T=d.useMemo(()=>{if(t)return p.createTheme();const m=k.get(g);return p.createTheme({cssVariables:{colorSchemeSelector:"data-mui-color-scheme",cssVarPrefix:"ov-mui"},colorSchemes:{light:{palette:m.getDesignTokens("light").palette},dark:{palette:m.getDesignTokens("dark").palette}},typography:x,shape:f,shadows:m.getShadows("light"),components:{MuiCssBaseline:{styleOverrides:{html:{height:"100%"},body:{height:"100%"}}},...m.getCustomizations(),...a}})},[t,a,g]);return t?o.jsx(o.Fragment,{children:e}):o.jsx(y.Provider,{value:{variant:g,colorMode:c},children:o.jsxs(p.ThemeProvider,{theme:T,children:[o.jsx(p.CssBaseline,{enableColorScheme:!0}),o.jsx(C,{mode:c}),o.jsx(B,{variant:g}),e]})})}exports.AppTheme=w;exports.ThemeRegistry=k;exports.ThemeVariantContext=y;exports.brand=s;exports.customShadows=R;exports.getDesignTokens=S;exports.gray=u;exports.green=n;exports.orange=i;exports.purple=h;exports.red=l;exports.shape=f;exports.typography=x;exports.useThemeVariant=z;
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { jsx as p, Fragment as k, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { createTheme as d, ThemeProvider as b, CssBaseline as S, useColorScheme as f } from "@mui/material";
|
|
3
|
+
import { useMemo as F, createContext as R, useEffect as y, useContext as z } from "react";
|
|
4
|
+
import { createTheme as B } from "@mui/material/styles";
|
|
5
|
+
const r = B(), s = {
|
|
6
|
+
50: "hsl(210, 100%, 95%)",
|
|
7
|
+
100: "hsl(210, 100%, 92%)",
|
|
8
|
+
200: "hsl(210, 100%, 80%)",
|
|
9
|
+
300: "hsl(210, 100%, 65%)",
|
|
10
|
+
400: "hsl(210, 98%, 48%)",
|
|
11
|
+
500: "hsl(210, 98%, 42%)",
|
|
12
|
+
600: "hsl(210, 98%, 55%)",
|
|
13
|
+
700: "hsl(210, 100%, 35%)",
|
|
14
|
+
800: "hsl(210, 100%, 16%)",
|
|
15
|
+
900: "hsl(210, 100%, 21%)"
|
|
16
|
+
}, m = {
|
|
17
|
+
50: "#ECF0F6",
|
|
18
|
+
// --ov-scale-gray-13
|
|
19
|
+
100: "#CBD5E1",
|
|
20
|
+
// --ov-scale-gray-12
|
|
21
|
+
200: "#ABB8CC",
|
|
22
|
+
// --ov-scale-gray-11
|
|
23
|
+
300: "#8B9BB5",
|
|
24
|
+
// --ov-scale-gray-10
|
|
25
|
+
400: "#6B7D96",
|
|
26
|
+
// --ov-scale-gray-9
|
|
27
|
+
500: "#3E4F66",
|
|
28
|
+
// --ov-scale-gray-8
|
|
29
|
+
600: "#2D3D52",
|
|
30
|
+
// --ov-scale-gray-6
|
|
31
|
+
700: "#1F2937",
|
|
32
|
+
// --ov-scale-gray-4
|
|
33
|
+
800: "#151B23",
|
|
34
|
+
// --ov-scale-gray-2
|
|
35
|
+
900: "#0D1117"
|
|
36
|
+
// --ov-scale-gray-0
|
|
37
|
+
}, n = {
|
|
38
|
+
50: "hsl(120, 80%, 98%)",
|
|
39
|
+
100: "hsl(120, 75%, 94%)",
|
|
40
|
+
200: "hsl(120, 75%, 87%)",
|
|
41
|
+
300: "hsl(120, 61%, 77%)",
|
|
42
|
+
400: "hsl(120, 44%, 53%)",
|
|
43
|
+
500: "hsl(120, 59%, 30%)",
|
|
44
|
+
600: "hsl(120, 70%, 25%)",
|
|
45
|
+
700: "hsl(120, 75%, 16%)",
|
|
46
|
+
800: "hsl(120, 84%, 10%)",
|
|
47
|
+
900: "hsl(120, 87%, 6%)"
|
|
48
|
+
}, l = {
|
|
49
|
+
50: "hsl(45, 100%, 97%)",
|
|
50
|
+
100: "hsl(45, 92%, 90%)",
|
|
51
|
+
200: "hsl(45, 94%, 80%)",
|
|
52
|
+
300: "hsl(45, 90%, 65%)",
|
|
53
|
+
400: "hsl(45, 90%, 40%)",
|
|
54
|
+
500: "hsl(45, 90%, 35%)",
|
|
55
|
+
600: "hsl(45, 91%, 25%)",
|
|
56
|
+
700: "hsl(45, 94%, 20%)",
|
|
57
|
+
800: "hsl(45, 95%, 16%)",
|
|
58
|
+
900: "hsl(45, 93%, 12%)"
|
|
59
|
+
}, i = {
|
|
60
|
+
50: "hsl(0, 100%, 97%)",
|
|
61
|
+
100: "hsl(0, 92%, 90%)",
|
|
62
|
+
200: "hsl(0, 94%, 80%)",
|
|
63
|
+
300: "hsl(0, 90%, 65%)",
|
|
64
|
+
400: "hsl(0, 90%, 40%)",
|
|
65
|
+
500: "hsl(0, 90%, 30%)",
|
|
66
|
+
600: "hsl(0, 91%, 25%)",
|
|
67
|
+
700: "hsl(0, 94%, 18%)",
|
|
68
|
+
800: "hsl(0, 95%, 12%)",
|
|
69
|
+
900: "hsl(0, 93%, 6%)"
|
|
70
|
+
}, o = {
|
|
71
|
+
50: "hsl(270, 100%, 97%)",
|
|
72
|
+
100: "hsl(270, 92%, 90%)",
|
|
73
|
+
200: "hsl(270, 80%, 80%)",
|
|
74
|
+
300: "hsl(270, 70%, 65%)",
|
|
75
|
+
400: "hsl(270, 70%, 50%)",
|
|
76
|
+
500: "hsl(270, 70%, 42%)",
|
|
77
|
+
600: "hsl(270, 70%, 35%)",
|
|
78
|
+
700: "hsl(270, 75%, 25%)",
|
|
79
|
+
800: "hsl(270, 80%, 16%)",
|
|
80
|
+
900: "hsl(270, 85%, 10%)"
|
|
81
|
+
}, j = (e) => ({
|
|
82
|
+
palette: {
|
|
83
|
+
mode: e,
|
|
84
|
+
primary: {
|
|
85
|
+
light: s[200],
|
|
86
|
+
main: s[400],
|
|
87
|
+
dark: s[700],
|
|
88
|
+
contrastText: s[50],
|
|
89
|
+
...e === "dark" && {
|
|
90
|
+
contrastText: s[50],
|
|
91
|
+
light: s[300],
|
|
92
|
+
main: s[400],
|
|
93
|
+
dark: s[700]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
info: {
|
|
97
|
+
light: s[100],
|
|
98
|
+
main: s[300],
|
|
99
|
+
dark: s[600],
|
|
100
|
+
contrastText: m[50],
|
|
101
|
+
...e === "dark" && {
|
|
102
|
+
contrastText: s[300],
|
|
103
|
+
light: s[500],
|
|
104
|
+
main: s[700],
|
|
105
|
+
dark: s[900]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
warning: {
|
|
109
|
+
light: l[300],
|
|
110
|
+
main: l[400],
|
|
111
|
+
dark: l[800],
|
|
112
|
+
...e === "dark" && {
|
|
113
|
+
light: l[400],
|
|
114
|
+
main: l[500],
|
|
115
|
+
dark: l[700]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
error: {
|
|
119
|
+
light: i[300],
|
|
120
|
+
main: i[400],
|
|
121
|
+
dark: i[800],
|
|
122
|
+
...e === "dark" && {
|
|
123
|
+
light: i[400],
|
|
124
|
+
main: i[500],
|
|
125
|
+
dark: i[700]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
success: {
|
|
129
|
+
light: n[300],
|
|
130
|
+
main: n[400],
|
|
131
|
+
dark: n[800],
|
|
132
|
+
...e === "dark" && {
|
|
133
|
+
light: n[400],
|
|
134
|
+
main: n[500],
|
|
135
|
+
dark: n[700]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
secondary: {
|
|
139
|
+
light: o[300],
|
|
140
|
+
main: o[400],
|
|
141
|
+
dark: o[700],
|
|
142
|
+
contrastText: o[50],
|
|
143
|
+
...e === "dark" && {
|
|
144
|
+
light: o[300],
|
|
145
|
+
main: o[400],
|
|
146
|
+
dark: o[800]
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
grey: m,
|
|
150
|
+
// Matches --ov-border-default / --ov-border-muted
|
|
151
|
+
divider: e === "dark" ? "rgba(62, 79, 102, 0.6)" : "rgba(208, 215, 222, 0.6)",
|
|
152
|
+
// alpha(--ov-border-default light, 0.6)
|
|
153
|
+
background: {
|
|
154
|
+
// Matches --ov-bg-base / --ov-bg-surface
|
|
155
|
+
default: e === "dark" ? "#0D1117" : "#FFFFFF",
|
|
156
|
+
paper: e === "dark" ? "#151B23" : "#F6F8FA"
|
|
157
|
+
},
|
|
158
|
+
text: {
|
|
159
|
+
// Matches --ov-fg-default / --ov-fg-muted
|
|
160
|
+
primary: e === "dark" ? "rgba(236, 240, 246, 0.92)" : "rgba(31, 35, 40, 0.92)",
|
|
161
|
+
secondary: e === "dark" ? "rgba(236, 240, 246, 0.64)" : "rgba(31, 35, 40, 0.64)"
|
|
162
|
+
},
|
|
163
|
+
action: {
|
|
164
|
+
// Matches --ov-state-hover / --ov-state-selected
|
|
165
|
+
hover: e === "dark" ? "rgba(255, 255, 255, 0.04)" : "rgba(31, 35, 40, 0.04)",
|
|
166
|
+
selected: e === "dark" ? "rgba(88, 166, 255, 0.10)" : "rgba(9, 105, 218, 0.10)"
|
|
167
|
+
},
|
|
168
|
+
baseShadow: e === "dark" ? "0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25)" : "0 4px 12px rgba(31, 35, 40, 0.12), 0 2px 4px rgba(31, 35, 40, 0.08)"
|
|
169
|
+
}
|
|
170
|
+
}), C = {
|
|
171
|
+
fontFamily: [
|
|
172
|
+
"-apple-system",
|
|
173
|
+
"BlinkMacSystemFont",
|
|
174
|
+
'"Segoe UI"',
|
|
175
|
+
'"Noto Sans"',
|
|
176
|
+
"Helvetica",
|
|
177
|
+
"Arial",
|
|
178
|
+
"sans-serif"
|
|
179
|
+
].join(","),
|
|
180
|
+
h1: { fontSize: r.typography.pxToRem(48), fontWeight: 600, lineHeight: 1.2, letterSpacing: -0.5 },
|
|
181
|
+
h2: { fontSize: r.typography.pxToRem(36), fontWeight: 600, lineHeight: 1.2 },
|
|
182
|
+
h3: { fontSize: r.typography.pxToRem(30), fontWeight: 600, lineHeight: 1.2 },
|
|
183
|
+
h4: { fontSize: r.typography.pxToRem(24), fontWeight: 600, lineHeight: 1.5 },
|
|
184
|
+
h5: { fontSize: r.typography.pxToRem(20), fontWeight: 600 },
|
|
185
|
+
h6: { fontSize: r.typography.pxToRem(18), fontWeight: 600 },
|
|
186
|
+
subtitle1: { fontSize: r.typography.pxToRem(18) },
|
|
187
|
+
subtitle2: { fontSize: r.typography.pxToRem(14), fontWeight: 500 },
|
|
188
|
+
body1: { fontSize: r.typography.pxToRem(14) },
|
|
189
|
+
body2: { fontSize: r.typography.pxToRem(14), fontWeight: 400 },
|
|
190
|
+
caption: { fontSize: r.typography.pxToRem(12), fontWeight: 400 },
|
|
191
|
+
button: { textTransform: "none", fontWeight: 600 },
|
|
192
|
+
overline: {
|
|
193
|
+
fontSize: r.typography.pxToRem(12),
|
|
194
|
+
fontWeight: 600,
|
|
195
|
+
textTransform: "uppercase",
|
|
196
|
+
letterSpacing: "0.08em"
|
|
197
|
+
}
|
|
198
|
+
}, W = { borderRadius: 8 }, P = (e) => {
|
|
199
|
+
const t = e === "dark" ? "0 4px 12px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25)" : "0 4px 12px rgba(31, 35, 40, 0.12), 0 2px 4px rgba(31, 35, 40, 0.08)", a = [...r.shadows];
|
|
200
|
+
return a[1] = t, a;
|
|
201
|
+
};
|
|
202
|
+
class w {
|
|
203
|
+
themes = /* @__PURE__ */ new Map();
|
|
204
|
+
register(t, a) {
|
|
205
|
+
this.themes.set(t, a);
|
|
206
|
+
}
|
|
207
|
+
get(t) {
|
|
208
|
+
return this.themes.get(t) ?? this.themes.get("default");
|
|
209
|
+
}
|
|
210
|
+
getVariants() {
|
|
211
|
+
return Array.from(this.themes.keys());
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const D = new w(), u = R({
|
|
215
|
+
variant: "default",
|
|
216
|
+
colorMode: "dark"
|
|
217
|
+
});
|
|
218
|
+
function $() {
|
|
219
|
+
return z(u);
|
|
220
|
+
}
|
|
221
|
+
function M({ mode: e }) {
|
|
222
|
+
const { setMode: t } = f();
|
|
223
|
+
return y(() => {
|
|
224
|
+
t && t(e);
|
|
225
|
+
}, [e, t]), null;
|
|
226
|
+
}
|
|
227
|
+
function v({ variant: e }) {
|
|
228
|
+
const { mode: t, systemMode: a } = f();
|
|
229
|
+
return y(() => {
|
|
230
|
+
const g = t === "system" ? a ?? "dark" : t ?? "dark", h = e === "default" ? g : `${e}-${g}`;
|
|
231
|
+
document.documentElement.setAttribute("data-ov-theme", h);
|
|
232
|
+
}, [e, t, a]), null;
|
|
233
|
+
}
|
|
234
|
+
function O({
|
|
235
|
+
children: e,
|
|
236
|
+
disableCustomTheme: t,
|
|
237
|
+
themeComponents: a,
|
|
238
|
+
defaultMode: g = "dark",
|
|
239
|
+
variant: h = "default"
|
|
240
|
+
}) {
|
|
241
|
+
const x = F(() => {
|
|
242
|
+
if (t)
|
|
243
|
+
return d();
|
|
244
|
+
const c = D.get(h);
|
|
245
|
+
return d({
|
|
246
|
+
cssVariables: {
|
|
247
|
+
colorSchemeSelector: "data-mui-color-scheme",
|
|
248
|
+
cssVarPrefix: "ov-mui"
|
|
249
|
+
},
|
|
250
|
+
colorSchemes: {
|
|
251
|
+
light: { palette: c.getDesignTokens("light").palette },
|
|
252
|
+
dark: { palette: c.getDesignTokens("dark").palette }
|
|
253
|
+
},
|
|
254
|
+
typography: C,
|
|
255
|
+
shape: W,
|
|
256
|
+
shadows: c.getShadows("light"),
|
|
257
|
+
components: {
|
|
258
|
+
MuiCssBaseline: {
|
|
259
|
+
styleOverrides: {
|
|
260
|
+
html: { height: "100%" },
|
|
261
|
+
body: { height: "100%" }
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
...c.getCustomizations(),
|
|
265
|
+
...a
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}, [t, a, h]);
|
|
269
|
+
return t ? /* @__PURE__ */ p(k, { children: e }) : /* @__PURE__ */ p(u.Provider, { value: { variant: h, colorMode: g }, children: /* @__PURE__ */ T(b, { theme: x, children: [
|
|
270
|
+
/* @__PURE__ */ p(S, { enableColorScheme: !0 }),
|
|
271
|
+
/* @__PURE__ */ p(M, { mode: g }),
|
|
272
|
+
/* @__PURE__ */ p(v, { variant: h }),
|
|
273
|
+
e
|
|
274
|
+
] }) });
|
|
275
|
+
}
|
|
276
|
+
export {
|
|
277
|
+
O as A,
|
|
278
|
+
D as T,
|
|
279
|
+
n as a,
|
|
280
|
+
s as b,
|
|
281
|
+
P as c,
|
|
282
|
+
j as d,
|
|
283
|
+
u as e,
|
|
284
|
+
m as g,
|
|
285
|
+
l as o,
|
|
286
|
+
o as p,
|
|
287
|
+
i as r,
|
|
288
|
+
W as s,
|
|
289
|
+
C as t,
|
|
290
|
+
$ as u
|
|
291
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useMemo as K } from "react";
|
|
3
|
+
import R from "@mui/material/Select";
|
|
4
|
+
import w 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 to, toMuiColor as eo } from "./types.js";
|
|
18
|
+
function ro({
|
|
19
|
+
options: g,
|
|
20
|
+
value: h,
|
|
21
|
+
onChange: f,
|
|
22
|
+
size: v = "md",
|
|
23
|
+
color: T = "neutral",
|
|
24
|
+
label: u,
|
|
25
|
+
helperText: M,
|
|
26
|
+
placeholder: i,
|
|
27
|
+
searchable: c = !1,
|
|
28
|
+
multiple: x = !1,
|
|
29
|
+
loading: C = !1,
|
|
30
|
+
error: d,
|
|
31
|
+
fullWidth: E,
|
|
32
|
+
disabled: H,
|
|
33
|
+
clearable: k = !1,
|
|
34
|
+
sx: A
|
|
35
|
+
}) {
|
|
36
|
+
const [y, D] = P(""), [O, L] = P(!1), [s, a] = P(-1), F = to(v), I = eo(T), W = typeof d == "string" ? !!d : d, z = typeof d == "string" ? d : void 0, S = () => {
|
|
37
|
+
L(!1), a(-1), c && D("");
|
|
38
|
+
}, n = K(() => {
|
|
39
|
+
if (!c || !y) return g;
|
|
40
|
+
const o = y.toLowerCase();
|
|
41
|
+
return g.filter((t) => t.label.toLowerCase().includes(o));
|
|
42
|
+
}, [g, y, 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(), n.length === 0) return;
|
|
51
|
+
const t = s + 1;
|
|
52
|
+
a(t >= n.length ? 0 : t);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (o.key === "ArrowUp") {
|
|
56
|
+
o.preventDefault(), o.stopPropagation();
|
|
57
|
+
const t = s - 1;
|
|
58
|
+
a(t < 0 ? n.length - 1 : t);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (o.key === "Tab") {
|
|
62
|
+
if (o.preventDefault(), o.stopPropagation(), n.length === 0) return;
|
|
63
|
+
const t = s + 1;
|
|
64
|
+
a(t >= n.length ? 0 : t);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (o.key === "Enter" && s >= 0 && s < n.length) {
|
|
68
|
+
o.preventDefault(), o.stopPropagation();
|
|
69
|
+
const t = n[s];
|
|
70
|
+
if (!t.disabled)
|
|
71
|
+
if (x) {
|
|
72
|
+
const r = Array.isArray(h) ? h : [], b = r.includes(t.value) ? r.filter((l) => l !== t.value) : [...r, t.value];
|
|
73
|
+
f(b);
|
|
74
|
+
} else
|
|
75
|
+
f(t.value), S();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
o.stopPropagation();
|
|
79
|
+
};
|
|
80
|
+
return /* @__PURE__ */ p(
|
|
81
|
+
U,
|
|
82
|
+
{
|
|
83
|
+
size: F,
|
|
84
|
+
fullWidth: E,
|
|
85
|
+
error: W,
|
|
86
|
+
disabled: H,
|
|
87
|
+
style: { "--ov-input-height": oo[v] },
|
|
88
|
+
sx: A,
|
|
89
|
+
children: [
|
|
90
|
+
u && /* @__PURE__ */ e(
|
|
91
|
+
V,
|
|
92
|
+
{
|
|
93
|
+
color: I === "default" || I === "inherit" ? void 0 : I,
|
|
94
|
+
shrink: !!i || void 0,
|
|
95
|
+
children: u
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ p(
|
|
99
|
+
R,
|
|
100
|
+
{
|
|
101
|
+
value: h,
|
|
102
|
+
onChange: N,
|
|
103
|
+
multiple: x,
|
|
104
|
+
displayEmpty: !!i,
|
|
105
|
+
label: u,
|
|
106
|
+
notched: u && !!i || void 0,
|
|
107
|
+
input: x ? /* @__PURE__ */ e(Q, { label: u }) : void 0,
|
|
108
|
+
open: O,
|
|
109
|
+
onOpen: () => {
|
|
110
|
+
L(!0), a(-1);
|
|
111
|
+
},
|
|
112
|
+
onClose: S,
|
|
113
|
+
renderValue: x ? (o) => {
|
|
114
|
+
const t = o;
|
|
115
|
+
return t.length === 0 && i ? /* @__PURE__ */ e(m, { sx: { color: "var(--ov-fg-faint)" }, children: i }) : /* @__PURE__ */ p(
|
|
116
|
+
m,
|
|
117
|
+
{
|
|
118
|
+
sx: {
|
|
119
|
+
display: "flex",
|
|
120
|
+
flexWrap: "nowrap",
|
|
121
|
+
gap: 0.5,
|
|
122
|
+
overflow: "hidden",
|
|
123
|
+
alignItems: "center"
|
|
124
|
+
},
|
|
125
|
+
children: [
|
|
126
|
+
t.map((r) => {
|
|
127
|
+
const b = g.find((l) => l.value === r);
|
|
128
|
+
return /* @__PURE__ */ e(
|
|
129
|
+
Y,
|
|
130
|
+
{
|
|
131
|
+
label: b?.label ?? r,
|
|
132
|
+
size: "small",
|
|
133
|
+
...k ? {
|
|
134
|
+
onDelete: (l) => {
|
|
135
|
+
l.stopPropagation(), f(t.filter((B) => B !== r));
|
|
136
|
+
},
|
|
137
|
+
onMouseDown: (l) => {
|
|
138
|
+
l.stopPropagation();
|
|
139
|
+
}
|
|
140
|
+
} : {}
|
|
141
|
+
},
|
|
142
|
+
r
|
|
143
|
+
);
|
|
144
|
+
}),
|
|
145
|
+
k && t.length > 1 && /* @__PURE__ */ e(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
"aria-label": "Clear all",
|
|
150
|
+
onClick: (r) => {
|
|
151
|
+
r.stopPropagation(), f([]);
|
|
152
|
+
},
|
|
153
|
+
style: {
|
|
154
|
+
display: "inline-flex",
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
flexShrink: 0,
|
|
157
|
+
marginLeft: 2,
|
|
158
|
+
cursor: "pointer",
|
|
159
|
+
color: "var(--ov-fg-faint)",
|
|
160
|
+
lineHeight: 0,
|
|
161
|
+
background: "none",
|
|
162
|
+
border: "none",
|
|
163
|
+
padding: 0
|
|
164
|
+
},
|
|
165
|
+
children: /* @__PURE__ */ e($, { sx: { fontSize: 16 } })
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
} : i && !h ? () => /* @__PURE__ */ e(m, { sx: { color: "var(--ov-fg-faint)" }, children: i }) : void 0,
|
|
172
|
+
MenuProps: {
|
|
173
|
+
PaperProps: {
|
|
174
|
+
sx: {
|
|
175
|
+
maxHeight: 300,
|
|
176
|
+
...v === "xs" || v === "sm" ? {
|
|
177
|
+
"& .MuiMenuItem-root": {
|
|
178
|
+
fontSize: "0.8rem",
|
|
179
|
+
minHeight: 28,
|
|
180
|
+
padding: "3px 8px"
|
|
181
|
+
},
|
|
182
|
+
"& .MuiListItemText-root": {
|
|
183
|
+
margin: 0
|
|
184
|
+
},
|
|
185
|
+
"& .MuiListItemText-primary": {
|
|
186
|
+
fontSize: "0.8rem"
|
|
187
|
+
},
|
|
188
|
+
"& .MuiListItemIcon-root": {
|
|
189
|
+
minWidth: 22
|
|
190
|
+
}
|
|
191
|
+
} : {}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
children: [
|
|
196
|
+
c && /* @__PURE__ */ e(
|
|
197
|
+
m,
|
|
198
|
+
{
|
|
199
|
+
sx: { px: 1, pb: 0.5, pt: 0.5 },
|
|
200
|
+
onClickCapture: (o) => o.stopPropagation(),
|
|
201
|
+
onMouseDown: (o) => o.stopPropagation(),
|
|
202
|
+
children: /* @__PURE__ */ p(
|
|
203
|
+
m,
|
|
204
|
+
{
|
|
205
|
+
sx: {
|
|
206
|
+
display: "flex",
|
|
207
|
+
alignItems: "center",
|
|
208
|
+
height: 28,
|
|
209
|
+
border: "1px solid var(--ov-border-default)",
|
|
210
|
+
borderRadius: "4px",
|
|
211
|
+
bgcolor: "var(--ov-bg-base)",
|
|
212
|
+
px: 0.75,
|
|
213
|
+
"&:focus-within": { borderColor: "var(--ov-accent)" }
|
|
214
|
+
},
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ e(
|
|
217
|
+
Z,
|
|
218
|
+
{
|
|
219
|
+
sx: { fontSize: 14, color: "var(--ov-fg-faint)", mr: 0.5 }
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ e(
|
|
223
|
+
X,
|
|
224
|
+
{
|
|
225
|
+
autoFocus: !0,
|
|
226
|
+
fullWidth: !0,
|
|
227
|
+
placeholder: "Search...",
|
|
228
|
+
value: y,
|
|
229
|
+
onChange: (o) => {
|
|
230
|
+
D(o.target.value), a(-1);
|
|
231
|
+
},
|
|
232
|
+
onKeyDown: j,
|
|
233
|
+
sx: {
|
|
234
|
+
flex: 1,
|
|
235
|
+
fontSize: "0.75rem",
|
|
236
|
+
color: "var(--ov-fg-default)",
|
|
237
|
+
"& input": { py: 0, px: 0 },
|
|
238
|
+
"& input::placeholder": {
|
|
239
|
+
color: "var(--ov-fg-faint)",
|
|
240
|
+
opacity: 1
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
C && /* @__PURE__ */ p(w, { disabled: !0, children: [
|
|
251
|
+
/* @__PURE__ */ e(J, { size: 16, sx: { mr: 1 } }),
|
|
252
|
+
" Loading..."
|
|
253
|
+
] }),
|
|
254
|
+
n.map((o, t) => /* @__PURE__ */ p(
|
|
255
|
+
w,
|
|
256
|
+
{
|
|
257
|
+
value: o.value,
|
|
258
|
+
disabled: o.disabled,
|
|
259
|
+
...c ? {
|
|
260
|
+
onMouseEnter: () => a(t),
|
|
261
|
+
sx: t === s ? { bgcolor: "action.focus" } : void 0
|
|
262
|
+
} : {},
|
|
263
|
+
children: [
|
|
264
|
+
o.icon && /* @__PURE__ */ e(_, { sx: { minWidth: 28 }, children: o.icon }),
|
|
265
|
+
/* @__PURE__ */ e(q, { children: o.label })
|
|
266
|
+
]
|
|
267
|
+
},
|
|
268
|
+
o.value
|
|
269
|
+
)),
|
|
270
|
+
n.length === 0 && !C && /* @__PURE__ */ e(w, { disabled: !0, children: "No options" })
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
(z || M) && /* @__PURE__ */ e(G, { children: z ?? M })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
ro.displayName = "Select";
|
|
280
|
+
export {
|
|
281
|
+
ro as S
|
|
282
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),y=require("react"),B=require("@mui/material/Select"),q=require("@mui/material/MenuItem"),K=require("@mui/material/FormControl"),U=require("@mui/material/InputLabel"),V=require("@mui/material/FormHelperText"),G=require("@mui/material/ListItemIcon"),_=require("@mui/material/ListItemText"),J=require("@mui/material/CircularProgress"),Q=require("@mui/material/OutlinedInput"),X=require("@mui/material/InputBase"),Y=require("@mui/material/Chip"),f=require("@mui/material/Box"),Z=require("@mui/icons-material/Search"),$=require("@mui/icons-material/Clear"),b=require("./types.cjs");function L({options:x,value:g,onChange:l,size:h="md",color:z="neutral",label:c,helperText:P,placeholder:s,searchable:d=!1,multiple:v=!1,loading:w=!1,error:p,fullWidth:T,disabled:E,clearable:M=!1,sx:H}){const[m,C]=y.useState(""),[A,k]=y.useState(!1),[i,a]=y.useState(-1),O=b.toMuiInputSize(h),I=b.toMuiColor(z),F=typeof p=="string"?!!p:p,D=typeof p=="string"?p:void 0,j=()=>{k(!1),a(-1),d&&C("")},o=y.useMemo(()=>{if(!d||!m)return x;const e=m.toLowerCase();return x.filter(t=>t.label.toLowerCase().includes(e))},[x,m,d]),R=e=>{l(e.target.value)},W=e=>{if(e.key==="Escape"){j();return}if(e.key==="ArrowDown"){if(e.preventDefault(),e.stopPropagation(),o.length===0)return;const t=i+1;a(t>=o.length?0:t);return}if(e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation();const t=i-1;a(t<0?o.length-1:t);return}if(e.key==="Tab"){if(e.preventDefault(),e.stopPropagation(),o.length===0)return;const t=i+1;a(t>=o.length?0:t);return}if(e.key==="Enter"&&i>=0&&i<o.length){e.preventDefault(),e.stopPropagation();const t=o[i];if(!t.disabled)if(v){const n=Array.isArray(g)?g:[],S=n.includes(t.value)?n.filter(u=>u!==t.value):[...n,t.value];l(S)}else l(t.value),j();return}e.stopPropagation()};return r.jsxs(K,{size:O,fullWidth:T,error:F,disabled:E,style:{"--ov-input-height":b.INPUT_HEIGHTS[h]},sx:H,children:[c&&r.jsx(U,{color:I==="default"||I==="inherit"?void 0:I,shrink:!!s||void 0,children:c}),r.jsxs(B,{value:g,onChange:R,multiple:v,displayEmpty:!!s,label:c,notched:c&&!!s||void 0,input:v?r.jsx(Q,{label:c}):void 0,open:A,onOpen:()=>{k(!0),a(-1)},onClose:j,renderValue:v?e=>{const t=e;return t.length===0&&s?r.jsx(f,{sx:{color:"var(--ov-fg-faint)"},children:s}):r.jsxs(f,{sx:{display:"flex",flexWrap:"nowrap",gap:.5,overflow:"hidden",alignItems:"center"},children:[t.map(n=>{const S=x.find(u=>u.value===n);return r.jsx(Y,{label:S?.label??n,size:"small",...M?{onDelete:u=>{u.stopPropagation(),l(t.filter(N=>N!==n))},onMouseDown:u=>{u.stopPropagation()}}:{}},n)}),M&&t.length>1&&r.jsx("button",{type:"button","aria-label":"Clear all",onClick:n=>{n.stopPropagation(),l([])},style:{display:"inline-flex",alignItems:"center",flexShrink:0,marginLeft:2,cursor:"pointer",color:"var(--ov-fg-faint)",lineHeight:0,background:"none",border:"none",padding:0},children:r.jsx($,{sx:{fontSize:16}})})]})}:s&&!g?()=>r.jsx(f,{sx:{color:"var(--ov-fg-faint)"},children:s}):void 0,MenuProps:{PaperProps:{sx:{maxHeight:300,...h==="xs"||h==="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&&r.jsx(f,{sx:{px:1,pb:.5,pt:.5},onClickCapture:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:r.jsxs(f,{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:[r.jsx(Z,{sx:{fontSize:14,color:"var(--ov-fg-faint)",mr:.5}}),r.jsx(X,{autoFocus:!0,fullWidth:!0,placeholder:"Search...",value:m,onChange:e=>{C(e.target.value),a(-1)},onKeyDown:W,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}}})]})}),w&&r.jsxs(q,{disabled:!0,children:[r.jsx(J,{size:16,sx:{mr:1}})," Loading..."]}),o.map((e,t)=>r.jsxs(q,{value:e.value,disabled:e.disabled,...d?{onMouseEnter:()=>a(t),sx:t===i?{bgcolor:"action.focus"}:void 0}:{},children:[e.icon&&r.jsx(G,{sx:{minWidth:28},children:e.icon}),r.jsx(_,{children:e.label})]},e.value)),o.length===0&&!w&&r.jsx(q,{disabled:!0,children:"No options"})]}),(D||P)&&r.jsx(V,{children:D??P})]})}L.displayName="Select";exports.Select=L;
|
|
@@ -13,8 +13,10 @@ export interface ActionMenuProps {
|
|
|
13
13
|
items: ActionMenuItem[];
|
|
14
14
|
trigger?: React.ReactNode;
|
|
15
15
|
size?: ComponentSize;
|
|
16
|
+
/** Accessible label for the default trigger button. */
|
|
17
|
+
label?: string;
|
|
16
18
|
}
|
|
17
|
-
declare function ActionMenu({ items, trigger, size, }: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function ActionMenu({ items, trigger, size, label, }: ActionMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
declare namespace ActionMenu {
|
|
19
21
|
var displayName: string;
|
|
20
22
|
}
|
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-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:
|
|
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:r="Are you sure?",children:c,...e}){const[l,s]=g.useState(!1),i=g.useRef(null);return o.jsxs(o.Fragment,{children:[o.jsx(m,{component:"span",ref:i,sx:{display:"inline-flex"},children:o.jsx(y.Button,{...e,onClick:()=>s(!0),children:c})}),o.jsxs(O,{open:l,anchorEl:i.current,onClose:()=>s(!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:r}),o.jsxs(m,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[o.jsx(y.Button,{size:"xs",emphasis:"ghost",color:"neutral",onClick:()=>s(!1),children:"Cancel"}),o.jsx(y.Button,{size:"xs",emphasis:"solid",color:"danger",onClick:()=>{s(!1),n()},children:"Confirm"})]})]})]})}q.displayName="ConfirmButton";function S({items:n,trigger:r,size:c="sm",label:e="Actions"}){const[l,s]=g.useState(!1),i=g.useRef(null),u=()=>s(!1);return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:i,children:r?o.jsx("span",{onClick:()=>s(!0),style:{cursor:"pointer"},children:r}):o.jsx(B.IconButton,{size:c,color:"neutral",onClick:()=>s(!0),"aria-label":e,children:o.jsx(K,{fontSize:"inherit"})})}),o.jsx(w,{open:l,anchorEl:i.current,onClose:u,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(t=>[o.jsxs(N,{disabled:t.disabled,onClick:()=>{u(),t.onClick()},sx:{fontSize:"var(--ov-text-sm)",color:t.color==="danger"||t.color==="error"?"var(--ov-danger-default)":"var(--ov-fg-default)"},children:[t.icon&&o.jsx(E,{sx:{color:"inherit",minWidth:28},children:t.icon}),o.jsx($,{children:t.label})]},t.key),t.dividerAfter&&o.jsx(D,{},`${t.key}-divider`)])})]})}S.displayName="ActionMenu";function k({children:n,emphasis:r="outline",size:c="sm",color:e="neutral",fullWidth:l,orientation:s="horizontal",disabled:i,sx:u}){const t=d.toMuiColor(e),p=d.toMuiVariant(r),a=d.toMuiSize(c);return o.jsx(W,{color:t,variant:p,size:a,fullWidth:l,orientation:s,disabled:i,sx:u,children:n})}k.displayName="ButtonGroup";const _={default:36,dense:28};function M({children:n,variant:r="default",dividers:c=!1,sx:e}){const l=_[r];return o.jsx(m,{sx:{display:"flex",alignItems:"center",height:l,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 e=="object"&&!Array.isArray(e)?e:{}},children:n})}M.displayName="Toolbar";function T({children:n,sx:r}){return o.jsx(m,{sx:{display:"flex",alignItems:"center",gap:"2px",...typeof r=="object"&&!Array.isArray(r)?r:{}},children:n})}T.displayName="ToolbarGroup";function A({selected:n,onChange:r,icon:c,label:e,size:l="sm",color:s="primary",disabled:i,sx:u}){const t=d.toMuiSize(l),p=d.toCssColor(s),a=o.jsx(v,{size:t,disabled:i,onClick:()=>r(!n),sx:{borderRadius:"4px",color:n?p:"var(--ov-fg-muted)",bgcolor:n?"var(--ov-state-hover)":"transparent","&:hover":{bgcolor:"var(--ov-state-hover)"},...typeof u=="object"&&!Array.isArray(u)?u:{}},children:c});return e?o.jsx(C,{title:e,children:a}):a}A.displayName="ToggleButton";function I({value:n,onChange:r,options:c,exclusive:e=!0,size:l="sm",color:s="primary",sx:i}){const u=d.toMuiSize(l),t=d.toCssColor(s),p=(a,x)=>{x!==null&&r(x)};return o.jsx(U,{value:n,exclusive:e,onChange:p,size:u,sx:{"& .Mui-selected":{color:`${t} !important`,bgcolor:"var(--ov-state-hover) !important"},...typeof i=="object"&&!Array.isArray(i)?i:{}},children:c.map(a=>o.jsxs(F,{value:a.key,disabled:a.disabled,sx:{fontSize:"var(--ov-text-sm)",textTransform:"none",px:1.5,gap:.5},children:[a.icon,a.label]},a.key))})}I.displayName="ToggleGroup";const H={xs:24,sm:28,md:32,lg:36,xl:40};function G({value:n,onChange:r,placeholder:c="Search...",regex:e,caseSensitive:l,onRegexChange:s,onCaseSensitiveChange:i,matchCount:u,currentMatch:t,onNext:p,onPrev:a,size:x="sm",sx:j}){const R=H[x],h=x==="xs"?12:14,L=g.useCallback(f=>{f.key==="Enter"&&(f.shiftKey?a?.():p?.()),f.key==="Escape"&&f.target.blur()},[p,a]);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=>r(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}}}),i&&o.jsx(C,{title:"Match Case",children:o.jsx(v,{size:"small",onClick:()=>i(!l),sx:{borderRadius:"3px",p:"2px",color:l?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:l?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuCaseSensitive,{size:h})})}),s&&o.jsx(C,{title:"Use Regular Expression",children:o.jsx(v,{size:"small",onClick:()=>s(!e),sx:{borderRadius:"3px",p:"2px",color:e?"var(--ov-accent-fg)":"var(--ov-fg-faint)",bgcolor:e?"var(--ov-accent-subtle)":"transparent"},children:o.jsx(b.LuRegex,{size:h})})}),u!==void 0&&o.jsx(z,{sx:{fontSize:"var(--ov-text-xs)",color:"var(--ov-fg-muted)",whiteSpace:"nowrap",px:.5},children:u===0?"No results":`${(t??0)+1}/${u}`}),a&&o.jsx(v,{size:"small",onClick:a,sx:{p:"2px"},children:o.jsx(b.LuChevronUp,{size:h})}),p&&o.jsx(v,{size:"small",onClick:p,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;
|