@imdanibytes/nexus-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.
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { jsx as a, jsxs as h } from "react/jsx-runtime";
2
2
  import * as L from "react";
3
- import { useState as A, useEffect as ce, memo as rt, useCallback as R, useRef as Q, useContext as ot, createContext as kt, forwardRef as yt, useMemo as vt } from "react";
3
+ import { useState as A, useEffect as ce, memo as rt, useCallback as T, useRef as H, useContext as ot, createContext as kt, forwardRef as yt, useMemo as vt } from "react";
4
4
  import { HeroUIProvider as wt, Input as Nt, Button as Se, Tooltip as ze } from "@heroui/react";
5
5
  import { Toaster as Ct } from "sonner";
6
- import { Toaster as jo, toast as Bo } from "sonner";
6
+ import { Toaster as Bo, toast as Fo } from "sonner";
7
7
  import { Streamdown as _t } from "streamdown";
8
8
  import { createMathPlugin as St } from "@streamdown/math";
9
9
  import { createCodePlugin as zt } from "@streamdown/code";
10
- import It from "remark-gfm";
11
- import { visit as Z } from "unist-util-visit";
12
- import { ChevronDownIcon as Rt, CheckIcon as Tt, CopyIcon as $t, ArrowUpIcon as Mt, SquareIcon as At, XIcon as Et } from "lucide-react";
13
- import { AnimatePresence as Ie, motion as we, LazyMotion as Be, domAnimation as Fe, m as de } from "framer-motion";
10
+ import Rt from "remark-gfm";
11
+ import { visit as Q } from "unist-util-visit";
12
+ import { ChevronDownIcon as Tt, CheckIcon as It, CopyIcon as $t, ArrowUpIcon as Mt, SquareIcon as At, XIcon as Et } from "lucide-react";
13
+ import { AnimatePresence as Re, motion as we, LazyMotion as Be, domAnimation as Fe, m as de } from "framer-motion";
14
14
  const nt = L.createContext({
15
15
  apiUrl: "http://localhost:9600"
16
16
  });
17
- function wo() {
17
+ function No() {
18
18
  return L.useContext(nt);
19
19
  }
20
20
  function be(e) {
@@ -27,7 +27,7 @@ function Ot() {
27
27
  return;
28
28
  }
29
29
  }
30
- function No({
30
+ function Co({
31
31
  children: e,
32
32
  apiUrl: t = "http://localhost:9600",
33
33
  toaster: r = !0
@@ -132,10 +132,10 @@ const Lt = (e, t) => {
132
132
  const r = at();
133
133
  for (const o in e) {
134
134
  const n = e[o];
135
- Re(n, r, o, t);
135
+ Te(n, r, o, t);
136
136
  }
137
137
  return r;
138
- }, Re = (e, t, r, o) => {
138
+ }, Te = (e, t, r, o) => {
139
139
  const n = e.length;
140
140
  for (let l = 0; l < n; l++) {
141
141
  const s = e[l];
@@ -156,7 +156,7 @@ const Lt = (e, t) => {
156
156
  o.classGroupId = r;
157
157
  }, qt = (e, t, r, o) => {
158
158
  if (Jt(e)) {
159
- Re(e(o), t, r, o);
159
+ Te(e(o), t, r, o);
160
160
  return;
161
161
  }
162
162
  t.validators === null && (t.validators = []), t.validators.push(jt(r, e));
@@ -164,7 +164,7 @@ const Lt = (e, t) => {
164
164
  const n = Object.entries(e), l = n.length;
165
165
  for (let s = 0; s < l; s++) {
166
166
  const [i, c] = n[s];
167
- Re(c, it(t, i), r, o);
167
+ Te(c, it(t, i), r, o);
168
168
  }
169
169
  }, it = (e, t) => {
170
170
  let r = e;
@@ -302,14 +302,14 @@ const Lt = (e, t) => {
302
302
  }
303
303
  z = !1;
304
304
  }
305
- const ee = x.length === 0 ? "" : x.length === 1 ? x[0] : l(x).join(":"), K = v ? ee + Ne : ee, G = K + j;
305
+ const ee = x.length === 0 ? "" : x.length === 1 ? x[0] : l(x).join(":"), Y = v ? ee + Ne : ee, G = Y + j;
306
306
  if (s.indexOf(G) > -1)
307
307
  continue;
308
308
  s.push(G);
309
309
  const D = n(j, z);
310
310
  for (let B = 0; B < D.length; ++B) {
311
- const Y = D[B];
312
- s.push(K + Y);
311
+ const X = D[B];
312
+ s.push(Y + X);
313
313
  }
314
314
  c = b + (c.length > 0 ? " " + c : c);
315
315
  }
@@ -347,14 +347,14 @@ const Lt = (e, t) => {
347
347
  // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
348
348
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
349
349
  lr.test(e) && !ir.test(e)
350
- ), mt = () => !1, pr = (e) => cr.test(e), fr = (e) => dr.test(e), hr = (e) => !u(e) && !m(e), br = (e) => H(e, ht, mt), u = (e) => dt.test(e), W = (e) => H(e, bt, mr), xe = (e) => H(e, vr, k), Ve = (e) => H(e, pt, mt), gr = (e) => H(e, ft, fr), ae = (e) => H(e, gt, pr), m = (e) => ut.test(e), X = (e) => J(e, bt), xr = (e) => J(e, wr), Ue = (e) => J(e, pt), kr = (e) => J(e, ht), yr = (e) => J(e, ft), le = (e) => J(e, gt, !0), H = (e, t, r) => {
350
+ ), mt = () => !1, pr = (e) => cr.test(e), fr = (e) => dr.test(e), hr = (e) => !u(e) && !m(e), br = (e) => J(e, ht, mt), u = (e) => dt.test(e), W = (e) => J(e, bt, mr), xe = (e) => J(e, vr, k), Ve = (e) => J(e, pt, mt), gr = (e) => J(e, ft, fr), ae = (e) => J(e, gt, pr), m = (e) => ut.test(e), Z = (e) => K(e, bt), xr = (e) => K(e, wr), Ue = (e) => K(e, pt), kr = (e) => K(e, ht), yr = (e) => K(e, ft), le = (e) => K(e, gt, !0), J = (e, t, r) => {
351
351
  const o = dt.exec(e);
352
352
  return o ? o[1] ? t(o[1]) : r(o[2]) : !1;
353
- }, J = (e, t, r = !1) => {
353
+ }, K = (e, t, r = !1) => {
354
354
  const o = ut.exec(e);
355
355
  return o ? o[1] ? t(o[1]) : r : !1;
356
356
  }, pt = (e) => e === "position" || e === "percentage", ft = (e) => e === "image" || e === "url", ht = (e) => e === "length" || e === "size" || e === "bg-size", bt = (e) => e === "length", vr = (e) => e === "number", wr = (e) => e === "family-name", gt = (e) => e === "shadow", Nr = () => {
357
- const e = N("color"), t = N("font"), r = N("text"), o = N("font-weight"), n = N("tracking"), l = N("leading"), s = N("breakpoint"), i = N("container"), c = N("spacing"), d = N("radius"), b = N("shadow"), y = N("inset-shadow"), x = N("text-shadow"), v = N("drop-shadow"), w = N("blur"), _ = N("perspective"), z = N("aspect"), j = N("ease"), ee = N("animate"), K = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], G = () => [
357
+ const e = N("color"), t = N("font"), r = N("text"), o = N("font-weight"), n = N("tracking"), l = N("leading"), s = N("breakpoint"), i = N("container"), c = N("spacing"), d = N("radius"), b = N("shadow"), y = N("inset-shadow"), x = N("text-shadow"), v = N("drop-shadow"), w = N("blur"), _ = N("perspective"), z = N("aspect"), j = N("ease"), ee = N("animate"), Y = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], G = () => [
358
358
  "center",
359
359
  "top",
360
360
  "bottom",
@@ -372,7 +372,7 @@ const Lt = (e, t) => {
372
372
  "bottom-left",
373
373
  // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
374
374
  "left-bottom"
375
- ], D = () => [...G(), m, u], B = () => ["auto", "hidden", "clip", "visible", "scroll"], Y = () => ["auto", "contain", "none"], g = () => [m, u, c], T = () => [U, "full", "auto", ...g()], $e = () => [E, "none", "subgrid", m, u], Me = () => ["auto", {
375
+ ], D = () => [...G(), m, u], B = () => ["auto", "hidden", "clip", "visible", "scroll"], X = () => ["auto", "contain", "none"], g = () => [m, u, c], I = () => [U, "full", "auto", ...g()], $e = () => [E, "none", "subgrid", m, u], Me = () => ["auto", {
376
376
  span: ["full", E, m, u]
377
377
  }, E, m, u], te = () => [E, "auto", m, u], Ae = () => ["auto", "min", "max", "fr", m, u], pe = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], V = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], $ = () => ["auto", ...g()], F = () => [U, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...g()], f = () => [e, m, u], Ee = () => [...G(), Ue, Ve, {
378
378
  position: [m, u]
@@ -380,7 +380,7 @@ const Lt = (e, t) => {
380
380
  repeat: ["", "x", "y", "space", "round"]
381
381
  }], Pe = () => ["auto", "cover", "contain", kr, br, {
382
382
  size: [m, u]
383
- }], fe = () => [ge, X, W], S = () => [
383
+ }], fe = () => [ge, Z, W], S = () => [
384
384
  // Deprecated since Tailwind CSS v4.0.0
385
385
  "",
386
386
  "none",
@@ -388,7 +388,7 @@ const Lt = (e, t) => {
388
388
  d,
389
389
  m,
390
390
  u
391
- ], I = () => ["", k, X, W], re = () => ["solid", "dashed", "dotted", "double"], Le = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], C = () => [k, ge, Ue, Ve], je = () => [
391
+ ], R = () => ["", k, Z, W], re = () => ["solid", "dashed", "dotted", "double"], Le = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], C = () => [k, ge, Ue, Ve], je = () => [
392
392
  // Deprecated since Tailwind CSS v4.0.0
393
393
  "",
394
394
  "none",
@@ -448,14 +448,14 @@ const Lt = (e, t) => {
448
448
  * @see https://tailwindcss.com/docs/break-after
449
449
  */
450
450
  "break-after": [{
451
- "break-after": K()
451
+ "break-after": Y()
452
452
  }],
453
453
  /**
454
454
  * Break Before
455
455
  * @see https://tailwindcss.com/docs/break-before
456
456
  */
457
457
  "break-before": [{
458
- "break-before": K()
458
+ "break-before": Y()
459
459
  }],
460
460
  /**
461
461
  * Break Inside
@@ -547,21 +547,21 @@ const Lt = (e, t) => {
547
547
  * @see https://tailwindcss.com/docs/overscroll-behavior
548
548
  */
549
549
  overscroll: [{
550
- overscroll: Y()
550
+ overscroll: X()
551
551
  }],
552
552
  /**
553
553
  * Overscroll Behavior X
554
554
  * @see https://tailwindcss.com/docs/overscroll-behavior
555
555
  */
556
556
  "overscroll-x": [{
557
- "overscroll-x": Y()
557
+ "overscroll-x": X()
558
558
  }],
559
559
  /**
560
560
  * Overscroll Behavior Y
561
561
  * @see https://tailwindcss.com/docs/overscroll-behavior
562
562
  */
563
563
  "overscroll-y": [{
564
- "overscroll-y": Y()
564
+ "overscroll-y": X()
565
565
  }],
566
566
  /**
567
567
  * Position
@@ -573,63 +573,63 @@ const Lt = (e, t) => {
573
573
  * @see https://tailwindcss.com/docs/top-right-bottom-left
574
574
  */
575
575
  inset: [{
576
- inset: T()
576
+ inset: I()
577
577
  }],
578
578
  /**
579
579
  * Right / Left
580
580
  * @see https://tailwindcss.com/docs/top-right-bottom-left
581
581
  */
582
582
  "inset-x": [{
583
- "inset-x": T()
583
+ "inset-x": I()
584
584
  }],
585
585
  /**
586
586
  * Top / Bottom
587
587
  * @see https://tailwindcss.com/docs/top-right-bottom-left
588
588
  */
589
589
  "inset-y": [{
590
- "inset-y": T()
590
+ "inset-y": I()
591
591
  }],
592
592
  /**
593
593
  * Start
594
594
  * @see https://tailwindcss.com/docs/top-right-bottom-left
595
595
  */
596
596
  start: [{
597
- start: T()
597
+ start: I()
598
598
  }],
599
599
  /**
600
600
  * End
601
601
  * @see https://tailwindcss.com/docs/top-right-bottom-left
602
602
  */
603
603
  end: [{
604
- end: T()
604
+ end: I()
605
605
  }],
606
606
  /**
607
607
  * Top
608
608
  * @see https://tailwindcss.com/docs/top-right-bottom-left
609
609
  */
610
610
  top: [{
611
- top: T()
611
+ top: I()
612
612
  }],
613
613
  /**
614
614
  * Right
615
615
  * @see https://tailwindcss.com/docs/top-right-bottom-left
616
616
  */
617
617
  right: [{
618
- right: T()
618
+ right: I()
619
619
  }],
620
620
  /**
621
621
  * Bottom
622
622
  * @see https://tailwindcss.com/docs/top-right-bottom-left
623
623
  */
624
624
  bottom: [{
625
- bottom: T()
625
+ bottom: I()
626
626
  }],
627
627
  /**
628
628
  * Left
629
629
  * @see https://tailwindcss.com/docs/top-right-bottom-left
630
630
  */
631
631
  left: [{
632
- left: T()
632
+ left: I()
633
633
  }],
634
634
  /**
635
635
  * Visibility
@@ -1088,7 +1088,7 @@ const Lt = (e, t) => {
1088
1088
  * @see https://tailwindcss.com/docs/font-size
1089
1089
  */
1090
1090
  "font-size": [{
1091
- text: ["base", r, X, W]
1091
+ text: ["base", r, Z, W]
1092
1092
  }],
1093
1093
  /**
1094
1094
  * Font Smoothing
@@ -1538,70 +1538,70 @@ const Lt = (e, t) => {
1538
1538
  * @see https://tailwindcss.com/docs/border-width
1539
1539
  */
1540
1540
  "border-w": [{
1541
- border: I()
1541
+ border: R()
1542
1542
  }],
1543
1543
  /**
1544
1544
  * Border Width X
1545
1545
  * @see https://tailwindcss.com/docs/border-width
1546
1546
  */
1547
1547
  "border-w-x": [{
1548
- "border-x": I()
1548
+ "border-x": R()
1549
1549
  }],
1550
1550
  /**
1551
1551
  * Border Width Y
1552
1552
  * @see https://tailwindcss.com/docs/border-width
1553
1553
  */
1554
1554
  "border-w-y": [{
1555
- "border-y": I()
1555
+ "border-y": R()
1556
1556
  }],
1557
1557
  /**
1558
1558
  * Border Width Start
1559
1559
  * @see https://tailwindcss.com/docs/border-width
1560
1560
  */
1561
1561
  "border-w-s": [{
1562
- "border-s": I()
1562
+ "border-s": R()
1563
1563
  }],
1564
1564
  /**
1565
1565
  * Border Width End
1566
1566
  * @see https://tailwindcss.com/docs/border-width
1567
1567
  */
1568
1568
  "border-w-e": [{
1569
- "border-e": I()
1569
+ "border-e": R()
1570
1570
  }],
1571
1571
  /**
1572
1572
  * Border Width Top
1573
1573
  * @see https://tailwindcss.com/docs/border-width
1574
1574
  */
1575
1575
  "border-w-t": [{
1576
- "border-t": I()
1576
+ "border-t": R()
1577
1577
  }],
1578
1578
  /**
1579
1579
  * Border Width Right
1580
1580
  * @see https://tailwindcss.com/docs/border-width
1581
1581
  */
1582
1582
  "border-w-r": [{
1583
- "border-r": I()
1583
+ "border-r": R()
1584
1584
  }],
1585
1585
  /**
1586
1586
  * Border Width Bottom
1587
1587
  * @see https://tailwindcss.com/docs/border-width
1588
1588
  */
1589
1589
  "border-w-b": [{
1590
- "border-b": I()
1590
+ "border-b": R()
1591
1591
  }],
1592
1592
  /**
1593
1593
  * Border Width Left
1594
1594
  * @see https://tailwindcss.com/docs/border-width
1595
1595
  */
1596
1596
  "border-w-l": [{
1597
- "border-l": I()
1597
+ "border-l": R()
1598
1598
  }],
1599
1599
  /**
1600
1600
  * Divide Width X
1601
1601
  * @see https://tailwindcss.com/docs/border-width#between-children
1602
1602
  */
1603
1603
  "divide-x": [{
1604
- "divide-x": I()
1604
+ "divide-x": R()
1605
1605
  }],
1606
1606
  /**
1607
1607
  * Divide Width X Reverse
@@ -1613,7 +1613,7 @@ const Lt = (e, t) => {
1613
1613
  * @see https://tailwindcss.com/docs/border-width#between-children
1614
1614
  */
1615
1615
  "divide-y": [{
1616
- "divide-y": I()
1616
+ "divide-y": R()
1617
1617
  }],
1618
1618
  /**
1619
1619
  * Divide Width Y Reverse
@@ -1723,7 +1723,7 @@ const Lt = (e, t) => {
1723
1723
  * @see https://tailwindcss.com/docs/outline-width
1724
1724
  */
1725
1725
  "outline-w": [{
1726
- outline: ["", k, X, W]
1726
+ outline: ["", k, Z, W]
1727
1727
  }],
1728
1728
  /**
1729
1729
  * Outline Color
@@ -1775,7 +1775,7 @@ const Lt = (e, t) => {
1775
1775
  * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
1776
1776
  */
1777
1777
  "ring-w": [{
1778
- ring: I()
1778
+ ring: R()
1779
1779
  }],
1780
1780
  /**
1781
1781
  * Ring Width Inset
@@ -1814,7 +1814,7 @@ const Lt = (e, t) => {
1814
1814
  * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
1815
1815
  */
1816
1816
  "inset-ring-w": [{
1817
- "inset-ring": I()
1817
+ "inset-ring": R()
1818
1818
  }],
1819
1819
  /**
1820
1820
  * Inset Ring Color
@@ -2748,7 +2748,7 @@ const Lt = (e, t) => {
2748
2748
  * @see https://tailwindcss.com/docs/stroke-width
2749
2749
  */
2750
2750
  "stroke-w": [{
2751
- stroke: [k, X, W, xe]
2751
+ stroke: [k, Z, W, xe]
2752
2752
  }],
2753
2753
  /**
2754
2754
  * Stroke
@@ -2832,7 +2832,7 @@ const _r = [
2832
2832
  { size: 600, x: "70%", y: "15%", color: "secondary", opacity: 0.06, drift: "drift-2", duration: "30s" },
2833
2833
  { size: 550, x: "30%", y: "65%", color: "primary", opacity: 0.05, drift: "drift-4", duration: "22s" }
2834
2834
  ];
2835
- function Co({ blobs: e = _r, className: t }) {
2835
+ function _o({ blobs: e = _r, className: t }) {
2836
2836
  return /* @__PURE__ */ a("div", { className: p("fixed inset-0 -z-10 overflow-hidden bg-background", t), children: e.map((r, o) => /* @__PURE__ */ a(
2837
2837
  "div",
2838
2838
  {
@@ -2867,7 +2867,7 @@ const Sr = L.forwardRef(
2867
2867
  )
2868
2868
  );
2869
2869
  Sr.displayName = "Surface";
2870
- function _o({
2870
+ function So({
2871
2871
  value: e,
2872
2872
  onChange: t,
2873
2873
  placeholder: r = "Search...",
@@ -2902,7 +2902,7 @@ const qe = {
2902
2902
  busy: "bg-warning",
2903
2903
  installing: "bg-warning"
2904
2904
  };
2905
- function So({ status: e, ping: t, className: r }) {
2905
+ function zo({ status: e, ping: t, className: r }) {
2906
2906
  const o = t ?? e === "running";
2907
2907
  return /* @__PURE__ */ a("span", { className: p("flex items-center justify-center w-4 shrink-0", r), children: /* @__PURE__ */ h("span", { className: "relative flex h-2 w-2", children: [
2908
2908
  o && /* @__PURE__ */ a(
@@ -2946,13 +2946,13 @@ function zr({ text: e, label: t }) {
2946
2946
  }
2947
2947
  );
2948
2948
  }
2949
- function zo({ text: e, copyLabel: t, className: r }) {
2949
+ function Ro({ text: e, copyLabel: t, className: r }) {
2950
2950
  return /* @__PURE__ */ h("div", { className: p("relative", r), children: [
2951
2951
  /* @__PURE__ */ a("pre", { className: "bg-background border border-default-100 rounded-[8px] p-3 text-[11px] text-default-500 font-mono overflow-x-auto leading-relaxed whitespace-pre-wrap break-all", children: e }),
2952
2952
  /* @__PURE__ */ a(zr, { text: e, label: t })
2953
2953
  ] });
2954
2954
  }
2955
- function Io({ icon: e, title: t, description: r, action: o, className: n }) {
2955
+ function To({ icon: e, title: t, description: r, action: o, className: n }) {
2956
2956
  return /* @__PURE__ */ h("div", { className: p("text-center py-12 rounded-xl border border-dashed border-default-200/50", n), children: [
2957
2957
  /* @__PURE__ */ a(e, { size: 28, className: "mx-auto mb-3 text-default-400" }),
2958
2958
  /* @__PURE__ */ a("p", { className: "text-sm text-default-500", children: t }),
@@ -2961,9 +2961,9 @@ function Io({ icon: e, title: t, description: r, action: o, className: n }) {
2961
2961
  ] });
2962
2962
  }
2963
2963
  const He = /==([^\n]+?)==/g;
2964
- function Ir() {
2964
+ function Rr() {
2965
2965
  return (e) => {
2966
- Z(e, "text", (t, r, o) => {
2966
+ Q(e, "text", (t, r, o) => {
2967
2967
  if (r === void 0 || !o) return;
2968
2968
  He.lastIndex = 0;
2969
2969
  const n = [];
@@ -2976,9 +2976,9 @@ function Ir() {
2976
2976
  };
2977
2977
  }
2978
2978
  const Je = /~([^~\s][^~]*)~|\^([^^\s][^^]*)\^/g;
2979
- function Rr() {
2979
+ function Tr() {
2980
2980
  return (e) => {
2981
- Z(e, "text", (t, r, o) => {
2981
+ Q(e, "text", (t, r, o) => {
2982
2982
  if (r === void 0 || !o) return;
2983
2983
  Je.lastIndex = 0;
2984
2984
  const n = [];
@@ -2991,22 +2991,22 @@ function Rr() {
2991
2991
  };
2992
2992
  }
2993
2993
  const ke = /^\*\[([^\]]+)\]:\s*(.+)$/gm;
2994
- function Tr() {
2994
+ function Ir() {
2995
2995
  return (e) => {
2996
2996
  const t = /* @__PURE__ */ new Map();
2997
- if (Z(e, "text", (n) => {
2997
+ if (Q(e, "text", (n) => {
2998
2998
  ke.lastIndex = 0;
2999
2999
  let l;
3000
3000
  for (; (l = ke.exec(n.value)) !== null; )
3001
3001
  t.set(l[1], l[2]);
3002
3002
  }), t.size === 0) return;
3003
- Z(e, "paragraph", (n, l, s) => {
3003
+ Q(e, "paragraph", (n, l, s) => {
3004
3004
  if (l === void 0 || !s) return;
3005
3005
  if (n.children.filter((d) => d.type === "text").map((d) => d.value).join("").replace(ke, "").trim() === "")
3006
3006
  return s.children.splice(l, 1), l;
3007
3007
  });
3008
3008
  const r = [...t.keys()].sort((n, l) => l.length - n.length), o = new RegExp(`\\b(${r.map($r).join("|")})\\b`, "g");
3009
- Z(e, "text", (n, l, s) => {
3009
+ Q(e, "text", (n, l, s) => {
3010
3010
  if (l === void 0 || !s) return;
3011
3011
  o.lastIndex = 0;
3012
3012
  const i = [];
@@ -3034,10 +3034,10 @@ const Ar = {
3034
3034
  math: St({ singleDollarTextMath: !0 }),
3035
3035
  code: zt({ themes: ["github-light", "github-dark"] })
3036
3036
  }, Er = [
3037
- [It, { singleTilde: !1 }],
3038
- Ir,
3037
+ [Rt, { singleTilde: !1 }],
3039
3038
  Rr,
3040
- Tr
3039
+ Tr,
3040
+ Ir
3041
3041
  ], Or = ({ text: e, isStreaming: t }) => /* @__PURE__ */ a(
3042
3042
  _t,
3043
3043
  {
@@ -3128,7 +3128,7 @@ const Ar = {
3128
3128
  }
3129
3129
  ),
3130
3130
  a: ({ className: e, node: t, href: r, ...o }) => {
3131
- const n = r?.startsWith("#"), l = R(
3131
+ const n = r?.startsWith("#"), l = T(
3132
3132
  (s) => {
3133
3133
  if (!n || !r) return;
3134
3134
  s.preventDefault();
@@ -3282,7 +3282,7 @@ const Ar = {
3282
3282
  )
3283
3283
  };
3284
3284
  function jr(e, t) {
3285
- return R(() => {
3285
+ return T(() => {
3286
3286
  const r = e.current;
3287
3287
  if (!r) return;
3288
3288
  let o = r.parentElement;
@@ -3439,11 +3439,11 @@ function Gr({
3439
3439
  children: n,
3440
3440
  ...l
3441
3441
  }) {
3442
- const s = Q(null), [i, c] = A(o), d = jr(s, Ye), b = t !== void 0, y = b ? t : i, x = R(() => {
3442
+ const s = H(null), [i, c] = A(o), d = jr(s, Ye), b = t !== void 0, y = b ? t : i, x = T(() => {
3443
3443
  const v = !y;
3444
3444
  v || d(), b || c(v), r?.(v);
3445
3445
  }, [y, d, b, r]);
3446
- return /* @__PURE__ */ a(Te.Provider, { value: { isOpen: y, toggle: x }, children: /* @__PURE__ */ a(
3446
+ return /* @__PURE__ */ a(Ie.Provider, { value: { isOpen: y, toggle: x }, children: /* @__PURE__ */ a(
3447
3447
  "div",
3448
3448
  {
3449
3449
  ref: s,
@@ -3462,7 +3462,7 @@ function Gr({
3462
3462
  }
3463
3463
  ) });
3464
3464
  }
3465
- const Te = kt({
3465
+ const Ie = kt({
3466
3466
  isOpen: !1,
3467
3467
  toggle: () => {
3468
3468
  }
@@ -3481,7 +3481,7 @@ function Ur({
3481
3481
  className: o,
3482
3482
  ...n
3483
3483
  }) {
3484
- const { isOpen: l } = ot(Te), s = r?.type ?? "complete", i = s === "running", c = r?.type === "incomplete" && r.reason === "cancelled", d = Vr[s], b = Fr(e, t);
3484
+ const { isOpen: l } = ot(Ie), s = r?.type ?? "complete", i = s === "running", c = r?.type === "incomplete" && r.reason === "cancelled", d = Vr[s], b = Fr(e, t);
3485
3485
  return /* @__PURE__ */ h(
3486
3486
  "button",
3487
3487
  {
@@ -3517,7 +3517,7 @@ function Ur({
3517
3517
  }
3518
3518
  ),
3519
3519
  /* @__PURE__ */ a(
3520
- Rt,
3520
+ Tt,
3521
3521
  {
3522
3522
  "data-slot": "tool-fallback-trigger-chevron",
3523
3523
  className: p(
@@ -3535,8 +3535,8 @@ function qr({
3535
3535
  className: e,
3536
3536
  children: t
3537
3537
  }) {
3538
- const { isOpen: r } = ot(Te);
3539
- return /* @__PURE__ */ a(Ie, { initial: !1, children: r && /* @__PURE__ */ a(
3538
+ const { isOpen: r } = ot(Ie);
3539
+ return /* @__PURE__ */ a(Re, { initial: !1, children: r && /* @__PURE__ */ a(
3540
3540
  we.div,
3541
3541
  {
3542
3542
  "data-slot": "tool-fallback-content",
@@ -3577,7 +3577,7 @@ function Ce({ text: e }) {
3577
3577
  },
3578
3578
  className: "shrink-0 rounded-md p-1 text-default-400 transition-colors hover:bg-default-200/40 hover:text-default-600",
3579
3579
  "aria-label": "Copy",
3580
- children: t ? /* @__PURE__ */ a(Tt, { className: "size-3 text-success" }) : /* @__PURE__ */ a($t, { className: "size-3" })
3580
+ children: t ? /* @__PURE__ */ a(It, { className: "size-3 text-success" }) : /* @__PURE__ */ a($t, { className: "size-3" })
3581
3581
  }
3582
3582
  );
3583
3583
  }
@@ -3643,7 +3643,7 @@ function Zr(e, t) {
3643
3643
  `), isTruncated: !0 };
3644
3644
  }
3645
3645
  function Qr({ text: e }) {
3646
- const [t, r] = A(!1), [o, n] = A(null), l = Q(null), s = Xr(e), i = s === "json" ? JSON.stringify(JSON.parse(e.trim()), null, 2) : e, { isTruncated: c } = Zr(i, Ze), d = R((v) => {
3646
+ const [t, r] = A(!1), [o, n] = A(null), l = H(null), s = Xr(e), i = s === "json" ? JSON.stringify(JSON.parse(e.trim()), null, 2) : e, { isTruncated: c } = Zr(i, Ze), d = T((v) => {
3647
3647
  if (l.current = v, v && o === null) {
3648
3648
  const w = v.style, _ = {
3649
3649
  display: w.display,
@@ -3755,7 +3755,7 @@ const ro = ({
3755
3755
  ]
3756
3756
  }
3757
3757
  );
3758
- }, Ro = rt(ro), xt = yt(({ children: e, tooltip: t, side: r = "bottom", className: o, variant: n, ...l }, s) => /* @__PURE__ */ a(ze, { content: t, placement: r ?? "bottom", children: /* @__PURE__ */ h(
3758
+ }, Io = rt(ro), xt = yt(({ children: e, tooltip: t, side: r = "bottom", className: o, variant: n, ...l }, s) => /* @__PURE__ */ a(ze, { content: t, placement: r ?? "bottom", children: /* @__PURE__ */ h(
3759
3759
  Se,
3760
3760
  {
3761
3761
  variant: n === "default" ? "solid" : n === "outline" ? "bordered" : n === "destructive" ? "solid" : "light",
@@ -3772,7 +3772,7 @@ const ro = ({
3772
3772
  }
3773
3773
  ) }));
3774
3774
  xt.displayName = "TooltipIconButton";
3775
- const To = ({
3775
+ const $o = ({
3776
3776
  onSend: e,
3777
3777
  onCancel: t,
3778
3778
  isStreaming: r,
@@ -3780,15 +3780,15 @@ const To = ({
3780
3780
  placeholder: n = "Send a message...",
3781
3781
  leftSlot: l
3782
3782
  }) => {
3783
- const [s, i] = A(""), c = Q(null), d = R(() => {
3783
+ const [s, i] = A(""), c = H(null), d = T(() => {
3784
3784
  const x = s.trim();
3785
3785
  !x || r || (e(x), i(""), c.current && (c.current.style.height = "auto"));
3786
- }, [s, r, e]), b = R(
3786
+ }, [s, r, e]), b = T(
3787
3787
  (x) => {
3788
3788
  x.key === "Enter" && !x.shiftKey && (x.preventDefault(), d());
3789
3789
  },
3790
3790
  [d]
3791
- ), y = R(() => {
3791
+ ), y = T(() => {
3792
3792
  const x = c.current;
3793
3793
  x && (x.style.height = "auto", x.style.height = `${x.scrollHeight}px`);
3794
3794
  }, []);
@@ -3882,7 +3882,7 @@ function ao(e) {
3882
3882
  l.push(s);
3883
3883
  return l;
3884
3884
  }
3885
- function $o({ spans: e }) {
3885
+ function Mo({ spans: e }) {
3886
3886
  const [t, r] = A(null), { rows: o, totalMs: n, gridlines: l } = vt(() => {
3887
3887
  const s = oo(e), i = no(s), c = i.find((y) => y.span.name === "turn"), d = c ? c.span.endMs : Math.max(...e.map((y) => y.endMs), 1);
3888
3888
  return {
@@ -4041,7 +4041,7 @@ function tt(e) {
4041
4041
  function lo(e) {
4042
4042
  return e >= 1 ? `$${e.toFixed(2)}` : e >= 0.01 ? `$${e.toFixed(2)}` : e > 0 ? `$${e.toFixed(3)}` : "$0.00";
4043
4043
  }
4044
- const Mo = ({
4044
+ const Ao = ({
4045
4045
  contextTokens: e,
4046
4046
  contextWindow: t,
4047
4047
  totalCost: r
@@ -4136,7 +4136,7 @@ const Mo = ({
4136
4136
  ] }), co = ({
4137
4137
  activeTab: e,
4138
4138
  children: t
4139
- }) => /* @__PURE__ */ a("div", { className: "flex-1 min-h-0 nx-glass overflow-y-auto p-8", children: /* @__PURE__ */ a(Ie, { mode: "wait", children: /* @__PURE__ */ a(
4139
+ }) => /* @__PURE__ */ a("div", { className: "flex-1 min-h-0 nx-glass overflow-y-auto p-8", children: /* @__PURE__ */ a(Re, { mode: "wait", children: /* @__PURE__ */ a(
4140
4140
  de.div,
4141
4141
  {
4142
4142
  initial: { opacity: 0, y: 8 },
@@ -4146,7 +4146,7 @@ const Mo = ({
4146
4146
  children: t
4147
4147
  },
4148
4148
  e
4149
- ) }) }), Ao = ({
4149
+ ) }) }), Eo = ({
4150
4150
  tabs: e,
4151
4151
  activeTab: t,
4152
4152
  onTabChange: r,
@@ -4158,7 +4158,7 @@ const Mo = ({
4158
4158
  tabBadge: c,
4159
4159
  className: d
4160
4160
  }) => {
4161
- const b = R(
4161
+ const b = T(
4162
4162
  (v) => {
4163
4163
  n === "modal" && v.key === "Escape" && l?.();
4164
4164
  },
@@ -4184,7 +4184,7 @@ const Mo = ({
4184
4184
  return n === "panel" ? /* @__PURE__ */ a(Be, { features: Fe, children: /* @__PURE__ */ h("div", { className: p("flex h-full gap-3 p-3", d), children: [
4185
4185
  y,
4186
4186
  x
4187
- ] }) }) : /* @__PURE__ */ a(Be, { features: Fe, children: /* @__PURE__ */ a(Ie, { children: /* @__PURE__ */ h(
4187
+ ] }) }) : /* @__PURE__ */ a(Be, { features: Fe, children: /* @__PURE__ */ a(Re, { children: /* @__PURE__ */ h(
4188
4188
  de.div,
4189
4189
  {
4190
4190
  className: p("absolute inset-0 z-50 flex items-center justify-center", d),
@@ -4217,31 +4217,37 @@ const Mo = ({
4217
4217
  ]
4218
4218
  }
4219
4219
  ) }) });
4220
- };
4221
- function Eo() {
4222
- const e = Q(null), t = Q(null), [r, o] = A(!0);
4220
+ }, uo = 50;
4221
+ function Oo() {
4222
+ const e = H(null), t = H(null), [r, o] = A(!0), n = H(!0);
4223
4223
  ce(() => {
4224
- const s = t.current;
4225
- if (!s) return;
4226
- const i = new IntersectionObserver(
4227
- ([c]) => o(c.isIntersecting),
4228
- { root: e.current, threshold: 0 }
4229
- );
4230
- return i.observe(s), () => i.disconnect();
4224
+ const i = e.current;
4225
+ if (!i) return;
4226
+ const c = () => {
4227
+ const d = i.scrollHeight - i.scrollTop - i.clientHeight < uo;
4228
+ n.current = d, o(d);
4229
+ };
4230
+ return i.addEventListener("scroll", c, { passive: !0 }), () => i.removeEventListener("scroll", c);
4231
4231
  }, []);
4232
- const n = R(() => {
4233
- const s = e.current;
4234
- s && s.scrollTo({ top: s.scrollHeight, behavior: "smooth" });
4235
- }, []), l = R(() => {
4236
- if (r) {
4237
- const s = e.current;
4238
- s && (s.scrollTop = s.scrollHeight);
4232
+ const l = T(() => {
4233
+ const i = e.current;
4234
+ i && i.scrollTo({ top: i.scrollHeight, behavior: "smooth" });
4235
+ }, []), s = T(() => {
4236
+ if (n.current) {
4237
+ const i = e.current;
4238
+ i && (i.scrollTop = i.scrollHeight);
4239
4239
  }
4240
- }, [r]);
4241
- return { containerRef: e, sentinelRef: t, isAtBottom: r, scrollToBottom: n, scrollToBottomIfNeeded: l };
4240
+ }, []);
4241
+ return {
4242
+ containerRef: e,
4243
+ sentinelRef: t,
4244
+ isAtBottom: r,
4245
+ scrollToBottom: l,
4246
+ scrollToBottomIfNeeded: s
4247
+ };
4242
4248
  }
4243
4249
  const ve = 768;
4244
- function Oo() {
4250
+ function Po() {
4245
4251
  const [e, t] = L.useState(void 0);
4246
4252
  return L.useEffect(() => {
4247
4253
  const r = window.matchMedia(`(max-width: ${ve - 1}px)`), o = () => {
@@ -4251,29 +4257,29 @@ function Oo() {
4251
4257
  }, []), !!e;
4252
4258
  }
4253
4259
  export {
4254
- zo as CodeBlock,
4255
- To as Composer,
4256
- Mo as ContextRing,
4257
- Io as EmptyState,
4258
- Co as GradientBackground,
4260
+ Ro as CodeBlock,
4261
+ $o as Composer,
4262
+ Ao as ContextRing,
4263
+ To as EmptyState,
4264
+ _o as GradientBackground,
4259
4265
  Pr as MarkdownText,
4260
- No as NexusProvider,
4261
- _o as SearchBar,
4262
- Ao as SettingsShell,
4263
- So as StatusDot,
4266
+ Co as NexusProvider,
4267
+ So as SearchBar,
4268
+ Eo as SettingsShell,
4269
+ zo as StatusDot,
4264
4270
  Sr as Surface,
4265
- $o as TimingWaterfall,
4266
- jo as Toaster,
4267
- Ro as ToolFallback,
4271
+ Mo as TimingWaterfall,
4272
+ Bo as Toaster,
4273
+ Io as ToolFallback,
4268
4274
  xt as TooltipIconButton,
4269
4275
  p as cn,
4270
4276
  Fr as formatToolDescription,
4271
- Tr as remarkAbbreviations,
4272
- Ir as remarkHighlight,
4273
- Rr as remarkSubSuperscript,
4274
- Bo as toast,
4275
- Eo as useAutoScroll,
4276
- Oo as useIsMobile,
4277
- wo as useNexus,
4277
+ Ir as remarkAbbreviations,
4278
+ Rr as remarkHighlight,
4279
+ Tr as remarkSubSuperscript,
4280
+ Fo as toast,
4281
+ Oo as useAutoScroll,
4282
+ Po as useIsMobile,
4283
+ No as useNexus,
4278
4284
  jr as useScrollLock
4279
4285
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imdanibytes/nexus-ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Nexus theme, provider, and utilities for HeroUI-based plugins",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -166,3 +166,66 @@
166
166
  from { transform: translate3d(0, 0, 0); }
167
167
  to { transform: translate3d(25px, -35px, 0); }
168
168
  }
169
+
170
+ /* ============================================
171
+ Markdown (MarkdownText / Streamdown)
172
+ ============================================ */
173
+
174
+ /* Footnote scroll flash */
175
+ @keyframes md-flash {
176
+ 0% { background-color: hsl(var(--heroui-primary) / 0.2); }
177
+ 100% { background-color: transparent; }
178
+ }
179
+ .aui-md-flash {
180
+ animation: md-flash 1.5s ease-out;
181
+ border-radius: 4px;
182
+ }
183
+
184
+ /* Streamdown code blocks — glass treatment */
185
+ .aui-md [data-streamdown="code-block"] {
186
+ margin-top: 0.625rem;
187
+ margin-bottom: 0.625rem;
188
+ border-radius: 0.75rem;
189
+ border: 1px solid hsl(var(--heroui-default-200));
190
+ overflow: hidden;
191
+ backdrop-filter: blur(24px);
192
+ -webkit-backdrop-filter: blur(24px);
193
+ }
194
+ :is(.dark) .aui-md [data-streamdown="code-block"] {
195
+ border-color: hsl(var(--heroui-default-200) / 0.5);
196
+ }
197
+ .aui-md [data-streamdown="code-block-header"] {
198
+ background: hsl(var(--heroui-default-100));
199
+ padding: 0.375rem 0.75rem;
200
+ border-bottom: 1px solid hsl(var(--heroui-default-200));
201
+ }
202
+ :is(.dark) .aui-md [data-streamdown="code-block-header"] {
203
+ background: hsl(var(--heroui-default-100) / 0.4);
204
+ border-bottom-color: hsl(var(--heroui-default-200) / 0.5);
205
+ }
206
+ .aui-md [data-streamdown="code-block-body"] {
207
+ background: hsl(var(--heroui-default-100) / 0.6);
208
+ border-top: none !important;
209
+ padding: 0.75rem;
210
+ font-size: 0.75rem;
211
+ line-height: 1.625;
212
+ }
213
+ :is(.dark) .aui-md [data-streamdown="code-block-body"] {
214
+ background: hsl(var(--heroui-default-100) / 0.2);
215
+ }
216
+ /* Shiki dual-theme: force --shiki-dark in dark mode */
217
+ :is(.dark) [data-streamdown="code-block-body"] span[style] {
218
+ color: var(--shiki-dark, inherit) !important;
219
+ }
220
+ @media (prefers-color-scheme: dark) {
221
+ [data-streamdown="code-block-body"] span[style] {
222
+ color: var(--shiki-dark, inherit) !important;
223
+ }
224
+ }
225
+ .aui-md [data-streamdown="inline-code"] {
226
+ border: 1px solid hsl(var(--heroui-default-200) / 0.5);
227
+ background: hsl(var(--heroui-default-100) / 0.4);
228
+ padding: 0.125rem 0.375rem;
229
+ border-radius: 0.375rem;
230
+ font-size: 0.85em;
231
+ }