@ramme-io/ui 4.2.0 → 4.2.2
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/formFieldFloor.test.d.ts +1 -0
- package/dist/index.css +1 -1
- package/dist/severity-contrast.test.d.ts +1 -0
- package/dist/utils/apiBaseUrl.d.ts +1 -0
- package/dist/utils/apiBaseUrl.js +10 -0
- package/package.json +2 -2
|
@@ -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
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|