@rock10/ui 1.0.17 → 1.0.19
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/charts.d.ts +1 -0
- package/dist/charts.es.js +433 -0
- package/dist/cn-D4DU2yxV.js +3818 -0
- package/dist/components/AppShell.d.ts +29 -0
- package/dist/components/Button.d.ts +9 -2
- package/dist/components/CopyButton.d.ts +14 -0
- package/dist/components/HighlightVideoCard.d.ts +23 -0
- package/dist/components/PageHeader.d.ts +6 -1
- package/dist/components/Pagination.d.ts +12 -0
- package/dist/components/PixPaymentModal.d.ts +17 -0
- package/dist/components/ReceiptModal.d.ts +20 -0
- package/dist/components/ShareLinkModal.d.ts +14 -0
- package/dist/components/StatCard.d.ts +7 -1
- package/dist/components/VideoPreviewModal.d.ts +30 -0
- package/dist/components/charts/TimelineDrilldownChart.d.ts +33 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.es.js +3518 -5138
- package/dist/style.css +1 -1
- package/dist/utils/cpfValidator.d.ts +6 -0
- package/dist/utils/image.d.ts +12 -0
- package/package.json +25 -12
- package/dist/index.umd.js +0 -175
package/dist/charts.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TimelineDrilldownChart, type TimelineDrilldownChartProps, type TimelineItem, type TimelineFetchParams, } from './components/charts/TimelineDrilldownChart';
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
import { c as u, j as e, C as G, a as _, b as O, E as U, D as X, H as J, S as Q, d as Z, e as ee } from "./cn-D4DU2yxV.js";
|
|
2
|
+
import { useState as s, useEffect as re, useMemo as ae } from "react";
|
|
3
|
+
import { ResponsiveContainer as te, LineChart as se, CartesianGrid as oe, XAxis as de, YAxis as le, Tooltip as ne, Line as L } from "recharts";
|
|
4
|
+
/**
|
|
5
|
+
* @license lucide-react v0.475.0 - ISC
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the ISC license.
|
|
8
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/
|
|
10
|
+
const ie = [
|
|
11
|
+
[
|
|
12
|
+
"path",
|
|
13
|
+
{
|
|
14
|
+
d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
|
|
15
|
+
key: "zw3jo"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
|
|
22
|
+
key: "1wduqc"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"path",
|
|
27
|
+
{
|
|
28
|
+
d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
|
|
29
|
+
key: "kqbvx6"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
], ce = u("Layers", ie);
|
|
33
|
+
/**
|
|
34
|
+
* @license lucide-react v0.475.0 - ISC
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the ISC license.
|
|
37
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/
|
|
39
|
+
const xe = [
|
|
40
|
+
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
41
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
42
|
+
], pe = u("RotateCcw", xe);
|
|
43
|
+
/**
|
|
44
|
+
* @license lucide-react v0.475.0 - ISC
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the ISC license.
|
|
47
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/
|
|
49
|
+
const me = [
|
|
50
|
+
["polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17", key: "126l90" }],
|
|
51
|
+
["polyline", { points: "16 7 22 7 22 13", key: "kwv8wd" }]
|
|
52
|
+
], ue = u("TrendingUp", me);
|
|
53
|
+
/**
|
|
54
|
+
* @license lucide-react v0.475.0 - ISC
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the ISC license.
|
|
57
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/
|
|
59
|
+
const he = [
|
|
60
|
+
[
|
|
61
|
+
"path",
|
|
62
|
+
{
|
|
63
|
+
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
64
|
+
key: "ftymec"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
|
|
68
|
+
], be = u("Video", he), v = [
|
|
69
|
+
{
|
|
70
|
+
key: "videos",
|
|
71
|
+
prevKey: "prev_videos",
|
|
72
|
+
name: "Vídeos",
|
|
73
|
+
color: "#8b5cf6",
|
|
74
|
+
// Violet
|
|
75
|
+
prevColor: "#c4b5fd",
|
|
76
|
+
icon: be
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "visualizacoes",
|
|
80
|
+
prevKey: "prev_visualizacoes",
|
|
81
|
+
name: "Visualizações",
|
|
82
|
+
color: "#3b82f6",
|
|
83
|
+
// Blue
|
|
84
|
+
prevColor: "#93c5fd",
|
|
85
|
+
icon: U
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: "downloads",
|
|
89
|
+
prevKey: "prev_downloads",
|
|
90
|
+
name: "Downloads",
|
|
91
|
+
color: "#f97316",
|
|
92
|
+
// Orange
|
|
93
|
+
prevColor: "#fdba74",
|
|
94
|
+
icon: X
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
key: "curtidas",
|
|
98
|
+
prevKey: "prev_curtidas",
|
|
99
|
+
name: "Curtidas",
|
|
100
|
+
color: "#ef4444",
|
|
101
|
+
// Red
|
|
102
|
+
prevColor: "#fca5a5",
|
|
103
|
+
icon: J
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "compartilhamentos",
|
|
107
|
+
prevKey: "prev_compartilhamentos",
|
|
108
|
+
name: "Compartilhamentos",
|
|
109
|
+
color: "#10b981",
|
|
110
|
+
// Emerald
|
|
111
|
+
prevColor: "#6ee7b7",
|
|
112
|
+
icon: Q
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
function ve({
|
|
116
|
+
title: D = "Evolução Temporal & Métricas de Engajamento",
|
|
117
|
+
titleSuffix: f,
|
|
118
|
+
onFetchData: M,
|
|
119
|
+
initialYear: z,
|
|
120
|
+
className: S
|
|
121
|
+
}) {
|
|
122
|
+
const l = z ?? (/* @__PURE__ */ new Date()).getFullYear(), [t, p] = s("months"), [i, T] = s(l), [c, $] = s(l - 1), [h, j] = s(null), [K, w] = s(""), [b, y] = s(null), [V, k] = s(""), [n, q] = s([]), [E, N] = s(!0), [x, A] = s(!0), [g, R] = s({
|
|
123
|
+
videos: !0,
|
|
124
|
+
visualizacoes: !0,
|
|
125
|
+
downloads: !0,
|
|
126
|
+
curtidas: !0,
|
|
127
|
+
compartilhamentos: !0
|
|
128
|
+
}), I = (r) => {
|
|
129
|
+
R((a) => {
|
|
130
|
+
const o = Object.values(a).filter(Boolean).length;
|
|
131
|
+
return a[r] && o === 1 ? a : { ...a, [r]: !a[r] };
|
|
132
|
+
});
|
|
133
|
+
}, W = async () => {
|
|
134
|
+
try {
|
|
135
|
+
N(!0);
|
|
136
|
+
const r = await M({
|
|
137
|
+
year: i,
|
|
138
|
+
compare_year: x ? c : void 0,
|
|
139
|
+
month: h ?? void 0,
|
|
140
|
+
day: b ?? void 0
|
|
141
|
+
});
|
|
142
|
+
q(r || []);
|
|
143
|
+
} catch (r) {
|
|
144
|
+
console.error("Erro ao carregar dados do gráfico drilldown:", r);
|
|
145
|
+
} finally {
|
|
146
|
+
N(!1);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
re(() => {
|
|
150
|
+
W();
|
|
151
|
+
}, [i, c, h, b, x]);
|
|
152
|
+
const Y = (r) => {
|
|
153
|
+
if (!r) return;
|
|
154
|
+
let a;
|
|
155
|
+
r.activePayload && r.activePayload.length > 0 ? a = r.activePayload[0].payload : r.activeTooltipIndex !== void 0 && n[r.activeTooltipIndex] ? a = n[r.activeTooltipIndex] : r.activeLabel !== void 0 ? a = n.find((o) => String(o.label) === String(r.activeLabel)) : r.payload && (a = r.payload), a && (t === "months" ? (j(a.key ?? a.month ?? null), w(a.label), p("days")) : t === "days" && (y(a.key ?? a.day ?? null), k(a.label), p("hours")));
|
|
156
|
+
}, m = () => {
|
|
157
|
+
j(null), w(""), y(null), k(""), p("months");
|
|
158
|
+
}, C = () => {
|
|
159
|
+
y(null), k(""), p("days");
|
|
160
|
+
}, P = ae(() => n.reduce(
|
|
161
|
+
(r, a) => ({
|
|
162
|
+
videos: r.videos + (a.videos || 0),
|
|
163
|
+
visualizacoes: r.visualizacoes + (a.visualizacoes || 0),
|
|
164
|
+
downloads: r.downloads + (a.downloads || 0),
|
|
165
|
+
curtidas: r.curtidas + (a.curtidas || 0),
|
|
166
|
+
compartilhamentos: r.compartilhamentos + (a.compartilhamentos || 0),
|
|
167
|
+
prev_videos: r.prev_videos + (a.prev_videos || 0),
|
|
168
|
+
prev_visualizacoes: r.prev_visualizacoes + (a.prev_visualizacoes || 0),
|
|
169
|
+
prev_downloads: r.prev_downloads + (a.prev_downloads || 0),
|
|
170
|
+
prev_curtidas: r.prev_curtidas + (a.prev_curtidas || 0),
|
|
171
|
+
prev_compartilhamentos: r.prev_compartilhamentos + (a.prev_compartilhamentos || 0)
|
|
172
|
+
}),
|
|
173
|
+
{
|
|
174
|
+
videos: 0,
|
|
175
|
+
visualizacoes: 0,
|
|
176
|
+
downloads: 0,
|
|
177
|
+
curtidas: 0,
|
|
178
|
+
compartilhamentos: 0,
|
|
179
|
+
prev_videos: 0,
|
|
180
|
+
prev_visualizacoes: 0,
|
|
181
|
+
prev_downloads: 0,
|
|
182
|
+
prev_curtidas: 0,
|
|
183
|
+
prev_compartilhamentos: 0
|
|
184
|
+
}
|
|
185
|
+
), [n]), B = ({ active: r, payload: a, label: o }) => r && a && a.length ? /* @__PURE__ */ e.jsxs("div", { className: "bg-white/95 dark:bg-dark-surface/95 backdrop-blur-md p-3.5 rounded-xl border border-gray-200 dark:border-dark-border shadow-xl min-w-[200px] pointer-events-none select-none", children: [
|
|
186
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between pb-2 mb-2 border-b border-gray-100 dark:border-dark-border/60", children: [
|
|
187
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-xs font-black uppercase text-gray-700 dark:text-dark-text tracking-wide", children: [
|
|
188
|
+
t === "months" && `Mês: ${o}`,
|
|
189
|
+
t === "days" && `Dia: ${o}`,
|
|
190
|
+
t === "hours" && `Horário: ${o}`
|
|
191
|
+
] }),
|
|
192
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[10px] text-gray-400 font-semibold uppercase", children: i })
|
|
193
|
+
] }),
|
|
194
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-1.5", children: a.map((d, H) => {
|
|
195
|
+
const F = d.dataKey.startsWith("prev_");
|
|
196
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-4 text-xs font-semibold", children: [
|
|
197
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-1.5", style: { color: d.color }, children: [
|
|
198
|
+
/* @__PURE__ */ e.jsx("span", { className: "w-2 h-2 rounded-full inline-block", style: { backgroundColor: d.color } }),
|
|
199
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-gray-600 dark:text-dark-text-muted", children: [
|
|
200
|
+
d.name,
|
|
201
|
+
" ",
|
|
202
|
+
F ? `(${c})` : ""
|
|
203
|
+
] })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-bold text-gray-900 dark:text-dark-text", children: Number(d.value).toLocaleString("pt-BR") })
|
|
206
|
+
] }, H);
|
|
207
|
+
}) }),
|
|
208
|
+
t !== "hours" && /* @__PURE__ */ e.jsxs("div", { className: "mt-2.5 pt-2 border-t border-dashed border-gray-200 dark:border-dark-border/40 text-[10px] text-primary-600 dark:text-primary-400 font-medium text-center", children: [
|
|
209
|
+
"💡 Clique para detalhar ",
|
|
210
|
+
t === "months" ? "os dias do mês" : "as horas do dia"
|
|
211
|
+
] })
|
|
212
|
+
] }) : null;
|
|
213
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ee("bg-white dark:bg-dark-surface p-6 rounded-2xl border border-gray-200 dark:border-dark-border shadow-sm space-y-5", S), children: [
|
|
214
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col lg:flex-row lg:items-center justify-between gap-4", children: [
|
|
215
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
216
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
217
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-1.5 rounded-lg bg-primary-100 dark:bg-primary-900/40 text-primary-600 dark:text-primary-400", children: /* @__PURE__ */ e.jsx(ue, { className: "w-5 h-5" }) }),
|
|
218
|
+
/* @__PURE__ */ e.jsxs("h2", { className: "text-lg font-bold text-gray-900 dark:text-dark-text", children: [
|
|
219
|
+
D,
|
|
220
|
+
" ",
|
|
221
|
+
f ? `— ${f}` : ""
|
|
222
|
+
] })
|
|
223
|
+
] }),
|
|
224
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap gap-1.5 text-xs font-semibold text-gray-500 dark:text-dark-text-muted mt-2", children: [
|
|
225
|
+
/* @__PURE__ */ e.jsxs(
|
|
226
|
+
"button",
|
|
227
|
+
{
|
|
228
|
+
type: "button",
|
|
229
|
+
onClick: m,
|
|
230
|
+
className: `flex items-center gap-1 px-2.5 py-1 rounded-lg transition-colors cursor-pointer ${t === "months" ? "bg-primary-50 dark:bg-primary-950/40 text-primary-600 dark:text-primary-400 font-bold" : "hover:bg-gray-100 dark:hover:bg-dark-surface-light text-gray-600 dark:text-dark-text"}`,
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ e.jsx(G, { className: "w-3.5 h-3.5" }),
|
|
233
|
+
"Ano ",
|
|
234
|
+
i,
|
|
235
|
+
" (Meses)"
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
h !== null && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
240
|
+
/* @__PURE__ */ e.jsx(_, { className: "w-3.5 h-3.5 text-gray-400" }),
|
|
241
|
+
/* @__PURE__ */ e.jsxs(
|
|
242
|
+
"button",
|
|
243
|
+
{
|
|
244
|
+
type: "button",
|
|
245
|
+
onClick: C,
|
|
246
|
+
className: `flex items-center gap-1 px-2.5 py-1 rounded-lg transition-colors cursor-pointer ${t === "days" ? "bg-primary-50 dark:bg-primary-950/40 text-primary-600 dark:text-primary-400 font-bold" : "hover:bg-gray-100 dark:hover:bg-dark-surface-light text-gray-600 dark:text-dark-text"}`,
|
|
247
|
+
children: [
|
|
248
|
+
"Mês ",
|
|
249
|
+
K,
|
|
250
|
+
" (Dias)"
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
] }),
|
|
255
|
+
b !== null && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
256
|
+
/* @__PURE__ */ e.jsx(_, { className: "w-3.5 h-3.5 text-gray-400" }),
|
|
257
|
+
/* @__PURE__ */ e.jsxs("span", { className: "flex items-center gap-1 px-2.5 py-1 rounded-lg bg-primary-50 dark:bg-primary-950/40 text-primary-600 dark:text-primary-400 font-bold", children: [
|
|
258
|
+
"Dia ",
|
|
259
|
+
V,
|
|
260
|
+
" (24 Horas)"
|
|
261
|
+
] })
|
|
262
|
+
] }),
|
|
263
|
+
t !== "months" && /* @__PURE__ */ e.jsxs(
|
|
264
|
+
"button",
|
|
265
|
+
{
|
|
266
|
+
type: "button",
|
|
267
|
+
onClick: t === "hours" ? C : m,
|
|
268
|
+
className: "ml-2 flex items-center gap-1 text-[11px] font-bold text-gray-500 hover:text-gray-800 dark:hover:text-dark-text bg-gray-100 dark:bg-dark-surface-light px-2 py-0.5 rounded-md cursor-pointer transition-colors",
|
|
269
|
+
title: "Voltar ao nível anterior",
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ e.jsx(O, { className: "w-3.5 h-3.5" }),
|
|
272
|
+
"Voltar"
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
] })
|
|
277
|
+
] }),
|
|
278
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center flex-wrap gap-2", children: [
|
|
279
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
280
|
+
/* @__PURE__ */ e.jsx("label", { className: "text-xs font-bold text-gray-500 dark:text-dark-text-muted", children: "Ano:" }),
|
|
281
|
+
/* @__PURE__ */ e.jsx(
|
|
282
|
+
"select",
|
|
283
|
+
{
|
|
284
|
+
value: i,
|
|
285
|
+
onChange: (r) => {
|
|
286
|
+
const a = Number(r.target.value);
|
|
287
|
+
T(a), $(a - 1), m();
|
|
288
|
+
},
|
|
289
|
+
className: "h-9 px-3 bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border rounded-xl text-xs font-bold text-gray-800 dark:text-dark-text focus:outline-none focus:ring-2 focus:ring-primary-500/20 cursor-pointer",
|
|
290
|
+
children: [l, l - 1, l - 2, l - 3].map((r) => /* @__PURE__ */ e.jsx("option", { value: r, children: r }, r))
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] }),
|
|
294
|
+
t === "months" && /* @__PURE__ */ e.jsxs(
|
|
295
|
+
"button",
|
|
296
|
+
{
|
|
297
|
+
type: "button",
|
|
298
|
+
onClick: () => A(!x),
|
|
299
|
+
className: `h-9 px-3 rounded-xl text-xs font-bold border transition-colors flex items-center gap-1.5 cursor-pointer ${x ? "bg-primary-50 dark:bg-primary-950/40 border-primary-300 dark:border-primary-800/40 text-primary-600 dark:text-primary-400" : "bg-white dark:bg-dark-surface border-gray-200 dark:border-dark-border text-gray-600 dark:text-dark-text hover:bg-gray-50"}`,
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ e.jsx(ce, { className: "w-3.5 h-3.5" }),
|
|
302
|
+
"Comparar ",
|
|
303
|
+
c
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
t !== "months" && /* @__PURE__ */ e.jsxs(
|
|
308
|
+
"button",
|
|
309
|
+
{
|
|
310
|
+
type: "button",
|
|
311
|
+
onClick: m,
|
|
312
|
+
className: "h-9 px-3 rounded-xl text-xs font-bold border border-gray-200 dark:border-dark-border text-gray-700 dark:text-dark-text hover:bg-gray-50 dark:hover:bg-dark-surface-light transition-colors flex items-center gap-1.5 cursor-pointer",
|
|
313
|
+
children: [
|
|
314
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-3.5 h-3.5" }),
|
|
315
|
+
"Ver Ano Completo"
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
)
|
|
319
|
+
] })
|
|
320
|
+
] }),
|
|
321
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-wrap items-center gap-2 pt-2 border-t border-gray-100 dark:border-dark-border/40", children: [
|
|
322
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-bold text-gray-400 dark:text-dark-text-muted uppercase tracking-wider mr-1", children: "Métricas:" }),
|
|
323
|
+
v.map((r) => {
|
|
324
|
+
const a = g[r.key], o = r.icon, d = P[r.key] || 0;
|
|
325
|
+
return /* @__PURE__ */ e.jsxs(
|
|
326
|
+
"button",
|
|
327
|
+
{
|
|
328
|
+
type: "button",
|
|
329
|
+
onClick: () => I(r.key),
|
|
330
|
+
className: `flex items-center gap-2 px-3 py-1.5 rounded-xl text-xs font-bold border transition-all cursor-pointer ${a ? "bg-white dark:bg-dark-surface shadow-xs text-gray-900 dark:text-dark-text" : "opacity-40 bg-gray-50 dark:bg-dark-bg text-gray-400 border-dashed border-gray-300"}`,
|
|
331
|
+
style: {
|
|
332
|
+
borderColor: a ? r.color : void 0
|
|
333
|
+
},
|
|
334
|
+
children: [
|
|
335
|
+
/* @__PURE__ */ e.jsx(
|
|
336
|
+
"span",
|
|
337
|
+
{
|
|
338
|
+
className: "w-2.5 h-2.5 rounded-full inline-block",
|
|
339
|
+
style: { backgroundColor: a ? r.color : "#9ca3af" }
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
/* @__PURE__ */ e.jsx(o, { className: "w-3.5 h-3.5", style: { color: a ? r.color : "#9ca3af" } }),
|
|
343
|
+
/* @__PURE__ */ e.jsx("span", { children: r.name }),
|
|
344
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[11px] font-black text-gray-500 dark:text-dark-text-muted bg-gray-100 dark:bg-dark-surface-light px-1.5 py-0.5 rounded-md", children: d.toLocaleString("pt-BR") })
|
|
345
|
+
]
|
|
346
|
+
},
|
|
347
|
+
r.key
|
|
348
|
+
);
|
|
349
|
+
})
|
|
350
|
+
] }),
|
|
351
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative w-full h-80 pt-2", children: [
|
|
352
|
+
E ? /* @__PURE__ */ e.jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center bg-white/70 dark:bg-dark-surface/70 backdrop-blur-xs z-10", children: [
|
|
353
|
+
/* @__PURE__ */ e.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500" }),
|
|
354
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-xs font-bold text-gray-500 dark:text-dark-text-muted mt-2", children: "Processando camadas de métricas..." })
|
|
355
|
+
] }) : null,
|
|
356
|
+
/* @__PURE__ */ e.jsx(te, { width: "100%", height: "100%", children: /* @__PURE__ */ e.jsxs(
|
|
357
|
+
se,
|
|
358
|
+
{
|
|
359
|
+
data: n,
|
|
360
|
+
onClick: Y,
|
|
361
|
+
margin: { top: 10, right: 20, left: 0, bottom: 5 },
|
|
362
|
+
style: { cursor: t !== "hours" ? "pointer" : "default" },
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ e.jsx(oe, { strokeDasharray: "3 3", stroke: "#e5e7eb", opacity: 0.5 }),
|
|
365
|
+
/* @__PURE__ */ e.jsx(
|
|
366
|
+
de,
|
|
367
|
+
{
|
|
368
|
+
dataKey: "label",
|
|
369
|
+
tick: { fontSize: 11, fill: "#6b7280", fontWeight: 600 },
|
|
370
|
+
tickLine: !1,
|
|
371
|
+
axisLine: { stroke: "#e5e7eb" }
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ e.jsx(
|
|
375
|
+
le,
|
|
376
|
+
{
|
|
377
|
+
tick: { fontSize: 11, fill: "#6b7280", fontWeight: 600 },
|
|
378
|
+
tickLine: !1,
|
|
379
|
+
axisLine: { stroke: "#e5e7eb" },
|
|
380
|
+
allowDecimals: !1
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ e.jsx(ne, { content: /* @__PURE__ */ e.jsx(B, {}), wrapperStyle: { pointerEvents: "none" } }),
|
|
384
|
+
v.map((r) => g[r.key] ? /* @__PURE__ */ e.jsx(
|
|
385
|
+
L,
|
|
386
|
+
{
|
|
387
|
+
type: "monotone",
|
|
388
|
+
dataKey: r.key,
|
|
389
|
+
name: r.name,
|
|
390
|
+
stroke: r.color,
|
|
391
|
+
strokeWidth: 2.5,
|
|
392
|
+
dot: { r: 3, fill: r.color, strokeWidth: 1 },
|
|
393
|
+
activeDot: { r: 6, fill: r.color, stroke: "#fff", strokeWidth: 2, cursor: "pointer" }
|
|
394
|
+
},
|
|
395
|
+
r.key
|
|
396
|
+
) : null),
|
|
397
|
+
t === "months" && x && v.map((r) => g[r.key] ? /* @__PURE__ */ e.jsx(
|
|
398
|
+
L,
|
|
399
|
+
{
|
|
400
|
+
type: "monotone",
|
|
401
|
+
dataKey: r.prevKey,
|
|
402
|
+
name: `${r.name} (${c})`,
|
|
403
|
+
stroke: r.prevColor,
|
|
404
|
+
strokeDasharray: "4 4",
|
|
405
|
+
strokeWidth: 2,
|
|
406
|
+
dot: { r: 2, fill: r.prevColor },
|
|
407
|
+
activeDot: { r: 5, fill: r.prevColor }
|
|
408
|
+
},
|
|
409
|
+
r.prevKey
|
|
410
|
+
) : null)
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
) })
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between pt-3 border-t border-gray-100 dark:border-dark-border/40 text-xs text-gray-500 dark:text-dark-text-muted", children: [
|
|
416
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
417
|
+
/* @__PURE__ */ e.jsx(Z, { className: "w-3.5 h-3.5 text-primary-500" }),
|
|
418
|
+
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
419
|
+
t === "months" && "💡 Dica: Clique em qualquer mês para abrir a visão diária.",
|
|
420
|
+
t === "days" && "💡 Dica: Clique em qualquer dia para analisar a distribuição por hora.",
|
|
421
|
+
t === "hours" && "Visão detalhada por hora (00h às 23h)."
|
|
422
|
+
] })
|
|
423
|
+
] }),
|
|
424
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-semibold text-gray-400 dark:text-dark-text-muted", children: [
|
|
425
|
+
"Camada ativa: ",
|
|
426
|
+
/* @__PURE__ */ e.jsx("strong", { className: "text-gray-700 dark:text-dark-text uppercase", children: t === "months" ? "1. Meses" : t === "days" ? "2. Dias" : "3. Horas" })
|
|
427
|
+
] })
|
|
428
|
+
] })
|
|
429
|
+
] });
|
|
430
|
+
}
|
|
431
|
+
export {
|
|
432
|
+
ve as TimelineDrilldownChart
|
|
433
|
+
};
|