@aintela/bi 0.2.3 → 0.2.5

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.
Files changed (40) hide show
  1. package/dist/{GridLayout-1gWuIKeZ.js → GridLayout-BQcuPzng.js} +2 -2
  2. package/dist/GridLayout-BQcuPzng.js.map +1 -0
  3. package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js → ScriptDashboardViewerVertical-B8Y5LoE4.js} +42 -26
  4. package/dist/{ScriptDashboardViewerVertical-Rr_4adpH.js.map → ScriptDashboardViewerVertical-B8Y5LoE4.js.map} +1 -1
  5. package/dist/{biModuleSurface-BdJK7sSL.js → biModuleSurface-zEeRrln5.js} +6 -6
  6. package/dist/{biModuleSurface-BdJK7sSL.js.map → biModuleSurface-zEeRrln5.js.map} +1 -1
  7. package/dist/composer/index.d.ts +1 -1
  8. package/dist/composer/models/utils.d.ts +11 -0
  9. package/dist/composer.js +33 -32
  10. package/dist/grid.js +2 -2
  11. package/dist/{index-DChE_l-p.js → index-C38e4aIE.js} +2 -2
  12. package/dist/index-C38e4aIE.js.map +1 -0
  13. package/dist/{index-BzUugG0A.js → index-D6-YxBjl.js} +2 -2
  14. package/dist/{index-BzUugG0A.js.map → index-D6-YxBjl.js.map} +1 -1
  15. package/dist/{index-C4_VSDeU.js → index-GTSBsgzP.js} +875 -857
  16. package/dist/index-GTSBsgzP.js.map +1 -0
  17. package/dist/index-ZBNoVc5M.js +210 -0
  18. package/dist/index-ZBNoVc5M.js.map +1 -0
  19. package/dist/index-zN3LPF6u.js +97 -0
  20. package/dist/index-zN3LPF6u.js.map +1 -0
  21. package/dist/index.js +55 -54
  22. package/dist/inline/Chart.d.ts +0 -9
  23. package/dist/inline/Metric.d.ts +0 -2
  24. package/dist/inline/MetricGroup.d.ts +1 -1
  25. package/dist/inline.js +1 -1
  26. package/dist/runtime/version.d.ts +1 -1
  27. package/dist/runtime.js +7 -7
  28. package/dist/style.css +1 -1
  29. package/dist/theme.js +1 -1
  30. package/dist/{version-BTc4ElDG.js → version-oYqU5xJk.js} +6 -6
  31. package/dist/{version-BTc4ElDG.js.map → version-oYqU5xJk.js.map} +1 -1
  32. package/dist/viewer.js +1 -1
  33. package/package.json +1 -1
  34. package/dist/GridLayout-1gWuIKeZ.js.map +0 -1
  35. package/dist/index-BYc79sSy.js +0 -131
  36. package/dist/index-BYc79sSy.js.map +0 -1
  37. package/dist/index-C4_VSDeU.js.map +0 -1
  38. package/dist/index-D7Oo_dC-.js +0 -94
  39. package/dist/index-D7Oo_dC-.js.map +0 -1
  40. package/dist/index-DChE_l-p.js.map +0 -1
@@ -0,0 +1,210 @@
1
+ var q = Object.defineProperty;
2
+ var a = (e, t) => q(e, "name", { value: t, configurable: !0 });
3
+ import { jsx as i, jsxs as o, Fragment as N } from "react/jsx-runtime";
4
+ import { useCallback as $ } from "react";
5
+ import { Box as c, Paper as I, Typography as y, Tooltip as F, IconButton as H, Stack as M } from "@mui/material";
6
+ import j from "@mui/icons-material/SettingsOverscan";
7
+ import { u as R, e as W } from "./BiClientProvider-CWJochvi.js";
8
+ import T from "@mui/icons-material/TrendingUp";
9
+ import V from "@mui/icons-material/TrendingDown";
10
+ import B from "@mui/icons-material/TrendingFlat";
11
+ const f = /* @__PURE__ */ a((e, t) => t ? `var(--bi-${e}, ${t})` : `var(--bi-${e})`, "v$2"), _ = /* @__PURE__ */ a(({ src: e, name: t, reasoning: l, alt: m, naked: p, sessionId: s, dashboardId: u, id: d, onExpand: r }) => {
12
+ const h = R(), b = W(), w = { sessionId: s ?? b, dashboardId: u }, g = h.artifactUrl(e, w), S = $(() => {
13
+ r ? r({ src: e, url: g, name: t, reasoning: l }) : typeof window < "u" && window.open(g, "_blank", "noopener");
14
+ }, [r, e, g, t, l]), x = /* @__PURE__ */ i(
15
+ c,
16
+ {
17
+ component: "img",
18
+ src: g,
19
+ alt: m ?? t ?? "",
20
+ title: l,
21
+ onClick: S,
22
+ sx: { maxWidth: "100%", maxHeight: 480, width: "auto", height: "auto", objectFit: "scale-down", display: "block", cursor: "zoom-in", borderRadius: f("radius-sm") }
23
+ }
24
+ );
25
+ return p ? /* @__PURE__ */ i(c, { id: d, sx: { position: "relative", width: "100%", my: 1 }, children: x }) : /* @__PURE__ */ o(
26
+ I,
27
+ {
28
+ id: d,
29
+ variant: "outlined",
30
+ className: "bi-chart",
31
+ sx: { position: "relative", my: 1.5, px: 1.75, pt: 1.5, pb: 1.75, bgcolor: f("card-bg"), borderColor: f("card-border"), borderRadius: f("radius-lg", f("radius")), minHeight: 120, transition: "border-color .15s", "&:hover": { borderColor: f("card-border-strong") } },
32
+ children: [
33
+ /* @__PURE__ */ o(c, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 0.5, minHeight: 32 }, children: [
34
+ /* @__PURE__ */ i(y, { variant: "overline", sx: { fontFamily: f("font-mono"), fontSize: 10, letterSpacing: ".12em", lineHeight: 1.4, color: f("text-disabled"), pl: 0.5 }, children: t ?? "" }),
35
+ /* @__PURE__ */ i(F, { title: "Expandir", children: /* @__PURE__ */ i(
36
+ H,
37
+ {
38
+ size: "small",
39
+ onClick: S,
40
+ "aria-label": "Expandir gráfico",
41
+ "data-src": e,
42
+ sx: { color: f("text-disabled"), borderRadius: f("radius-sm"), "&:hover": { bgcolor: f("surface-2"), color: f("text-1") } },
43
+ children: /* @__PURE__ */ i(j, { fontSize: "small" })
44
+ }
45
+ ) })
46
+ ] }),
47
+ /* @__PURE__ */ i(c, { sx: { display: "flex", justifyContent: "center" }, children: x })
48
+ ]
49
+ }
50
+ );
51
+ }, "Chart");
52
+ function z(e) {
53
+ if (!e) return { prefix: void 0, suffix: void 0, number: void 0 };
54
+ const t = /[$%(\w?$)]/gi, l = /[a-z]?\$/gi;
55
+ let m = "", p = "";
56
+ if (e.match(t)) {
57
+ e.indexOf("%") > -1 && (p = " %");
58
+ const d = e.match(l);
59
+ d && (m = d[0] + " ");
60
+ }
61
+ let s = parseFloat(e);
62
+ if (!isNaN(s))
63
+ return e = e.replaceAll(".", "").replaceAll(",", "."), { prefix: m, suffix: p, number: parseFloat(e) };
64
+ let u = "";
65
+ for (const d of e)
66
+ if (d.match(/[0-9.,]/)) {
67
+ let r = d;
68
+ r === "." ? r = "" : r === "," && (r = "."), u += r;
69
+ }
70
+ return s = parseFloat(u), isNaN(s) ? { prefix: void 0, suffix: void 0, number: void 0 } : { prefix: m, suffix: p, number: s };
71
+ }
72
+ a(z, "parseKnownNumbers");
73
+ const k = /* @__PURE__ */ a((e) => {
74
+ if (!e) return /* @__PURE__ */ i("span", { children: "N/A" });
75
+ const t = Math.abs(e);
76
+ return t >= 1e9 ? /* @__PURE__ */ o(N, { children: [
77
+ /* @__PURE__ */ i("span", { children: (e / 1e9).toFixed(2).replace(/\.?0+$/, "") }),
78
+ " ",
79
+ /* @__PURE__ */ i("span", { className: "billion", children: "B" })
80
+ ] }) : t >= 1e6 ? /* @__PURE__ */ o(N, { children: [
81
+ /* @__PURE__ */ i("span", { children: (e / 1e6).toFixed(3).replace(/\.?0+$/, "") }),
82
+ /* @__PURE__ */ i("span", { className: "million", children: "M" })
83
+ ] }) : t >= 1e3 ? /* @__PURE__ */ o(N, { children: [
84
+ /* @__PURE__ */ i("span", { children: (e / 1e3).toFixed(2).replace(/\.?0+$/, "") }),
85
+ /* @__PURE__ */ i("span", { className: "thousand", children: "K" })
86
+ ] }) : /* @__PURE__ */ i("span", { children: e.toString() });
87
+ }, "formatValue"), P = /* @__PURE__ */ a((e, t) => {
88
+ if (e = e ?? 0, t = t ?? 0, !t) return { percentage: 0, trend: "neutral" };
89
+ const l = (e - t) / t * 100, m = l > 0 ? "up" : l < 0 ? "down" : "neutral";
90
+ return { percentage: Math.abs(l), trend: m };
91
+ }, "calculateDelta"), n = /* @__PURE__ */ a((e, t) => t ? `var(--bi-${e}, ${t})` : `var(--bi-${e})`, "v$1"), v = {
92
+ root: {
93
+ position: "relative",
94
+ display: "flex",
95
+ alignItems: "flex-start",
96
+ gap: 1.5,
97
+ minWidth: 0,
98
+ bgcolor: n("card-bg"),
99
+ border: `1px solid ${n("card-border")}`,
100
+ borderRadius: n("radius-lg", n("radius")),
101
+ px: 2,
102
+ pt: 1.75,
103
+ pb: 1.5,
104
+ transition: "border-color .15s",
105
+ "&:hover": { borderColor: n("card-border-strong") },
106
+ // solta (fora de um MetricGroup) não estica
107
+ ":not(.quick-stats) > &": { display: "inline-flex", minWidth: 240, maxWidth: "100%", my: 1.5 }
108
+ },
109
+ icon: {
110
+ position: "absolute",
111
+ top: 12,
112
+ right: 12,
113
+ width: 30,
114
+ height: 30,
115
+ borderRadius: n("radius-sm"),
116
+ bgcolor: n("accent-soft"),
117
+ color: n("positive"),
118
+ display: "flex",
119
+ alignItems: "center",
120
+ justifyContent: "center",
121
+ flex: "none",
122
+ "& .material-icons": { fontSize: 16, lineHeight: 1, display: "block" }
123
+ },
124
+ content: { display: "flex", flexDirection: "column", gap: 0.5, minWidth: 0, flex: 1 },
125
+ label: { fontSize: 12.5, lineHeight: 1.35, color: n("text-2") },
126
+ value: {
127
+ fontSize: 28,
128
+ fontWeight: 600,
129
+ lineHeight: 1.05,
130
+ letterSpacing: "-.03em",
131
+ fontVariantNumeric: "tabular-nums",
132
+ color: n("text-1"),
133
+ wordBreak: "break-word",
134
+ "& small": { fontSize: 14, fontWeight: 500, color: n("text-disabled"), mx: "2px", letterSpacing: 0 }
135
+ },
136
+ change: /* @__PURE__ */ a((e) => ({
137
+ display: "inline-flex",
138
+ alignItems: "center",
139
+ gap: "2px",
140
+ fontFamily: n("font-mono", n("font-family")),
141
+ fontSize: 11,
142
+ fontWeight: 500,
143
+ lineHeight: 1,
144
+ px: "7px",
145
+ py: "3px",
146
+ borderRadius: n("radius-sm"),
147
+ bgcolor: n(e === "neutral" ? "neutral-soft" : `${e === "up" ? "positive" : "negative"}-soft`),
148
+ color: n(e === "neutral" ? "neutral" : e === "up" ? "positive" : "negative"),
149
+ "& .material-icons, & svg": { fontSize: 13, width: 13, height: 13 }
150
+ }), "change"),
151
+ prev: { fontSize: 11.5, color: n("text-disabled"), "&::before": { content: '"vs "' } }
152
+ }, A = /* @__PURE__ */ a((e) => {
153
+ const t = /* @__PURE__ */ a((x) => x === "up" ? /* @__PURE__ */ i(T, { fontSize: "small" }) : x === "down" ? /* @__PURE__ */ i(V, { fontSize: "small" }) : /* @__PURE__ */ i(B, { fontSize: "small" }), "trendIcon"), l = /* @__PURE__ */ a((x) => x === "up" ? "kpi-change-up" : x === "down" ? "kpi-change-down" : "kpi-change-flat", "trendClass"), { prefix: m, suffix: p, number: s } = z(e.currentValue), { prefix: u, suffix: d, number: r } = z(e.previousValue), { percentage: h, trend: b } = P(s, r), w = e.partial ? "-nohover" : "", g = e.prefix ?? m, S = e.suffix ?? p;
154
+ return /* @__PURE__ */ o(c, { className: `quick-stat${w}`, sx: v.root, children: [
155
+ e.icon && /* @__PURE__ */ i(c, { className: "quick-stat-icon kpi", sx: v.icon, children: /* @__PURE__ */ i("i", { className: "material-icons", children: e.icon }) }),
156
+ /* @__PURE__ */ o(c, { className: "quick-stat-content", sx: { ...v.content, pr: e.icon ? 4.5 : 0 }, children: [
157
+ e.description && /* @__PURE__ */ i(y, { component: "div", className: "quick-stat-label", sx: v.label, children: e.description }),
158
+ /* @__PURE__ */ o(c, { className: "quick-stat-value", sx: v.value, children: [
159
+ g && /* @__PURE__ */ i("small", { children: g }),
160
+ k(s),
161
+ S && /* @__PURE__ */ i("small", { children: S })
162
+ ] }),
163
+ e.previousValue && /* @__PURE__ */ o(M, { direction: "row", spacing: 1, useFlexGap: !0, flexWrap: "wrap", sx: { alignItems: "center", mt: 0.5 }, children: [
164
+ /* @__PURE__ */ o(c, { className: `kpi-change ${l(b)}`, sx: v.change(b), children: [
165
+ t(b),
166
+ e.differenceStyle === "Value" && s != null && r != null ? k(Math.abs(s - r)) : `${h.toFixed(2)}%`
167
+ ] }),
168
+ /* @__PURE__ */ o(y, { component: "div", className: "quick-stat-label", sx: v.prev, children: [
169
+ u,
170
+ k(r),
171
+ d
172
+ ] })
173
+ ] })
174
+ ] })
175
+ ] });
176
+ }, "Metric"), C = /* @__PURE__ */ a((e) => `var(--bi-${e})`, "v"), D = /* @__PURE__ */ a((e) => /* @__PURE__ */ o(c, { className: "bi-metric-group", sx: { display: "flex", flexDirection: "column", gap: 1, my: 1.5 }, children: [
177
+ e.title && /* @__PURE__ */ o(y, { variant: "overline", component: "div", sx: { fontFamily: C("font-mono"), fontSize: 10, lineHeight: 1.4, letterSpacing: ".12em", color: C("text-disabled"), px: "2px" }, children: [
178
+ e.materialIcon && /* @__PURE__ */ i("i", { className: "material-icons", style: { fontSize: 14, verticalAlign: "middle", marginRight: 4 }, children: e.materialIcon }),
179
+ e.title
180
+ ] }),
181
+ /* @__PURE__ */ i(c, { className: "quick-stats", sx: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))", gap: 1.25 }, children: e.children }),
182
+ e.footNote && /* @__PURE__ */ i(y, { component: "div", sx: { fontSize: 11.5, color: C("text-disabled"), px: "2px" }, children: e.footNote })
183
+ ] }), "MetricGroup"), O = /* @__PURE__ */ a(({ id: e, name: t, src: l, sessionId: m, partial: p, height: s = 400, onExpand: u }) => {
184
+ const d = R(), r = W(), h = d.iframeUrl(l, { sessionId: m ?? r }), b = $(() => {
185
+ u ? u({ name: t, url: h }) : typeof window < "u" && window.open(h, "_blank", "noopener");
186
+ }, [u, t, h]);
187
+ return /* @__PURE__ */ o(I, { id: e, variant: "outlined", className: `bi-iframe${p ? " bi-iframe-partial" : ""}`, sx: { position: "relative", my: 2, p: 1, bgcolor: "background.paper", borderColor: "divider" }, children: [
188
+ /* @__PURE__ */ o(c, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 0.5 }, children: [
189
+ /* @__PURE__ */ i(y, { variant: "overline", color: "text.secondary", sx: { letterSpacing: 0.6, pl: 0.5 }, children: t }),
190
+ /* @__PURE__ */ i(F, { title: "Expandir", children: /* @__PURE__ */ i(H, { size: "small", onClick: b, "aria-label": "Expandir", "data-src": h, children: /* @__PURE__ */ i(j, { fontSize: "small" }) }) })
191
+ ] }),
192
+ /* @__PURE__ */ i(c, { className: "iframe-container", sx: { border: "1px dashed", borderColor: "divider", borderRadius: 1, bgcolor: "action.hover" }, children: /* @__PURE__ */ i("iframe", { title: t, src: h, style: { minHeight: s, width: "100%", border: 0, borderRadius: "var(--bi-radius)" } }) })
193
+ ] });
194
+ }, "IFrame"), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
195
+ __proto__: null,
196
+ Chart: _,
197
+ IFrame: O,
198
+ Metric: A,
199
+ MetricGroup: D,
200
+ parseKnownNumbers: z
201
+ }, Symbol.toStringTag, { value: "Module" }));
202
+ export {
203
+ _ as C,
204
+ O as I,
205
+ A as M,
206
+ D as a,
207
+ Z as b,
208
+ z as p
209
+ };
210
+ //# sourceMappingURL=index-ZBNoVc5M.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-ZBNoVc5M.js","sources":["../src/inline/Chart.tsx","../src/inline/parseKnownNumbers.ts","../src/inline/Metric.tsx","../src/inline/MetricGroup.tsx","../src/inline/IFrame.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Box, IconButton, Paper, Tooltip, Typography } from '@mui/material';\nimport SettingsOverscanIcon from '@mui/icons-material/SettingsOverscan';\nimport { useBiClient, useBiSessionId, type ArtifactUrlScope } from '../client';\n\nconst v = (name: string, fallback?: string) => (fallback ? `var(--bi-${name}, ${fallback})` : `var(--bi-${name})`);\n\nexport interface ChartExpandInfo { src: string; url: string; name?: string; reasoning?: string }\nexport interface ChartProps { src: string; name?: string; reasoning?: string; alt?: string; naked?: boolean; sessionId?: string; dashboardId?: string; id?: string; onExpand?: (info: ChartExpandInfo) => void }\n\nexport const Chart: React.FC<ChartProps> = ({ src, name, reasoning, alt, naked, sessionId, dashboardId, id, onExpand }) => {\n const client = useBiClient();\n const ambientSession = useBiSessionId();\n const scope: ArtifactUrlScope = { sessionId: sessionId ?? ambientSession, dashboardId };\n const url = client.artifactUrl(src, scope);\n\n const expand = useCallback(() => {\n if (onExpand) onExpand({ src, url, name, reasoning });\n else if (typeof window !== 'undefined') window.open(url, '_blank', 'noopener');\n }, [onExpand, src, url, name, reasoning]);\n\n const img = (\n <Box component=\"img\" src={url} alt={alt ?? name ?? ''} title={reasoning} onClick={expand}\n sx={{ maxWidth: '100%', maxHeight: 480, width: 'auto', height: 'auto', objectFit: 'scale-down', display: 'block', cursor: 'zoom-in', borderRadius: v('radius-sm') }} />\n );\n\n if (naked) return <Box id={id} sx={{ position: 'relative', width: '100%', my: 1 }}>{img}</Box>;\n\n return (\n <Paper id={id} variant=\"outlined\" className=\"bi-chart\"\n sx={{ position: 'relative', my: 1.5, px: 1.75, pt: 1.5, pb: 1.75, bgcolor: v('card-bg'), borderColor: v('card-border'), borderRadius: v('radius-lg', v('radius')), minHeight: 120, transition: 'border-color .15s', '&:hover': { borderColor: v('card-border-strong') } }}>\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5, minHeight: 32 }}>\n <Typography variant=\"overline\" sx={{ fontFamily: v('font-mono'), fontSize: 10, letterSpacing: '.12em', lineHeight: 1.4, color: v('text-disabled'), pl: 0.5 }}>\n {name ?? ''}\n </Typography>\n <Tooltip title=\"Expandir\">\n <IconButton size=\"small\" onClick={expand} aria-label=\"Expandir gráfico\" data-src={src}\n sx={{ color: v('text-disabled'), borderRadius: v('radius-sm'), '&:hover': { bgcolor: v('surface-2'), color: v('text-1') } }}>\n <SettingsOverscanIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Box>\n <Box sx={{ display: 'flex', justifyContent: 'center' }}>{img}</Box>\n </Paper>\n );\n};\n\nexport default Chart;\n","/**\n * Splits a formatted figure such as `\"R$ 1.234,56\"` or `\"12,5%\"` into a\n * currency/percent prefix + suffix and a JS number. Mirrors the chat library's\n * `parseKnownNumbers` (`src/utils/stringUtils.ts`), which is not part of its\n * public `@aintela/chat/utils` surface — so it lives here.\n */\nexport function parseKnownNumbers(text?: string): { prefix?: string; suffix?: string; number?: number } {\n if (!text) return { prefix: undefined, suffix: undefined, number: undefined };\n\n const knownChars = /[$%(\\w?$)]/gi;\n const currencySymbol = /[a-z]?\\$/gi;\n\n let prefix = '';\n let suffix = '';\n\n if (text.match(knownChars)) {\n if (text.indexOf('%') > -1) suffix = ' %';\n const match = text.match(currencySymbol);\n if (match) prefix = match[0] + ' ';\n }\n\n let number = parseFloat(text);\n if (!isNaN(number)) {\n text = text.replaceAll('.', '').replaceAll(',', '.');\n return { prefix, suffix, number: parseFloat(text) };\n }\n\n let finalNumber = '';\n for (const char of text) {\n if (char.match(/[0-9.,]/)) {\n let replacedChar = char;\n if (replacedChar === '.') replacedChar = '';\n else if (replacedChar === ',') replacedChar = '.';\n finalNumber += replacedChar;\n }\n }\n\n number = parseFloat(finalNumber);\n if (!isNaN(number)) return { prefix, suffix, number };\n\n return { prefix: undefined, suffix: undefined, number: undefined };\n}\n","import React from 'react';\nimport TrendingUpIcon from '@mui/icons-material/TrendingUp';\nimport TrendingDownIcon from '@mui/icons-material/TrendingDown';\nimport TrendingFlatIcon from '@mui/icons-material/TrendingFlat';\nimport { Box, Stack, Typography } from '@mui/material';\nimport { parseKnownNumbers } from './parseKnownNumbers';\nimport './inline.css';\n\nexport interface MetricProps {\n preview?: boolean;\n previousValue?: string;\n currentValue: string;\n prefix?: string;\n suffix?: string;\n differenceStyle?: 'Percentage' | 'Value';\n description?: string;\n /** Material Icons ligature name (the host must load the Material Icons font). */\n icon?: string;\n partial?: boolean;\n}\n\nconst formatValue = (value?: number) => {\n if (!value) return <span>N/A</span>;\n const absValue = Math.abs(value);\n if (absValue >= 1e9) return <><span>{(value / 1e9).toFixed(2).replace(/\\.?0+$/, '')}</span> <span className=\"billion\">B</span></>;\n if (absValue >= 1e6) return <><span>{(value / 1e6).toFixed(3).replace(/\\.?0+$/, '')}</span><span className=\"million\">M</span></>;\n if (absValue >= 1e3) return <><span>{(value / 1e3).toFixed(2).replace(/\\.?0+$/, '')}</span><span className=\"thousand\">K</span></>;\n return <span>{value.toString()}</span>;\n};\n\ntype Trend = 'up' | 'down' | 'neutral';\n\nconst calculateDelta = (current?: number, previous?: number): { percentage: number; trend: Trend } => {\n current = current ?? 0;\n previous = previous ?? 0;\n if (!previous) return { percentage: 0, trend: 'neutral' };\n const percentage = ((current - previous) / previous) * 100;\n const trend: Trend = percentage > 0 ? 'up' : percentage < 0 ? 'down' : 'neutral';\n return { percentage: Math.abs(percentage), trend };\n};\n\n\nconst v = (name: string, fallback?: string) => (fallback ? `var(--bi-${name}, ${fallback})` : `var(--bi-${name})`);\n\nconst metricSx = {\n root: {\n position: 'relative', display: 'flex', alignItems: 'flex-start', gap: 1.5, minWidth: 0,\n bgcolor: v('card-bg'), border: `1px solid ${v('card-border')}`, borderRadius: v('radius-lg', v('radius')),\n px: 2, pt: 1.75, pb: 1.5, transition: 'border-color .15s',\n '&:hover': { borderColor: v('card-border-strong') },\n // solta (fora de um MetricGroup) não estica\n ':not(.quick-stats) > &': { display: 'inline-flex', minWidth: 240, maxWidth: '100%', my: 1.5 },\n },\n icon: {\n position: 'absolute', top: 12, right: 12, width: 30, height: 30, borderRadius: v('radius-sm'),\n bgcolor: v('accent-soft'), color: v('positive'), display: 'flex', alignItems: 'center', justifyContent: 'center', flex: 'none',\n '& .material-icons': { fontSize: 16, lineHeight: 1, display: 'block' },\n },\n content: { display: 'flex', flexDirection: 'column', gap: 0.5, minWidth: 0, flex: 1 },\n label: { fontSize: 12.5, lineHeight: 1.35, color: v('text-2') },\n value: {\n fontSize: 28, fontWeight: 600, lineHeight: 1.05, letterSpacing: '-.03em', fontVariantNumeric: 'tabular-nums',\n color: v('text-1'), wordBreak: 'break-word',\n '& small': { fontSize: 14, fontWeight: 500, color: v('text-disabled'), mx: '2px', letterSpacing: 0 },\n },\n change: (trend: 'up' | 'down' | 'neutral') => ({\n display: 'inline-flex', alignItems: 'center', gap: '2px', fontFamily: v('font-mono', v('font-family')),\n fontSize: 11, fontWeight: 500, lineHeight: 1, px: '7px', py: '3px', borderRadius: v('radius-sm'),\n bgcolor: v(trend === 'neutral' ? 'neutral-soft' : `${trend === 'up' ? 'positive' : 'negative'}-soft`),\n color: v(trend === 'neutral' ? 'neutral' : trend === 'up' ? 'positive' : 'negative'),\n '& .material-icons, & svg': { fontSize: 13, width: 13, height: 13 },\n }),\n prev: { fontSize: 11.5, color: v('text-disabled'), '&::before': { content: '\"vs \"' } },\n};\n\nexport const Metric: React.FC<MetricProps> = (props) => {\n const trendIcon = (t: Trend) => (t === 'up' ? <TrendingUpIcon fontSize=\"small\" /> : t === 'down' ? <TrendingDownIcon fontSize=\"small\" /> : <TrendingFlatIcon fontSize=\"small\" />);\n const trendClass = (t: Trend) => (t === 'up' ? 'kpi-change-up' : t === 'down' ? 'kpi-change-down' : 'kpi-change-flat');\n\n const { prefix: prefixC, suffix: suffixC, number: numberC } = parseKnownNumbers(props.currentValue);\n const { prefix: prefixP, suffix: suffixP, number: numberP } = parseKnownNumbers(props.previousValue);\n const { percentage, trend } = calculateDelta(numberC, numberP);\n const classNameSuffix = props.partial ? '-nohover' : '';\n const prefix = props.prefix ?? prefixC;\n const suffix = props.suffix ?? suffixC;\n return (\n <Box className={`quick-stat${classNameSuffix}`} sx={metricSx.root}>\n {props.icon && (\n <Box className=\"quick-stat-icon kpi\" sx={metricSx.icon}><i className=\"material-icons\">{props.icon}</i></Box>\n )}\n <Box className=\"quick-stat-content\" sx={{ ...metricSx.content, pr: props.icon ? 4.5 : 0 }}>\n {/* rótulo primeiro, valor depois */}\n {props.description && <Typography component=\"div\" className=\"quick-stat-label\" sx={metricSx.label}>{props.description}</Typography>}\n <Box className=\"quick-stat-value\" sx={metricSx.value}>\n {prefix && <small>{prefix}</small>}{formatValue(numberC)}{suffix && <small>{suffix}</small>}\n </Box>\n {props.previousValue && (\n <Stack direction=\"row\" spacing={1} useFlexGap flexWrap=\"wrap\" sx={{ alignItems: 'center', mt: 0.5 }}>\n <Box className={`kpi-change ${trendClass(trend)}`} sx={metricSx.change(trend)}>\n {trendIcon(trend)}\n {props.differenceStyle === 'Value' && numberC != null && numberP != null ? formatValue(Math.abs(numberC - numberP)) : `${percentage.toFixed(2)}%`}\n </Box>\n <Typography component=\"div\" className=\"quick-stat-label\" sx={metricSx.prev}>{prefixP}{formatValue(numberP)}{suffixP}</Typography>\n </Stack>\n )}\n </Box>\n </Box>\n );\n};\n","import React from 'react';\nimport { Box, Typography } from '@mui/material';\nimport './inline.css';\n\nexport interface MetricGroupProps {\n children: React.ReactNode;\n title?: string;\n materialIcon?: string;\n footNote?: string;\n partial?: boolean;\n}\n\nconst v = (name: string) => `var(--bi-${name})`;\n\n/** A row of `Metric` tiles (`present_metric_group`). Sem inline.css. */\nexport const MetricGroup: React.FC<MetricGroupProps> = (props) => (\n <Box className=\"bi-metric-group\" sx={{ display: 'flex', flexDirection: 'column', gap: 1, my: 1.5 }}>\n {props.title && (\n <Typography variant=\"overline\" component=\"div\" sx={{ fontFamily: v('font-mono'), fontSize: 10, lineHeight: 1.4, letterSpacing: '.12em', color: v('text-disabled'), px: '2px' }}>\n {props.materialIcon && <i className=\"material-icons\" style={{ fontSize: 14, verticalAlign: 'middle', marginRight: 4 }}>{props.materialIcon}</i>}\n {props.title}\n </Typography>\n )}\n <Box className=\"quick-stats\" sx={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))', gap: 1.25 }}>\n {props.children}\n </Box>\n {props.footNote && (\n <Typography component=\"div\" sx={{ fontSize: 11.5, color: v('text-disabled'), px: '2px' }}>{props.footNote}</Typography>\n )}\n </Box>\n);\n\nexport default MetricGroup;\n","import React, { useCallback } from 'react';\nimport { Box, IconButton, Paper, Tooltip, Typography } from '@mui/material';\nimport SettingsOverscanIcon from '@mui/icons-material/SettingsOverscan';\nimport { useBiClient, useBiSessionId } from '../client';\n\nexport interface IFrameExpandInfo {\n name: string;\n url: string;\n}\n\nexport interface IFrameProps {\n id?: string;\n name: string;\n /** HTML artifact file name (e.g. a folium map). */\n src: string;\n sessionId?: string;\n partial?: boolean;\n height?: number | string;\n /** Called from the expand affordance. When omitted the frame URL opens in a new tab. */\n onExpand?: (info: IFrameExpandInfo) => void;\n}\n\n/** HTML artifact card used by `present_iframe`. URL resolved through the injected `BiClient`. */\nexport const IFrame: React.FC<IFrameProps> = ({ id, name, src, sessionId, partial, height = 400, onExpand }) => {\n const client = useBiClient();\n const ambientSession = useBiSessionId();\n const url = client.iframeUrl(src, { sessionId: sessionId ?? ambientSession });\n\n const expand = useCallback(() => {\n if (onExpand) onExpand({ name, url });\n else if (typeof window !== 'undefined') window.open(url, '_blank', 'noopener');\n }, [onExpand, name, url]);\n\n return (\n <Paper id={id} variant=\"outlined\" className={`bi-iframe${partial ? ' bi-iframe-partial' : ''}`} sx={{ position: 'relative', my: 2, p: 1, bgcolor: 'background.paper', borderColor: 'divider' }}>\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', mb: 0.5 }}>\n <Typography variant=\"overline\" color=\"text.secondary\" sx={{ letterSpacing: 0.6, pl: 0.5 }}>{name}</Typography>\n <Tooltip title=\"Expandir\">\n <IconButton size=\"small\" onClick={expand} aria-label=\"Expandir\" data-src={url}>\n <SettingsOverscanIcon fontSize=\"small\" />\n </IconButton>\n </Tooltip>\n </Box>\n <Box className=\"iframe-container\" sx={{ border: '1px dashed', borderColor: 'divider', borderRadius: 1, bgcolor: 'action.hover' }}>\n <iframe title={name} src={url} style={{ minHeight: height, width: '100%', border: 0, borderRadius: 'var(--bi-radius)' }} />\n </Box>\n </Paper>\n );\n};\n\nexport default IFrame;\n"],"names":["v","__name","name","fallback","Chart","src","reasoning","alt","naked","sessionId","dashboardId","id","onExpand","client","useBiClient","ambientSession","useBiSessionId","scope","url","expand","useCallback","img","jsx","Box","jsxs","Paper","Typography","Tooltip","IconButton","SettingsOverscanIcon","parseKnownNumbers","text","knownChars","currencySymbol","prefix","suffix","match","number","finalNumber","char","replacedChar","formatValue","value","absValue","Fragment","calculateDelta","current","previous","percentage","trend","metricSx","Metric","props","trendIcon","t","TrendingUpIcon","TrendingDownIcon","TrendingFlatIcon","trendClass","prefixC","suffixC","numberC","prefixP","suffixP","numberP","classNameSuffix","Stack","MetricGroup","IFrame","partial","height"],"mappings":";;;;;;;;;;AAKA,MAAMA,IAAI,gBAAAC,EAAA,CAACC,GAAcC,MAAuBA,IAAW,YAAYD,CAAI,KAAKC,CAAQ,MAAM,YAAYD,CAAI,KAApG,QAKGE,IAA8B,gBAAAH,EAAA,CAAC,EAAE,KAAAI,GAAK,MAAAH,GAAM,WAAAI,GAAW,KAAAC,GAAK,OAAAC,GAAO,WAAAC,GAAW,aAAAC,GAAa,IAAAC,GAAI,UAAAC,EAAA,MAAe;AACvH,QAAMC,IAASC,EAAA,GACTC,IAAiBC,EAAA,GACjBC,IAA0B,EAAE,WAAWR,KAAaM,GAAgB,aAAAL,EAAA,GACpEQ,IAAML,EAAO,YAAYR,GAAKY,CAAK,GAEnCE,IAASC,EAAY,MAAM;AAC7B,IAAIR,IAAUA,EAAS,EAAE,KAAAP,GAAK,KAAAa,GAAK,MAAAhB,GAAM,WAAAI,GAAW,IAC3C,OAAO,SAAW,cAAoB,KAAKY,GAAK,UAAU,UAAU;AAAA,EACjF,GAAG,CAACN,GAAUP,GAAKa,GAAKhB,GAAMI,CAAS,CAAC,GAElCe,IACF,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MAAI,WAAU;AAAA,MAAM,KAAKL;AAAA,MAAK,KAAKX,KAAOL,KAAQ;AAAA,MAAI,OAAOI;AAAA,MAAW,SAASa;AAAA,MAC9E,IAAI,EAAE,UAAU,QAAQ,WAAW,KAAK,OAAO,QAAQ,QAAQ,QAAQ,WAAW,cAAc,SAAS,SAAS,QAAQ,WAAW,cAAcnB,EAAE,WAAW,EAAA;AAAA,IAAE;AAAA,EAAA;AAG1K,SAAIQ,IAAc,gBAAAc,EAACC,GAAA,EAA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AQ,OAAO,QAAQ,QAAQ,GAAG,cAAc,mBAAA,GAAsB,EAAA,CAC7H;AAAA,EAAA,GACJ;AAER,GAzB6C;;;;;;;;"}
@@ -0,0 +1,97 @@
1
+ var y = Object.defineProperty;
2
+ var n = (r, i) => y(r, "name", { value: i, configurable: !0 });
3
+ import { r as c, b as f, a as h, c as g, d as v, u as x, w as k } from "./createBiTheme-TyUv_UHM.js";
4
+ import { jsx as P } from "react/jsx-runtime";
5
+ import { useMemo as u, useEffect as p } from "react";
6
+ import { useTheme as m, alpha as t } from "@mui/material/styles";
7
+ function d(r) {
8
+ const i = c(r), e = r.palette, o = typeof r.shape.borderRadius == "number" ? `${r.shape.borderRadius}px` : String(r.shape.borderRadius);
9
+ return {
10
+ "--bi-font-mono": r.typography.fontFamilyMono ?? "ui-monospace, SFMono-Regular, Menlo, monospace",
11
+ "--bi-radius-lg": `${Math.round((typeof r.shape.borderRadius == "number" ? r.shape.borderRadius : 4) * 1.5)}px`,
12
+ // 12px com radius 8
13
+ "--bi-bg": e.background.default,
14
+ "--bi-card-bg": e.background.paper,
15
+ "--bi-card-border": e.divider,
16
+ "--bi-card-border-strong": t(e.text.primary, 0.28),
17
+ "--bi-text-1": e.text.primary,
18
+ "--bi-text-2": e.text.secondary,
19
+ "--bi-text-disabled": e.text.disabled,
20
+ "--bi-grid-line": t(e.text.primary, 0.12),
21
+ "--bi-hover": e.action.hover,
22
+ "--bi-selected": e.action.selected,
23
+ "--bi-overlay": t(e.text.primary, 0.08),
24
+ "--bi-surface-1": t(e.text.primary, 0.03),
25
+ "--bi-surface-2": t(e.text.primary, 0.06),
26
+ "--bi-accent": e.primary.main,
27
+ "--bi-accent-soft": t(e.primary.main, 0.12),
28
+ "--bi-accent-border": t(e.primary.main, 0.3),
29
+ "--bi-positive": i.positive,
30
+ "--bi-positive-soft": t(i.positive, 0.15),
31
+ "--bi-negative": i.negative,
32
+ "--bi-negative-soft": t(i.negative, 0.15),
33
+ "--bi-neutral": i.neutral,
34
+ "--bi-neutral-soft": t(i.neutral, 0.15),
35
+ "--bi-error": e.error.main,
36
+ "--bi-error-soft": t(e.error.main, 0.08),
37
+ // ── Composer / sketch pad (`composer.css`) ──
38
+ "--bi-secondary": e.secondary.main,
39
+ "--bi-secondary-soft": t(e.secondary.main, 0.16),
40
+ "--bi-sketch-dash": t(e.text.primary, 0.35),
41
+ "--bi-sketch-dash-faint": t(e.text.primary, 0.12),
42
+ "--bi-sketch-selection": t(e.primary.main, 0.12),
43
+ "--bi-scrim": t(e.common.black, 0.4),
44
+ "--bi-highlight-outline": e.secondary.main,
45
+ "--bi-highlight-glow": t(e.secondary.main, 0.35),
46
+ "--bi-shadow": r.shadows[4],
47
+ "--bi-shadow-strong": r.shadows[8],
48
+ "--bi-radius": o,
49
+ "--bi-radius-sm": `${Math.max(2, Math.round((typeof r.shape.borderRadius == "number" ? r.shape.borderRadius : 4) / 2))}px`,
50
+ "--bi-font-family": r.typography.fontFamily ?? "inherit"
51
+ };
52
+ }
53
+ n(d, "computeBiCssVars");
54
+ const B = /* @__PURE__ */ n(({ children: r, className: i, style: e }) => {
55
+ const o = m(), a = u(() => d(o), [o]);
56
+ return p(() => {
57
+ if (r !== void 0 || typeof document > "u") return;
58
+ const s = document.documentElement;
59
+ for (const [b, l] of Object.entries(a)) s.style.setProperty(b, l);
60
+ return () => {
61
+ for (const b of Object.keys(a)) s.style.removeProperty(b);
62
+ };
63
+ }, [a, r]), r === void 0 ? null : /* @__PURE__ */ P("div", { className: i, "data-bi-theme": o.palette.mode, style: { ...a, height: "100%", ...e }, children: r });
64
+ }, "BiThemeBridge");
65
+ function M(r) {
66
+ const i = m(), e = u(() => d(i), [i]);
67
+ return p(() => {
68
+ const o = r ?? (typeof document < "u" ? document.documentElement : null);
69
+ if (o) {
70
+ for (const [a, s] of Object.entries(e)) o.style.setProperty(a, s);
71
+ return () => {
72
+ for (const a of Object.keys(e)) o.style.removeProperty(a);
73
+ };
74
+ }
75
+ }, [e, r]), e;
76
+ }
77
+ n(M, "useBiCssVars");
78
+ const S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
79
+ __proto__: null,
80
+ BiThemeBridge: B,
81
+ biDarkPalette: f,
82
+ biLightPalette: h,
83
+ biSeriesColor: g,
84
+ computeBiCssVars: d,
85
+ createBiTheme: v,
86
+ resolveBiPalette: c,
87
+ useBiCssVars: M,
88
+ useBiPalette: x,
89
+ withBiPalette: k
90
+ }, Symbol.toStringTag, { value: "Module" }));
91
+ export {
92
+ B,
93
+ S as T,
94
+ d as c,
95
+ M as u
96
+ };
97
+ //# sourceMappingURL=index-zN3LPF6u.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-zN3LPF6u.js","sources":["../src/theme/BiThemeBridge.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { alpha, useTheme } from '@mui/material/styles';\nimport type { Theme } from '@mui/material/styles';\nimport { resolveBiPalette } from './createBiTheme';\n\n/**\n * The CSS custom properties the package's stylesheets consume\n * (`GridLayout.css`, `inline.css`, `composer.css`). Every value is derived from the MUI theme —\n * the stylesheets themselves contain no colour.\n */\nexport function computeBiCssVars(theme: Theme): Record<string, string> {\n const bi = resolveBiPalette(theme);\n const p = theme.palette;\n const radius = typeof theme.shape.borderRadius === 'number' ? `${theme.shape.borderRadius}px` : String(theme.shape.borderRadius);\n return {\n '--bi-font-mono': theme.typography.fontFamilyMono ?? 'ui-monospace, SFMono-Regular, Menlo, monospace',\n '--bi-radius-lg': `${Math.round((typeof theme.shape.borderRadius === 'number' ? theme.shape.borderRadius : 4) * 1.5)}px`, // 12px com radius 8\n '--bi-bg': p.background.default,\n '--bi-card-bg': p.background.paper,\n '--bi-card-border': p.divider,\n '--bi-card-border-strong': alpha(p.text.primary, 0.28),\n '--bi-text-1': p.text.primary,\n '--bi-text-2': p.text.secondary,\n '--bi-text-disabled': p.text.disabled,\n '--bi-grid-line': alpha(p.text.primary, 0.12),\n '--bi-hover': p.action.hover,\n '--bi-selected': p.action.selected,\n '--bi-overlay': alpha(p.text.primary, 0.08),\n '--bi-surface-1': alpha(p.text.primary, 0.03),\n '--bi-surface-2': alpha(p.text.primary, 0.06),\n '--bi-accent': p.primary.main,\n '--bi-accent-soft': alpha(p.primary.main, 0.12),\n '--bi-accent-border': alpha(p.primary.main, 0.3),\n '--bi-positive': bi.positive,\n '--bi-positive-soft': alpha(bi.positive, 0.15),\n '--bi-negative': bi.negative,\n '--bi-negative-soft': alpha(bi.negative, 0.15),\n '--bi-neutral': bi.neutral,\n '--bi-neutral-soft': alpha(bi.neutral, 0.15),\n '--bi-error': p.error.main,\n '--bi-error-soft': alpha(p.error.main, 0.08),\n // ── Composer / sketch pad (`composer.css`) ──\n '--bi-secondary': p.secondary.main,\n '--bi-secondary-soft': alpha(p.secondary.main, 0.16),\n '--bi-sketch-dash': alpha(p.text.primary, 0.35),\n '--bi-sketch-dash-faint': alpha(p.text.primary, 0.12),\n '--bi-sketch-selection': alpha(p.primary.main, 0.12),\n '--bi-scrim': alpha(p.common.black, 0.4),\n '--bi-highlight-outline': p.secondary.main,\n '--bi-highlight-glow': alpha(p.secondary.main, 0.35),\n '--bi-shadow': theme.shadows[4],\n '--bi-shadow-strong': theme.shadows[8],\n '--bi-radius': radius,\n '--bi-radius-sm': `${Math.max(2, Math.round((typeof theme.shape.borderRadius === 'number' ? theme.shape.borderRadius : 4) / 2))}px`,\n '--bi-font-family': theme.typography.fontFamily ?? 'inherit',\n };\n}\n\nexport interface BiThemeBridgeProps {\n /**\n * With children: renders a wrapper `div` carrying the variables as inline\n * style, so the theme applies to that subtree only (several themes may\n * coexist on one page). Without children: writes the variables onto\n * `document.documentElement` on mount and updates them when the theme\n * changes.\n */\n children?: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n}\n\n/**\n * Publishes the theme-derived CSS custom properties the package stylesheets\n * read. Mount it once inside your `<ThemeProvider>` (either around the BI\n * surface, or childless at the app root).\n */\nexport const BiThemeBridge: React.FC<BiThemeBridgeProps> = ({ children, className, style }) => {\n const theme = useTheme();\n const vars = useMemo(() => computeBiCssVars(theme), [theme]);\n\n useEffect(() => {\n if (children !== undefined) return;\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);\n return () => {\n for (const k of Object.keys(vars)) root.style.removeProperty(k);\n };\n }, [vars, children]);\n\n if (children === undefined) return null;\n return (\n <div className={className} data-bi-theme={theme.palette.mode} style={{ ...(vars as React.CSSProperties), height: '100%', ...style }}>\n {children}\n </div>\n );\n};\n\n/**\n * Hook form of the bridge: applies the variables to `target` (default:\n * `document.documentElement`) for as long as the calling component is mounted.\n */\nexport function useBiCssVars(target?: HTMLElement | null): Record<string, string> {\n const theme = useTheme();\n const vars = useMemo(() => computeBiCssVars(theme), [theme]);\n useEffect(() => {\n const el = target ?? (typeof document !== 'undefined' ? document.documentElement : null);\n if (!el) return;\n for (const [k, v] of Object.entries(vars)) el.style.setProperty(k, v);\n return () => {\n for (const k of Object.keys(vars)) el.style.removeProperty(k);\n };\n }, [vars, target]);\n return vars;\n}\n\nexport default BiThemeBridge;\n"],"names":["computeBiCssVars","theme","bi","resolveBiPalette","p","radius","alpha","__name","BiThemeBridge","children","className","style","useTheme","vars","useMemo","useEffect","root","k","v","useBiCssVars","target","el"],"mappings":";;;;;;AAUO,SAASA,EAAiBC,GAAsC;AACnE,QAAMC,IAAKC,EAAiBF,CAAK,GAC3BG,IAAIH,EAAM,SACVI,IAAS,OAAOJ,EAAM,MAAM,gBAAiB,WAAW,GAAGA,EAAM,MAAM,YAAY,OAAO,OAAOA,EAAM,MAAM,YAAY;AAC/H,SAAO;AAAA,IACH,kBAAkBA,EAAM,WAAW,kBAAkB;AAAA,IACrD,kBAAkB,GAAG,KAAK,OAAO,OAAOA,EAAM,MAAM,gBAAiB,WAAWA,EAAM,MAAM,eAAe,KAAK,GAAG,CAAC;AAAA;AAAA,IACpH,WAAWG,EAAE,WAAW;AAAA,IACxB,gBAAgBA,EA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AAC3D,SAAAc,EAAU,MAAM;AACZ,UAAMM,IAAKD,MAAW,OAAO,WAAa,MAAc,SAAS,kBAAkB;AACnF,QAAKC,GACL;AAAA,iBAAW,CAACJ,GAAGC,CAAC,KAAK,OAAO,QAAQL,CAAI,EAAG,CAAAQ,EAAG,MAAM,YAAYJ,GAAGC,CAAC;AACpE,aAAO,MAAM;AACT,mBAAWD,KAAK,OAAO,KAAKJ,CAAI,EAAG,CAAAQ,EAAG,MAAM,eAAeJ,CAAC;AAAA,MAChE;AAAA;AAAA,EACJ,GAAG,CAACJ,GAAMO,CAAM,CAAC,GACVP;AACX;AAZgBN,EAAAY,GAAA;;;;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import { b as s, a as r, c as t, d as o, r as i, u as n, w as d } from "./createBiTheme-TyUv_UHM.js";
2
- import { B as C, c as u, u as m } from "./index-D7Oo_dC-.js";
2
+ import { B as C, c as u, u as m } from "./index-zN3LPF6u.js";
3
3
  import { B as c, b as E, c as S, d as D, u as T, a as P, e as h } from "./BiClientProvider-CWJochvi.js";
4
- import { D as f, c as I, a as B, b as R, d as b, e as g, f as A, g as L, h as x, i as v, j as G, k as O, l as M, m as V, p as F, t as N, n as y, o as k, q as z, r as H, s as U, u as w, v as Y, w as W, x as X } from "./dataUtils-CAUE5uZY.js";
5
- import { C as j, a as q, u as Z } from "./ChartCardDefaultsContext-BDRsVljO.js";
4
+ import { D as f, c as I, a as B, b as R, d as b, e as g, f as A, g as L, h as x, i as G, j as v, k as O, l as M, m as V, p as F, t as N, n as y, o as k, q as z, r as H, s as U, u as w, v as Y, w as W, x as X } from "./dataUtils-CAUE5uZY.js";
5
+ import { C as j, a as q, u as J } from "./ChartCardDefaultsContext-BDRsVljO.js";
6
6
  import { B as Q, C as $, a as aa, D as ea, G as sa, b as ra, c as ta, d as oa, e as ia, f as na, M as da, g as la, h as Ca, i as ua, j as ma, T as pa, k as ca, l as Ea, m as Sa, n as Da, u as Ta, w as Pa, o as ha } from "./index-9LcZjCK0.js";
7
7
  import { u as fa } from "./useContainerRectangle-D464wPFX.js";
8
- import { B as Ba, D as Ra, a as ba, b as ga, c as Aa, d as La, G as xa, e as va } from "./GridLayout-1gWuIKeZ.js";
8
+ import { B as Ba, D as Ra, a as ba, b as ga, c as Aa, d as La, G as xa, e as Ga } from "./GridLayout-BQcuPzng.js";
9
9
  import { G as Oa } from "./GridCardPlaceHolder-DVVT3pqn.js";
10
10
  import { C as Va, u as Fa } from "./ChartContext-C_f_6khG.js";
11
- import { t as ya, a as ka, b as za, u as Ha } from "./index-BzUugG0A.js";
12
- import { C as wa, I as Ya, M as Wa, a as Xa, p as Ka } from "./index-BYc79sSy.js";
13
- import { A as qa, D as Za, a as Ja, V as Qa, b as $a, c as ae, d as ee, g as se } from "./filterFactory-Ysv0FOQ2.js";
11
+ import { t as ya, a as ka, b as za, u as Ha } from "./index-D6-YxBjl.js";
12
+ import { C as wa, I as Ya, M as Wa, a as Xa, p as Ka } from "./index-ZBNoVc5M.js";
13
+ import { A as qa, D as Ja, a as Za, V as Qa, b as $a, c as ae, d as ee, g as se } from "./filterFactory-Ysv0FOQ2.js";
14
14
  import { V as te, a as oe, b as ie } from "./index-BRx4bRbe.js";
15
- import { B as de, c as le, n as Ce, r as ue, a as me } from "./version-BTc4ElDG.js";
16
- import { getBiModuleSurface as ce } from "./biModuleSurface-BdJK7sSL.js";
17
- import { C as Se, S as De, a as Te, c as Pe, e as he, g as _e, b as fe, h as Ie, i as Be, l as Re, r as be, s as ge, u as Ae } from "./ScriptDashboardViewerVertical-Rr_4adpH.js";
18
- import { C as xe, a as ve, b as Ge, c as Oe, d as Me, e as Ve, f as Fe, g as Ne, h as ye, i as ke, D as ze, j as He, k as Ue, l as we, m as Ye, n as We, o as Xe, p as Ke, q as je, E as qe, r as Ze, s as Je, t as Qe, u as $e, v as as, F as es, w as ss, x as rs, G as ts, y as os, H as is, P as ns, z as ds, A as ls, S as Cs, B as us, I as ms, J as ps, K as cs, L as Es, M as Ss, T as Ds, N as Ts, O as Ps, Q as hs, R as _s, V as fs, U as Is, W as Bs, X as Rs, Y as bs, Z as gs, _ as As, $ as Ls, a0 as xs, a1 as vs, a2 as Gs, a3 as Os, a4 as Ms, a5 as Vs, a6 as Fs, a7 as Ns, a8 as ys, a9 as ks, aa as zs, ab as Hs, ac as Us, ad as ws, ae as Ys, af as Ws, ag as Xs, ah as Ks, ai as js, aj as qs, ak as Zs, al as Js, am as Qs, an as $s, ao as ar, ap as er, aq as sr, ar as rr, as as tr, at as or, au as ir, av as nr, aw as dr, ax as lr, ay as Cr, az as ur, aA as mr, aB as pr, aC as cr, aD as Er, aE as Sr, aF as Dr } from "./index-C4_VSDeU.js";
19
- import { EnvironmentProvider as Pr, InertEnvironmentProvider as hr, useEnvironment as _r, useEnvironmentOptional as fr } from "@aintela/chat/components";
20
- import { u as Br, a as Rr } from "./index-D3OoOPjl.js";
21
- import { D as gr, a as Ar, u as Lr } from "./DashboardParametersContext-Clv--79U.js";
15
+ import { B as de, c as le, n as Ce, r as ue, a as me } from "./version-oYqU5xJk.js";
16
+ import { getBiModuleSurface as ce } from "./biModuleSurface-zEeRrln5.js";
17
+ import { C as Se, S as De, a as Te, c as Pe, e as he, g as _e, b as fe, h as Ie, i as Be, l as Re, r as be, s as ge, u as Ae } from "./ScriptDashboardViewerVertical-B8Y5LoE4.js";
18
+ import { C as xe, a as Ge, b as ve, c as Oe, d as Me, e as Ve, f as Fe, g as Ne, h as ye, i as ke, D as ze, j as He, k as Ue, l as we, m as Ye, n as We, o as Xe, p as Ke, q as je, E as qe, r as Je, s as Ze, t as Qe, u as $e, v as as, F as es, w as ss, x as rs, G as ts, y as os, H as is, P as ns, z as ds, A as ls, S as Cs, B as us, I as ms, J as ps, K as cs, L as Es, M as Ss, T as Ds, N as Ts, O as Ps, Q as hs, R as _s, V as fs, U as Is, W as Bs, X as Rs, Y as bs, Z as gs, _ as As, $ as Ls, a0 as xs, a1 as Gs, a2 as vs, a3 as Os, a4 as Ms, a5 as Vs, a6 as Fs, a7 as Ns, a8 as ys, a9 as ks, aa as zs, ab as Hs, ac as Us, ad as ws, ae as Ys, af as Ws, ag as Xs, ah as Ks, ai as js, aj as qs, ak as Js, al as Zs, am as Qs, an as $s, ao as ar, ap as er, aq as sr, ar as rr, as as tr, at as or, au as ir, av as nr, aw as dr, ax as lr, ay as Cr, az as ur, aA as mr, aB as pr, aC as cr, aD as Er, aE as Sr, aF as Dr, aG as Tr } from "./index-GTSBsgzP.js";
19
+ import { EnvironmentProvider as hr, InertEnvironmentProvider as _r, useEnvironment as fr, useEnvironmentOptional as Ir } from "@aintela/chat/components";
20
+ import { u as Rr, a as br } from "./index-D3OoOPjl.js";
21
+ import { D as Ar, a as Lr, u as xr } from "./DashboardParametersContext-Clv--79U.js";
22
22
  export {
23
23
  qa as AutoCompleteInstructions,
24
24
  Q as BASE_SCALE,
@@ -27,9 +27,9 @@ export {
27
27
  Ba as BiErrorBoundary,
28
28
  C as BiThemeBridge,
29
29
  xe as CARD_TYPE_CATALOG,
30
- ve as CATEGORY_ICONS,
30
+ Ge as CATEGORY_ICONS,
31
31
  Se as CATEGORY_PREFIXES,
32
- Ge as COLOR_MAP,
32
+ ve as COLOR_MAP,
33
33
  $ as CONTINENT_PATHS,
34
34
  Oe as CardScketch,
35
35
  Me as CardSketch,
@@ -53,20 +53,20 @@ export {
53
53
  Ue as DashboardPad,
54
54
  we as DashboardPadEditor,
55
55
  Ye as DashboardPadSketch,
56
- gr as DashboardParametersContext,
57
- Ar as DashboardParametersProvider,
56
+ Ar as DashboardParametersContext,
57
+ Lr as DashboardParametersProvider,
58
58
  We as DashboardPin,
59
59
  Xe as DashboardSidePanel,
60
60
  f as DataResult,
61
61
  ea as DataTableCard,
62
62
  Ke as DatasetParameterizationControls,
63
- Za as DateRangeFilterBeginSuffix,
64
- Ja as DateRangeFilterEndSuffix,
63
+ Ja as DateRangeFilterBeginSuffix,
64
+ Za as DateRangeFilterEndSuffix,
65
65
  je as DrawablePrompt,
66
66
  qe as ENV_HIGHLIGHT_CLASS,
67
- Ze as EntryEmptyState,
68
- Pr as EnvironmentProvider,
69
- Je as ExampleCardSkath,
67
+ Je as EntryEmptyState,
68
+ hr as EnvironmentProvider,
69
+ Ze as ExampleCardSkath,
70
70
  Qe as ExampleCardSketch,
71
71
  $e as ExampleCardSketh,
72
72
  as as ExamplePad,
@@ -83,10 +83,10 @@ export {
83
83
  na as GeoLayersProvider,
84
84
  xa as GridCard,
85
85
  Oa as GridCardPlaceHolder,
86
- va as GridLayout,
86
+ Ga as GridLayout,
87
87
  is as HoverButton,
88
88
  Ya as IFrame,
89
- hr as InertEnvironmentProvider,
89
+ _r as InertEnvironmentProvider,
90
90
  da as MAP_VIEWBOX,
91
91
  la as MapBubblesCard,
92
92
  Ca as MapConnectionsCard,
@@ -133,10 +133,10 @@ export {
133
133
  ca as brazilGeoLayers,
134
134
  xs as c,
135
135
  I as capitalize,
136
- vs as categoryPrefix,
136
+ Gs as categoryPrefix,
137
137
  Ea as chartShade,
138
138
  Pe as clearBundleCaches,
139
- Gs as composerLayoutTransition,
139
+ vs as composerLayoutTransition,
140
140
  Os as composerLayoutTransitionReduced,
141
141
  u as computeBiCssVars,
142
142
  B as computeDomain,
@@ -161,8 +161,8 @@ export {
161
161
  A as extractFieldTypeName,
162
162
  L as formatBoolean,
163
163
  x as formatCompact,
164
- v as formatCurrency,
165
- G as formatDate,
164
+ G as formatCurrency,
165
+ v as formatDate,
166
166
  O as formatISODate,
167
167
  M as formatNumber,
168
168
  V as formatPercent,
@@ -185,28 +185,29 @@ export {
185
185
  Ka as parseKnownNumbers,
186
186
  F as percentChange,
187
187
  qs as pickBestElement,
188
- Zs as randomId,
188
+ Js as randomId,
189
189
  ue as registerBiModules,
190
190
  me as resetBiModuleRegistration,
191
191
  i as resolveBiPalette,
192
192
  be as resolveCardMetadata,
193
- Js as resolveComposerSurfaces,
193
+ Zs as resolveComposerSurfaces,
194
194
  Qs as resolveEnvironmentElements,
195
195
  $s as resolveGuideElement,
196
196
  ar as sanitizeToJsVariable,
197
- er as seedFromTemplate,
197
+ er as sanitizeToJsxComponentName,
198
+ sr as seedFromTemplate,
198
199
  ge as seedHostModules,
199
- sr as sketchCardItemComparer,
200
- rr as sketchFilterComparer,
201
- tr as targetSuggestsPadInternal,
202
- or as templateKinds,
200
+ rr as sketchCardItemComparer,
201
+ tr as sketchFilterComparer,
202
+ or as targetSuggestsPadInternal,
203
+ ir as templateKinds,
203
204
  N as toBoolean,
204
205
  y as toDashResult,
205
206
  k as toDataResultFromList,
206
207
  z as toDate,
207
- ir as toDraftPayload,
208
+ nr as toDraftPayload,
208
209
  H as toNumber,
209
- nr as toSelectorList,
210
+ dr as toSelectorList,
210
211
  U as toStr,
211
212
  w as toTitleCase,
212
213
  ya as translateGridConfig,
@@ -215,32 +216,32 @@ export {
215
216
  Y as trendArrow,
216
217
  W as trendColor,
217
218
  X as truncateText,
218
- dr as upsertDashboardDraft,
219
+ lr as upsertDashboardDraft,
219
220
  T as useBiClient,
220
221
  P as useBiClientOptional,
221
222
  m as useBiCssVars,
222
223
  n as useBiPalette,
223
224
  h as useBiSessionId,
224
- lr as useCardTypeIcons,
225
- Z as useChartCardDefaults,
225
+ Cr as useCardTypeIcons,
226
+ J as useChartCardDefaults,
226
227
  Fa as useChartContext,
227
- Cr as useComposer,
228
- ur as useComposerChatBridge,
229
- mr as useComposerEnvironment,
230
- pr as useComposerStore,
231
- cr as useComposerStoreOptional,
228
+ ur as useComposer,
229
+ mr as useComposerChatBridge,
230
+ pr as useComposerEnvironment,
231
+ cr as useComposerStore,
232
+ Er as useComposerStoreOptional,
232
233
  fa as useContainerRectangle,
233
234
  Ae as useDashboardBundle,
234
- Br as useDashboardData,
235
- Rr as useDashboardLazyData,
236
- Er as useDashboardPad,
237
- Lr as useDashboardParameters,
238
- _r as useEnvironment,
239
- fr as useEnvironmentOptional,
235
+ Rr as useDashboardData,
236
+ br as useDashboardLazyData,
237
+ Sr as useDashboardPad,
238
+ xr as useDashboardParameters,
239
+ fr as useEnvironment,
240
+ Ir as useEnvironmentOptional,
240
241
  Ta as useGeoLayers,
241
242
  Ha as useGridConfigTranslator,
242
- Sr as useSessionVisualizations,
243
- Dr as validateSketch,
243
+ Dr as useSessionVisualizations,
244
+ Tr as validateSketch,
244
245
  Pa as warnIfMuiXLicenseMissing,
245
246
  d as withBiPalette,
246
247
  ha as worldGeoLayers
@@ -6,24 +6,15 @@ export interface ChartExpandInfo {
6
6
  reasoning?: string;
7
7
  }
8
8
  export interface ChartProps {
9
- /** Artifact file name as the tool returned it (e.g. `chart_1.png`). */
10
9
  src: string;
11
10
  name?: string;
12
11
  reasoning?: string;
13
12
  alt?: string;
14
- /** Just the image, no card chrome. */
15
13
  naked?: boolean;
16
- /** Artifact scope; defaults to the `BiClientProvider`'s `sessionId`. */
17
14
  sessionId?: string;
18
15
  dashboardId?: string;
19
16
  id?: string;
20
- /** Called from the expand affordance. When omitted the image opens in a new tab. */
21
17
  onExpand?: (info: ChartExpandInfo) => void;
22
18
  }
23
- /**
24
- * The explorer's chart card: a matplotlib PNG rendered server-side and served
25
- * as an artifact. The URL comes from the injected `BiClient`
26
- * (`client.artifactUrl(src, { sessionId, dashboardId })`).
27
- */
28
19
  export declare const Chart: React.FC<ChartProps>;
29
20
  export default Chart;
@@ -11,6 +11,4 @@ export interface MetricProps {
11
11
  icon?: string;
12
12
  partial?: boolean;
13
13
  }
14
- /** KPI tile used by `present_metric` / `present_metric_group`. */
15
14
  export declare const Metric: React.FC<MetricProps>;
16
- export default Metric;