@genomicx/ui 0.8.0 → 0.9.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.
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export type StatusBadgeVariant = 'success' | 'warning' | 'error' | 'info' | 'muted';
3
+ export interface StatusBadgeProps {
4
+ variant: StatusBadgeVariant;
5
+ children: ReactNode;
6
+ }
7
+ export declare function StatusBadge({ variant, children }: StatusBadgeProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export { ProgressBar } from './components/ProgressBar';
11
11
  export type { ProgressBarProps } from './components/ProgressBar';
12
12
  export { Alert } from './components/Alert';
13
13
  export type { AlertProps, AlertVariant } from './components/Alert';
14
+ export { StatusBadge } from './components/StatusBadge';
15
+ export type { StatusBadgeProps, StatusBadgeVariant } from './components/StatusBadge';
14
16
  export { loadWasmModule, createModuleInstance } from './wasm/loader';
15
17
  export type { EmscriptenModule, WasmModuleFactory } from './wasm/types';
16
18
  export { downloadBlob, downloadText, downloadBuffer } from './utils/download';
package/dist/index.js CHANGED
@@ -36,8 +36,8 @@ const b = () => /* @__PURE__ */ l("svg", { className: "gx-nav-logo-icon", viewBo
36
36
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "6" }),
37
37
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" })
38
38
  ] });
39
- function M({ appName: a, appSubtitle: n, version: o, icon: r, githubUrl: t, actions: c, mobileActions: s }) {
40
- const [i, m] = p(!1);
39
+ function M({ appName: a, appSubtitle: n, version: o, icon: r, githubUrl: t, actions: c, mobileActions: i }) {
40
+ const [s, m] = p(!1);
41
41
  return /* @__PURE__ */ l("nav", { className: "gx-nav", children: [
42
42
  /* @__PURE__ */ e("div", { className: "gx-nav-inner", children: /* @__PURE__ */ l("div", { className: "gx-nav-row", children: [
43
43
  /* @__PURE__ */ l(g, { to: "/", className: "gx-nav-logo", children: [
@@ -64,11 +64,11 @@ function M({ appName: a, appSubtitle: n, version: o, icon: r, githubUrl: t, acti
64
64
  ] }),
65
65
  /* @__PURE__ */ l("div", { className: "gx-nav-mobile-toggle", children: [
66
66
  /* @__PURE__ */ e(N, {}),
67
- /* @__PURE__ */ e("button", { onClick: () => m(!i), className: "gx-nav-hamburger", "aria-label": "Toggle menu", children: i ? /* @__PURE__ */ e("svg", { className: "gx-nav-hamburger-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ e("svg", { className: "gx-nav-hamburger-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }) })
67
+ /* @__PURE__ */ e("button", { onClick: () => m(!s), className: "gx-nav-hamburger", "aria-label": "Toggle menu", children: s ? /* @__PURE__ */ e("svg", { className: "gx-nav-hamburger-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ e("svg", { className: "gx-nav-hamburger-icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 6h16M4 12h16M4 18h16" }) }) })
68
68
  ] })
69
69
  ] }) }),
70
- i && /* @__PURE__ */ l("div", { className: "gx-nav-dropdown", children: [
71
- s,
70
+ s && /* @__PURE__ */ l("div", { className: "gx-nav-dropdown", children: [
71
+ i,
72
72
  /* @__PURE__ */ e(g, { to: "/about", onClick: () => m(!1), className: "gx-nav-dropdown-link", children: "About" }),
73
73
  t && /* @__PURE__ */ e("a", { href: t, target: "_blank", rel: "noopener noreferrer", className: "gx-nav-dropdown-link", children: "GitHub ↗" })
74
74
  ] })
@@ -92,7 +92,7 @@ function C({ onClose: a, bugReportEmail: n, bugReportUrl: o, bugReportItems: r }
92
92
  /* @__PURE__ */ e("p", { className: "gx-modal-email", children: /* @__PURE__ */ e("a", { href: `mailto:${n}`, children: n }) }),
93
93
  /* @__PURE__ */ l("div", { className: "gx-modal-checklist", children: [
94
94
  /* @__PURE__ */ e("p", { className: "gx-modal-checklist-title", children: "Please include:" }),
95
- /* @__PURE__ */ e("ol", { className: "gx-modal-checklist-items", children: t.map((c, s) => /* @__PURE__ */ e("li", { children: c }, s)) })
95
+ /* @__PURE__ */ e("ol", { className: "gx-modal-checklist-items", children: t.map((c, i) => /* @__PURE__ */ e("li", { children: c }, i)) })
96
96
  ] }),
97
97
  o && /* @__PURE__ */ l("p", { className: "gx-modal-github-hint", children: [
98
98
  "You can also open an issue on",
@@ -104,9 +104,9 @@ function C({ onClose: a, bugReportEmail: n, bugReportUrl: o, bugReportItems: r }
104
104
  ] }) });
105
105
  }
106
106
  function L({ appName: a = "GenomicX", bugReportEmail: n, bugReportUrl: o, onReportBug: r, bugReportItems: t }) {
107
- const [c, s] = p(!1);
108
- function i() {
109
- n ? s(!0) : r && r();
107
+ const [c, i] = p(!1);
108
+ function s() {
109
+ n ? i(!0) : r && r();
110
110
  }
111
111
  return /* @__PURE__ */ l(x, { children: [
112
112
  /* @__PURE__ */ e("footer", { className: "gx-footer", children: /* @__PURE__ */ e("div", { className: "gx-footer-inner", children: /* @__PURE__ */ l("div", { className: "gx-footer-content", children: [
@@ -119,13 +119,13 @@ function L({ appName: a = "GenomicX", bugReportEmail: n, bugReportUrl: o, onRepo
119
119
  ] }),
120
120
  /* @__PURE__ */ l("div", { className: "gx-footer-links", children: [
121
121
  /* @__PURE__ */ e("a", { href: "https://genomicx.org", target: "_blank", rel: "noopener noreferrer", className: "gx-footer-link", children: "genomicx.org" }),
122
- (n || o || r) && /* @__PURE__ */ e("button", { onClick: i, className: "gx-footer-link", children: "Report Bug" })
122
+ (n || o || r) && /* @__PURE__ */ e("button", { onClick: s, className: "gx-footer-link", children: "Report Bug" })
123
123
  ] })
124
124
  ] }) }) }),
125
125
  c && n && /* @__PURE__ */ e(
126
126
  C,
127
127
  {
128
- onClose: () => s(!1),
128
+ onClose: () => i(!1),
129
129
  bugReportEmail: n,
130
130
  bugReportUrl: o,
131
131
  bugReportItems: t
@@ -175,33 +175,33 @@ function R({ logs: a, progress: n, title: o = "Console" }) {
175
175
  "Copy"
176
176
  ] })
177
177
  ] }),
178
- /* @__PURE__ */ e("div", { ref: r, className: "gx-console-body", children: a.length === 0 ? /* @__PURE__ */ e("div", { className: "gx-console-empty", children: "No logs yet..." }) : a.map((s, i) => /* @__PURE__ */ e("div", { className: "gx-console-line", children: s }, i)) })
178
+ /* @__PURE__ */ e("div", { ref: r, className: "gx-console-body", children: a.length === 0 ? /* @__PURE__ */ e("div", { className: "gx-console-empty", children: "No logs yet..." }) : a.map((i, s) => /* @__PURE__ */ e("div", { className: "gx-console-line", children: i }, s)) })
179
179
  ] });
180
180
  }
181
- function _({
181
+ function S({
182
182
  files: a,
183
183
  onFilesChange: n,
184
184
  disabled: o = !1,
185
185
  multiple: r = !0,
186
186
  accept: t = ".fasta,.fa,.fna,.fsa,.fasta.gz,.fa.gz,.fna.gz",
187
187
  label: c = "Drop files here or click to browse",
188
- hint: s,
189
- filterFn: i
188
+ hint: i,
189
+ filterFn: s
190
190
  }) {
191
191
  const m = f(
192
192
  (d) => {
193
193
  if (!d.target.files) return;
194
194
  let h = Array.from(d.target.files);
195
- i && (h = h.filter(i)), h.length > 0 && n(h);
195
+ s && (h = h.filter(s)), h.length > 0 && n(h);
196
196
  },
197
- [n, i]
197
+ [n, s]
198
198
  ), w = f(
199
199
  (d) => {
200
200
  if (d.preventDefault(), !d.dataTransfer.files) return;
201
201
  let h = Array.from(d.dataTransfer.files);
202
- i && (h = h.filter(i)), h.length > 0 && n(h);
202
+ s && (h = h.filter(s)), h.length > 0 && n(h);
203
203
  },
204
- [n, i]
204
+ [n, s]
205
205
  );
206
206
  return /* @__PURE__ */ e("div", { className: "gx-file-upload", onDrop: w, onDragOver: (d) => d.preventDefault(), children: /* @__PURE__ */ l("label", { className: "gx-file-upload-area", children: [
207
207
  /* @__PURE__ */ e(
@@ -234,7 +234,7 @@ function _({
234
234
  ),
235
235
  a.length === 0 ? /* @__PURE__ */ l(x, { children: [
236
236
  /* @__PURE__ */ e("div", { className: "gx-file-upload-label", children: c }),
237
- s && /* @__PURE__ */ e("div", { className: "gx-file-upload-hint", children: s })
237
+ i && /* @__PURE__ */ e("div", { className: "gx-file-upload-hint", children: i })
238
238
  ] }) : /* @__PURE__ */ l(x, { children: [
239
239
  /* @__PURE__ */ l("div", { className: "gx-file-upload-label", children: [
240
240
  a.length,
@@ -246,7 +246,7 @@ function _({
246
246
  ] })
247
247
  ] }) });
248
248
  }
249
- function S({ value: a, label: n }) {
249
+ function _({ value: a, label: n }) {
250
250
  const o = Math.min(100, Math.max(0, a));
251
251
  return /* @__PURE__ */ l("div", { className: "gx-progress-wrap", children: [
252
252
  /* @__PURE__ */ e(
@@ -290,6 +290,9 @@ function E({ variant: a, children: n }) {
290
290
  /* @__PURE__ */ e("div", { className: "gx-alert-body", children: n })
291
291
  ] });
292
292
  }
293
+ function I({ variant: a, children: n }) {
294
+ return /* @__PURE__ */ e("span", { className: `gx-badge gx-badge--${a}`, children: n });
295
+ }
293
296
  const A = "https://static.genomicx.org/wasm", u = /* @__PURE__ */ new Map();
294
297
  async function z(a, n = A) {
295
298
  const o = `${n}/${a}`;
@@ -300,29 +303,29 @@ async function z(a, n = A) {
300
303
  ]);
301
304
  if (!r.ok) throw new Error(`Failed to fetch ${a}.js: ${r.status}`);
302
305
  if (!t.ok) throw new Error(`Failed to fetch ${a}.wasm: ${t.status}`);
303
- const [c, s] = await Promise.all([
306
+ const [c, i] = await Promise.all([
304
307
  r.text(),
305
308
  t.arrayBuffer()
306
- ]), m = { factory: new Function("Module", c + "; return Module;")({}), wasmBinary: s };
309
+ ]), m = { factory: new Function("Module", c + "; return Module;")({}), wasmBinary: i };
307
310
  return u.set(o, m), m;
308
311
  }
309
- async function I(a, n) {
310
- const { factory: o, wasmBinary: r } = await z(a, n), t = [], c = [], s = await o({
312
+ async function O(a, n) {
313
+ const { factory: o, wasmBinary: r } = await z(a, n), t = [], c = [], i = await o({
311
314
  wasmBinary: r.slice(0),
312
- print: (i) => t.push(i),
313
- printErr: (i) => c.push(i),
315
+ print: (s) => t.push(s),
316
+ printErr: (s) => c.push(s),
314
317
  noInitialRun: !0
315
318
  });
316
- return s._stdout = t, s._stderr = c, s;
319
+ return i._stdout = t, i._stderr = c, i;
317
320
  }
318
321
  function k(a, n) {
319
322
  const o = URL.createObjectURL(a), r = document.createElement("a");
320
323
  r.href = o, r.download = n, r.click(), URL.revokeObjectURL(o);
321
324
  }
322
- function O(a, n, o = "text/plain") {
325
+ function P(a, n, o = "text/plain") {
323
326
  k(new Blob([a], { type: o }), n);
324
327
  }
325
- function P(a, n) {
328
+ function G(a, n) {
326
329
  k(new Blob([a]), n);
327
330
  }
328
331
  export {
@@ -330,14 +333,15 @@ export {
330
333
  L as AppFooter,
331
334
  H as AppShell,
332
335
  C as BugReportModal,
333
- _ as FileUpload,
336
+ S as FileUpload,
334
337
  R as LogConsole,
335
338
  M as NavBar,
336
- S as ProgressBar,
339
+ _ as ProgressBar,
340
+ I as StatusBadge,
337
341
  N as ThemeToggle,
338
- I as createModuleInstance,
342
+ O as createModuleInstance,
339
343
  k as downloadBlob,
340
- P as downloadBuffer,
341
- O as downloadText,
344
+ G as downloadBuffer,
345
+ P as downloadText,
342
346
  z as loadWasmModule
343
347
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genomicx/ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Shared UI components, styles, and WASM loader for GenomicX tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -613,3 +613,20 @@ code {
613
613
  .gx-alert-icon--success { color: var(--gx-success); }
614
614
 
615
615
  .gx-alert-body { flex: 1; }
616
+
617
+ /* ── StatusBadge ─────────────────────────────── */
618
+ .gx-badge {
619
+ display: inline-flex;
620
+ align-items: center;
621
+ padding: 0.2rem 0.6rem;
622
+ border-radius: var(--gx-radius-pill);
623
+ font-size: 0.75rem;
624
+ font-weight: 600;
625
+ border: 1px solid;
626
+ white-space: nowrap;
627
+ }
628
+ .gx-badge--success { background: color-mix(in srgb, var(--gx-success) 12%, transparent); border-color: color-mix(in srgb, var(--gx-success) 30%, transparent); color: var(--gx-success); }
629
+ .gx-badge--warning { background: color-mix(in srgb, var(--gx-warning) 12%, transparent); border-color: color-mix(in srgb, var(--gx-warning) 30%, transparent); color: var(--gx-warning); }
630
+ .gx-badge--error { background: color-mix(in srgb, var(--gx-error) 12%, transparent); border-color: color-mix(in srgb, var(--gx-error) 30%, transparent); color: var(--gx-error); }
631
+ .gx-badge--info { background: color-mix(in srgb, var(--gx-info) 12%, transparent); border-color: color-mix(in srgb, var(--gx-info) 30%, transparent); color: var(--gx-info); }
632
+ .gx-badge--muted { background: color-mix(in srgb, var(--gx-text-muted) 12%, transparent); border-color: color-mix(in srgb, var(--gx-text-muted) 30%, transparent); color: var(--gx-text-muted); }