@vector-business-services/cristal-ds-web 0.11.0 → 0.13.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/dist/index.cjs +368 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +139 -39
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +101 -26
- package/dist/index.d.ts +101 -26
- package/dist/index.js +370 -68
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -8,6 +8,8 @@ var autocomplete = require('primereact/autocomplete');
|
|
|
8
8
|
var badge = require('primereact/badge');
|
|
9
9
|
var button = require('primereact/button');
|
|
10
10
|
var card = require('primereact/card');
|
|
11
|
+
var chart = require('primereact/chart');
|
|
12
|
+
var tooltip = require('primereact/tooltip');
|
|
11
13
|
var checkbox = require('primereact/checkbox');
|
|
12
14
|
var chip = require('primereact/chip');
|
|
13
15
|
var divider = require('primereact/divider');
|
|
@@ -17,7 +19,6 @@ var api = require('primereact/api');
|
|
|
17
19
|
var menu = require('primereact/menu');
|
|
18
20
|
var menubar = require('primereact/menubar');
|
|
19
21
|
var avatar = require('primereact/avatar');
|
|
20
|
-
var tooltip = require('primereact/tooltip');
|
|
21
22
|
var tag = require('primereact/tag');
|
|
22
23
|
var message = require('primereact/message');
|
|
23
24
|
var dialog = require('primereact/dialog');
|
|
@@ -210,6 +211,319 @@ var Card = react.forwardRef(function Card2({ padding = "xsmall", outline = false
|
|
|
210
211
|
}
|
|
211
212
|
);
|
|
212
213
|
});
|
|
214
|
+
var usandoTeclado = false;
|
|
215
|
+
if (typeof document !== "undefined") {
|
|
216
|
+
document.addEventListener("keydown", () => usandoTeclado = true, true);
|
|
217
|
+
document.addEventListener("pointerdown", () => usandoTeclado = false, true);
|
|
218
|
+
}
|
|
219
|
+
var resolveTargets = (target) => {
|
|
220
|
+
if (typeof target === "string") return Array.from(document.querySelectorAll(target));
|
|
221
|
+
if (target instanceof HTMLElement) return [target];
|
|
222
|
+
return target.current ? [target.current] : [];
|
|
223
|
+
};
|
|
224
|
+
function Tooltip({
|
|
225
|
+
target,
|
|
226
|
+
content,
|
|
227
|
+
type = "plain",
|
|
228
|
+
position = "bottom",
|
|
229
|
+
event = "both",
|
|
230
|
+
showDelay,
|
|
231
|
+
hideDelay,
|
|
232
|
+
disabled,
|
|
233
|
+
describe = true,
|
|
234
|
+
id,
|
|
235
|
+
className
|
|
236
|
+
}) {
|
|
237
|
+
const autoId = react.useId();
|
|
238
|
+
const tooltipId = id ?? autoId;
|
|
239
|
+
react.useEffect(() => {
|
|
240
|
+
if (!describe) return;
|
|
241
|
+
const elements = resolveTargets(target);
|
|
242
|
+
elements.forEach((element) => element.setAttribute("aria-describedby", tooltipId));
|
|
243
|
+
return () => elements.forEach((element) => element.removeAttribute("aria-describedby"));
|
|
244
|
+
}, [target, tooltipId, describe]);
|
|
245
|
+
const classes = ["cr-tooltip", `cr-tooltip--${type}`, className].filter(Boolean).join(" ");
|
|
246
|
+
const pt = {
|
|
247
|
+
root: (options) => {
|
|
248
|
+
const side = options?.state?.position ?? position;
|
|
249
|
+
return { className: `${classes} cr-tooltip--${side}`, "aria-hidden": false };
|
|
250
|
+
},
|
|
251
|
+
arrow: { className: "cr-tooltip__arrow" },
|
|
252
|
+
text: { className: "cr-tooltip__text" }
|
|
253
|
+
};
|
|
254
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
255
|
+
tooltip.Tooltip,
|
|
256
|
+
{
|
|
257
|
+
unstyled: true,
|
|
258
|
+
id: tooltipId,
|
|
259
|
+
target,
|
|
260
|
+
position,
|
|
261
|
+
event,
|
|
262
|
+
showDelay,
|
|
263
|
+
hideDelay,
|
|
264
|
+
disabled,
|
|
265
|
+
onBeforeShow: (e) => e.originalEvent?.type !== "focus" || usandoTeclado,
|
|
266
|
+
pt,
|
|
267
|
+
children: content
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
var CORES = ["primary", "secondary", "tertiary", "quaternary"];
|
|
272
|
+
var corDe = (serie, indice) => serie.color ?? CORES[indice % CORES.length];
|
|
273
|
+
var tomDe = (serie, tipo) => serie.tone ?? (tipo === "bar" ? 500 : 600);
|
|
274
|
+
var lerTema = (el) => {
|
|
275
|
+
const css = getComputedStyle(el);
|
|
276
|
+
const v = (nome) => css.getPropertyValue(nome).trim();
|
|
277
|
+
const px = (nome) => parseFloat(v(nome));
|
|
278
|
+
return {
|
|
279
|
+
cor: (cor, tom) => v(`--cr-color-chart-fill-${cor}-${tom}`),
|
|
280
|
+
grade: v("--cr-color-chart-tertiary"),
|
|
281
|
+
texto: v("--cr-color-chart-secondary"),
|
|
282
|
+
cruz: v("--cr-color-stroke-neutral-bold"),
|
|
283
|
+
superficie: v("--cr-color-fill-neutral-container"),
|
|
284
|
+
tooltipFundo: v("--cr-color-fill-neutral-boldest"),
|
|
285
|
+
tooltipTexto: v("--cr-color-text-inverse-base"),
|
|
286
|
+
fonte: {
|
|
287
|
+
family: v("--cr-typography-label-small-10-semibold-font-family"),
|
|
288
|
+
size: px("--cr-typography-label-small-10-semibold-font-size"),
|
|
289
|
+
weight: Number(v("--cr-typography-label-small-10-semibold-font-weight")),
|
|
290
|
+
lineHeight: px("--cr-typography-label-small-10-semibold-line-height") / px("--cr-typography-label-small-10-semibold-font-size")
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
var comAlfa = (hex, alfa) => {
|
|
295
|
+
const n = parseInt(hex.replace("#", ""), 16);
|
|
296
|
+
return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alfa})`;
|
|
297
|
+
};
|
|
298
|
+
var cruz = (cor) => ({
|
|
299
|
+
id: "crCruz",
|
|
300
|
+
afterDatasetsDraw(chart) {
|
|
301
|
+
const ativo = chart.tooltip?.getActiveElements()[0];
|
|
302
|
+
if (!ativo) return;
|
|
303
|
+
const { ctx, chartArea } = chart;
|
|
304
|
+
ctx.save();
|
|
305
|
+
ctx.strokeStyle = cor;
|
|
306
|
+
ctx.lineWidth = 1;
|
|
307
|
+
ctx.beginPath();
|
|
308
|
+
ctx.moveTo(ativo.element.x, chartArea.top);
|
|
309
|
+
ctx.lineTo(ativo.element.x, chartArea.bottom);
|
|
310
|
+
ctx.stroke();
|
|
311
|
+
ctx.restore();
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
var curvaDoFigma = {
|
|
315
|
+
id: "crCurva",
|
|
316
|
+
beforeDatasetsDraw(chart) {
|
|
317
|
+
chart.data.datasets.forEach((_, indice) => {
|
|
318
|
+
const meta = chart.getDatasetMeta(indice);
|
|
319
|
+
const pontos = meta.data;
|
|
320
|
+
pontos.forEach((ponto, i) => {
|
|
321
|
+
const antes = pontos[i - 1];
|
|
322
|
+
const depois = pontos[i + 1];
|
|
323
|
+
ponto.cp1x = antes ? (antes.x + ponto.x) / 2 : ponto.x;
|
|
324
|
+
ponto.cp2x = depois ? (ponto.x + depois.x) / 2 : ponto.x;
|
|
325
|
+
ponto.cp1y = ponto.y;
|
|
326
|
+
ponto.cp2y = ponto.y;
|
|
327
|
+
});
|
|
328
|
+
if (meta.dataset)
|
|
329
|
+
meta.dataset._pointsUpdated = true;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
var formatar = (eixo, valor) => eixo?.format ? eixo.format(valor) : String(valor);
|
|
334
|
+
function Chart({
|
|
335
|
+
type = "line",
|
|
336
|
+
stacked = false,
|
|
337
|
+
labels,
|
|
338
|
+
series,
|
|
339
|
+
yAxis,
|
|
340
|
+
y2Axis,
|
|
341
|
+
title,
|
|
342
|
+
help,
|
|
343
|
+
helpLabel = "Ajuda",
|
|
344
|
+
actions,
|
|
345
|
+
height = 266,
|
|
346
|
+
id,
|
|
347
|
+
className
|
|
348
|
+
}) {
|
|
349
|
+
const raiz = react.useRef(null);
|
|
350
|
+
const ajuda = react.useRef(null);
|
|
351
|
+
const [tema, setTema] = react.useState();
|
|
352
|
+
react.useLayoutEffect(() => {
|
|
353
|
+
if (raiz.current) setTema(lerTema(raiz.current));
|
|
354
|
+
}, []);
|
|
355
|
+
const temDireita = series.some((s) => s.axis === "right");
|
|
356
|
+
const data = react.useMemo(() => {
|
|
357
|
+
if (!tema) return void 0;
|
|
358
|
+
return {
|
|
359
|
+
labels,
|
|
360
|
+
datasets: series.map((s, i) => {
|
|
361
|
+
const cor = tema.cor(corDe(s, i), tomDe(s, type));
|
|
362
|
+
if (type === "bar") {
|
|
363
|
+
const topo = !stacked || i === series.length - 1;
|
|
364
|
+
return {
|
|
365
|
+
type: "bar",
|
|
366
|
+
label: s.label,
|
|
367
|
+
data: s.data,
|
|
368
|
+
yAxisID: s.axis === "right" ? "y2" : "y",
|
|
369
|
+
backgroundColor: cor,
|
|
370
|
+
hoverBackgroundColor: cor,
|
|
371
|
+
barThickness: 10,
|
|
372
|
+
borderSkipped: false,
|
|
373
|
+
borderRadius: topo ? { topLeft: 2, topRight: 2, bottomLeft: 0, bottomRight: 0 } : 0
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
type: "line",
|
|
378
|
+
label: s.label,
|
|
379
|
+
data: s.data,
|
|
380
|
+
yAxisID: s.axis === "right" ? "y2" : "y",
|
|
381
|
+
borderColor: cor,
|
|
382
|
+
borderWidth: 2,
|
|
383
|
+
tension: 0.4,
|
|
384
|
+
pointRadius: 0,
|
|
385
|
+
pointHoverRadius: 4,
|
|
386
|
+
pointHoverBorderWidth: 2,
|
|
387
|
+
pointHoverBorderColor: tema.superficie,
|
|
388
|
+
pointHoverBackgroundColor: cor,
|
|
389
|
+
fill: "origin",
|
|
390
|
+
backgroundColor: (ctx) => {
|
|
391
|
+
const area = ctx.chart.chartArea;
|
|
392
|
+
if (!area) return comAlfa(cor, 0.1);
|
|
393
|
+
const degrade = ctx.chart.ctx.createLinearGradient(0, area.top, 0, area.bottom);
|
|
394
|
+
degrade.addColorStop(0, comAlfa(cor, 0.1));
|
|
395
|
+
degrade.addColorStop(1, comAlfa(cor, 0.02));
|
|
396
|
+
return degrade;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
})
|
|
400
|
+
};
|
|
401
|
+
}, [tema, labels, series, type, stacked]);
|
|
402
|
+
const options = react.useMemo(() => {
|
|
403
|
+
if (!tema) return void 0;
|
|
404
|
+
const fonte = { ...tema.fonte, weight: tema.fonte.weight };
|
|
405
|
+
const eixoY = (eixo, direita) => ({
|
|
406
|
+
position: direita ? "right" : "left",
|
|
407
|
+
stacked,
|
|
408
|
+
min: eixo?.min ?? 0,
|
|
409
|
+
max: eixo?.max,
|
|
410
|
+
// A grade tracejada do Figma (2px e 2px): no Chart.js 4, o tracejado fica em border.dash.
|
|
411
|
+
border: { display: false, dash: [2, 2] },
|
|
412
|
+
grid: direita ? { drawOnChartArea: false, drawTicks: false } : { color: tema.grade, lineWidth: 1, drawTicks: false },
|
|
413
|
+
ticks: {
|
|
414
|
+
color: tema.texto,
|
|
415
|
+
font: fonte,
|
|
416
|
+
padding: 8,
|
|
417
|
+
stepSize: eixo?.stepSize,
|
|
418
|
+
callback: (valor) => formatar(eixo, Number(valor))
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
return {
|
|
422
|
+
responsive: true,
|
|
423
|
+
maintainAspectRatio: false,
|
|
424
|
+
animation: false,
|
|
425
|
+
interaction: { mode: "index", intersect: false },
|
|
426
|
+
layout: { padding: { top: 8 } },
|
|
427
|
+
scales: {
|
|
428
|
+
x: {
|
|
429
|
+
stacked,
|
|
430
|
+
border: { display: false },
|
|
431
|
+
grid: { display: false },
|
|
432
|
+
// Os rótulos só somem quando não cabem (como no Figma, as 24 horas cabem em 638px).
|
|
433
|
+
ticks: { color: tema.texto, font: fonte, maxRotation: 0, padding: 8, autoSkipPadding: 2 }
|
|
434
|
+
},
|
|
435
|
+
y: eixoY(yAxis, false),
|
|
436
|
+
...temDireita ? { y2: eixoY(y2Axis, true) } : {}
|
|
437
|
+
},
|
|
438
|
+
plugins: {
|
|
439
|
+
legend: { display: false },
|
|
440
|
+
tooltip: {
|
|
441
|
+
backgroundColor: tema.tooltipFundo,
|
|
442
|
+
titleColor: tema.tooltipTexto,
|
|
443
|
+
bodyColor: tema.tooltipTexto,
|
|
444
|
+
titleFont: fonte,
|
|
445
|
+
bodyFont: { ...fonte, weight: 400 },
|
|
446
|
+
padding: { x: 12, y: 8 },
|
|
447
|
+
cornerRadius: 8,
|
|
448
|
+
usePointStyle: true,
|
|
449
|
+
boxWidth: 8,
|
|
450
|
+
boxHeight: type === "bar" ? 8 : 2,
|
|
451
|
+
callbacks: {
|
|
452
|
+
label: (item) => {
|
|
453
|
+
const s = series[item.datasetIndex];
|
|
454
|
+
const eixo = s.axis === "right" ? y2Axis : yAxis;
|
|
455
|
+
return `${formatar(eixo, item.parsed.y ?? 0)} ${s.label}`;
|
|
456
|
+
},
|
|
457
|
+
labelPointStyle: () => ({ pointStyle: type === "bar" ? "rect" : "line", rotation: 0 })
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}, [tema, yAxis, y2Axis, temDireita, series, type, stacked]);
|
|
463
|
+
const card = Boolean(title || actions);
|
|
464
|
+
const classes = ["cr-chart", card && "cr-chart--card", className].filter(Boolean).join(" ");
|
|
465
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: raiz, id, className: classes, children: [
|
|
466
|
+
card && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__header", children: [
|
|
467
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__title-row", children: [
|
|
468
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-chart__title", children: title }),
|
|
469
|
+
help && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
470
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { ref: ajuda, type: "button", className: "cr-chart__help", "aria-label": helpLabel, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Question, { "aria-hidden": "true" }) }),
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tooltip, { target: ajuda, content: help, type: "rich" })
|
|
472
|
+
] })
|
|
473
|
+
] }),
|
|
474
|
+
actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cr-chart__actions", children: actions })
|
|
475
|
+
] }),
|
|
476
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cr-chart__body", children: [
|
|
477
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "cr-chart__plot", style: { height }, children: data && options && /* @__PURE__ */ jsxRuntime.jsx(
|
|
478
|
+
chart.Chart,
|
|
479
|
+
{
|
|
480
|
+
type,
|
|
481
|
+
data,
|
|
482
|
+
options,
|
|
483
|
+
plugins: type === "line" ? [curvaDoFigma, cruz(tema.cruz)] : [],
|
|
484
|
+
width: "100%",
|
|
485
|
+
height: "100%",
|
|
486
|
+
pt: {
|
|
487
|
+
root: { className: "cr-chart__canvas-wrap" },
|
|
488
|
+
canvas: {
|
|
489
|
+
role: "img",
|
|
490
|
+
"aria-label": title ?? series.map((s) => s.label).join(", ")
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
type
|
|
495
|
+
) }),
|
|
496
|
+
series.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "cr-chart__legend", children: series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "cr-chart__legend-item", children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
498
|
+
"span",
|
|
499
|
+
{
|
|
500
|
+
className: "cr-chart__swatch",
|
|
501
|
+
style: {
|
|
502
|
+
backgroundColor: `var(--cr-color-chart-fill-${corDe(s, i)}-${tomDe(s, type)})`
|
|
503
|
+
},
|
|
504
|
+
"aria-hidden": "true"
|
|
505
|
+
}
|
|
506
|
+
),
|
|
507
|
+
s.label
|
|
508
|
+
] }, s.label)) })
|
|
509
|
+
] }),
|
|
510
|
+
/* @__PURE__ */ jsxRuntime.jsxs("table", { className: "cr-chart__table", children: [
|
|
511
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("caption", { children: title }),
|
|
512
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", {}),
|
|
514
|
+
series.map((s) => /* @__PURE__ */ jsxRuntime.jsx("th", { scope: "col", children: s.label }, s.label))
|
|
515
|
+
] }) }),
|
|
516
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: labels.map((rotulo, linha) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
517
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { scope: "row", children: rotulo }),
|
|
518
|
+
series.map((s) => {
|
|
519
|
+
const valor = s.data[linha];
|
|
520
|
+
const eixo = s.axis === "right" ? y2Axis : yAxis;
|
|
521
|
+
return /* @__PURE__ */ jsxRuntime.jsx("td", { children: valor == null ? "" : formatar(eixo, valor) }, s.label);
|
|
522
|
+
})
|
|
523
|
+
] }, rotulo)) })
|
|
524
|
+
] })
|
|
525
|
+
] });
|
|
526
|
+
}
|
|
213
527
|
var Checkbox = react.forwardRef(function Checkbox2({
|
|
214
528
|
label,
|
|
215
529
|
showLabel = true,
|
|
@@ -352,24 +666,54 @@ var Divider = react.forwardRef(function Divider2({ orientation = "horizontal", v
|
|
|
352
666
|
}
|
|
353
667
|
);
|
|
354
668
|
});
|
|
355
|
-
var IconButton = react.forwardRef(function IconButton2({
|
|
669
|
+
var IconButton = react.forwardRef(function IconButton2({
|
|
670
|
+
variant = "primary",
|
|
671
|
+
size = "large",
|
|
672
|
+
icon,
|
|
673
|
+
type = "button",
|
|
674
|
+
tooltip,
|
|
675
|
+
tooltipPosition,
|
|
676
|
+
className,
|
|
677
|
+
...props
|
|
678
|
+
}, ref) {
|
|
679
|
+
const botao = react.useRef(null);
|
|
680
|
+
const ligar = react.useCallback(
|
|
681
|
+
(elemento) => {
|
|
682
|
+
botao.current = elemento;
|
|
683
|
+
if (typeof ref === "function") ref(elemento);
|
|
684
|
+
else if (ref) ref.current = elemento;
|
|
685
|
+
},
|
|
686
|
+
[ref]
|
|
687
|
+
);
|
|
688
|
+
const texto = tooltip ?? props["aria-label"];
|
|
356
689
|
const classes = [
|
|
357
690
|
"cr-icon-button",
|
|
358
691
|
`cr-icon-button--${variant}`,
|
|
359
692
|
`cr-icon-button--${size}`,
|
|
360
693
|
className
|
|
361
694
|
].filter(Boolean).join(" ");
|
|
362
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
695
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
696
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
697
|
+
button.Button,
|
|
698
|
+
{
|
|
699
|
+
unstyled: true,
|
|
700
|
+
ref: ligar,
|
|
701
|
+
type,
|
|
702
|
+
className: classes,
|
|
703
|
+
...props,
|
|
704
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cr-icon-button__icon", "aria-hidden": "true", children: icon })
|
|
705
|
+
}
|
|
706
|
+
),
|
|
707
|
+
texto !== false && /* @__PURE__ */ jsxRuntime.jsx(
|
|
708
|
+
Tooltip,
|
|
709
|
+
{
|
|
710
|
+
target: botao,
|
|
711
|
+
content: texto,
|
|
712
|
+
position: tooltipPosition,
|
|
713
|
+
describe: texto !== props["aria-label"]
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
] });
|
|
373
717
|
});
|
|
374
718
|
var FOCAVEIS = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
375
719
|
function Drawer({
|
|
@@ -653,55 +997,6 @@ var Menu = react.forwardRef(function Menu2({
|
|
|
653
997
|
);
|
|
654
998
|
return context ? menu$1 : /* @__PURE__ */ jsxRuntime.jsx(api.PrimeReactProvider, { children: menu$1 });
|
|
655
999
|
});
|
|
656
|
-
var resolveTargets = (target) => {
|
|
657
|
-
if (typeof target === "string") return Array.from(document.querySelectorAll(target));
|
|
658
|
-
if (target instanceof HTMLElement) return [target];
|
|
659
|
-
return target.current ? [target.current] : [];
|
|
660
|
-
};
|
|
661
|
-
function Tooltip({
|
|
662
|
-
target,
|
|
663
|
-
content,
|
|
664
|
-
type = "plain",
|
|
665
|
-
position = "bottom",
|
|
666
|
-
event = "both",
|
|
667
|
-
showDelay,
|
|
668
|
-
hideDelay,
|
|
669
|
-
disabled,
|
|
670
|
-
id,
|
|
671
|
-
className
|
|
672
|
-
}) {
|
|
673
|
-
const autoId = react.useId();
|
|
674
|
-
const tooltipId = id ?? autoId;
|
|
675
|
-
react.useEffect(() => {
|
|
676
|
-
const elements = resolveTargets(target);
|
|
677
|
-
elements.forEach((element) => element.setAttribute("aria-describedby", tooltipId));
|
|
678
|
-
return () => elements.forEach((element) => element.removeAttribute("aria-describedby"));
|
|
679
|
-
}, [target, tooltipId]);
|
|
680
|
-
const classes = ["cr-tooltip", `cr-tooltip--${type}`, className].filter(Boolean).join(" ");
|
|
681
|
-
const pt = {
|
|
682
|
-
root: (options) => {
|
|
683
|
-
const side = options?.state?.position ?? position;
|
|
684
|
-
return { className: `${classes} cr-tooltip--${side}`, "aria-hidden": false };
|
|
685
|
-
},
|
|
686
|
-
arrow: { className: "cr-tooltip__arrow" },
|
|
687
|
-
text: { className: "cr-tooltip__text" }
|
|
688
|
-
};
|
|
689
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
690
|
-
tooltip.Tooltip,
|
|
691
|
-
{
|
|
692
|
-
unstyled: true,
|
|
693
|
-
id: tooltipId,
|
|
694
|
-
target,
|
|
695
|
-
position,
|
|
696
|
-
event,
|
|
697
|
-
showDelay,
|
|
698
|
-
hideDelay,
|
|
699
|
-
disabled,
|
|
700
|
-
pt,
|
|
701
|
-
children: content
|
|
702
|
-
}
|
|
703
|
-
);
|
|
704
|
-
}
|
|
705
1000
|
|
|
706
1001
|
// src/components/Menubar/assets/vector-logo-simbolo.svg
|
|
707
1002
|
var vector_logo_simbolo_default = 'data:image/svg+xml,<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="42.7061" height="20" viewBox="0 0 42.7061 20" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<g id="Grupo 2380">%0A<path id="Caminho 1049" d="M26.8782 10.21C26.8393 10.1525 26.7869 10.1055 26.7255 10.0731C26.6642 10.0408 26.5958 10.024 26.5264 10.0244H4.21626C4.14666 10.024 4.07803 10.0408 4.0165 10.0733C3.95497 10.1059 3.90244 10.1531 3.8636 10.2109C3.82535 10.2676 3.80224 10.3333 3.79648 10.4015C3.79072 10.4697 3.80251 10.5383 3.8307 10.6007L7.35895 19.7545C7.39283 19.8281 7.44722 19.8905 7.51559 19.934C7.58397 19.9776 7.66345 20.0005 7.74451 20C7.82641 19.9998 7.90647 19.9758 7.97493 19.9308C8.0434 19.8859 8.09731 19.822 8.13007 19.7469L11.5604 13.47H25.3511C25.4325 13.4705 25.5123 13.4474 25.5809 13.4035C25.6494 13.3596 25.7038 13.2969 25.7375 13.2228L26.9086 10.5964C26.9365 10.5347 26.9484 10.4669 26.9431 10.3993C26.9378 10.3318 26.9154 10.2666 26.8782 10.21V10.21Z" fill="%23C1BFBF"/>%0A<g id="Grupo 2378">%0A<path id="Caminho 1050" d="M26.3926 6.06543L24.0666 19.1424C24.0588 19.2502 24.0736 19.3585 24.1103 19.4602C24.1469 19.5619 24.2045 19.6549 24.2792 19.7329C24.3554 19.813 24.447 19.8767 24.5485 19.9202C24.65 19.9637 24.7593 19.9861 24.8698 19.986H30.4229L29.2578 13.5446L26.3926 6.06543Z" fill="%231545DE"/>%0A<g id="Grupo 2377">%0A<path id="Caminho 1051" d="M42.2783 16.0921H42.0598C42.0303 11.9033 41.8911 10.7668 41.2541 10.086C40.167 9.29536 38.9793 8.65329 37.7225 8.17676C37.1378 7.91016 36.4755 7.60812 36.3684 7.52881C36.1102 7.27149 34.8768 5.05179 34.2145 3.85884C33.9378 3.36107 33.6956 2.92488 33.5311 2.63887C33.166 1.80107 32.5487 1.09795 31.7653 0.627372C30.9818 0.15679 30.0712 -0.0578392 29.16 0.0133599H21.1072C21.036 0.0134652 20.966 0.0313585 20.9036 0.0653944C20.8411 0.0994303 20.7881 0.148532 20.7494 0.208251C20.7106 0.268417 20.6872 0.337237 20.6813 0.408613C20.6754 0.479989 20.6872 0.551716 20.7157 0.617433L28.9955 19.7283C29.0285 19.8051 29.0832 19.8705 29.1529 19.9166C29.2226 19.9626 29.3043 19.9872 29.3878 19.9873H30.9849C31.0972 19.9869 31.2048 19.9425 31.2848 19.8637C31.3648 19.7848 31.4107 19.6778 31.4126 19.5655C31.4126 18.581 31.8037 17.6368 32.4999 16.9406C33.1961 16.2444 34.1403 15.8533 35.1248 15.8533C36.1093 15.8533 37.0535 16.2444 37.7497 16.9406C38.4459 17.6368 38.837 18.581 38.837 19.5655C38.839 19.6778 38.8848 19.7848 38.9648 19.8637C39.0447 19.9425 39.1524 19.9869 39.2647 19.9873H41.6396C41.6961 19.9871 41.752 19.9758 41.8041 19.9539C41.8561 19.9321 41.9034 19.9002 41.9431 19.8601C41.9828 19.82 42.0143 19.7724 42.0356 19.7201C42.0569 19.6678 42.0677 19.6119 42.0674 19.5554C42.0674 19.2179 42.0674 18.9015 42.0674 18.5911H42.2783C42.3923 18.5904 42.5013 18.5445 42.5815 18.4636C42.6617 18.3826 42.7065 18.2731 42.7061 18.1591V16.5241C42.7065 16.4101 42.6617 16.3006 42.5815 16.2196C42.5013 16.1386 42.3923 16.0928 42.2783 16.0921V16.0921ZM31.6058 8.33621H27.9359C27.7958 8.33732 27.6591 8.29246 27.547 8.20849C27.4348 8.12452 27.3533 8.00609 27.3149 7.87135L26.0545 3.91029C26.0293 3.8176 26.0262 3.72028 26.0455 3.62619C26.0649 3.5321 26.1061 3.44388 26.1658 3.36866C26.2264 3.29247 26.3034 3.23091 26.391 3.18856C26.4786 3.1462 26.5747 3.12414 26.672 3.124H28.9305C29.2861 3.13975 29.6349 3.22716 29.9558 3.38098C30.2768 3.53479 30.5634 3.75184 30.7984 4.01912C31.7475 5.02307 32.2662 6.35841 32.2437 7.73973C32.2339 7.90191 32.1624 8.05419 32.0437 8.16517C31.925 8.27615 31.7683 8.33736 31.6058 8.33621V8.33621Z" fill="%231545DE"/>%0A</g>%0A</g>%0A<path id="Caminho 1052" d="M18.318 0.208784C18.2779 0.150057 18.224 0.102045 18.1611 0.0689531C18.0981 0.0358617 18.028 0.0186933 17.9569 0.0189526H0.432107C0.361515 0.0187583 0.291932 0.0356991 0.229331 0.0683223C0.166729 0.100945 0.112985 0.148276 0.0727059 0.206248C0.0332923 0.263519 0.00898875 0.329827 0.00205642 0.399002C-0.00487591 0.468178 0.00578389 0.537987 0.0330492 0.601939L1.0404 3.29747C1.07434 3.3749 1.13023 3.44069 1.20115 3.48672C1.27206 3.53275 1.35491 3.55701 1.43945 3.55648H16.5134C16.5968 3.55702 16.6787 3.53341 16.749 3.4885C16.8194 3.44359 16.8753 3.37931 16.9099 3.30338L18.3526 0.607835C18.3813 0.543894 18.3933 0.473655 18.3872 0.403804C18.3812 0.333954 18.3573 0.266823 18.318 0.208784V0.208784Z" fill="%23C1BFBF"/>%0A<path id="Caminho 1053" d="M20.2107 5.18251C20.1706 5.12378 20.1167 5.07577 20.0538 5.04268C19.9908 5.00959 19.9207 4.99242 19.8496 4.99268H2.32482C2.25423 4.99248 2.18465 5.00943 2.12205 5.04205C2.05945 5.07467 2.0057 5.122 1.96542 5.17997C1.92601 5.23725 1.9017 5.30355 1.89477 5.37273C1.88784 5.4419 1.8985 5.51171 1.92577 5.57567L2.93311 8.2712C2.96706 8.34863 3.02294 8.41442 3.09386 8.46045C3.16478 8.50648 3.24763 8.53073 3.33217 8.53021H18.4061C18.4896 8.53075 18.5714 8.50714 18.6417 8.46224C18.7121 8.41733 18.768 8.35304 18.8026 8.27711L20.2453 5.58157C20.274 5.51761 20.2859 5.44738 20.2798 5.37754C20.2738 5.30771 20.25 5.24058 20.2107 5.18251V5.18251Z" fill="%23C1BFBF"/>%0A</g>%0A</svg>%0A';
|
|
@@ -1335,7 +1630,9 @@ var PageHeader = react.forwardRef(function PageHeader2({
|
|
|
1335
1630
|
segmentControl,
|
|
1336
1631
|
actions,
|
|
1337
1632
|
onExpand,
|
|
1633
|
+
expanded,
|
|
1338
1634
|
expandLabel = "Expandir",
|
|
1635
|
+
collapseLabel = "Recolher",
|
|
1339
1636
|
tabs,
|
|
1340
1637
|
activeTab,
|
|
1341
1638
|
onTabChange,
|
|
@@ -1345,6 +1642,8 @@ var PageHeader = react.forwardRef(function PageHeader2({
|
|
|
1345
1642
|
}, ref) {
|
|
1346
1643
|
const [interna, setInterna] = react.useState(0);
|
|
1347
1644
|
const ativa = activeTab ?? interna;
|
|
1645
|
+
const [expandidoInterno, setExpandidoInterno] = react.useState(false);
|
|
1646
|
+
const expandido = expanded ?? expandidoInterno;
|
|
1348
1647
|
const tools = segmentControl || actions;
|
|
1349
1648
|
const tabTemplate = (tab) => (
|
|
1350
1649
|
// O TabMenu também passa o index da aba nas opções, além do que o tipo do MenuItem declara.
|
|
@@ -1392,9 +1691,12 @@ var PageHeader = react.forwardRef(function PageHeader2({
|
|
|
1392
1691
|
className: "cr-page-header__expand",
|
|
1393
1692
|
variant: "tertiary",
|
|
1394
1693
|
size: "medium",
|
|
1395
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArrowsOutSimple, {}),
|
|
1396
|
-
"aria-label": expandLabel,
|
|
1397
|
-
onClick:
|
|
1694
|
+
icon: expandido ? /* @__PURE__ */ jsxRuntime.jsx(react$1.ArrowsInSimple, {}) : /* @__PURE__ */ jsxRuntime.jsx(react$1.ArrowsOutSimple, {}),
|
|
1695
|
+
"aria-label": expandido ? collapseLabel : expandLabel,
|
|
1696
|
+
onClick: () => {
|
|
1697
|
+
setExpandidoInterno(!expandido);
|
|
1698
|
+
onExpand(!expandido);
|
|
1699
|
+
}
|
|
1398
1700
|
}
|
|
1399
1701
|
)
|
|
1400
1702
|
]
|
|
@@ -1978,6 +2280,7 @@ exports.AutoComplete = AutoComplete;
|
|
|
1978
2280
|
exports.Badge = Badge;
|
|
1979
2281
|
exports.Button = Button;
|
|
1980
2282
|
exports.Card = Card;
|
|
2283
|
+
exports.Chart = Chart;
|
|
1981
2284
|
exports.Checkbox = Checkbox;
|
|
1982
2285
|
exports.Chip = Chip;
|
|
1983
2286
|
exports.Divider = Divider;
|