@ramme-io/ui 4.1.1 → 4.2.1
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/components/ai/AIChatThread/AIChatThread.js +76 -79
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +14 -13
- package/dist/components/ai/CompanyProfileCard/CompanyProfileCard.js +20 -19
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +22 -21
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +23 -22
- package/dist/components/ai/LiveQuoteCard/LiveQuoteCard.js +29 -28
- package/dist/components/ai/NewsSummaryCard/NewsSummaryCard.js +23 -22
- package/dist/components/ai/StockChart/StockChart.js +33 -33
- package/dist/components/data-display/StatusBadge.d.ts +4 -3
- package/dist/components/data-display/StatusBadge.js +18 -18
- package/dist/components/feedback/Alert.js +19 -19
- package/dist/components/forms/SegmentedControl.js +10 -10
- package/dist/components/layout/DetailDrawer.d.ts +9 -1
- package/dist/components/layout/DetailDrawer.js +61 -51
- package/dist/components/layout/Drawer.js +47 -39
- package/dist/components/layout/Modal.js +28 -23
- package/dist/components/layout/Sheet.js +38 -36
- package/dist/formFieldFloor.test.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +188 -186
- package/dist/lib/hooks/useDialogFocus.d.ts +1 -0
- package/dist/lib/hooks/useDialogFocus.js +46 -0
- package/dist/utils/apiBaseUrl.d.ts +1 -0
- package/dist/utils/apiBaseUrl.js +10 -0
- package/dist/wizardManifest.js +9 -4
- package/package.json +2 -2
- package/src/wizardManifest.ts +9 -4
- package/tailwind.preset.js +8 -0
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { apiBaseUrl as g } from "../../../utils/apiBaseUrl.js";
|
|
3
|
+
import { useState as c, useEffect as h } from "react";
|
|
4
|
+
import { Card as N, CardHeader as b, CardTitle as v, CardContent as y } from "../../layout/Card.js";
|
|
5
|
+
import { Icon as i } from "../../ui/Icon.js";
|
|
6
|
+
const E = ({ params: u }) => {
|
|
7
|
+
const { ticker: s } = u, [r, x] = c(null), [d, m] = c(!0), [o, l] = c(null);
|
|
8
|
+
h(() => {
|
|
8
9
|
(async () => {
|
|
9
10
|
try {
|
|
10
|
-
m(!0),
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
throw new Error(`No quote data available for ${
|
|
14
|
-
const
|
|
15
|
-
x(
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
11
|
+
m(!0), l(null);
|
|
12
|
+
const n = g(), p = await fetch(`${n}/companies/${s.toUpperCase()}/hydrate-quote`);
|
|
13
|
+
if (!p.ok)
|
|
14
|
+
throw new Error(`No quote data available for ${s.toUpperCase()}`);
|
|
15
|
+
const f = await p.json();
|
|
16
|
+
x(f);
|
|
17
|
+
} catch (n) {
|
|
18
|
+
l(n instanceof Error ? n.message : "Failed to fetch quote");
|
|
18
19
|
} finally {
|
|
19
20
|
m(!1);
|
|
20
21
|
}
|
|
21
22
|
})();
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
23
|
+
}, [s]);
|
|
24
|
+
const a = r && r.change_percent >= 0;
|
|
24
25
|
return /* @__PURE__ */ e(N, { className: "w-full min-w-[280px] max-w-md shadow-lg border-primary/20", children: [
|
|
25
|
-
/* @__PURE__ */ t(b, { className: "pb-3", children: /* @__PURE__ */ e(
|
|
26
|
-
/* @__PURE__ */ t(
|
|
26
|
+
/* @__PURE__ */ t(b, { className: "pb-3", children: /* @__PURE__ */ e(v, { className: "text-sm font-medium text-muted-foreground flex items-center gap-2", children: [
|
|
27
|
+
/* @__PURE__ */ t(i, { name: "trending-up", size: 14 }),
|
|
27
28
|
"Live Quote"
|
|
28
29
|
] }) }),
|
|
29
|
-
/* @__PURE__ */ e(
|
|
30
|
-
|
|
30
|
+
/* @__PURE__ */ e(y, { className: "pt-0", children: [
|
|
31
|
+
d && /* @__PURE__ */ t("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ t(i, { name: "loader", size: 24, className: "animate-spin text-muted-foreground" }) }),
|
|
31
32
|
o && /* @__PURE__ */ e("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: [
|
|
32
|
-
/* @__PURE__ */ t(
|
|
33
|
+
/* @__PURE__ */ t(i, { name: "alert-circle", size: 14, className: "mt-px shrink-0" }),
|
|
33
34
|
/* @__PURE__ */ t("span", { children: o })
|
|
34
35
|
] }),
|
|
35
|
-
r && !
|
|
36
|
+
r && !d && !o && /* @__PURE__ */ e("div", { className: "space-y-3", children: [
|
|
36
37
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("span", { className: "px-2.5 py-1 rounded-md bg-primary/10 border border-primary/20 font-mono text-sm font-semibold text-primary", children: r.ticker }) }),
|
|
37
38
|
/* @__PURE__ */ e("div", { className: "space-y-1", children: [
|
|
38
39
|
/* @__PURE__ */ e("div", { className: "flex items-baseline gap-2", children: [
|
|
@@ -43,8 +44,8 @@ const d = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, U =
|
|
|
43
44
|
maximumFractionDigits: 2
|
|
44
45
|
})
|
|
45
46
|
] }),
|
|
46
|
-
/* @__PURE__ */ e("span", { className: `text-lg font-semibold ${
|
|
47
|
-
|
|
47
|
+
/* @__PURE__ */ e("span", { className: `text-lg font-semibold ${a ? "text-green-500" : "text-red-500"}`, children: [
|
|
48
|
+
a ? "+" : "",
|
|
48
49
|
r.change_percent.toFixed(2),
|
|
49
50
|
"%"
|
|
50
51
|
] })
|
|
@@ -59,14 +60,14 @@ const d = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, U =
|
|
|
59
60
|
})
|
|
60
61
|
] })
|
|
61
62
|
] }),
|
|
62
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2 pt-2 border-t border-border/40", children: /* @__PURE__ */ e("div", { className: `flex items-center gap-1.5 text-xs font-medium ${
|
|
63
|
-
/* @__PURE__ */ t(
|
|
64
|
-
/* @__PURE__ */ t("span", { children:
|
|
63
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-2 pt-2 border-t border-border/40", children: /* @__PURE__ */ e("div", { className: `flex items-center gap-1.5 text-xs font-medium ${a ? "text-green-500" : "text-red-500"}`, children: [
|
|
64
|
+
/* @__PURE__ */ t(i, { name: a ? "trending-up" : "trending-down", size: 14 }),
|
|
65
|
+
/* @__PURE__ */ t("span", { children: a ? "Gaining" : "Declining" })
|
|
65
66
|
] }) })
|
|
66
67
|
] })
|
|
67
68
|
] })
|
|
68
69
|
] });
|
|
69
70
|
};
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
+
E as LiveQuoteCard
|
|
72
73
|
};
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { apiBaseUrl as h } from "../../../utils/apiBaseUrl.js";
|
|
3
|
+
import { useState as l, useEffect as g } from "react";
|
|
3
4
|
import { Card as N, CardHeader as b, CardTitle as w, CardContent as y } from "../../layout/Card.js";
|
|
4
|
-
import { Icon as
|
|
5
|
-
const
|
|
6
|
-
const { ticker:
|
|
5
|
+
import { Icon as a } from "../../ui/Icon.js";
|
|
6
|
+
const _ = ({ params: f }) => {
|
|
7
|
+
const { ticker: s } = f, [c, x] = l([]), [i, d] = l(!0), [n, m] = l(null);
|
|
7
8
|
return g(() => {
|
|
8
9
|
(async () => {
|
|
9
10
|
try {
|
|
10
|
-
|
|
11
|
-
const o = (
|
|
12
|
-
if (!
|
|
13
|
-
throw new Error(`No news available for ${
|
|
14
|
-
const
|
|
15
|
-
x(
|
|
11
|
+
d(!0), m(null);
|
|
12
|
+
const o = h(), p = await fetch(`${o}/companies/${s.toUpperCase()}/news?limit=5`);
|
|
13
|
+
if (!p.ok)
|
|
14
|
+
throw new Error(`No news available for ${s.toUpperCase()}`);
|
|
15
|
+
const u = await p.json();
|
|
16
|
+
x(u);
|
|
16
17
|
} catch (o) {
|
|
17
|
-
|
|
18
|
+
m(o instanceof Error ? o.message : "Failed to fetch news");
|
|
18
19
|
} finally {
|
|
19
|
-
|
|
20
|
+
d(!1);
|
|
20
21
|
}
|
|
21
22
|
})();
|
|
22
|
-
}, [
|
|
23
|
+
}, [s]), /* @__PURE__ */ t(N, { className: "w-full min-w-[320px] max-w-2xl shadow-lg border-primary/20", children: [
|
|
23
24
|
/* @__PURE__ */ e(b, { className: "pb-3", children: /* @__PURE__ */ t(w, { className: "text-sm font-medium text-muted-foreground flex items-center gap-2", children: [
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(a, { name: "newspaper", size: 14 }),
|
|
25
26
|
"Recent News · ",
|
|
26
|
-
|
|
27
|
+
s.toUpperCase()
|
|
27
28
|
] }) }),
|
|
28
29
|
/* @__PURE__ */ t(y, { className: "pt-0", children: [
|
|
29
|
-
|
|
30
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ e(a, { name: "loader", size: 24, className: "animate-spin text-muted-foreground" }) }),
|
|
30
31
|
n && /* @__PURE__ */ t("div", { className: "flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: [
|
|
31
|
-
/* @__PURE__ */ e(
|
|
32
|
+
/* @__PURE__ */ e(a, { name: "alert-circle", size: 14, className: "mt-px shrink-0" }),
|
|
32
33
|
/* @__PURE__ */ e("span", { children: n })
|
|
33
34
|
] }),
|
|
34
|
-
c.length === 0 && !
|
|
35
|
-
/* @__PURE__ */ e(
|
|
35
|
+
c.length === 0 && !i && !n && /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center py-8 gap-2 text-muted-foreground", children: [
|
|
36
|
+
/* @__PURE__ */ e(a, { name: "inbox", size: 24, opacity: 0.5 }),
|
|
36
37
|
/* @__PURE__ */ e("p", { className: "text-sm", children: "No recent news available" })
|
|
37
38
|
] }),
|
|
38
|
-
c.length > 0 && !
|
|
39
|
+
c.length > 0 && !i && !n && /* @__PURE__ */ e("div", { className: "space-y-3", children: c.map((r) => /* @__PURE__ */ e(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
42
|
className: "border-b border-border/50 pb-3 last:border-0 last:pb-0",
|
|
@@ -64,7 +65,7 @@ const d = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, k =
|
|
|
64
65
|
] })
|
|
65
66
|
] })
|
|
66
67
|
] }),
|
|
67
|
-
r.url && /* @__PURE__ */ e(
|
|
68
|
+
r.url && /* @__PURE__ */ e(a, { name: "external-link", size: 12, className: "text-muted-foreground/50 flex-shrink-0 mt-0.5" })
|
|
68
69
|
] })
|
|
69
70
|
},
|
|
70
71
|
r.id
|
|
@@ -73,5 +74,5 @@ const d = { BASE_URL: "/", DEV: !1, MODE: "production", PROD: !0, SSR: !1 }, k =
|
|
|
73
74
|
] });
|
|
74
75
|
};
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
_ as NewsSummaryCard
|
|
77
78
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import _ from "react";
|
|
3
3
|
import { ResponsiveContainer as F, ComposedChart as W, CartesianGrid as K, XAxis as U, YAxis as A, Tooltip as $, Legend as j, Line as S, Bar as z } from "recharts";
|
|
4
4
|
import { Card as E, CardHeader as H, CardTitle as L, CardContent as V } from "../../layout/Card.js";
|
|
5
5
|
import { useChartTheme as Y } from "../../../lib/hooks/useChartTheme.js";
|
|
6
|
-
function G(
|
|
6
|
+
function G(a, p, C) {
|
|
7
7
|
const N = Date.now(), M = p && Array.isArray(p) && p.length > 0 ? p : ["price", "volume"], c = {
|
|
8
8
|
"1D": { duration: 6.5 * 60 * 60 * 1e3, points: 78, basePrice: 150 },
|
|
9
9
|
// 5-minute intervals (market hours)
|
|
@@ -13,30 +13,30 @@ function G(s, p, C) {
|
|
|
13
13
|
// Daily close
|
|
14
14
|
"1Y": { duration: 365 * 24 * 60 * 60 * 1e3, points: 52, basePrice: 100 }
|
|
15
15
|
// Weekly close
|
|
16
|
-
}, g = c[
|
|
16
|
+
}, g = c[a] || c["1M"], { duration: l, points: u, basePrice: r } = g, o = l / u, x = [];
|
|
17
17
|
let n = r;
|
|
18
|
-
const
|
|
19
|
-
for (let d = 0; d <
|
|
18
|
+
const h = [];
|
|
19
|
+
for (let d = 0; d < u; d++) {
|
|
20
20
|
const v = N - l + d * o, m = {
|
|
21
21
|
timestamp: new Date(v).toLocaleString("en-US", {
|
|
22
|
-
...
|
|
23
|
-
...
|
|
24
|
-
...
|
|
25
|
-
...
|
|
22
|
+
...a === "1D" && { hour: "2-digit", minute: "2-digit" },
|
|
23
|
+
...a === "1W" && { weekday: "short", hour: "2-digit" },
|
|
24
|
+
...a === "1M" && { month: "short", day: "numeric" },
|
|
25
|
+
...a === "1Y" && { month: "short", year: "2-digit" }
|
|
26
26
|
})
|
|
27
27
|
};
|
|
28
28
|
M.forEach((i) => {
|
|
29
29
|
switch (i) {
|
|
30
30
|
case "price":
|
|
31
|
-
const P = r * 0.02, y = 1e-4 * r,
|
|
32
|
-
n = Math.max(n +
|
|
31
|
+
const P = r * 0.02, y = 1e-4 * r, b = (Math.random() - 0.48) * P + y;
|
|
32
|
+
n = Math.max(n + b, r * 0.7), h.push(n), m[i] = Number(n.toFixed(2));
|
|
33
33
|
break;
|
|
34
34
|
case "volume":
|
|
35
35
|
const t = 1e6, f = Math.random() > 0.7 ? Math.random() * 2 : 1;
|
|
36
36
|
m[i] = Math.round((t + Math.random() * t * 2) * f);
|
|
37
37
|
break;
|
|
38
38
|
case "moving_average":
|
|
39
|
-
const w = Math.min(20, d + 1), D =
|
|
39
|
+
const w = Math.min(20, d + 1), D = h.slice(-w).reduce((I, T) => I + T, 0) / w;
|
|
40
40
|
m[i] = Number(D.toFixed(2));
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
@@ -46,7 +46,7 @@ function G(s, p, C) {
|
|
|
46
46
|
}
|
|
47
47
|
return x;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const k = {
|
|
50
50
|
price: { label: "Price", unit: "USD", color: "#10b981" },
|
|
51
51
|
// Emerald/green
|
|
52
52
|
volume: { label: "Volume", unit: "shares", color: "#f59e0b" },
|
|
@@ -54,16 +54,16 @@ const b = {
|
|
|
54
54
|
moving_average: { label: "MA(20)", unit: "", color: "#ef4444" }
|
|
55
55
|
// Red
|
|
56
56
|
}, Q = ({
|
|
57
|
-
params:
|
|
57
|
+
params: a,
|
|
58
58
|
title: p,
|
|
59
59
|
data: C
|
|
60
60
|
}) => {
|
|
61
|
-
var y,
|
|
62
|
-
const { ticker: N, timeRange: M, metrics: c } =
|
|
61
|
+
var y, b;
|
|
62
|
+
const { ticker: N, timeRange: M, metrics: c } = a, { textColor: g, gridColor: l } = Y(), u = N || a.symbol || "UNKNOWN", r = M || "1M", o = c && Array.isArray(c) && c.length > 0 ? c : ["price", "volume"], x = _.useMemo(
|
|
63
63
|
() => {
|
|
64
64
|
const t = C || G(r, o);
|
|
65
65
|
return console.log("[StockChart] Data generated:", {
|
|
66
|
-
ticker:
|
|
66
|
+
ticker: u,
|
|
67
67
|
timeRange: r,
|
|
68
68
|
metrics: o,
|
|
69
69
|
dataPoints: t.length,
|
|
@@ -71,20 +71,20 @@ const b = {
|
|
|
71
71
|
lastPoint: t[t.length - 1]
|
|
72
72
|
}), t;
|
|
73
73
|
},
|
|
74
|
-
[C, r, o,
|
|
75
|
-
), n = x.filter((t) => t.price !== void 0),
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */ e(H, { className: "pb-2", children: /* @__PURE__ */
|
|
74
|
+
[C, r, o, u]
|
|
75
|
+
), n = x.filter((t) => t.price !== void 0), h = ((y = n[0]) == null ? void 0 : y.price) || 0, d = ((b = n[n.length - 1]) == null ? void 0 : b.price) || 0, v = d - h, m = h > 0 ? (v / h * 100).toFixed(2) : "0.00", i = v >= 0, P = p || `${u.toUpperCase()} - ${r}`;
|
|
76
|
+
return /* @__PURE__ */ s(E, { className: "w-full max-w-2xl shadow-lg border-primary/20", children: [
|
|
77
|
+
/* @__PURE__ */ e(H, { className: "pb-2", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
78
78
|
/* @__PURE__ */ e(L, { className: "text-sm font-medium text-foreground/80", children: P }),
|
|
79
|
-
o.includes("price") && /* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
79
|
+
o.includes("price") && /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
80
|
+
/* @__PURE__ */ s("span", { className: "text-base font-semibold", children: [
|
|
81
81
|
"$",
|
|
82
82
|
d.toFixed(2)
|
|
83
83
|
] }),
|
|
84
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ s(
|
|
85
85
|
"span",
|
|
86
86
|
{
|
|
87
|
-
className: `text-xs font-medium ${i ? "text-
|
|
87
|
+
className: `text-xs font-medium ${i ? "text-success-strong" : "text-destructive-strong"}`,
|
|
88
88
|
children: [
|
|
89
89
|
i ? "+" : "",
|
|
90
90
|
v.toFixed(2),
|
|
@@ -97,8 +97,8 @@ const b = {
|
|
|
97
97
|
)
|
|
98
98
|
] })
|
|
99
99
|
] }) }),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ e("div", { className: "h-64 w-full bg-background", style: { minHeight: "256px", minWidth: "350px" }, children: /* @__PURE__ */ e(F, { width: "100%", height: 256, children: /* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ s(V, { className: "pt-0", children: [
|
|
101
|
+
/* @__PURE__ */ e("div", { className: "h-64 w-full bg-background", style: { minHeight: "256px", minWidth: "350px" }, children: /* @__PURE__ */ e(F, { width: "100%", height: 256, children: /* @__PURE__ */ s(W, { data: x, margin: { top: 5, right: 20, bottom: 5, left: 0 }, children: [
|
|
102
102
|
/* @__PURE__ */ e(K, { strokeDasharray: "3 3", stroke: l, opacity: 0.3 }),
|
|
103
103
|
/* @__PURE__ */ e(
|
|
104
104
|
U,
|
|
@@ -136,7 +136,7 @@ const b = {
|
|
|
136
136
|
yAxisId: "price",
|
|
137
137
|
type: "monotone",
|
|
138
138
|
dataKey: "price",
|
|
139
|
-
stroke:
|
|
139
|
+
stroke: k.price.color,
|
|
140
140
|
strokeWidth: 2,
|
|
141
141
|
dot: !1,
|
|
142
142
|
name: "Price (USD)"
|
|
@@ -148,7 +148,7 @@ const b = {
|
|
|
148
148
|
yAxisId: "price",
|
|
149
149
|
type: "monotone",
|
|
150
150
|
dataKey: "moving_average",
|
|
151
|
-
stroke:
|
|
151
|
+
stroke: k.moving_average.color,
|
|
152
152
|
strokeWidth: 2,
|
|
153
153
|
dot: !1,
|
|
154
154
|
name: "MA(20)",
|
|
@@ -160,15 +160,15 @@ const b = {
|
|
|
160
160
|
{
|
|
161
161
|
yAxisId: "volume",
|
|
162
162
|
dataKey: "volume",
|
|
163
|
-
fill:
|
|
163
|
+
fill: k.volume.color,
|
|
164
164
|
opacity: 0.6,
|
|
165
165
|
name: "Volume"
|
|
166
166
|
}
|
|
167
167
|
)
|
|
168
168
|
] }) }) }),
|
|
169
169
|
/* @__PURE__ */ e("div", { className: "mt-3 flex flex-wrap gap-2", children: o.map((t) => {
|
|
170
|
-
const f =
|
|
171
|
-
return /* @__PURE__ */
|
|
170
|
+
const f = k[t];
|
|
171
|
+
return /* @__PURE__ */ s(
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
174
|
className: "inline-flex items-center gap-1.5 rounded-full bg-muted/50 px-2.5 py-1 text-xs",
|
|
@@ -181,7 +181,7 @@ const b = {
|
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
183
|
/* @__PURE__ */ e("span", { className: "font-medium", children: f.label }),
|
|
184
|
-
f.unit && /* @__PURE__ */
|
|
184
|
+
f.unit && /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: [
|
|
185
185
|
"(",
|
|
186
186
|
f.unit,
|
|
187
187
|
")"
|
|
@@ -4,8 +4,9 @@ export interface StatusBadgeProps {
|
|
|
4
4
|
/** One of the 5 built-in presets. Omit and use `color` + `label` for a
|
|
5
5
|
* status this preset set doesn't cover (e.g. a domain-specific state). */
|
|
6
6
|
status?: StatusType;
|
|
7
|
-
/**
|
|
8
|
-
* the `status` preset's
|
|
7
|
+
/** Background class for the dot, e.g. 'bg-success' or 'bg-chart-2'. Overrides
|
|
8
|
+
* the `status` preset's colour when both are given. Use a semantic token: a
|
|
9
|
+
* numeric shade is fixed across all five themes. */
|
|
9
10
|
color?: string;
|
|
10
11
|
/**
|
|
11
12
|
* Optional custom label. If not provided, uses the default status name.
|
|
@@ -27,7 +28,7 @@ export interface StatusBadgeProps {
|
|
|
27
28
|
* description: One of the 5 built-in presets. Determines the color of the dot. Omit and use `color`+`label` for a status outside this set.
|
|
28
29
|
* - name: color
|
|
29
30
|
* type: string
|
|
30
|
-
* description:
|
|
31
|
+
* description: Background class for the dot (e.g. 'bg-success'). Use a semantic token — a numeric shade does not adapt to the active theme. Overrides the `status` preset's colour when both are given.
|
|
31
32
|
* - name: label
|
|
32
33
|
* type: string
|
|
33
34
|
* description: Custom text to display next to the dot. If omitted, displays the status name (e.g., "Online").
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
const
|
|
4
|
-
online: { color: "bg-
|
|
5
|
-
offline: { color: "bg-
|
|
6
|
-
error: { color: "bg-
|
|
7
|
-
warning: { color: "bg-
|
|
8
|
-
active: { color: "bg-
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../utils/cn.js";
|
|
3
|
+
const g = {
|
|
4
|
+
online: { color: "bg-success", label: "Online" },
|
|
5
|
+
offline: { color: "bg-muted-foreground", label: "Offline" },
|
|
6
|
+
error: { color: "bg-destructive", label: "Error" },
|
|
7
|
+
warning: { color: "bg-warning", label: "Warning" },
|
|
8
|
+
active: { color: "bg-info", label: "Active" }
|
|
9
9
|
}, m = ({
|
|
10
|
-
status:
|
|
11
|
-
color:
|
|
12
|
-
label:
|
|
13
|
-
className:
|
|
14
|
-
showDot:
|
|
10
|
+
status: n,
|
|
11
|
+
color: t,
|
|
12
|
+
label: r,
|
|
13
|
+
className: c,
|
|
14
|
+
showDot: a = !0
|
|
15
15
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
16
|
+
const o = n ? g[n] : void 0, s = t ?? (o == null ? void 0 : o.color) ?? "bg-muted-foreground", l = r === null ? null : r ?? (o == null ? void 0 : o.label) ?? null;
|
|
17
|
+
return /* @__PURE__ */ d("div", { className: i("inline-flex items-center gap-2", c), children: [
|
|
18
|
+
a && /* @__PURE__ */ e(
|
|
19
19
|
"span",
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: i("h-2.5 w-2.5 rounded-full ring-2 ring-card", s),
|
|
22
22
|
"aria-hidden": "true"
|
|
23
23
|
}
|
|
24
24
|
),
|
|
25
|
-
|
|
25
|
+
l && /* @__PURE__ */ e("span", { className: "text-sm font-medium text-foreground", children: l })
|
|
26
26
|
] });
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Icon as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as c, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as o } from "../ui/Icon.js";
|
|
3
|
+
const a = {
|
|
4
4
|
info: {
|
|
5
5
|
icon: "info",
|
|
6
|
-
classes: "bg-
|
|
6
|
+
classes: "bg-info/10 border-info/50 text-info-strong"
|
|
7
7
|
},
|
|
8
8
|
success: {
|
|
9
9
|
icon: "check-circle",
|
|
10
|
-
classes: "bg-
|
|
10
|
+
classes: "bg-success/10 border-success/50 text-success-strong"
|
|
11
11
|
},
|
|
12
12
|
warning: {
|
|
13
13
|
icon: "alert-triangle",
|
|
14
|
-
classes: "bg-
|
|
14
|
+
classes: "bg-warning/10 border-warning/50 text-warning-strong"
|
|
15
15
|
},
|
|
16
16
|
danger: {
|
|
17
17
|
icon: "x-circle",
|
|
18
|
-
classes: "bg-
|
|
18
|
+
classes: "bg-destructive/10 border-destructive/50 text-destructive-strong"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
21
|
-
title:
|
|
22
|
-
children:
|
|
23
|
-
variant:
|
|
24
|
-
className:
|
|
20
|
+
}, g = ({
|
|
21
|
+
title: n,
|
|
22
|
+
children: e,
|
|
23
|
+
variant: i = "info",
|
|
24
|
+
className: t
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
26
|
+
const r = a[i];
|
|
27
|
+
return /* @__PURE__ */ c("div", { className: `flex items-start gap-4 p-4 border-l-4 rounded-r-lg ${r.classes} ${t || ""}`, role: "alert", children: [
|
|
28
|
+
/* @__PURE__ */ s("div", { className: "flex-shrink-0", children: /* @__PURE__ */ s(o, { name: r.icon, size: 20 }) }),
|
|
29
|
+
/* @__PURE__ */ c("div", { className: "flex-grow", children: [
|
|
30
|
+
/* @__PURE__ */ s("h4", { className: "font-semibold", children: n }),
|
|
31
|
+
e && /* @__PURE__ */ s("div", { className: "text-sm mt-1", children: e })
|
|
32
32
|
] })
|
|
33
33
|
] });
|
|
34
34
|
};
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
g as Alert
|
|
37
37
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
const m = ({
|
|
4
4
|
options: n,
|
|
5
|
-
value:
|
|
5
|
+
value: o,
|
|
6
6
|
onChange: l,
|
|
7
7
|
size: r = "md",
|
|
8
|
-
className:
|
|
9
|
-
}) => /* @__PURE__ */
|
|
8
|
+
className: i
|
|
9
|
+
}) => /* @__PURE__ */ d("div", { className: t(
|
|
10
10
|
// Container: Use 'muted' background for the track (works in all themes)
|
|
11
11
|
"inline-flex bg-muted border border-border",
|
|
12
12
|
r === "xs" ? "rounded-md p-0.5" : "rounded-lg p-1",
|
|
13
|
-
|
|
13
|
+
i
|
|
14
14
|
), children: n.map((e) => {
|
|
15
|
-
const s = e.value ===
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
const s = e.value === o;
|
|
16
|
+
return /* @__PURE__ */ d(
|
|
17
17
|
"button",
|
|
18
18
|
{
|
|
19
19
|
onClick: () => !e.disabled && l(e.value),
|
|
20
20
|
disabled: e.disabled,
|
|
21
|
-
className:
|
|
21
|
+
className: t(
|
|
22
22
|
"relative rounded-md font-medium transition-all duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
|
|
23
23
|
// Size Variants
|
|
24
24
|
//
|
|
@@ -40,7 +40,7 @@ const m = ({
|
|
|
40
40
|
// those two already clear AA and must not move.
|
|
41
41
|
r === "xs" ? "inline-flex items-center justify-center min-h-6 text-2xs px-2 py-0.5" : r === "sm" ? "text-xs px-3 py-1" : "text-sm px-4 py-1.5",
|
|
42
42
|
// State Styles (Theme Aware)
|
|
43
|
-
s ? "bg-card text-foreground shadow-sm ring-1 ring-
|
|
43
|
+
s ? "bg-card text-foreground shadow-sm ring-1 ring-border" : "text-muted-foreground hover:text-foreground hover:bg-background/50",
|
|
44
44
|
e.disabled && "opacity-50 cursor-not-allowed"
|
|
45
45
|
),
|
|
46
46
|
type: "button",
|
|
@@ -8,13 +8,14 @@ import React from 'react';
|
|
|
8
8
|
* @id detail-drawer
|
|
9
9
|
* @param {boolean} isOpen - Whether the drawer is showing.
|
|
10
10
|
* @param {function} onClose - Called when the drawer requests dismissal.
|
|
11
|
-
* @param {string} variant - 'push' compresses sibling flex content so the list stays visible; 'overlay' floats fixed above the page. Defaults to
|
|
11
|
+
* @param {string} variant - 'push' compresses sibling flex content so the list stays visible; 'overlay' floats fixed above the page. Defaults to overlay.
|
|
12
12
|
* @param {string} side - Which edge it docks to: 'left' or 'right'. Defaults to right.
|
|
13
13
|
* @param {boolean} resizable - Enables the draggable handle on the inner border.
|
|
14
14
|
* @param {number} width - Current width in px. Controlled — pair with onWidthChange.
|
|
15
15
|
* @param {function} onWidthChange - Called with the new width while dragging.
|
|
16
16
|
* @param {number} minWidth - Lower bound for resizing. Defaults to 320.
|
|
17
17
|
* @param {number} maxWidth - Upper bound for resizing. Defaults to 60% of the window width.
|
|
18
|
+
* @param {string} title - Names the panel for assistive technology. Not rendered: there is no header row to put it in, and adding one is a design decision. Without it an overlay announces only as "dialog".
|
|
18
19
|
* @param {ReactNode} children - The detail content.
|
|
19
20
|
*/
|
|
20
21
|
export interface DetailDrawerProps {
|
|
@@ -28,5 +29,12 @@ export interface DetailDrawerProps {
|
|
|
28
29
|
minWidth?: number;
|
|
29
30
|
maxWidth?: number;
|
|
30
31
|
side?: 'left' | 'right';
|
|
32
|
+
/**
|
|
33
|
+
* Names the panel for assistive technology. Not rendered — this component
|
|
34
|
+
* has no header row to put it in, and adding one is a visual change that is
|
|
35
|
+
* a designer's call, not this fix's. Without it an overlay announces only as
|
|
36
|
+
* "dialog" and a push panel as nothing at all.
|
|
37
|
+
*/
|
|
38
|
+
title?: string;
|
|
31
39
|
}
|
|
32
40
|
export declare const DetailDrawer: React.FC<DetailDrawerProps>;
|