@snksergio/design-system 0.35.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -12
- package/dist-lib/chunks/avatar-CIHTveDJ.mjs +1177 -0
- package/dist-lib/chunks/avatar-CIHTveDJ.mjs.map +1 -0
- package/dist-lib/chunks/avatar-YpqQgJnh.cjs +1196 -0
- package/dist-lib/chunks/avatar-YpqQgJnh.cjs.map +1 -0
- package/dist-lib/chunks/{input-CizzMZ20.cjs → input-CJnonz-G.cjs} +3 -3
- package/dist-lib/chunks/{input-CizzMZ20.cjs.map → input-CJnonz-G.cjs.map} +1 -1
- package/dist-lib/chunks/{input-Cym0k4ZI.mjs → input-jLoO8t0I.mjs} +2 -2
- package/dist-lib/chunks/{input-Cym0k4ZI.mjs.map → input-jLoO8t0I.mjs.map} +1 -1
- package/dist-lib/chunks/{kpi-delta-FhfuIg27.mjs → kpi-delta-D0g2YzDy.mjs} +3 -2
- package/dist-lib/chunks/{kpi-delta-FhfuIg27.mjs.map → kpi-delta-D0g2YzDy.mjs.map} +1 -1
- package/dist-lib/chunks/{kpi-delta-DrSJPMCY.cjs → kpi-delta-D6cLnCqW.cjs} +8 -7
- package/dist-lib/chunks/{kpi-delta-DrSJPMCY.cjs.map → kpi-delta-D6cLnCqW.cjs.map} +1 -1
- package/dist-lib/chunks/{page-header-BMzUloFi.cjs → page-header-DSTprenz.cjs} +4 -4
- package/dist-lib/chunks/{page-header-BMzUloFi.cjs.map → page-header-DSTprenz.cjs.map} +1 -1
- package/dist-lib/chunks/{page-header-Buh6YlQM.mjs → page-header-Deb1excS.mjs} +2 -2
- package/dist-lib/chunks/{page-header-Buh6YlQM.mjs.map → page-header-Deb1excS.mjs.map} +1 -1
- package/dist-lib/chunks/{panel-Cdl0GPVE.mjs → panel-Cid3m9zb.mjs} +370 -9823
- package/dist-lib/chunks/panel-Cid3m9zb.mjs.map +1 -0
- package/dist-lib/chunks/{panel-DlyaLunw.cjs → panel-DLcD8LhW.cjs} +595 -10052
- package/dist-lib/chunks/panel-DLcD8LhW.cjs.map +1 -0
- package/dist-lib/chunks/textarea-BDJRaL5h.mjs +781 -0
- package/dist-lib/chunks/textarea-BDJRaL5h.mjs.map +1 -0
- package/dist-lib/chunks/textarea-Bxl9Voe8.cjs +802 -0
- package/dist-lib/chunks/textarea-Bxl9Voe8.cjs.map +1 -0
- package/dist-lib/chunks/tooltip-DGI3hDFM.mjs +1452 -0
- package/dist-lib/chunks/tooltip-DGI3hDFM.mjs.map +1 -0
- package/dist-lib/chunks/tooltip-vLUyJ0h5.cjs +1484 -0
- package/dist-lib/chunks/tooltip-vLUyJ0h5.cjs.map +1 -0
- package/dist-lib/chunks/{useTheme-D4alxxGV.cjs → useTheme-DQ7FaHdv.cjs} +170 -1282
- package/dist-lib/chunks/useTheme-DQ7FaHdv.cjs.map +1 -0
- package/dist-lib/chunks/{useTheme-DF2xbSdI.mjs → useTheme-UrerJ3i-.mjs} +26 -1134
- package/dist-lib/chunks/useTheme-UrerJ3i-.mjs.map +1 -0
- package/dist-lib/index.cjs +1258 -311
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.mjs +1631 -679
- package/dist-lib/index.mjs.map +1 -1
- package/dist-lib/preview/chat.cjs +45 -44
- package/dist-lib/preview/chat.cjs.map +1 -1
- package/dist-lib/preview/chat.mjs +3 -2
- package/dist-lib/preview/chat.mjs.map +1 -1
- package/dist-lib/preview/clientes.cjs +22 -20
- package/dist-lib/preview/clientes.cjs.map +1 -1
- package/dist-lib/preview/clientes.mjs +6 -4
- package/dist-lib/preview/clientes.mjs.map +1 -1
- package/dist-lib/preview/dashboard.cjs +40 -39
- package/dist-lib/preview/dashboard.cjs.map +1 -1
- package/dist-lib/preview/dashboard.mjs +4 -3
- package/dist-lib/preview/dashboard.mjs.map +1 -1
- package/dist-lib/shadcn.cjs +293 -0
- package/dist-lib/shadcn.cjs.map +1 -0
- package/dist-lib/shadcn.d.ts +2 -0
- package/dist-lib/shadcn.mjs +276 -0
- package/dist-lib/shadcn.mjs.map +1 -0
- package/dist-lib/src/components/index.d.ts +10 -0
- package/dist-lib/src/components/index.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/command.d.ts.map +1 -1
- package/dist-lib/src/components/shadcn/index.d.ts +60 -6
- package/dist-lib/src/components/shadcn/index.d.ts.map +1 -1
- package/dist-lib/src/hooks/useBrand.d.ts +1 -1
- package/dist-lib/theme/brand-blue.css +110 -110
- package/dist-lib/theme/brand-green.css +110 -110
- package/dist-lib/theme/brand-pay.css +189 -189
- package/dist-lib/theme/brand-vibrant.css +148 -148
- package/dist-lib/theme.css +10 -6
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts +4 -0
- package/dist-lib/tokens/brands/blue/semantic/color-dark.d.ts.map +1 -1
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts +4 -0
- package/dist-lib/tokens/brands/blue/semantic/color-light.d.ts.map +1 -1
- package/dist-lib/tokens/brands/default/semantic/color-dark.d.ts +4 -0
- package/dist-lib/tokens/brands/default/semantic/color-dark.d.ts.map +1 -1
- package/dist-lib/tokens/brands/default/semantic/color-light.d.ts +4 -0
- package/dist-lib/tokens/brands/default/semantic/color-light.d.ts.map +1 -1
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts +4 -0
- package/dist-lib/tokens/brands/green/semantic/color-dark.d.ts.map +1 -1
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts +4 -0
- package/dist-lib/tokens/brands/green/semantic/color-light.d.ts.map +1 -1
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts +4 -0
- package/dist-lib/tokens/brands/pay/semantic/color-dark.d.ts.map +1 -1
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts +4 -0
- package/dist-lib/tokens/brands/pay/semantic/color-light.d.ts.map +1 -1
- package/dist-lib/tokens/brands/vibrant/semantic/color-dark.d.ts +4 -0
- package/dist-lib/tokens/brands/vibrant/semantic/color-dark.d.ts.map +1 -1
- package/dist-lib/tokens/brands/vibrant/semantic/color-light.d.ts +4 -0
- package/dist-lib/tokens/brands/vibrant/semantic/color-light.d.ts.map +1 -1
- package/dist-lib/tokens.cjs +12 -0
- package/dist-lib/tokens.cjs.map +1 -1
- package/dist-lib/tokens.mjs +12 -0
- package/dist-lib/tokens.mjs.map +1 -1
- package/package.json +11 -3
- package/dist-lib/chunks/panel-Cdl0GPVE.mjs.map +0 -1
- package/dist-lib/chunks/panel-DlyaLunw.cjs.map +0 -1
- package/dist-lib/chunks/useTheme-D4alxxGV.cjs.map +0 -1
- package/dist-lib/chunks/useTheme-DF2xbSdI.mjs.map +0 -1
package/dist-lib/index.cjs
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const panel = require("./chunks/panel-
|
|
4
|
-
const useTheme = require("./chunks/useTheme-
|
|
3
|
+
const panel = require("./chunks/panel-DLcD8LhW.cjs");
|
|
4
|
+
const useTheme = require("./chunks/useTheme-DQ7FaHdv.cjs");
|
|
5
|
+
const avatar = require("./chunks/avatar-YpqQgJnh.cjs");
|
|
5
6
|
const jsxRuntime = require("react/jsx-runtime");
|
|
6
7
|
const React = require("react");
|
|
8
|
+
const textarea = require("./chunks/textarea-Bxl9Voe8.cjs");
|
|
7
9
|
const lucideReact = require("lucide-react");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
const tooltip = require("./chunks/tooltip-vLUyJ0h5.cjs");
|
|
11
|
+
require("@radix-ui/react-aspect-ratio");
|
|
12
|
+
require("react-day-picker");
|
|
13
|
+
require("@radix-ui/react-collapsible");
|
|
14
|
+
const input = require("./chunks/input-CJnonz-G.cjs");
|
|
15
|
+
const sonner = require("sonner");
|
|
16
|
+
const kpiDelta = require("./chunks/kpi-delta-D6cLnCqW.cjs");
|
|
17
|
+
const pageHeader = require("./chunks/page-header-DSTprenz.cjs");
|
|
18
|
+
const RechartsPrimitive = require("recharts");
|
|
19
|
+
const reactVirtual = require("@tanstack/react-virtual");
|
|
20
|
+
require("@hello-pangea/dnd");
|
|
14
21
|
function _interopNamespaceDefault(e) {
|
|
15
22
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
16
23
|
if (e) {
|
|
@@ -28,10 +35,8 @@ function _interopNamespaceDefault(e) {
|
|
|
28
35
|
return Object.freeze(n);
|
|
29
36
|
}
|
|
30
37
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const CollapsiblePrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CollapsiblePrimitive);
|
|
34
|
-
const cardCheckbox = useTheme.tv({
|
|
38
|
+
const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
|
|
39
|
+
const cardCheckbox = avatar.tv({
|
|
35
40
|
slots: {
|
|
36
41
|
root: [
|
|
37
42
|
"flex items-center gap-gp-lg w-full",
|
|
@@ -81,7 +86,7 @@ const CardCheckbox = React.forwardRef(
|
|
|
81
86
|
className: [styles2.root(), className].filter(Boolean).join(" "),
|
|
82
87
|
children: [
|
|
83
88
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
84
|
-
|
|
89
|
+
textarea.Checkbox,
|
|
85
90
|
{
|
|
86
91
|
ref,
|
|
87
92
|
id: autoId,
|
|
@@ -101,111 +106,7 @@ const CardCheckbox = React.forwardRef(
|
|
|
101
106
|
}
|
|
102
107
|
);
|
|
103
108
|
CardCheckbox.displayName = "CardCheckbox";
|
|
104
|
-
const
|
|
105
|
-
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
-
SeparatorPrimitive__namespace.Root,
|
|
107
|
-
{
|
|
108
|
-
ref,
|
|
109
|
-
decorative,
|
|
110
|
-
orientation,
|
|
111
|
-
className: useTheme.cn(
|
|
112
|
-
"shrink-0 bg-border",
|
|
113
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
114
|
-
className
|
|
115
|
-
),
|
|
116
|
-
...props
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
);
|
|
120
|
-
Separator.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
121
|
-
const badgeVariants = useTheme.tv({
|
|
122
|
-
base: [
|
|
123
|
-
"inline-flex items-center justify-center",
|
|
124
|
-
"border border-transparent",
|
|
125
|
-
"font-semibold leading-none whitespace-nowrap",
|
|
126
|
-
"transition-colors",
|
|
127
|
-
"focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary",
|
|
128
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
129
|
-
],
|
|
130
|
-
variants: {
|
|
131
|
-
color: {
|
|
132
|
-
primary: "",
|
|
133
|
-
secondary: "",
|
|
134
|
-
critical: "",
|
|
135
|
-
success: "",
|
|
136
|
-
warning: "",
|
|
137
|
-
info: ""
|
|
138
|
-
},
|
|
139
|
-
variant: {
|
|
140
|
-
solid: "",
|
|
141
|
-
soft: "",
|
|
142
|
-
outline: "bg-transparent",
|
|
143
|
-
ghost: "bg-transparent border-transparent"
|
|
144
|
-
},
|
|
145
|
-
size: {
|
|
146
|
-
sm: "h-comp-2xs px-pad-sm text-caption-xs gap-gp-2xs [&_svg]:size-3",
|
|
147
|
-
// 20px / 6 / 10
|
|
148
|
-
md: "h-comp-xs px-pad-md text-body-xs gap-gp-xs [&_svg]:size-3.5",
|
|
149
|
-
// 24px / 8 / 12 (default)
|
|
150
|
-
lg: "h-comp-sm px-pad-lg text-body-sm font-normal gap-gp-sm [&_svg]:size-4"
|
|
151
|
-
// 28px / 10 / 13
|
|
152
|
-
},
|
|
153
|
-
shape: {
|
|
154
|
-
default: "rounded-radius-sm",
|
|
155
|
-
// 6px — counter, value tags
|
|
156
|
-
pill: "rounded-radius-full"
|
|
157
|
-
// pill — status chips
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
compoundVariants: [
|
|
161
|
-
/* ── Primary (brand) ─────────────────────────────────────────────── */
|
|
162
|
-
{ color: "primary", variant: "solid", class: "bg-bg-brand text-fg-on-brand" },
|
|
163
|
-
{ color: "primary", variant: "soft", class: "bg-bg-brand-subtle text-fg-brand" },
|
|
164
|
-
{ color: "primary", variant: "outline", class: "border-border-brand text-fg-brand" },
|
|
165
|
-
{ color: "primary", variant: "ghost", class: "text-fg-brand" },
|
|
166
|
-
/* ── Secondary (neutral) ─────────────────────────────────────────── */
|
|
167
|
-
{ color: "secondary", variant: "solid", class: "bg-bg-emphasis text-fg-default" },
|
|
168
|
-
{ color: "secondary", variant: "soft", class: "bg-bg-muted text-fg-muted" },
|
|
169
|
-
{ color: "secondary", variant: "outline", class: "border-border-default text-fg-default" },
|
|
170
|
-
{ color: "secondary", variant: "ghost", class: "text-fg-muted" },
|
|
171
|
-
/* ── Critical (danger) ───────────────────────────────────────────── */
|
|
172
|
-
{ color: "critical", variant: "solid", class: "bg-bg-danger text-fg-on-danger" },
|
|
173
|
-
{ color: "critical", variant: "soft", class: "bg-bg-danger-muted text-fg-danger" },
|
|
174
|
-
{ color: "critical", variant: "outline", class: "border-border-danger-muted text-fg-danger" },
|
|
175
|
-
{ color: "critical", variant: "ghost", class: "text-fg-danger" },
|
|
176
|
-
/* ── Success ─────────────────────────────────────────────────────── */
|
|
177
|
-
{ color: "success", variant: "solid", class: "bg-bg-success text-fg-on-success" },
|
|
178
|
-
{ color: "success", variant: "soft", class: "bg-bg-success-muted text-fg-success" },
|
|
179
|
-
{ color: "success", variant: "outline", class: "border-border-success-muted text-fg-success" },
|
|
180
|
-
{ color: "success", variant: "ghost", class: "text-fg-success" },
|
|
181
|
-
/* ── Warning ─────────────────────────────────────────────────────── */
|
|
182
|
-
{ color: "warning", variant: "solid", class: "bg-bg-warning text-fg-on-warning" },
|
|
183
|
-
{ color: "warning", variant: "soft", class: "bg-bg-warning-muted text-fg-warning" },
|
|
184
|
-
{ color: "warning", variant: "outline", class: "border-border-warning-muted text-fg-warning" },
|
|
185
|
-
{ color: "warning", variant: "ghost", class: "text-fg-warning" },
|
|
186
|
-
/* ── Info ────────────────────────────────────────────────────────── */
|
|
187
|
-
{ color: "info", variant: "solid", class: "bg-bg-info text-fg-on-info" },
|
|
188
|
-
{ color: "info", variant: "soft", class: "bg-bg-info-muted text-fg-info" },
|
|
189
|
-
{ color: "info", variant: "outline", class: "border-border-info-muted text-fg-info" },
|
|
190
|
-
{ color: "info", variant: "ghost", class: "text-fg-info" }
|
|
191
|
-
],
|
|
192
|
-
defaultVariants: {
|
|
193
|
-
color: "secondary",
|
|
194
|
-
variant: "soft",
|
|
195
|
-
size: "md",
|
|
196
|
-
shape: "default"
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
function Badge({ className, color, variant, size, shape, ...props }) {
|
|
200
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
201
|
-
"span",
|
|
202
|
-
{
|
|
203
|
-
className: badgeVariants({ color, variant, size, shape, className }),
|
|
204
|
-
...props
|
|
205
|
-
}
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
const colorPickerStyles = useTheme.tv({
|
|
109
|
+
const colorPickerStyles = avatar.tv({
|
|
209
110
|
slots: {
|
|
210
111
|
root: "inline-flex w-full items-center gap-gp-md",
|
|
211
112
|
swatch: [
|
|
@@ -359,9 +260,9 @@ const ColorPicker = React.forwardRef(
|
|
|
359
260
|
setOpen(false);
|
|
360
261
|
};
|
|
361
262
|
const swatchBg = normalizeHex(value) ?? "transparent";
|
|
362
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.Popover, { open, onOpenChange: setOpen, children: [
|
|
363
264
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.root({ className }), children: [
|
|
364
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
365
266
|
"button",
|
|
366
267
|
{
|
|
367
268
|
ref,
|
|
@@ -399,7 +300,7 @@ const ColorPicker = React.forwardRef(
|
|
|
399
300
|
)
|
|
400
301
|
] }),
|
|
401
302
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
402
|
-
|
|
303
|
+
avatar.PopoverContent,
|
|
403
304
|
{
|
|
404
305
|
align: "start",
|
|
405
306
|
mobileSheet: true,
|
|
@@ -441,7 +342,7 @@ const ColorPicker = React.forwardRef(
|
|
|
441
342
|
}
|
|
442
343
|
),
|
|
443
344
|
allowCustomHex && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
444
|
-
/* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
345
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Separator, {}),
|
|
445
346
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.customRow(), children: [
|
|
446
347
|
/* @__PURE__ */ jsxRuntime.jsx(panel.FormField, { label: "Cor personalizada", id: `${id}-custom`, children: ({ id: customId }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
348
|
input.Input,
|
|
@@ -462,7 +363,7 @@ const ColorPicker = React.forwardRef(
|
|
|
462
363
|
}
|
|
463
364
|
) }),
|
|
464
365
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
-
|
|
366
|
+
avatar.Button,
|
|
466
367
|
{
|
|
467
368
|
type: "button",
|
|
468
369
|
size: "sm",
|
|
@@ -480,7 +381,7 @@ const ColorPicker = React.forwardRef(
|
|
|
480
381
|
] });
|
|
481
382
|
}
|
|
482
383
|
);
|
|
483
|
-
const markdownTextStyles =
|
|
384
|
+
const markdownTextStyles = avatar.tv({
|
|
484
385
|
slots: {
|
|
485
386
|
root: "text-body-sm text-fg-default break-words",
|
|
486
387
|
strong: "font-semibold",
|
|
@@ -592,7 +493,7 @@ function MarkdownText({
|
|
|
592
493
|
}
|
|
593
494
|
return /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.root({ className }), children: content });
|
|
594
495
|
}
|
|
595
|
-
const conversationListItemStyles =
|
|
496
|
+
const conversationListItemStyles = avatar.tv({
|
|
596
497
|
slots: {
|
|
597
498
|
root: [
|
|
598
499
|
"group/cli relative w-full text-left",
|
|
@@ -687,7 +588,7 @@ function isAvatarData(value) {
|
|
|
687
588
|
}
|
|
688
589
|
const ConversationListItem = React.forwardRef(function ConversationListItem2({
|
|
689
590
|
title: title2,
|
|
690
|
-
avatar,
|
|
591
|
+
avatar: avatar2,
|
|
691
592
|
preview,
|
|
692
593
|
time,
|
|
693
594
|
badges,
|
|
@@ -718,9 +619,9 @@ const ConversationListItem = React.forwardRef(function ConversationListItem2({
|
|
|
718
619
|
};
|
|
719
620
|
const stopActions = (e) => e.stopPropagation();
|
|
720
621
|
let avatarNode = null;
|
|
721
|
-
if (
|
|
722
|
-
if (isAvatarData(
|
|
723
|
-
const { src, name, colorHex } =
|
|
622
|
+
if (avatar2 != null) {
|
|
623
|
+
if (isAvatarData(avatar2)) {
|
|
624
|
+
const { src, name, colorHex } = avatar2;
|
|
724
625
|
const label = name ?? title2;
|
|
725
626
|
avatarNode = /* @__PURE__ */ jsxRuntime.jsx(panel.Avatar, { size: "lg", colorHex, "aria-label": label, children: src ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
627
|
"img",
|
|
@@ -732,7 +633,7 @@ const ConversationListItem = React.forwardRef(function ConversationListItem2({
|
|
|
732
633
|
}
|
|
733
634
|
) : initialsFromName(name ?? title2) });
|
|
734
635
|
} else {
|
|
735
|
-
avatarNode =
|
|
636
|
+
avatarNode = avatar2;
|
|
736
637
|
}
|
|
737
638
|
}
|
|
738
639
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -785,31 +686,31 @@ function ToolbarMobileDialog({
|
|
|
785
686
|
const [internalOpen, setInternalOpen] = React.useState(false);
|
|
786
687
|
const open = openProp ?? internalOpen;
|
|
787
688
|
const setOpen = onOpenChange ?? setInternalOpen;
|
|
788
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
789
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
790
|
-
|
|
689
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.Dialog, { open, onOpenChange: setOpen, children: [
|
|
690
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DialogTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
691
|
+
avatar.Button,
|
|
791
692
|
{
|
|
792
693
|
color: "secondary",
|
|
793
694
|
variant: "outline",
|
|
794
695
|
size: "icon-md",
|
|
795
696
|
"aria-label": "Mais opções",
|
|
796
|
-
className:
|
|
697
|
+
className: avatar.cn(HIDDEN_AT[desktopBreakpoint], className),
|
|
797
698
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {})
|
|
798
699
|
}
|
|
799
700
|
) }),
|
|
800
701
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
801
|
-
|
|
702
|
+
avatar.DialogContent,
|
|
802
703
|
{
|
|
803
704
|
hideClose: true,
|
|
804
705
|
"aria-describedby": void 0,
|
|
805
|
-
className:
|
|
706
|
+
className: avatar.cn(
|
|
806
707
|
// Visual alinhado com CommandDialog
|
|
807
708
|
"overflow-hidden p-0 gap-0 sm:max-w-[384px]",
|
|
808
709
|
"rounded-[12px] border border-border-default outline-float",
|
|
809
710
|
contentClassName
|
|
810
711
|
),
|
|
811
712
|
children: [
|
|
812
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DialogTitle, { className: "sr-only", children: title2 }),
|
|
813
714
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-3xl p-pad-2xl max-h-[85vh] overflow-y-auto", children })
|
|
814
715
|
]
|
|
815
716
|
}
|
|
@@ -822,7 +723,7 @@ function ToolbarMobileSection({
|
|
|
822
723
|
children,
|
|
823
724
|
className
|
|
824
725
|
}) {
|
|
825
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className:
|
|
726
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: avatar.cn("flex flex-col gap-gp-md", className), children: [
|
|
826
727
|
title2 && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-body-xs font-medium text-fg-muted", children: title2 }),
|
|
827
728
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-md", children })
|
|
828
729
|
] });
|
|
@@ -1112,7 +1013,7 @@ const DatePicker = React__namespace.forwardRef(
|
|
|
1112
1013
|
const v = props.value;
|
|
1113
1014
|
label = v?.from ? v.to ? `${formatShort(v.from)} – ${formatShort(v.to)}` : formatShort(v.from) : null;
|
|
1114
1015
|
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
|
-
|
|
1016
|
+
textarea.Calendar,
|
|
1116
1017
|
{
|
|
1117
1018
|
mode: "range",
|
|
1118
1019
|
min: 1,
|
|
@@ -1129,7 +1030,7 @@ const DatePicker = React__namespace.forwardRef(
|
|
|
1129
1030
|
const v = props.value;
|
|
1130
1031
|
label = v && v.length > 0 ? v.length === 1 ? "1 data selecionada" : `${v.length} datas selecionadas` : null;
|
|
1131
1032
|
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1132
|
-
|
|
1033
|
+
textarea.Calendar,
|
|
1133
1034
|
{
|
|
1134
1035
|
mode: "multiple",
|
|
1135
1036
|
numberOfMonths: props.numberOfMonths,
|
|
@@ -1142,7 +1043,7 @@ const DatePicker = React__namespace.forwardRef(
|
|
|
1142
1043
|
const v = props.value;
|
|
1143
1044
|
label = v ? formatFull(v) : null;
|
|
1144
1045
|
calendar = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1145
|
-
|
|
1046
|
+
textarea.Calendar,
|
|
1146
1047
|
{
|
|
1147
1048
|
mode: "single",
|
|
1148
1049
|
numberOfMonths: props.numberOfMonths,
|
|
@@ -1155,15 +1056,15 @@ const DatePicker = React__namespace.forwardRef(
|
|
|
1155
1056
|
);
|
|
1156
1057
|
}
|
|
1157
1058
|
const text = label ?? placeholder ?? (props.mode === "range" ? "Selecione o período" : "Selecione a data");
|
|
1158
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1159
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1059
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.Popover, { open, onOpenChange: setOpen, children: [
|
|
1060
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1160
1061
|
"button",
|
|
1161
1062
|
{
|
|
1162
1063
|
ref,
|
|
1163
1064
|
type: "button",
|
|
1164
1065
|
disabled,
|
|
1165
1066
|
"data-placeholder": label ? void 0 : "",
|
|
1166
|
-
className:
|
|
1067
|
+
className: avatar.cn(
|
|
1167
1068
|
// Trigger espelha o SelectTrigger (`shadcn/select.tsx`), que é o
|
|
1168
1069
|
// precedente do DS pra "botão que tem que parecer input": mesmos
|
|
1169
1070
|
// tokens de bg/border/radius/padding/gap e o mesmo tratamento de
|
|
@@ -1190,7 +1091,7 @@ const DatePicker = React__namespace.forwardRef(
|
|
|
1190
1091
|
]
|
|
1191
1092
|
}
|
|
1192
1093
|
) }),
|
|
1193
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1094
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverContent, { align, className: "w-auto p-pad-xl", children: calendar })
|
|
1194
1095
|
] });
|
|
1195
1096
|
}
|
|
1196
1097
|
);
|
|
@@ -3603,7 +3504,7 @@ const icons = {
|
|
|
3603
3504
|
"igreen-seguro": "M11.4639 1.25702C14.085 1.19572 16.6411 1.6447 19.0066 2.80744C19.3755 2.98873 19.8048 3.19906 20.142 3.4273C20.9286 3.95325 21.4689 4.77503 21.64 5.70561C21.7473 6.26792 21.7481 6.87869 21.75 7.45017L21.7514 8.83666C21.7516 9.87475 21.7887 11.1941 21.7047 12.2121C21.5436 14.0305 20.9125 15.7758 19.8734 17.2767C18.5209 19.2611 16.5655 20.8084 14.4652 21.9442C13.8002 22.3039 13.3077 22.5769 12.5623 22.7178C11.4536 22.8767 10.7471 22.5794 9.79046 22.0794C8.44126 21.3884 7.18846 20.5236 6.06411 19.5069C3.84267 17.4616 2.38475 14.8198 2.26307 11.7606C2.22718 10.8583 2.25004 9.84503 2.25011 8.93645L2.25126 7.48091C2.25539 6.12739 2.2747 4.98567 3.24579 3.9393C3.71646 3.43213 4.19253 3.20858 4.79776 2.89964C6.88626 1.83361 9.13195 1.34875 11.4639 1.25702ZM12.2478 21.2347C12.7949 21.1598 13.2274 20.8973 13.7073 20.643C16.9795 18.9081 19.9055 15.9692 20.208 12.0955C20.2867 11.0876 20.2506 10.0186 20.2508 8.99972L20.2497 7.49477C20.2462 6.34402 20.3047 5.23981 19.1555 4.57861C16.8945 3.27767 14.3404 2.72419 11.7463 2.75784C9.58278 2.77438 7.45059 3.27663 5.50717 4.22755C5.10873 4.42741 4.69854 4.61347 4.37701 4.93105C3.74856 5.55175 3.75436 6.41214 3.75218 7.23411C3.74851 8.62352 3.74971 10.0193 3.75311 11.4093C3.77103 15.6466 6.86057 18.8792 10.425 20.718C10.9812 21.0048 11.3782 21.2548 12.0336 21.2458C12.1051 21.2442 12.1766 21.2406 12.2478 21.2347Z",
|
|
3604
3505
|
"igreen-clientes": "M21.25 11.5996C21.25 9.90753 21.2495 8.68345 21.1709 7.7207C21.0929 6.76657 20.9419 6.1346 20.6777 5.61621C20.1744 4.62859 19.3714 3.82556 18.3838 3.32227C17.8654 3.05814 17.2334 2.90706 16.2793 2.8291C15.3165 2.75047 14.0925 2.75 12.4004 2.75H11.5996C9.90753 2.75 8.68345 2.75047 7.7207 2.8291C6.76657 2.90706 6.1346 3.05814 5.61621 3.32227C4.62859 3.82556 3.82556 4.62859 3.32227 5.61621C3.05814 6.1346 2.90706 6.76657 2.8291 7.7207C2.75047 8.68345 2.75 9.90753 2.75 11.5996V12.4004C2.75 14.0925 2.75047 15.3165 2.8291 16.2793C2.90706 17.2334 3.05814 17.8654 3.32227 18.3838C3.82556 19.3714 4.62859 20.1744 5.61621 20.6777C6.1346 20.9419 6.76657 21.0929 7.7207 21.1709C8.68345 21.2495 9.90753 21.25 11.5996 21.25H12.4004C14.0925 21.25 15.3165 21.2495 16.2793 21.1709C17.2334 21.0929 17.8654 20.9419 18.3838 20.6777C19.3714 20.1744 20.1744 19.3714 20.6777 18.3838C20.9419 17.8654 21.0929 17.2334 21.1709 16.2793C21.2495 15.3165 21.25 14.0925 21.25 12.4004V11.5996ZM15.25 15.667C15.25 14.6084 14.3916 13.75 13.333 13.75H10.667C9.60845 13.75 8.75 14.6084 8.75 15.667C8.75018 15.9889 9.0111 16.2498 9.33301 16.25H14.667C14.9889 16.2498 15.2498 15.9889 15.25 15.667ZM13.25 8C13.25 7.30964 12.6904 6.75 12 6.75C11.3096 6.75 10.75 7.30964 10.75 8C10.75 8.69036 11.3096 9.25 12 9.25C12.6904 9.25 13.25 8.69036 13.25 8ZM16.75 15.667C16.7498 16.8173 15.8173 17.7498 14.667 17.75H9.33301C8.18267 17.7498 7.25018 16.8173 7.25 15.667C7.25 13.78 8.78002 12.25 10.667 12.25H13.333C15.22 12.25 16.75 13.78 16.75 15.667ZM22.75 12.4004C22.75 14.068 22.7508 15.3643 22.666 16.4023C22.5805 17.449 22.4044 18.2995 22.0146 19.0645C21.3675 20.3345 20.3345 21.3675 19.0645 22.0146C18.2995 22.4044 17.449 22.5805 16.4023 22.666C15.3643 22.7508 14.068 22.75 12.4004 22.75H11.5996C9.93202 22.75 8.63571 22.7508 7.59766 22.666C6.55103 22.5805 5.70049 22.4044 4.93555 22.0146C3.66545 21.3675 2.6325 20.3345 1.98535 19.0645C1.59562 18.2995 1.41953 17.449 1.33398 16.4023C1.24917 15.3643 1.25 14.068 1.25 12.4004V11.5996C1.25 9.93202 1.24917 8.63571 1.33398 7.59766C1.41953 6.55103 1.59562 5.70049 1.98535 4.93555C2.6325 3.66545 3.66545 2.6325 4.93555 1.98535C5.70049 1.59562 6.55103 1.41953 7.59766 1.33398C8.63571 1.24917 9.93202 1.25 11.5996 1.25H12.4004C14.068 1.25 15.3643 1.24917 16.4023 1.33398C17.449 1.41953 18.2995 1.59562 19.0645 1.98535C20.3345 2.6325 21.3675 3.66545 22.0146 4.93555C22.4044 5.70049 22.5805 6.55103 22.666 7.59766C22.7508 8.63571 22.75 9.93202 22.75 11.5996V12.4004ZM14.75 8C14.75 9.51878 13.5188 10.75 12 10.75C10.4812 10.75 9.25 9.51878 9.25 8C9.25 6.48122 10.4812 5.25 12 5.25C13.5188 5.25 14.75 6.48122 14.75 8Z"
|
|
3605
3506
|
};
|
|
3606
|
-
const iconStyles =
|
|
3507
|
+
const iconStyles = avatar.tv({
|
|
3607
3508
|
base: "inline-block shrink-0 transition-colors",
|
|
3608
3509
|
variants: {
|
|
3609
3510
|
size: {
|
|
@@ -3677,7 +3578,7 @@ const Icon = React.forwardRef(
|
|
|
3677
3578
|
clipRule: "evenodd",
|
|
3678
3579
|
role: decorative ? void 0 : "img",
|
|
3679
3580
|
"aria-hidden": decorative ? true : void 0,
|
|
3680
|
-
className:
|
|
3581
|
+
className: avatar.cn(iconStyles({ size: preset ? size : void 0, tone }), className),
|
|
3681
3582
|
style: { ...sizeStyle, ...color ? { color } : void 0, ...style },
|
|
3682
3583
|
...props,
|
|
3683
3584
|
children: [
|
|
@@ -3689,7 +3590,7 @@ const Icon = React.forwardRef(
|
|
|
3689
3590
|
}
|
|
3690
3591
|
);
|
|
3691
3592
|
Icon.displayName = "Icon";
|
|
3692
|
-
const dateSeparatorChipStyles =
|
|
3593
|
+
const dateSeparatorChipStyles = avatar.tv({
|
|
3693
3594
|
slots: {
|
|
3694
3595
|
root: "flex w-full items-center justify-center",
|
|
3695
3596
|
rule: "flex-1",
|
|
@@ -3723,13 +3624,13 @@ function DateSeparatorChip({
|
|
|
3723
3624
|
icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "xs" }) : null,
|
|
3724
3625
|
label
|
|
3725
3626
|
] });
|
|
3726
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", "aria-label": label, className:
|
|
3727
|
-
/* @__PURE__ */ jsxRuntime.jsx(Separator, { decorative: true, className: styles2.rule() }),
|
|
3627
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", "aria-label": label, className: avatar.cn(styles2.root(), className), children: isBoundary ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3628
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Separator, { decorative: true, className: styles2.rule() }),
|
|
3728
3629
|
chip,
|
|
3729
|
-
/* @__PURE__ */ jsxRuntime.jsx(Separator, { decorative: true, className: styles2.rule() })
|
|
3630
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Separator, { decorative: true, className: styles2.rule() })
|
|
3730
3631
|
] }) : chip });
|
|
3731
3632
|
}
|
|
3732
|
-
const emptyStateStyles =
|
|
3633
|
+
const emptyStateStyles = avatar.tv({
|
|
3733
3634
|
slots: {
|
|
3734
3635
|
root: "flex flex-col items-center justify-center gap-gp-md text-center",
|
|
3735
3636
|
icon: "inline-flex shrink-0 items-center justify-center text-fg-subtle [&_svg]:size-full",
|
|
@@ -3789,7 +3690,7 @@ function EmptyState({
|
|
|
3789
3690
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: styles2.title(), children: title2 }),
|
|
3790
3691
|
description2 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles2.description(), children: description2 }),
|
|
3791
3692
|
action != null && (isActionConfig(action) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.action(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3792
|
-
|
|
3693
|
+
avatar.Button,
|
|
3793
3694
|
{
|
|
3794
3695
|
type: "button",
|
|
3795
3696
|
size: ACTION_BUTTON_SIZE[size],
|
|
@@ -3801,7 +3702,7 @@ function EmptyState({
|
|
|
3801
3702
|
) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.action(), children: action }))
|
|
3802
3703
|
] });
|
|
3803
3704
|
}
|
|
3804
|
-
const fileUploadFieldStyles =
|
|
3705
|
+
const fileUploadFieldStyles = avatar.tv({
|
|
3805
3706
|
slots: {
|
|
3806
3707
|
dropzone: [
|
|
3807
3708
|
"flex w-full flex-col items-center justify-center text-center",
|
|
@@ -3964,7 +3865,7 @@ function FileUploadField({
|
|
|
3964
3865
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.fileName(), children: displayName })
|
|
3965
3866
|
] }) }),
|
|
3966
3867
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.removeWrap(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3967
|
-
|
|
3868
|
+
avatar.Button,
|
|
3968
3869
|
{
|
|
3969
3870
|
type: "button",
|
|
3970
3871
|
color: "critical",
|
|
@@ -3981,7 +3882,7 @@ function FileUploadField({
|
|
|
3981
3882
|
}
|
|
3982
3883
|
);
|
|
3983
3884
|
}
|
|
3984
|
-
const messageAckStyles =
|
|
3885
|
+
const messageAckStyles = avatar.tv({
|
|
3985
3886
|
slots: {
|
|
3986
3887
|
icon: "inline-block shrink-0 align-middle size-icon-xs"
|
|
3987
3888
|
},
|
|
@@ -3997,18 +3898,18 @@ const messageAckStyles = useTheme.tv({
|
|
|
3997
3898
|
const MessageAck = ({ ack, error = false, className }) => {
|
|
3998
3899
|
if (error) {
|
|
3999
3900
|
const styles22 = messageAckStyles({ tone: "danger" });
|
|
4000
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { "aria-hidden": true, className:
|
|
3901
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { "aria-hidden": true, className: avatar.cn(styles22.icon(), className) });
|
|
4001
3902
|
}
|
|
4002
3903
|
const tone = ack >= 4 ? "success" : "muted";
|
|
4003
3904
|
const styles2 = messageAckStyles({ tone });
|
|
4004
|
-
const iconClassName =
|
|
3905
|
+
const iconClassName = avatar.cn(styles2.icon(), className);
|
|
4005
3906
|
if (ack >= 4) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { "aria-hidden": true, className: iconClassName });
|
|
4006
3907
|
if (ack === 3) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { "aria-hidden": true, className: iconClassName });
|
|
4007
3908
|
if (ack === 2) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": true, className: iconClassName });
|
|
4008
3909
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { "aria-hidden": true, className: iconClassName });
|
|
4009
3910
|
};
|
|
4010
3911
|
MessageAck.displayName = "MessageAck";
|
|
4011
|
-
const messageBubbleStyles =
|
|
3912
|
+
const messageBubbleStyles = avatar.tv({
|
|
4012
3913
|
slots: {
|
|
4013
3914
|
row: "group/bubble flex w-full items-end gap-gp-sm",
|
|
4014
3915
|
avatarSlot: "shrink-0 self-end",
|
|
@@ -4193,7 +4094,7 @@ function MessageMediaRenderer({
|
|
|
4193
4094
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles$1.mediaDocHint(), children: "Toque para baixar" })
|
|
4194
4095
|
] }),
|
|
4195
4096
|
mediaUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4196
|
-
|
|
4097
|
+
avatar.Button,
|
|
4197
4098
|
{
|
|
4198
4099
|
type: "button",
|
|
4199
4100
|
size: "xs",
|
|
@@ -4272,7 +4173,7 @@ function MessageBubble({
|
|
|
4272
4173
|
isDeleted = false,
|
|
4273
4174
|
tail = true,
|
|
4274
4175
|
authorName,
|
|
4275
|
-
avatar,
|
|
4176
|
+
avatar: avatar$1,
|
|
4276
4177
|
actions,
|
|
4277
4178
|
onMediaClick,
|
|
4278
4179
|
className
|
|
@@ -4283,17 +4184,17 @@ function MessageBubble({
|
|
|
4283
4184
|
const hasMedia = !isDeleted && mediaType !== "text";
|
|
4284
4185
|
const showAck = side === "sent" && ack !== void 0 && !isDeleted;
|
|
4285
4186
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.row({ className }), children: [
|
|
4286
|
-
avatar ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.avatarSlot(), children: avatar }) : null,
|
|
4187
|
+
avatar$1 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.avatarSlot(), children: avatar$1 }) : null,
|
|
4287
4188
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.column(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.bubble(), children: [
|
|
4288
4189
|
actions && !isDeleted ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4289
|
-
|
|
4190
|
+
avatar.Popover,
|
|
4290
4191
|
{
|
|
4291
4192
|
open: actionsOpen,
|
|
4292
4193
|
onOpenChange: setActionsOpen,
|
|
4293
4194
|
modal: false,
|
|
4294
4195
|
children: [
|
|
4295
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4296
|
-
|
|
4196
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4197
|
+
avatar.Button,
|
|
4297
4198
|
{
|
|
4298
4199
|
type: "button",
|
|
4299
4200
|
size: "2xs",
|
|
@@ -4308,7 +4209,7 @@ function MessageBubble({
|
|
|
4308
4209
|
}
|
|
4309
4210
|
) }),
|
|
4310
4211
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4311
|
-
|
|
4212
|
+
avatar.PopoverContent,
|
|
4312
4213
|
{
|
|
4313
4214
|
align: side === "sent" ? "end" : "start",
|
|
4314
4215
|
role: "menu",
|
|
@@ -4358,7 +4259,7 @@ function MessageBubble({
|
|
|
4358
4259
|
] });
|
|
4359
4260
|
}
|
|
4360
4261
|
MessageBubble.displayName = "MessageBubble";
|
|
4361
|
-
const messageComposerStyles =
|
|
4262
|
+
const messageComposerStyles = avatar.tv({
|
|
4362
4263
|
slots: {
|
|
4363
4264
|
root: [
|
|
4364
4265
|
"flex w-full flex-col",
|
|
@@ -4465,11 +4366,11 @@ const MessageComposer = React.forwardRef(function MessageComposer2({
|
|
|
4465
4366
|
replyPreview ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.replyPreview(), children: replyPreview }) : null,
|
|
4466
4367
|
banner ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.banner(), children: banner }) : null,
|
|
4467
4368
|
!isReadOnly && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4468
|
-
(replyPreview || banner) && /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
|
|
4369
|
+
(replyPreview || banner) && /* @__PURE__ */ jsxRuntime.jsx(tooltip.Separator, {}),
|
|
4469
4370
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.field(), children: [
|
|
4470
4371
|
toolbarStart ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.toolbarStart(), children: toolbarStart }) : null,
|
|
4471
4372
|
recording ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.recording(), children: recording }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.inputArea(), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4472
|
-
|
|
4373
|
+
textarea.Textarea,
|
|
4473
4374
|
{
|
|
4474
4375
|
ref: setRefs,
|
|
4475
4376
|
rows: 1,
|
|
@@ -4484,7 +4385,7 @@ const MessageComposer = React.forwardRef(function MessageComposer2({
|
|
|
4484
4385
|
) }),
|
|
4485
4386
|
toolbarEnd ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.toolbarEnd(), children: toolbarEnd }) : null,
|
|
4486
4387
|
!recording && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4487
|
-
|
|
4388
|
+
avatar.Button,
|
|
4488
4389
|
{
|
|
4489
4390
|
type: "button",
|
|
4490
4391
|
size: size === "sm" ? "icon-sm" : "icon-md",
|
|
@@ -4504,7 +4405,7 @@ const MessageComposer = React.forwardRef(function MessageComposer2({
|
|
|
4504
4405
|
] })
|
|
4505
4406
|
] });
|
|
4506
4407
|
});
|
|
4507
|
-
const messageVariablesPickerStyles =
|
|
4408
|
+
const messageVariablesPickerStyles = avatar.tv({
|
|
4508
4409
|
slots: {
|
|
4509
4410
|
/** Container interno do PopoverContent. */
|
|
4510
4411
|
content: "flex flex-col gap-gp-md p-sp-sm min-w-[200px]",
|
|
@@ -4555,9 +4456,9 @@ function MessageVariablesPicker({
|
|
|
4555
4456
|
if (closeOnSelect) setOpen(false);
|
|
4556
4457
|
};
|
|
4557
4458
|
const buttonSize = triggerVariant === "icon" ? size === "md" ? "icon-md" : "icon-sm" : size;
|
|
4558
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4559
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4560
|
-
|
|
4459
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.Popover, { open, onOpenChange: setOpen, children: [
|
|
4460
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverTrigger, { asChild: true, children: triggerVariant === "icon" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4461
|
+
avatar.Button,
|
|
4561
4462
|
{
|
|
4562
4463
|
type: "button",
|
|
4563
4464
|
color: "primary",
|
|
@@ -4570,7 +4471,7 @@ function MessageVariablesPicker({
|
|
|
4570
4471
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "line-code" })
|
|
4571
4472
|
}
|
|
4572
4473
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
4573
|
-
|
|
4474
|
+
avatar.Button,
|
|
4574
4475
|
{
|
|
4575
4476
|
type: "button",
|
|
4576
4477
|
color: "primary",
|
|
@@ -4583,10 +4484,10 @@ function MessageVariablesPicker({
|
|
|
4583
4484
|
children: label
|
|
4584
4485
|
}
|
|
4585
4486
|
) }),
|
|
4586
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4487
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverContent, { align: "start", sideOffset: 6, mobileSheet: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles2.content(), children: [
|
|
4587
4488
|
variables.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4588
4489
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.header(), children: "Variáveis disponíveis" }),
|
|
4589
|
-
/* @__PURE__ */ jsxRuntime.jsx(Separator, {})
|
|
4490
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Separator, {})
|
|
4590
4491
|
] }),
|
|
4591
4492
|
variables.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles2.empty(), children: "Nenhuma variável disponível" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.list(), children: variables.map((variable) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4592
4493
|
useTheme.Chip,
|
|
@@ -4605,7 +4506,7 @@ function MessageVariablesPicker({
|
|
|
4605
4506
|
] }) })
|
|
4606
4507
|
] });
|
|
4607
4508
|
}
|
|
4608
|
-
const dialog =
|
|
4509
|
+
const dialog = avatar.tv({
|
|
4609
4510
|
base: [
|
|
4610
4511
|
// Override do DialogContent default (grid + p-pad-4xl + rounded-radius-base + shadow-sh-xl)
|
|
4611
4512
|
"!gap-0 !p-0",
|
|
@@ -4637,7 +4538,7 @@ const dialog = useTheme.tv({
|
|
|
4637
4538
|
},
|
|
4638
4539
|
defaultVariants: { size: "md" }
|
|
4639
4540
|
});
|
|
4640
|
-
const closeBtn =
|
|
4541
|
+
const closeBtn = avatar.tv({
|
|
4641
4542
|
base: [
|
|
4642
4543
|
"absolute top-[14px] right-[14px] z-[1]",
|
|
4643
4544
|
"grid place-items-center size-[28px]",
|
|
@@ -4649,7 +4550,7 @@ const closeBtn = useTheme.tv({
|
|
|
4649
4550
|
"dark:hover:bg-bg-muted-hover"
|
|
4650
4551
|
]
|
|
4651
4552
|
});
|
|
4652
|
-
const head =
|
|
4553
|
+
const head = avatar.tv({
|
|
4653
4554
|
base: [
|
|
4654
4555
|
"flex items-center gap-[14px]",
|
|
4655
4556
|
"px-pad-4xl pt-pad-4xl pb-pad-3xl",
|
|
@@ -4661,7 +4562,7 @@ const head = useTheme.tv({
|
|
|
4661
4562
|
withIcon: { false: "", true: "" }
|
|
4662
4563
|
}
|
|
4663
4564
|
});
|
|
4664
|
-
const headIcon =
|
|
4565
|
+
const headIcon = avatar.tv({
|
|
4665
4566
|
base: [
|
|
4666
4567
|
"shrink-0 grid place-items-center size-form-lg",
|
|
4667
4568
|
// 40×40
|
|
@@ -4671,7 +4572,7 @@ const headIcon = useTheme.tv({
|
|
|
4671
4572
|
"dark:bg-bg-accent dark:border-border-subtle"
|
|
4672
4573
|
]
|
|
4673
4574
|
});
|
|
4674
|
-
const headTitleWrap =
|
|
4575
|
+
const headTitleWrap = avatar.tv({
|
|
4675
4576
|
base: [
|
|
4676
4577
|
"flex-1 min-w-0",
|
|
4677
4578
|
"flex flex-col justify-center",
|
|
@@ -4680,7 +4581,7 @@ const headTitleWrap = useTheme.tv({
|
|
|
4680
4581
|
// reserva espaço pro X close (right-14 + 28px) — evita overlap
|
|
4681
4582
|
]
|
|
4682
4583
|
});
|
|
4683
|
-
const title =
|
|
4584
|
+
const title = avatar.tv({
|
|
4684
4585
|
base: [
|
|
4685
4586
|
"m-0 mb-[2px]",
|
|
4686
4587
|
"text-body-lg font-bold leading-[1.3]",
|
|
@@ -4688,10 +4589,10 @@ const title = useTheme.tv({
|
|
|
4688
4589
|
"tracking-[-0.01em]"
|
|
4689
4590
|
]
|
|
4690
4591
|
});
|
|
4691
|
-
const description =
|
|
4592
|
+
const description = avatar.tv({
|
|
4692
4593
|
base: "m-0 text-body-xs font-normal text-fg-muted leading-[1.45]"
|
|
4693
4594
|
});
|
|
4694
|
-
const body =
|
|
4595
|
+
const body = avatar.tv({
|
|
4695
4596
|
// `min-h-0` é o que permite o flex item encolher e a rolagem acontecer aqui,
|
|
4696
4597
|
// em vez de o conteúdo empurrar o container para fora da tela. Sem ele,
|
|
4697
4598
|
// `overflow-y-auto` não tem efeito nenhum dentro de um flex column.
|
|
@@ -4700,7 +4601,7 @@ const body = useTheme.tv({
|
|
|
4700
4601
|
"min-h-0 flex-1 overflow-y-auto"
|
|
4701
4602
|
]
|
|
4702
4603
|
});
|
|
4703
|
-
const foot =
|
|
4604
|
+
const foot = avatar.tv({
|
|
4704
4605
|
base: [
|
|
4705
4606
|
"flex items-center gap-gp-lg",
|
|
4706
4607
|
// gap 10px
|
|
@@ -4715,7 +4616,7 @@ const foot = useTheme.tv({
|
|
|
4715
4616
|
},
|
|
4716
4617
|
defaultVariants: { layout: "end" }
|
|
4717
4618
|
});
|
|
4718
|
-
const footRight =
|
|
4619
|
+
const footRight = avatar.tv({
|
|
4719
4620
|
base: "flex items-center gap-gp-lg"
|
|
4720
4621
|
});
|
|
4721
4622
|
function Modal({
|
|
@@ -4742,20 +4643,20 @@ function Modal({
|
|
|
4742
4643
|
if (!closeOnOverlay) return;
|
|
4743
4644
|
onClose();
|
|
4744
4645
|
};
|
|
4745
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4746
|
-
|
|
4646
|
+
return /* @__PURE__ */ jsxRuntime.jsx(avatar.Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4647
|
+
avatar.DialogContent,
|
|
4747
4648
|
{
|
|
4748
4649
|
className: dialog({ size, className }),
|
|
4749
4650
|
hideClose: true,
|
|
4750
4651
|
...description$1 ? {} : { "aria-describedby": void 0 },
|
|
4751
4652
|
children: [
|
|
4752
|
-
!title$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4753
|
-
!hideClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4653
|
+
!title$1 && /* @__PURE__ */ jsxRuntime.jsx(avatar.DialogTitle, { className: "sr-only", children: "Diálogo" }),
|
|
4654
|
+
!hideClose && /* @__PURE__ */ jsxRuntime.jsx(avatar.DialogClose, { className: closeBtn(), "aria-label": "Fechar", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-icon-sm" }) }),
|
|
4754
4655
|
hasHeader && /* @__PURE__ */ jsxRuntime.jsxs("header", { className: head(), children: [
|
|
4755
4656
|
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: headIcon(), "aria-hidden": "true", children: icon }),
|
|
4756
4657
|
(title$1 || description$1) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: headTitleWrap(), children: [
|
|
4757
|
-
title$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4758
|
-
description$1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4658
|
+
title$1 && /* @__PURE__ */ jsxRuntime.jsx(avatar.DialogTitle, { className: title(), children: title$1 }),
|
|
4659
|
+
description$1 && /* @__PURE__ */ jsxRuntime.jsx(avatar.DialogDescription, { className: description(), children: description$1 })
|
|
4759
4660
|
] })
|
|
4760
4661
|
] }),
|
|
4761
4662
|
children !== void 0 && children !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: body(), children }),
|
|
@@ -4787,7 +4688,7 @@ function StructuredActions({
|
|
|
4787
4688
|
onClose
|
|
4788
4689
|
}) {
|
|
4789
4690
|
const renderTertiary = tertiary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4790
|
-
|
|
4691
|
+
avatar.Button,
|
|
4791
4692
|
{
|
|
4792
4693
|
color: tertiary.danger ? "critical" : "secondary",
|
|
4793
4694
|
variant: "ghost",
|
|
@@ -4799,7 +4700,7 @@ function StructuredActions({
|
|
|
4799
4700
|
}
|
|
4800
4701
|
);
|
|
4801
4702
|
const renderSecondary = secondary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4802
|
-
|
|
4703
|
+
avatar.Button,
|
|
4803
4704
|
{
|
|
4804
4705
|
color: "secondary",
|
|
4805
4706
|
variant: "outline",
|
|
@@ -4811,7 +4712,7 @@ function StructuredActions({
|
|
|
4811
4712
|
}
|
|
4812
4713
|
);
|
|
4813
4714
|
const renderPrimary = primary && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4814
|
-
|
|
4715
|
+
avatar.Button,
|
|
4815
4716
|
{
|
|
4816
4717
|
color: primary.danger ? "critical" : "primary",
|
|
4817
4718
|
variant: "filled",
|
|
@@ -4836,7 +4737,7 @@ function StructuredActions({
|
|
|
4836
4737
|
renderPrimary
|
|
4837
4738
|
] });
|
|
4838
4739
|
}
|
|
4839
|
-
const monthYearStyles =
|
|
4740
|
+
const monthYearStyles = avatar.tv({
|
|
4840
4741
|
slots: {
|
|
4841
4742
|
trigger: [
|
|
4842
4743
|
"flex min-h-form-lg w-full items-center justify-between gap-gp-md",
|
|
@@ -4871,7 +4772,7 @@ const monthYearStyles = useTheme.tv({
|
|
|
4871
4772
|
grid: "grid grid-cols-3 gap-gp-sm"
|
|
4872
4773
|
}
|
|
4873
4774
|
});
|
|
4874
|
-
const monthYearMonthButton =
|
|
4775
|
+
const monthYearMonthButton = avatar.tv({
|
|
4875
4776
|
base: [
|
|
4876
4777
|
"flex items-center justify-center min-h-form-md px-pad-md",
|
|
4877
4778
|
"rounded-radius-base text-body-sm font-medium",
|
|
@@ -4965,8 +4866,8 @@ const MonthYearPicker = React.forwardRef(function MonthYearPicker2({
|
|
|
4965
4866
|
onValueChange?.(next);
|
|
4966
4867
|
setOpen(false);
|
|
4967
4868
|
};
|
|
4968
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4969
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4869
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.Popover, { open, onOpenChange: setOpen, children: [
|
|
4870
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4970
4871
|
"button",
|
|
4971
4872
|
{
|
|
4972
4873
|
ref,
|
|
@@ -4990,7 +4891,7 @@ const MonthYearPicker = React.forwardRef(function MonthYearPicker2({
|
|
|
4990
4891
|
}
|
|
4991
4892
|
) }),
|
|
4992
4893
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4993
|
-
|
|
4894
|
+
avatar.PopoverContent,
|
|
4994
4895
|
{
|
|
4995
4896
|
align,
|
|
4996
4897
|
className: styles2.content({ className: contentClassName }),
|
|
@@ -5046,44 +4947,6 @@ const MonthYearPicker = React.forwardRef(function MonthYearPicker2({
|
|
|
5046
4947
|
] });
|
|
5047
4948
|
});
|
|
5048
4949
|
MonthYearPicker.displayName = "MonthYearPicker";
|
|
5049
|
-
const TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
5050
|
-
const TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
5051
|
-
const Tooltip = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { ...props, children }) });
|
|
5052
|
-
Tooltip.displayName = "Tooltip";
|
|
5053
|
-
const TooltipContent = React__namespace.forwardRef(({ className, sideOffset = 6, showArrow = true, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5054
|
-
TooltipPrimitive__namespace.Content,
|
|
5055
|
-
{
|
|
5056
|
-
ref,
|
|
5057
|
-
sideOffset,
|
|
5058
|
-
className: useTheme.cn(
|
|
5059
|
-
"z-50 max-w-[16rem] select-none",
|
|
5060
|
-
"bg-bg-emphasis text-fg-default",
|
|
5061
|
-
"rounded-radius-md px-pad-lg py-pad-xs",
|
|
5062
|
-
"text-caption-sm",
|
|
5063
|
-
"shadow-sh-md",
|
|
5064
|
-
"origin-[--radix-tooltip-content-transform-origin]",
|
|
5065
|
-
"data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out",
|
|
5066
|
-
"data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0",
|
|
5067
|
-
"data-[state=closed]:zoom-out-95 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95",
|
|
5068
|
-
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
|
|
5069
|
-
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
5070
|
-
className
|
|
5071
|
-
),
|
|
5072
|
-
...props,
|
|
5073
|
-
children: [
|
|
5074
|
-
children,
|
|
5075
|
-
showArrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5076
|
-
TooltipPrimitive__namespace.Arrow,
|
|
5077
|
-
{
|
|
5078
|
-
width: 11,
|
|
5079
|
-
height: 5,
|
|
5080
|
-
className: "fill-bg-emphasis"
|
|
5081
|
-
}
|
|
5082
|
-
)
|
|
5083
|
-
]
|
|
5084
|
-
}
|
|
5085
|
-
) }));
|
|
5086
|
-
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
5087
4950
|
const SingleMenuSidebarContext = React.createContext({
|
|
5088
4951
|
expanded: true,
|
|
5089
4952
|
isHoverExpand: false,
|
|
@@ -5160,7 +5023,7 @@ function useSingleMenuSidebarState(defaultExpanded, controlledExpanded, onExpand
|
|
|
5160
5023
|
setOpenCategoryId
|
|
5161
5024
|
};
|
|
5162
5025
|
}
|
|
5163
|
-
const sidebarRoot =
|
|
5026
|
+
const sidebarRoot = avatar.tv({
|
|
5164
5027
|
base: [
|
|
5165
5028
|
"relative flex h-full flex-col overflow-x-hidden",
|
|
5166
5029
|
"border-r border-border-sidebar bg-bg-sidebar",
|
|
@@ -5178,7 +5041,7 @@ const sidebarRoot = useTheme.tv({
|
|
|
5178
5041
|
expanded: true
|
|
5179
5042
|
}
|
|
5180
5043
|
});
|
|
5181
|
-
const category =
|
|
5044
|
+
const category = avatar.tv({
|
|
5182
5045
|
slots: {
|
|
5183
5046
|
root: "flex items-center rounded-radius-lg cursor-pointer transition-all",
|
|
5184
5047
|
text: "flex-1 text-left text-body-sm whitespace-nowrap overflow-hidden text-ellipsis",
|
|
@@ -5213,7 +5076,7 @@ const category = useTheme.tv({
|
|
|
5213
5076
|
collapsed: false
|
|
5214
5077
|
}
|
|
5215
5078
|
});
|
|
5216
|
-
const menuItem =
|
|
5079
|
+
const menuItem = avatar.tv({
|
|
5217
5080
|
slots: {
|
|
5218
5081
|
root: "flex h-[38px] items-center gap-[18px] pl-[18px] pr-pad-2xl cursor-pointer transition-colors hover:bg-bg-sidebar-accent",
|
|
5219
5082
|
border: "h-full w-0 shrink-0",
|
|
@@ -5311,14 +5174,14 @@ function SingleMenuHeader({
|
|
|
5311
5174
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5312
5175
|
"div",
|
|
5313
5176
|
{
|
|
5314
|
-
className:
|
|
5177
|
+
className: avatar.cn(
|
|
5315
5178
|
styles.header.wrapper,
|
|
5316
5179
|
!expanded && styles.header.wrapperCollapsed
|
|
5317
5180
|
),
|
|
5318
5181
|
children: [
|
|
5319
5182
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.header.inner, children: [
|
|
5320
5183
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.header.logo, children: logo }),
|
|
5321
|
-
expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
5184
|
+
expanded && /* @__PURE__ */ jsxRuntime.jsx("span", { className: avatar.cn(styles.header.title, styles.textFadeIn), children: title2 })
|
|
5322
5185
|
] }),
|
|
5323
5186
|
expanded ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5324
5187
|
"button",
|
|
@@ -5330,7 +5193,7 @@ function SingleMenuHeader({
|
|
|
5330
5193
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5331
5194
|
lucideReact.PanelLeftClose,
|
|
5332
5195
|
{
|
|
5333
|
-
className:
|
|
5196
|
+
className: avatar.cn(
|
|
5334
5197
|
"size-icon-sm transition-transform duration-300",
|
|
5335
5198
|
isFlipped && "rotate-180"
|
|
5336
5199
|
)
|
|
@@ -5347,7 +5210,7 @@ function SingleMenuHeader({
|
|
|
5347
5210
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5348
5211
|
lucideReact.PanelLeftClose,
|
|
5349
5212
|
{
|
|
5350
|
-
className:
|
|
5213
|
+
className: avatar.cn(
|
|
5351
5214
|
styles.header.expandBtnIcon,
|
|
5352
5215
|
"transition-transform duration-300 rotate-180"
|
|
5353
5216
|
)
|
|
@@ -5379,14 +5242,14 @@ function SingleMenuModuleSelector({
|
|
|
5379
5242
|
if (!options || options.length === 0) {
|
|
5380
5243
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.trigger, children: triggerContent });
|
|
5381
5244
|
}
|
|
5382
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5383
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5384
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5245
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.DropdownMenu, { children: [
|
|
5246
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuTrigger, { className: s.trigger, children: triggerContent }),
|
|
5247
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuContent, { side: "bottom", sideOffset: 4, align: "start", children: options.map((option) => {
|
|
5385
5248
|
const isSelected = option.label === title2;
|
|
5386
5249
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5387
|
-
|
|
5250
|
+
avatar.DropdownMenuItem,
|
|
5388
5251
|
{
|
|
5389
|
-
className:
|
|
5252
|
+
className: avatar.cn(
|
|
5390
5253
|
s.dropdownItem,
|
|
5391
5254
|
isSelected && s.dropdownItemSelected
|
|
5392
5255
|
),
|
|
@@ -5431,13 +5294,13 @@ function SingleMenuCommand({
|
|
|
5431
5294
|
onSelect(id, parentId);
|
|
5432
5295
|
onOpenChange(false);
|
|
5433
5296
|
};
|
|
5434
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5435
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5436
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5437
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5297
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(avatar.CommandDialog, { open, onOpenChange, children: [
|
|
5298
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.CommandInput, { placeholder }),
|
|
5299
|
+
/* @__PURE__ */ jsxRuntime.jsxs(avatar.CommandList, { children: [
|
|
5300
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.CommandEmpty, { children: "Nenhum resultado." }),
|
|
5438
5301
|
custom ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5439
|
-
leaves.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5440
|
-
|
|
5302
|
+
leaves.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(avatar.CommandGroup, { heading: "Menu", children: leaves.map((c) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5303
|
+
avatar.CommandItem,
|
|
5441
5304
|
{
|
|
5442
5305
|
value: c.label,
|
|
5443
5306
|
onSelect: () => handle(c.id),
|
|
@@ -5448,8 +5311,8 @@ function SingleMenuCommand({
|
|
|
5448
5311
|
},
|
|
5449
5312
|
c.id
|
|
5450
5313
|
)) }),
|
|
5451
|
-
groups.map((cat) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5452
|
-
|
|
5314
|
+
groups.map((cat) => /* @__PURE__ */ jsxRuntime.jsx(avatar.CommandGroup, { heading: cat.label, children: cat.items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5315
|
+
avatar.CommandItem,
|
|
5453
5316
|
{
|
|
5454
5317
|
value: `${cat.label} ${item.label}`,
|
|
5455
5318
|
onSelect: () => handle(item.id, cat.id),
|
|
@@ -5462,9 +5325,6 @@ function SingleMenuCommand({
|
|
|
5462
5325
|
] });
|
|
5463
5326
|
}
|
|
5464
5327
|
SingleMenuCommand.displayName = "SingleMenuCommand";
|
|
5465
|
-
const Collapsible = CollapsiblePrimitive__namespace.Root;
|
|
5466
|
-
const CollapsibleTrigger = CollapsiblePrimitive__namespace.CollapsibleTrigger;
|
|
5467
|
-
const CollapsibleContent = CollapsiblePrimitive__namespace.CollapsibleContent;
|
|
5468
5328
|
function SingleMenuItem({
|
|
5469
5329
|
label,
|
|
5470
5330
|
selected = false,
|
|
@@ -5506,9 +5366,9 @@ function SingleMenuCategory({
|
|
|
5506
5366
|
}
|
|
5507
5367
|
};
|
|
5508
5368
|
if (!expanded) {
|
|
5509
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
5369
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
|
|
5510
5370
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5511
|
-
TooltipTrigger,
|
|
5371
|
+
tooltip.TooltipTrigger,
|
|
5512
5372
|
{
|
|
5513
5373
|
role: "button",
|
|
5514
5374
|
tabIndex: 0,
|
|
@@ -5523,17 +5383,17 @@ function SingleMenuCategory({
|
|
|
5523
5383
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.icon(), children: icon })
|
|
5524
5384
|
}
|
|
5525
5385
|
),
|
|
5526
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: "right", sideOffset: 8, children: label })
|
|
5386
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { side: "right", sideOffset: 8, children: label })
|
|
5527
5387
|
] });
|
|
5528
5388
|
}
|
|
5529
5389
|
if (!hasItems) {
|
|
5530
5390
|
return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: handleToggle, className: s.root(), children: [
|
|
5531
5391
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.icon(), children: icon }),
|
|
5532
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
5392
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: avatar.cn(s.text(), styles.textFadeIn), children: label })
|
|
5533
5393
|
] });
|
|
5534
5394
|
}
|
|
5535
5395
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5536
|
-
Collapsible,
|
|
5396
|
+
tooltip.Collapsible,
|
|
5537
5397
|
{
|
|
5538
5398
|
open: isOpen,
|
|
5539
5399
|
onOpenChange: (open) => {
|
|
@@ -5541,12 +5401,12 @@ function SingleMenuCategory({
|
|
|
5541
5401
|
onCategoryClick?.();
|
|
5542
5402
|
},
|
|
5543
5403
|
children: [
|
|
5544
|
-
/* @__PURE__ */ jsxRuntime.jsxs(CollapsibleTrigger, { className: s.root(), children: [
|
|
5404
|
+
/* @__PURE__ */ jsxRuntime.jsxs(tooltip.CollapsibleTrigger, { className: s.root(), children: [
|
|
5545
5405
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.icon(), children: icon }),
|
|
5546
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
5547
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className:
|
|
5406
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: avatar.cn(s.text(), styles.textFadeIn), children: label }),
|
|
5407
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: avatar.cn(s.chevron(), isOpen && "rotate-180") })
|
|
5548
5408
|
] }),
|
|
5549
|
-
/* @__PURE__ */ jsxRuntime.jsx(CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.subItemList, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5409
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.subItemList, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5550
5410
|
SingleMenuItem,
|
|
5551
5411
|
{
|
|
5552
5412
|
label: item.label,
|
|
@@ -5563,14 +5423,14 @@ SingleMenuCategory.displayName = "SingleMenuCategory";
|
|
|
5563
5423
|
function SingleMenuFooter({
|
|
5564
5424
|
name,
|
|
5565
5425
|
email,
|
|
5566
|
-
avatar,
|
|
5426
|
+
avatar: avatar$1,
|
|
5567
5427
|
actions,
|
|
5568
5428
|
onAction
|
|
5569
5429
|
}) {
|
|
5570
5430
|
const { expanded } = useSingleMenuSidebar();
|
|
5571
5431
|
const s = styles.footer;
|
|
5572
5432
|
const triggerContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5573
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.avatar, children: avatar ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: s.avatarIcon }) }),
|
|
5433
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.avatar, children: avatar$1 ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: s.avatarIcon }) }),
|
|
5574
5434
|
expanded && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5575
5435
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.textContainer, children: [
|
|
5576
5436
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.name, children: name }),
|
|
@@ -5580,30 +5440,30 @@ function SingleMenuFooter({
|
|
|
5580
5440
|
] })
|
|
5581
5441
|
] });
|
|
5582
5442
|
if (!actions || actions.length === 0) {
|
|
5583
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
5443
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: avatar.cn(s.button, !expanded && "justify-center px-0"), children: triggerContent }) });
|
|
5584
5444
|
}
|
|
5585
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5445
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.wrapper, children: /* @__PURE__ */ jsxRuntime.jsxs(avatar.DropdownMenu, { children: [
|
|
5586
5446
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5587
|
-
|
|
5447
|
+
avatar.DropdownMenuTrigger,
|
|
5588
5448
|
{
|
|
5589
|
-
className:
|
|
5449
|
+
className: avatar.cn(s.button, !expanded && "justify-center px-0"),
|
|
5590
5450
|
children: triggerContent
|
|
5591
5451
|
}
|
|
5592
5452
|
),
|
|
5593
5453
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5594
|
-
|
|
5454
|
+
avatar.DropdownMenuContent,
|
|
5595
5455
|
{
|
|
5596
5456
|
side: expanded ? "top" : "right",
|
|
5597
5457
|
sideOffset: 8,
|
|
5598
5458
|
align: expanded ? "end" : "start",
|
|
5599
5459
|
children: [
|
|
5600
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5460
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuGroup, { children: /* @__PURE__ */ jsxRuntime.jsxs(avatar.DropdownMenuLabel, { className: s.dropdownLabel, children: [
|
|
5601
5461
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.dropdownLabelName, children: name }),
|
|
5602
5462
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.dropdownLabelEmail, children: email })
|
|
5603
5463
|
] }) }),
|
|
5604
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5464
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuSeparator, {}),
|
|
5605
5465
|
actions.map((action) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5606
|
-
|
|
5466
|
+
avatar.DropdownMenuItem,
|
|
5607
5467
|
{
|
|
5608
5468
|
variant: action.variant === "destructive" ? "destructive" : "default",
|
|
5609
5469
|
onClick: () => onAction?.(action.id),
|
|
@@ -5714,11 +5574,11 @@ function SingleMenuSidebar({
|
|
|
5714
5574
|
]
|
|
5715
5575
|
);
|
|
5716
5576
|
return /* @__PURE__ */ jsxRuntime.jsxs(SingleMenuSidebarContext.Provider, { value: contextValue, children: [
|
|
5717
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5577
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5718
5578
|
"aside",
|
|
5719
5579
|
{
|
|
5720
5580
|
"aria-label": "Navegação lateral",
|
|
5721
|
-
className:
|
|
5581
|
+
className: avatar.cn(sidebarRoot({ expanded }), className),
|
|
5722
5582
|
onMouseEnter,
|
|
5723
5583
|
onMouseLeave,
|
|
5724
5584
|
...props,
|
|
@@ -5732,7 +5592,7 @@ function SingleMenuSidebar({
|
|
|
5732
5592
|
}
|
|
5733
5593
|
),
|
|
5734
5594
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.divider }),
|
|
5735
|
-
expanded && (moduleDisplay || showSearch) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
5595
|
+
expanded && (moduleDisplay || showSearch) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: avatar.cn(styles.sectionPadding, styles.textFadeIn), children: [
|
|
5736
5596
|
moduleDisplay && /* @__PURE__ */ jsxRuntime.jsx(SingleMenuModuleSelector, { ...moduleDisplay }),
|
|
5737
5597
|
showSearch && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5738
5598
|
SingleMenuSearch,
|
|
@@ -5746,7 +5606,7 @@ function SingleMenuSidebar({
|
|
|
5746
5606
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5747
5607
|
"nav",
|
|
5748
5608
|
{
|
|
5749
|
-
className:
|
|
5609
|
+
className: avatar.cn(
|
|
5750
5610
|
styles.navContainer,
|
|
5751
5611
|
expanded ? styles.navContainerExpanded : styles.navContainerCollapsed
|
|
5752
5612
|
),
|
|
@@ -5779,7 +5639,7 @@ function SingleMenuSidebar({
|
|
|
5779
5639
|
] });
|
|
5780
5640
|
}
|
|
5781
5641
|
SingleMenuSidebar.displayName = "SingleMenuSidebar";
|
|
5782
|
-
const spinnerStyles =
|
|
5642
|
+
const spinnerStyles = avatar.tv({
|
|
5783
5643
|
base: ["inline-block shrink-0", "animate-spin motion-reduce:animate-none"],
|
|
5784
5644
|
variants: {
|
|
5785
5645
|
size: {
|
|
@@ -7334,7 +7194,7 @@ function object(topology, o) {
|
|
|
7334
7194
|
}
|
|
7335
7195
|
return geometry(o);
|
|
7336
7196
|
}
|
|
7337
|
-
const choroplethStyles =
|
|
7197
|
+
const choroplethStyles = avatar.tv({
|
|
7338
7198
|
slots: {
|
|
7339
7199
|
root: "relative w-full",
|
|
7340
7200
|
svg: "block h-auto w-full",
|
|
@@ -7490,9 +7350,9 @@ const ChoroplethMap = React.forwardRef(
|
|
|
7490
7350
|
})
|
|
7491
7351
|
}
|
|
7492
7352
|
),
|
|
7493
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.tooltipLayer(), children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { open: hover != null, onOpenChange: () => {
|
|
7353
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles2.tooltipLayer(), children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { open: hover != null, onOpenChange: () => {
|
|
7494
7354
|
}, disableHoverableContent: true, children: [
|
|
7495
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7355
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7496
7356
|
"span",
|
|
7497
7357
|
{
|
|
7498
7358
|
"aria-hidden": "true",
|
|
@@ -7501,7 +7361,7 @@ const ChoroplethMap = React.forwardRef(
|
|
|
7501
7361
|
}
|
|
7502
7362
|
) }),
|
|
7503
7363
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7504
|
-
TooltipContent,
|
|
7364
|
+
tooltip.TooltipContent,
|
|
7505
7365
|
{
|
|
7506
7366
|
showArrow: false,
|
|
7507
7367
|
className: "border border-border-default bg-bg-surface-elevated shadow-sh-lg",
|
|
@@ -7531,6 +7391,1080 @@ const ChoroplethMap = React.forwardRef(
|
|
|
7531
7391
|
}
|
|
7532
7392
|
);
|
|
7533
7393
|
ChoroplethMap.displayName = "ChoroplethMap";
|
|
7394
|
+
const THEMES = { light: "", dark: ".dark" };
|
|
7395
|
+
const ChartContext = React__namespace.createContext(null);
|
|
7396
|
+
function useChart() {
|
|
7397
|
+
const ctx = React__namespace.useContext(ChartContext);
|
|
7398
|
+
if (!ctx) {
|
|
7399
|
+
throw new Error("useChart deve ser usado dentro de <ChartContainer>");
|
|
7400
|
+
}
|
|
7401
|
+
return ctx;
|
|
7402
|
+
}
|
|
7403
|
+
const ChartContainer = React__namespace.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
7404
|
+
const uniqueId = React__namespace.useId();
|
|
7405
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
7406
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7407
|
+
"div",
|
|
7408
|
+
{
|
|
7409
|
+
"data-chart": chartId,
|
|
7410
|
+
ref,
|
|
7411
|
+
className: avatar.cn(
|
|
7412
|
+
"flex aspect-video justify-center text-caption-sm",
|
|
7413
|
+
"[&_.recharts-cartesian-axis-tick_text]:fill-fg-muted",
|
|
7414
|
+
"[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-[var(--color-chart-grid)]",
|
|
7415
|
+
"[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border-default",
|
|
7416
|
+
"[&_.recharts-dot[stroke='#fff']]:stroke-transparent",
|
|
7417
|
+
"[&_.recharts-layer]:outline-none",
|
|
7418
|
+
"[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-[var(--color-chart-grid)]",
|
|
7419
|
+
"[&_.recharts-radial-bar-background-sector]:fill-bg-muted",
|
|
7420
|
+
"[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-bg-muted",
|
|
7421
|
+
"[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border-default",
|
|
7422
|
+
"[&_.recharts-sector[stroke='#fff']]:stroke-transparent",
|
|
7423
|
+
"[&_.recharts-sector]:outline-none",
|
|
7424
|
+
"[&_.recharts-surface]:outline-none",
|
|
7425
|
+
className
|
|
7426
|
+
),
|
|
7427
|
+
...props,
|
|
7428
|
+
children: [
|
|
7429
|
+
/* @__PURE__ */ jsxRuntime.jsx(ChartStyle, { id: chartId, config }),
|
|
7430
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { children })
|
|
7431
|
+
]
|
|
7432
|
+
}
|
|
7433
|
+
) });
|
|
7434
|
+
});
|
|
7435
|
+
ChartContainer.displayName = "ChartContainer";
|
|
7436
|
+
const ChartStyle = ({ id, config }) => {
|
|
7437
|
+
const colorConfig = Object.entries(config).filter(
|
|
7438
|
+
([, c]) => c.theme || c.color
|
|
7439
|
+
);
|
|
7440
|
+
if (!colorConfig.length) return null;
|
|
7441
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7442
|
+
"style",
|
|
7443
|
+
{
|
|
7444
|
+
dangerouslySetInnerHTML: {
|
|
7445
|
+
__html: Object.entries(THEMES).map(
|
|
7446
|
+
([theme, prefix]) => `
|
|
7447
|
+
${prefix} [data-chart=${id}] {
|
|
7448
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
7449
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
7450
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
7451
|
+
}).filter(Boolean).join("\n")}
|
|
7452
|
+
}
|
|
7453
|
+
`
|
|
7454
|
+
).join("\n")
|
|
7455
|
+
}
|
|
7456
|
+
}
|
|
7457
|
+
);
|
|
7458
|
+
};
|
|
7459
|
+
const ChartTooltip = RechartsPrimitive__namespace.Tooltip;
|
|
7460
|
+
const ChartTooltipContent = React__namespace.forwardRef(
|
|
7461
|
+
({
|
|
7462
|
+
active,
|
|
7463
|
+
payload,
|
|
7464
|
+
label,
|
|
7465
|
+
className,
|
|
7466
|
+
indicator = "dot",
|
|
7467
|
+
hideLabel = false,
|
|
7468
|
+
hideIndicator = false,
|
|
7469
|
+
labelFormatter,
|
|
7470
|
+
formatter,
|
|
7471
|
+
nameKey,
|
|
7472
|
+
labelKey
|
|
7473
|
+
}, ref) => {
|
|
7474
|
+
const { config } = useChart();
|
|
7475
|
+
const tooltipLabel = React__namespace.useMemo(() => {
|
|
7476
|
+
if (hideLabel || !payload?.length) return null;
|
|
7477
|
+
const [item] = payload;
|
|
7478
|
+
const key = `${labelKey || item?.dataKey || item?.name || "value"}`;
|
|
7479
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
7480
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
7481
|
+
if (labelFormatter) {
|
|
7482
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-fg-default", children: labelFormatter(value, payload) });
|
|
7483
|
+
}
|
|
7484
|
+
if (!value) return null;
|
|
7485
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-fg-default", children: value });
|
|
7486
|
+
}, [label, labelFormatter, payload, hideLabel, labelKey, config]);
|
|
7487
|
+
if (!active || !payload?.length) return null;
|
|
7488
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
7489
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7490
|
+
"div",
|
|
7491
|
+
{
|
|
7492
|
+
ref,
|
|
7493
|
+
className: avatar.cn(
|
|
7494
|
+
"grid min-w-[8rem] items-start gap-gp-sm rounded-radius-lg border border-border-default bg-bg-surface-elevated px-pad-lg py-pad-md text-caption-sm shadow-sh-lg",
|
|
7495
|
+
className
|
|
7496
|
+
),
|
|
7497
|
+
children: [
|
|
7498
|
+
!nestLabel ? tooltipLabel : null,
|
|
7499
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-gp-sm", children: payload.map((item, index) => {
|
|
7500
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
7501
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
7502
|
+
const indicatorColor = item.color || item.payload?.fill;
|
|
7503
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7504
|
+
"div",
|
|
7505
|
+
{
|
|
7506
|
+
className: avatar.cn(
|
|
7507
|
+
"flex w-full flex-wrap items-stretch gap-gp-md [&>svg]:size-icon-xs [&>svg]:text-fg-muted",
|
|
7508
|
+
indicator === "dot" && "items-center"
|
|
7509
|
+
),
|
|
7510
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, String(item.name), item, index, item.payload) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7511
|
+
itemConfig?.icon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7512
|
+
"div",
|
|
7513
|
+
{
|
|
7514
|
+
className: avatar.cn(
|
|
7515
|
+
"shrink-0 rounded-radius-xs",
|
|
7516
|
+
indicator === "dot" && "size-2.5",
|
|
7517
|
+
indicator === "line" && "w-1",
|
|
7518
|
+
indicator === "dashed" && "w-0 border-[1.5px] border-dashed bg-transparent",
|
|
7519
|
+
nestLabel && indicator === "dashed" && "my-0.5"
|
|
7520
|
+
),
|
|
7521
|
+
style: {
|
|
7522
|
+
backgroundColor: indicator === "dashed" ? "transparent" : indicatorColor,
|
|
7523
|
+
borderColor: indicatorColor
|
|
7524
|
+
}
|
|
7525
|
+
}
|
|
7526
|
+
),
|
|
7527
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7528
|
+
"div",
|
|
7529
|
+
{
|
|
7530
|
+
className: avatar.cn(
|
|
7531
|
+
"flex flex-1 justify-between leading-none",
|
|
7532
|
+
nestLabel ? "items-end" : "items-center"
|
|
7533
|
+
),
|
|
7534
|
+
children: [
|
|
7535
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-gp-2xs", children: [
|
|
7536
|
+
nestLabel ? tooltipLabel : null,
|
|
7537
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-fg-muted", children: itemConfig?.label || item.name })
|
|
7538
|
+
] }),
|
|
7539
|
+
item.value !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium tabular-nums text-fg-default", children: typeof item.value === "number" ? item.value.toLocaleString("pt-BR") : item.value })
|
|
7540
|
+
]
|
|
7541
|
+
}
|
|
7542
|
+
)
|
|
7543
|
+
] })
|
|
7544
|
+
},
|
|
7545
|
+
item.dataKey ?? index
|
|
7546
|
+
);
|
|
7547
|
+
}) })
|
|
7548
|
+
]
|
|
7549
|
+
}
|
|
7550
|
+
);
|
|
7551
|
+
}
|
|
7552
|
+
);
|
|
7553
|
+
ChartTooltipContent.displayName = "ChartTooltipContent";
|
|
7554
|
+
const ChartLegend = RechartsPrimitive__namespace.Legend;
|
|
7555
|
+
const ChartLegendContent = React__namespace.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
|
7556
|
+
const { config } = useChart();
|
|
7557
|
+
if (!payload?.length) return null;
|
|
7558
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7559
|
+
"div",
|
|
7560
|
+
{
|
|
7561
|
+
ref,
|
|
7562
|
+
className: avatar.cn(
|
|
7563
|
+
"flex items-center justify-center gap-gp-xl",
|
|
7564
|
+
verticalAlign === "top" ? "pb-pad-md" : "pt-pad-md",
|
|
7565
|
+
className
|
|
7566
|
+
),
|
|
7567
|
+
children: payload.map((item) => {
|
|
7568
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
7569
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
7570
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7571
|
+
"div",
|
|
7572
|
+
{
|
|
7573
|
+
className: "flex items-center gap-gp-sm text-fg-muted [&>svg]:size-icon-xs [&>svg]:text-fg-muted",
|
|
7574
|
+
children: [
|
|
7575
|
+
itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
7576
|
+
"div",
|
|
7577
|
+
{
|
|
7578
|
+
className: "size-2.5 shrink-0 rounded-radius-xs",
|
|
7579
|
+
style: { backgroundColor: item.color }
|
|
7580
|
+
}
|
|
7581
|
+
),
|
|
7582
|
+
itemConfig?.label
|
|
7583
|
+
]
|
|
7584
|
+
},
|
|
7585
|
+
item.value
|
|
7586
|
+
);
|
|
7587
|
+
})
|
|
7588
|
+
}
|
|
7589
|
+
);
|
|
7590
|
+
});
|
|
7591
|
+
ChartLegendContent.displayName = "ChartLegendContent";
|
|
7592
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
7593
|
+
if (typeof payload !== "object" || payload === null) return void 0;
|
|
7594
|
+
const inner = "payload" in payload && typeof payload.payload === "object" ? payload.payload : void 0;
|
|
7595
|
+
let configLabelKey = key;
|
|
7596
|
+
const p = payload;
|
|
7597
|
+
if (key in p && typeof p[key] === "string") {
|
|
7598
|
+
configLabelKey = p[key];
|
|
7599
|
+
} else if (inner && key in inner && typeof inner[key] === "string") {
|
|
7600
|
+
configLabelKey = inner[key];
|
|
7601
|
+
}
|
|
7602
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
7603
|
+
}
|
|
7604
|
+
function asText$1(v) {
|
|
7605
|
+
return v == null ? "" : String(v);
|
|
7606
|
+
}
|
|
7607
|
+
function isEmptyVal(v) {
|
|
7608
|
+
if (v == null) return true;
|
|
7609
|
+
if (typeof v === "string") return v.length === 0;
|
|
7610
|
+
if (Array.isArray(v)) return v.length === 0;
|
|
7611
|
+
return false;
|
|
7612
|
+
}
|
|
7613
|
+
function matchOp(op, val, fv) {
|
|
7614
|
+
const a = asText$1(val).toLowerCase();
|
|
7615
|
+
const b = asText$1(fv).toLowerCase();
|
|
7616
|
+
switch (op) {
|
|
7617
|
+
case "equals":
|
|
7618
|
+
return a === b;
|
|
7619
|
+
case "neq":
|
|
7620
|
+
return a !== b;
|
|
7621
|
+
case "contains":
|
|
7622
|
+
return a.includes(b);
|
|
7623
|
+
case "notContains":
|
|
7624
|
+
return !a.includes(b);
|
|
7625
|
+
case "startsWith":
|
|
7626
|
+
return a.startsWith(b);
|
|
7627
|
+
case "endsWith":
|
|
7628
|
+
return a.endsWith(b);
|
|
7629
|
+
case "gt":
|
|
7630
|
+
return Number(val) > Number(fv);
|
|
7631
|
+
case "lt":
|
|
7632
|
+
return Number(val) < Number(fv);
|
|
7633
|
+
case "gte":
|
|
7634
|
+
return Number(val) >= Number(fv);
|
|
7635
|
+
case "lte":
|
|
7636
|
+
return Number(val) <= Number(fv);
|
|
7637
|
+
case "between": {
|
|
7638
|
+
const [lo, hi] = Array.isArray(fv) ? fv : [void 0, void 0];
|
|
7639
|
+
const n = Number(val);
|
|
7640
|
+
return (lo == null || n >= Number(lo)) && (hi == null || n <= Number(hi));
|
|
7641
|
+
}
|
|
7642
|
+
case "isEmpty":
|
|
7643
|
+
return isEmptyVal(val);
|
|
7644
|
+
case "isNotEmpty":
|
|
7645
|
+
return !isEmptyVal(val);
|
|
7646
|
+
default:
|
|
7647
|
+
return a === b;
|
|
7648
|
+
}
|
|
7649
|
+
}
|
|
7650
|
+
function applyFilterModel(items, model, fieldsById) {
|
|
7651
|
+
const active = (model?.items ?? []).filter(
|
|
7652
|
+
(it) => it.operator === "isEmpty" || it.operator === "isNotEmpty" || !isEmptyVal(it.value)
|
|
7653
|
+
);
|
|
7654
|
+
if (active.length === 0) return items;
|
|
7655
|
+
const byField = /* @__PURE__ */ new Map();
|
|
7656
|
+
for (const it of active) {
|
|
7657
|
+
if (!byField.has(it.field)) byField.set(it.field, []);
|
|
7658
|
+
byField.get(it.field).push(it);
|
|
7659
|
+
}
|
|
7660
|
+
const matchField = (item, fieldId, group) => {
|
|
7661
|
+
const field = fieldsById.get(fieldId);
|
|
7662
|
+
if (!field) return true;
|
|
7663
|
+
const val = field.accessor(item);
|
|
7664
|
+
const anyOf = group.filter((g) => g.operator === "isAnyOf").map((g) => g.value);
|
|
7665
|
+
const noneOf = group.filter((g) => g.operator === "isNoneOf").map((g) => g.value);
|
|
7666
|
+
const scalar = group.filter((g) => g.operator !== "isAnyOf" && g.operator !== "isNoneOf");
|
|
7667
|
+
if (anyOf.length && !anyOf.some((v) => matchOp("equals", val, v))) return false;
|
|
7668
|
+
if (noneOf.length && noneOf.some((v) => matchOp("equals", val, v))) return false;
|
|
7669
|
+
for (const g of scalar) {
|
|
7670
|
+
if (!matchOp(g.operator, val, g.value)) return false;
|
|
7671
|
+
}
|
|
7672
|
+
return true;
|
|
7673
|
+
};
|
|
7674
|
+
return items.filter((item) => {
|
|
7675
|
+
for (const [fieldId, group] of byField) {
|
|
7676
|
+
if (!matchField(item, fieldId, group)) return false;
|
|
7677
|
+
}
|
|
7678
|
+
return true;
|
|
7679
|
+
});
|
|
7680
|
+
}
|
|
7681
|
+
const EMPTY_MODEL = { items: [], logicOperator: "AND" };
|
|
7682
|
+
const EMPTY_QUERY = { search: "", filterModel: EMPTY_MODEL };
|
|
7683
|
+
function asText(v) {
|
|
7684
|
+
return typeof v === "string" || typeof v === "number" ? String(v) : "";
|
|
7685
|
+
}
|
|
7686
|
+
function loadPersisted(key) {
|
|
7687
|
+
if (!key || typeof localStorage === "undefined") return null;
|
|
7688
|
+
try {
|
|
7689
|
+
const raw = localStorage.getItem(`ds-datalist:${key}`);
|
|
7690
|
+
if (!raw) return null;
|
|
7691
|
+
const p = JSON.parse(raw);
|
|
7692
|
+
return {
|
|
7693
|
+
search: p.search ?? "",
|
|
7694
|
+
filterModel: p.filterModel?.items ? { items: p.filterModel.items, logicOperator: p.filterModel.logicOperator ?? "AND" } : EMPTY_MODEL
|
|
7695
|
+
};
|
|
7696
|
+
} catch {
|
|
7697
|
+
return null;
|
|
7698
|
+
}
|
|
7699
|
+
}
|
|
7700
|
+
function useDataList({
|
|
7701
|
+
items,
|
|
7702
|
+
mode,
|
|
7703
|
+
filterFields,
|
|
7704
|
+
views,
|
|
7705
|
+
persistKey,
|
|
7706
|
+
defaultExpandedIds,
|
|
7707
|
+
onQueryChange,
|
|
7708
|
+
onSelectionChange
|
|
7709
|
+
}) {
|
|
7710
|
+
const [query, setQuery] = React.useState(
|
|
7711
|
+
() => loadPersisted(persistKey) ?? EMPTY_QUERY
|
|
7712
|
+
);
|
|
7713
|
+
const [activeViewId, setActiveViewId] = React.useState(null);
|
|
7714
|
+
const [selected, setSelected] = React.useState(/* @__PURE__ */ new Set());
|
|
7715
|
+
const [expanded, setExpanded] = React.useState(
|
|
7716
|
+
() => defaultExpandedIds ?? /* @__PURE__ */ new Set()
|
|
7717
|
+
);
|
|
7718
|
+
React.useEffect(() => {
|
|
7719
|
+
if (!persistKey || typeof localStorage === "undefined") return;
|
|
7720
|
+
try {
|
|
7721
|
+
localStorage.setItem(`ds-datalist:${persistKey}`, JSON.stringify(query));
|
|
7722
|
+
} catch {
|
|
7723
|
+
}
|
|
7724
|
+
}, [persistKey, query]);
|
|
7725
|
+
const onQueryChangeRef = React.useRef(onQueryChange);
|
|
7726
|
+
onQueryChangeRef.current = onQueryChange;
|
|
7727
|
+
React.useEffect(() => {
|
|
7728
|
+
if (mode !== "server") return;
|
|
7729
|
+
const t = setTimeout(() => onQueryChangeRef.current?.(query), 250);
|
|
7730
|
+
return () => clearTimeout(t);
|
|
7731
|
+
}, [mode, query]);
|
|
7732
|
+
const setSearch = React.useCallback((search) => {
|
|
7733
|
+
setActiveViewId(null);
|
|
7734
|
+
setQuery((q) => ({ ...q, search }));
|
|
7735
|
+
}, []);
|
|
7736
|
+
const setFilterModel = React.useCallback((filterModel) => {
|
|
7737
|
+
setActiveViewId(null);
|
|
7738
|
+
setQuery((q) => ({ ...q, filterModel }));
|
|
7739
|
+
}, []);
|
|
7740
|
+
const applyView = React.useCallback((view) => {
|
|
7741
|
+
setActiveViewId(view?.id ?? null);
|
|
7742
|
+
setQuery(view ? view.query : EMPTY_QUERY);
|
|
7743
|
+
}, []);
|
|
7744
|
+
const toggleSelect = React.useCallback(
|
|
7745
|
+
(id) => {
|
|
7746
|
+
setSelected((prev) => {
|
|
7747
|
+
const next = new Set(prev);
|
|
7748
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
7749
|
+
onSelectionChange?.(next);
|
|
7750
|
+
return next;
|
|
7751
|
+
});
|
|
7752
|
+
},
|
|
7753
|
+
[onSelectionChange]
|
|
7754
|
+
);
|
|
7755
|
+
const clearSelection = React.useCallback(() => {
|
|
7756
|
+
setSelected(() => {
|
|
7757
|
+
const next = /* @__PURE__ */ new Set();
|
|
7758
|
+
onSelectionChange?.(next);
|
|
7759
|
+
return next;
|
|
7760
|
+
});
|
|
7761
|
+
}, [onSelectionChange]);
|
|
7762
|
+
const replaceSelection = React.useCallback(
|
|
7763
|
+
(next) => {
|
|
7764
|
+
setSelected(next);
|
|
7765
|
+
onSelectionChange?.(next);
|
|
7766
|
+
},
|
|
7767
|
+
[onSelectionChange]
|
|
7768
|
+
);
|
|
7769
|
+
const toggleExpand = React.useCallback((id) => {
|
|
7770
|
+
setExpanded((prev) => {
|
|
7771
|
+
const next = new Set(prev);
|
|
7772
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
7773
|
+
return next;
|
|
7774
|
+
});
|
|
7775
|
+
}, []);
|
|
7776
|
+
const fieldsById = React.useMemo(() => {
|
|
7777
|
+
const m = /* @__PURE__ */ new Map();
|
|
7778
|
+
for (const f of filterFields ?? []) m.set(f.id, f);
|
|
7779
|
+
return m;
|
|
7780
|
+
}, [filterFields]);
|
|
7781
|
+
const matchesSearch = React.useCallback(
|
|
7782
|
+
(item) => {
|
|
7783
|
+
const s = query.search.trim().toLowerCase();
|
|
7784
|
+
if (!s) return true;
|
|
7785
|
+
const hay = [
|
|
7786
|
+
asText(item.title),
|
|
7787
|
+
asText(item.subtitle),
|
|
7788
|
+
asText(item.description),
|
|
7789
|
+
...(filterFields ?? []).map((f) => asText(f.accessor(item)))
|
|
7790
|
+
].join(" ").toLowerCase();
|
|
7791
|
+
return hay.includes(s);
|
|
7792
|
+
},
|
|
7793
|
+
[query.search, filterFields]
|
|
7794
|
+
);
|
|
7795
|
+
const processedItems = React.useMemo(() => {
|
|
7796
|
+
if (mode === "server") return items;
|
|
7797
|
+
const searched = query.search ? items.filter(matchesSearch) : items;
|
|
7798
|
+
return applyFilterModel(searched, query.filterModel, fieldsById);
|
|
7799
|
+
}, [mode, items, query.search, query.filterModel, matchesSearch, fieldsById]);
|
|
7800
|
+
return {
|
|
7801
|
+
query,
|
|
7802
|
+
activeViewId,
|
|
7803
|
+
setSearch,
|
|
7804
|
+
setFilterModel,
|
|
7805
|
+
applyView,
|
|
7806
|
+
views: views ?? [],
|
|
7807
|
+
selected,
|
|
7808
|
+
toggleSelect,
|
|
7809
|
+
clearSelection,
|
|
7810
|
+
replaceSelection,
|
|
7811
|
+
expanded,
|
|
7812
|
+
toggleExpand,
|
|
7813
|
+
setExpanded,
|
|
7814
|
+
processedItems
|
|
7815
|
+
};
|
|
7816
|
+
}
|
|
7817
|
+
const ALL_VIEW_ID = "__all__";
|
|
7818
|
+
function toColumns(fields) {
|
|
7819
|
+
return fields.map((f) => ({
|
|
7820
|
+
key: f.id,
|
|
7821
|
+
label: f.label,
|
|
7822
|
+
filterType: f.type,
|
|
7823
|
+
type: f.type === "select" ? "select" : f.type === "number" ? "number" : "text",
|
|
7824
|
+
options: f.options
|
|
7825
|
+
}));
|
|
7826
|
+
}
|
|
7827
|
+
function toAppliedFilters(model, fieldsById) {
|
|
7828
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
7829
|
+
for (const item of model.items) {
|
|
7830
|
+
const isEmpty = item.operator !== "isEmpty" && item.operator !== "isNotEmpty" && (item.value == null || item.value === "" || Array.isArray(item.value) && item.value.length === 0);
|
|
7831
|
+
if (isEmpty) continue;
|
|
7832
|
+
const key = `${item.field}|${item.operator}`;
|
|
7833
|
+
if (!grouped.has(key)) grouped.set(key, []);
|
|
7834
|
+
grouped.get(key).push(item);
|
|
7835
|
+
}
|
|
7836
|
+
return Array.from(grouped.entries()).map(([key, items]) => {
|
|
7837
|
+
const field = fieldsById.get(items[0].field);
|
|
7838
|
+
const columnLabel = field?.label ?? items[0].field;
|
|
7839
|
+
const labelOf = (v) => field?.options?.find((o) => o.value === String(v))?.label ?? String(v);
|
|
7840
|
+
const values = [];
|
|
7841
|
+
for (const it of items) {
|
|
7842
|
+
if (Array.isArray(it.value))
|
|
7843
|
+
for (const v of it.value) values.push(labelOf(v));
|
|
7844
|
+
else if (it.value != null && it.value !== "")
|
|
7845
|
+
values.push(labelOf(it.value));
|
|
7846
|
+
}
|
|
7847
|
+
const value = values.length <= 2 ? values : `${values.length} selecionados`;
|
|
7848
|
+
return {
|
|
7849
|
+
id: key,
|
|
7850
|
+
columnLabel,
|
|
7851
|
+
op: items[0].operator,
|
|
7852
|
+
value
|
|
7853
|
+
};
|
|
7854
|
+
});
|
|
7855
|
+
}
|
|
7856
|
+
function DataListToolbar({
|
|
7857
|
+
title: title2,
|
|
7858
|
+
count,
|
|
7859
|
+
views,
|
|
7860
|
+
activeViewId,
|
|
7861
|
+
onApplyView,
|
|
7862
|
+
searchable,
|
|
7863
|
+
searchPlaceholder,
|
|
7864
|
+
search,
|
|
7865
|
+
onSearch,
|
|
7866
|
+
filterFields,
|
|
7867
|
+
filterModel,
|
|
7868
|
+
onFilterModelChange,
|
|
7869
|
+
onRefresh,
|
|
7870
|
+
toolbarActions,
|
|
7871
|
+
moreActions,
|
|
7872
|
+
loading
|
|
7873
|
+
}) {
|
|
7874
|
+
const hasActions = !!toolbarActions && toolbarActions.length > 0;
|
|
7875
|
+
const moreItems = (moreActions ?? []).map((a) => ({
|
|
7876
|
+
label: a.label,
|
|
7877
|
+
icon: a.icon,
|
|
7878
|
+
onClick: a.onClick,
|
|
7879
|
+
destructive: a.destructive,
|
|
7880
|
+
disabled: a.disabled,
|
|
7881
|
+
separator: a.separator
|
|
7882
|
+
}));
|
|
7883
|
+
const [drawerOpen, setDrawerOpen] = React.useState(false);
|
|
7884
|
+
const columns = React.useMemo(() => toColumns(filterFields ?? []), [filterFields]);
|
|
7885
|
+
const fieldsById = React.useMemo(() => {
|
|
7886
|
+
const m = /* @__PURE__ */ new Map();
|
|
7887
|
+
for (const f of filterFields ?? []) m.set(f.id, f);
|
|
7888
|
+
return m;
|
|
7889
|
+
}, [filterFields]);
|
|
7890
|
+
const appliedFilters = React.useMemo(
|
|
7891
|
+
() => toAppliedFilters(filterModel, fieldsById),
|
|
7892
|
+
[filterModel, fieldsById]
|
|
7893
|
+
);
|
|
7894
|
+
const filterCount = appliedFilters.length;
|
|
7895
|
+
const [openChipKey, setOpenChipKey] = React.useState(null);
|
|
7896
|
+
const isEmptyVal2 = (v) => v == null || v === "" || Array.isArray(v) && v.length === 0;
|
|
7897
|
+
const setGroupValue = (field, operator, value) => {
|
|
7898
|
+
const rest = filterModel.items.filter(
|
|
7899
|
+
(i) => !(i.field === field && i.operator === operator)
|
|
7900
|
+
);
|
|
7901
|
+
const next = isEmptyVal2(value) ? rest : [
|
|
7902
|
+
...rest,
|
|
7903
|
+
{
|
|
7904
|
+
id: `${field}-${operator}`,
|
|
7905
|
+
field,
|
|
7906
|
+
operator,
|
|
7907
|
+
value
|
|
7908
|
+
}
|
|
7909
|
+
];
|
|
7910
|
+
onFilterModelChange({ ...filterModel, items: next });
|
|
7911
|
+
};
|
|
7912
|
+
const renderEditableChip = (f, defaultChip) => {
|
|
7913
|
+
const [field, operator] = f.id.split("|");
|
|
7914
|
+
const fieldDef = fieldsById.get(field);
|
|
7915
|
+
if (!fieldDef) return defaultChip;
|
|
7916
|
+
const isMulti = operator === "isAnyOf" || operator === "isNoneOf";
|
|
7917
|
+
const isTuple = operator === "between";
|
|
7918
|
+
const regType = isMulti ? "multiSelect" : fieldDef.type;
|
|
7919
|
+
const def = panel.columnTypeRegistry.get(regType);
|
|
7920
|
+
const groupItems = filterModel.items.filter(
|
|
7921
|
+
(i) => i.field === field && i.operator === operator
|
|
7922
|
+
);
|
|
7923
|
+
const currentValue = isTuple ? groupItems[0]?.value : isMulti ? groupItems.flatMap(
|
|
7924
|
+
(i) => Array.isArray(i.value) ? i.value : i.value != null ? [i.value] : []
|
|
7925
|
+
) : groupItems[0]?.value;
|
|
7926
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7927
|
+
avatar.Popover,
|
|
7928
|
+
{
|
|
7929
|
+
open: openChipKey === f.id,
|
|
7930
|
+
onOpenChange: (o) => setOpenChipKey(o ? f.id : null),
|
|
7931
|
+
children: [
|
|
7932
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverTrigger, { asChild: true, children: defaultChip }),
|
|
7933
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.PopoverContent, { align: "start", className: "p-0", children: def.renderFastFilterInput({
|
|
7934
|
+
value: currentValue,
|
|
7935
|
+
onChange: (v) => setGroupValue(field, operator, v),
|
|
7936
|
+
options: fieldDef.options,
|
|
7937
|
+
onClose: () => setOpenChipKey(null)
|
|
7938
|
+
}) })
|
|
7939
|
+
]
|
|
7940
|
+
}
|
|
7941
|
+
);
|
|
7942
|
+
};
|
|
7943
|
+
const tabs = views.length > 0 ? [
|
|
7944
|
+
{ id: ALL_VIEW_ID, name: title2 ?? "Todos" },
|
|
7945
|
+
...views.map((v) => ({ id: v.id, name: v.label }))
|
|
7946
|
+
] : void 0;
|
|
7947
|
+
const savedViewsSlot = tabs ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7948
|
+
panel.ToolbarTabs,
|
|
7949
|
+
{
|
|
7950
|
+
tabs,
|
|
7951
|
+
activeId: activeViewId ?? ALL_VIEW_ID,
|
|
7952
|
+
onSelect: (id) => onApplyView(
|
|
7953
|
+
id === ALL_VIEW_ID ? null : views.find((v) => v.id === id) ?? null
|
|
7954
|
+
),
|
|
7955
|
+
ariaLabel: "Visões"
|
|
7956
|
+
}
|
|
7957
|
+
) : title2 ? /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-title-md font-semibold text-fg-default", children: [
|
|
7958
|
+
title2,
|
|
7959
|
+
typeof count === "number" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-gp-sm text-body-sm font-normal text-fg-muted", children: count })
|
|
7960
|
+
] }) : void 0;
|
|
7961
|
+
const removeFilter = (groupKey) => {
|
|
7962
|
+
const [field, operator] = groupKey.split("|");
|
|
7963
|
+
onFilterModelChange({
|
|
7964
|
+
...filterModel,
|
|
7965
|
+
items: filterModel.items.filter(
|
|
7966
|
+
(i) => !(i.field === field && i.operator === operator)
|
|
7967
|
+
)
|
|
7968
|
+
});
|
|
7969
|
+
};
|
|
7970
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7971
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7972
|
+
panel.TableToolbar,
|
|
7973
|
+
{
|
|
7974
|
+
savedViews: savedViewsSlot,
|
|
7975
|
+
refresh: onRefresh ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7976
|
+
panel.ToolbarToolButton,
|
|
7977
|
+
{
|
|
7978
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: loading ? "animate-spin" : void 0 }),
|
|
7979
|
+
"aria-label": "Atualizar",
|
|
7980
|
+
title: "Atualizar",
|
|
7981
|
+
onClick: onRefresh
|
|
7982
|
+
}
|
|
7983
|
+
) : void 0,
|
|
7984
|
+
search: searchable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7985
|
+
panel.ToolbarSearch,
|
|
7986
|
+
{
|
|
7987
|
+
value: search,
|
|
7988
|
+
placeholder: searchPlaceholder ?? "Buscar...",
|
|
7989
|
+
onChange: (e) => onSearch(e.target.value)
|
|
7990
|
+
}
|
|
7991
|
+
) : void 0,
|
|
7992
|
+
filter: filterFields && filterFields.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7993
|
+
panel.ToolbarFilterButton,
|
|
7994
|
+
{
|
|
7995
|
+
isActive: filterCount > 0,
|
|
7996
|
+
hasIndicator: filterCount > 0,
|
|
7997
|
+
onClick: () => setDrawerOpen(true)
|
|
7998
|
+
}
|
|
7999
|
+
) : void 0,
|
|
8000
|
+
actions: hasActions ? /* @__PURE__ */ jsxRuntime.jsx(panel.ToolbarActions, { actions: toolbarActions, extraItems: moreItems }) : void 0,
|
|
8001
|
+
more: !hasActions && moreActions && moreActions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(avatar.DropdownMenu, { children: [
|
|
8002
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8003
|
+
panel.ToolbarToolButton,
|
|
8004
|
+
{
|
|
8005
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {}),
|
|
8006
|
+
"aria-label": "Mais ações",
|
|
8007
|
+
title: "Mais ações"
|
|
8008
|
+
}
|
|
8009
|
+
) }),
|
|
8010
|
+
/* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuContent, { align: "end", sideOffset: 4, children: moreActions.map(
|
|
8011
|
+
(a, i) => a.separator ? /* @__PURE__ */ jsxRuntime.jsx(avatar.DropdownMenuSeparator, {}, `s${i}`) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8012
|
+
avatar.DropdownMenuItem,
|
|
8013
|
+
{
|
|
8014
|
+
variant: a.destructive ? "destructive" : "default",
|
|
8015
|
+
disabled: a.disabled,
|
|
8016
|
+
onSelect: () => a.onClick?.(),
|
|
8017
|
+
children: [
|
|
8018
|
+
a.icon,
|
|
8019
|
+
a.label
|
|
8020
|
+
]
|
|
8021
|
+
},
|
|
8022
|
+
a.label?.toString() ?? i
|
|
8023
|
+
)
|
|
8024
|
+
) })
|
|
8025
|
+
] }) : void 0
|
|
8026
|
+
}
|
|
8027
|
+
),
|
|
8028
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8029
|
+
panel.ToolbarApplied,
|
|
8030
|
+
{
|
|
8031
|
+
filters: appliedFilters,
|
|
8032
|
+
onRemove: removeFilter,
|
|
8033
|
+
onClearAll: () => onFilterModelChange({ ...filterModel, items: [] }),
|
|
8034
|
+
separator: false,
|
|
8035
|
+
renderChip: (f, defaultChip) => renderEditableChip(f, defaultChip)
|
|
8036
|
+
}
|
|
8037
|
+
),
|
|
8038
|
+
filterFields && filterFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8039
|
+
panel.ToolbarSimpleFilterDrawer,
|
|
8040
|
+
{
|
|
8041
|
+
open: drawerOpen,
|
|
8042
|
+
onOpenChange: setDrawerOpen,
|
|
8043
|
+
columns,
|
|
8044
|
+
filterModel,
|
|
8045
|
+
onFilterModelChange
|
|
8046
|
+
}
|
|
8047
|
+
)
|
|
8048
|
+
] });
|
|
8049
|
+
}
|
|
8050
|
+
function DataListVirtualized({
|
|
8051
|
+
items,
|
|
8052
|
+
density,
|
|
8053
|
+
estimateItemSize,
|
|
8054
|
+
selectable,
|
|
8055
|
+
selectedIds,
|
|
8056
|
+
openId,
|
|
8057
|
+
onToggleSelect,
|
|
8058
|
+
onItemClick,
|
|
8059
|
+
renderItem,
|
|
8060
|
+
getMenuItems,
|
|
8061
|
+
height = 480
|
|
8062
|
+
}) {
|
|
8063
|
+
const parentRef = React.useRef(null);
|
|
8064
|
+
const gap = density === "compact" ? 8 : 10;
|
|
8065
|
+
const v = reactVirtual.useVirtualizer({
|
|
8066
|
+
count: items.length,
|
|
8067
|
+
getScrollElement: () => parentRef.current,
|
|
8068
|
+
estimateSize: () => estimateItemSize,
|
|
8069
|
+
// mede a altura REAL de cada card — sem isso o estimateItemSize (76) reservava
|
|
8070
|
+
// mais espaço que o card renderizado e o excedente aparecia como "gap" grande.
|
|
8071
|
+
measureElement: (el) => el.getBoundingClientRect().height,
|
|
8072
|
+
overscan: 8,
|
|
8073
|
+
gap
|
|
8074
|
+
});
|
|
8075
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: parentRef, className: "overflow-auto scrollbar-thin", style: { height }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: v.getTotalSize(), position: "relative", width: "100%" }, children: v.getVirtualItems().map((row) => {
|
|
8076
|
+
const item = items[row.index];
|
|
8077
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8078
|
+
"div",
|
|
8079
|
+
{
|
|
8080
|
+
"data-index": row.index,
|
|
8081
|
+
ref: v.measureElement,
|
|
8082
|
+
style: {
|
|
8083
|
+
position: "absolute",
|
|
8084
|
+
top: 0,
|
|
8085
|
+
left: 0,
|
|
8086
|
+
width: "100%",
|
|
8087
|
+
transform: `translateY(${row.start}px)`
|
|
8088
|
+
},
|
|
8089
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8090
|
+
panel.ListItem,
|
|
8091
|
+
{
|
|
8092
|
+
item,
|
|
8093
|
+
state: {
|
|
8094
|
+
selected: selectedIds.has(item.id),
|
|
8095
|
+
open: openId === item.id,
|
|
8096
|
+
dragging: false,
|
|
8097
|
+
depth: 0
|
|
8098
|
+
},
|
|
8099
|
+
density,
|
|
8100
|
+
renderItem,
|
|
8101
|
+
getMenuItems,
|
|
8102
|
+
onClick: onItemClick,
|
|
8103
|
+
selectable,
|
|
8104
|
+
onToggleSelect
|
|
8105
|
+
}
|
|
8106
|
+
)
|
|
8107
|
+
},
|
|
8108
|
+
item.id
|
|
8109
|
+
);
|
|
8110
|
+
}) }) });
|
|
8111
|
+
}
|
|
8112
|
+
function DataListSkeleton({ count = 3 }) {
|
|
8113
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-gp-lg", "aria-hidden": "true", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8114
|
+
"div",
|
|
8115
|
+
{
|
|
8116
|
+
className: "w-full p-pad-xl bg-bg-surface border border-border-subtle dark:border-border-default rounded-radius-lg",
|
|
8117
|
+
children: [
|
|
8118
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: avatar.cn("h-[12px] rounded-radius-full bg-bg-muted animate-pulse", "w-1/3 mb-gp-md") }),
|
|
8119
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: avatar.cn("h-[12px] rounded-radius-full bg-bg-muted animate-pulse", "w-2/3") })
|
|
8120
|
+
]
|
|
8121
|
+
},
|
|
8122
|
+
i
|
|
8123
|
+
)) });
|
|
8124
|
+
}
|
|
8125
|
+
function DataListInfinite({
|
|
8126
|
+
onLoadMore,
|
|
8127
|
+
hasMore,
|
|
8128
|
+
loading,
|
|
8129
|
+
skeletonCount = 3
|
|
8130
|
+
}) {
|
|
8131
|
+
const sentinelRef = React.useRef(null);
|
|
8132
|
+
const onLoadMoreRef = React.useRef(onLoadMore);
|
|
8133
|
+
onLoadMoreRef.current = onLoadMore;
|
|
8134
|
+
React.useEffect(() => {
|
|
8135
|
+
const el = sentinelRef.current;
|
|
8136
|
+
if (!el || !hasMore || loading) return;
|
|
8137
|
+
const io = new IntersectionObserver(
|
|
8138
|
+
(entries) => {
|
|
8139
|
+
if (entries[0]?.isIntersecting) onLoadMoreRef.current();
|
|
8140
|
+
},
|
|
8141
|
+
{ rootMargin: "200px" }
|
|
8142
|
+
);
|
|
8143
|
+
io.observe(el);
|
|
8144
|
+
return () => io.disconnect();
|
|
8145
|
+
}, [hasMore, loading]);
|
|
8146
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8147
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(DataListSkeleton, { count: skeletonCount }),
|
|
8148
|
+
hasMore && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: sentinelRef, className: "h-px w-full", "aria-hidden": "true" })
|
|
8149
|
+
] });
|
|
8150
|
+
}
|
|
8151
|
+
function mergeLoaded(items, loaded) {
|
|
8152
|
+
if (Object.keys(loaded).length === 0) return items;
|
|
8153
|
+
return items.map((it) => {
|
|
8154
|
+
const children = loaded[it.id] ?? it.children;
|
|
8155
|
+
const mergedChildren = children ? mergeLoaded(children, loaded) : void 0;
|
|
8156
|
+
return mergedChildren ? { ...it, children: mergedChildren } : it;
|
|
8157
|
+
});
|
|
8158
|
+
}
|
|
8159
|
+
function DataList(props) {
|
|
8160
|
+
const {
|
|
8161
|
+
items,
|
|
8162
|
+
layout = "standard",
|
|
8163
|
+
groups,
|
|
8164
|
+
renderItem,
|
|
8165
|
+
getMenuItems,
|
|
8166
|
+
onItemClick,
|
|
8167
|
+
openId,
|
|
8168
|
+
groupSurface,
|
|
8169
|
+
density = "comfortable",
|
|
8170
|
+
title: title2,
|
|
8171
|
+
searchable,
|
|
8172
|
+
searchPlaceholder,
|
|
8173
|
+
filterFields,
|
|
8174
|
+
views,
|
|
8175
|
+
onRefresh,
|
|
8176
|
+
toolbarActions,
|
|
8177
|
+
moreActions,
|
|
8178
|
+
mode = "client",
|
|
8179
|
+
loading,
|
|
8180
|
+
total,
|
|
8181
|
+
onQueryChange,
|
|
8182
|
+
onLoadMore,
|
|
8183
|
+
hasMore,
|
|
8184
|
+
loadingMore,
|
|
8185
|
+
virtualized,
|
|
8186
|
+
estimateItemSize = 76,
|
|
8187
|
+
onLoadChildren,
|
|
8188
|
+
defaultExpandedIds,
|
|
8189
|
+
branchHighlight,
|
|
8190
|
+
selectable,
|
|
8191
|
+
onSelectionChange,
|
|
8192
|
+
bulkActions,
|
|
8193
|
+
enableDnD,
|
|
8194
|
+
onReorder,
|
|
8195
|
+
onMove,
|
|
8196
|
+
persistKey,
|
|
8197
|
+
fillHeight,
|
|
8198
|
+
className,
|
|
8199
|
+
emptyState
|
|
8200
|
+
} = props;
|
|
8201
|
+
const [loaded, setLoaded] = React.useState({});
|
|
8202
|
+
const baseItems = React.useMemo(() => mergeLoaded(items, loaded), [items, loaded]);
|
|
8203
|
+
const ctrl = useDataList({
|
|
8204
|
+
items: baseItems,
|
|
8205
|
+
mode,
|
|
8206
|
+
filterFields,
|
|
8207
|
+
views,
|
|
8208
|
+
persistKey,
|
|
8209
|
+
defaultExpandedIds,
|
|
8210
|
+
onQueryChange,
|
|
8211
|
+
onSelectionChange
|
|
8212
|
+
});
|
|
8213
|
+
const handleExpandedChange = React.useCallback(
|
|
8214
|
+
(next) => {
|
|
8215
|
+
const added = [...next].find((id) => !ctrl.expanded.has(id));
|
|
8216
|
+
ctrl.setExpanded(next);
|
|
8217
|
+
if (added && onLoadChildren && !loaded[added]) {
|
|
8218
|
+
onLoadChildren(added).then(
|
|
8219
|
+
(children) => setLoaded((p) => ({ ...p, [added]: children }))
|
|
8220
|
+
);
|
|
8221
|
+
}
|
|
8222
|
+
},
|
|
8223
|
+
[ctrl, onLoadChildren, loaded]
|
|
8224
|
+
);
|
|
8225
|
+
const useVirtual = Boolean(virtualized) && layout === "standard";
|
|
8226
|
+
const dndEnabled = Boolean(enableDnD) && !useVirtual;
|
|
8227
|
+
const count = mode === "server" ? total : ctrl.processedItems.length;
|
|
8228
|
+
const body2 = useVirtual ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8229
|
+
DataListVirtualized,
|
|
8230
|
+
{
|
|
8231
|
+
items: ctrl.processedItems,
|
|
8232
|
+
density,
|
|
8233
|
+
estimateItemSize,
|
|
8234
|
+
selectable,
|
|
8235
|
+
selectedIds: ctrl.selected,
|
|
8236
|
+
openId,
|
|
8237
|
+
onToggleSelect: ctrl.toggleSelect,
|
|
8238
|
+
onItemClick,
|
|
8239
|
+
renderItem,
|
|
8240
|
+
getMenuItems
|
|
8241
|
+
}
|
|
8242
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
8243
|
+
panel.List,
|
|
8244
|
+
{
|
|
8245
|
+
layout,
|
|
8246
|
+
items: ctrl.processedItems,
|
|
8247
|
+
groups,
|
|
8248
|
+
renderItem,
|
|
8249
|
+
getMenuItems,
|
|
8250
|
+
onItemClick,
|
|
8251
|
+
openId,
|
|
8252
|
+
groupSurface,
|
|
8253
|
+
density,
|
|
8254
|
+
branchHighlight,
|
|
8255
|
+
selectable,
|
|
8256
|
+
selectedIds: ctrl.selected,
|
|
8257
|
+
onSelectionChange: ctrl.replaceSelection,
|
|
8258
|
+
expandedIds: ctrl.expanded,
|
|
8259
|
+
onExpandedChange: handleExpandedChange,
|
|
8260
|
+
enableDnD: dndEnabled,
|
|
8261
|
+
onReorder,
|
|
8262
|
+
onMove,
|
|
8263
|
+
loading,
|
|
8264
|
+
emptyState
|
|
8265
|
+
}
|
|
8266
|
+
);
|
|
8267
|
+
const selCount = ctrl.selected.size;
|
|
8268
|
+
const scrollBody = fillHeight && !useVirtual;
|
|
8269
|
+
const listBlock = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
8270
|
+
body2,
|
|
8271
|
+
onLoadMore && !useVirtual && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8272
|
+
DataListInfinite,
|
|
8273
|
+
{
|
|
8274
|
+
onLoadMore,
|
|
8275
|
+
hasMore: Boolean(hasMore),
|
|
8276
|
+
loading: Boolean(loadingMore)
|
|
8277
|
+
}
|
|
8278
|
+
)
|
|
8279
|
+
] });
|
|
8280
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8281
|
+
"div",
|
|
8282
|
+
{
|
|
8283
|
+
className: avatar.cn(
|
|
8284
|
+
"flex flex-col gap-gp-lg",
|
|
8285
|
+
fillHeight && "min-h-0",
|
|
8286
|
+
className
|
|
8287
|
+
),
|
|
8288
|
+
children: [
|
|
8289
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8290
|
+
DataListToolbar,
|
|
8291
|
+
{
|
|
8292
|
+
title: title2,
|
|
8293
|
+
count,
|
|
8294
|
+
views: ctrl.views,
|
|
8295
|
+
activeViewId: ctrl.activeViewId,
|
|
8296
|
+
onApplyView: ctrl.applyView,
|
|
8297
|
+
searchable,
|
|
8298
|
+
searchPlaceholder,
|
|
8299
|
+
search: ctrl.query.search,
|
|
8300
|
+
onSearch: ctrl.setSearch,
|
|
8301
|
+
filterFields,
|
|
8302
|
+
filterModel: ctrl.query.filterModel,
|
|
8303
|
+
onFilterModelChange: ctrl.setFilterModel,
|
|
8304
|
+
onRefresh,
|
|
8305
|
+
toolbarActions,
|
|
8306
|
+
moreActions,
|
|
8307
|
+
loading
|
|
8308
|
+
}
|
|
8309
|
+
),
|
|
8310
|
+
selectable && selCount > 0 && bulkActions && bulkActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-gp-md rounded-radius-lg border border-border-brand-subtle bg-bg-brand-subtle px-pad-xl py-pad-md", children: [
|
|
8311
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-body-sm font-medium text-fg-default", children: [
|
|
8312
|
+
selCount,
|
|
8313
|
+
" selecionado(s)"
|
|
8314
|
+
] }),
|
|
8315
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex items-center gap-gp-sm", children: [
|
|
8316
|
+
bulkActions.map((a, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8317
|
+
avatar.Button,
|
|
8318
|
+
{
|
|
8319
|
+
size: "sm",
|
|
8320
|
+
variant: a.destructive ? "soft" : "soft",
|
|
8321
|
+
color: a.destructive ? "critical" : "secondary",
|
|
8322
|
+
iconLeft: a.icon,
|
|
8323
|
+
onClick: () => a.onClick(ctrl.selected),
|
|
8324
|
+
children: a.label
|
|
8325
|
+
},
|
|
8326
|
+
i
|
|
8327
|
+
)),
|
|
8328
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8329
|
+
avatar.Button,
|
|
8330
|
+
{
|
|
8331
|
+
size: "sm",
|
|
8332
|
+
variant: "ghost",
|
|
8333
|
+
color: "secondary",
|
|
8334
|
+
onClick: ctrl.clearSelection,
|
|
8335
|
+
children: "Limpar"
|
|
8336
|
+
}
|
|
8337
|
+
)
|
|
8338
|
+
] })
|
|
8339
|
+
] }),
|
|
8340
|
+
scrollBody ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden scrollbar-thin pr-pad-xs", children: listBlock }) : listBlock
|
|
8341
|
+
]
|
|
8342
|
+
}
|
|
8343
|
+
);
|
|
8344
|
+
}
|
|
8345
|
+
const toastVariants = avatar.tv({
|
|
8346
|
+
slots: {
|
|
8347
|
+
root: "flex w-full flex-col gap-gp-md rounded-radius-xl border border-border-default bg-bg-surface p-pad-2xl text-left shadow-sh-lg",
|
|
8348
|
+
row: "flex items-center gap-gp-xl",
|
|
8349
|
+
iconChip: "flex size-form-md shrink-0 items-center justify-center rounded-radius-lg [&_svg]:size-[18px]",
|
|
8350
|
+
content: "flex min-w-0 flex-1 flex-col gap-gp-2xs",
|
|
8351
|
+
title: "text-body-sm font-semibold text-fg-default",
|
|
8352
|
+
description: "text-body-sm text-fg-muted",
|
|
8353
|
+
rightCluster: "flex shrink-0 items-center gap-gp-sm",
|
|
8354
|
+
meta: "whitespace-nowrap text-caption-sm text-fg-subtle",
|
|
8355
|
+
footer: "flex items-center justify-end gap-gp-xs"
|
|
8356
|
+
},
|
|
8357
|
+
variants: {
|
|
8358
|
+
status: {
|
|
8359
|
+
default: { iconChip: "bg-bg-muted text-fg-default" },
|
|
8360
|
+
info: { iconChip: "bg-bg-info-muted text-fg-info" },
|
|
8361
|
+
success: { iconChip: "bg-bg-success-muted text-fg-success" },
|
|
8362
|
+
warning: { iconChip: "bg-bg-warning-muted text-fg-warning" },
|
|
8363
|
+
danger: { iconChip: "bg-bg-danger-muted text-fg-danger" }
|
|
8364
|
+
}
|
|
8365
|
+
},
|
|
8366
|
+
defaultVariants: {
|
|
8367
|
+
status: "default"
|
|
8368
|
+
}
|
|
8369
|
+
});
|
|
8370
|
+
const DEFAULT_ICON = {
|
|
8371
|
+
default: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, {}),
|
|
8372
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, {}),
|
|
8373
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, {}),
|
|
8374
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, {}),
|
|
8375
|
+
danger: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.OctagonX, {})
|
|
8376
|
+
};
|
|
8377
|
+
const TONE_PROPS = {
|
|
8378
|
+
brand: { color: "primary", variant: "filled" },
|
|
8379
|
+
neutral: { color: "secondary", variant: "soft" },
|
|
8380
|
+
danger: { color: "critical", variant: "soft" }
|
|
8381
|
+
};
|
|
8382
|
+
function ActionButton({ action }) {
|
|
8383
|
+
const tone = TONE_PROPS[action.tone ?? "brand"];
|
|
8384
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8385
|
+
avatar.Button,
|
|
8386
|
+
{
|
|
8387
|
+
color: tone.color,
|
|
8388
|
+
variant: tone.variant,
|
|
8389
|
+
size: "xs",
|
|
8390
|
+
iconLeft: action.iconLeft,
|
|
8391
|
+
iconRight: action.iconRight,
|
|
8392
|
+
onClick: action.onClick,
|
|
8393
|
+
children: action.label
|
|
8394
|
+
}
|
|
8395
|
+
);
|
|
8396
|
+
}
|
|
8397
|
+
function ToastCard({
|
|
8398
|
+
status = "default",
|
|
8399
|
+
title: title2,
|
|
8400
|
+
description: description2,
|
|
8401
|
+
icon,
|
|
8402
|
+
meta,
|
|
8403
|
+
action,
|
|
8404
|
+
cancel,
|
|
8405
|
+
onClose,
|
|
8406
|
+
toastId
|
|
8407
|
+
}) {
|
|
8408
|
+
const s = toastVariants({ status });
|
|
8409
|
+
const hasFooter = Boolean(cancel);
|
|
8410
|
+
const inlineAction = action && !hasFooter ? action : null;
|
|
8411
|
+
const handleClose = () => {
|
|
8412
|
+
onClose?.();
|
|
8413
|
+
if (toastId !== void 0) sonner.toast.dismiss(toastId);
|
|
8414
|
+
};
|
|
8415
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.root(), children: [
|
|
8416
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.row(), children: [
|
|
8417
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: s.iconChip(), children: icon ?? DEFAULT_ICON[status] }),
|
|
8418
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.content(), children: [
|
|
8419
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: s.title(), children: title2 }),
|
|
8420
|
+
description2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: s.description(), children: description2 })
|
|
8421
|
+
] }),
|
|
8422
|
+
(meta || inlineAction || onClose) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.rightCluster(), children: [
|
|
8423
|
+
meta && /* @__PURE__ */ jsxRuntime.jsx("span", { className: s.meta(), children: meta }),
|
|
8424
|
+
inlineAction && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { action: inlineAction }),
|
|
8425
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8426
|
+
avatar.Button,
|
|
8427
|
+
{
|
|
8428
|
+
color: "secondary",
|
|
8429
|
+
variant: "ghost",
|
|
8430
|
+
size: "icon-2xs",
|
|
8431
|
+
"aria-label": "Fechar",
|
|
8432
|
+
iconLeft: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}),
|
|
8433
|
+
onClick: handleClose
|
|
8434
|
+
}
|
|
8435
|
+
)
|
|
8436
|
+
] })
|
|
8437
|
+
] }),
|
|
8438
|
+
hasFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: s.footer(), children: [
|
|
8439
|
+
cancel && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { action: { tone: "neutral", ...cancel } }),
|
|
8440
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(ActionButton, { action })
|
|
8441
|
+
] })
|
|
8442
|
+
] });
|
|
8443
|
+
}
|
|
8444
|
+
const STRIP_SONNER_BOX = {
|
|
8445
|
+
toast: "!bg-transparent !border-0 !p-0 !shadow-none"
|
|
8446
|
+
};
|
|
8447
|
+
function show(opts, status) {
|
|
8448
|
+
const { duration, position, id, ...card } = opts;
|
|
8449
|
+
return sonner.toast.custom(
|
|
8450
|
+
(t) => /* @__PURE__ */ jsxRuntime.jsx(ToastCard, { ...card, status, toastId: t }),
|
|
8451
|
+
{ duration, position, id, classNames: STRIP_SONNER_BOX }
|
|
8452
|
+
);
|
|
8453
|
+
}
|
|
8454
|
+
const toast = Object.assign(
|
|
8455
|
+
(opts) => show(opts, "default"),
|
|
8456
|
+
{
|
|
8457
|
+
success: (opts) => show(opts, "success"),
|
|
8458
|
+
error: (opts) => show(opts, "danger"),
|
|
8459
|
+
warning: (opts) => show(opts, "warning"),
|
|
8460
|
+
info: (opts) => show(opts, "info"),
|
|
8461
|
+
// passthrough nativo do Sonner
|
|
8462
|
+
promise: sonner.toast.promise,
|
|
8463
|
+
dismiss: sonner.toast.dismiss,
|
|
8464
|
+
custom: sonner.toast.custom,
|
|
8465
|
+
loading: sonner.toast.loading
|
|
8466
|
+
}
|
|
8467
|
+
);
|
|
7534
8468
|
const BRANDS = [
|
|
7535
8469
|
{ id: "default", label: "iGreen", swatch: "oklch(0.5248 0.1415 150.9)" },
|
|
7536
8470
|
{ id: "blue", label: "Azul", swatch: "oklch(0.52 0.180 264)" },
|
|
@@ -7631,15 +8565,13 @@ exports.FormFieldSelect = panel.FormFieldSelect;
|
|
|
7631
8565
|
exports.FormFieldSwitch = panel.FormFieldSwitch;
|
|
7632
8566
|
exports.FormFieldTextarea = panel.FormFieldTextarea;
|
|
7633
8567
|
exports.Kanban = panel.Kanban;
|
|
8568
|
+
exports.List = panel.List;
|
|
8569
|
+
exports.ListItem = panel.ListItem;
|
|
7634
8570
|
exports.MoreMenu = panel.MoreMenu;
|
|
7635
8571
|
exports.Panel = panel.Panel;
|
|
7636
8572
|
exports.PanelBody = panel.PanelBody;
|
|
7637
|
-
exports.PanelCloseAction = panel.SheetClose;
|
|
7638
|
-
exports.PanelContent = panel.SheetContent;
|
|
7639
8573
|
exports.PanelFooter = panel.PanelFooter;
|
|
7640
8574
|
exports.PanelHeader = panel.PanelHeader;
|
|
7641
|
-
exports.PanelRoot = panel.Sheet;
|
|
7642
|
-
exports.PanelTrigger = panel.SheetTrigger;
|
|
7643
8575
|
exports.SELECTION_COLUMN_WIDTH = panel.SELECTION_COLUMN_WIDTH;
|
|
7644
8576
|
exports.SortPanel = panel.SortPanel;
|
|
7645
8577
|
exports.SortPopover = panel.SortPopover;
|
|
@@ -7675,7 +8607,6 @@ exports.useColumnWidths = panel.useColumnWidths;
|
|
|
7675
8607
|
exports.useDataTableContext = panel.useDataTableContext;
|
|
7676
8608
|
exports.useFloatingPanelResize = panel.useFloatingPanelResize;
|
|
7677
8609
|
exports.AppShell = useTheme.AppShell;
|
|
7678
|
-
exports.Button = useTheme.Button;
|
|
7679
8610
|
exports.Chip = useTheme.Chip;
|
|
7680
8611
|
exports.ChipGroup = useTheme.ChipGroup;
|
|
7681
8612
|
exports.ChipGroupItem = useTheme.ChipGroupItem;
|
|
@@ -7685,19 +8616,7 @@ exports.HeaderMessages = useTheme.HeaderMessages;
|
|
|
7685
8616
|
exports.HeaderNotifications = useTheme.HeaderNotifications;
|
|
7686
8617
|
exports.HeaderSearch = useTheme.HeaderSearch;
|
|
7687
8618
|
exports.HeaderThemeSwitcher = useTheme.HeaderThemeSwitcher;
|
|
7688
|
-
exports.InputGroup = useTheme.InputGroup;
|
|
7689
|
-
exports.InputGroupAddon = useTheme.InputGroupAddon;
|
|
7690
|
-
exports.InputGroupButton = useTheme.InputGroupButton;
|
|
7691
|
-
exports.InputGroupInput = useTheme.InputGroupInput;
|
|
7692
|
-
exports.InputGroupText = useTheme.InputGroupText;
|
|
7693
|
-
exports.InputGroupTextarea = useTheme.InputGroupTextarea;
|
|
7694
8619
|
exports.MenuSidebar = useTheme.MenuSidebar;
|
|
7695
|
-
exports.MoreMenuCheckboxItem = useTheme.DropdownMenuCheckboxItem;
|
|
7696
|
-
exports.MoreMenuItem = useTheme.DropdownMenuItem;
|
|
7697
|
-
exports.MoreMenuLabel = useTheme.DropdownMenuLabel;
|
|
7698
|
-
exports.MoreMenuRadioGroup = useTheme.DropdownMenuRadioGroup;
|
|
7699
|
-
exports.MoreMenuRadioItem = useTheme.DropdownMenuRadioItem;
|
|
7700
|
-
exports.MoreMenuSeparator = useTheme.DropdownMenuSeparator;
|
|
7701
8620
|
exports.SidebarBrandIcon = useTheme.SidebarBrandIcon;
|
|
7702
8621
|
exports.SidebarItem = useTheme.SidebarItem;
|
|
7703
8622
|
exports.SidebarPanel = useTheme.SidebarPanel;
|
|
@@ -7706,17 +8625,36 @@ exports.SidebarRail = useTheme.SidebarRail;
|
|
|
7706
8625
|
exports.SidebarSection = useTheme.SidebarSection;
|
|
7707
8626
|
exports.SidebarSubgroup = useTheme.SidebarSubgroup;
|
|
7708
8627
|
exports.UserMenu = useTheme.UserMenu;
|
|
7709
|
-
exports.buttonVariants = useTheme.buttonVariants;
|
|
7710
8628
|
exports.chipCount = useTheme.chipCount;
|
|
7711
8629
|
exports.chipVariants = useTheme.chipVariants;
|
|
7712
|
-
exports.inputGroupVariants = useTheme.inputGroupVariants;
|
|
7713
8630
|
exports.useControllable = useTheme.useControllable;
|
|
7714
8631
|
exports.useMediaQuery = useTheme.useMediaQuery;
|
|
7715
8632
|
exports.useTheme = useTheme.useTheme;
|
|
8633
|
+
exports.Button = avatar.Button;
|
|
8634
|
+
exports.InputGroup = avatar.InputGroup;
|
|
8635
|
+
exports.InputGroupAddon = avatar.InputGroupAddon;
|
|
8636
|
+
exports.InputGroupButton = avatar.InputGroupButton;
|
|
8637
|
+
exports.InputGroupInput = avatar.InputGroupInput;
|
|
8638
|
+
exports.InputGroupText = avatar.InputGroupText;
|
|
8639
|
+
exports.InputGroupTextarea = avatar.InputGroupTextarea;
|
|
8640
|
+
exports.MoreMenuCheckboxItem = avatar.DropdownMenuCheckboxItem;
|
|
8641
|
+
exports.MoreMenuItem = avatar.DropdownMenuItem;
|
|
8642
|
+
exports.MoreMenuLabel = avatar.DropdownMenuLabel;
|
|
8643
|
+
exports.MoreMenuRadioGroup = avatar.DropdownMenuRadioGroup;
|
|
8644
|
+
exports.MoreMenuRadioItem = avatar.DropdownMenuRadioItem;
|
|
8645
|
+
exports.MoreMenuSeparator = avatar.DropdownMenuSeparator;
|
|
8646
|
+
exports.buttonVariants = avatar.buttonVariants;
|
|
8647
|
+
exports.inputGroupVariants = avatar.inputGroupVariants;
|
|
8648
|
+
exports.PanelCloseAction = textarea.SheetClose;
|
|
8649
|
+
exports.PanelContent = textarea.SheetContent;
|
|
8650
|
+
exports.PanelRoot = textarea.Sheet;
|
|
8651
|
+
exports.PanelTrigger = textarea.SheetTrigger;
|
|
7716
8652
|
Object.defineProperty(exports, "MessageReplyIcon", {
|
|
7717
8653
|
enumerable: true,
|
|
7718
8654
|
get: () => lucideReact.Reply
|
|
7719
8655
|
});
|
|
8656
|
+
exports.Badge = tooltip.Badge;
|
|
8657
|
+
exports.badgeVariants = tooltip.badgeVariants;
|
|
7720
8658
|
exports.Input = input.Input;
|
|
7721
8659
|
exports.inputVariants = input.inputVariants;
|
|
7722
8660
|
exports.Kpi = kpiDelta.Kpi;
|
|
@@ -7725,13 +8663,19 @@ exports.KpiGroup = kpiDelta.KpiGroup;
|
|
|
7725
8663
|
exports.PageHeader = pageHeader.PageHeader;
|
|
7726
8664
|
exports.pageHeaderStyles = pageHeader.pageHeaderStyles;
|
|
7727
8665
|
exports.BRANDS = BRANDS;
|
|
7728
|
-
exports.Badge = Badge;
|
|
7729
8666
|
exports.CardCheckbox = CardCheckbox;
|
|
8667
|
+
exports.ChartContainer = ChartContainer;
|
|
8668
|
+
exports.ChartLegend = ChartLegend;
|
|
8669
|
+
exports.ChartLegendContent = ChartLegendContent;
|
|
8670
|
+
exports.ChartStyle = ChartStyle;
|
|
8671
|
+
exports.ChartTooltip = ChartTooltip;
|
|
8672
|
+
exports.ChartTooltipContent = ChartTooltipContent;
|
|
7730
8673
|
exports.ChoroplethMap = ChoroplethMap;
|
|
7731
8674
|
exports.ColorPicker = ColorPicker;
|
|
7732
8675
|
exports.ConversationListItem = ConversationListItem;
|
|
7733
8676
|
exports.DEFAULT_COLOR_PRESETS = DEFAULT_COLOR_PRESETS;
|
|
7734
8677
|
exports.DEFAULT_MESSAGE_VARIABLES = DEFAULT_MESSAGE_VARIABLES;
|
|
8678
|
+
exports.DataList = DataList;
|
|
7735
8679
|
exports.DatePicker = DatePicker;
|
|
7736
8680
|
exports.DateSeparatorChip = DateSeparatorChip;
|
|
7737
8681
|
exports.EmptyState = EmptyState;
|
|
@@ -7746,12 +8690,12 @@ exports.Modal = Modal;
|
|
|
7746
8690
|
exports.MonthYearPicker = MonthYearPicker;
|
|
7747
8691
|
exports.SingleMenuSidebar = SingleMenuSidebar;
|
|
7748
8692
|
exports.Spinner = Spinner;
|
|
8693
|
+
exports.ToastCard = ToastCard;
|
|
7749
8694
|
exports.ToolbarFilterControl = ToolbarFilterControl;
|
|
7750
8695
|
exports.ToolbarMobileDialog = ToolbarMobileDialog;
|
|
7751
8696
|
exports.ToolbarMobileSection = ToolbarMobileSection;
|
|
7752
8697
|
exports.ToolbarMobileSheet = ToolbarMobileSheet;
|
|
7753
8698
|
exports.actionColumn = actionColumn;
|
|
7754
|
-
exports.badgeVariants = badgeVariants;
|
|
7755
8699
|
exports.cardCheckbox = cardCheckbox;
|
|
7756
8700
|
exports.colorPickerStyles = colorPickerStyles;
|
|
7757
8701
|
exports.conversationListItemStyles = conversationListItemStyles;
|
|
@@ -7772,7 +8716,10 @@ exports.numberColumn = numberColumn;
|
|
|
7772
8716
|
exports.phoneColumn = phoneColumn;
|
|
7773
8717
|
exports.statusColumn = statusColumn;
|
|
7774
8718
|
exports.textColumn = textColumn;
|
|
8719
|
+
exports.toast = toast;
|
|
8720
|
+
exports.toastVariants = toastVariants;
|
|
7775
8721
|
exports.useBrand = useBrand;
|
|
8722
|
+
exports.useChart = useChart;
|
|
7776
8723
|
exports.useToolbarFilterControl = useToolbarFilterControl;
|
|
7777
8724
|
exports.useToolbarFilters = useToolbarFilters;
|
|
7778
8725
|
exports.useToolbarSort = useToolbarSort;
|