@ramme-io/ui 4.2.9 → 5.0.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/README.md +3 -9
- package/bin/ramme-ui.mjs +364 -0
- package/dist/blocks/iot/DeviceCard.d.ts +5 -0
- package/dist/blocks/iot/DeviceCard.js +29 -28
- package/dist/component-registry.js +384 -409
- package/dist/components/ai/AIChatThread/AIChatThread.d.ts +10 -2
- package/dist/components/ai/AIChatThread/AIChatThread.js +106 -119
- package/dist/components/ai/cardState.d.ts +19 -0
- package/dist/components/data-display/DocumentScanView.d.ts +81 -0
- package/dist/components/data-display/DocumentScanView.js +79 -0
- package/dist/components/data-display/Gallery.d.ts +49 -0
- package/dist/components/data-display/Gallery.js +95 -0
- package/dist/components/theme/ThemeSynthesizer.d.ts +2 -0
- package/dist/components/theme/ThemeSynthesizer.js +16 -15
- package/dist/components/ui/icon-loader.d.ts +1 -1
- package/dist/contexts/ThemeContext.d.ts +3 -0
- package/dist/contexts/ThemeContext.js +32 -30
- package/dist/index.d.ts +4 -9
- package/dist/index.js +252 -265
- package/dist/wizardManifest.js +123 -166
- package/package.json +7 -3
- package/src/wizardManifest.ts +123 -166
- package/tailwind.preset.js +17 -0
- package/dist/blocks/engines/WatchlistEngine.d.ts +0 -37
- package/dist/blocks/engines/WatchlistEngine.js +0 -130
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.d.ts +0 -28
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +0 -71
- package/dist/components/ai/ArchitectureReferenceCard/index.d.ts +0 -2
- package/dist/components/ai/CompanyProfileCard/CompanyProfileCard.d.ts +0 -15
- package/dist/components/ai/CompanyProfileCard/CompanyProfileCard.js +0 -110
- package/dist/components/ai/CompanyProfileCard/index.d.ts +0 -1
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.d.ts +0 -30
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +0 -83
- package/dist/components/ai/CounterpartyGraphCard/index.d.ts +0 -2
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.d.ts +0 -29
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +0 -70
- package/dist/components/ai/DivergenceMetricsCard/index.d.ts +0 -2
- package/dist/components/ai/LiveQuoteCard/LiveQuoteCard.d.ts +0 -27
- package/dist/components/ai/LiveQuoteCard/LiveQuoteCard.js +0 -73
- package/dist/components/ai/LiveQuoteCard/index.d.ts +0 -2
- package/dist/components/ai/NewsSummaryCard/NewsSummaryCard.d.ts +0 -27
- package/dist/components/ai/NewsSummaryCard/NewsSummaryCard.js +0 -78
- package/dist/components/ai/NewsSummaryCard/index.d.ts +0 -2
- package/dist/components/ai/StockChart/StockChart.d.ts +0 -34
- package/dist/components/ai/StockChart/StockChart.js +0 -199
- package/dist/components/ai/StockChart/index.d.ts +0 -2
- package/dist/utils/apiBaseUrl.d.ts +0 -1
- package/dist/utils/apiBaseUrl.js +0 -10
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import _ from "react";
|
|
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
|
-
import { Card as E, CardHeader as H, CardTitle as L, CardContent as V } from "../../layout/Card.js";
|
|
5
|
-
import { useChartTheme as Y } from "../../../lib/hooks/useChartTheme.js";
|
|
6
|
-
function G(a, p, C) {
|
|
7
|
-
const N = Date.now(), M = p && Array.isArray(p) && p.length > 0 ? p : ["price", "volume"], c = {
|
|
8
|
-
"1D": { duration: 6.5 * 60 * 60 * 1e3, points: 78, basePrice: 150 },
|
|
9
|
-
// 5-minute intervals (market hours)
|
|
10
|
-
"1W": { duration: 7 * 24 * 60 * 60 * 1e3, points: 35, basePrice: 150 },
|
|
11
|
-
// Daily close
|
|
12
|
-
"1M": { duration: 30 * 24 * 60 * 60 * 1e3, points: 30, basePrice: 150 },
|
|
13
|
-
// Daily close
|
|
14
|
-
"1Y": { duration: 365 * 24 * 60 * 60 * 1e3, points: 52, basePrice: 100 }
|
|
15
|
-
// Weekly close
|
|
16
|
-
}, g = c[a] || c["1M"], { duration: l, points: u, basePrice: r } = g, o = l / u, x = [];
|
|
17
|
-
let n = r;
|
|
18
|
-
const h = [];
|
|
19
|
-
for (let d = 0; d < u; d++) {
|
|
20
|
-
const v = N - l + d * o, m = {
|
|
21
|
-
timestamp: new Date(v).toLocaleString("en-US", {
|
|
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
|
-
})
|
|
27
|
-
};
|
|
28
|
-
M.forEach((i) => {
|
|
29
|
-
switch (i) {
|
|
30
|
-
case "price":
|
|
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
|
-
break;
|
|
34
|
-
case "volume":
|
|
35
|
-
const t = 1e6, f = Math.random() > 0.7 ? Math.random() * 2 : 1;
|
|
36
|
-
m[i] = Math.round((t + Math.random() * t * 2) * f);
|
|
37
|
-
break;
|
|
38
|
-
case "moving_average":
|
|
39
|
-
const w = Math.min(20, d + 1), D = h.slice(-w).reduce((I, T) => I + T, 0) / w;
|
|
40
|
-
m[i] = Number(D.toFixed(2));
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
m[i] = 0;
|
|
44
|
-
}
|
|
45
|
-
}), x.push(m);
|
|
46
|
-
}
|
|
47
|
-
return x;
|
|
48
|
-
}
|
|
49
|
-
const k = {
|
|
50
|
-
price: { label: "Price", unit: "USD", color: "#10b981" },
|
|
51
|
-
// Emerald/green
|
|
52
|
-
volume: { label: "Volume", unit: "shares", color: "#f59e0b" },
|
|
53
|
-
// Amber
|
|
54
|
-
moving_average: { label: "MA(20)", unit: "", color: "#ef4444" }
|
|
55
|
-
// Red
|
|
56
|
-
}, Q = ({
|
|
57
|
-
params: a,
|
|
58
|
-
title: p,
|
|
59
|
-
data: C
|
|
60
|
-
}) => {
|
|
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
|
-
() => {
|
|
64
|
-
const t = C || G(r, o);
|
|
65
|
-
return console.log("[StockChart] Data generated:", {
|
|
66
|
-
ticker: u,
|
|
67
|
-
timeRange: r,
|
|
68
|
-
metrics: o,
|
|
69
|
-
dataPoints: t.length,
|
|
70
|
-
firstPoint: t[0],
|
|
71
|
-
lastPoint: t[t.length - 1]
|
|
72
|
-
}), t;
|
|
73
|
-
},
|
|
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
|
-
/* @__PURE__ */ e(L, { className: "text-sm font-medium text-foreground/80", children: P }),
|
|
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
|
-
"$",
|
|
82
|
-
d.toFixed(2)
|
|
83
|
-
] }),
|
|
84
|
-
/* @__PURE__ */ s(
|
|
85
|
-
"span",
|
|
86
|
-
{
|
|
87
|
-
className: `text-xs font-medium ${i ? "text-success-strong" : "text-destructive-strong"}`,
|
|
88
|
-
children: [
|
|
89
|
-
i ? "+" : "",
|
|
90
|
-
v.toFixed(2),
|
|
91
|
-
" (",
|
|
92
|
-
i ? "+" : "",
|
|
93
|
-
m,
|
|
94
|
-
"%)"
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] })
|
|
99
|
-
] }) }),
|
|
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
|
-
/* @__PURE__ */ e(K, { strokeDasharray: "3 3", stroke: l, opacity: 0.3 }),
|
|
103
|
-
/* @__PURE__ */ e(
|
|
104
|
-
U,
|
|
105
|
-
{
|
|
106
|
-
dataKey: "timestamp",
|
|
107
|
-
tick: { fontSize: 11, fill: g },
|
|
108
|
-
stroke: l,
|
|
109
|
-
interval: "preserveStartEnd"
|
|
110
|
-
}
|
|
111
|
-
),
|
|
112
|
-
/* @__PURE__ */ e(
|
|
113
|
-
A,
|
|
114
|
-
{
|
|
115
|
-
yAxisId: "price",
|
|
116
|
-
tick: { fontSize: 11, fill: g },
|
|
117
|
-
stroke: l,
|
|
118
|
-
width: 60
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
/* @__PURE__ */ e(
|
|
122
|
-
A,
|
|
123
|
-
{
|
|
124
|
-
yAxisId: "volume",
|
|
125
|
-
orientation: "right",
|
|
126
|
-
tick: { fontSize: 11, fill: g },
|
|
127
|
-
stroke: l,
|
|
128
|
-
width: 60
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
/* @__PURE__ */ e($, {}),
|
|
132
|
-
/* @__PURE__ */ e(j, {}),
|
|
133
|
-
o.includes("price") && /* @__PURE__ */ e(
|
|
134
|
-
S,
|
|
135
|
-
{
|
|
136
|
-
yAxisId: "price",
|
|
137
|
-
type: "monotone",
|
|
138
|
-
dataKey: "price",
|
|
139
|
-
stroke: k.price.color,
|
|
140
|
-
strokeWidth: 2,
|
|
141
|
-
dot: !1,
|
|
142
|
-
name: "Price (USD)"
|
|
143
|
-
}
|
|
144
|
-
),
|
|
145
|
-
o.includes("moving_average") && /* @__PURE__ */ e(
|
|
146
|
-
S,
|
|
147
|
-
{
|
|
148
|
-
yAxisId: "price",
|
|
149
|
-
type: "monotone",
|
|
150
|
-
dataKey: "moving_average",
|
|
151
|
-
stroke: k.moving_average.color,
|
|
152
|
-
strokeWidth: 2,
|
|
153
|
-
dot: !1,
|
|
154
|
-
name: "MA(20)",
|
|
155
|
-
strokeDasharray: "5 5"
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
o.includes("volume") && /* @__PURE__ */ e(
|
|
159
|
-
z,
|
|
160
|
-
{
|
|
161
|
-
yAxisId: "volume",
|
|
162
|
-
dataKey: "volume",
|
|
163
|
-
fill: k.volume.color,
|
|
164
|
-
opacity: 0.6,
|
|
165
|
-
name: "Volume"
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
] }) }) }),
|
|
169
|
-
/* @__PURE__ */ e("div", { className: "mt-3 flex flex-wrap gap-2", children: o.map((t) => {
|
|
170
|
-
const f = k[t];
|
|
171
|
-
return /* @__PURE__ */ s(
|
|
172
|
-
"div",
|
|
173
|
-
{
|
|
174
|
-
className: "inline-flex items-center gap-1.5 rounded-full bg-muted/50 px-2.5 py-1 text-xs",
|
|
175
|
-
children: [
|
|
176
|
-
/* @__PURE__ */ e(
|
|
177
|
-
"span",
|
|
178
|
-
{
|
|
179
|
-
className: "h-2 w-2 rounded-full",
|
|
180
|
-
style: { backgroundColor: f.color }
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children: f.label }),
|
|
184
|
-
f.unit && /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: [
|
|
185
|
-
"(",
|
|
186
|
-
f.unit,
|
|
187
|
-
")"
|
|
188
|
-
] })
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
t
|
|
192
|
-
);
|
|
193
|
-
}) })
|
|
194
|
-
] })
|
|
195
|
-
] });
|
|
196
|
-
};
|
|
197
|
-
export {
|
|
198
|
-
Q as StockChart
|
|
199
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const apiBaseUrl: () => string;
|