@omniviewdev/ui 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/AppTheme-BakZ7ezV.cjs +1 -0
  2. package/dist/AppTheme-wAxlNjgN.js +291 -0
  3. package/dist/{CodeBlock-CIyG0DbW.cjs → CodeBlock-DTB_WsXQ.cjs} +1 -1
  4. package/dist/{CodeBlock-B1iQO7zU.js → CodeBlock-DV6CPG00.js} +1 -1
  5. package/dist/CopyButton-3fq1UAiv.cjs +1 -0
  6. package/dist/CopyButton-DWVcqdPe.js +78 -0
  7. package/dist/{ErrorState-CnIR-1xa.cjs → ErrorState-Cwwem5yh.cjs} +1 -1
  8. package/dist/{ErrorState-CexYrMpy.js → ErrorState-DNOrahZX.js} +1 -1
  9. package/dist/Select-BqA47TdK.cjs +1 -0
  10. package/dist/Select-D61fKI8Y.js +276 -0
  11. package/dist/{Tooltip-BEVuYuZ3.js → Tooltip-CZMOcjX7.js} +10 -10
  12. package/dist/Tooltip-oUFp4gNV.cjs +1 -0
  13. package/dist/buttons/IconButton.d.ts +1 -4
  14. package/dist/buttons.cjs +1 -1
  15. package/dist/buttons.js +2 -2
  16. package/dist/charts.cjs +1 -1
  17. package/dist/charts.js +2 -2
  18. package/dist/domain.cjs +1 -1
  19. package/dist/domain.js +3 -3
  20. package/dist/editors/index.d.ts +1 -1
  21. package/dist/editors/themes.d.ts +13 -0
  22. package/dist/editors.cjs +26 -26
  23. package/dist/editors.js +3860 -3791
  24. package/dist/feedback.cjs +1 -1
  25. package/dist/feedback.js +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/inputs.cjs +1 -1
  29. package/dist/inputs.js +1 -1
  30. package/dist/overlays.cjs +1 -1
  31. package/dist/overlays.js +1 -1
  32. package/dist/theme/AppTheme.d.ts +11 -2
  33. package/dist/theme/customizations/dataDisplay.d.ts +11 -0
  34. package/dist/theme/customizations/feedback.d.ts +6 -0
  35. package/dist/theme/customizations/inputs.d.ts +7 -0
  36. package/dist/theme/customizations/navigation.d.ts +7 -0
  37. package/dist/theme/index.d.ts +10 -5
  38. package/dist/theme/registry/init.d.ts +1 -0
  39. package/dist/theme/registry/registry.d.ts +9 -0
  40. package/dist/theme/registry/types.d.ts +19 -0
  41. package/dist/theme/registry/variants/default/index.d.ts +2 -0
  42. package/dist/theme/registry/variants/solarized/index.d.ts +2 -0
  43. package/dist/theme/registry/variants/solarized/palettes.d.ts +147 -0
  44. package/dist/theme.cjs +1 -1
  45. package/dist/theme.js +1250 -1275
  46. package/dist/tokens.css +116 -0
  47. package/dist/typography.cjs +1 -1
  48. package/dist/typography.js +1 -1
  49. package/package.json +1 -1
  50. package/dist/CopyButton-CACe3RCF.cjs +0 -1
  51. package/dist/CopyButton-DPBgL0K8.js +0 -77
  52. package/dist/Select-CnRBSc5w.cjs +0 -1
  53. package/dist/Select-DTUF31OP.js +0 -206
  54. package/dist/Tooltip-44-P5KfQ.cjs +0 -1
package/dist/tokens.css CHANGED
@@ -242,6 +242,122 @@
242
242
  --ov-accent-fg: #79C0FF;
243
243
  }
244
244
 
245
+ /* ================================================================
246
+ * SOLARIZED DARK
247
+ * Ethan Schoonover's Solarized palette — dark variant.
248
+ * Overrides the gray-scale primitives so that var()-based semantic
249
+ * tokens (backgrounds, borders) resolve automatically.
250
+ * ================================================================ */
251
+ [data-ov-theme="solarized-dark"] {
252
+ /* Neutral scale: base03 → base02 → base01 → base00 → base0 → base1 → base2 */
253
+ --ov-scale-gray-0: #002B36;
254
+ --ov-scale-gray-1: #04313C;
255
+ --ov-scale-gray-2: #073642;
256
+ --ov-scale-gray-3: #133E49;
257
+ --ov-scale-gray-4: #1E4651;
258
+ --ov-scale-gray-5: #2A4E58;
259
+ --ov-scale-gray-6: #35565F;
260
+ --ov-scale-gray-7: #415E66;
261
+ --ov-scale-gray-8: #4C666E;
262
+ --ov-scale-gray-9: #586E75;
263
+ --ov-scale-gray-10: #657B83;
264
+ --ov-scale-gray-11: #839496;
265
+ --ov-scale-gray-12: #93A1A1;
266
+ --ov-scale-gray-13: #EEE8D5;
267
+
268
+ --ov-fg-base: #93A1A1;
269
+ --ov-fg-default: rgba(147, 161, 161, 0.92);
270
+ --ov-fg-muted: rgba(147, 161, 161, 0.64);
271
+ --ov-fg-faint: rgba(147, 161, 161, 0.44);
272
+ --ov-fg-disabled: rgba(147, 161, 161, 0.28);
273
+ --ov-fg-accent: #268BD2;
274
+
275
+ --ov-accent: #268BD2;
276
+ --ov-accent-muted: rgba(38, 139, 210, 0.20);
277
+ --ov-accent-subtle: rgba(38, 139, 210, 0.10);
278
+ --ov-accent-fg: #268BD2;
279
+
280
+ --ov-success-emphasis: #5B6B00;
281
+ --ov-success-default: #859900;
282
+ --ov-success-muted: rgba(133, 153, 0, 0.12);
283
+
284
+ --ov-warning-emphasis: #7B5D00;
285
+ --ov-warning-default: #B58900;
286
+ --ov-warning-muted: rgba(181, 137, 0, 0.12);
287
+
288
+ --ov-danger-emphasis: #B5211E;
289
+ --ov-danger-default: #DC322F;
290
+ --ov-danger-muted: rgba(220, 50, 47, 0.12);
291
+
292
+ --ov-info-emphasis: #1A6091;
293
+ --ov-info-default: #268BD2;
294
+ --ov-info-muted: rgba(38, 139, 210, 0.12);
295
+
296
+ --ov-shadow-sm: 0 1px 3px rgba(0, 20, 26, 0.30), 0 1px 2px rgba(0, 20, 26, 0.20);
297
+ --ov-shadow-md: 0 4px 12px rgba(0, 20, 26, 0.35), 0 2px 4px rgba(0, 20, 26, 0.25);
298
+ --ov-shadow-lg: 0 8px 24px rgba(0, 20, 26, 0.40), 0 4px 8px rgba(0, 20, 26, 0.30);
299
+ --ov-shadow-xl: 0 16px 48px rgba(0, 20, 26, 0.45);
300
+
301
+ --ov-state-hover: rgba(147, 161, 161, 0.04);
302
+ --ov-state-active: rgba(147, 161, 161, 0.07);
303
+ --ov-state-selected: var(--ov-accent-subtle);
304
+ --ov-state-focus: 0 0 0 2px var(--ov-accent);
305
+ }
306
+
307
+ /* ================================================================
308
+ * SOLARIZED LIGHT
309
+ * Ethan Schoonover's Solarized palette — light variant.
310
+ * ================================================================ */
311
+ [data-ov-theme="solarized-light"] {
312
+ --ov-bg-base: #FDF6E3;
313
+ --ov-bg-surface: #EEE8D5;
314
+ --ov-bg-surface-raised: #FDF6E3;
315
+ --ov-bg-surface-overlay: #FDF6E3;
316
+ --ov-bg-surface-inset: #E4DECB;
317
+
318
+ --ov-fg-base: #586E75;
319
+ --ov-fg-default: rgba(88, 110, 117, 0.92);
320
+ --ov-fg-muted: rgba(88, 110, 117, 0.64);
321
+ --ov-fg-faint: rgba(88, 110, 117, 0.44);
322
+ --ov-fg-disabled: rgba(88, 110, 117, 0.28);
323
+ --ov-fg-accent: #268BD2;
324
+
325
+ --ov-border-default: #C9C2AF;
326
+ --ov-border-muted: #DDD6C1;
327
+ --ov-border-emphasis: #93A1A1;
328
+
329
+ --ov-accent: #268BD2;
330
+ --ov-accent-muted: rgba(38, 139, 210, 0.20);
331
+ --ov-accent-subtle: rgba(38, 139, 210, 0.10);
332
+ --ov-accent-fg: #1A6091;
333
+
334
+ --ov-success-emphasis: #5B6B00;
335
+ --ov-success-default: #859900;
336
+ --ov-success-muted: rgba(133, 153, 0, 0.10);
337
+
338
+ --ov-warning-emphasis: #7B5D00;
339
+ --ov-warning-default: #B58900;
340
+ --ov-warning-muted: rgba(181, 137, 0, 0.10);
341
+
342
+ --ov-danger-emphasis: #B5211E;
343
+ --ov-danger-default: #DC322F;
344
+ --ov-danger-muted: rgba(220, 50, 47, 0.10);
345
+
346
+ --ov-info-emphasis: #1A6091;
347
+ --ov-info-default: #268BD2;
348
+ --ov-info-muted: rgba(38, 139, 210, 0.10);
349
+
350
+ --ov-shadow-sm: 0 1px 3px rgba(88, 110, 117, 0.10), 0 1px 2px rgba(88, 110, 117, 0.06);
351
+ --ov-shadow-md: 0 4px 12px rgba(88, 110, 117, 0.12), 0 2px 4px rgba(88, 110, 117, 0.08);
352
+ --ov-shadow-lg: 0 8px 24px rgba(88, 110, 117, 0.16), 0 4px 8px rgba(88, 110, 117, 0.10);
353
+ --ov-shadow-xl: 0 16px 48px rgba(88, 110, 117, 0.20);
354
+
355
+ --ov-state-hover: rgba(88, 110, 117, 0.04);
356
+ --ov-state-active: rgba(88, 110, 117, 0.07);
357
+ --ov-state-selected: var(--ov-accent-subtle);
358
+ --ov-state-focus: 0 0 0 2px var(--ov-accent);
359
+ }
360
+
245
361
  /* ================================================================
246
362
  * REDUCED MOTION
247
363
  * ================================================================ */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Text-Mk6Uyg1w.cjs"),i=require("react/jsx-runtime"),v=require("@mui/material/Typography"),s=require("@mui/material/Box"),y=require("@mui/icons-material/Link"),h=require("./CodeBlock-CIyG0DbW.cjs"),m=require("@mui/material/Link"),x=require("./types.cjs"),b={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function l({children:n,level:o=2,id:e,copyLink:t=!1,sx:r}){const a=typeof o=="string"?parseInt(o.replace("h",""),10):o,c=b[a],u=()=>{if(e){const f=`${window.location.origin}${window.location.pathname}#${e}`;navigator.clipboard.writeText(f)}};return i.jsxs(v,{variant:c,id:e,sx:{color:"var(--ov-fg-base)",fontWeight:"var(--ov-weight-semibold)",display:"flex",alignItems:"center",gap:.5,"&:hover .ov-heading-anchor":{opacity:1},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:[n,t&&e&&i.jsx(s,{component:"button",className:"ov-heading-anchor",onClick:u,sx:{opacity:0,transition:"opacity 150ms",background:"none",border:"none",cursor:"pointer",color:"var(--ov-fg-faint)",display:"inline-flex",p:0,"&:hover":{color:"var(--ov-fg-default)"}},children:i.jsx(y,{sx:{fontSize:"0.7em"}})})]})}l.displayName="Heading";function d({children:n,sx:o}){return i.jsx(s,{component:"code",sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.85em",backgroundColor:"var(--ov-bg-surface-inset)",color:"var(--ov-fg-default)",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap",...typeof o=="object"&&!Array.isArray(o)?o:{}},children:n})}d.displayName="CodeInline";function p({children:n,href:o,color:e="primary",underline:t="hover",external:r=!1,onClick:a,sx:c}){return i.jsx(m,{href:o,color:x.toMuiColor(e),underline:t,onClick:a,...r?{target:"_blank",rel:"noopener noreferrer"}:{},sx:c,children:n})}p.displayName="Link";exports.Text=g.Text;exports.CodeBlock=h.CodeBlock;exports.CodeInline=d;exports.Heading=l;exports.Link=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Text-Mk6Uyg1w.cjs"),i=require("react/jsx-runtime"),v=require("@mui/material/Typography"),s=require("@mui/material/Box"),y=require("@mui/icons-material/Link"),h=require("./CodeBlock-DTB_WsXQ.cjs"),m=require("@mui/material/Link"),x=require("./types.cjs"),b={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};function l({children:n,level:o=2,id:e,copyLink:t=!1,sx:r}){const a=typeof o=="string"?parseInt(o.replace("h",""),10):o,c=b[a],u=()=>{if(e){const f=`${window.location.origin}${window.location.pathname}#${e}`;navigator.clipboard.writeText(f)}};return i.jsxs(v,{variant:c,id:e,sx:{color:"var(--ov-fg-base)",fontWeight:"var(--ov-weight-semibold)",display:"flex",alignItems:"center",gap:.5,"&:hover .ov-heading-anchor":{opacity:1},...typeof r=="object"&&!Array.isArray(r)?r:{}},children:[n,t&&e&&i.jsx(s,{component:"button",className:"ov-heading-anchor",onClick:u,sx:{opacity:0,transition:"opacity 150ms",background:"none",border:"none",cursor:"pointer",color:"var(--ov-fg-faint)",display:"inline-flex",p:0,"&:hover":{color:"var(--ov-fg-default)"}},children:i.jsx(y,{sx:{fontSize:"0.7em"}})})]})}l.displayName="Heading";function d({children:n,sx:o}){return i.jsx(s,{component:"code",sx:{fontFamily:"var(--ov-font-mono)",fontSize:"0.85em",backgroundColor:"var(--ov-bg-surface-inset)",color:"var(--ov-fg-default)",padding:"2px 6px",borderRadius:"3px",whiteSpace:"nowrap",...typeof o=="object"&&!Array.isArray(o)?o:{}},children:n})}d.displayName="CodeInline";function p({children:n,href:o,color:e="primary",underline:t="hover",external:r=!1,onClick:a,sx:c}){return i.jsx(m,{href:o,color:x.toMuiColor(e),underline:t,onClick:a,...r?{target:"_blank",rel:"noopener noreferrer"}:{},sx:c,children:n})}p.displayName="Link";exports.Text=g.Text;exports.CodeBlock=h.CodeBlock;exports.CodeInline=d;exports.Heading=l;exports.Link=p;
@@ -3,7 +3,7 @@ import { jsxs as s, jsx as a } from "react/jsx-runtime";
3
3
  import m from "@mui/material/Typography";
4
4
  import c from "@mui/material/Box";
5
5
  import d from "@mui/icons-material/Link";
6
- import { C as S } from "./CodeBlock-B1iQO7zU.js";
6
+ import { C as S } from "./CodeBlock-DV6CPG00.js";
7
7
  import h from "@mui/material/Link";
8
8
  import { toMuiColor as v } from "./types.js";
9
9
  const g = {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Omniview",
3
3
  "license": "AGPL-3.0-only",
4
4
  "name": "@omniviewdev/ui",
5
- "version": "0.1.9",
5
+ "version": "0.1.11",
6
6
  "description": "Shared UI components, tokens, and theming for Omniview",
7
7
  "sideEffects": [
8
8
  "*.css"
@@ -1 +0,0 @@
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;
@@ -1,77 +0,0 @@
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
- };
@@ -1 +0,0 @@
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;
@@ -1,206 +0,0 @@
1
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
- import { useState as E, useMemo as F } from "react";
3
- import N from "@mui/material/Select";
4
- import x from "@mui/material/MenuItem";
5
- import j from "@mui/material/FormControl";
6
- import B from "@mui/material/InputLabel";
7
- import O from "@mui/material/FormHelperText";
8
- import G from "@mui/material/ListItemIcon";
9
- import K from "@mui/material/ListItemText";
10
- import R from "@mui/material/CircularProgress";
11
- import U from "@mui/material/OutlinedInput";
12
- import V from "@mui/material/InputBase";
13
- import _ from "@mui/material/Chip";
14
- import m from "@mui/material/Box";
15
- import q from "@mui/icons-material/Search";
16
- import A from "@mui/icons-material/Clear";
17
- import { INPUT_HEIGHTS as J, toMuiInputSize as Q, toMuiColor as X } from "./types.js";
18
- function Y({
19
- options: f,
20
- value: v,
21
- onChange: c,
22
- size: p = "md",
23
- color: P = "neutral",
24
- label: a,
25
- helperText: I,
26
- placeholder: t,
27
- searchable: u = !1,
28
- multiple: g = !1,
29
- loading: S = !1,
30
- error: s,
31
- fullWidth: w,
32
- disabled: L,
33
- clearable: y = !1,
34
- sx: z
35
- }) {
36
- const [d, C] = E(""), D = Q(p), h = X(P), H = typeof s == "string" ? !!s : s, M = typeof s == "string" ? s : void 0, b = F(() => {
37
- if (!u || !d) return f;
38
- const o = d.toLowerCase();
39
- return f.filter((i) => i.label.toLowerCase().includes(o));
40
- }, [f, d, u]), T = (o) => {
41
- c(o.target.value);
42
- };
43
- return /* @__PURE__ */ n(
44
- j,
45
- {
46
- size: D,
47
- fullWidth: w,
48
- error: H,
49
- disabled: L,
50
- style: { "--ov-input-height": J[p] },
51
- sx: z,
52
- children: [
53
- a && /* @__PURE__ */ r(
54
- B,
55
- {
56
- color: h === "default" || h === "inherit" ? void 0 : h,
57
- shrink: !!t || void 0,
58
- children: a
59
- }
60
- ),
61
- /* @__PURE__ */ n(
62
- N,
63
- {
64
- value: v,
65
- onChange: T,
66
- multiple: g,
67
- displayEmpty: !!t,
68
- label: a,
69
- notched: a && !!t || void 0,
70
- input: g ? /* @__PURE__ */ r(U, { label: a }) : void 0,
71
- onClose: () => {
72
- u && C("");
73
- },
74
- renderValue: g ? (o) => {
75
- const i = o;
76
- return i.length === 0 && t ? /* @__PURE__ */ r(m, { sx: { color: "var(--ov-fg-faint)" }, children: t }) : /* @__PURE__ */ n(m, { sx: { display: "flex", flexWrap: "nowrap", gap: 0.5, overflow: "hidden", alignItems: "center" }, children: [
77
- i.map((e) => {
78
- const W = f.find((l) => l.value === e);
79
- return /* @__PURE__ */ r(
80
- _,
81
- {
82
- label: W?.label ?? e,
83
- size: "small",
84
- ...y ? {
85
- onDelete: (l) => {
86
- l.stopPropagation(), c(i.filter((k) => k !== e));
87
- },
88
- onMouseDown: (l) => {
89
- l.stopPropagation();
90
- }
91
- } : {}
92
- },
93
- e
94
- );
95
- }),
96
- y && i.length > 1 && /* @__PURE__ */ r(
97
- "span",
98
- {
99
- role: "button",
100
- "aria-label": "Clear all",
101
- onMouseDown: (e) => {
102
- e.stopPropagation(), e.preventDefault(), c([]);
103
- },
104
- style: {
105
- display: "inline-flex",
106
- alignItems: "center",
107
- flexShrink: 0,
108
- marginLeft: 2,
109
- cursor: "pointer",
110
- color: "var(--ov-fg-faint)",
111
- lineHeight: 0
112
- },
113
- children: /* @__PURE__ */ r(A, { sx: { fontSize: 16 } })
114
- }
115
- )
116
- ] });
117
- } : t && !v ? () => /* @__PURE__ */ r(m, { sx: { color: "var(--ov-fg-faint)" }, children: t }) : void 0,
118
- MenuProps: {
119
- PaperProps: {
120
- sx: {
121
- maxHeight: 300,
122
- ...p === "xs" || p === "sm" ? {
123
- "& .MuiMenuItem-root": {
124
- fontSize: "0.8rem",
125
- minHeight: 28,
126
- padding: "3px 8px"
127
- },
128
- "& .MuiListItemText-root": {
129
- margin: 0
130
- },
131
- "& .MuiListItemText-primary": {
132
- fontSize: "0.8rem"
133
- },
134
- "& .MuiListItemIcon-root": {
135
- minWidth: 22
136
- }
137
- } : {}
138
- }
139
- }
140
- },
141
- children: [
142
- u && /* @__PURE__ */ r(
143
- m,
144
- {
145
- sx: { px: 1, pb: 0.5, pt: 0.5 },
146
- onKeyDown: (o) => o.stopPropagation(),
147
- onClickCapture: (o) => o.stopPropagation(),
148
- onMouseDown: (o) => o.stopPropagation(),
149
- children: /* @__PURE__ */ n(
150
- m,
151
- {
152
- sx: {
153
- display: "flex",
154
- alignItems: "center",
155
- height: 28,
156
- border: "1px solid var(--ov-border-default)",
157
- borderRadius: "4px",
158
- bgcolor: "var(--ov-bg-base)",
159
- px: 0.75,
160
- "&:focus-within": { borderColor: "var(--ov-accent)" }
161
- },
162
- children: [
163
- /* @__PURE__ */ r(q, { sx: { fontSize: 14, color: "var(--ov-fg-faint)", mr: 0.5 } }),
164
- /* @__PURE__ */ r(
165
- V,
166
- {
167
- autoFocus: !0,
168
- fullWidth: !0,
169
- placeholder: "Search...",
170
- value: d,
171
- onChange: (o) => C(o.target.value),
172
- sx: {
173
- flex: 1,
174
- fontSize: "0.75rem",
175
- color: "var(--ov-fg-default)",
176
- "& input": { py: 0, px: 0 },
177
- "& input::placeholder": { color: "var(--ov-fg-faint)", opacity: 1 }
178
- }
179
- }
180
- )
181
- ]
182
- }
183
- )
184
- }
185
- ),
186
- S && /* @__PURE__ */ n(x, { disabled: !0, children: [
187
- /* @__PURE__ */ r(R, { size: 16, sx: { mr: 1 } }),
188
- " Loading..."
189
- ] }),
190
- b.map((o) => /* @__PURE__ */ n(x, { value: o.value, disabled: o.disabled, children: [
191
- o.icon && /* @__PURE__ */ r(G, { sx: { minWidth: 28 }, children: o.icon }),
192
- /* @__PURE__ */ r(K, { children: o.label })
193
- ] }, o.value)),
194
- b.length === 0 && !S && /* @__PURE__ */ r(x, { disabled: !0, children: "No options" })
195
- ]
196
- }
197
- ),
198
- (M || I) && /* @__PURE__ */ r(O, { children: M ?? I })
199
- ]
200
- }
201
- );
202
- }
203
- Y.displayName = "Select";
204
- export {
205
- Y as S
206
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),p=require("@mui/material/Tooltip"),s=require("@mui/material/Box");function n({title:t,content:l,variant:o="default",placement:c="top",delay:r,children:x}){const i=t??l??"",u=o==="code"?e.jsx(s,{sx:{fontFamily:"var(--ov-font-mono)",fontSize:"var(--ov-text-xs)",bgcolor:"var(--ov-bg-surface-inset)",px:1,py:.5,borderRadius:"3px"},children:i}):o==="rich"?e.jsx(s,{sx:{p:1,maxWidth:320},children:i}):t;return e.jsx(p,{title:u,placement:c,enterDelay:r,enterNextDelay:r,arrow:o==="default",children:x})}n.displayName="Tooltip";exports.Tooltip=n;