@humu-tech/ui 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +1017 -906
- package/dist/index.mjs +698 -590
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -220,6 +220,34 @@ function getShortcutKeys(key) {
|
|
|
220
220
|
return isMacOS() ? ["\u2318", key] : ["Ctrl", key];
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
// src/lib/fileType.ts
|
|
224
|
+
var IMAGE_EXTENSIONS = [
|
|
225
|
+
"png",
|
|
226
|
+
"jpg",
|
|
227
|
+
"jpeg",
|
|
228
|
+
"gif",
|
|
229
|
+
"webp",
|
|
230
|
+
"bmp",
|
|
231
|
+
"svg",
|
|
232
|
+
"avif"
|
|
233
|
+
];
|
|
234
|
+
function getExtension(fileName) {
|
|
235
|
+
var _a;
|
|
236
|
+
return ((_a = fileName == null ? void 0 : fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase()) ?? "";
|
|
237
|
+
}
|
|
238
|
+
function isImageFile(mimeType, fileName) {
|
|
239
|
+
if (mimeType) {
|
|
240
|
+
return mimeType.toLowerCase().startsWith("image/");
|
|
241
|
+
}
|
|
242
|
+
return IMAGE_EXTENSIONS.includes(getExtension(fileName));
|
|
243
|
+
}
|
|
244
|
+
function isPdfFile(mimeType, fileName) {
|
|
245
|
+
if (mimeType) {
|
|
246
|
+
return mimeType.toLowerCase() === "application/pdf";
|
|
247
|
+
}
|
|
248
|
+
return getExtension(fileName) === "pdf";
|
|
249
|
+
}
|
|
250
|
+
|
|
223
251
|
// src/primitives/Avatar/Avatar.tsx
|
|
224
252
|
import { forwardRef } from "react";
|
|
225
253
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
@@ -2691,10 +2719,87 @@ var CopyButton = forwardRef19(
|
|
|
2691
2719
|
);
|
|
2692
2720
|
CopyButton.displayName = "CopyButton";
|
|
2693
2721
|
|
|
2722
|
+
// src/primitives/FileThumbnail/FileThumbnail.tsx
|
|
2723
|
+
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
2724
|
+
import { FilePdf, FileText, Image as ImageIcon } from "@phosphor-icons/react";
|
|
2725
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2726
|
+
function FallbackIcon({
|
|
2727
|
+
mimeType,
|
|
2728
|
+
fileName,
|
|
2729
|
+
iconSize: iconSize3
|
|
2730
|
+
}) {
|
|
2731
|
+
if (isImageFile(mimeType, fileName)) {
|
|
2732
|
+
return /* @__PURE__ */ jsx27(ImageIcon, { size: iconSize3, weight: "bold", "aria-hidden": "true" });
|
|
2733
|
+
}
|
|
2734
|
+
if (isPdfFile(mimeType, fileName)) {
|
|
2735
|
+
return /* @__PURE__ */ jsx27(FilePdf, { size: iconSize3, weight: "bold", "aria-hidden": "true" });
|
|
2736
|
+
}
|
|
2737
|
+
return /* @__PURE__ */ jsx27(FileText, { size: iconSize3, weight: "bold", "aria-hidden": "true" });
|
|
2738
|
+
}
|
|
2739
|
+
function FileThumbnail({
|
|
2740
|
+
src,
|
|
2741
|
+
loadPreview,
|
|
2742
|
+
mimeType,
|
|
2743
|
+
fileName,
|
|
2744
|
+
size = 40,
|
|
2745
|
+
alt,
|
|
2746
|
+
className
|
|
2747
|
+
}) {
|
|
2748
|
+
const isImage = isImageFile(mimeType, fileName);
|
|
2749
|
+
const [objectUrl, setObjectUrl] = useState9();
|
|
2750
|
+
const [errored, setErrored] = useState9(false);
|
|
2751
|
+
useEffect6(() => {
|
|
2752
|
+
setErrored(false);
|
|
2753
|
+
setObjectUrl(void 0);
|
|
2754
|
+
if (src || !isImage || !loadPreview) return;
|
|
2755
|
+
let active = true;
|
|
2756
|
+
let createdUrl;
|
|
2757
|
+
loadPreview().then((blob) => {
|
|
2758
|
+
if (!active) return;
|
|
2759
|
+
createdUrl = URL.createObjectURL(blob);
|
|
2760
|
+
setObjectUrl(createdUrl);
|
|
2761
|
+
}).catch(() => {
|
|
2762
|
+
if (active) setErrored(true);
|
|
2763
|
+
});
|
|
2764
|
+
return () => {
|
|
2765
|
+
active = false;
|
|
2766
|
+
if (createdUrl) URL.revokeObjectURL(createdUrl);
|
|
2767
|
+
};
|
|
2768
|
+
}, [src, isImage, loadPreview]);
|
|
2769
|
+
const resolvedSrc = src ?? objectUrl;
|
|
2770
|
+
const iconSize3 = Math.round(size * 0.45);
|
|
2771
|
+
return /* @__PURE__ */ jsx27(
|
|
2772
|
+
"span",
|
|
2773
|
+
{
|
|
2774
|
+
className: cn(
|
|
2775
|
+
"inline-flex shrink-0 items-center justify-center overflow-hidden rounded-v2-md border border-v2-border-subtle bg-v2-bg-subtle text-v2-fg-muted",
|
|
2776
|
+
className
|
|
2777
|
+
),
|
|
2778
|
+
style: { width: size, height: size },
|
|
2779
|
+
children: isImage && resolvedSrc && !errored ? /* @__PURE__ */ jsx27(
|
|
2780
|
+
"img",
|
|
2781
|
+
{
|
|
2782
|
+
src: resolvedSrc,
|
|
2783
|
+
alt: alt ?? fileName ?? "Pr\xE9via do arquivo",
|
|
2784
|
+
className: "size-full object-cover",
|
|
2785
|
+
onError: () => setErrored(true)
|
|
2786
|
+
}
|
|
2787
|
+
) : /* @__PURE__ */ jsx27(
|
|
2788
|
+
FallbackIcon,
|
|
2789
|
+
{
|
|
2790
|
+
mimeType,
|
|
2791
|
+
fileName,
|
|
2792
|
+
iconSize: iconSize3
|
|
2793
|
+
}
|
|
2794
|
+
)
|
|
2795
|
+
}
|
|
2796
|
+
);
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2694
2799
|
// src/primitives/FileUpload/FileUpload.tsx
|
|
2695
|
-
import { useId as useId8, useRef as useRef4, useState as
|
|
2800
|
+
import { useId as useId8, useRef as useRef4, useState as useState10, forwardRef as forwardRef20 } from "react";
|
|
2696
2801
|
import { CloudArrowUp, X as X4, File as FileIcon } from "@phosphor-icons/react";
|
|
2697
|
-
import { Fragment as Fragment3, jsx as
|
|
2802
|
+
import { Fragment as Fragment3, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2698
2803
|
var FileUpload = forwardRef20(
|
|
2699
2804
|
({
|
|
2700
2805
|
onFilesSelected,
|
|
@@ -2715,8 +2820,8 @@ var FileUpload = forwardRef20(
|
|
|
2715
2820
|
const id = useId8();
|
|
2716
2821
|
const inputId = `${id}-input`;
|
|
2717
2822
|
const inputRef = useRef4(null);
|
|
2718
|
-
const [isDragging, setIsDragging] =
|
|
2719
|
-
const [internalError, setInternalError] =
|
|
2823
|
+
const [isDragging, setIsDragging] = useState10(false);
|
|
2824
|
+
const [internalError, setInternalError] = useState10(null);
|
|
2720
2825
|
const displayError = error ?? internalError;
|
|
2721
2826
|
const validateFiles = (selectedFiles) => {
|
|
2722
2827
|
if (accept) {
|
|
@@ -2781,7 +2886,7 @@ var FileUpload = forwardRef20(
|
|
|
2781
2886
|
className: cn("flex flex-col gap-2", className),
|
|
2782
2887
|
...props,
|
|
2783
2888
|
children: [
|
|
2784
|
-
label && /* @__PURE__ */
|
|
2889
|
+
label && /* @__PURE__ */ jsx28(Label, { htmlFor: inputId, children: label }),
|
|
2785
2890
|
/* @__PURE__ */ jsxs16(
|
|
2786
2891
|
"div",
|
|
2787
2892
|
{
|
|
@@ -2818,7 +2923,7 @@ var FileUpload = forwardRef20(
|
|
|
2818
2923
|
displayError && "border-v2-danger-500"
|
|
2819
2924
|
),
|
|
2820
2925
|
children: [
|
|
2821
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ jsx28(
|
|
2822
2927
|
CloudArrowUp,
|
|
2823
2928
|
{
|
|
2824
2929
|
size: 32,
|
|
@@ -2827,7 +2932,7 @@ var FileUpload = forwardRef20(
|
|
|
2827
2932
|
className: "text-v2-fg-muted"
|
|
2828
2933
|
}
|
|
2829
2934
|
),
|
|
2830
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsx28("span", { className: "text-v2-sm text-v2-fg-default", children: dropzonePlaceholder }),
|
|
2831
2936
|
(accept || maxSize) && /* @__PURE__ */ jsxs16("span", { className: "text-v2-xs text-v2-fg-muted", children: [
|
|
2832
2937
|
accept && /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2833
2938
|
"Aceita: ",
|
|
@@ -2840,7 +2945,7 @@ var FileUpload = forwardRef20(
|
|
|
2840
2945
|
" MB"
|
|
2841
2946
|
] })
|
|
2842
2947
|
] }),
|
|
2843
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ jsx28(
|
|
2844
2949
|
"input",
|
|
2845
2950
|
{
|
|
2846
2951
|
ref: inputRef,
|
|
@@ -2856,12 +2961,12 @@ var FileUpload = forwardRef20(
|
|
|
2856
2961
|
]
|
|
2857
2962
|
}
|
|
2858
2963
|
),
|
|
2859
|
-
files && files.length > 0 && /* @__PURE__ */
|
|
2964
|
+
files && files.length > 0 && /* @__PURE__ */ jsx28("ul", { className: "flex flex-col gap-1.5", children: files.map((file, idx) => /* @__PURE__ */ jsxs16(
|
|
2860
2965
|
"li",
|
|
2861
2966
|
{
|
|
2862
2967
|
className: "flex items-center gap-2 rounded-v2-md border border-v2-border-default bg-v2-panel px-3 py-2",
|
|
2863
2968
|
children: [
|
|
2864
|
-
/* @__PURE__ */
|
|
2969
|
+
/* @__PURE__ */ jsx28(
|
|
2865
2970
|
FileIcon,
|
|
2866
2971
|
{
|
|
2867
2972
|
size: 16,
|
|
@@ -2869,27 +2974,27 @@ var FileUpload = forwardRef20(
|
|
|
2869
2974
|
className: "text-v2-fg-muted"
|
|
2870
2975
|
}
|
|
2871
2976
|
),
|
|
2872
|
-
/* @__PURE__ */
|
|
2977
|
+
/* @__PURE__ */ jsx28("span", { className: "flex-1 truncate text-v2-sm text-v2-fg-default", children: file.name }),
|
|
2873
2978
|
/* @__PURE__ */ jsxs16("span", { className: "text-v2-xs tabular-nums text-v2-fg-muted", children: [
|
|
2874
2979
|
(file.size / 1024).toFixed(1),
|
|
2875
2980
|
" KB"
|
|
2876
2981
|
] }),
|
|
2877
|
-
onFileRemove && /* @__PURE__ */
|
|
2982
|
+
onFileRemove && /* @__PURE__ */ jsx28(
|
|
2878
2983
|
"button",
|
|
2879
2984
|
{
|
|
2880
2985
|
type: "button",
|
|
2881
2986
|
"aria-label": `Remover ${file.name}`,
|
|
2882
2987
|
onClick: () => onFileRemove(file, idx),
|
|
2883
2988
|
className: "inline-flex items-center justify-center rounded-v2-sm p-1 text-v2-fg-muted hover:bg-v2-bg-subtle hover:text-v2-danger-500",
|
|
2884
|
-
children: /* @__PURE__ */
|
|
2989
|
+
children: /* @__PURE__ */ jsx28(X4, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
2885
2990
|
}
|
|
2886
2991
|
)
|
|
2887
2992
|
]
|
|
2888
2993
|
},
|
|
2889
2994
|
`${file.name}-${idx}`
|
|
2890
2995
|
)) }),
|
|
2891
|
-
helper && !displayError && /* @__PURE__ */
|
|
2892
|
-
displayError && /* @__PURE__ */
|
|
2996
|
+
helper && !displayError && /* @__PURE__ */ jsx28("p", { className: "text-v2-xs text-v2-fg-muted", children: helper }),
|
|
2997
|
+
displayError && /* @__PURE__ */ jsx28("p", { className: "text-v2-xs text-v2-danger-500", role: "alert", children: displayError })
|
|
2893
2998
|
]
|
|
2894
2999
|
}
|
|
2895
3000
|
);
|
|
@@ -2908,7 +3013,7 @@ import {
|
|
|
2908
3013
|
Warning as Warning2,
|
|
2909
3014
|
WarningCircle
|
|
2910
3015
|
} from "@phosphor-icons/react";
|
|
2911
|
-
import { jsx as
|
|
3016
|
+
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2912
3017
|
var formAlertStyles = cva11(
|
|
2913
3018
|
"flex items-start gap-3 rounded-v2-md border p-4 text-v2-sm",
|
|
2914
3019
|
{
|
|
@@ -2940,10 +3045,10 @@ var FormAlert = forwardRef21(
|
|
|
2940
3045
|
className: cn(formAlertStyles({ variant }), className),
|
|
2941
3046
|
...props,
|
|
2942
3047
|
children: [
|
|
2943
|
-
!hideIcon && /* @__PURE__ */
|
|
3048
|
+
!hideIcon && /* @__PURE__ */ jsx29("span", { className: "mt-0.5 shrink-0", "aria-hidden": "true", children: icon ?? /* @__PURE__ */ jsx29(IconComponent, { size: 18, weight: "fill" }) }),
|
|
2944
3049
|
/* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2945
|
-
title && /* @__PURE__ */
|
|
2946
|
-
children && /* @__PURE__ */
|
|
3050
|
+
title && /* @__PURE__ */ jsx29("span", { className: "font-semibold text-v2-fg-default", children: title }),
|
|
3051
|
+
children && /* @__PURE__ */ jsx29("div", { className: "min-w-0", children })
|
|
2947
3052
|
] })
|
|
2948
3053
|
]
|
|
2949
3054
|
}
|
|
@@ -2953,7 +3058,7 @@ var FormAlert = forwardRef21(
|
|
|
2953
3058
|
FormAlert.displayName = "FormAlert";
|
|
2954
3059
|
|
|
2955
3060
|
// src/primitives/FullScreenLoading/FullScreenLoading.tsx
|
|
2956
|
-
import { jsx as
|
|
3061
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2957
3062
|
function FullScreenLoading({
|
|
2958
3063
|
message,
|
|
2959
3064
|
className
|
|
@@ -2968,8 +3073,8 @@ function FullScreenLoading({
|
|
|
2968
3073
|
className
|
|
2969
3074
|
),
|
|
2970
3075
|
children: [
|
|
2971
|
-
message ? /* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
3076
|
+
message ? /* @__PURE__ */ jsx30("span", { className: "text-v2-sm text-v2-fg-default", children: message }) : null,
|
|
3077
|
+
/* @__PURE__ */ jsx30(Spinner, { size: "md", decorative: true })
|
|
2973
3078
|
]
|
|
2974
3079
|
}
|
|
2975
3080
|
);
|
|
@@ -2979,7 +3084,7 @@ FullScreenLoading.displayName = "FullScreenLoading";
|
|
|
2979
3084
|
// src/primitives/Heading/Heading.tsx
|
|
2980
3085
|
import { forwardRef as forwardRef22 } from "react";
|
|
2981
3086
|
import { cva as cva12 } from "class-variance-authority";
|
|
2982
|
-
import { jsx as
|
|
3087
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2983
3088
|
var headingStyles = cva12("tracking-tight text-v2-fg-default", {
|
|
2984
3089
|
variants: {
|
|
2985
3090
|
size: {
|
|
@@ -2997,7 +3102,7 @@ var headingStyles = cva12("tracking-tight text-v2-fg-default", {
|
|
|
2997
3102
|
var Heading = forwardRef22(
|
|
2998
3103
|
({ level = 2, size, className, ...props }, ref) => {
|
|
2999
3104
|
const Tag = `h${level}`;
|
|
3000
|
-
return /* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ jsx31(
|
|
3001
3106
|
Tag,
|
|
3002
3107
|
{
|
|
3003
3108
|
ref,
|
|
@@ -3012,7 +3117,7 @@ Heading.displayName = "Heading";
|
|
|
3012
3117
|
// src/primitives/HelpHint/HelpHint.tsx
|
|
3013
3118
|
import { forwardRef as forwardRef23 } from "react";
|
|
3014
3119
|
import { ArrowRight, PlayCircle, Question } from "@phosphor-icons/react";
|
|
3015
|
-
import { jsx as
|
|
3120
|
+
import { jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3016
3121
|
var TRIGGER_SIZE = {
|
|
3017
3122
|
sm: "size-6",
|
|
3018
3123
|
md: "size-8"
|
|
@@ -3056,7 +3161,7 @@ var HelpHint = forwardRef23(
|
|
|
3056
3161
|
}, ref) {
|
|
3057
3162
|
const embed = videoUrl ? toEmbedUrl(videoUrl) : null;
|
|
3058
3163
|
return /* @__PURE__ */ jsxs19(Popover, { children: [
|
|
3059
|
-
/* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ jsx32(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsx32(
|
|
3060
3165
|
"button",
|
|
3061
3166
|
{
|
|
3062
3167
|
ref,
|
|
@@ -3067,7 +3172,7 @@ var HelpHint = forwardRef23(
|
|
|
3067
3172
|
TRIGGER_SIZE[size],
|
|
3068
3173
|
className
|
|
3069
3174
|
),
|
|
3070
|
-
children: /* @__PURE__ */
|
|
3175
|
+
children: /* @__PURE__ */ jsx32(
|
|
3071
3176
|
Question,
|
|
3072
3177
|
{
|
|
3073
3178
|
size: TRIGGER_ICON[size],
|
|
@@ -3088,8 +3193,8 @@ var HelpHint = forwardRef23(
|
|
|
3088
3193
|
embed ? "w-96" : "w-72"
|
|
3089
3194
|
),
|
|
3090
3195
|
children: [
|
|
3091
|
-
title && /* @__PURE__ */
|
|
3092
|
-
/* @__PURE__ */
|
|
3196
|
+
title && /* @__PURE__ */ jsx32("div", { className: "border-b border-v2-border-subtle bg-v2-bg-subtle px-4 py-2.5", children: /* @__PURE__ */ jsxs19("p", { className: "flex items-center gap-1.5 text-v2-sm font-semibold text-v2-fg-default", children: [
|
|
3197
|
+
/* @__PURE__ */ jsx32(
|
|
3093
3198
|
Question,
|
|
3094
3199
|
{
|
|
3095
3200
|
size: 14,
|
|
@@ -3100,7 +3205,7 @@ var HelpHint = forwardRef23(
|
|
|
3100
3205
|
),
|
|
3101
3206
|
title
|
|
3102
3207
|
] }) }),
|
|
3103
|
-
embed && /* @__PURE__ */
|
|
3208
|
+
embed && /* @__PURE__ */ jsx32("div", { className: "relative aspect-video w-full bg-v2-canvas", children: /* @__PURE__ */ jsx32(
|
|
3104
3209
|
"iframe",
|
|
3105
3210
|
{
|
|
3106
3211
|
src: embed,
|
|
@@ -3110,16 +3215,16 @@ var HelpHint = forwardRef23(
|
|
|
3110
3215
|
className: "absolute inset-0 size-full border-0"
|
|
3111
3216
|
}
|
|
3112
3217
|
) }),
|
|
3113
|
-
/* @__PURE__ */
|
|
3114
|
-
docHref && /* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ jsx32("div", { className: "px-4 py-3", children: /* @__PURE__ */ jsx32("p", { className: "text-v2-sm leading-relaxed text-v2-fg-default", children: description }) }),
|
|
3219
|
+
docHref && /* @__PURE__ */ jsx32("div", { className: "border-t border-v2-border-subtle bg-v2-bg-subtle px-4 py-2.5", children: /* @__PURE__ */ jsxs19(
|
|
3115
3220
|
"a",
|
|
3116
3221
|
{
|
|
3117
3222
|
href: docHref,
|
|
3118
3223
|
className: "group/cta inline-flex items-center gap-1.5 text-v2-xs font-bold text-v2-brand-primary hover:underline focus-visible:underline focus-visible:outline-none",
|
|
3119
3224
|
children: [
|
|
3120
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ jsx32(PlayCircle, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
3121
3226
|
docLabel,
|
|
3122
|
-
/* @__PURE__ */
|
|
3227
|
+
/* @__PURE__ */ jsx32(
|
|
3123
3228
|
ArrowRight,
|
|
3124
3229
|
{
|
|
3125
3230
|
size: 12,
|
|
@@ -3140,7 +3245,7 @@ var HelpHint = forwardRef23(
|
|
|
3140
3245
|
HelpHint.displayName = "HelpHint";
|
|
3141
3246
|
|
|
3142
3247
|
// src/primitives/ImageUpload/ImageUpload.tsx
|
|
3143
|
-
import { forwardRef as forwardRef25, useId as useId9, useRef as useRef5, useState as
|
|
3248
|
+
import { forwardRef as forwardRef25, useId as useId9, useRef as useRef5, useState as useState11 } from "react";
|
|
3144
3249
|
import { ImageSquare, UploadSimple, X as X5 } from "@phosphor-icons/react";
|
|
3145
3250
|
|
|
3146
3251
|
// src/lib/base64.ts
|
|
@@ -3175,7 +3280,7 @@ async function getBase64(file) {
|
|
|
3175
3280
|
// src/primitives/Text/Text.tsx
|
|
3176
3281
|
import { forwardRef as forwardRef24 } from "react";
|
|
3177
3282
|
import { cva as cva13 } from "class-variance-authority";
|
|
3178
|
-
import { jsx as
|
|
3283
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3179
3284
|
var textStyles = cva13("", {
|
|
3180
3285
|
variants: {
|
|
3181
3286
|
size: {
|
|
@@ -3201,7 +3306,7 @@ var textStyles = cva13("", {
|
|
|
3201
3306
|
});
|
|
3202
3307
|
var Text = forwardRef24(({ tag = "p", size, color, weight, className, ...props }, ref) => {
|
|
3203
3308
|
const Tag = tag;
|
|
3204
|
-
return /* @__PURE__ */
|
|
3309
|
+
return /* @__PURE__ */ jsx33(
|
|
3205
3310
|
Tag,
|
|
3206
3311
|
{
|
|
3207
3312
|
ref,
|
|
@@ -3213,7 +3318,7 @@ var Text = forwardRef24(({ tag = "p", size, color, weight, className, ...props }
|
|
|
3213
3318
|
Text.displayName = "Text";
|
|
3214
3319
|
|
|
3215
3320
|
// src/primitives/ImageUpload/ImageUpload.tsx
|
|
3216
|
-
import { jsx as
|
|
3321
|
+
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3217
3322
|
var DEFAULT_ACCEPT = "image/png, image/jpeg, image/jpg";
|
|
3218
3323
|
var ImageUpload = forwardRef25(
|
|
3219
3324
|
({
|
|
@@ -3238,7 +3343,7 @@ var ImageUpload = forwardRef25(
|
|
|
3238
3343
|
const generatedId = useId9();
|
|
3239
3344
|
const inputId = id ?? generatedId;
|
|
3240
3345
|
const inputRef = useRef5(null);
|
|
3241
|
-
const [internalError, setInternalError] =
|
|
3346
|
+
const [internalError, setInternalError] = useState11(null);
|
|
3242
3347
|
const displayError = error ?? internalError;
|
|
3243
3348
|
const handleSelect = async (e) => {
|
|
3244
3349
|
var _a;
|
|
@@ -3261,8 +3366,8 @@ var ImageUpload = forwardRef25(
|
|
|
3261
3366
|
disabled && "cursor-not-allowed opacity-60"
|
|
3262
3367
|
);
|
|
3263
3368
|
return /* @__PURE__ */ jsxs20("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
3264
|
-
label && /* @__PURE__ */
|
|
3265
|
-
helper && /* @__PURE__ */
|
|
3369
|
+
label && /* @__PURE__ */ jsx34(Label, { htmlFor: inputId, required, children: label }),
|
|
3370
|
+
helper && /* @__PURE__ */ jsx34(Text, { size: "xs", color: "muted", children: helper }),
|
|
3266
3371
|
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-3", children: [
|
|
3267
3372
|
/* @__PURE__ */ jsxs20(
|
|
3268
3373
|
"button",
|
|
@@ -3275,12 +3380,12 @@ var ImageUpload = forwardRef25(
|
|
|
3275
3380
|
},
|
|
3276
3381
|
className: triggerClassName,
|
|
3277
3382
|
children: [
|
|
3278
|
-
/* @__PURE__ */
|
|
3383
|
+
/* @__PURE__ */ jsx34(UploadSimple, { size: 14, weight: "bold", "aria-hidden": "true" }),
|
|
3279
3384
|
value ? changeLabel : selectLabel
|
|
3280
3385
|
]
|
|
3281
3386
|
}
|
|
3282
3387
|
),
|
|
3283
|
-
value && !disabled && /* @__PURE__ */
|
|
3388
|
+
value && !disabled && /* @__PURE__ */ jsx34(
|
|
3284
3389
|
ConfirmDialog,
|
|
3285
3390
|
{
|
|
3286
3391
|
title: removeConfirmTitle,
|
|
@@ -3290,18 +3395,18 @@ var ImageUpload = forwardRef25(
|
|
|
3290
3395
|
onValueChange(null);
|
|
3291
3396
|
setInternalError(null);
|
|
3292
3397
|
},
|
|
3293
|
-
trigger: /* @__PURE__ */
|
|
3398
|
+
trigger: /* @__PURE__ */ jsx34(
|
|
3294
3399
|
"button",
|
|
3295
3400
|
{
|
|
3296
3401
|
type: "button",
|
|
3297
3402
|
"aria-label": "Remover arquivo",
|
|
3298
3403
|
className: "inline-flex size-8 items-center justify-center rounded-v2-md text-v2-fg-muted transition-colors hover:bg-v2-danger-500/10 hover:text-v2-danger-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-v2-border-strong",
|
|
3299
|
-
children: /* @__PURE__ */
|
|
3404
|
+
children: /* @__PURE__ */ jsx34(X5, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
3300
3405
|
}
|
|
3301
3406
|
)
|
|
3302
3407
|
}
|
|
3303
3408
|
),
|
|
3304
|
-
/* @__PURE__ */
|
|
3409
|
+
/* @__PURE__ */ jsx34(
|
|
3305
3410
|
"input",
|
|
3306
3411
|
{
|
|
3307
3412
|
ref: (node) => {
|
|
@@ -3318,21 +3423,21 @@ var ImageUpload = forwardRef25(
|
|
|
3318
3423
|
}
|
|
3319
3424
|
)
|
|
3320
3425
|
] }),
|
|
3321
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ jsx34(
|
|
3322
3427
|
"div",
|
|
3323
3428
|
{
|
|
3324
3429
|
className: cn(
|
|
3325
3430
|
"flex h-32 w-full items-center justify-center overflow-hidden rounded-v2-md border border-v2-border-subtle",
|
|
3326
3431
|
previewBgClass
|
|
3327
3432
|
),
|
|
3328
|
-
children: value ? /* @__PURE__ */
|
|
3433
|
+
children: value ? /* @__PURE__ */ jsx34(
|
|
3329
3434
|
"img",
|
|
3330
3435
|
{
|
|
3331
3436
|
src: value,
|
|
3332
3437
|
alt: typeof label === "string" ? label : "Pr\xE9-visualiza\xE7\xE3o",
|
|
3333
3438
|
className: "max-h-28 max-w-full object-contain"
|
|
3334
3439
|
}
|
|
3335
|
-
) : /* @__PURE__ */
|
|
3440
|
+
) : /* @__PURE__ */ jsx34(
|
|
3336
3441
|
ImageSquare,
|
|
3337
3442
|
{
|
|
3338
3443
|
size: 32,
|
|
@@ -3343,7 +3448,7 @@ var ImageUpload = forwardRef25(
|
|
|
3343
3448
|
)
|
|
3344
3449
|
}
|
|
3345
3450
|
),
|
|
3346
|
-
displayError && /* @__PURE__ */
|
|
3451
|
+
displayError && /* @__PURE__ */ jsx34("p", { className: "text-v2-xs text-v2-danger-500", role: "alert", children: displayError })
|
|
3347
3452
|
] });
|
|
3348
3453
|
}
|
|
3349
3454
|
);
|
|
@@ -3354,7 +3459,7 @@ import {
|
|
|
3354
3459
|
useLayoutEffect,
|
|
3355
3460
|
useRef as useRef6
|
|
3356
3461
|
} from "react";
|
|
3357
|
-
import { jsx as
|
|
3462
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3358
3463
|
function formatBRL(digits) {
|
|
3359
3464
|
const cents = parseInt(digits || "0", 10);
|
|
3360
3465
|
return new Intl.NumberFormat("pt-BR", {
|
|
@@ -3394,7 +3499,7 @@ function MoneyInput({
|
|
|
3394
3499
|
const handleMouseUp = (e) => {
|
|
3395
3500
|
setCaretToEnd(e.currentTarget);
|
|
3396
3501
|
};
|
|
3397
|
-
return /* @__PURE__ */
|
|
3502
|
+
return /* @__PURE__ */ jsx35(
|
|
3398
3503
|
Input,
|
|
3399
3504
|
{
|
|
3400
3505
|
inputMode: "numeric",
|
|
@@ -3409,9 +3514,9 @@ function MoneyInput({
|
|
|
3409
3514
|
}
|
|
3410
3515
|
|
|
3411
3516
|
// src/primitives/MultiCombobox/MultiCombobox.tsx
|
|
3412
|
-
import { forwardRef as forwardRef26, useEffect as
|
|
3517
|
+
import { forwardRef as forwardRef26, useEffect as useEffect7, useId as useId10, useRef as useRef7, useState as useState12 } from "react";
|
|
3413
3518
|
import { CaretDown as CaretDown4, MagnifyingGlass as MagnifyingGlass2, X as X6 } from "@phosphor-icons/react";
|
|
3414
|
-
import { Fragment as Fragment4, jsx as
|
|
3519
|
+
import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3415
3520
|
var DEFAULT_MAX_CHIPS = 3;
|
|
3416
3521
|
var MultiCombobox = forwardRef26(
|
|
3417
3522
|
({
|
|
@@ -3438,12 +3543,12 @@ var MultiCombobox = forwardRef26(
|
|
|
3438
3543
|
const listboxId = `${generatedId}-listbox`;
|
|
3439
3544
|
const helperId = `${generatedId}-helper`;
|
|
3440
3545
|
const errorId = `${generatedId}-error`;
|
|
3441
|
-
const [internalValue, setInternalValue] =
|
|
3546
|
+
const [internalValue, setInternalValue] = useState12(
|
|
3442
3547
|
defaultValue ?? []
|
|
3443
3548
|
);
|
|
3444
3549
|
const currentValue = value ?? internalValue;
|
|
3445
|
-
const [open, setOpen] =
|
|
3446
|
-
const [query, setQuery] =
|
|
3550
|
+
const [open, setOpen] = useState12(false);
|
|
3551
|
+
const [query, setQuery] = useState12("");
|
|
3447
3552
|
const searchInputRef = useRef7(null);
|
|
3448
3553
|
const selectedItems = currentValue.map((v) => items.find((i) => i.value === v)).filter((i) => !!i);
|
|
3449
3554
|
const filteredItems = items.filter(
|
|
@@ -3472,7 +3577,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3472
3577
|
setOpen(false);
|
|
3473
3578
|
}
|
|
3474
3579
|
};
|
|
3475
|
-
|
|
3580
|
+
useEffect7(() => {
|
|
3476
3581
|
var _a;
|
|
3477
3582
|
if (open) {
|
|
3478
3583
|
(_a = searchInputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -3501,21 +3606,21 @@ var MultiCombobox = forwardRef26(
|
|
|
3501
3606
|
disabled && "cursor-not-allowed opacity-50 hover:border-v2-border-default"
|
|
3502
3607
|
),
|
|
3503
3608
|
children: [
|
|
3504
|
-
/* @__PURE__ */
|
|
3609
|
+
/* @__PURE__ */ jsx36(
|
|
3505
3610
|
"span",
|
|
3506
3611
|
{
|
|
3507
3612
|
className: cn(
|
|
3508
3613
|
"flex flex-1 flex-wrap items-center gap-1 text-left",
|
|
3509
3614
|
selectedItems.length === 0 && "text-v2-fg-muted"
|
|
3510
3615
|
),
|
|
3511
|
-
children: selectedItems.length === 0 ? /* @__PURE__ */
|
|
3616
|
+
children: selectedItems.length === 0 ? /* @__PURE__ */ jsx36("span", { className: "py-0.5", children: placeholder }) : /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
3512
3617
|
visibleChips.map((item) => /* @__PURE__ */ jsxs21(
|
|
3513
3618
|
"span",
|
|
3514
3619
|
{
|
|
3515
3620
|
className: "inline-flex items-center gap-1 rounded-v2-pill bg-v2-brand-bg-soft px-2 py-0.5 text-v2-xs font-medium text-v2-brand-text-dark",
|
|
3516
3621
|
children: [
|
|
3517
|
-
/* @__PURE__ */
|
|
3518
|
-
!disabled && /* @__PURE__ */
|
|
3622
|
+
/* @__PURE__ */ jsx36("span", { className: "max-w-[140px] truncate", children: item.label }),
|
|
3623
|
+
!disabled && /* @__PURE__ */ jsx36(
|
|
3519
3624
|
"span",
|
|
3520
3625
|
{
|
|
3521
3626
|
role: "button",
|
|
@@ -3533,7 +3638,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3533
3638
|
}
|
|
3534
3639
|
},
|
|
3535
3640
|
className: "inline-flex items-center justify-center rounded-v2-sm hover:bg-v2-action-primary/15",
|
|
3536
|
-
children: /* @__PURE__ */
|
|
3641
|
+
children: /* @__PURE__ */ jsx36(X6, { size: 10, weight: "bold", "aria-hidden": "true" })
|
|
3537
3642
|
}
|
|
3538
3643
|
)
|
|
3539
3644
|
]
|
|
@@ -3548,7 +3653,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3548
3653
|
}
|
|
3549
3654
|
),
|
|
3550
3655
|
/* @__PURE__ */ jsxs21("span", { className: "flex shrink-0 items-center gap-1 pt-0.5", children: [
|
|
3551
|
-
selectedItems.length > 0 && !disabled && /* @__PURE__ */
|
|
3656
|
+
selectedItems.length > 0 && !disabled && /* @__PURE__ */ jsx36(
|
|
3552
3657
|
"span",
|
|
3553
3658
|
{
|
|
3554
3659
|
role: "button",
|
|
@@ -3566,10 +3671,10 @@ var MultiCombobox = forwardRef26(
|
|
|
3566
3671
|
}
|
|
3567
3672
|
},
|
|
3568
3673
|
className: "inline-flex items-center justify-center rounded-v2-sm p-0.5 text-v2-fg-muted hover:bg-v2-bg-subtle hover:text-v2-fg-default",
|
|
3569
|
-
children: /* @__PURE__ */
|
|
3674
|
+
children: /* @__PURE__ */ jsx36(X6, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
3570
3675
|
}
|
|
3571
3676
|
),
|
|
3572
|
-
/* @__PURE__ */
|
|
3677
|
+
/* @__PURE__ */ jsx36(
|
|
3573
3678
|
CaretDown4,
|
|
3574
3679
|
{
|
|
3575
3680
|
size: 16,
|
|
@@ -3584,7 +3689,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3584
3689
|
return /* @__PURE__ */ jsxs21("div", { className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
3585
3690
|
/* @__PURE__ */ jsxs21(Popover, { open, onOpenChange: setOpen, children: [
|
|
3586
3691
|
label ? /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
3587
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsx36(Popover.Trigger, { asChild: true, children: triggerButton }),
|
|
3588
3693
|
/* @__PURE__ */ jsxs21(
|
|
3589
3694
|
"label",
|
|
3590
3695
|
{
|
|
@@ -3595,7 +3700,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3595
3700
|
),
|
|
3596
3701
|
children: [
|
|
3597
3702
|
label,
|
|
3598
|
-
required && /* @__PURE__ */
|
|
3703
|
+
required && /* @__PURE__ */ jsx36(
|
|
3599
3704
|
"span",
|
|
3600
3705
|
{
|
|
3601
3706
|
"aria-hidden": "true",
|
|
@@ -3606,7 +3711,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3606
3711
|
]
|
|
3607
3712
|
}
|
|
3608
3713
|
)
|
|
3609
|
-
] }) : /* @__PURE__ */
|
|
3714
|
+
] }) : /* @__PURE__ */ jsx36(Popover.Trigger, { asChild: true, children: triggerButton }),
|
|
3610
3715
|
/* @__PURE__ */ jsxs21(
|
|
3611
3716
|
Popover.Content,
|
|
3612
3717
|
{
|
|
@@ -3617,7 +3722,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3617
3722
|
sideOffset: 4,
|
|
3618
3723
|
children: [
|
|
3619
3724
|
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 border-b border-v2-border-default px-3 py-2", children: [
|
|
3620
|
-
/* @__PURE__ */
|
|
3725
|
+
/* @__PURE__ */ jsx36(
|
|
3621
3726
|
MagnifyingGlass2,
|
|
3622
3727
|
{
|
|
3623
3728
|
size: 16,
|
|
@@ -3625,7 +3730,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3625
3730
|
className: "text-v2-fg-muted"
|
|
3626
3731
|
}
|
|
3627
3732
|
),
|
|
3628
|
-
/* @__PURE__ */
|
|
3733
|
+
/* @__PURE__ */ jsx36(
|
|
3629
3734
|
"input",
|
|
3630
3735
|
{
|
|
3631
3736
|
ref: searchInputRef,
|
|
@@ -3638,7 +3743,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3638
3743
|
className: "flex-1 bg-transparent text-v2-sm text-v2-fg-default placeholder:text-v2-fg-muted focus:outline-none"
|
|
3639
3744
|
}
|
|
3640
3745
|
),
|
|
3641
|
-
selectedItems.length > 0 && /* @__PURE__ */
|
|
3746
|
+
selectedItems.length > 0 && /* @__PURE__ */ jsx36(
|
|
3642
3747
|
"button",
|
|
3643
3748
|
{
|
|
3644
3749
|
type: "button",
|
|
@@ -3648,14 +3753,14 @@ var MultiCombobox = forwardRef26(
|
|
|
3648
3753
|
}
|
|
3649
3754
|
)
|
|
3650
3755
|
] }),
|
|
3651
|
-
/* @__PURE__ */
|
|
3756
|
+
/* @__PURE__ */ jsx36(
|
|
3652
3757
|
"ul",
|
|
3653
3758
|
{
|
|
3654
3759
|
id: listboxId,
|
|
3655
3760
|
role: "listbox",
|
|
3656
3761
|
"aria-multiselectable": "true",
|
|
3657
3762
|
className: "max-h-[280px] overflow-y-auto py-1",
|
|
3658
|
-
children: loading ? /* @__PURE__ */
|
|
3763
|
+
children: loading ? /* @__PURE__ */ jsx36("li", { className: "px-3 py-2 text-v2-sm text-v2-fg-muted", children: "Buscando\u2026" }) : filteredItems.length === 0 ? /* @__PURE__ */ jsx36("li", { className: "px-3 py-2 text-v2-sm text-v2-fg-muted", children: emptyMessage }) : filteredItems.map((item) => {
|
|
3659
3764
|
const isSelected = currentValue.includes(item.value);
|
|
3660
3765
|
return /* @__PURE__ */ jsxs21(
|
|
3661
3766
|
"li",
|
|
@@ -3670,7 +3775,7 @@ var MultiCombobox = forwardRef26(
|
|
|
3670
3775
|
item.disabled && "cursor-not-allowed opacity-50"
|
|
3671
3776
|
),
|
|
3672
3777
|
children: [
|
|
3673
|
-
/* @__PURE__ */
|
|
3778
|
+
/* @__PURE__ */ jsx36(
|
|
3674
3779
|
"span",
|
|
3675
3780
|
{
|
|
3676
3781
|
className: cn(
|
|
@@ -3678,14 +3783,14 @@ var MultiCombobox = forwardRef26(
|
|
|
3678
3783
|
isSelected ? "border-v2-action-primary bg-v2-action-primary text-v2-action-on-primary" : "border-v2-border-default"
|
|
3679
3784
|
),
|
|
3680
3785
|
"aria-hidden": "true",
|
|
3681
|
-
children: isSelected && /* @__PURE__ */
|
|
3786
|
+
children: isSelected && /* @__PURE__ */ jsx36(
|
|
3682
3787
|
"svg",
|
|
3683
3788
|
{
|
|
3684
3789
|
width: "10",
|
|
3685
3790
|
height: "10",
|
|
3686
3791
|
viewBox: "0 0 10 10",
|
|
3687
3792
|
fill: "none",
|
|
3688
|
-
children: /* @__PURE__ */
|
|
3793
|
+
children: /* @__PURE__ */ jsx36(
|
|
3689
3794
|
"path",
|
|
3690
3795
|
{
|
|
3691
3796
|
d: "M1 5l3 3 5-6",
|
|
@@ -3700,8 +3805,8 @@ var MultiCombobox = forwardRef26(
|
|
|
3700
3805
|
}
|
|
3701
3806
|
),
|
|
3702
3807
|
/* @__PURE__ */ jsxs21("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
3703
|
-
/* @__PURE__ */
|
|
3704
|
-
item.description && /* @__PURE__ */
|
|
3808
|
+
/* @__PURE__ */ jsx36("span", { className: "truncate", children: item.label }),
|
|
3809
|
+
item.description && /* @__PURE__ */ jsx36(
|
|
3705
3810
|
"span",
|
|
3706
3811
|
{
|
|
3707
3812
|
className: cn(
|
|
@@ -3728,8 +3833,8 @@ var MultiCombobox = forwardRef26(
|
|
|
3728
3833
|
}
|
|
3729
3834
|
)
|
|
3730
3835
|
] }),
|
|
3731
|
-
helper && !error && /* @__PURE__ */
|
|
3732
|
-
error && /* @__PURE__ */
|
|
3836
|
+
helper && !error && /* @__PURE__ */ jsx36("p", { id: helperId, className: "text-v2-xs text-v2-fg-muted", children: helper }),
|
|
3837
|
+
error && /* @__PURE__ */ jsx36(
|
|
3733
3838
|
"p",
|
|
3734
3839
|
{
|
|
3735
3840
|
id: errorId,
|
|
@@ -3746,7 +3851,7 @@ MultiCombobox.displayName = "MultiCombobox";
|
|
|
3746
3851
|
// src/primitives/OtpInput/OtpInput.tsx
|
|
3747
3852
|
import { forwardRef as forwardRef27 } from "react";
|
|
3748
3853
|
import { OTPInput, REGEXP_ONLY_DIGITS } from "input-otp";
|
|
3749
|
-
import { jsx as
|
|
3854
|
+
import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3750
3855
|
function OtpSlot({
|
|
3751
3856
|
char,
|
|
3752
3857
|
isActive: isActive2,
|
|
@@ -3763,7 +3868,7 @@ function OtpSlot({
|
|
|
3763
3868
|
),
|
|
3764
3869
|
children: [
|
|
3765
3870
|
char,
|
|
3766
|
-
hasFakeCaret && /* @__PURE__ */
|
|
3871
|
+
hasFakeCaret && /* @__PURE__ */ jsx37("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx37(
|
|
3767
3872
|
"div",
|
|
3768
3873
|
{
|
|
3769
3874
|
className: cn(
|
|
@@ -3794,7 +3899,7 @@ var OtpInput = forwardRef27(
|
|
|
3794
3899
|
"aria-label": "C\xF3digo de verifica\xE7\xE3o",
|
|
3795
3900
|
className: "flex flex-col items-center gap-1.5",
|
|
3796
3901
|
children: [
|
|
3797
|
-
/* @__PURE__ */
|
|
3902
|
+
/* @__PURE__ */ jsx37(
|
|
3798
3903
|
OTPInput,
|
|
3799
3904
|
{
|
|
3800
3905
|
ref,
|
|
@@ -3806,11 +3911,11 @@ var OtpInput = forwardRef27(
|
|
|
3806
3911
|
"flex items-center gap-2 overflow-hidden p-1 has-[:disabled]:opacity-50",
|
|
3807
3912
|
className
|
|
3808
3913
|
),
|
|
3809
|
-
render: ({ slots }) => /* @__PURE__ */
|
|
3914
|
+
render: ({ slots }) => /* @__PURE__ */ jsx37("div", { className: "flex items-center gap-2", children: slots.map((slot, idx) => /* @__PURE__ */ jsx37(OtpSlot, { ...slot, isDark }, idx)) }),
|
|
3810
3915
|
...props
|
|
3811
3916
|
}
|
|
3812
3917
|
),
|
|
3813
|
-
error && /* @__PURE__ */
|
|
3918
|
+
error && /* @__PURE__ */ jsx37("span", { className: "text-v2-xs text-v2-danger-500", role: "alert", children: error })
|
|
3814
3919
|
]
|
|
3815
3920
|
}
|
|
3816
3921
|
);
|
|
@@ -3819,19 +3924,19 @@ var OtpInput = forwardRef27(
|
|
|
3819
3924
|
OtpInput.displayName = "OtpInput";
|
|
3820
3925
|
|
|
3821
3926
|
// src/primitives/PasswordInput/PasswordInput.tsx
|
|
3822
|
-
import { forwardRef as forwardRef28, useState as
|
|
3927
|
+
import { forwardRef as forwardRef28, useState as useState13 } from "react";
|
|
3823
3928
|
import { Eye, EyeSlash } from "@phosphor-icons/react";
|
|
3824
|
-
import { jsx as
|
|
3929
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3825
3930
|
var PasswordInput = forwardRef28(
|
|
3826
3931
|
(props, ref) => {
|
|
3827
|
-
const [visible, setVisible] =
|
|
3932
|
+
const [visible, setVisible] = useState13(false);
|
|
3828
3933
|
const isDark = props.surface === "dark";
|
|
3829
|
-
return /* @__PURE__ */
|
|
3934
|
+
return /* @__PURE__ */ jsx38(
|
|
3830
3935
|
Input,
|
|
3831
3936
|
{
|
|
3832
3937
|
ref,
|
|
3833
3938
|
type: visible ? "text" : "password",
|
|
3834
|
-
rightIcon: /* @__PURE__ */
|
|
3939
|
+
rightIcon: /* @__PURE__ */ jsx38(
|
|
3835
3940
|
"button",
|
|
3836
3941
|
{
|
|
3837
3942
|
type: "button",
|
|
@@ -3842,7 +3947,7 @@ var PasswordInput = forwardRef28(
|
|
|
3842
3947
|
"flex items-center justify-center rounded-v2-sm p-1 transition-colors motion-reduce:transition-none",
|
|
3843
3948
|
isDark ? "text-v2-auth-fg-muted hover:text-v2-auth-fg" : "text-v2-fg-subtle hover:text-v2-fg-default"
|
|
3844
3949
|
),
|
|
3845
|
-
children: visible ? /* @__PURE__ */
|
|
3950
|
+
children: visible ? /* @__PURE__ */ jsx38(EyeSlash, { size: 18, weight: "bold", "aria-hidden": "true" }) : /* @__PURE__ */ jsx38(Eye, { size: 18, weight: "bold", "aria-hidden": "true" })
|
|
3846
3951
|
}
|
|
3847
3952
|
),
|
|
3848
3953
|
...props
|
|
@@ -3857,7 +3962,7 @@ import {
|
|
|
3857
3962
|
useLayoutEffect as useLayoutEffect2,
|
|
3858
3963
|
useRef as useRef8
|
|
3859
3964
|
} from "react";
|
|
3860
|
-
import { jsx as
|
|
3965
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3861
3966
|
function formatPercent(digits) {
|
|
3862
3967
|
const capped = digits.slice(0, 5);
|
|
3863
3968
|
const numeric = parseInt(capped || "0", 10) / 100;
|
|
@@ -3896,7 +4001,7 @@ function PercentInput({
|
|
|
3896
4001
|
const handleMouseUp = (e) => {
|
|
3897
4002
|
setCaretToEditEnd(e.currentTarget);
|
|
3898
4003
|
};
|
|
3899
|
-
return /* @__PURE__ */
|
|
4004
|
+
return /* @__PURE__ */ jsx39(
|
|
3900
4005
|
Input,
|
|
3901
4006
|
{
|
|
3902
4007
|
inputMode: "numeric",
|
|
@@ -3911,9 +4016,9 @@ function PercentInput({
|
|
|
3911
4016
|
}
|
|
3912
4017
|
|
|
3913
4018
|
// src/primitives/PhoneInput/PhoneInput.tsx
|
|
3914
|
-
import { jsx as
|
|
4019
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3915
4020
|
function PhoneInput(props) {
|
|
3916
|
-
return /* @__PURE__ */
|
|
4021
|
+
return /* @__PURE__ */ jsx40(MaskedInput, { ...props, mask: ["(00) 0000-0000", "(00) 00000-0000"] });
|
|
3917
4022
|
}
|
|
3918
4023
|
|
|
3919
4024
|
// src/primitives/RadioGroup/RadioGroup.tsx
|
|
@@ -3922,7 +4027,7 @@ import {
|
|
|
3922
4027
|
useId as useId11
|
|
3923
4028
|
} from "react";
|
|
3924
4029
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
3925
|
-
import { jsx as
|
|
4030
|
+
import { jsx as jsx41, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3926
4031
|
var RadioGroup = forwardRef29(
|
|
3927
4032
|
({
|
|
3928
4033
|
items,
|
|
@@ -3949,11 +4054,11 @@ var RadioGroup = forwardRef29(
|
|
|
3949
4054
|
className: "mb-0 p-0 text-v2-sm font-medium text-v2-fg-default",
|
|
3950
4055
|
children: [
|
|
3951
4056
|
label,
|
|
3952
|
-
required && /* @__PURE__ */
|
|
4057
|
+
required && /* @__PURE__ */ jsx41("span", { "aria-label": "required", className: "ml-1 text-v2-danger-500", children: "*" })
|
|
3953
4058
|
]
|
|
3954
4059
|
}
|
|
3955
4060
|
),
|
|
3956
|
-
/* @__PURE__ */
|
|
4061
|
+
/* @__PURE__ */ jsx41(
|
|
3957
4062
|
RadioGroupPrimitive.Root,
|
|
3958
4063
|
{
|
|
3959
4064
|
ref,
|
|
@@ -3971,23 +4076,23 @@ var RadioGroup = forwardRef29(
|
|
|
3971
4076
|
children: items.map((item) => {
|
|
3972
4077
|
const itemId = `${groupId}-${item.value}`;
|
|
3973
4078
|
return /* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
3974
|
-
/* @__PURE__ */
|
|
4079
|
+
/* @__PURE__ */ jsx41(
|
|
3975
4080
|
RadioGroupPrimitive.Item,
|
|
3976
4081
|
{
|
|
3977
4082
|
value: item.value,
|
|
3978
4083
|
id: itemId,
|
|
3979
4084
|
disabled: item.disabled,
|
|
3980
4085
|
className: "aria-invalid:border-v2-danger-500 peer size-5 shrink-0 rounded-v2-pill border border-v2-border-default bg-v2-raised transition-colors data-[state=checked]:border-v2-action-primary data-[state=checked]:bg-v2-action-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30 focus-visible:ring-offset-2 focus-visible:ring-offset-v2-canvas disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none",
|
|
3981
|
-
children: /* @__PURE__ */
|
|
4086
|
+
children: /* @__PURE__ */ jsx41(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center after:block after:size-2 after:rounded-v2-pill after:bg-v2-action-on-primary" })
|
|
3982
4087
|
}
|
|
3983
4088
|
),
|
|
3984
|
-
/* @__PURE__ */
|
|
4089
|
+
/* @__PURE__ */ jsx41(Label, { htmlFor: itemId, children: item.label })
|
|
3985
4090
|
] }, item.value);
|
|
3986
4091
|
})
|
|
3987
4092
|
}
|
|
3988
4093
|
),
|
|
3989
|
-
helper && !error && /* @__PURE__ */
|
|
3990
|
-
error && /* @__PURE__ */
|
|
4094
|
+
helper && !error && /* @__PURE__ */ jsx41("p", { id: helperId, className: "text-v2-xs text-v2-fg-muted", children: helper }),
|
|
4095
|
+
error && /* @__PURE__ */ jsx41(
|
|
3991
4096
|
"p",
|
|
3992
4097
|
{
|
|
3993
4098
|
id: errorId,
|
|
@@ -4006,9 +4111,9 @@ import {
|
|
|
4006
4111
|
forwardRef as forwardRef30
|
|
4007
4112
|
} from "react";
|
|
4008
4113
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4009
|
-
import { jsx as
|
|
4114
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4010
4115
|
var Separator5 = forwardRef30(
|
|
4011
|
-
({ orientation = "horizontal", decorative = true, className, ...props }, ref) => /* @__PURE__ */
|
|
4116
|
+
({ orientation = "horizontal", decorative = true, className, ...props }, ref) => /* @__PURE__ */ jsx42(
|
|
4012
4117
|
SeparatorPrimitive.Root,
|
|
4013
4118
|
{
|
|
4014
4119
|
ref,
|
|
@@ -4028,7 +4133,7 @@ Separator5.displayName = "Separator";
|
|
|
4028
4133
|
// src/primitives/Stepper/Stepper.tsx
|
|
4029
4134
|
import { forwardRef as forwardRef31 } from "react";
|
|
4030
4135
|
import { Check as Check4, WarningCircle as WarningCircle2, X as X7 } from "@phosphor-icons/react";
|
|
4031
|
-
import { jsx as
|
|
4136
|
+
import { jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4032
4137
|
var stateClass = {
|
|
4033
4138
|
completed: "bg-v2-success-500 text-v2-action-on-primary border-v2-success-500",
|
|
4034
4139
|
active: "bg-v2-action-primary text-v2-action-on-primary border-v2-action-primary",
|
|
@@ -4037,7 +4142,7 @@ var stateClass = {
|
|
|
4037
4142
|
error: "bg-v2-danger-500 text-v2-fg-on-danger border-v2-danger-500"
|
|
4038
4143
|
};
|
|
4039
4144
|
var Stepper = forwardRef31(
|
|
4040
|
-
({ steps, orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */
|
|
4145
|
+
({ steps, orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */ jsx43(
|
|
4041
4146
|
"ol",
|
|
4042
4147
|
{
|
|
4043
4148
|
ref,
|
|
@@ -4047,12 +4152,12 @@ var Stepper = forwardRef31(
|
|
|
4047
4152
|
),
|
|
4048
4153
|
"aria-label": "Passos",
|
|
4049
4154
|
...props,
|
|
4050
|
-
children: steps.map((step, idx) => /* @__PURE__ */
|
|
4155
|
+
children: steps.map((step, idx) => /* @__PURE__ */ jsx43(
|
|
4051
4156
|
"li",
|
|
4052
4157
|
{
|
|
4053
4158
|
className: cn(orientation === "horizontal" ? "flex-1" : ""),
|
|
4054
4159
|
children: /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2", children: [
|
|
4055
|
-
/* @__PURE__ */
|
|
4160
|
+
/* @__PURE__ */ jsx43(
|
|
4056
4161
|
"span",
|
|
4057
4162
|
{
|
|
4058
4163
|
"data-state": step.state,
|
|
@@ -4061,7 +4166,7 @@ var Stepper = forwardRef31(
|
|
|
4061
4166
|
"flex size-8 shrink-0 items-center justify-center rounded-v2-pill border-2 text-v2-sm font-semibold",
|
|
4062
4167
|
stateClass[step.state]
|
|
4063
4168
|
),
|
|
4064
|
-
children: step.state === "completed" ? /* @__PURE__ */
|
|
4169
|
+
children: step.state === "completed" ? /* @__PURE__ */ jsx43(Check4, { size: 16, weight: "bold" }) : step.state === "blocked" ? /* @__PURE__ */ jsx43(X7, { size: 16, weight: "bold" }) : step.state === "error" ? /* @__PURE__ */ jsx43(WarningCircle2, { size: 16, weight: "bold" }) : idx + 1
|
|
4065
4170
|
}
|
|
4066
4171
|
),
|
|
4067
4172
|
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col", children: [
|
|
@@ -4081,7 +4186,7 @@ var Stepper = forwardRef31(
|
|
|
4081
4186
|
]
|
|
4082
4187
|
}
|
|
4083
4188
|
),
|
|
4084
|
-
step.description && /* @__PURE__ */
|
|
4189
|
+
step.description && /* @__PURE__ */ jsx43(Text, { tag: "p", size: "xs", color: "muted", children: step.description })
|
|
4085
4190
|
] })
|
|
4086
4191
|
] })
|
|
4087
4192
|
},
|
|
@@ -4095,7 +4200,7 @@ Stepper.displayName = "Stepper";
|
|
|
4095
4200
|
// src/primitives/Skeleton/Skeleton.tsx
|
|
4096
4201
|
import { forwardRef as forwardRef32 } from "react";
|
|
4097
4202
|
import { cva as cva14 } from "class-variance-authority";
|
|
4098
|
-
import { jsx as
|
|
4203
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
4099
4204
|
var skeletonStyles = cva14(
|
|
4100
4205
|
"animate-pulse rounded-v2-md bg-v2-bg-subtle motion-reduce:animate-none",
|
|
4101
4206
|
{
|
|
@@ -4117,7 +4222,7 @@ var Skeleton = forwardRef32(
|
|
|
4117
4222
|
role,
|
|
4118
4223
|
"aria-label": ariaLabel,
|
|
4119
4224
|
...props
|
|
4120
|
-
}, ref) => /* @__PURE__ */
|
|
4225
|
+
}, ref) => /* @__PURE__ */ jsx44(
|
|
4121
4226
|
"div",
|
|
4122
4227
|
{
|
|
4123
4228
|
ref,
|
|
@@ -4133,7 +4238,7 @@ Skeleton.displayName = "Skeleton";
|
|
|
4133
4238
|
|
|
4134
4239
|
// src/primitives/Sparkline/Sparkline.tsx
|
|
4135
4240
|
import { useId as useId12 } from "react";
|
|
4136
|
-
import { jsx as
|
|
4241
|
+
import { jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4137
4242
|
function buildPath(values, width, height, pad) {
|
|
4138
4243
|
if (values.length === 0) return { line: "", area: "" };
|
|
4139
4244
|
const min = Math.min(...values);
|
|
@@ -4177,12 +4282,12 @@ function Sparkline({
|
|
|
4177
4282
|
className: cn("block", className),
|
|
4178
4283
|
style: { width, height },
|
|
4179
4284
|
children: [
|
|
4180
|
-
variant === "area" && /* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4182
|
-
/* @__PURE__ */
|
|
4285
|
+
variant === "area" && /* @__PURE__ */ jsx45("defs", { children: /* @__PURE__ */ jsxs25("linearGradient", { id: `spark-${id}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
4286
|
+
/* @__PURE__ */ jsx45("stop", { offset: "0%", stopColor: color, stopOpacity: 0.35 }),
|
|
4287
|
+
/* @__PURE__ */ jsx45("stop", { offset: "100%", stopColor: color, stopOpacity: 0 })
|
|
4183
4288
|
] }) }),
|
|
4184
|
-
variant === "area" && /* @__PURE__ */
|
|
4185
|
-
/* @__PURE__ */
|
|
4289
|
+
variant === "area" && /* @__PURE__ */ jsx45("path", { d: area, fill: `url(#spark-${id})`, stroke: "none" }),
|
|
4290
|
+
/* @__PURE__ */ jsx45(
|
|
4186
4291
|
"path",
|
|
4187
4292
|
{
|
|
4188
4293
|
d: line,
|
|
@@ -4201,7 +4306,7 @@ function Sparkline({
|
|
|
4201
4306
|
// src/primitives/SparklineBadge/SparklineBadge.tsx
|
|
4202
4307
|
import { forwardRef as forwardRef33 } from "react";
|
|
4203
4308
|
import { ArrowUp, ArrowDown, Minus as Minus2 } from "@phosphor-icons/react";
|
|
4204
|
-
import { jsx as
|
|
4309
|
+
import { jsx as jsx46, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4205
4310
|
var directionDefaultTone = {
|
|
4206
4311
|
up: "success",
|
|
4207
4312
|
down: "danger",
|
|
@@ -4240,7 +4345,7 @@ var SparklineBadge = forwardRef33(
|
|
|
4240
4345
|
),
|
|
4241
4346
|
...props,
|
|
4242
4347
|
children: [
|
|
4243
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx46(Icon, { size: iconSize[size], weight: "bold", "aria-hidden": "true" }),
|
|
4244
4349
|
value
|
|
4245
4350
|
]
|
|
4246
4351
|
}
|
|
@@ -4255,7 +4360,7 @@ import {
|
|
|
4255
4360
|
useId as useId13
|
|
4256
4361
|
} from "react";
|
|
4257
4362
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4258
|
-
import { jsx as
|
|
4363
|
+
import { jsx as jsx47, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4259
4364
|
var Switch = forwardRef34(
|
|
4260
4365
|
({ label, helper, error, id, className, required, ...props }, ref) => {
|
|
4261
4366
|
const generatedId = useId13();
|
|
@@ -4265,7 +4370,7 @@ var Switch = forwardRef34(
|
|
|
4265
4370
|
const describedBy = [helperId, errorId].filter(Boolean).join(" ") || void 0;
|
|
4266
4371
|
return /* @__PURE__ */ jsxs27("div", { className: "flex flex-col gap-1", children: [
|
|
4267
4372
|
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-3", children: [
|
|
4268
|
-
/* @__PURE__ */
|
|
4373
|
+
/* @__PURE__ */ jsx47(
|
|
4269
4374
|
SwitchPrimitive.Root,
|
|
4270
4375
|
{
|
|
4271
4376
|
ref,
|
|
@@ -4278,13 +4383,13 @@ var Switch = forwardRef34(
|
|
|
4278
4383
|
className
|
|
4279
4384
|
),
|
|
4280
4385
|
...props,
|
|
4281
|
-
children: /* @__PURE__ */
|
|
4386
|
+
children: /* @__PURE__ */ jsx47(SwitchPrimitive.Thumb, { className: "pointer-events-none block size-4 rounded-v2-pill bg-v2-action-on-primary shadow-sm transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0.5 motion-reduce:transition-none" })
|
|
4282
4387
|
}
|
|
4283
4388
|
),
|
|
4284
|
-
label && /* @__PURE__ */
|
|
4389
|
+
label && /* @__PURE__ */ jsx47(Label, { htmlFor: switchId, required, children: label })
|
|
4285
4390
|
] }),
|
|
4286
|
-
helper && !error && /* @__PURE__ */
|
|
4287
|
-
error && /* @__PURE__ */
|
|
4391
|
+
helper && !error && /* @__PURE__ */ jsx47("p", { id: helperId, className: "text-v2-xs text-v2-fg-muted", children: helper }),
|
|
4392
|
+
error && /* @__PURE__ */ jsx47(
|
|
4288
4393
|
"p",
|
|
4289
4394
|
{
|
|
4290
4395
|
id: errorId,
|
|
@@ -4330,10 +4435,10 @@ var tabsContentStyles = cva15(
|
|
|
4330
4435
|
);
|
|
4331
4436
|
|
|
4332
4437
|
// src/primitives/Tabs/Tabs.tsx
|
|
4333
|
-
import { jsx as
|
|
4438
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4334
4439
|
var TabsVariantContext = createContext("pill");
|
|
4335
4440
|
var List2 = forwardRef35(
|
|
4336
|
-
({ className, variant = "pill", ...props }, ref) => /* @__PURE__ */
|
|
4441
|
+
({ className, variant = "pill", ...props }, ref) => /* @__PURE__ */ jsx48(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx48(
|
|
4337
4442
|
TabsPrimitive.List,
|
|
4338
4443
|
{
|
|
4339
4444
|
ref,
|
|
@@ -4346,7 +4451,7 @@ List2.displayName = "Tabs.List";
|
|
|
4346
4451
|
var Trigger12 = forwardRef35(({ className, ...props }, ref) => {
|
|
4347
4452
|
const variant = useContext(TabsVariantContext);
|
|
4348
4453
|
const baseStyles = variant === "underline" ? tabsUnderlineTriggerStyles() : tabsTriggerStyles();
|
|
4349
|
-
return /* @__PURE__ */
|
|
4454
|
+
return /* @__PURE__ */ jsx48(
|
|
4350
4455
|
TabsPrimitive.Trigger,
|
|
4351
4456
|
{
|
|
4352
4457
|
ref,
|
|
@@ -4356,7 +4461,7 @@ var Trigger12 = forwardRef35(({ className, ...props }, ref) => {
|
|
|
4356
4461
|
);
|
|
4357
4462
|
});
|
|
4358
4463
|
Trigger12.displayName = "Tabs.Trigger";
|
|
4359
|
-
var Content12 = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */
|
|
4464
|
+
var Content12 = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */ jsx48(
|
|
4360
4465
|
TabsPrimitive.Content,
|
|
4361
4466
|
{
|
|
4362
4467
|
ref,
|
|
@@ -4366,7 +4471,7 @@ var Content12 = forwardRef35(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
4366
4471
|
));
|
|
4367
4472
|
Content12.displayName = "Tabs.Content";
|
|
4368
4473
|
function TabsRoot({ children, className, ...props }) {
|
|
4369
|
-
return /* @__PURE__ */
|
|
4474
|
+
return /* @__PURE__ */ jsx48(TabsPrimitive.Root, { className: cn("w-full", className), ...props, children });
|
|
4370
4475
|
}
|
|
4371
4476
|
TabsRoot.displayName = "Tabs";
|
|
4372
4477
|
var Tabs = Object.assign(TabsRoot, {
|
|
@@ -4376,9 +4481,9 @@ var Tabs = Object.assign(TabsRoot, {
|
|
|
4376
4481
|
});
|
|
4377
4482
|
|
|
4378
4483
|
// src/primitives/ThemeToggle/ThemeToggle.tsx
|
|
4379
|
-
import { forwardRef as forwardRef36, useCallback, useEffect as
|
|
4484
|
+
import { forwardRef as forwardRef36, useCallback, useEffect as useEffect8, useState as useState14 } from "react";
|
|
4380
4485
|
import { Monitor, Moon, Sun } from "@phosphor-icons/react";
|
|
4381
|
-
import { jsx as
|
|
4486
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4382
4487
|
var sizeClass2 = {
|
|
4383
4488
|
sm: "size-7",
|
|
4384
4489
|
md: "size-9",
|
|
@@ -4415,20 +4520,20 @@ var ThemeToggle = forwardRef36(
|
|
|
4415
4520
|
onClick,
|
|
4416
4521
|
...props
|
|
4417
4522
|
}, ref) => {
|
|
4418
|
-
const [preference, setPreference] =
|
|
4523
|
+
const [preference, setPreference] = useState14(
|
|
4419
4524
|
() => readPreference(storageKey)
|
|
4420
4525
|
);
|
|
4421
|
-
const [systemMode, setSystemMode] =
|
|
4526
|
+
const [systemMode, setSystemMode] = useState14(
|
|
4422
4527
|
() => getSystemMode()
|
|
4423
4528
|
);
|
|
4424
4529
|
const resolvedMode = preference === "system" ? systemMode : preference;
|
|
4425
|
-
|
|
4530
|
+
useEffect8(() => {
|
|
4426
4531
|
const root = document.documentElement;
|
|
4427
4532
|
root.dataset.theme = resolvedMode;
|
|
4428
4533
|
root.classList.toggle("dark", resolvedMode === "dark");
|
|
4429
4534
|
root.classList.toggle("light", resolvedMode === "light");
|
|
4430
4535
|
}, [resolvedMode]);
|
|
4431
|
-
|
|
4536
|
+
useEffect8(() => {
|
|
4432
4537
|
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
4433
4538
|
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4434
4539
|
const onChange = (event) => {
|
|
@@ -4466,7 +4571,7 @@ var ThemeToggle = forwardRef36(
|
|
|
4466
4571
|
),
|
|
4467
4572
|
...props,
|
|
4468
4573
|
children: [
|
|
4469
|
-
/* @__PURE__ */
|
|
4574
|
+
/* @__PURE__ */ jsx49(
|
|
4470
4575
|
Sun,
|
|
4471
4576
|
{
|
|
4472
4577
|
size: iconSize2[size],
|
|
@@ -4478,7 +4583,7 @@ var ThemeToggle = forwardRef36(
|
|
|
4478
4583
|
)
|
|
4479
4584
|
}
|
|
4480
4585
|
),
|
|
4481
|
-
/* @__PURE__ */
|
|
4586
|
+
/* @__PURE__ */ jsx49(
|
|
4482
4587
|
Moon,
|
|
4483
4588
|
{
|
|
4484
4589
|
size: iconSize2[size],
|
|
@@ -4490,7 +4595,7 @@ var ThemeToggle = forwardRef36(
|
|
|
4490
4595
|
)
|
|
4491
4596
|
}
|
|
4492
4597
|
),
|
|
4493
|
-
/* @__PURE__ */
|
|
4598
|
+
/* @__PURE__ */ jsx49(
|
|
4494
4599
|
Monitor,
|
|
4495
4600
|
{
|
|
4496
4601
|
size: iconSize2[size],
|
|
@@ -4511,7 +4616,7 @@ ThemeToggle.displayName = "ThemeToggle";
|
|
|
4511
4616
|
|
|
4512
4617
|
// src/primitives/TextArea/TextArea.tsx
|
|
4513
4618
|
import { forwardRef as forwardRef37, useId as useId14 } from "react";
|
|
4514
|
-
import { jsx as
|
|
4619
|
+
import { jsx as jsx50, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4515
4620
|
var TextArea = forwardRef37(
|
|
4516
4621
|
({
|
|
4517
4622
|
label,
|
|
@@ -4534,8 +4639,8 @@ var TextArea = forwardRef37(
|
|
|
4534
4639
|
const currentLength = typeof value === "string" ? value.length : 0;
|
|
4535
4640
|
const showFooter = !!error || !!helper || showCount && !!maxLength;
|
|
4536
4641
|
return /* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-1", children: [
|
|
4537
|
-
label && /* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4642
|
+
label && /* @__PURE__ */ jsx50(Label, { htmlFor: textareaId, required, children: label }),
|
|
4643
|
+
/* @__PURE__ */ jsx50(
|
|
4539
4644
|
"textarea",
|
|
4540
4645
|
{
|
|
4541
4646
|
ref,
|
|
@@ -4559,7 +4664,7 @@ var TextArea = forwardRef37(
|
|
|
4559
4664
|
}
|
|
4560
4665
|
),
|
|
4561
4666
|
showFooter && /* @__PURE__ */ jsxs29("div", { className: "flex items-start justify-between gap-2", children: [
|
|
4562
|
-
error ? /* @__PURE__ */
|
|
4667
|
+
error ? /* @__PURE__ */ jsx50(
|
|
4563
4668
|
"p",
|
|
4564
4669
|
{
|
|
4565
4670
|
id: errorId,
|
|
@@ -4567,7 +4672,7 @@ var TextArea = forwardRef37(
|
|
|
4567
4672
|
role: "alert",
|
|
4568
4673
|
children: error
|
|
4569
4674
|
}
|
|
4570
|
-
) : helper ? /* @__PURE__ */
|
|
4675
|
+
) : helper ? /* @__PURE__ */ jsx50("p", { id: helperId, className: "text-v2-xs text-v2-fg-muted", children: helper }) : /* @__PURE__ */ jsx50("span", {}),
|
|
4571
4676
|
showCount && maxLength && /* @__PURE__ */ jsxs29("span", { className: "text-v2-xs tabular-nums text-v2-fg-muted", children: [
|
|
4572
4677
|
currentLength,
|
|
4573
4678
|
"/",
|
|
@@ -4592,7 +4697,7 @@ var tooltipContentStyles = cva16(
|
|
|
4592
4697
|
);
|
|
4593
4698
|
|
|
4594
4699
|
// src/primitives/Tooltip/Tooltip.tsx
|
|
4595
|
-
import { jsx as
|
|
4700
|
+
import { jsx as jsx51, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4596
4701
|
var Provider2 = TooltipPrimitive.Provider;
|
|
4597
4702
|
var TooltipRoot = forwardRef38(function TooltipRoot2({
|
|
4598
4703
|
content,
|
|
@@ -4608,7 +4713,7 @@ var TooltipRoot = forwardRef38(function TooltipRoot2({
|
|
|
4608
4713
|
disableHoverableContent,
|
|
4609
4714
|
...triggerProps
|
|
4610
4715
|
}, ref) {
|
|
4611
|
-
return /* @__PURE__ */
|
|
4716
|
+
return /* @__PURE__ */ jsx51(TooltipPrimitive.Provider, { delayDuration, children: /* @__PURE__ */ jsxs30(
|
|
4612
4717
|
TooltipPrimitive.Root,
|
|
4613
4718
|
{
|
|
4614
4719
|
open,
|
|
@@ -4616,8 +4721,8 @@ var TooltipRoot = forwardRef38(function TooltipRoot2({
|
|
|
4616
4721
|
onOpenChange,
|
|
4617
4722
|
disableHoverableContent,
|
|
4618
4723
|
children: [
|
|
4619
|
-
/* @__PURE__ */
|
|
4620
|
-
/* @__PURE__ */
|
|
4724
|
+
/* @__PURE__ */ jsx51(TooltipPrimitive.Trigger, { asChild: true, ref, ...triggerProps, children }),
|
|
4725
|
+
/* @__PURE__ */ jsx51(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
4621
4726
|
TooltipPrimitive.Content,
|
|
4622
4727
|
{
|
|
4623
4728
|
side,
|
|
@@ -4626,7 +4731,7 @@ var TooltipRoot = forwardRef38(function TooltipRoot2({
|
|
|
4626
4731
|
className: cn(tooltipContentStyles(), contentClassName),
|
|
4627
4732
|
children: [
|
|
4628
4733
|
content,
|
|
4629
|
-
/* @__PURE__ */
|
|
4734
|
+
/* @__PURE__ */ jsx51(TooltipPrimitive.Arrow, { className: "fill-v2-panel" })
|
|
4630
4735
|
]
|
|
4631
4736
|
}
|
|
4632
4737
|
) })
|
|
@@ -4635,7 +4740,7 @@ var TooltipRoot = forwardRef38(function TooltipRoot2({
|
|
|
4635
4740
|
) });
|
|
4636
4741
|
});
|
|
4637
4742
|
TooltipRoot.displayName = "Tooltip";
|
|
4638
|
-
var Content14 = forwardRef38(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
4743
|
+
var Content14 = forwardRef38(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx51(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx51(
|
|
4639
4744
|
TooltipPrimitive.Content,
|
|
4640
4745
|
{
|
|
4641
4746
|
ref,
|
|
@@ -4645,7 +4750,7 @@ var Content14 = forwardRef38(({ className, sideOffset = 4, ...props }, ref) => /
|
|
|
4645
4750
|
}
|
|
4646
4751
|
) }));
|
|
4647
4752
|
Content14.displayName = "Tooltip.Content";
|
|
4648
|
-
var Trigger14 = forwardRef38((props, ref) => /* @__PURE__ */
|
|
4753
|
+
var Trigger14 = forwardRef38((props, ref) => /* @__PURE__ */ jsx51(TooltipPrimitive.Trigger, { ref, ...props }));
|
|
4649
4754
|
Trigger14.displayName = "Tooltip.Trigger";
|
|
4650
4755
|
var Root12 = TooltipPrimitive.Root;
|
|
4651
4756
|
var Tooltip = Object.assign(TooltipRoot, {
|
|
@@ -4732,7 +4837,7 @@ function useToast() {
|
|
|
4732
4837
|
}
|
|
4733
4838
|
|
|
4734
4839
|
// src/primitives/Toast/Toaster.tsx
|
|
4735
|
-
import { jsx as
|
|
4840
|
+
import { jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4736
4841
|
function Toaster({
|
|
4737
4842
|
duration = 5e3,
|
|
4738
4843
|
swipeDirection = "right",
|
|
@@ -4756,23 +4861,23 @@ function Toaster({
|
|
|
4756
4861
|
className: cn(toastStyles({ variant: item.variant })),
|
|
4757
4862
|
children: [
|
|
4758
4863
|
/* @__PURE__ */ jsxs31("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
4759
|
-
item.title && /* @__PURE__ */
|
|
4760
|
-
item.description && /* @__PURE__ */
|
|
4864
|
+
item.title && /* @__PURE__ */ jsx52(ToastPrimitive.Title, { className: "text-v2-sm font-semibold", children: item.title }),
|
|
4865
|
+
item.description && /* @__PURE__ */ jsx52(ToastPrimitive.Description, { className: "text-v2-sm opacity-90", children: item.description })
|
|
4761
4866
|
] }),
|
|
4762
|
-
item.action && /* @__PURE__ */
|
|
4763
|
-
/* @__PURE__ */
|
|
4867
|
+
item.action && /* @__PURE__ */ jsx52(ToastPrimitive.Action, { altText: "a\xE7\xE3o", asChild: true, children: item.action }),
|
|
4868
|
+
/* @__PURE__ */ jsx52(
|
|
4764
4869
|
ToastPrimitive.Close,
|
|
4765
4870
|
{
|
|
4766
4871
|
"aria-label": "Fechar",
|
|
4767
4872
|
className: "shrink-0 rounded-v2-sm p-1 text-v2-fg-muted transition-colors hover:text-v2-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
4768
|
-
children: /* @__PURE__ */
|
|
4873
|
+
children: /* @__PURE__ */ jsx52(X8, { size: 16, "aria-hidden": "true" })
|
|
4769
4874
|
}
|
|
4770
4875
|
)
|
|
4771
4876
|
]
|
|
4772
4877
|
},
|
|
4773
4878
|
item.id
|
|
4774
4879
|
)),
|
|
4775
|
-
/* @__PURE__ */
|
|
4880
|
+
/* @__PURE__ */ jsx52(
|
|
4776
4881
|
ToastPrimitive.Viewport,
|
|
4777
4882
|
{
|
|
4778
4883
|
className: cn(
|
|
@@ -4803,9 +4908,9 @@ import {
|
|
|
4803
4908
|
|
|
4804
4909
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
4805
4910
|
import { CaretDoubleLeft, CaretDoubleRight } from "@phosphor-icons/react";
|
|
4806
|
-
import { forwardRef as forwardRef39, useCallback as useCallback2, useEffect as
|
|
4911
|
+
import { forwardRef as forwardRef39, useCallback as useCallback2, useEffect as useEffect9, useState as useState15 } from "react";
|
|
4807
4912
|
import "./Sidebar-4ILVFQI5.css";
|
|
4808
|
-
import { Fragment as Fragment5, jsx as
|
|
4913
|
+
import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4809
4914
|
var LINK_BASE_CLASS = "flex h-full w-full items-center";
|
|
4810
4915
|
function isActive(currentPath, to) {
|
|
4811
4916
|
if (!currentPath) return false;
|
|
@@ -4819,7 +4924,7 @@ function ItemLink({
|
|
|
4819
4924
|
linkComponent
|
|
4820
4925
|
}) {
|
|
4821
4926
|
if (item.external) {
|
|
4822
|
-
return /* @__PURE__ */
|
|
4927
|
+
return /* @__PURE__ */ jsx53(
|
|
4823
4928
|
"a",
|
|
4824
4929
|
{
|
|
4825
4930
|
href: item.to,
|
|
@@ -4831,7 +4936,7 @@ function ItemLink({
|
|
|
4831
4936
|
);
|
|
4832
4937
|
}
|
|
4833
4938
|
const LinkComponent = linkComponent ?? DefaultLink;
|
|
4834
|
-
return /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ jsx53(LinkComponent, { to: item.to, className, children });
|
|
4835
4940
|
}
|
|
4836
4941
|
function ItemContent({
|
|
4837
4942
|
item,
|
|
@@ -4849,7 +4954,7 @@ function ItemContent({
|
|
|
4849
4954
|
active ? "bg-v2-brand-primary font-semibold text-v2-brand-on-primary" : "text-v2-fg-default hover:bg-v2-bg-subtle"
|
|
4850
4955
|
),
|
|
4851
4956
|
children: [
|
|
4852
|
-
/* @__PURE__ */
|
|
4957
|
+
/* @__PURE__ */ jsx53(
|
|
4853
4958
|
"span",
|
|
4854
4959
|
{
|
|
4855
4960
|
className: cn(
|
|
@@ -4860,8 +4965,8 @@ function ItemContent({
|
|
|
4860
4965
|
}
|
|
4861
4966
|
),
|
|
4862
4967
|
!collapsed ? /* @__PURE__ */ jsxs32(Fragment5, { children: [
|
|
4863
|
-
/* @__PURE__ */
|
|
4864
|
-
item.badge !== void 0 && /* @__PURE__ */
|
|
4968
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-1 truncate", children: item.label }),
|
|
4969
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx53(
|
|
4865
4970
|
"span",
|
|
4866
4971
|
{
|
|
4867
4972
|
className: cn(
|
|
@@ -4871,7 +4976,7 @@ function ItemContent({
|
|
|
4871
4976
|
children: item.badge
|
|
4872
4977
|
}
|
|
4873
4978
|
)
|
|
4874
|
-
] }) : item.badge !== void 0 && /* @__PURE__ */
|
|
4979
|
+
] }) : item.badge !== void 0 && /* @__PURE__ */ jsx53(
|
|
4875
4980
|
"span",
|
|
4876
4981
|
{
|
|
4877
4982
|
"aria-label": `${item.badge} pendentes`,
|
|
@@ -4891,15 +4996,15 @@ function GroupItems({
|
|
|
4891
4996
|
showTopDivider
|
|
4892
4997
|
}) {
|
|
4893
4998
|
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-col gap-1", children: [
|
|
4894
|
-
group.label && !collapsed && /* @__PURE__ */
|
|
4895
|
-
group.label && collapsed && /* @__PURE__ */
|
|
4999
|
+
group.label && !collapsed && /* @__PURE__ */ jsx53("h3", { className: "pb-1 pl-4 pt-2 text-v2-xs font-bold uppercase tracking-[0.08em] text-v2-fg-muted", children: group.label }),
|
|
5000
|
+
group.label && collapsed && /* @__PURE__ */ jsx53(
|
|
4896
5001
|
"div",
|
|
4897
5002
|
{
|
|
4898
5003
|
"aria-hidden": "true",
|
|
4899
5004
|
className: "mx-2 my-1 h-px bg-v2-border-default"
|
|
4900
5005
|
}
|
|
4901
5006
|
),
|
|
4902
|
-
!group.label && showTopDivider && /* @__PURE__ */
|
|
5007
|
+
!group.label && showTopDivider && /* @__PURE__ */ jsx53(
|
|
4903
5008
|
"div",
|
|
4904
5009
|
{
|
|
4905
5010
|
"aria-hidden": "true",
|
|
@@ -4909,9 +5014,9 @@ function GroupItems({
|
|
|
4909
5014
|
)
|
|
4910
5015
|
}
|
|
4911
5016
|
),
|
|
4912
|
-
/* @__PURE__ */
|
|
5017
|
+
/* @__PURE__ */ jsx53("ul", { className: "flex flex-col gap-0.5", children: group.items.map((item) => {
|
|
4913
5018
|
const active = isActive(currentPath, item.to);
|
|
4914
|
-
const itemContent = /* @__PURE__ */
|
|
5019
|
+
const itemContent = /* @__PURE__ */ jsx53(
|
|
4915
5020
|
ItemContent,
|
|
4916
5021
|
{
|
|
4917
5022
|
item,
|
|
@@ -4920,7 +5025,7 @@ function GroupItems({
|
|
|
4920
5025
|
title: collapsed ? item.label : void 0
|
|
4921
5026
|
}
|
|
4922
5027
|
);
|
|
4923
|
-
return /* @__PURE__ */
|
|
5028
|
+
return /* @__PURE__ */ jsx53(
|
|
4924
5029
|
"li",
|
|
4925
5030
|
{
|
|
4926
5031
|
"aria-current": active ? "page" : void 0,
|
|
@@ -4928,7 +5033,7 @@ function GroupItems({
|
|
|
4928
5033
|
"ml-1.5 h-12 rounded-l-v2-pill p-1 transition-colors",
|
|
4929
5034
|
active && "ds-v2-sidebar-item--active"
|
|
4930
5035
|
),
|
|
4931
|
-
children: renderLink ? renderLink(item, itemContent) : /* @__PURE__ */
|
|
5036
|
+
children: renderLink ? renderLink(item, itemContent) : /* @__PURE__ */ jsx53(
|
|
4932
5037
|
ItemLink,
|
|
4933
5038
|
{
|
|
4934
5039
|
item,
|
|
@@ -4953,7 +5058,7 @@ function NavGroups({
|
|
|
4953
5058
|
const topGroups = groups.filter((g) => g.pin !== "bottom");
|
|
4954
5059
|
const bottomGroups = groups.filter((g) => g.pin === "bottom");
|
|
4955
5060
|
return /* @__PURE__ */ jsxs32("nav", { className: "ds-v2-sidebar-nav flex flex-1 flex-col gap-3 py-3", children: [
|
|
4956
|
-
topGroups.map((group, idx) => /* @__PURE__ */
|
|
5061
|
+
topGroups.map((group, idx) => /* @__PURE__ */ jsx53(
|
|
4957
5062
|
GroupItems,
|
|
4958
5063
|
{
|
|
4959
5064
|
group,
|
|
@@ -4965,7 +5070,7 @@ function NavGroups({
|
|
|
4965
5070
|
},
|
|
4966
5071
|
group.label ?? `top-${idx}`
|
|
4967
5072
|
)),
|
|
4968
|
-
bottomGroups.length > 0 && /* @__PURE__ */
|
|
5073
|
+
bottomGroups.length > 0 && /* @__PURE__ */ jsx53("div", { className: "mt-auto flex flex-col gap-1 pt-3", children: bottomGroups.map((group, idx) => /* @__PURE__ */ jsx53(
|
|
4969
5074
|
GroupItems,
|
|
4970
5075
|
{
|
|
4971
5076
|
group,
|
|
@@ -5009,7 +5114,7 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5009
5114
|
...rest
|
|
5010
5115
|
}, ref) {
|
|
5011
5116
|
const isControlled = controlledCollapsed !== void 0;
|
|
5012
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
5117
|
+
const [internalCollapsed, setInternalCollapsed] = useState15(
|
|
5013
5118
|
() => readStoredCollapsed(defaultCollapsed)
|
|
5014
5119
|
);
|
|
5015
5120
|
const collapsed = isControlled ? controlledCollapsed : internalCollapsed;
|
|
@@ -5022,7 +5127,7 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5022
5127
|
}
|
|
5023
5128
|
onCollapseChange == null ? void 0 : onCollapseChange(next);
|
|
5024
5129
|
}, [collapsed, isControlled, onCollapseChange]);
|
|
5025
|
-
|
|
5130
|
+
useEffect9(() => {
|
|
5026
5131
|
if (!enableShortcut || typeof window === "undefined") return;
|
|
5027
5132
|
const handler = (event) => {
|
|
5028
5133
|
if (!((event.metaKey || event.ctrlKey) && event.key === "b")) return;
|
|
@@ -5052,16 +5157,16 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5052
5157
|
collapsed ? "justify-center px-0" : "justify-between"
|
|
5053
5158
|
),
|
|
5054
5159
|
children: [
|
|
5055
|
-
headerSlot && !collapsed && /* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */
|
|
5160
|
+
headerSlot && !collapsed && /* @__PURE__ */ jsx53("div", { children: headerSlot }),
|
|
5161
|
+
/* @__PURE__ */ jsx53(
|
|
5057
5162
|
Tooltip,
|
|
5058
5163
|
{
|
|
5059
5164
|
side: "right",
|
|
5060
5165
|
content: /* @__PURE__ */ jsxs32("span", { children: [
|
|
5061
5166
|
collapsed ? "Expandir menu" : "Recolher menu",
|
|
5062
|
-
enableShortcut && /* @__PURE__ */
|
|
5167
|
+
enableShortcut && /* @__PURE__ */ jsx53("span", { className: "ml-1 text-v2-fg-muted", children: getShortcutLabel("B") })
|
|
5063
5168
|
] }),
|
|
5064
|
-
children: /* @__PURE__ */
|
|
5169
|
+
children: /* @__PURE__ */ jsx53(
|
|
5065
5170
|
"button",
|
|
5066
5171
|
{
|
|
5067
5172
|
type: "button",
|
|
@@ -5071,7 +5176,7 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5071
5176
|
className: cn(
|
|
5072
5177
|
"inline-flex size-8 shrink-0 items-center justify-center rounded-v2-md text-current transition-colors hover:bg-v2-bg-subtle"
|
|
5073
5178
|
),
|
|
5074
|
-
children: collapsed ? /* @__PURE__ */
|
|
5179
|
+
children: collapsed ? /* @__PURE__ */ jsx53(CaretDoubleRight, { size: 16 }) : /* @__PURE__ */ jsx53(CaretDoubleLeft, { size: 16 })
|
|
5075
5180
|
}
|
|
5076
5181
|
)
|
|
5077
5182
|
}
|
|
@@ -5079,7 +5184,7 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5079
5184
|
]
|
|
5080
5185
|
}
|
|
5081
5186
|
),
|
|
5082
|
-
/* @__PURE__ */
|
|
5187
|
+
/* @__PURE__ */ jsx53(
|
|
5083
5188
|
NavGroups,
|
|
5084
5189
|
{
|
|
5085
5190
|
groups,
|
|
@@ -5096,7 +5201,7 @@ var Sidebar = forwardRef39(function Sidebar2({
|
|
|
5096
5201
|
|
|
5097
5202
|
// src/patterns/Topbar/Topbar.tsx
|
|
5098
5203
|
import { forwardRef as forwardRef40 } from "react";
|
|
5099
|
-
import { jsx as
|
|
5204
|
+
import { jsx as jsx54, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5100
5205
|
var Topbar = forwardRef40(function Topbar2({
|
|
5101
5206
|
pageTitle,
|
|
5102
5207
|
searchTrigger,
|
|
@@ -5120,8 +5225,8 @@ var Topbar = forwardRef40(function Topbar2({
|
|
|
5120
5225
|
),
|
|
5121
5226
|
...props,
|
|
5122
5227
|
children: [
|
|
5123
|
-
/* @__PURE__ */
|
|
5124
|
-
searchTrigger && /* @__PURE__ */
|
|
5228
|
+
/* @__PURE__ */ jsx54("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: pageTitle && /* @__PURE__ */ jsx54("h2", { className: "truncate text-v2-sm font-bold", children: pageTitle }) }),
|
|
5229
|
+
searchTrigger && /* @__PURE__ */ jsx54("div", { className: "flex flex-1 items-center justify-center", children: searchTrigger }),
|
|
5125
5230
|
/* @__PURE__ */ jsxs33("div", { className: "flex flex-1 items-center justify-end gap-2", children: [
|
|
5126
5231
|
notificationCenter,
|
|
5127
5232
|
themeToggle,
|
|
@@ -5134,7 +5239,7 @@ var Topbar = forwardRef40(function Topbar2({
|
|
|
5134
5239
|
Topbar.displayName = "Topbar";
|
|
5135
5240
|
|
|
5136
5241
|
// src/patterns/AppShell/AppShell.tsx
|
|
5137
|
-
import { jsx as
|
|
5242
|
+
import { jsx as jsx55, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5138
5243
|
var DEFAULT_GROUPS = [
|
|
5139
5244
|
{
|
|
5140
5245
|
label: null,
|
|
@@ -5142,55 +5247,55 @@ var DEFAULT_GROUPS = [
|
|
|
5142
5247
|
{
|
|
5143
5248
|
id: "home",
|
|
5144
5249
|
label: "P\xE1gina inicial",
|
|
5145
|
-
icon: /* @__PURE__ */
|
|
5250
|
+
icon: /* @__PURE__ */ jsx55(House, { size: 20 }),
|
|
5146
5251
|
to: "/"
|
|
5147
5252
|
},
|
|
5148
5253
|
{
|
|
5149
5254
|
id: "users",
|
|
5150
5255
|
label: "Usu\xE1rios",
|
|
5151
|
-
icon: /* @__PURE__ */
|
|
5256
|
+
icon: /* @__PURE__ */ jsx55(Users, { size: 20 }),
|
|
5152
5257
|
to: "/users"
|
|
5153
5258
|
},
|
|
5154
5259
|
{
|
|
5155
5260
|
id: "orgs",
|
|
5156
5261
|
label: "Organiza\xE7\xF5es",
|
|
5157
|
-
icon: /* @__PURE__ */
|
|
5262
|
+
icon: /* @__PURE__ */ jsx55(Buildings, { size: 20 }),
|
|
5158
5263
|
to: "/organizations"
|
|
5159
5264
|
},
|
|
5160
5265
|
{
|
|
5161
5266
|
id: "configs-op",
|
|
5162
5267
|
label: "Configs Opera\xE7\xE3o",
|
|
5163
|
-
icon: /* @__PURE__ */
|
|
5268
|
+
icon: /* @__PURE__ */ jsx55(Briefcase, { size: 20 }),
|
|
5164
5269
|
to: "/configs/operation"
|
|
5165
5270
|
},
|
|
5166
5271
|
{
|
|
5167
5272
|
id: "clients",
|
|
5168
5273
|
label: "Clientes",
|
|
5169
|
-
icon: /* @__PURE__ */
|
|
5274
|
+
icon: /* @__PURE__ */ jsx55(UsersThree, { size: 20 }),
|
|
5170
5275
|
to: "/clients"
|
|
5171
5276
|
},
|
|
5172
5277
|
{
|
|
5173
5278
|
id: "requests",
|
|
5174
5279
|
label: "Requisi\xE7\xF5es",
|
|
5175
|
-
icon: /* @__PURE__ */
|
|
5280
|
+
icon: /* @__PURE__ */ jsx55(PaperPlaneTilt, { size: 20 }),
|
|
5176
5281
|
to: "/requests"
|
|
5177
5282
|
},
|
|
5178
5283
|
{
|
|
5179
5284
|
id: "operations",
|
|
5180
5285
|
label: "Opera\xE7\xF5es",
|
|
5181
|
-
icon: /* @__PURE__ */
|
|
5286
|
+
icon: /* @__PURE__ */ jsx55(Receipt, { size: 20 }),
|
|
5182
5287
|
to: "/operations"
|
|
5183
5288
|
},
|
|
5184
5289
|
{
|
|
5185
5290
|
id: "finance",
|
|
5186
5291
|
label: "Financeiro",
|
|
5187
|
-
icon: /* @__PURE__ */
|
|
5292
|
+
icon: /* @__PURE__ */ jsx55(Coins, { size: 20 }),
|
|
5188
5293
|
to: "/finance"
|
|
5189
5294
|
},
|
|
5190
5295
|
{
|
|
5191
5296
|
id: "configurations",
|
|
5192
5297
|
label: "Configura\xE7\xF5es",
|
|
5193
|
-
icon: /* @__PURE__ */
|
|
5298
|
+
icon: /* @__PURE__ */ jsx55(Gear, { size: 20 }),
|
|
5194
5299
|
to: "/configurations"
|
|
5195
5300
|
}
|
|
5196
5301
|
]
|
|
@@ -5201,15 +5306,15 @@ var DEFAULT_GROUPS = [
|
|
|
5201
5306
|
{
|
|
5202
5307
|
id: "tutorials",
|
|
5203
5308
|
label: "Tutoriais",
|
|
5204
|
-
icon: /* @__PURE__ */
|
|
5309
|
+
icon: /* @__PURE__ */ jsx55(GraduationCap, { size: 20 }),
|
|
5205
5310
|
to: "/tutorials"
|
|
5206
5311
|
}
|
|
5207
5312
|
]
|
|
5208
5313
|
}
|
|
5209
5314
|
];
|
|
5210
5315
|
var DEFAULT_HEADER_SLOT = /* @__PURE__ */ jsxs34("span", { className: "flex items-center gap-1.5", children: [
|
|
5211
|
-
/* @__PURE__ */
|
|
5212
|
-
/* @__PURE__ */
|
|
5316
|
+
/* @__PURE__ */ jsx55(Bank, { size: 20, "aria-hidden": "true" }),
|
|
5317
|
+
/* @__PURE__ */ jsx55("span", { className: "text-v2-base font-bold text-v2-fg-default", children: "HUMU" })
|
|
5213
5318
|
] });
|
|
5214
5319
|
function AppShell({
|
|
5215
5320
|
children,
|
|
@@ -5225,7 +5330,7 @@ function AppShell({
|
|
|
5225
5330
|
defaultSidebarCollapsed = false
|
|
5226
5331
|
}) {
|
|
5227
5332
|
return /* @__PURE__ */ jsxs34("div", { className: "flex h-screen overflow-hidden bg-v2-canvas text-v2-fg-default", children: [
|
|
5228
|
-
/* @__PURE__ */
|
|
5333
|
+
/* @__PURE__ */ jsx55(
|
|
5229
5334
|
"a",
|
|
5230
5335
|
{
|
|
5231
5336
|
href: "#main-content",
|
|
@@ -5233,7 +5338,7 @@ function AppShell({
|
|
|
5233
5338
|
children: "Pular para o conte\xFAdo"
|
|
5234
5339
|
}
|
|
5235
5340
|
),
|
|
5236
|
-
/* @__PURE__ */
|
|
5341
|
+
/* @__PURE__ */ jsx55(
|
|
5237
5342
|
Sidebar,
|
|
5238
5343
|
{
|
|
5239
5344
|
groups: sidebarGroups,
|
|
@@ -5244,7 +5349,7 @@ function AppShell({
|
|
|
5244
5349
|
}
|
|
5245
5350
|
),
|
|
5246
5351
|
/* @__PURE__ */ jsxs34("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
|
|
5247
|
-
/* @__PURE__ */
|
|
5352
|
+
/* @__PURE__ */ jsx55(
|
|
5248
5353
|
Topbar,
|
|
5249
5354
|
{
|
|
5250
5355
|
pageTitle,
|
|
@@ -5254,14 +5359,14 @@ function AppShell({
|
|
|
5254
5359
|
userMenu
|
|
5255
5360
|
}
|
|
5256
5361
|
),
|
|
5257
|
-
/* @__PURE__ */
|
|
5362
|
+
/* @__PURE__ */ jsx55(
|
|
5258
5363
|
"main",
|
|
5259
5364
|
{
|
|
5260
5365
|
id: "main-content",
|
|
5261
5366
|
role: "main",
|
|
5262
5367
|
tabIndex: -1,
|
|
5263
5368
|
className: "flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain bg-v2-app p-4 focus:outline-none sm:p-6",
|
|
5264
|
-
children: /* @__PURE__ */
|
|
5369
|
+
children: /* @__PURE__ */ jsx55("div", { className: "flex-1 rounded-v2-lg border border-v2-border-default bg-v2-shell p-4 shadow-sm sm:p-6", children })
|
|
5265
5370
|
}
|
|
5266
5371
|
)
|
|
5267
5372
|
] })
|
|
@@ -5272,7 +5377,7 @@ AppShell.displayName = "AppShell";
|
|
|
5272
5377
|
// src/patterns/KpiHero/KpiHero.tsx
|
|
5273
5378
|
import { useId as useId15 } from "react";
|
|
5274
5379
|
import { ArrowUp as ArrowUp2, ArrowDown as ArrowDown2, Minus as Minus3 } from "@phosphor-icons/react";
|
|
5275
|
-
import { Fragment as Fragment6, jsx as
|
|
5380
|
+
import { Fragment as Fragment6, jsx as jsx56, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5276
5381
|
var iconBgClass = {
|
|
5277
5382
|
brand: "bg-v2-brand-bg-soft text-v2-brand-text-dark",
|
|
5278
5383
|
info: "bg-v2-info-soft text-v2-info-500",
|
|
@@ -5293,9 +5398,9 @@ var trendToneClass = {
|
|
|
5293
5398
|
flat: "bg-v2-bg-subtle text-v2-fg-muted"
|
|
5294
5399
|
};
|
|
5295
5400
|
var arrowIcon2 = {
|
|
5296
|
-
up: /* @__PURE__ */
|
|
5297
|
-
down: /* @__PURE__ */
|
|
5298
|
-
flat: /* @__PURE__ */
|
|
5401
|
+
up: /* @__PURE__ */ jsx56(ArrowUp2, { size: 11, weight: "bold", "aria-hidden": "true" }),
|
|
5402
|
+
down: /* @__PURE__ */ jsx56(ArrowDown2, { size: 11, weight: "bold", "aria-hidden": "true" }),
|
|
5403
|
+
flat: /* @__PURE__ */ jsx56(Minus3, { size: 11, weight: "bold", "aria-hidden": "true" })
|
|
5299
5404
|
};
|
|
5300
5405
|
function buildSparklinePaths(data) {
|
|
5301
5406
|
const width = 100;
|
|
@@ -5332,7 +5437,7 @@ function KpiHero({
|
|
|
5332
5437
|
const sparkPaths = sparkline !== void 0 && hasSparkline ? buildSparklinePaths(sparkline) : null;
|
|
5333
5438
|
const inner = /* @__PURE__ */ jsxs35(Fragment6, { children: [
|
|
5334
5439
|
/* @__PURE__ */ jsxs35("div", { className: "flex items-start justify-between", children: [
|
|
5335
|
-
/* @__PURE__ */
|
|
5440
|
+
/* @__PURE__ */ jsx56(
|
|
5336
5441
|
"span",
|
|
5337
5442
|
{
|
|
5338
5443
|
className: cn(
|
|
@@ -5356,10 +5461,10 @@ function KpiHero({
|
|
|
5356
5461
|
}
|
|
5357
5462
|
)
|
|
5358
5463
|
] }),
|
|
5359
|
-
/* @__PURE__ */
|
|
5360
|
-
/* @__PURE__ */
|
|
5361
|
-
sub && /* @__PURE__ */
|
|
5362
|
-
hasSparkline && sparkPaths && /* @__PURE__ */
|
|
5464
|
+
/* @__PURE__ */ jsx56("span", { className: "text-v2-xs font-semibold uppercase tracking-wide text-v2-fg-muted", children: label }),
|
|
5465
|
+
/* @__PURE__ */ jsx56("span", { className: "text-[30px] font-extrabold tabular-nums leading-none text-v2-fg-default", children: value }),
|
|
5466
|
+
sub && /* @__PURE__ */ jsx56("span", { className: "text-v2-xs text-v2-fg-muted", children: sub }),
|
|
5467
|
+
hasSparkline && sparkPaths && /* @__PURE__ */ jsx56("div", { className: cn("-mt-0.5 h-9 w-full", sparkColorClass[tone]), children: /* @__PURE__ */ jsxs35(
|
|
5363
5468
|
"svg",
|
|
5364
5469
|
{
|
|
5365
5470
|
viewBox: "0 0 100 36",
|
|
@@ -5367,11 +5472,11 @@ function KpiHero({
|
|
|
5367
5472
|
className: "size-full",
|
|
5368
5473
|
"aria-hidden": "true",
|
|
5369
5474
|
children: [
|
|
5370
|
-
/* @__PURE__ */
|
|
5371
|
-
/* @__PURE__ */
|
|
5372
|
-
/* @__PURE__ */
|
|
5475
|
+
/* @__PURE__ */ jsx56("defs", { children: /* @__PURE__ */ jsxs35("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
5476
|
+
/* @__PURE__ */ jsx56("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0.3" }),
|
|
5477
|
+
/* @__PURE__ */ jsx56("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0" })
|
|
5373
5478
|
] }) }),
|
|
5374
|
-
/* @__PURE__ */
|
|
5479
|
+
/* @__PURE__ */ jsx56(
|
|
5375
5480
|
"path",
|
|
5376
5481
|
{
|
|
5377
5482
|
d: sparkPaths.area,
|
|
@@ -5379,7 +5484,7 @@ function KpiHero({
|
|
|
5379
5484
|
stroke: "none"
|
|
5380
5485
|
}
|
|
5381
5486
|
),
|
|
5382
|
-
/* @__PURE__ */
|
|
5487
|
+
/* @__PURE__ */ jsx56(
|
|
5383
5488
|
"path",
|
|
5384
5489
|
{
|
|
5385
5490
|
d: sparkPaths.line,
|
|
@@ -5392,17 +5497,17 @@ function KpiHero({
|
|
|
5392
5497
|
]
|
|
5393
5498
|
}
|
|
5394
5499
|
) }),
|
|
5395
|
-
to && cta && /* @__PURE__ */
|
|
5500
|
+
to && cta && /* @__PURE__ */ jsx56("span", { className: "text-v2-xs font-bold text-v2-action-primary opacity-0 transition-opacity group-hover:opacity-100", children: cta })
|
|
5396
5501
|
] });
|
|
5397
5502
|
if (to) {
|
|
5398
5503
|
const LinkComponent = linkComponent ?? DefaultLink;
|
|
5399
|
-
return /* @__PURE__ */
|
|
5504
|
+
return /* @__PURE__ */ jsx56(LinkComponent, { to, className: containerClass, children: inner });
|
|
5400
5505
|
}
|
|
5401
|
-
return /* @__PURE__ */
|
|
5506
|
+
return /* @__PURE__ */ jsx56("div", { className: containerClass, children: inner });
|
|
5402
5507
|
}
|
|
5403
5508
|
|
|
5404
5509
|
// src/patterns/DashboardBlock/DashboardBlock.tsx
|
|
5405
|
-
import { Fragment as Fragment7, jsx as
|
|
5510
|
+
import { Fragment as Fragment7, jsx as jsx57, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5406
5511
|
function DashboardBlock({
|
|
5407
5512
|
available,
|
|
5408
5513
|
reason,
|
|
@@ -5413,7 +5518,7 @@ function DashboardBlock({
|
|
|
5413
5518
|
children
|
|
5414
5519
|
}) {
|
|
5415
5520
|
if (loading) {
|
|
5416
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ jsx57(
|
|
5417
5522
|
"div",
|
|
5418
5523
|
{
|
|
5419
5524
|
"data-testid": "dashboard-block-skeleton",
|
|
@@ -5424,8 +5529,8 @@ function DashboardBlock({
|
|
|
5424
5529
|
if (!available) {
|
|
5425
5530
|
if (reason === "source_data_missing") {
|
|
5426
5531
|
return /* @__PURE__ */ jsxs36("div", { className: "flex min-h-40 flex-col items-center justify-center gap-2 rounded-v2-lg border border-v2-border-default bg-v2-panel p-5 text-center", children: [
|
|
5427
|
-
/* @__PURE__ */
|
|
5428
|
-
onRetry && /* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ jsx57(Text, { size: "sm", weight: "semibold", children: "Fonte de dados indispon\xEDvel no momento" }),
|
|
5533
|
+
onRetry && /* @__PURE__ */ jsx57(
|
|
5429
5534
|
Button,
|
|
5430
5535
|
{
|
|
5431
5536
|
type: "button",
|
|
@@ -5440,15 +5545,15 @@ function DashboardBlock({
|
|
|
5440
5545
|
return null;
|
|
5441
5546
|
}
|
|
5442
5547
|
if (isEmpty) {
|
|
5443
|
-
return /* @__PURE__ */
|
|
5548
|
+
return /* @__PURE__ */ jsx57("div", { className: "flex min-h-40 items-center justify-center rounded-v2-lg border border-v2-border-default bg-v2-panel p-5 text-center", children: /* @__PURE__ */ jsx57(Text, { size: "sm", color: "muted", children: emptyLabel }) });
|
|
5444
5549
|
}
|
|
5445
|
-
return /* @__PURE__ */
|
|
5550
|
+
return /* @__PURE__ */ jsx57(Fragment7, { children });
|
|
5446
5551
|
}
|
|
5447
5552
|
|
|
5448
5553
|
// src/patterns/LegalDocumentRenderer/LegalDocumentRenderer.tsx
|
|
5449
5554
|
import ReactMarkdown from "react-markdown";
|
|
5450
5555
|
import remarkGfm from "remark-gfm";
|
|
5451
|
-
import { Fragment as Fragment8, jsx as
|
|
5556
|
+
import { Fragment as Fragment8, jsx as jsx58, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5452
5557
|
function formatLastUpdated(iso) {
|
|
5453
5558
|
if (!iso) return "";
|
|
5454
5559
|
const date = new Date(iso);
|
|
@@ -5459,16 +5564,16 @@ function formatLastUpdated(iso) {
|
|
|
5459
5564
|
}).format(date);
|
|
5460
5565
|
}
|
|
5461
5566
|
var markdownComponents = {
|
|
5462
|
-
h1: ({ children }) => /* @__PURE__ */
|
|
5463
|
-
h2: ({ children }) => /* @__PURE__ */
|
|
5464
|
-
h3: ({ children }) => /* @__PURE__ */
|
|
5465
|
-
p: ({ children }) => /* @__PURE__ */
|
|
5466
|
-
ul: ({ children }) => /* @__PURE__ */
|
|
5467
|
-
ol: ({ children }) => /* @__PURE__ */
|
|
5468
|
-
li: ({ children }) => /* @__PURE__ */
|
|
5567
|
+
h1: ({ children }) => /* @__PURE__ */ jsx58(Heading, { level: 2, size: "xl", children }),
|
|
5568
|
+
h2: ({ children }) => /* @__PURE__ */ jsx58(Heading, { level: 3, size: "lg", children }),
|
|
5569
|
+
h3: ({ children }) => /* @__PURE__ */ jsx58(Heading, { level: 4, size: "md", children }),
|
|
5570
|
+
p: ({ children }) => /* @__PURE__ */ jsx58(Text, { size: "base", color: "default", className: "leading-relaxed", children }),
|
|
5571
|
+
ul: ({ children }) => /* @__PURE__ */ jsx58("ul", { className: "ml-6 flex list-disc flex-col gap-1 text-v2-base text-v2-fg-default", children }),
|
|
5572
|
+
ol: ({ children }) => /* @__PURE__ */ jsx58("ol", { className: "ml-6 flex list-decimal flex-col gap-1 text-v2-base text-v2-fg-default", children }),
|
|
5573
|
+
li: ({ children }) => /* @__PURE__ */ jsx58("li", { children }),
|
|
5469
5574
|
a: ({ href, children }) => {
|
|
5470
5575
|
const isExternal = href == null ? void 0 : href.startsWith("http");
|
|
5471
|
-
return /* @__PURE__ */
|
|
5576
|
+
return /* @__PURE__ */ jsx58(
|
|
5472
5577
|
"a",
|
|
5473
5578
|
{
|
|
5474
5579
|
href,
|
|
@@ -5479,14 +5584,14 @@ var markdownComponents = {
|
|
|
5479
5584
|
}
|
|
5480
5585
|
);
|
|
5481
5586
|
},
|
|
5482
|
-
strong: ({ children }) => /* @__PURE__ */
|
|
5483
|
-
em: ({ children }) => /* @__PURE__ */
|
|
5484
|
-
hr: () => /* @__PURE__ */
|
|
5485
|
-
table: ({ children }) => /* @__PURE__ */
|
|
5486
|
-
th: ({ children }) => /* @__PURE__ */
|
|
5487
|
-
td: ({ children }) => /* @__PURE__ */
|
|
5488
|
-
blockquote: ({ children }) => /* @__PURE__ */
|
|
5489
|
-
code: ({ children }) => /* @__PURE__ */
|
|
5587
|
+
strong: ({ children }) => /* @__PURE__ */ jsx58("strong", { className: "font-semibold text-v2-fg-default", children }),
|
|
5588
|
+
em: ({ children }) => /* @__PURE__ */ jsx58("em", { className: "italic", children }),
|
|
5589
|
+
hr: () => /* @__PURE__ */ jsx58("hr", { className: "my-2 border-t border-v2-border-default" }),
|
|
5590
|
+
table: ({ children }) => /* @__PURE__ */ jsx58("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsx58("table", { className: "w-full border-collapse text-v2-sm", children }) }),
|
|
5591
|
+
th: ({ children }) => /* @__PURE__ */ jsx58("th", { className: "border-b border-v2-border-default bg-v2-bg-subtle px-3 py-2 text-left font-semibold", children }),
|
|
5592
|
+
td: ({ children }) => /* @__PURE__ */ jsx58("td", { className: "border-b border-v2-border-subtle px-3 py-2", children }),
|
|
5593
|
+
blockquote: ({ children }) => /* @__PURE__ */ jsx58("blockquote", { className: "border-l-4 border-v2-border-default pl-4 italic text-v2-fg-muted", children }),
|
|
5594
|
+
code: ({ children }) => /* @__PURE__ */ jsx58("code", { className: "rounded-v2-sm bg-v2-bg-subtle px-1 py-0.5 font-mono text-v2-xs", children })
|
|
5490
5595
|
};
|
|
5491
5596
|
function LegalDocumentRenderer({
|
|
5492
5597
|
document: document2,
|
|
@@ -5499,16 +5604,16 @@ function LegalDocumentRenderer({
|
|
|
5499
5604
|
className
|
|
5500
5605
|
}) {
|
|
5501
5606
|
if (isLoading) {
|
|
5502
|
-
return /* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5504
|
-
/* @__PURE__ */
|
|
5505
|
-
/* @__PURE__ */
|
|
5506
|
-
/* @__PURE__ */
|
|
5507
|
-
/* @__PURE__ */
|
|
5607
|
+
return /* @__PURE__ */ jsx58("div", { className: cn("flex flex-col gap-3", className), children: loadingState ?? /* @__PURE__ */ jsxs37(Fragment8, { children: [
|
|
5608
|
+
/* @__PURE__ */ jsx58(Skeleton, { shape: "text", style: { width: "60%", height: 24 } }),
|
|
5609
|
+
/* @__PURE__ */ jsx58(Skeleton, { shape: "text", style: { width: "100%", height: 14 } }),
|
|
5610
|
+
/* @__PURE__ */ jsx58(Skeleton, { shape: "text", style: { width: "95%", height: 14 } }),
|
|
5611
|
+
/* @__PURE__ */ jsx58(Skeleton, { shape: "text", style: { width: "90%", height: 14 } }),
|
|
5612
|
+
/* @__PURE__ */ jsx58(Skeleton, { shape: "text", style: { width: "85%", height: 14 } })
|
|
5508
5613
|
] }) });
|
|
5509
5614
|
}
|
|
5510
5615
|
if (error || !document2) {
|
|
5511
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ jsx58(
|
|
5512
5617
|
"div",
|
|
5513
5618
|
{
|
|
5514
5619
|
className: cn(
|
|
@@ -5516,18 +5621,18 @@ function LegalDocumentRenderer({
|
|
|
5516
5621
|
className
|
|
5517
5622
|
),
|
|
5518
5623
|
role: "alert",
|
|
5519
|
-
children: errorState ?? /* @__PURE__ */
|
|
5624
|
+
children: errorState ?? /* @__PURE__ */ jsx58(Text, { size: "sm", color: "default", children: "N\xE3o foi poss\xEDvel carregar o documento." })
|
|
5520
5625
|
}
|
|
5521
5626
|
);
|
|
5522
5627
|
}
|
|
5523
5628
|
return /* @__PURE__ */ jsxs37("article", { className: cn("flex flex-col gap-4", className), children: [
|
|
5524
|
-
title && /* @__PURE__ */
|
|
5629
|
+
title && /* @__PURE__ */ jsx58(Heading, { level: 1, size: "2xl", children: title }),
|
|
5525
5630
|
document2.lastUpdated && /* @__PURE__ */ jsxs37(Text, { size: "xs", color: "muted", children: [
|
|
5526
5631
|
lastUpdatedLabel,
|
|
5527
5632
|
": ",
|
|
5528
5633
|
formatLastUpdated(document2.lastUpdated)
|
|
5529
5634
|
] }),
|
|
5530
|
-
/* @__PURE__ */
|
|
5635
|
+
/* @__PURE__ */ jsx58("div", { className: "flex flex-col gap-4 text-v2-base text-v2-fg-default", children: /* @__PURE__ */ jsx58(
|
|
5531
5636
|
ReactMarkdown,
|
|
5532
5637
|
{
|
|
5533
5638
|
remarkPlugins: [remarkGfm],
|
|
@@ -5545,7 +5650,7 @@ import { forwardRef as forwardRef42 } from "react";
|
|
|
5545
5650
|
// src/patterns/SortableColumnHeader/SortableColumnHeader.tsx
|
|
5546
5651
|
import { forwardRef as forwardRef41 } from "react";
|
|
5547
5652
|
import { CaretDown as CaretDown5, CaretUp, CaretUpDown } from "@phosphor-icons/react";
|
|
5548
|
-
import { jsx as
|
|
5653
|
+
import { jsx as jsx59, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5549
5654
|
function nextDirection(current, cycleMode) {
|
|
5550
5655
|
if (cycleMode === "asc-desc") {
|
|
5551
5656
|
return current === "asc" ? "desc" : "asc";
|
|
@@ -5589,8 +5694,8 @@ var SortableColumnHeader = forwardRef41(
|
|
|
5589
5694
|
},
|
|
5590
5695
|
...props,
|
|
5591
5696
|
children: [
|
|
5592
|
-
/* @__PURE__ */
|
|
5593
|
-
direction === "asc" ? /* @__PURE__ */
|
|
5697
|
+
/* @__PURE__ */ jsx59("span", { children: label }),
|
|
5698
|
+
direction === "asc" ? /* @__PURE__ */ jsx59(CaretUp, { size: 12, weight: "bold", "aria-hidden": "true" }) : direction === "desc" ? /* @__PURE__ */ jsx59(CaretDown5, { size: 12, weight: "bold", "aria-hidden": "true" }) : /* @__PURE__ */ jsx59(CaretUpDown, { size: 12, "aria-hidden": "true", className: "opacity-60" })
|
|
5594
5699
|
]
|
|
5595
5700
|
}
|
|
5596
5701
|
);
|
|
@@ -5599,7 +5704,7 @@ var SortableColumnHeader = forwardRef41(
|
|
|
5599
5704
|
SortableColumnHeader.displayName = "SortableColumnHeader";
|
|
5600
5705
|
|
|
5601
5706
|
// src/patterns/DataTable/DataTable.tsx
|
|
5602
|
-
import { jsx as
|
|
5707
|
+
import { jsx as jsx60, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5603
5708
|
var densityCellClass = {
|
|
5604
5709
|
compact: "px-3 py-1.5",
|
|
5605
5710
|
comfortable: "px-3 py-3"
|
|
@@ -5636,7 +5741,7 @@ function DataTableInner({
|
|
|
5636
5741
|
}, ref) {
|
|
5637
5742
|
const cellPadding = densityCellClass[density];
|
|
5638
5743
|
const seenRowKeys = /* @__PURE__ */ new Set();
|
|
5639
|
-
return /* @__PURE__ */
|
|
5744
|
+
return /* @__PURE__ */ jsx60("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs39(
|
|
5640
5745
|
"table",
|
|
5641
5746
|
{
|
|
5642
5747
|
ref,
|
|
@@ -5644,14 +5749,14 @@ function DataTableInner({
|
|
|
5644
5749
|
className: cn("w-full border-collapse text-v2-sm", className),
|
|
5645
5750
|
...props,
|
|
5646
5751
|
children: [
|
|
5647
|
-
/* @__PURE__ */
|
|
5752
|
+
/* @__PURE__ */ jsx60(
|
|
5648
5753
|
"thead",
|
|
5649
5754
|
{
|
|
5650
5755
|
className: cn(
|
|
5651
5756
|
"border-b border-v2-border-default bg-v2-bg-subtle",
|
|
5652
5757
|
stickyHeader && "sticky top-0 z-10"
|
|
5653
5758
|
),
|
|
5654
|
-
children: /* @__PURE__ */
|
|
5759
|
+
children: /* @__PURE__ */ jsx60("tr", { children: columns.map((col) => /* @__PURE__ */ jsx60(
|
|
5655
5760
|
"th",
|
|
5656
5761
|
{
|
|
5657
5762
|
scope: "col",
|
|
@@ -5666,7 +5771,7 @@ function DataTableInner({
|
|
|
5666
5771
|
col.align === "center" && "text-center",
|
|
5667
5772
|
col.align !== "right" && col.align !== "center" && "text-left"
|
|
5668
5773
|
),
|
|
5669
|
-
children: col.sortable && onSortChange ? /* @__PURE__ */
|
|
5774
|
+
children: col.sortable && onSortChange ? /* @__PURE__ */ jsx60(
|
|
5670
5775
|
SortableColumnHeader,
|
|
5671
5776
|
{
|
|
5672
5777
|
label: col.label,
|
|
@@ -5689,18 +5794,18 @@ function DataTableInner({
|
|
|
5689
5794
|
)) })
|
|
5690
5795
|
}
|
|
5691
5796
|
),
|
|
5692
|
-
/* @__PURE__ */
|
|
5797
|
+
/* @__PURE__ */ jsx60("tbody", { children: loading ? Array.from({ length: loadingRowCount }).map((_, idx) => /* @__PURE__ */ jsx60(
|
|
5693
5798
|
"tr",
|
|
5694
5799
|
{
|
|
5695
5800
|
className: "border-b border-v2-border-default",
|
|
5696
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
5801
|
+
children: columns.map((col) => /* @__PURE__ */ jsx60("td", { className: cellPadding, children: /* @__PURE__ */ jsx60(Skeleton, { className: "h-4 w-full" }) }, col.key))
|
|
5697
5802
|
},
|
|
5698
5803
|
`skeleton-${idx}`
|
|
5699
|
-
)) : rows.length === 0 ? /* @__PURE__ */
|
|
5804
|
+
)) : rows.length === 0 ? /* @__PURE__ */ jsx60("tr", { children: /* @__PURE__ */ jsx60("td", { colSpan: columns.length, className: "py-12 text-center", children: emptyState ?? /* @__PURE__ */ jsx60("span", { className: "text-v2-sm text-v2-fg-muted", children: "Nenhum item." }) }) }) : rows.map((row, index) => {
|
|
5700
5805
|
const baseKey = rowKey(row);
|
|
5701
5806
|
const uniqueKey = seenRowKeys.has(baseKey) ? `${baseKey}__${index}` : baseKey;
|
|
5702
5807
|
seenRowKeys.add(baseKey);
|
|
5703
|
-
return /* @__PURE__ */
|
|
5808
|
+
return /* @__PURE__ */ jsx60(
|
|
5704
5809
|
"tr",
|
|
5705
5810
|
{
|
|
5706
5811
|
className: cn(
|
|
@@ -5708,7 +5813,7 @@ function DataTableInner({
|
|
|
5708
5813
|
zebra && index % 2 === 1 && "bg-v2-bg-subtle/50",
|
|
5709
5814
|
rowClassName == null ? void 0 : rowClassName(row, index)
|
|
5710
5815
|
),
|
|
5711
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
5816
|
+
children: columns.map((col) => /* @__PURE__ */ jsx60(
|
|
5712
5817
|
"td",
|
|
5713
5818
|
{
|
|
5714
5819
|
className: cn(
|
|
@@ -5733,9 +5838,9 @@ var DataTable = forwardRef42(
|
|
|
5733
5838
|
);
|
|
5734
5839
|
|
|
5735
5840
|
// src/patterns/DataTablePagination/DataTablePagination.tsx
|
|
5736
|
-
import { forwardRef as forwardRef43, useState as
|
|
5841
|
+
import { forwardRef as forwardRef43, useState as useState16 } from "react";
|
|
5737
5842
|
import { CaretDown as CaretDown6, CaretLeft, CaretRight as CaretRight2, Check as Check5 } from "@phosphor-icons/react";
|
|
5738
|
-
import { jsx as
|
|
5843
|
+
import { jsx as jsx61, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5739
5844
|
var DEFAULT_PER_PAGE_OPTIONS = [5, 10, 20, 30, 50, 70, 100];
|
|
5740
5845
|
function buildPageNumbers(page, totalPages, siblingCount) {
|
|
5741
5846
|
if (totalPages <= 7) {
|
|
@@ -5772,7 +5877,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5772
5877
|
className,
|
|
5773
5878
|
...props
|
|
5774
5879
|
}, ref) => {
|
|
5775
|
-
const [perPageOpen, setPerPageOpen] =
|
|
5880
|
+
const [perPageOpen, setPerPageOpen] = useState16(false);
|
|
5776
5881
|
const first = (page - 1) * perPage + 1;
|
|
5777
5882
|
const last = Math.min(page * perPage, total);
|
|
5778
5883
|
const totalPages = Math.max(1, Math.ceil(total / perPage));
|
|
@@ -5799,13 +5904,13 @@ var DataTablePagination = forwardRef43(
|
|
|
5799
5904
|
" ",
|
|
5800
5905
|
ofLabel,
|
|
5801
5906
|
" ",
|
|
5802
|
-
/* @__PURE__ */
|
|
5907
|
+
/* @__PURE__ */ jsx61("strong", { className: "tabular-nums text-v2-fg-default", children: total })
|
|
5803
5908
|
] }),
|
|
5804
5909
|
/* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-3", children: [
|
|
5805
5910
|
onPerPageChange && /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2", children: [
|
|
5806
|
-
/* @__PURE__ */
|
|
5911
|
+
/* @__PURE__ */ jsx61("span", { className: "text-v2-sm text-v2-fg-muted", children: perPageLabel }),
|
|
5807
5912
|
/* @__PURE__ */ jsxs40(Popover, { open: perPageOpen, onOpenChange: setPerPageOpen, children: [
|
|
5808
|
-
/* @__PURE__ */
|
|
5913
|
+
/* @__PURE__ */ jsx61(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs40(
|
|
5809
5914
|
"button",
|
|
5810
5915
|
{
|
|
5811
5916
|
type: "button",
|
|
@@ -5814,14 +5919,14 @@ var DataTablePagination = forwardRef43(
|
|
|
5814
5919
|
"aria-expanded": perPageOpen,
|
|
5815
5920
|
className: "inline-flex h-9 items-center gap-1.5 rounded-v2-md border border-v2-border-default bg-v2-panel px-3 text-v2-sm text-v2-fg-default transition-colors hover:bg-v2-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30",
|
|
5816
5921
|
children: [
|
|
5817
|
-
/* @__PURE__ */
|
|
5818
|
-
/* @__PURE__ */
|
|
5922
|
+
/* @__PURE__ */ jsx61("span", { className: "tabular-nums", children: perPage }),
|
|
5923
|
+
/* @__PURE__ */ jsx61(CaretDown6, { size: 12, weight: "bold", "aria-hidden": "true" })
|
|
5819
5924
|
]
|
|
5820
5925
|
}
|
|
5821
5926
|
) }),
|
|
5822
|
-
/* @__PURE__ */
|
|
5927
|
+
/* @__PURE__ */ jsx61(Popover.Content, { align: "end", className: "w-24 p-1", children: /* @__PURE__ */ jsx61("ul", { role: "listbox", className: "flex flex-col gap-0.5", children: perPageOptions.map((opt) => {
|
|
5823
5928
|
const selected = opt === perPage;
|
|
5824
|
-
return /* @__PURE__ */
|
|
5929
|
+
return /* @__PURE__ */ jsx61("li", { children: /* @__PURE__ */ jsxs40(
|
|
5825
5930
|
"button",
|
|
5826
5931
|
{
|
|
5827
5932
|
type: "button",
|
|
@@ -5837,7 +5942,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5837
5942
|
),
|
|
5838
5943
|
children: [
|
|
5839
5944
|
opt,
|
|
5840
|
-
selected && /* @__PURE__ */
|
|
5945
|
+
selected && /* @__PURE__ */ jsx61(
|
|
5841
5946
|
Check5,
|
|
5842
5947
|
{
|
|
5843
5948
|
size: 12,
|
|
@@ -5852,7 +5957,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5852
5957
|
] })
|
|
5853
5958
|
] }),
|
|
5854
5959
|
/* @__PURE__ */ jsxs40("ul", { className: "flex items-center gap-1", children: [
|
|
5855
|
-
/* @__PURE__ */
|
|
5960
|
+
/* @__PURE__ */ jsx61("li", { children: /* @__PURE__ */ jsx61(
|
|
5856
5961
|
"button",
|
|
5857
5962
|
{
|
|
5858
5963
|
type: "button",
|
|
@@ -5863,11 +5968,11 @@ var DataTablePagination = forwardRef43(
|
|
|
5863
5968
|
"inline-flex size-8 items-center justify-center rounded-v2-md border border-v2-border-default text-v2-fg-default transition-colors hover:bg-v2-bg-subtle",
|
|
5864
5969
|
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent"
|
|
5865
5970
|
),
|
|
5866
|
-
children: /* @__PURE__ */
|
|
5971
|
+
children: /* @__PURE__ */ jsx61(CaretLeft, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
5867
5972
|
}
|
|
5868
5973
|
) }),
|
|
5869
5974
|
pages.map(
|
|
5870
|
-
(p, idx) => p === "ellipsis" ? /* @__PURE__ */
|
|
5975
|
+
(p, idx) => p === "ellipsis" ? /* @__PURE__ */ jsx61(
|
|
5871
5976
|
"li",
|
|
5872
5977
|
{
|
|
5873
5978
|
"aria-hidden": "true",
|
|
@@ -5875,7 +5980,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5875
5980
|
children: "\u2026"
|
|
5876
5981
|
},
|
|
5877
5982
|
`ellipsis-${idx}`
|
|
5878
|
-
) : /* @__PURE__ */
|
|
5983
|
+
) : /* @__PURE__ */ jsx61("li", { children: /* @__PURE__ */ jsx61(
|
|
5879
5984
|
"button",
|
|
5880
5985
|
{
|
|
5881
5986
|
type: "button",
|
|
@@ -5890,7 +5995,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5890
5995
|
}
|
|
5891
5996
|
) }, p)
|
|
5892
5997
|
),
|
|
5893
|
-
/* @__PURE__ */
|
|
5998
|
+
/* @__PURE__ */ jsx61("li", { children: /* @__PURE__ */ jsx61(
|
|
5894
5999
|
"button",
|
|
5895
6000
|
{
|
|
5896
6001
|
type: "button",
|
|
@@ -5901,7 +6006,7 @@ var DataTablePagination = forwardRef43(
|
|
|
5901
6006
|
"inline-flex size-8 items-center justify-center rounded-v2-md border border-v2-border-default text-v2-fg-default transition-colors hover:bg-v2-bg-subtle",
|
|
5902
6007
|
"disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent"
|
|
5903
6008
|
),
|
|
5904
|
-
children: /* @__PURE__ */
|
|
6009
|
+
children: /* @__PURE__ */ jsx61(CaretRight2, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
5905
6010
|
}
|
|
5906
6011
|
) })
|
|
5907
6012
|
] })
|
|
@@ -5914,9 +6019,9 @@ var DataTablePagination = forwardRef43(
|
|
|
5914
6019
|
DataTablePagination.displayName = "DataTablePagination";
|
|
5915
6020
|
|
|
5916
6021
|
// src/patterns/ReadOnlyDataView/ReadOnlyDataView.tsx
|
|
5917
|
-
import { useState as
|
|
6022
|
+
import { useState as useState17 } from "react";
|
|
5918
6023
|
import { CaretDown as CaretDown7, CaretUp as CaretUp2, CaretUpDown as CaretUpDown2 } from "@phosphor-icons/react";
|
|
5919
|
-
import { Fragment as Fragment9, jsx as
|
|
6024
|
+
import { Fragment as Fragment9, jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5920
6025
|
function formatDate(value, format3) {
|
|
5921
6026
|
if (!value) return "\u2014";
|
|
5922
6027
|
const date = value instanceof Date ? value : new Date(String(value));
|
|
@@ -5953,7 +6058,7 @@ function ReadOnlyDataView({
|
|
|
5953
6058
|
density = "normal",
|
|
5954
6059
|
className
|
|
5955
6060
|
}) {
|
|
5956
|
-
const [activeDialog, setActiveDialog] =
|
|
6061
|
+
const [activeDialog, setActiveDialog] = useState17(null);
|
|
5957
6062
|
const cellPadding = density === "compact" ? "px-3 py-2" : "px-4 py-3";
|
|
5958
6063
|
const headerPadding = density === "compact" ? "px-3 py-2" : "px-4 py-3";
|
|
5959
6064
|
const handleHeaderClick = (column) => {
|
|
@@ -5971,18 +6076,18 @@ function ReadOnlyDataView({
|
|
|
5971
6076
|
};
|
|
5972
6077
|
const hasTriggerColumn = (column) => column.type !== "action" && Boolean(detailsDialogs == null ? void 0 : detailsDialogs.some((d) => d.triggerColumn === column.key));
|
|
5973
6078
|
return /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
5974
|
-
/* @__PURE__ */
|
|
6079
|
+
/* @__PURE__ */ jsx62(
|
|
5975
6080
|
Card,
|
|
5976
6081
|
{
|
|
5977
6082
|
padding: "none",
|
|
5978
6083
|
variant: "default",
|
|
5979
6084
|
className: cn("overflow-hidden", className),
|
|
5980
|
-
children: /* @__PURE__ */
|
|
5981
|
-
caption && /* @__PURE__ */
|
|
5982
|
-
/* @__PURE__ */
|
|
6085
|
+
children: /* @__PURE__ */ jsx62("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs41("table", { className: "w-full border-collapse", children: [
|
|
6086
|
+
caption && /* @__PURE__ */ jsx62("caption", { className: "sr-only", children: caption }),
|
|
6087
|
+
/* @__PURE__ */ jsx62("thead", { className: "bg-v2-bg-subtle", children: /* @__PURE__ */ jsx62("tr", { children: columns.map((column) => {
|
|
5983
6088
|
const isSortable = column.type !== "action" && Boolean(column.sortable);
|
|
5984
6089
|
const isSorted = column.type !== "action" && (sortValue == null ? void 0 : sortValue.column) === column.key;
|
|
5985
|
-
return /* @__PURE__ */
|
|
6090
|
+
return /* @__PURE__ */ jsx62(
|
|
5986
6091
|
"th",
|
|
5987
6092
|
{
|
|
5988
6093
|
scope: "col",
|
|
@@ -6002,21 +6107,21 @@ function ReadOnlyDataView({
|
|
|
6002
6107
|
className: "inline-flex items-center gap-1 text-v2-fg-muted hover:text-v2-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30 motion-reduce:transition-none",
|
|
6003
6108
|
children: [
|
|
6004
6109
|
column.label,
|
|
6005
|
-
isSorted ? (sortValue == null ? void 0 : sortValue.direction) === "asc" ? /* @__PURE__ */
|
|
6110
|
+
isSorted ? (sortValue == null ? void 0 : sortValue.direction) === "asc" ? /* @__PURE__ */ jsx62(
|
|
6006
6111
|
CaretUp2,
|
|
6007
6112
|
{
|
|
6008
6113
|
size: 12,
|
|
6009
6114
|
weight: "bold",
|
|
6010
6115
|
"aria-hidden": "true"
|
|
6011
6116
|
}
|
|
6012
|
-
) : /* @__PURE__ */
|
|
6117
|
+
) : /* @__PURE__ */ jsx62(
|
|
6013
6118
|
CaretDown7,
|
|
6014
6119
|
{
|
|
6015
6120
|
size: 12,
|
|
6016
6121
|
weight: "bold",
|
|
6017
6122
|
"aria-hidden": "true"
|
|
6018
6123
|
}
|
|
6019
|
-
) : /* @__PURE__ */
|
|
6124
|
+
) : /* @__PURE__ */ jsx62(CaretUpDown2, { size: 12, "aria-hidden": "true" })
|
|
6020
6125
|
]
|
|
6021
6126
|
}
|
|
6022
6127
|
) : column.label
|
|
@@ -6024,27 +6129,27 @@ function ReadOnlyDataView({
|
|
|
6024
6129
|
column.key ?? column.label
|
|
6025
6130
|
);
|
|
6026
6131
|
}) }) }),
|
|
6027
|
-
/* @__PURE__ */
|
|
6132
|
+
/* @__PURE__ */ jsx62("tbody", { children: loading ? Array.from({ length: loadingRows }).map((_, i) => /* @__PURE__ */ jsx62(
|
|
6028
6133
|
"tr",
|
|
6029
6134
|
{
|
|
6030
6135
|
className: "border-t border-v2-border-subtle",
|
|
6031
|
-
children: columns.map((column) => /* @__PURE__ */
|
|
6136
|
+
children: columns.map((column) => /* @__PURE__ */ jsx62(
|
|
6032
6137
|
"td",
|
|
6033
6138
|
{
|
|
6034
6139
|
className: cn(cellPadding),
|
|
6035
|
-
children: /* @__PURE__ */
|
|
6140
|
+
children: /* @__PURE__ */ jsx62(Skeleton, { shape: "text", style: { width: "80%" } })
|
|
6036
6141
|
},
|
|
6037
6142
|
column.key ?? column.label
|
|
6038
6143
|
))
|
|
6039
6144
|
},
|
|
6040
6145
|
`skeleton-${i}`
|
|
6041
|
-
)) : list.length === 0 ? /* @__PURE__ */
|
|
6146
|
+
)) : list.length === 0 ? /* @__PURE__ */ jsx62("tr", { children: /* @__PURE__ */ jsx62("td", { colSpan: columns.length, className: "p-0", children: /* @__PURE__ */ jsx62("div", { className: "flex flex-col items-center justify-center gap-2 p-8 text-center", children: emptyState ?? /* @__PURE__ */ jsx62(Text, { size: "sm", color: "muted", children: "Nenhum registro encontrado" }) }) }) }) : list.map((row, rowIndex) => /* @__PURE__ */ jsx62(
|
|
6042
6147
|
"tr",
|
|
6043
6148
|
{
|
|
6044
6149
|
className: "border-t border-v2-border-subtle hover:bg-v2-bg-subtle motion-reduce:transition-none",
|
|
6045
6150
|
children: columns.map((column) => {
|
|
6046
6151
|
const clickable = hasTriggerColumn(column);
|
|
6047
|
-
return /* @__PURE__ */
|
|
6152
|
+
return /* @__PURE__ */ jsx62(
|
|
6048
6153
|
"td",
|
|
6049
6154
|
{
|
|
6050
6155
|
className: cn(
|
|
@@ -6069,7 +6174,7 @@ function ReadOnlyDataView({
|
|
|
6069
6174
|
] }) })
|
|
6070
6175
|
}
|
|
6071
6176
|
),
|
|
6072
|
-
activeDialog && /* @__PURE__ */
|
|
6177
|
+
activeDialog && /* @__PURE__ */ jsx62(
|
|
6073
6178
|
DialogRoot,
|
|
6074
6179
|
{
|
|
6075
6180
|
open: true,
|
|
@@ -6082,8 +6187,8 @@ function ReadOnlyDataView({
|
|
|
6082
6187
|
size: activeDialog.dialog.size ?? "md",
|
|
6083
6188
|
"aria-describedby": void 0,
|
|
6084
6189
|
children: [
|
|
6085
|
-
/* @__PURE__ */
|
|
6086
|
-
/* @__PURE__ */
|
|
6190
|
+
/* @__PURE__ */ jsx62(DialogRoot.Header, { children: /* @__PURE__ */ jsx62(DialogRoot.Title, { children: activeDialog.dialog.title }) }),
|
|
6191
|
+
/* @__PURE__ */ jsx62(DialogRoot.Body, { children: activeDialog.details !== null ? activeDialog.dialog.renderDetails(activeDialog.details) : null })
|
|
6087
6192
|
]
|
|
6088
6193
|
}
|
|
6089
6194
|
)
|
|
@@ -6106,7 +6211,7 @@ function renderCell(column, row) {
|
|
|
6106
6211
|
const value = String(raw);
|
|
6107
6212
|
const variant = column.variantMap[value] ?? "default";
|
|
6108
6213
|
const display = ((_a = column.labelMap) == null ? void 0 : _a[value]) ?? value;
|
|
6109
|
-
return /* @__PURE__ */
|
|
6214
|
+
return /* @__PURE__ */ jsx62(Badge, { variant, children: display });
|
|
6110
6215
|
}
|
|
6111
6216
|
if (column.type === "date") {
|
|
6112
6217
|
return formatDate(raw, column.format);
|
|
@@ -6118,9 +6223,9 @@ function renderCell(column, row) {
|
|
|
6118
6223
|
}
|
|
6119
6224
|
|
|
6120
6225
|
// src/patterns/NotificationCenter/NotificationCenter.tsx
|
|
6121
|
-
import { forwardRef as forwardRef44, useState as
|
|
6226
|
+
import { forwardRef as forwardRef44, useState as useState18 } from "react";
|
|
6122
6227
|
import { Bell } from "@phosphor-icons/react";
|
|
6123
|
-
import { jsx as
|
|
6228
|
+
import { jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6124
6229
|
var severityDotClass = {
|
|
6125
6230
|
info: "bg-v2-info-500",
|
|
6126
6231
|
success: "bg-v2-success-500",
|
|
@@ -6153,11 +6258,11 @@ var NotificationCenter = forwardRef44(
|
|
|
6153
6258
|
triggerAriaLabel = "Notifica\xE7\xF5es",
|
|
6154
6259
|
relativeTime
|
|
6155
6260
|
}, ref) => {
|
|
6156
|
-
const [filter, setFilter] =
|
|
6261
|
+
const [filter, setFilter] = useState18("unread");
|
|
6157
6262
|
const relativeTimeFn = relativeTime ?? defaultRelativeTime;
|
|
6158
6263
|
const filteredNotifs = filter === "unread" ? notifications.filter((n) => !n.read) : notifications;
|
|
6159
6264
|
return /* @__PURE__ */ jsxs42(Popover, { children: [
|
|
6160
|
-
/* @__PURE__ */
|
|
6265
|
+
/* @__PURE__ */ jsx63(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs42(
|
|
6161
6266
|
"button",
|
|
6162
6267
|
{
|
|
6163
6268
|
ref,
|
|
@@ -6165,15 +6270,15 @@ var NotificationCenter = forwardRef44(
|
|
|
6165
6270
|
"aria-label": `${triggerAriaLabel}${unreadCount > 0 ? ` (${unreadCount} n\xE3o lidas)` : ""}`,
|
|
6166
6271
|
className: "relative inline-flex size-9 items-center justify-center rounded-v2-pill border border-v2-border-default bg-v2-panel text-v2-fg-default transition-colors hover:bg-v2-bg-subtle",
|
|
6167
6272
|
children: [
|
|
6168
|
-
/* @__PURE__ */
|
|
6169
|
-
unreadCount > 0 && /* @__PURE__ */
|
|
6273
|
+
/* @__PURE__ */ jsx63(Bell, { size: 18, "aria-hidden": "true" }),
|
|
6274
|
+
unreadCount > 0 && /* @__PURE__ */ jsx63("span", { className: "absolute -right-0.5 -top-0.5 inline-flex min-w-4 items-center justify-center rounded-v2-pill bg-v2-danger-500 px-1 text-v2-xs font-bold text-v2-action-on-primary", children: unreadCount > 99 ? "99+" : unreadCount })
|
|
6170
6275
|
]
|
|
6171
6276
|
}
|
|
6172
6277
|
) }),
|
|
6173
|
-
/* @__PURE__ */
|
|
6278
|
+
/* @__PURE__ */ jsx63(Popover.Content, { size: "auto", align: "end", className: "p-0", children: /* @__PURE__ */ jsxs42("div", { className: "flex w-[min(360px,calc(100vw-2rem))] flex-col", children: [
|
|
6174
6279
|
/* @__PURE__ */ jsxs42("div", { className: "flex items-center justify-between border-b border-v2-border-default px-4 py-3", children: [
|
|
6175
|
-
/* @__PURE__ */
|
|
6176
|
-
unreadCount > 0 && onMarkAllRead && /* @__PURE__ */
|
|
6280
|
+
/* @__PURE__ */ jsx63(Heading, { level: 3, size: "sm", children: "Notifica\xE7\xF5es" }),
|
|
6281
|
+
unreadCount > 0 && onMarkAllRead && /* @__PURE__ */ jsx63(Button, { variant: "secondary", size: "sm", onClick: onMarkAllRead, children: "Marcar todas como lidas" })
|
|
6177
6282
|
] }),
|
|
6178
6283
|
/* @__PURE__ */ jsxs42(
|
|
6179
6284
|
"div",
|
|
@@ -6220,13 +6325,13 @@ var NotificationCenter = forwardRef44(
|
|
|
6220
6325
|
]
|
|
6221
6326
|
}
|
|
6222
6327
|
),
|
|
6223
|
-
/* @__PURE__ */
|
|
6328
|
+
/* @__PURE__ */ jsx63(
|
|
6224
6329
|
"ul",
|
|
6225
6330
|
{
|
|
6226
6331
|
role: "status",
|
|
6227
6332
|
"aria-live": "polite",
|
|
6228
6333
|
className: "max-h-[400px] overflow-y-auto",
|
|
6229
|
-
children: filteredNotifs.length === 0 ? /* @__PURE__ */
|
|
6334
|
+
children: filteredNotifs.length === 0 ? /* @__PURE__ */ jsx63("li", { className: "px-4 py-6 text-center", children: /* @__PURE__ */ jsx63(Text, { size: "sm", color: "muted", children: emptyMessage }) }) : filteredNotifs.map((n) => /* @__PURE__ */ jsx63("li", { children: /* @__PURE__ */ jsxs42(
|
|
6230
6335
|
"button",
|
|
6231
6336
|
{
|
|
6232
6337
|
type: "button",
|
|
@@ -6236,7 +6341,7 @@ var NotificationCenter = forwardRef44(
|
|
|
6236
6341
|
!n.read && "bg-v2-brand-bg-soft/30"
|
|
6237
6342
|
),
|
|
6238
6343
|
children: [
|
|
6239
|
-
/* @__PURE__ */
|
|
6344
|
+
/* @__PURE__ */ jsx63(
|
|
6240
6345
|
"span",
|
|
6241
6346
|
{
|
|
6242
6347
|
"aria-hidden": "true",
|
|
@@ -6247,11 +6352,11 @@ var NotificationCenter = forwardRef44(
|
|
|
6247
6352
|
}
|
|
6248
6353
|
),
|
|
6249
6354
|
/* @__PURE__ */ jsxs42("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
6250
|
-
/* @__PURE__ */
|
|
6251
|
-
n.description && /* @__PURE__ */
|
|
6252
|
-
/* @__PURE__ */
|
|
6355
|
+
/* @__PURE__ */ jsx63(Text, { size: "sm", weight: "semibold", children: n.title }),
|
|
6356
|
+
n.description && /* @__PURE__ */ jsx63(Text, { size: "xs", color: "muted", children: n.description }),
|
|
6357
|
+
/* @__PURE__ */ jsx63(Text, { size: "xs", color: "subtle", children: relativeTimeFn(n.timestamp) })
|
|
6253
6358
|
] }),
|
|
6254
|
-
!n.read && /* @__PURE__ */
|
|
6359
|
+
!n.read && /* @__PURE__ */ jsx63(
|
|
6255
6360
|
"span",
|
|
6256
6361
|
{
|
|
6257
6362
|
"aria-label": "N\xE3o lida",
|
|
@@ -6272,7 +6377,7 @@ NotificationCenter.displayName = "NotificationCenter";
|
|
|
6272
6377
|
// src/patterns/NavigatorTile/NavigatorTile.tsx
|
|
6273
6378
|
import { forwardRef as forwardRef45 } from "react";
|
|
6274
6379
|
import { CaretRight as CaretRight3 } from "@phosphor-icons/react";
|
|
6275
|
-
import { Fragment as Fragment10, jsx as
|
|
6380
|
+
import { Fragment as Fragment10, jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6276
6381
|
var NavigatorTile = forwardRef45(
|
|
6277
6382
|
({
|
|
6278
6383
|
icon,
|
|
@@ -6285,7 +6390,7 @@ var NavigatorTile = forwardRef45(
|
|
|
6285
6390
|
className,
|
|
6286
6391
|
children,
|
|
6287
6392
|
...props
|
|
6288
|
-
}, ref) => /* @__PURE__ */
|
|
6393
|
+
}, ref) => /* @__PURE__ */ jsx64(
|
|
6289
6394
|
Card,
|
|
6290
6395
|
{
|
|
6291
6396
|
ref,
|
|
@@ -6301,14 +6406,14 @@ var NavigatorTile = forwardRef45(
|
|
|
6301
6406
|
...props,
|
|
6302
6407
|
children: asChild ? children : /* @__PURE__ */ jsxs43(Fragment10, { children: [
|
|
6303
6408
|
/* @__PURE__ */ jsxs43("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6304
|
-
icon && /* @__PURE__ */
|
|
6305
|
-
badge && /* @__PURE__ */
|
|
6409
|
+
icon && /* @__PURE__ */ jsx64("span", { className: "inline-flex size-10 shrink-0 items-center justify-center rounded-v2-pill bg-v2-brand-bg-soft text-v2-brand-text-dark", children: icon }),
|
|
6410
|
+
badge && /* @__PURE__ */ jsx64("span", { className: "shrink-0", children: badge })
|
|
6306
6411
|
] }),
|
|
6307
6412
|
/* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1", children: [
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
description && /* @__PURE__ */
|
|
6413
|
+
/* @__PURE__ */ jsx64(Heading, { level: 3, size: "xs", children: title }),
|
|
6414
|
+
description && /* @__PURE__ */ jsx64(Text, { size: "sm", color: "muted", children: description })
|
|
6310
6415
|
] }),
|
|
6311
|
-
showChevron && /* @__PURE__ */
|
|
6416
|
+
showChevron && /* @__PURE__ */ jsx64("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx64(
|
|
6312
6417
|
CaretRight3,
|
|
6313
6418
|
{
|
|
6314
6419
|
size: 16,
|
|
@@ -6331,7 +6436,7 @@ var columnClass = {
|
|
|
6331
6436
|
var NavigatorTileGrid = forwardRef45(
|
|
6332
6437
|
({ columns = 3, emptyState, isEmpty = false, className, children, ...props }, ref) => {
|
|
6333
6438
|
if (isEmpty && emptyState) {
|
|
6334
|
-
return /* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ jsx64(
|
|
6335
6440
|
"div",
|
|
6336
6441
|
{
|
|
6337
6442
|
ref,
|
|
@@ -6344,7 +6449,7 @@ var NavigatorTileGrid = forwardRef45(
|
|
|
6344
6449
|
}
|
|
6345
6450
|
);
|
|
6346
6451
|
}
|
|
6347
|
-
return /* @__PURE__ */
|
|
6452
|
+
return /* @__PURE__ */ jsx64(
|
|
6348
6453
|
"div",
|
|
6349
6454
|
{
|
|
6350
6455
|
ref,
|
|
@@ -6359,7 +6464,7 @@ NavigatorTileGrid.displayName = "NavigatorTileGrid";
|
|
|
6359
6464
|
|
|
6360
6465
|
// src/patterns/PublicPageLayout/PublicPageLayout.tsx
|
|
6361
6466
|
import { forwardRef as forwardRef46 } from "react";
|
|
6362
|
-
import { jsx as
|
|
6467
|
+
import { jsx as jsx65, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6363
6468
|
var maxWidthClass = {
|
|
6364
6469
|
sm: "max-w-md",
|
|
6365
6470
|
md: "max-w-2xl",
|
|
@@ -6388,7 +6493,7 @@ var PublicPageLayout = forwardRef46(
|
|
|
6388
6493
|
),
|
|
6389
6494
|
...props,
|
|
6390
6495
|
children: [
|
|
6391
|
-
/* @__PURE__ */
|
|
6496
|
+
/* @__PURE__ */ jsx65(
|
|
6392
6497
|
"a",
|
|
6393
6498
|
{
|
|
6394
6499
|
href: `#${mainId}`,
|
|
@@ -6396,21 +6501,21 @@ var PublicPageLayout = forwardRef46(
|
|
|
6396
6501
|
children: skipToMainLabel
|
|
6397
6502
|
}
|
|
6398
6503
|
),
|
|
6399
|
-
header && /* @__PURE__ */
|
|
6504
|
+
header && /* @__PURE__ */ jsx65("header", { className: "border-b border-v2-border-default bg-v2-panel", children: /* @__PURE__ */ jsx65(
|
|
6400
6505
|
"div",
|
|
6401
6506
|
{
|
|
6402
6507
|
className: cn("mx-auto w-full px-6 py-4", maxWidthClass[maxWidth]),
|
|
6403
6508
|
children: header
|
|
6404
6509
|
}
|
|
6405
6510
|
) }),
|
|
6406
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsx65("main", { id: mainId, className: "flex-1", children: /* @__PURE__ */ jsx65(
|
|
6407
6512
|
"div",
|
|
6408
6513
|
{
|
|
6409
6514
|
className: cn("mx-auto w-full px-6 py-8", maxWidthClass[maxWidth]),
|
|
6410
6515
|
children
|
|
6411
6516
|
}
|
|
6412
6517
|
) }),
|
|
6413
|
-
footer && /* @__PURE__ */
|
|
6518
|
+
footer && /* @__PURE__ */ jsx65("footer", { className: "border-t border-v2-border-default bg-v2-panel", children: /* @__PURE__ */ jsx65(
|
|
6414
6519
|
"div",
|
|
6415
6520
|
{
|
|
6416
6521
|
className: cn("mx-auto w-full px-6 py-4", maxWidthClass[maxWidth]),
|
|
@@ -6426,30 +6531,30 @@ PublicPageLayout.displayName = "PublicPageLayout";
|
|
|
6426
6531
|
// src/patterns/ErrorPageLayout/ErrorPageLayout.tsx
|
|
6427
6532
|
import { forwardRef as forwardRef47 } from "react";
|
|
6428
6533
|
import { ArrowLeft } from "@phosphor-icons/react";
|
|
6429
|
-
import { jsx as
|
|
6534
|
+
import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6430
6535
|
function isHrefAction(action) {
|
|
6431
6536
|
return Boolean(action && "href" in action);
|
|
6432
6537
|
}
|
|
6433
6538
|
var ErrorPageLayout = forwardRef47(
|
|
6434
|
-
({ code, title, description, primaryAction, illustration, ...layoutProps }, ref) => /* @__PURE__ */
|
|
6435
|
-
code && /* @__PURE__ */
|
|
6539
|
+
({ code, title, description, primaryAction, illustration, ...layoutProps }, ref) => /* @__PURE__ */ jsx66(PublicPageLayout, { ref, ...layoutProps, children: /* @__PURE__ */ jsxs45("div", { className: "flex flex-col items-center justify-center gap-6 py-12 text-center", children: [
|
|
6540
|
+
code && /* @__PURE__ */ jsx66("div", { className: "text-v2-6xl font-bold leading-none text-v2-action-primary", children: code }),
|
|
6436
6541
|
illustration,
|
|
6437
6542
|
/* @__PURE__ */ jsxs45("div", { className: "flex flex-col gap-2", children: [
|
|
6438
|
-
/* @__PURE__ */
|
|
6439
|
-
description && /* @__PURE__ */
|
|
6543
|
+
/* @__PURE__ */ jsx66(Heading, { level: 1, size: "xl", children: title }),
|
|
6544
|
+
description && /* @__PURE__ */ jsx66(Text, { size: "base", color: "muted", className: "max-w-md", children: description })
|
|
6440
6545
|
] }),
|
|
6441
|
-
primaryAction && (isHrefAction(primaryAction) ? /* @__PURE__ */
|
|
6546
|
+
primaryAction && (isHrefAction(primaryAction) ? /* @__PURE__ */ jsx66(
|
|
6442
6547
|
Button,
|
|
6443
6548
|
{
|
|
6444
6549
|
asChild: true,
|
|
6445
|
-
leftIcon: /* @__PURE__ */
|
|
6446
|
-
children: /* @__PURE__ */
|
|
6550
|
+
leftIcon: /* @__PURE__ */ jsx66(ArrowLeft, { size: 16, weight: "bold", "aria-hidden": "true" }),
|
|
6551
|
+
children: /* @__PURE__ */ jsx66("a", { href: primaryAction.href, children: primaryAction.label })
|
|
6447
6552
|
}
|
|
6448
|
-
) : /* @__PURE__ */
|
|
6553
|
+
) : /* @__PURE__ */ jsx66(
|
|
6449
6554
|
Button,
|
|
6450
6555
|
{
|
|
6451
6556
|
onClick: primaryAction.onClick,
|
|
6452
|
-
leftIcon: /* @__PURE__ */
|
|
6557
|
+
leftIcon: /* @__PURE__ */ jsx66(ArrowLeft, { size: 16, weight: "bold", "aria-hidden": "true" }),
|
|
6453
6558
|
children: primaryAction.label
|
|
6454
6559
|
}
|
|
6455
6560
|
))
|
|
@@ -6459,7 +6564,7 @@ ErrorPageLayout.displayName = "ErrorPageLayout";
|
|
|
6459
6564
|
|
|
6460
6565
|
// src/patterns/TutorialCard/TutorialCard.tsx
|
|
6461
6566
|
import { forwardRef as forwardRef48 } from "react";
|
|
6462
|
-
import { Fragment as Fragment11, jsx as
|
|
6567
|
+
import { Fragment as Fragment11, jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
6463
6568
|
var TutorialCard = forwardRef48(
|
|
6464
6569
|
({
|
|
6465
6570
|
title,
|
|
@@ -6471,7 +6576,7 @@ var TutorialCard = forwardRef48(
|
|
|
6471
6576
|
className,
|
|
6472
6577
|
children,
|
|
6473
6578
|
...props
|
|
6474
|
-
}, ref) => /* @__PURE__ */
|
|
6579
|
+
}, ref) => /* @__PURE__ */ jsx67(
|
|
6475
6580
|
Card,
|
|
6476
6581
|
{
|
|
6477
6582
|
ref,
|
|
@@ -6483,12 +6588,12 @@ var TutorialCard = forwardRef48(
|
|
|
6483
6588
|
children: asChild ? children : /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
6484
6589
|
media && /* @__PURE__ */ jsxs46("div", { className: "relative aspect-video w-full overflow-hidden bg-v2-bg-subtle", children: [
|
|
6485
6590
|
media,
|
|
6486
|
-
category && /* @__PURE__ */
|
|
6591
|
+
category && /* @__PURE__ */ jsx67("div", { className: "absolute left-3 top-3", children: /* @__PURE__ */ jsx67(Badge, { variant: "default", size: "sm", children: category }) })
|
|
6487
6592
|
] }),
|
|
6488
6593
|
/* @__PURE__ */ jsxs46("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
6489
|
-
/* @__PURE__ */
|
|
6490
|
-
description && /* @__PURE__ */
|
|
6491
|
-
duration && /* @__PURE__ */
|
|
6594
|
+
/* @__PURE__ */ jsx67(Heading, { level: 3, size: "sm", children: title }),
|
|
6595
|
+
description && /* @__PURE__ */ jsx67(Text, { size: "sm", color: "muted", children: description }),
|
|
6596
|
+
duration && /* @__PURE__ */ jsx67("div", { className: "mt-auto pt-2", children: /* @__PURE__ */ jsx67(Badge, { variant: "info", size: "sm", children: duration }) })
|
|
6492
6597
|
] })
|
|
6493
6598
|
] })
|
|
6494
6599
|
}
|
|
@@ -6498,7 +6603,7 @@ TutorialCard.displayName = "TutorialCard";
|
|
|
6498
6603
|
|
|
6499
6604
|
// src/patterns/KpiCard/KpiCard.tsx
|
|
6500
6605
|
import { forwardRef as forwardRef49 } from "react";
|
|
6501
|
-
import { jsx as
|
|
6606
|
+
import { jsx as jsx68, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
6502
6607
|
var variantAccent = {
|
|
6503
6608
|
neutral: "",
|
|
6504
6609
|
success: "border-l-4 border-l-v2-success-500",
|
|
@@ -6517,11 +6622,11 @@ var KpiCard = forwardRef49(
|
|
|
6517
6622
|
...props,
|
|
6518
6623
|
children: [
|
|
6519
6624
|
/* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-2", children: [
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
icon && /* @__PURE__ */
|
|
6625
|
+
/* @__PURE__ */ jsx68(Heading, { level: 2, size: "sm", children: label }),
|
|
6626
|
+
icon && /* @__PURE__ */ jsx68("span", { "aria-hidden": "true", children: icon })
|
|
6522
6627
|
] }),
|
|
6523
|
-
/* @__PURE__ */
|
|
6524
|
-
sublabel && /* @__PURE__ */
|
|
6628
|
+
/* @__PURE__ */ jsx68(Text, { size: "lg", weight: "semibold", className: "mt-2", children: value }),
|
|
6629
|
+
sublabel && /* @__PURE__ */ jsx68(Text, { size: "sm", color: "muted", children: sublabel })
|
|
6525
6630
|
]
|
|
6526
6631
|
}
|
|
6527
6632
|
)
|
|
@@ -6529,10 +6634,10 @@ var KpiCard = forwardRef49(
|
|
|
6529
6634
|
KpiCard.displayName = "KpiCard";
|
|
6530
6635
|
|
|
6531
6636
|
// src/patterns/CommandPalette/CommandPalette.tsx
|
|
6532
|
-
import { useEffect as
|
|
6637
|
+
import { useEffect as useEffect10, useRef as useRef9, useState as useState19 } from "react";
|
|
6533
6638
|
import { createPortal } from "react-dom";
|
|
6534
6639
|
import { MagnifyingGlass as MagnifyingGlass3 } from "@phosphor-icons/react";
|
|
6535
|
-
import { Fragment as Fragment12, jsx as
|
|
6640
|
+
import { Fragment as Fragment12, jsx as jsx69, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
6536
6641
|
function CommandPalette({
|
|
6537
6642
|
open,
|
|
6538
6643
|
onOpenChange,
|
|
@@ -6546,24 +6651,24 @@ function CommandPalette({
|
|
|
6546
6651
|
emptyMessage = "Sem resultados.",
|
|
6547
6652
|
ariaLabel = "Paleta de comandos"
|
|
6548
6653
|
}) {
|
|
6549
|
-
const [queryValue, setQueryValue] =
|
|
6550
|
-
const [highlightedId, setHighlightedId] =
|
|
6654
|
+
const [queryValue, setQueryValue] = useState19(query ?? "");
|
|
6655
|
+
const [highlightedId, setHighlightedId] = useState19(null);
|
|
6551
6656
|
const inputRef = useRef9(null);
|
|
6552
6657
|
const flatItems = groups.flatMap((g) => g.items.filter((i) => !i.disabled));
|
|
6553
6658
|
const filteredGroups = groups.filter((g) => g.loading || g.items.length > 0);
|
|
6554
|
-
|
|
6659
|
+
useEffect10(() => {
|
|
6555
6660
|
var _a;
|
|
6556
6661
|
if (open) {
|
|
6557
6662
|
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
6558
6663
|
}
|
|
6559
6664
|
}, [open]);
|
|
6560
|
-
|
|
6665
|
+
useEffect10(() => {
|
|
6561
6666
|
var _a;
|
|
6562
6667
|
if (open) {
|
|
6563
6668
|
setHighlightedId(((_a = flatItems[0]) == null ? void 0 : _a.id) ?? null);
|
|
6564
6669
|
}
|
|
6565
6670
|
}, [open, groups]);
|
|
6566
|
-
|
|
6671
|
+
useEffect10(() => {
|
|
6567
6672
|
if (!enableShortcut) return;
|
|
6568
6673
|
const handler = (e) => {
|
|
6569
6674
|
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
@@ -6613,7 +6718,7 @@ function CommandPalette({
|
|
|
6613
6718
|
"aria-label": ariaLabel,
|
|
6614
6719
|
className: "fixed inset-0 z-50 flex items-start justify-center p-4 pt-[10vh]",
|
|
6615
6720
|
children: [
|
|
6616
|
-
/* @__PURE__ */
|
|
6721
|
+
/* @__PURE__ */ jsx69(
|
|
6617
6722
|
"button",
|
|
6618
6723
|
{
|
|
6619
6724
|
type: "button",
|
|
@@ -6624,7 +6729,7 @@ function CommandPalette({
|
|
|
6624
6729
|
),
|
|
6625
6730
|
/* @__PURE__ */ jsxs48("div", { className: "relative z-10 flex w-full max-w-2xl flex-col overflow-hidden rounded-v2-lg border border-v2-border-default bg-v2-panel shadow-xl", children: [
|
|
6626
6731
|
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-3 border-b border-v2-border-default px-4 py-3", children: [
|
|
6627
|
-
/* @__PURE__ */
|
|
6732
|
+
/* @__PURE__ */ jsx69(
|
|
6628
6733
|
MagnifyingGlass3,
|
|
6629
6734
|
{
|
|
6630
6735
|
size: 18,
|
|
@@ -6632,7 +6737,7 @@ function CommandPalette({
|
|
|
6632
6737
|
className: "text-v2-fg-muted"
|
|
6633
6738
|
}
|
|
6634
6739
|
),
|
|
6635
|
-
/* @__PURE__ */
|
|
6740
|
+
/* @__PURE__ */ jsx69(
|
|
6636
6741
|
"input",
|
|
6637
6742
|
{
|
|
6638
6743
|
ref: inputRef,
|
|
@@ -6652,24 +6757,24 @@ function CommandPalette({
|
|
|
6652
6757
|
className: "flex-1 bg-transparent text-v2-base font-medium text-v2-fg-default placeholder:font-normal placeholder:text-v2-fg-subtle focus:outline-none"
|
|
6653
6758
|
}
|
|
6654
6759
|
),
|
|
6655
|
-
/* @__PURE__ */
|
|
6760
|
+
/* @__PURE__ */ jsx69("kbd", { className: "hidden rounded-v2-sm border border-v2-border-default px-1.5 py-0.5 text-v2-xs font-semibold text-v2-fg-muted md:inline-block", children: "ESC" })
|
|
6656
6761
|
] }),
|
|
6657
|
-
/* @__PURE__ */
|
|
6762
|
+
/* @__PURE__ */ jsx69(
|
|
6658
6763
|
"div",
|
|
6659
6764
|
{
|
|
6660
6765
|
id: "command-palette-listbox",
|
|
6661
6766
|
role: "listbox",
|
|
6662
6767
|
className: "max-h-[60vh] overflow-y-auto",
|
|
6663
|
-
children: filteredGroups.length === 0 ? /* @__PURE__ */
|
|
6768
|
+
children: filteredGroups.length === 0 ? /* @__PURE__ */ jsx69("p", { className: "px-4 py-3 text-v2-sm text-v2-fg-muted", children: emptyMessage }) : filteredGroups.map((group) => /* @__PURE__ */ jsxs48(
|
|
6664
6769
|
"section",
|
|
6665
6770
|
{
|
|
6666
6771
|
"aria-label": group.label,
|
|
6667
6772
|
className: "border-b border-v2-border-default last:border-b-0",
|
|
6668
6773
|
children: [
|
|
6669
|
-
group.label && /* @__PURE__ */
|
|
6670
|
-
group.loading ? /* @__PURE__ */
|
|
6774
|
+
group.label && /* @__PURE__ */ jsx69("h3", { className: "px-4 pb-1 pt-3 text-v2-xs font-semibold uppercase tracking-wider text-v2-fg-muted", children: group.label }),
|
|
6775
|
+
group.loading ? /* @__PURE__ */ jsx69("p", { className: "px-4 py-2 text-v2-xs text-v2-fg-muted", children: "Buscando\u2026" }) : group.items.length === 0 ? /* @__PURE__ */ jsx69("p", { className: "px-4 py-2 text-v2-xs text-v2-fg-muted", children: group.emptyMessage ?? emptyMessage }) : /* @__PURE__ */ jsx69("ul", { children: group.items.map((item) => {
|
|
6671
6776
|
const isHighlighted = highlightedId === item.id;
|
|
6672
|
-
return /* @__PURE__ */
|
|
6777
|
+
return /* @__PURE__ */ jsx69(
|
|
6673
6778
|
"li",
|
|
6674
6779
|
{
|
|
6675
6780
|
id: `command-palette-option-${item.id}`,
|
|
@@ -6684,8 +6789,8 @@ function CommandPalette({
|
|
|
6684
6789
|
),
|
|
6685
6790
|
children: renderItem ? renderItem(item, isHighlighted) : /* @__PURE__ */ jsxs48(Fragment12, { children: [
|
|
6686
6791
|
/* @__PURE__ */ jsxs48("div", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
6687
|
-
/* @__PURE__ */
|
|
6688
|
-
item.description && /* @__PURE__ */
|
|
6792
|
+
/* @__PURE__ */ jsx69("span", { className: "truncate font-medium", children: item.label }),
|
|
6793
|
+
item.description && /* @__PURE__ */ jsx69(
|
|
6689
6794
|
"span",
|
|
6690
6795
|
{
|
|
6691
6796
|
className: cn(
|
|
@@ -6696,7 +6801,7 @@ function CommandPalette({
|
|
|
6696
6801
|
}
|
|
6697
6802
|
)
|
|
6698
6803
|
] }),
|
|
6699
|
-
item.meta && /* @__PURE__ */
|
|
6804
|
+
item.meta && /* @__PURE__ */ jsx69(
|
|
6700
6805
|
"span",
|
|
6701
6806
|
{
|
|
6702
6807
|
className: cn(
|
|
@@ -6706,7 +6811,7 @@ function CommandPalette({
|
|
|
6706
6811
|
children: item.meta
|
|
6707
6812
|
}
|
|
6708
6813
|
),
|
|
6709
|
-
item.shortcut && /* @__PURE__ */
|
|
6814
|
+
item.shortcut && /* @__PURE__ */ jsx69("kbd", { className: "ml-2 inline-flex rounded-v2-sm border border-v2-border-default px-1.5 py-0.5 text-v2-xs font-semibold text-v2-fg-muted", children: item.shortcut })
|
|
6710
6815
|
] })
|
|
6711
6816
|
},
|
|
6712
6817
|
item.id
|
|
@@ -6727,8 +6832,8 @@ function CommandPalette({
|
|
|
6727
6832
|
}
|
|
6728
6833
|
|
|
6729
6834
|
// src/patterns/ChartTimeSeries/ChartTimeSeries.tsx
|
|
6730
|
-
import { forwardRef as forwardRef50, useId as useId16, useState as
|
|
6731
|
-
import { Fragment as Fragment13, jsx as
|
|
6835
|
+
import { forwardRef as forwardRef50, useId as useId16, useState as useState20 } from "react";
|
|
6836
|
+
import { Fragment as Fragment13, jsx as jsx70, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
6732
6837
|
var DEFAULT_RANGES = ["3m", "6m", "12m", "YTD"];
|
|
6733
6838
|
var DEFAULT_EMPTY_MESSAGE = "Sem dados no per\xEDodo.";
|
|
6734
6839
|
function buildChartPaths(data) {
|
|
@@ -6784,7 +6889,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6784
6889
|
className,
|
|
6785
6890
|
...props
|
|
6786
6891
|
}, ref) {
|
|
6787
|
-
const [internalRange, setInternalRange] =
|
|
6892
|
+
const [internalRange, setInternalRange] = useState20(
|
|
6788
6893
|
defaultRange ?? ranges[0]
|
|
6789
6894
|
);
|
|
6790
6895
|
const activeRange = range ?? internalRange;
|
|
@@ -6806,12 +6911,12 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6806
6911
|
children: [
|
|
6807
6912
|
/* @__PURE__ */ jsxs49("div", { className: "flex items-start justify-between gap-3", children: [
|
|
6808
6913
|
/* @__PURE__ */ jsxs49("div", { className: "flex flex-col", children: [
|
|
6809
|
-
/* @__PURE__ */
|
|
6810
|
-
subtitle && /* @__PURE__ */
|
|
6914
|
+
/* @__PURE__ */ jsx70("h3", { className: "text-v2-sm font-bold text-v2-fg-default", children: title }),
|
|
6915
|
+
subtitle && /* @__PURE__ */ jsx70("span", { className: "text-v2-xs text-v2-fg-muted", children: subtitle })
|
|
6811
6916
|
] }),
|
|
6812
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ jsx70("div", { role: "tablist", className: "flex items-center gap-1", children: ranges.map((r) => {
|
|
6813
6918
|
const isActive2 = r === activeRange;
|
|
6814
|
-
return /* @__PURE__ */
|
|
6919
|
+
return /* @__PURE__ */ jsx70(
|
|
6815
6920
|
"button",
|
|
6816
6921
|
{
|
|
6817
6922
|
type: "button",
|
|
@@ -6828,7 +6933,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6828
6933
|
);
|
|
6829
6934
|
}) })
|
|
6830
6935
|
] }),
|
|
6831
|
-
!hasData ? /* @__PURE__ */
|
|
6936
|
+
!hasData ? /* @__PURE__ */ jsx70("div", { className: "flex h-[220px] items-center justify-center text-v2-sm text-v2-fg-muted", children: emptyMessage }) : /* @__PURE__ */ jsxs49(
|
|
6832
6937
|
"svg",
|
|
6833
6938
|
{
|
|
6834
6939
|
viewBox: "0 0 720 200",
|
|
@@ -6837,11 +6942,11 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6837
6942
|
"aria-label": typeof title === "string" ? title : "Gr\xE1fico de s\xE9rie temporal",
|
|
6838
6943
|
role: "img",
|
|
6839
6944
|
children: [
|
|
6840
|
-
/* @__PURE__ */
|
|
6841
|
-
/* @__PURE__ */
|
|
6842
|
-
/* @__PURE__ */
|
|
6945
|
+
/* @__PURE__ */ jsx70("defs", { children: /* @__PURE__ */ jsxs49("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6946
|
+
/* @__PURE__ */ jsx70("stop", { offset: "0%", stopColor: "currentColor", stopOpacity: "0.3" }),
|
|
6947
|
+
/* @__PURE__ */ jsx70("stop", { offset: "100%", stopColor: "currentColor", stopOpacity: "0" })
|
|
6843
6948
|
] }) }),
|
|
6844
|
-
[40, 90, 140].map((y) => /* @__PURE__ */
|
|
6949
|
+
[40, 90, 140].map((y) => /* @__PURE__ */ jsx70(
|
|
6845
6950
|
"line",
|
|
6846
6951
|
{
|
|
6847
6952
|
x1: "0",
|
|
@@ -6855,7 +6960,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6855
6960
|
y
|
|
6856
6961
|
)),
|
|
6857
6962
|
paths && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
6858
|
-
/* @__PURE__ */
|
|
6963
|
+
/* @__PURE__ */ jsx70(
|
|
6859
6964
|
"path",
|
|
6860
6965
|
{
|
|
6861
6966
|
d: paths.area,
|
|
@@ -6863,7 +6968,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6863
6968
|
stroke: "none"
|
|
6864
6969
|
}
|
|
6865
6970
|
),
|
|
6866
|
-
/* @__PURE__ */
|
|
6971
|
+
/* @__PURE__ */ jsx70(
|
|
6867
6972
|
"path",
|
|
6868
6973
|
{
|
|
6869
6974
|
d: paths.line,
|
|
@@ -6874,7 +6979,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6874
6979
|
strokeLinejoin: "round"
|
|
6875
6980
|
}
|
|
6876
6981
|
),
|
|
6877
|
-
/* @__PURE__ */
|
|
6982
|
+
/* @__PURE__ */ jsx70(
|
|
6878
6983
|
"circle",
|
|
6879
6984
|
{
|
|
6880
6985
|
cx: paths.lastX,
|
|
@@ -6886,7 +6991,7 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6886
6991
|
}
|
|
6887
6992
|
)
|
|
6888
6993
|
] }),
|
|
6889
|
-
/* @__PURE__ */
|
|
6994
|
+
/* @__PURE__ */ jsx70("g", { style: { fontSize: 10 }, fill: "currentColor", opacity: "0.6", children: axisLabels.map((tick) => /* @__PURE__ */ jsx70(
|
|
6890
6995
|
"text",
|
|
6891
6996
|
{
|
|
6892
6997
|
x: tick.x,
|
|
@@ -6906,9 +7011,9 @@ var ChartTimeSeries = forwardRef50(
|
|
|
6906
7011
|
);
|
|
6907
7012
|
|
|
6908
7013
|
// src/patterns/DonutChart/DonutChart.tsx
|
|
6909
|
-
import { forwardRef as forwardRef51, useState as
|
|
7014
|
+
import { forwardRef as forwardRef51, useState as useState21 } from "react";
|
|
6910
7015
|
import { Cell, Pie, PieChart, ResponsiveContainer, Tooltip as Tooltip2 } from "recharts";
|
|
6911
|
-
import { jsx as
|
|
7016
|
+
import { jsx as jsx71, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
6912
7017
|
var DEFAULT_COLORS = [
|
|
6913
7018
|
"var(--v2-chart-cat-1)",
|
|
6914
7019
|
"var(--v2-chart-cat-2)",
|
|
@@ -6957,7 +7062,7 @@ function ChartTooltip({
|
|
|
6957
7062
|
if (!active || !slice) return null;
|
|
6958
7063
|
return /* @__PURE__ */ jsxs50("div", { className: "rounded-v2-md border border-v2-border-default bg-v2-panel px-3 py-2 text-v2-xs shadow-lg", children: [
|
|
6959
7064
|
/* @__PURE__ */ jsxs50("div", { className: "flex items-center gap-2", children: [
|
|
6960
|
-
/* @__PURE__ */
|
|
7065
|
+
/* @__PURE__ */ jsx71(
|
|
6961
7066
|
"span",
|
|
6962
7067
|
{
|
|
6963
7068
|
className: "size-2 rounded-full",
|
|
@@ -6965,10 +7070,10 @@ function ChartTooltip({
|
|
|
6965
7070
|
"aria-hidden": "true"
|
|
6966
7071
|
}
|
|
6967
7072
|
),
|
|
6968
|
-
/* @__PURE__ */
|
|
7073
|
+
/* @__PURE__ */ jsx71("p", { className: "font-semibold text-v2-fg-default", children: slice.label })
|
|
6969
7074
|
] }),
|
|
6970
|
-
/* @__PURE__ */
|
|
6971
|
-
typeof slice.secondaryValue === "number" && /* @__PURE__ */
|
|
7075
|
+
/* @__PURE__ */ jsx71("p", { className: "mt-1 font-semibold text-v2-fg-default", children: valueFormatter(slice.value) }),
|
|
7076
|
+
typeof slice.secondaryValue === "number" && /* @__PURE__ */ jsx71("p", { className: "text-v2-fg-muted", children: secondaryFormatter(slice.secondaryValue) })
|
|
6972
7077
|
] });
|
|
6973
7078
|
}
|
|
6974
7079
|
var DonutChart = forwardRef51(
|
|
@@ -6990,7 +7095,7 @@ var DonutChart = forwardRef51(
|
|
|
6990
7095
|
const total = totalProp ?? data.reduce((acc, s) => acc + s.value, 0);
|
|
6991
7096
|
const slices = buildSlices(data, topN, othersLabel, defaultColors);
|
|
6992
7097
|
const isEmpty = data.length === 0 || total === 0;
|
|
6993
|
-
const [activeIdx, setActiveIdx] =
|
|
7098
|
+
const [activeIdx, setActiveIdx] = useState21(null);
|
|
6994
7099
|
return /* @__PURE__ */ jsxs50(
|
|
6995
7100
|
"div",
|
|
6996
7101
|
{
|
|
@@ -6998,8 +7103,8 @@ var DonutChart = forwardRef51(
|
|
|
6998
7103
|
className: cn("flex flex-col gap-3.5", className),
|
|
6999
7104
|
...props,
|
|
7000
7105
|
children: [
|
|
7001
|
-
/* @__PURE__ */
|
|
7002
|
-
isEmpty ? /* @__PURE__ */
|
|
7106
|
+
/* @__PURE__ */ jsx71("h3", { className: "text-v2-sm font-bold text-v2-fg-default", children: title }),
|
|
7107
|
+
isEmpty ? /* @__PURE__ */ jsx71("div", { className: "flex h-[160px] items-center justify-center text-v2-sm text-v2-fg-muted", children: emptyMessage }) : /* @__PURE__ */ jsxs50(
|
|
7003
7108
|
"div",
|
|
7004
7109
|
{
|
|
7005
7110
|
className: "flex items-center gap-4",
|
|
@@ -7007,8 +7112,8 @@ var DonutChart = forwardRef51(
|
|
|
7007
7112
|
"aria-label": typeof title === "string" ? title : "Donut chart",
|
|
7008
7113
|
children: [
|
|
7009
7114
|
/* @__PURE__ */ jsxs50("div", { className: "relative size-[160px] shrink-0", children: [
|
|
7010
|
-
/* @__PURE__ */
|
|
7011
|
-
/* @__PURE__ */
|
|
7115
|
+
/* @__PURE__ */ jsx71(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs50(PieChart, { children: [
|
|
7116
|
+
/* @__PURE__ */ jsx71(
|
|
7012
7117
|
Pie,
|
|
7013
7118
|
{
|
|
7014
7119
|
data: slices,
|
|
@@ -7021,7 +7126,7 @@ var DonutChart = forwardRef51(
|
|
|
7021
7126
|
strokeWidth: 2,
|
|
7022
7127
|
onMouseEnter: (_, idx) => setActiveIdx(idx),
|
|
7023
7128
|
onMouseLeave: () => setActiveIdx(null),
|
|
7024
|
-
children: slices.map((slice, idx) => /* @__PURE__ */
|
|
7129
|
+
children: slices.map((slice, idx) => /* @__PURE__ */ jsx71(
|
|
7025
7130
|
Cell,
|
|
7026
7131
|
{
|
|
7027
7132
|
fill: slice.color,
|
|
@@ -7032,12 +7137,12 @@ var DonutChart = forwardRef51(
|
|
|
7032
7137
|
))
|
|
7033
7138
|
}
|
|
7034
7139
|
),
|
|
7035
|
-
/* @__PURE__ */
|
|
7140
|
+
/* @__PURE__ */ jsx71(
|
|
7036
7141
|
Tooltip2,
|
|
7037
7142
|
{
|
|
7038
7143
|
allowEscapeViewBox: { x: false, y: true },
|
|
7039
|
-
position: { y: -
|
|
7040
|
-
content: /* @__PURE__ */
|
|
7144
|
+
position: { y: -56 },
|
|
7145
|
+
content: /* @__PURE__ */ jsx71(
|
|
7041
7146
|
ChartTooltip,
|
|
7042
7147
|
{
|
|
7043
7148
|
valueFormatter,
|
|
@@ -7048,11 +7153,11 @@ var DonutChart = forwardRef51(
|
|
|
7048
7153
|
)
|
|
7049
7154
|
] }) }),
|
|
7050
7155
|
/* @__PURE__ */ jsxs50("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
7051
|
-
/* @__PURE__ */
|
|
7052
|
-
/* @__PURE__ */
|
|
7156
|
+
/* @__PURE__ */ jsx71("span", { className: "text-v2-xl font-extrabold text-v2-fg-default", children: centerValue ?? valueFormatter(total) }),
|
|
7157
|
+
/* @__PURE__ */ jsx71("span", { className: "text-v2-xs text-v2-fg-muted", children: centerLabel })
|
|
7053
7158
|
] })
|
|
7054
7159
|
] }),
|
|
7055
|
-
/* @__PURE__ */
|
|
7160
|
+
/* @__PURE__ */ jsx71("ul", { className: "flex flex-1 flex-col gap-2", children: slices.map((slice, idx) => /* @__PURE__ */ jsxs50(
|
|
7056
7161
|
"li",
|
|
7057
7162
|
{
|
|
7058
7163
|
onMouseEnter: () => setActiveIdx(idx),
|
|
@@ -7062,7 +7167,7 @@ var DonutChart = forwardRef51(
|
|
|
7062
7167
|
activeIdx === idx && "bg-v2-bg-subtle"
|
|
7063
7168
|
),
|
|
7064
7169
|
children: [
|
|
7065
|
-
/* @__PURE__ */
|
|
7170
|
+
/* @__PURE__ */ jsx71(
|
|
7066
7171
|
"span",
|
|
7067
7172
|
{
|
|
7068
7173
|
"aria-hidden": "true",
|
|
@@ -7070,8 +7175,8 @@ var DonutChart = forwardRef51(
|
|
|
7070
7175
|
style: { backgroundColor: slice.color }
|
|
7071
7176
|
}
|
|
7072
7177
|
),
|
|
7073
|
-
/* @__PURE__ */
|
|
7074
|
-
/* @__PURE__ */
|
|
7178
|
+
/* @__PURE__ */ jsx71("span", { className: "flex-1 truncate", children: slice.label }),
|
|
7179
|
+
/* @__PURE__ */ jsx71("span", { className: "font-bold tabular-nums", children: valueFormatter(slice.value) })
|
|
7075
7180
|
]
|
|
7076
7181
|
},
|
|
7077
7182
|
slice.label
|
|
@@ -7088,16 +7193,16 @@ var DonutChart = forwardRef51(
|
|
|
7088
7193
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
7089
7194
|
import { forwardRef as forwardRef52 } from "react";
|
|
7090
7195
|
import { MagnifyingGlass as MagnifyingGlass4, Tray, WarningCircle as WarningCircle3 } from "@phosphor-icons/react";
|
|
7091
|
-
import { jsx as
|
|
7196
|
+
import { jsx as jsx72, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
7092
7197
|
var variantIconBg = {
|
|
7093
7198
|
"no-data": "bg-v2-bg-subtle text-v2-fg-muted",
|
|
7094
7199
|
"no-results": "bg-v2-info-soft text-v2-info-500",
|
|
7095
7200
|
error: "bg-v2-danger-soft text-v2-danger-500"
|
|
7096
7201
|
};
|
|
7097
7202
|
var variantIcon2 = {
|
|
7098
|
-
"no-data": /* @__PURE__ */
|
|
7099
|
-
"no-results": /* @__PURE__ */
|
|
7100
|
-
error: /* @__PURE__ */
|
|
7203
|
+
"no-data": /* @__PURE__ */ jsx72(Tray, { size: 28, "aria-hidden": "true" }),
|
|
7204
|
+
"no-results": /* @__PURE__ */ jsx72(MagnifyingGlass4, { size: 28, "aria-hidden": "true" }),
|
|
7205
|
+
error: /* @__PURE__ */ jsx72(WarningCircle3, { size: 28, "aria-hidden": "true" })
|
|
7101
7206
|
};
|
|
7102
7207
|
var EmptyState = forwardRef52(
|
|
7103
7208
|
({
|
|
@@ -7121,7 +7226,7 @@ var EmptyState = forwardRef52(
|
|
|
7121
7226
|
),
|
|
7122
7227
|
...props,
|
|
7123
7228
|
children: [
|
|
7124
|
-
/* @__PURE__ */
|
|
7229
|
+
/* @__PURE__ */ jsx72(
|
|
7125
7230
|
"span",
|
|
7126
7231
|
{
|
|
7127
7232
|
"aria-hidden": "true",
|
|
@@ -7132,9 +7237,9 @@ var EmptyState = forwardRef52(
|
|
|
7132
7237
|
children: icon ?? variantIcon2[variant]
|
|
7133
7238
|
}
|
|
7134
7239
|
),
|
|
7135
|
-
/* @__PURE__ */
|
|
7136
|
-
description && /* @__PURE__ */
|
|
7137
|
-
action && /* @__PURE__ */
|
|
7240
|
+
/* @__PURE__ */ jsx72("h3", { className: "text-v2-base font-semibold text-v2-fg-default", children: title }),
|
|
7241
|
+
description && /* @__PURE__ */ jsx72("p", { className: "max-w-md text-v2-sm text-v2-fg-muted", children: description }),
|
|
7242
|
+
action && /* @__PURE__ */ jsx72("div", { className: "mt-1 flex items-center gap-2", children: action })
|
|
7138
7243
|
]
|
|
7139
7244
|
}
|
|
7140
7245
|
);
|
|
@@ -7144,7 +7249,7 @@ EmptyState.displayName = "EmptyState";
|
|
|
7144
7249
|
|
|
7145
7250
|
// src/patterns/WizardShell/WizardShell.tsx
|
|
7146
7251
|
import { Check as Check6, WarningCircle as WarningCircle4, X as X9 } from "@phosphor-icons/react";
|
|
7147
|
-
import { Fragment as Fragment14, jsx as
|
|
7252
|
+
import { Fragment as Fragment14, jsx as jsx73, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
7148
7253
|
var stepIndicatorClass = {
|
|
7149
7254
|
completed: "bg-v2-success-500 text-v2-action-on-primary border-v2-success-500",
|
|
7150
7255
|
active: "bg-v2-action-primary text-v2-action-on-primary border-v2-action-primary",
|
|
@@ -7158,7 +7263,7 @@ function StepIndicator({
|
|
|
7158
7263
|
onStepChange
|
|
7159
7264
|
}) {
|
|
7160
7265
|
const inner = /* @__PURE__ */ jsxs52(Fragment14, { children: [
|
|
7161
|
-
/* @__PURE__ */
|
|
7266
|
+
/* @__PURE__ */ jsx73(
|
|
7162
7267
|
"span",
|
|
7163
7268
|
{
|
|
7164
7269
|
"data-state": step.state,
|
|
@@ -7167,7 +7272,7 @@ function StepIndicator({
|
|
|
7167
7272
|
"flex size-8 shrink-0 items-center justify-center rounded-v2-pill border-2 text-v2-sm font-semibold",
|
|
7168
7273
|
stepIndicatorClass[step.state]
|
|
7169
7274
|
),
|
|
7170
|
-
children: step.state === "completed" ? /* @__PURE__ */
|
|
7275
|
+
children: step.state === "completed" ? /* @__PURE__ */ jsx73(Check6, { size: 16, weight: "bold" }) : step.state === "blocked" ? /* @__PURE__ */ jsx73(X9, { size: 16, weight: "bold" }) : step.state === "error" ? /* @__PURE__ */ jsx73(WarningCircle4, { size: 16, weight: "bold" }) : index + 1
|
|
7171
7276
|
}
|
|
7172
7277
|
),
|
|
7173
7278
|
/* @__PURE__ */ jsxs52("div", { className: "flex flex-col", children: [
|
|
@@ -7187,11 +7292,11 @@ function StepIndicator({
|
|
|
7187
7292
|
]
|
|
7188
7293
|
}
|
|
7189
7294
|
),
|
|
7190
|
-
step.description && /* @__PURE__ */
|
|
7295
|
+
step.description && /* @__PURE__ */ jsx73(Text, { tag: "p", size: "xs", color: "muted", children: step.description })
|
|
7191
7296
|
] })
|
|
7192
7297
|
] });
|
|
7193
7298
|
if (onStepChange) {
|
|
7194
|
-
return /* @__PURE__ */
|
|
7299
|
+
return /* @__PURE__ */ jsx73(
|
|
7195
7300
|
"button",
|
|
7196
7301
|
{
|
|
7197
7302
|
type: "button",
|
|
@@ -7202,7 +7307,7 @@ function StepIndicator({
|
|
|
7202
7307
|
}
|
|
7203
7308
|
);
|
|
7204
7309
|
}
|
|
7205
|
-
return /* @__PURE__ */
|
|
7310
|
+
return /* @__PURE__ */ jsx73(
|
|
7206
7311
|
"div",
|
|
7207
7312
|
{
|
|
7208
7313
|
className: "flex items-center gap-2",
|
|
@@ -7231,9 +7336,9 @@ function WizardShell(props) {
|
|
|
7231
7336
|
),
|
|
7232
7337
|
children: [
|
|
7233
7338
|
/* @__PURE__ */ jsxs52("div", { className: "border-b border-v2-border-default p-5", children: [
|
|
7234
|
-
/* @__PURE__ */
|
|
7235
|
-
subtitle && /* @__PURE__ */
|
|
7236
|
-
/* @__PURE__ */
|
|
7339
|
+
/* @__PURE__ */ jsx73("h1", { className: "text-v2-lg font-extrabold tracking-tight text-v2-fg-default", children: title }),
|
|
7340
|
+
subtitle && /* @__PURE__ */ jsx73(Text, { tag: "p", size: "sm", color: "muted", className: "mt-0.5", children: subtitle }),
|
|
7341
|
+
/* @__PURE__ */ jsx73("ol", { className: "mt-4 flex items-start gap-2", "aria-label": "Passos", children: steps.map((step, idx) => /* @__PURE__ */ jsx73("li", { className: "flex-1", children: /* @__PURE__ */ jsx73(
|
|
7237
7342
|
StepIndicator,
|
|
7238
7343
|
{
|
|
7239
7344
|
step,
|
|
@@ -7250,12 +7355,12 @@ function WizardShell(props) {
|
|
|
7250
7355
|
aside ? "lg:grid-cols-[1fr_320px]" : "grid-cols-1"
|
|
7251
7356
|
),
|
|
7252
7357
|
children: [
|
|
7253
|
-
/* @__PURE__ */
|
|
7254
|
-
aside && /* @__PURE__ */
|
|
7358
|
+
/* @__PURE__ */ jsx73("div", { children }),
|
|
7359
|
+
aside && /* @__PURE__ */ jsx73("div", { className: "lg:sticky lg:top-4", children: aside })
|
|
7255
7360
|
]
|
|
7256
7361
|
}
|
|
7257
7362
|
),
|
|
7258
|
-
footer && /* @__PURE__ */
|
|
7363
|
+
footer && /* @__PURE__ */ jsx73("div", { className: "border-t border-v2-border-default bg-v2-bg-subtle p-4", children: footer })
|
|
7259
7364
|
]
|
|
7260
7365
|
}
|
|
7261
7366
|
);
|
|
@@ -7268,8 +7373,8 @@ import {
|
|
|
7268
7373
|
} from "react";
|
|
7269
7374
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
7270
7375
|
import { CaretDown as CaretDown8 } from "@phosphor-icons/react";
|
|
7271
|
-
import { jsx as
|
|
7272
|
-
var SingleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */
|
|
7376
|
+
import { jsx as jsx74, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
7377
|
+
var SingleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */ jsx74(
|
|
7273
7378
|
AccordionPrimitive.Root,
|
|
7274
7379
|
{
|
|
7275
7380
|
ref,
|
|
@@ -7278,7 +7383,7 @@ var SingleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
7278
7383
|
}
|
|
7279
7384
|
));
|
|
7280
7385
|
SingleRoot.displayName = "DSAccordion.Root";
|
|
7281
|
-
var MultipleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */
|
|
7386
|
+
var MultipleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */ jsx74(
|
|
7282
7387
|
AccordionPrimitive.Root,
|
|
7283
7388
|
{
|
|
7284
7389
|
ref,
|
|
@@ -7288,7 +7393,7 @@ var MultipleRoot = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
7288
7393
|
));
|
|
7289
7394
|
MultipleRoot.displayName = "DSAccordion.MultipleRoot";
|
|
7290
7395
|
var Root15 = AccordionPrimitive.Root;
|
|
7291
|
-
var Item7 = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */
|
|
7396
|
+
var Item7 = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */ jsx74(
|
|
7292
7397
|
AccordionPrimitive.Item,
|
|
7293
7398
|
{
|
|
7294
7399
|
ref,
|
|
@@ -7301,7 +7406,7 @@ var Item7 = forwardRef53(({ className, ...props }, ref) => /* @__PURE__ */ jsx73
|
|
|
7301
7406
|
));
|
|
7302
7407
|
Item7.displayName = "DSAccordion.Item";
|
|
7303
7408
|
var Trigger16 = forwardRef53(
|
|
7304
|
-
({ className, children, icon, meta, ...props }, ref) => /* @__PURE__ */
|
|
7409
|
+
({ className, children, icon, meta, ...props }, ref) => /* @__PURE__ */ jsx74(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs53(
|
|
7305
7410
|
AccordionPrimitive.Trigger,
|
|
7306
7411
|
{
|
|
7307
7412
|
ref,
|
|
@@ -7312,7 +7417,7 @@ var Trigger16 = forwardRef53(
|
|
|
7312
7417
|
...props,
|
|
7313
7418
|
children: [
|
|
7314
7419
|
/* @__PURE__ */ jsxs53("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
7315
|
-
icon && /* @__PURE__ */
|
|
7420
|
+
icon && /* @__PURE__ */ jsx74(
|
|
7316
7421
|
"span",
|
|
7317
7422
|
{
|
|
7318
7423
|
className: "shrink-0 text-v2-fg-muted",
|
|
@@ -7320,11 +7425,11 @@ var Trigger16 = forwardRef53(
|
|
|
7320
7425
|
children: icon
|
|
7321
7426
|
}
|
|
7322
7427
|
),
|
|
7323
|
-
/* @__PURE__ */
|
|
7428
|
+
/* @__PURE__ */ jsx74("span", { className: "truncate text-v2-base font-semibold text-v2-fg-default", children })
|
|
7324
7429
|
] }),
|
|
7325
7430
|
/* @__PURE__ */ jsxs53("span", { className: "flex shrink-0 items-center gap-3", children: [
|
|
7326
7431
|
meta,
|
|
7327
|
-
/* @__PURE__ */
|
|
7432
|
+
/* @__PURE__ */ jsx74(
|
|
7328
7433
|
CaretDown8,
|
|
7329
7434
|
{
|
|
7330
7435
|
size: 16,
|
|
@@ -7339,7 +7444,7 @@ var Trigger16 = forwardRef53(
|
|
|
7339
7444
|
) })
|
|
7340
7445
|
);
|
|
7341
7446
|
Trigger16.displayName = "DSAccordion.Trigger";
|
|
7342
|
-
var Content16 = forwardRef53(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
7447
|
+
var Content16 = forwardRef53(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx74(
|
|
7343
7448
|
AccordionPrimitive.Content,
|
|
7344
7449
|
{
|
|
7345
7450
|
ref,
|
|
@@ -7348,7 +7453,7 @@ var Content16 = forwardRef53(({ className, children, ...props }, ref) => /* @__P
|
|
|
7348
7453
|
className
|
|
7349
7454
|
),
|
|
7350
7455
|
...props,
|
|
7351
|
-
children: /* @__PURE__ */
|
|
7456
|
+
children: /* @__PURE__ */ jsx74("div", { className: "border-t border-v2-border-default p-5", children })
|
|
7352
7457
|
}
|
|
7353
7458
|
));
|
|
7354
7459
|
Content16.displayName = "DSAccordion.Content";
|
|
@@ -7359,7 +7464,7 @@ var DSAccordion = Object.assign(Root15, {
|
|
|
7359
7464
|
});
|
|
7360
7465
|
|
|
7361
7466
|
// src/patterns/DataField/DataField.tsx
|
|
7362
|
-
import { jsx as
|
|
7467
|
+
import { jsx as jsx75, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
7363
7468
|
function DataField({
|
|
7364
7469
|
label,
|
|
7365
7470
|
value,
|
|
@@ -7383,15 +7488,15 @@ function DataField({
|
|
|
7383
7488
|
]
|
|
7384
7489
|
}
|
|
7385
7490
|
),
|
|
7386
|
-
/* @__PURE__ */
|
|
7387
|
-
hint && /* @__PURE__ */
|
|
7491
|
+
/* @__PURE__ */ jsx75(Text, { size: "sm", weight: "semibold", children: value ?? "\u2014" }),
|
|
7492
|
+
hint && /* @__PURE__ */ jsx75(Text, { size: "xs", color: "subtle", children: hint })
|
|
7388
7493
|
] });
|
|
7389
7494
|
}
|
|
7390
7495
|
|
|
7391
7496
|
// src/patterns/FilterBarV2/FilterBarV2.tsx
|
|
7392
|
-
import { useEffect as
|
|
7497
|
+
import { useEffect as useEffect11, useState as useState22 } from "react";
|
|
7393
7498
|
import { CheckSquare, FunnelSimple, Square } from "@phosphor-icons/react";
|
|
7394
|
-
import { Fragment as Fragment15, jsx as
|
|
7499
|
+
import { Fragment as Fragment15, jsx as jsx76, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
7395
7500
|
function isStringValue(v) {
|
|
7396
7501
|
return typeof v === "string";
|
|
7397
7502
|
}
|
|
@@ -7418,7 +7523,7 @@ function MultiSelectField({
|
|
|
7418
7523
|
onChange
|
|
7419
7524
|
}) {
|
|
7420
7525
|
const selected = isStringArray(value) ? value : [];
|
|
7421
|
-
const [open, setOpen] =
|
|
7526
|
+
const [open, setOpen] = useState22(false);
|
|
7422
7527
|
const toggle = (optionValue) => {
|
|
7423
7528
|
if (selected.includes(optionValue)) {
|
|
7424
7529
|
onChange(selected.filter((v) => v !== optionValue));
|
|
@@ -7429,9 +7534,9 @@ function MultiSelectField({
|
|
|
7429
7534
|
const selectedLabels = field.options.filter((opt) => selected.includes(opt.value)).map((opt) => opt.label);
|
|
7430
7535
|
const triggerLabel = selectedLabels.length === 0 ? field.placeholder ?? "Selecione..." : selectedLabels.length === 1 ? selectedLabels[0] : `${selectedLabels.length} selecionados`;
|
|
7431
7536
|
return /* @__PURE__ */ jsxs55("div", { className: "relative w-full", children: [
|
|
7432
|
-
field.label && /* @__PURE__ */
|
|
7537
|
+
field.label && /* @__PURE__ */ jsx76(Label, { className: "absolute -top-2 left-3 z-10 bg-v2-raised px-1 text-v2-xs font-medium text-v2-fg-muted", children: field.label }),
|
|
7433
7538
|
/* @__PURE__ */ jsxs55(Popover, { open, onOpenChange: setOpen, children: [
|
|
7434
|
-
/* @__PURE__ */
|
|
7539
|
+
/* @__PURE__ */ jsx76(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs55(
|
|
7435
7540
|
"button",
|
|
7436
7541
|
{
|
|
7437
7542
|
type: "button",
|
|
@@ -7442,12 +7547,12 @@ function MultiSelectField({
|
|
|
7442
7547
|
selected.length === 0 && "text-v2-fg-muted"
|
|
7443
7548
|
),
|
|
7444
7549
|
children: [
|
|
7445
|
-
/* @__PURE__ */
|
|
7446
|
-
selected.length > 0 && /* @__PURE__ */
|
|
7550
|
+
/* @__PURE__ */ jsx76("span", { className: "truncate", children: triggerLabel }),
|
|
7551
|
+
selected.length > 0 && /* @__PURE__ */ jsx76(Badge, { variant: "info", size: "sm", children: selected.length })
|
|
7447
7552
|
]
|
|
7448
7553
|
}
|
|
7449
7554
|
) }),
|
|
7450
|
-
/* @__PURE__ */
|
|
7555
|
+
/* @__PURE__ */ jsx76(
|
|
7451
7556
|
Popover.Content,
|
|
7452
7557
|
{
|
|
7453
7558
|
size: "md",
|
|
@@ -7460,10 +7565,10 @@ function MultiSelectField({
|
|
|
7460
7565
|
"aria-multiselectable": "true",
|
|
7461
7566
|
className: "flex flex-col",
|
|
7462
7567
|
children: [
|
|
7463
|
-
field.options.length === 0 && /* @__PURE__ */
|
|
7568
|
+
field.options.length === 0 && /* @__PURE__ */ jsx76("li", { className: "px-3 py-2 text-v2-sm text-v2-fg-muted", children: "Nenhuma op\xE7\xE3o dispon\xEDvel" }),
|
|
7464
7569
|
field.options.map((option) => {
|
|
7465
7570
|
const checked = selected.includes(option.value);
|
|
7466
|
-
return /* @__PURE__ */
|
|
7571
|
+
return /* @__PURE__ */ jsx76("li", { children: /* @__PURE__ */ jsxs55(
|
|
7467
7572
|
"button",
|
|
7468
7573
|
{
|
|
7469
7574
|
type: "button",
|
|
@@ -7475,14 +7580,14 @@ function MultiSelectField({
|
|
|
7475
7580
|
"hover:bg-v2-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-v2-focus-ring/30"
|
|
7476
7581
|
),
|
|
7477
7582
|
children: [
|
|
7478
|
-
checked ? /* @__PURE__ */
|
|
7583
|
+
checked ? /* @__PURE__ */ jsx76(
|
|
7479
7584
|
CheckSquare,
|
|
7480
7585
|
{
|
|
7481
7586
|
size: 18,
|
|
7482
7587
|
weight: "fill",
|
|
7483
7588
|
className: "shrink-0 text-v2-action-primary"
|
|
7484
7589
|
}
|
|
7485
|
-
) : /* @__PURE__ */
|
|
7590
|
+
) : /* @__PURE__ */ jsx76(
|
|
7486
7591
|
Square,
|
|
7487
7592
|
{
|
|
7488
7593
|
size: 18,
|
|
@@ -7490,7 +7595,7 @@ function MultiSelectField({
|
|
|
7490
7595
|
className: "shrink-0 text-v2-fg-muted"
|
|
7491
7596
|
}
|
|
7492
7597
|
),
|
|
7493
|
-
/* @__PURE__ */
|
|
7598
|
+
/* @__PURE__ */ jsx76("span", { className: "truncate", children: option.label })
|
|
7494
7599
|
]
|
|
7495
7600
|
}
|
|
7496
7601
|
) }, option.value);
|
|
@@ -7509,7 +7614,7 @@ function DateRangeField({
|
|
|
7509
7614
|
onChange
|
|
7510
7615
|
}) {
|
|
7511
7616
|
const range = asDateRange(value);
|
|
7512
|
-
return /* @__PURE__ */
|
|
7617
|
+
return /* @__PURE__ */ jsx76(
|
|
7513
7618
|
DateRangeInput,
|
|
7514
7619
|
{
|
|
7515
7620
|
label: field.label,
|
|
@@ -7532,7 +7637,7 @@ function NumberRangeField({
|
|
|
7532
7637
|
const maxLabel = field.maxLabel ?? `${field.label} (menor ou igual)`;
|
|
7533
7638
|
if (field.format === "money") {
|
|
7534
7639
|
return /* @__PURE__ */ jsxs55(Fragment15, { children: [
|
|
7535
|
-
/* @__PURE__ */
|
|
7640
|
+
/* @__PURE__ */ jsx76(
|
|
7536
7641
|
MoneyInput,
|
|
7537
7642
|
{
|
|
7538
7643
|
label: minLabel,
|
|
@@ -7540,7 +7645,7 @@ function NumberRangeField({
|
|
|
7540
7645
|
onValueChange: (_f, raw) => setMin(raw)
|
|
7541
7646
|
}
|
|
7542
7647
|
),
|
|
7543
|
-
/* @__PURE__ */
|
|
7648
|
+
/* @__PURE__ */ jsx76(
|
|
7544
7649
|
MoneyInput,
|
|
7545
7650
|
{
|
|
7546
7651
|
label: maxLabel,
|
|
@@ -7552,7 +7657,7 @@ function NumberRangeField({
|
|
|
7552
7657
|
}
|
|
7553
7658
|
if (field.format === "percent") {
|
|
7554
7659
|
return /* @__PURE__ */ jsxs55(Fragment15, { children: [
|
|
7555
|
-
/* @__PURE__ */
|
|
7660
|
+
/* @__PURE__ */ jsx76(
|
|
7556
7661
|
PercentInput,
|
|
7557
7662
|
{
|
|
7558
7663
|
label: minLabel,
|
|
@@ -7560,7 +7665,7 @@ function NumberRangeField({
|
|
|
7560
7665
|
onValueChange: (_f, raw) => setMin(raw)
|
|
7561
7666
|
}
|
|
7562
7667
|
),
|
|
7563
|
-
/* @__PURE__ */
|
|
7668
|
+
/* @__PURE__ */ jsx76(
|
|
7564
7669
|
PercentInput,
|
|
7565
7670
|
{
|
|
7566
7671
|
label: maxLabel,
|
|
@@ -7571,7 +7676,7 @@ function NumberRangeField({
|
|
|
7571
7676
|
] });
|
|
7572
7677
|
}
|
|
7573
7678
|
return /* @__PURE__ */ jsxs55(Fragment15, { children: [
|
|
7574
|
-
/* @__PURE__ */
|
|
7679
|
+
/* @__PURE__ */ jsx76(
|
|
7575
7680
|
Input,
|
|
7576
7681
|
{
|
|
7577
7682
|
label: minLabel,
|
|
@@ -7580,7 +7685,7 @@ function NumberRangeField({
|
|
|
7580
7685
|
onChange: (e) => setMin(e.target.value)
|
|
7581
7686
|
}
|
|
7582
7687
|
),
|
|
7583
|
-
/* @__PURE__ */
|
|
7688
|
+
/* @__PURE__ */ jsx76(
|
|
7584
7689
|
Input,
|
|
7585
7690
|
{
|
|
7586
7691
|
label: maxLabel,
|
|
@@ -7593,7 +7698,7 @@ function NumberRangeField({
|
|
|
7593
7698
|
}
|
|
7594
7699
|
function renderField(field, value, onChange) {
|
|
7595
7700
|
if (field.type === "text") {
|
|
7596
|
-
return /* @__PURE__ */
|
|
7701
|
+
return /* @__PURE__ */ jsx76(
|
|
7597
7702
|
Input,
|
|
7598
7703
|
{
|
|
7599
7704
|
label: field.label,
|
|
@@ -7605,7 +7710,7 @@ function renderField(field, value, onChange) {
|
|
|
7605
7710
|
);
|
|
7606
7711
|
}
|
|
7607
7712
|
if (field.type === "mask") {
|
|
7608
|
-
return /* @__PURE__ */
|
|
7713
|
+
return /* @__PURE__ */ jsx76(
|
|
7609
7714
|
DocumentInput,
|
|
7610
7715
|
{
|
|
7611
7716
|
label: field.label,
|
|
@@ -7617,7 +7722,7 @@ function renderField(field, value, onChange) {
|
|
|
7617
7722
|
);
|
|
7618
7723
|
}
|
|
7619
7724
|
if (field.type === "select") {
|
|
7620
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ jsx76(
|
|
7621
7726
|
Combobox,
|
|
7622
7727
|
{
|
|
7623
7728
|
label: field.label,
|
|
@@ -7631,13 +7736,13 @@ function renderField(field, value, onChange) {
|
|
|
7631
7736
|
);
|
|
7632
7737
|
}
|
|
7633
7738
|
if (field.type === "multiSelect") {
|
|
7634
|
-
return /* @__PURE__ */
|
|
7739
|
+
return /* @__PURE__ */ jsx76(MultiSelectField, { field, value, onChange });
|
|
7635
7740
|
}
|
|
7636
7741
|
if (field.type === "dateRange") {
|
|
7637
|
-
return /* @__PURE__ */
|
|
7742
|
+
return /* @__PURE__ */ jsx76(DateRangeField, { field, value, onChange });
|
|
7638
7743
|
}
|
|
7639
7744
|
if (field.type === "numberRange") {
|
|
7640
|
-
return /* @__PURE__ */
|
|
7745
|
+
return /* @__PURE__ */ jsx76(NumberRangeField, { field, value, onChange });
|
|
7641
7746
|
}
|
|
7642
7747
|
return null;
|
|
7643
7748
|
}
|
|
@@ -7658,16 +7763,16 @@ function FilterBarV2({
|
|
|
7658
7763
|
onOpenChange
|
|
7659
7764
|
}) {
|
|
7660
7765
|
const isOpenControlled = controlledOpen !== void 0;
|
|
7661
|
-
const [internalOpen, setInternalOpen] =
|
|
7766
|
+
const [internalOpen, setInternalOpen] = useState22(defaultOpen);
|
|
7662
7767
|
const open = isOpenControlled ? controlledOpen : internalOpen;
|
|
7663
7768
|
const setOpen = (next) => {
|
|
7664
7769
|
if (!isOpenControlled) setInternalOpen(next);
|
|
7665
7770
|
onOpenChange == null ? void 0 : onOpenChange(next);
|
|
7666
7771
|
};
|
|
7667
|
-
const [draftValues, setDraftValues] =
|
|
7772
|
+
const [draftValues, setDraftValues] = useState22(
|
|
7668
7773
|
controlledValues ?? defaultValues ?? {}
|
|
7669
7774
|
);
|
|
7670
|
-
|
|
7775
|
+
useEffect11(() => {
|
|
7671
7776
|
if (open) {
|
|
7672
7777
|
setDraftValues(controlledValues ?? defaultValues ?? {});
|
|
7673
7778
|
}
|
|
@@ -7687,7 +7792,7 @@ function FilterBarV2({
|
|
|
7687
7792
|
};
|
|
7688
7793
|
const triggerLabel = activeCount > 0 ? `Filtros (${activeCount})` : title ?? "Filtros avan\xE7ados";
|
|
7689
7794
|
return /* @__PURE__ */ jsxs55(DrawerRoot, { open, onOpenChange: setOpen, children: [
|
|
7690
|
-
!hideTrigger && /* @__PURE__ */
|
|
7795
|
+
!hideTrigger && /* @__PURE__ */ jsx76(DrawerRoot.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs55(
|
|
7691
7796
|
"button",
|
|
7692
7797
|
{
|
|
7693
7798
|
type: "button",
|
|
@@ -7698,17 +7803,17 @@ function FilterBarV2({
|
|
|
7698
7803
|
),
|
|
7699
7804
|
children: [
|
|
7700
7805
|
/* @__PURE__ */ jsxs55("span", { className: "inline-flex items-center gap-2", children: [
|
|
7701
|
-
/* @__PURE__ */
|
|
7806
|
+
/* @__PURE__ */ jsx76(FunnelSimple, { size: 18, weight: "bold", "aria-hidden": "true" }),
|
|
7702
7807
|
triggerLabel
|
|
7703
7808
|
] }),
|
|
7704
|
-
activeCount > 0 ? /* @__PURE__ */
|
|
7809
|
+
activeCount > 0 ? /* @__PURE__ */ jsx76(Badge, { variant: "info", size: "sm", children: activeCount }) : null
|
|
7705
7810
|
]
|
|
7706
7811
|
}
|
|
7707
7812
|
) }),
|
|
7708
7813
|
/* @__PURE__ */ jsxs55(DrawerRoot.Content, { side: "right", size: "md", children: [
|
|
7709
7814
|
/* @__PURE__ */ jsxs55(DrawerRoot.Header, { children: [
|
|
7710
|
-
/* @__PURE__ */
|
|
7711
|
-
/* @__PURE__ */
|
|
7815
|
+
/* @__PURE__ */ jsx76(DrawerRoot.Title, { children: title ?? "Filtros avan\xE7ados" }),
|
|
7816
|
+
/* @__PURE__ */ jsx76(DrawerRoot.Description, { children: activeCount > 0 ? `${activeCount} ${activeCount === 1 ? "filtro aplicado" : "filtros aplicados"}` : "Refine sua busca por campos espec\xEDficos." })
|
|
7712
7817
|
] }),
|
|
7713
7818
|
/* @__PURE__ */ jsxs55(
|
|
7714
7819
|
"form",
|
|
@@ -7716,7 +7821,7 @@ function FilterBarV2({
|
|
|
7716
7821
|
onSubmit: handleApply,
|
|
7717
7822
|
className: "flex flex-1 flex-col overflow-hidden",
|
|
7718
7823
|
children: [
|
|
7719
|
-
/* @__PURE__ */
|
|
7824
|
+
/* @__PURE__ */ jsx76(DrawerRoot.Body, { className: "flex flex-col gap-4", children: fields.map((field) => /* @__PURE__ */ jsx76(
|
|
7720
7825
|
"div",
|
|
7721
7826
|
{
|
|
7722
7827
|
className: cn(
|
|
@@ -7732,7 +7837,7 @@ function FilterBarV2({
|
|
|
7732
7837
|
field.name
|
|
7733
7838
|
)) }),
|
|
7734
7839
|
/* @__PURE__ */ jsxs55(DrawerRoot.Footer, { className: "sm:justify-between", children: [
|
|
7735
|
-
activeCount > 0 ? /* @__PURE__ */
|
|
7840
|
+
activeCount > 0 ? /* @__PURE__ */ jsx76(Button, { type: "button", variant: "secondary", onClick: handleClear, children: clearLabel }) : /* @__PURE__ */ jsx76(
|
|
7736
7841
|
Button,
|
|
7737
7842
|
{
|
|
7738
7843
|
type: "button",
|
|
@@ -7741,7 +7846,7 @@ function FilterBarV2({
|
|
|
7741
7846
|
children: "Cancelar"
|
|
7742
7847
|
}
|
|
7743
7848
|
),
|
|
7744
|
-
/* @__PURE__ */
|
|
7849
|
+
/* @__PURE__ */ jsx76(Button, { type: "submit", children: applyLabel })
|
|
7745
7850
|
] })
|
|
7746
7851
|
]
|
|
7747
7852
|
}
|
|
@@ -7751,7 +7856,7 @@ function FilterBarV2({
|
|
|
7751
7856
|
}
|
|
7752
7857
|
|
|
7753
7858
|
// src/patterns/FormSection/FormSection.tsx
|
|
7754
|
-
import { jsx as
|
|
7859
|
+
import { jsx as jsx77, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
7755
7860
|
function FormSection({
|
|
7756
7861
|
id,
|
|
7757
7862
|
icon,
|
|
@@ -7769,7 +7874,7 @@ function FormSection({
|
|
|
7769
7874
|
className: "scroll-mt-4 rounded-v2-lg border border-v2-border-default bg-v2-panel p-5 shadow-sm",
|
|
7770
7875
|
children: [
|
|
7771
7876
|
/* @__PURE__ */ jsxs56("header", { className: "mb-5 flex items-start gap-3", children: [
|
|
7772
|
-
/* @__PURE__ */
|
|
7877
|
+
/* @__PURE__ */ jsx77(
|
|
7773
7878
|
"span",
|
|
7774
7879
|
{
|
|
7775
7880
|
"aria-hidden": "true",
|
|
@@ -7778,10 +7883,10 @@ function FormSection({
|
|
|
7778
7883
|
}
|
|
7779
7884
|
),
|
|
7780
7885
|
/* @__PURE__ */ jsxs56("div", { className: "flex flex-1 flex-col", children: [
|
|
7781
|
-
/* @__PURE__ */
|
|
7782
|
-
/* @__PURE__ */
|
|
7886
|
+
/* @__PURE__ */ jsx77("h2", { className: "text-v2-base font-bold text-v2-fg-default", children: title }),
|
|
7887
|
+
/* @__PURE__ */ jsx77("p", { className: "text-v2-sm text-v2-fg-muted", children: description })
|
|
7783
7888
|
] }),
|
|
7784
|
-
meta && /* @__PURE__ */
|
|
7889
|
+
meta && /* @__PURE__ */ jsx77("div", { className: "shrink-0", children: meta })
|
|
7785
7890
|
] }),
|
|
7786
7891
|
children
|
|
7787
7892
|
]
|
|
@@ -7790,14 +7895,14 @@ function FormSection({
|
|
|
7790
7895
|
}
|
|
7791
7896
|
|
|
7792
7897
|
// src/patterns/FormWithAside/FormWithAside.tsx
|
|
7793
|
-
import { useState as
|
|
7898
|
+
import { useState as useState23 } from "react";
|
|
7794
7899
|
import {
|
|
7795
7900
|
CaretDoubleLeft as CaretDoubleLeft2,
|
|
7796
7901
|
CaretDoubleRight as CaretDoubleRight2,
|
|
7797
7902
|
CheckCircle as CheckCircle2,
|
|
7798
7903
|
Circle
|
|
7799
7904
|
} from "@phosphor-icons/react";
|
|
7800
|
-
import { Fragment as Fragment16, jsx as
|
|
7905
|
+
import { Fragment as Fragment16, jsx as jsx78, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
7801
7906
|
function ProgressRing({
|
|
7802
7907
|
percent,
|
|
7803
7908
|
size = 36
|
|
@@ -7816,7 +7921,7 @@ function ProgressRing({
|
|
|
7816
7921
|
"aria-hidden": "true",
|
|
7817
7922
|
className: "shrink-0",
|
|
7818
7923
|
children: [
|
|
7819
|
-
/* @__PURE__ */
|
|
7924
|
+
/* @__PURE__ */ jsx78(
|
|
7820
7925
|
"circle",
|
|
7821
7926
|
{
|
|
7822
7927
|
cx: size / 2,
|
|
@@ -7827,7 +7932,7 @@ function ProgressRing({
|
|
|
7827
7932
|
fill: "none"
|
|
7828
7933
|
}
|
|
7829
7934
|
),
|
|
7830
|
-
/* @__PURE__ */
|
|
7935
|
+
/* @__PURE__ */ jsx78(
|
|
7831
7936
|
"circle",
|
|
7832
7937
|
{
|
|
7833
7938
|
cx: size / 2,
|
|
@@ -7872,12 +7977,12 @@ function FormWithAside({
|
|
|
7872
7977
|
overallPercent,
|
|
7873
7978
|
asideExtra
|
|
7874
7979
|
}) {
|
|
7875
|
-
const [collapsed, setCollapsed] =
|
|
7980
|
+
const [collapsed, setCollapsed] = useState23(false);
|
|
7876
7981
|
const computedOverall = overallPercent ?? (sections.length > 0 ? Math.round(
|
|
7877
7982
|
sections.reduce((sum, s) => sum + (s.percent ?? 0), 0) / sections.length
|
|
7878
7983
|
) : 0);
|
|
7879
7984
|
return /* @__PURE__ */ jsxs57("div", { className: "flex flex-col gap-4 lg:flex-row", children: [
|
|
7880
|
-
/* @__PURE__ */
|
|
7985
|
+
/* @__PURE__ */ jsx78("div", { className: "min-w-0 flex-1", children }),
|
|
7881
7986
|
/* @__PURE__ */ jsxs57(
|
|
7882
7987
|
"aside",
|
|
7883
7988
|
{
|
|
@@ -7895,8 +8000,8 @@ function FormWithAside({
|
|
|
7895
8000
|
collapsed ? "justify-center" : "justify-between"
|
|
7896
8001
|
),
|
|
7897
8002
|
children: [
|
|
7898
|
-
!collapsed && /* @__PURE__ */
|
|
7899
|
-
/* @__PURE__ */
|
|
8003
|
+
!collapsed && /* @__PURE__ */ jsx78("h2", { className: "text-v2-xs font-bold uppercase tracking-wide text-v2-fg-muted", children: title }),
|
|
8004
|
+
/* @__PURE__ */ jsx78(
|
|
7900
8005
|
"button",
|
|
7901
8006
|
{
|
|
7902
8007
|
type: "button",
|
|
@@ -7905,17 +8010,17 @@ function FormWithAside({
|
|
|
7905
8010
|
"aria-label": collapsed ? "Expandir resumo" : "Recolher resumo",
|
|
7906
8011
|
title: collapsed ? "Expandir resumo" : "Recolher resumo",
|
|
7907
8012
|
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-v2-md text-v2-fg-muted transition-colors hover:bg-v2-raised hover:text-v2-fg-default focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-v2-border-strong",
|
|
7908
|
-
children: collapsed ? /* @__PURE__ */
|
|
8013
|
+
children: collapsed ? /* @__PURE__ */ jsx78(CaretDoubleLeft2, { size: 14, weight: "bold", "aria-hidden": "true" }) : /* @__PURE__ */ jsx78(CaretDoubleRight2, { size: 14, weight: "bold", "aria-hidden": "true" })
|
|
7909
8014
|
}
|
|
7910
8015
|
)
|
|
7911
8016
|
]
|
|
7912
8017
|
}
|
|
7913
8018
|
),
|
|
7914
8019
|
collapsed ? /* @__PURE__ */ jsxs57("div", { className: "flex flex-col items-center gap-3", children: [
|
|
7915
|
-
/* @__PURE__ */
|
|
8020
|
+
/* @__PURE__ */ jsx78(ProgressRing, { percent: computedOverall, size: 36 }),
|
|
7916
8021
|
sections.map((s) => {
|
|
7917
8022
|
const done = (s.percent ?? 0) >= 100;
|
|
7918
|
-
return /* @__PURE__ */
|
|
8023
|
+
return /* @__PURE__ */ jsx78(
|
|
7919
8024
|
"button",
|
|
7920
8025
|
{
|
|
7921
8026
|
type: "button",
|
|
@@ -7932,9 +8037,9 @@ function FormWithAside({
|
|
|
7932
8037
|
})
|
|
7933
8038
|
] }) : /* @__PURE__ */ jsxs57(Fragment16, { children: [
|
|
7934
8039
|
/* @__PURE__ */ jsxs57("div", { className: "flex items-center gap-3 rounded-v2-md bg-v2-raised px-3 py-2", children: [
|
|
7935
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ jsx78(ProgressRing, { percent: computedOverall, size: 40 }),
|
|
7936
8041
|
/* @__PURE__ */ jsxs57("div", { className: "flex min-w-0 flex-col", children: [
|
|
7937
|
-
/* @__PURE__ */
|
|
8042
|
+
/* @__PURE__ */ jsx78("span", { className: "text-v2-xs font-semibold text-v2-fg-default", children: "Progresso geral" }),
|
|
7938
8043
|
/* @__PURE__ */ jsxs57("span", { className: "text-v2-xs text-v2-fg-muted", children: [
|
|
7939
8044
|
sections.filter((s) => (s.percent ?? 0) >= 100).length,
|
|
7940
8045
|
" de",
|
|
@@ -7944,37 +8049,37 @@ function FormWithAside({
|
|
|
7944
8049
|
] })
|
|
7945
8050
|
] })
|
|
7946
8051
|
] }),
|
|
7947
|
-
/* @__PURE__ */
|
|
8052
|
+
/* @__PURE__ */ jsx78("nav", { "aria-label": "Navega\xE7\xE3o por se\xE7\xF5es", children: /* @__PURE__ */ jsx78("ul", { className: "flex flex-col gap-0.5", children: sections.map((s) => {
|
|
7948
8053
|
const done = (s.percent ?? 0) >= 100;
|
|
7949
|
-
return /* @__PURE__ */
|
|
8054
|
+
return /* @__PURE__ */ jsx78("li", { children: /* @__PURE__ */ jsxs57(
|
|
7950
8055
|
"button",
|
|
7951
8056
|
{
|
|
7952
8057
|
type: "button",
|
|
7953
8058
|
onClick: () => scrollToId(s.id),
|
|
7954
8059
|
className: "group flex w-full items-start gap-2 rounded-v2-md p-2 text-left transition-colors hover:bg-v2-raised focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-v2-border-strong",
|
|
7955
8060
|
children: [
|
|
7956
|
-
/* @__PURE__ */
|
|
8061
|
+
/* @__PURE__ */ jsx78("span", { "aria-hidden": "true", className: "mt-0.5 shrink-0", children: done ? /* @__PURE__ */ jsx78(
|
|
7957
8062
|
CheckCircle2,
|
|
7958
8063
|
{
|
|
7959
8064
|
size: 14,
|
|
7960
8065
|
weight: "fill",
|
|
7961
8066
|
className: "text-v2-success-500"
|
|
7962
8067
|
}
|
|
7963
|
-
) : /* @__PURE__ */
|
|
8068
|
+
) : /* @__PURE__ */ jsx78(Circle, { size: 14, className: "text-v2-fg-muted" }) }),
|
|
7964
8069
|
/* @__PURE__ */ jsxs57("span", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
7965
8070
|
/* @__PURE__ */ jsxs57("span", { className: "flex items-center justify-between gap-2", children: [
|
|
7966
|
-
/* @__PURE__ */
|
|
8071
|
+
/* @__PURE__ */ jsx78("span", { className: "truncate text-v2-sm font-medium text-v2-fg-default", children: s.label }),
|
|
7967
8072
|
typeof s.percent === "number" && /* @__PURE__ */ jsxs57("span", { className: "shrink-0 text-v2-xs font-semibold tabular-nums text-v2-fg-muted", children: [
|
|
7968
8073
|
s.percent,
|
|
7969
8074
|
"%"
|
|
7970
8075
|
] })
|
|
7971
8076
|
] }),
|
|
7972
|
-
typeof s.percent === "number" && /* @__PURE__ */
|
|
8077
|
+
typeof s.percent === "number" && /* @__PURE__ */ jsx78(
|
|
7973
8078
|
"span",
|
|
7974
8079
|
{
|
|
7975
8080
|
"aria-hidden": "true",
|
|
7976
8081
|
className: "block h-1 overflow-hidden rounded-v2-pill bg-v2-bg-subtle",
|
|
7977
|
-
children: /* @__PURE__ */
|
|
8082
|
+
children: /* @__PURE__ */ jsx78(
|
|
7978
8083
|
"span",
|
|
7979
8084
|
{
|
|
7980
8085
|
className: "block h-full bg-v2-action-primary transition-all",
|
|
@@ -7993,7 +8098,7 @@ function FormWithAside({
|
|
|
7993
8098
|
}
|
|
7994
8099
|
) }, s.id);
|
|
7995
8100
|
}) }) }),
|
|
7996
|
-
asideExtra && /* @__PURE__ */
|
|
8101
|
+
asideExtra && /* @__PURE__ */ jsx78("div", { className: "border-t border-v2-border-default pt-3", children: asideExtra })
|
|
7997
8102
|
] })
|
|
7998
8103
|
]
|
|
7999
8104
|
}
|
|
@@ -8002,7 +8107,7 @@ function FormWithAside({
|
|
|
8002
8107
|
}
|
|
8003
8108
|
|
|
8004
8109
|
// src/patterns/HorizontalBarChart/HorizontalBarChart.tsx
|
|
8005
|
-
import { jsx as
|
|
8110
|
+
import { jsx as jsx79, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
8006
8111
|
var PALETTE = [
|
|
8007
8112
|
"var(--v2-chart-cat-1)",
|
|
8008
8113
|
"var(--v2-chart-cat-2)",
|
|
@@ -8021,7 +8126,7 @@ function HorizontalBarChart({
|
|
|
8021
8126
|
showSecondary = false
|
|
8022
8127
|
}) {
|
|
8023
8128
|
const max = Math.max(1, ...items.map((i) => i.value));
|
|
8024
|
-
return /* @__PURE__ */
|
|
8129
|
+
return /* @__PURE__ */ jsx79(
|
|
8025
8130
|
"div",
|
|
8026
8131
|
{
|
|
8027
8132
|
role: "img",
|
|
@@ -8038,13 +8143,13 @@ function HorizontalBarChart({
|
|
|
8038
8143
|
title: hasSecondary ? `${item.label}: ${valueFormatter(item.value)} \xB7 ${secondaryFormatter(item.secondaryValue ?? 0)}` : `${item.label}: ${valueFormatter(item.value)}`,
|
|
8039
8144
|
children: [
|
|
8040
8145
|
/* @__PURE__ */ jsxs58("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
8041
|
-
/* @__PURE__ */
|
|
8146
|
+
/* @__PURE__ */ jsx79("span", { className: "truncate text-v2-xs font-semibold text-v2-fg-muted", children: item.label }),
|
|
8042
8147
|
/* @__PURE__ */ jsxs58("span", { className: "flex items-baseline gap-2", children: [
|
|
8043
|
-
/* @__PURE__ */
|
|
8044
|
-
hasSecondary && /* @__PURE__ */
|
|
8148
|
+
/* @__PURE__ */ jsx79("span", { className: "font-bold text-v2-fg-default", children: valueFormatter(item.value) }),
|
|
8149
|
+
hasSecondary && /* @__PURE__ */ jsx79("span", { className: "text-v2-xs text-v2-fg-subtle", children: item.secondaryLabel ? `${item.secondaryLabel} ${secondaryFormatter(item.secondaryValue ?? 0)}` : secondaryFormatter(item.secondaryValue ?? 0) })
|
|
8045
8150
|
] })
|
|
8046
8151
|
] }),
|
|
8047
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ jsx79("div", { className: "h-2.5 w-full overflow-hidden rounded-v2-pill bg-v2-bg-subtle", children: /* @__PURE__ */ jsx79(
|
|
8048
8153
|
"div",
|
|
8049
8154
|
{
|
|
8050
8155
|
className: "h-full rounded-v2-pill transition-all duration-300 group-hover:brightness-110",
|
|
@@ -8077,7 +8182,7 @@ import {
|
|
|
8077
8182
|
XAxis,
|
|
8078
8183
|
YAxis
|
|
8079
8184
|
} from "recharts";
|
|
8080
|
-
import { jsx as
|
|
8185
|
+
import { jsx as jsx80, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
8081
8186
|
function toRows(labels, series) {
|
|
8082
8187
|
return labels.map((label, i) => {
|
|
8083
8188
|
const row = { x: label };
|
|
@@ -8099,9 +8204,9 @@ function ChartTooltip2({
|
|
|
8099
8204
|
}) {
|
|
8100
8205
|
if (!active || !(payload == null ? void 0 : payload.length)) return null;
|
|
8101
8206
|
return /* @__PURE__ */ jsxs59("div", { className: "rounded-v2-md border border-v2-border-default bg-v2-panel px-3 py-2 text-v2-xs shadow-lg", children: [
|
|
8102
|
-
/* @__PURE__ */
|
|
8103
|
-
/* @__PURE__ */
|
|
8104
|
-
/* @__PURE__ */
|
|
8207
|
+
/* @__PURE__ */ jsx80("p", { className: "font-semibold text-v2-fg-default", children: formatLabel(label ?? "") }),
|
|
8208
|
+
/* @__PURE__ */ jsx80("div", { className: "mt-1 flex flex-col gap-0.5", children: payload.map((p) => /* @__PURE__ */ jsxs59("div", { className: "flex items-center gap-2", children: [
|
|
8209
|
+
/* @__PURE__ */ jsx80(
|
|
8105
8210
|
"span",
|
|
8106
8211
|
{
|
|
8107
8212
|
className: "size-2 rounded-full",
|
|
@@ -8113,7 +8218,7 @@ function ChartTooltip2({
|
|
|
8113
8218
|
p.name,
|
|
8114
8219
|
":"
|
|
8115
8220
|
] }),
|
|
8116
|
-
/* @__PURE__ */
|
|
8221
|
+
/* @__PURE__ */ jsx80("span", { className: "font-semibold text-v2-fg-default", children: formatValue(typeof p.value === "number" ? p.value : 0) })
|
|
8117
8222
|
] }, p.name)) })
|
|
8118
8223
|
] });
|
|
8119
8224
|
}
|
|
@@ -8129,15 +8234,15 @@ function LineChart({
|
|
|
8129
8234
|
}) {
|
|
8130
8235
|
const rows = toRows(labels, series);
|
|
8131
8236
|
const Chart = variant === "area" ? RechartsAreaChart : RechartsLineChart;
|
|
8132
|
-
return /* @__PURE__ */
|
|
8237
|
+
return /* @__PURE__ */ jsx80(
|
|
8133
8238
|
"div",
|
|
8134
8239
|
{
|
|
8135
8240
|
role: "img",
|
|
8136
8241
|
"aria-label": ariaLabel,
|
|
8137
8242
|
className: cn("w-full", className),
|
|
8138
8243
|
style: { height },
|
|
8139
|
-
children: /* @__PURE__ */
|
|
8140
|
-
/* @__PURE__ */
|
|
8244
|
+
children: /* @__PURE__ */ jsx80(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs59(Chart, { data: rows, margin: { top: 8, right: 12, left: 0, bottom: 0 }, children: [
|
|
8245
|
+
/* @__PURE__ */ jsx80("defs", { children: series.map((s, i) => /* @__PURE__ */ jsxs59(
|
|
8141
8246
|
"linearGradient",
|
|
8142
8247
|
{
|
|
8143
8248
|
id: `v2-line-grad-${i}`,
|
|
@@ -8146,13 +8251,13 @@ function LineChart({
|
|
|
8146
8251
|
x2: "0",
|
|
8147
8252
|
y2: "1",
|
|
8148
8253
|
children: [
|
|
8149
|
-
/* @__PURE__ */
|
|
8150
|
-
/* @__PURE__ */
|
|
8254
|
+
/* @__PURE__ */ jsx80("stop", { offset: "0%", stopColor: s.color, stopOpacity: 0.35 }),
|
|
8255
|
+
/* @__PURE__ */ jsx80("stop", { offset: "95%", stopColor: s.color, stopOpacity: 0 })
|
|
8151
8256
|
]
|
|
8152
8257
|
},
|
|
8153
8258
|
`grad-${s.name}-${i}`
|
|
8154
8259
|
)) }),
|
|
8155
|
-
/* @__PURE__ */
|
|
8260
|
+
/* @__PURE__ */ jsx80(
|
|
8156
8261
|
CartesianGrid,
|
|
8157
8262
|
{
|
|
8158
8263
|
strokeDasharray: "3 4",
|
|
@@ -8160,7 +8265,7 @@ function LineChart({
|
|
|
8160
8265
|
vertical: false
|
|
8161
8266
|
}
|
|
8162
8267
|
),
|
|
8163
|
-
/* @__PURE__ */
|
|
8268
|
+
/* @__PURE__ */ jsx80(
|
|
8164
8269
|
XAxis,
|
|
8165
8270
|
{
|
|
8166
8271
|
dataKey: "x",
|
|
@@ -8169,7 +8274,7 @@ function LineChart({
|
|
|
8169
8274
|
axisLine: { stroke: "var(--v2-border-default)" }
|
|
8170
8275
|
}
|
|
8171
8276
|
),
|
|
8172
|
-
/* @__PURE__ */
|
|
8277
|
+
/* @__PURE__ */ jsx80(
|
|
8173
8278
|
YAxis,
|
|
8174
8279
|
{
|
|
8175
8280
|
tick: { fill: "var(--v2-fg-subtle)", fontSize: 11 },
|
|
@@ -8179,14 +8284,14 @@ function LineChart({
|
|
|
8179
8284
|
width: 70
|
|
8180
8285
|
}
|
|
8181
8286
|
),
|
|
8182
|
-
/* @__PURE__ */
|
|
8287
|
+
/* @__PURE__ */ jsx80(
|
|
8183
8288
|
Tooltip3,
|
|
8184
8289
|
{
|
|
8185
8290
|
cursor: {
|
|
8186
8291
|
stroke: "var(--v2-border-default)",
|
|
8187
8292
|
strokeDasharray: "3 4"
|
|
8188
8293
|
},
|
|
8189
|
-
content: /* @__PURE__ */
|
|
8294
|
+
content: /* @__PURE__ */ jsx80(
|
|
8190
8295
|
ChartTooltip2,
|
|
8191
8296
|
{
|
|
8192
8297
|
formatValue,
|
|
@@ -8195,7 +8300,7 @@ function LineChart({
|
|
|
8195
8300
|
)
|
|
8196
8301
|
}
|
|
8197
8302
|
),
|
|
8198
|
-
/* @__PURE__ */
|
|
8303
|
+
/* @__PURE__ */ jsx80(
|
|
8199
8304
|
Legend,
|
|
8200
8305
|
{
|
|
8201
8306
|
verticalAlign: "top",
|
|
@@ -8205,7 +8310,7 @@ function LineChart({
|
|
|
8205
8310
|
}
|
|
8206
8311
|
),
|
|
8207
8312
|
series.map(
|
|
8208
|
-
(s, i) => variant === "area" ? /* @__PURE__ */
|
|
8313
|
+
(s, i) => variant === "area" ? /* @__PURE__ */ jsx80(
|
|
8209
8314
|
Area,
|
|
8210
8315
|
{
|
|
8211
8316
|
type: "monotone",
|
|
@@ -8220,7 +8325,7 @@ function LineChart({
|
|
|
8220
8325
|
}
|
|
8221
8326
|
},
|
|
8222
8327
|
s.name
|
|
8223
|
-
) : /* @__PURE__ */
|
|
8328
|
+
) : /* @__PURE__ */ jsx80(
|
|
8224
8329
|
Line,
|
|
8225
8330
|
{
|
|
8226
8331
|
type: "monotone",
|
|
@@ -8244,7 +8349,7 @@ function LineChart({
|
|
|
8244
8349
|
|
|
8245
8350
|
// src/patterns/PanelCard/PanelCard.tsx
|
|
8246
8351
|
import { forwardRef as forwardRef54 } from "react";
|
|
8247
|
-
import { jsx as
|
|
8352
|
+
import { jsx as jsx81, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
8248
8353
|
var PanelCard = forwardRef54(
|
|
8249
8354
|
({
|
|
8250
8355
|
icon,
|
|
@@ -8284,18 +8389,18 @@ var PanelCard = forwardRef54(
|
|
|
8284
8389
|
),
|
|
8285
8390
|
children: [
|
|
8286
8391
|
/* @__PURE__ */ jsxs60("div", { className: "flex min-w-0 items-start gap-3", children: [
|
|
8287
|
-
icon && /* @__PURE__ */
|
|
8392
|
+
icon && /* @__PURE__ */ jsx81("span", { className: "inline-flex size-9 shrink-0 items-center justify-center rounded-v2-md bg-v2-brand-bg-soft text-v2-brand-text-dark", children: icon }),
|
|
8288
8393
|
(title || subtitle) && /* @__PURE__ */ jsxs60("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
8289
|
-
title && /* @__PURE__ */
|
|
8290
|
-
subtitle && /* @__PURE__ */
|
|
8394
|
+
title && /* @__PURE__ */ jsx81("h2", { className: "m-0 text-v2-base font-semibold text-v2-fg-default", children: title }),
|
|
8395
|
+
subtitle && /* @__PURE__ */ jsx81("p", { className: "m-0 text-v2-sm text-v2-fg-muted", children: subtitle })
|
|
8291
8396
|
] })
|
|
8292
8397
|
] }),
|
|
8293
|
-
actions && /* @__PURE__ */
|
|
8398
|
+
actions && /* @__PURE__ */ jsx81("div", { className: "flex shrink-0 items-center gap-2", children: actions })
|
|
8294
8399
|
]
|
|
8295
8400
|
}
|
|
8296
8401
|
),
|
|
8297
|
-
children !== void 0 && /* @__PURE__ */
|
|
8298
|
-
footer && /* @__PURE__ */
|
|
8402
|
+
children !== void 0 && /* @__PURE__ */ jsx81("div", { className: cn(padding, bodyClassName), children }),
|
|
8403
|
+
footer && /* @__PURE__ */ jsx81(
|
|
8299
8404
|
"footer",
|
|
8300
8405
|
{
|
|
8301
8406
|
className: cn(
|
|
@@ -8314,7 +8419,7 @@ PanelCard.displayName = "PanelCard";
|
|
|
8314
8419
|
|
|
8315
8420
|
// src/patterns/SectionCard/SectionCard.tsx
|
|
8316
8421
|
import { WarningCircle as WarningCircle5 } from "@phosphor-icons/react";
|
|
8317
|
-
import { jsx as
|
|
8422
|
+
import { jsx as jsx82, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
8318
8423
|
function SectionCard({
|
|
8319
8424
|
title,
|
|
8320
8425
|
icon,
|
|
@@ -8336,7 +8441,7 @@ function SectionCard({
|
|
|
8336
8441
|
children: [
|
|
8337
8442
|
/* @__PURE__ */ jsxs61("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2 border-b border-v2-border-subtle pb-3", children: [
|
|
8338
8443
|
/* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-2", children: [
|
|
8339
|
-
icon && /* @__PURE__ */
|
|
8444
|
+
icon && /* @__PURE__ */ jsx82(
|
|
8340
8445
|
"span",
|
|
8341
8446
|
{
|
|
8342
8447
|
"aria-hidden": "true",
|
|
@@ -8344,9 +8449,9 @@ function SectionCard({
|
|
|
8344
8449
|
children: icon
|
|
8345
8450
|
}
|
|
8346
8451
|
),
|
|
8347
|
-
/* @__PURE__ */
|
|
8452
|
+
/* @__PURE__ */ jsx82(Heading, { level: 3, size: "sm", children: title }),
|
|
8348
8453
|
highlight && /* @__PURE__ */ jsxs61("span", { className: "inline-flex items-center gap-1 rounded-v2-pill bg-v2-warn-soft px-2 py-0.5 text-[11px] font-bold text-v2-warn-fg", children: [
|
|
8349
|
-
/* @__PURE__ */
|
|
8454
|
+
/* @__PURE__ */ jsx82(WarningCircle5, { size: 11, weight: "fill", "aria-hidden": "true" }),
|
|
8350
8455
|
"Pendente"
|
|
8351
8456
|
] })
|
|
8352
8457
|
] }),
|
|
@@ -8369,7 +8474,7 @@ import {
|
|
|
8369
8474
|
XAxis as XAxis2,
|
|
8370
8475
|
YAxis as YAxis2
|
|
8371
8476
|
} from "recharts";
|
|
8372
|
-
import { jsx as
|
|
8477
|
+
import { jsx as jsx83, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
8373
8478
|
function toRows2(labels, stacks) {
|
|
8374
8479
|
return labels.map((label, i) => {
|
|
8375
8480
|
const row = { x: label };
|
|
@@ -8395,10 +8500,10 @@ function ChartTooltip3({
|
|
|
8395
8500
|
0
|
|
8396
8501
|
);
|
|
8397
8502
|
return /* @__PURE__ */ jsxs62("div", { className: "rounded-v2-md border border-v2-border-default bg-v2-panel px-3 py-2 text-v2-xs shadow-lg", children: [
|
|
8398
|
-
/* @__PURE__ */
|
|
8503
|
+
/* @__PURE__ */ jsx83("p", { className: "font-semibold text-v2-fg-default", children: formatLabel(label ?? "") }),
|
|
8399
8504
|
/* @__PURE__ */ jsxs62("div", { className: "mt-1 flex flex-col gap-0.5", children: [
|
|
8400
8505
|
payload.map((p) => /* @__PURE__ */ jsxs62("div", { className: "flex items-center gap-2", children: [
|
|
8401
|
-
/* @__PURE__ */
|
|
8506
|
+
/* @__PURE__ */ jsx83(
|
|
8402
8507
|
"span",
|
|
8403
8508
|
{
|
|
8404
8509
|
className: "size-2 rounded-sm",
|
|
@@ -8410,11 +8515,11 @@ function ChartTooltip3({
|
|
|
8410
8515
|
p.name,
|
|
8411
8516
|
":"
|
|
8412
8517
|
] }),
|
|
8413
|
-
/* @__PURE__ */
|
|
8518
|
+
/* @__PURE__ */ jsx83("span", { className: "font-semibold text-v2-fg-default", children: formatValue(typeof p.value === "number" ? p.value : 0) })
|
|
8414
8519
|
] }, p.name)),
|
|
8415
8520
|
/* @__PURE__ */ jsxs62("div", { className: "mt-1 flex items-center justify-between gap-2 border-t border-v2-border-default pt-1", children: [
|
|
8416
|
-
/* @__PURE__ */
|
|
8417
|
-
/* @__PURE__ */
|
|
8521
|
+
/* @__PURE__ */ jsx83("span", { className: "text-v2-fg-muted", children: "Total:" }),
|
|
8522
|
+
/* @__PURE__ */ jsx83("span", { className: "font-semibold text-v2-fg-default", children: formatValue(total) })
|
|
8418
8523
|
] })
|
|
8419
8524
|
] })
|
|
8420
8525
|
] });
|
|
@@ -8429,20 +8534,20 @@ function StackedBarChart({
|
|
|
8429
8534
|
formatLabel = (l) => l
|
|
8430
8535
|
}) {
|
|
8431
8536
|
const rows = toRows2(labels, stacks);
|
|
8432
|
-
return /* @__PURE__ */
|
|
8537
|
+
return /* @__PURE__ */ jsx83(
|
|
8433
8538
|
"div",
|
|
8434
8539
|
{
|
|
8435
8540
|
role: "img",
|
|
8436
8541
|
"aria-label": ariaLabel,
|
|
8437
8542
|
className: cn("w-full", className),
|
|
8438
8543
|
style: { height },
|
|
8439
|
-
children: /* @__PURE__ */
|
|
8544
|
+
children: /* @__PURE__ */ jsx83(ResponsiveContainer3, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs62(
|
|
8440
8545
|
BarChart,
|
|
8441
8546
|
{
|
|
8442
8547
|
data: rows,
|
|
8443
8548
|
margin: { top: 8, right: 12, left: 0, bottom: 0 },
|
|
8444
8549
|
children: [
|
|
8445
|
-
/* @__PURE__ */
|
|
8550
|
+
/* @__PURE__ */ jsx83(
|
|
8446
8551
|
CartesianGrid2,
|
|
8447
8552
|
{
|
|
8448
8553
|
strokeDasharray: "3 4",
|
|
@@ -8450,7 +8555,7 @@ function StackedBarChart({
|
|
|
8450
8555
|
vertical: false
|
|
8451
8556
|
}
|
|
8452
8557
|
),
|
|
8453
|
-
/* @__PURE__ */
|
|
8558
|
+
/* @__PURE__ */ jsx83(
|
|
8454
8559
|
XAxis2,
|
|
8455
8560
|
{
|
|
8456
8561
|
dataKey: "x",
|
|
@@ -8459,7 +8564,7 @@ function StackedBarChart({
|
|
|
8459
8564
|
axisLine: { stroke: "var(--v2-border-default)" }
|
|
8460
8565
|
}
|
|
8461
8566
|
),
|
|
8462
|
-
/* @__PURE__ */
|
|
8567
|
+
/* @__PURE__ */ jsx83(
|
|
8463
8568
|
YAxis2,
|
|
8464
8569
|
{
|
|
8465
8570
|
tick: { fill: "var(--v2-fg-subtle)", fontSize: 11 },
|
|
@@ -8469,11 +8574,11 @@ function StackedBarChart({
|
|
|
8469
8574
|
width: 70
|
|
8470
8575
|
}
|
|
8471
8576
|
),
|
|
8472
|
-
/* @__PURE__ */
|
|
8577
|
+
/* @__PURE__ */ jsx83(
|
|
8473
8578
|
Tooltip4,
|
|
8474
8579
|
{
|
|
8475
8580
|
cursor: { fill: "var(--v2-bg-subtle)" },
|
|
8476
|
-
content: /* @__PURE__ */
|
|
8581
|
+
content: /* @__PURE__ */ jsx83(
|
|
8477
8582
|
ChartTooltip3,
|
|
8478
8583
|
{
|
|
8479
8584
|
formatValue,
|
|
@@ -8482,7 +8587,7 @@ function StackedBarChart({
|
|
|
8482
8587
|
)
|
|
8483
8588
|
}
|
|
8484
8589
|
),
|
|
8485
|
-
/* @__PURE__ */
|
|
8590
|
+
/* @__PURE__ */ jsx83(
|
|
8486
8591
|
Legend2,
|
|
8487
8592
|
{
|
|
8488
8593
|
verticalAlign: "top",
|
|
@@ -8491,7 +8596,7 @@ function StackedBarChart({
|
|
|
8491
8596
|
wrapperStyle: { fontSize: 11, paddingBottom: 8 }
|
|
8492
8597
|
}
|
|
8493
8598
|
),
|
|
8494
|
-
stacks.map((s) => /* @__PURE__ */
|
|
8599
|
+
stacks.map((s) => /* @__PURE__ */ jsx83(
|
|
8495
8600
|
Bar,
|
|
8496
8601
|
{
|
|
8497
8602
|
dataKey: s.name,
|
|
@@ -8510,11 +8615,11 @@ function StackedBarChart({
|
|
|
8510
8615
|
|
|
8511
8616
|
// src/patterns/WorkflowDesigner/WorkflowDesigner.tsx
|
|
8512
8617
|
import { Lightning, Hand, Gear as Gear2 } from "@phosphor-icons/react";
|
|
8513
|
-
import { jsx as
|
|
8618
|
+
import { jsx as jsx84, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
8514
8619
|
var kindIconMap = {
|
|
8515
|
-
automatic: /* @__PURE__ */
|
|
8516
|
-
manual: /* @__PURE__ */
|
|
8517
|
-
system: /* @__PURE__ */
|
|
8620
|
+
automatic: /* @__PURE__ */ jsx84(Lightning, { size: 14, "aria-hidden": "true" }),
|
|
8621
|
+
manual: /* @__PURE__ */ jsx84(Hand, { size: 14, "aria-hidden": "true" }),
|
|
8622
|
+
system: /* @__PURE__ */ jsx84(Gear2, { size: 14, "aria-hidden": "true" })
|
|
8518
8623
|
};
|
|
8519
8624
|
function NodeCard({
|
|
8520
8625
|
node,
|
|
@@ -8535,8 +8640,8 @@ function NodeCard({
|
|
|
8535
8640
|
),
|
|
8536
8641
|
children: [
|
|
8537
8642
|
/* @__PURE__ */ jsxs63("div", { className: "mb-1 flex items-center gap-1.5", children: [
|
|
8538
|
-
/* @__PURE__ */
|
|
8539
|
-
/* @__PURE__ */
|
|
8643
|
+
/* @__PURE__ */ jsx84("span", { className: "text-v2-fg-muted", children: kindIconMap[node.kind] }),
|
|
8644
|
+
/* @__PURE__ */ jsx84("span", { className: "truncate text-v2-sm font-semibold text-v2-fg-default", children: node.label })
|
|
8540
8645
|
] }),
|
|
8541
8646
|
(rulesCount > 0 || actionsCount > 0) && /* @__PURE__ */ jsxs63("div", { className: "mt-1.5 flex flex-wrap items-center gap-1", children: [
|
|
8542
8647
|
rulesCount > 0 && /* @__PURE__ */ jsxs63(Badge, { size: "sm", variant: "default", children: [
|
|
@@ -8560,11 +8665,11 @@ function SidePanel({
|
|
|
8560
8665
|
}) {
|
|
8561
8666
|
const selected = nodes.find((n) => n.id === selectedNodeId);
|
|
8562
8667
|
return /* @__PURE__ */ jsxs63("div", { className: "w-72 shrink-0 rounded-v2-lg border border-v2-border-default bg-v2-panel p-4 shadow-sm", children: [
|
|
8563
|
-
/* @__PURE__ */
|
|
8564
|
-
!selected ? /* @__PURE__ */
|
|
8565
|
-
/* @__PURE__ */
|
|
8668
|
+
/* @__PURE__ */ jsx84(Heading, { level: 3, size: "xs", className: "mb-3", children: "Regras e a\xE7\xF5es" }),
|
|
8669
|
+
!selected ? /* @__PURE__ */ jsx84(Text, { size: "sm", color: "muted", children: "Selecione um n\xF3 para configurar" }) : /* @__PURE__ */ jsxs63("div", { className: "flex flex-col gap-4", children: [
|
|
8670
|
+
/* @__PURE__ */ jsx84(Text, { size: "base", weight: "semibold", children: selected.label }),
|
|
8566
8671
|
/* @__PURE__ */ jsxs63("section", { children: [
|
|
8567
|
-
/* @__PURE__ */
|
|
8672
|
+
/* @__PURE__ */ jsx84(
|
|
8568
8673
|
Text,
|
|
8569
8674
|
{
|
|
8570
8675
|
size: "xs",
|
|
@@ -8574,13 +8679,13 @@ function SidePanel({
|
|
|
8574
8679
|
children: "Regras"
|
|
8575
8680
|
}
|
|
8576
8681
|
),
|
|
8577
|
-
!selected.rules || selected.rules.length === 0 ? /* @__PURE__ */
|
|
8578
|
-
/* @__PURE__ */
|
|
8579
|
-
/* @__PURE__ */
|
|
8682
|
+
!selected.rules || selected.rules.length === 0 ? /* @__PURE__ */ jsx84(Text, { size: "sm", color: "muted", children: "Nenhuma regra" }) : /* @__PURE__ */ jsx84("ul", { className: "flex flex-col gap-1.5", children: selected.rules.map((rule, idx) => /* @__PURE__ */ jsxs63("li", { className: "flex flex-col gap-0.5", children: [
|
|
8683
|
+
/* @__PURE__ */ jsx84(Text, { size: "xs", color: "muted", children: rule.type }),
|
|
8684
|
+
/* @__PURE__ */ jsx84("code", { className: "rounded-v2-sm bg-v2-bg-subtle px-1.5 py-0.5 font-mono text-v2-xs text-v2-fg-default", children: rule.value })
|
|
8580
8685
|
] }, idx)) })
|
|
8581
8686
|
] }),
|
|
8582
8687
|
/* @__PURE__ */ jsxs63("section", { children: [
|
|
8583
|
-
/* @__PURE__ */
|
|
8688
|
+
/* @__PURE__ */ jsx84(
|
|
8584
8689
|
Text,
|
|
8585
8690
|
{
|
|
8586
8691
|
size: "xs",
|
|
@@ -8590,9 +8695,9 @@ function SidePanel({
|
|
|
8590
8695
|
children: "A\xE7\xF5es"
|
|
8591
8696
|
}
|
|
8592
8697
|
),
|
|
8593
|
-
!selected.actions || selected.actions.length === 0 ? /* @__PURE__ */
|
|
8594
|
-
/* @__PURE__ */
|
|
8595
|
-
/* @__PURE__ */
|
|
8698
|
+
!selected.actions || selected.actions.length === 0 ? /* @__PURE__ */ jsx84(Text, { size: "sm", color: "muted", children: "Nenhuma a\xE7\xE3o" }) : /* @__PURE__ */ jsx84("ul", { className: "flex flex-col gap-1.5", children: selected.actions.map((action, idx) => /* @__PURE__ */ jsxs63("li", { className: "flex flex-col gap-0.5", children: [
|
|
8699
|
+
/* @__PURE__ */ jsx84(Text, { size: "xs", color: "muted", children: action.type }),
|
|
8700
|
+
/* @__PURE__ */ jsx84("code", { className: "rounded-v2-sm bg-v2-bg-subtle px-1.5 py-0.5 font-mono text-v2-xs text-v2-fg-default", children: action.event })
|
|
8596
8701
|
] }, idx)) })
|
|
8597
8702
|
] })
|
|
8598
8703
|
] })
|
|
@@ -8615,12 +8720,12 @@ function WorkflowDesigner({
|
|
|
8615
8720
|
const colCount = phases.length;
|
|
8616
8721
|
return /* @__PURE__ */ jsxs63("div", { className: cn("flex gap-4", className), ...props, children: [
|
|
8617
8722
|
/* @__PURE__ */ jsxs63("div", { className: "min-h-[480px] flex-1 rounded-v2-lg border border-v2-border-default bg-v2-bg-subtle p-4", children: [
|
|
8618
|
-
/* @__PURE__ */
|
|
8723
|
+
/* @__PURE__ */ jsx84(
|
|
8619
8724
|
"div",
|
|
8620
8725
|
{
|
|
8621
8726
|
className: "mb-3 grid gap-3 border-b border-v2-border-default pb-2",
|
|
8622
8727
|
style: { gridTemplateColumns: `repeat(${colCount}, minmax(0, 1fr))` },
|
|
8623
|
-
children: phases.map((phase) => /* @__PURE__ */
|
|
8728
|
+
children: phases.map((phase) => /* @__PURE__ */ jsx84(
|
|
8624
8729
|
"div",
|
|
8625
8730
|
{
|
|
8626
8731
|
className: "text-v2-xs font-bold uppercase tracking-wide text-v2-fg-muted",
|
|
@@ -8630,14 +8735,14 @@ function WorkflowDesigner({
|
|
|
8630
8735
|
))
|
|
8631
8736
|
}
|
|
8632
8737
|
),
|
|
8633
|
-
/* @__PURE__ */
|
|
8738
|
+
/* @__PURE__ */ jsx84(
|
|
8634
8739
|
"div",
|
|
8635
8740
|
{
|
|
8636
8741
|
className: "grid gap-3",
|
|
8637
8742
|
style: { gridTemplateColumns: `repeat(${colCount}, minmax(0, 1fr))` },
|
|
8638
8743
|
children: phases.map((phase) => {
|
|
8639
8744
|
const phaseNodes = nodes.filter((n) => n.phase === phase);
|
|
8640
|
-
return /* @__PURE__ */
|
|
8745
|
+
return /* @__PURE__ */ jsx84("div", { className: "flex flex-col gap-2", children: phaseNodes.map((node) => /* @__PURE__ */ jsx84(
|
|
8641
8746
|
NodeCard,
|
|
8642
8747
|
{
|
|
8643
8748
|
node,
|
|
@@ -8649,21 +8754,21 @@ function WorkflowDesigner({
|
|
|
8649
8754
|
})
|
|
8650
8755
|
}
|
|
8651
8756
|
),
|
|
8652
|
-
edges.length > 0 && /* @__PURE__ */
|
|
8757
|
+
edges.length > 0 && /* @__PURE__ */ jsx84(
|
|
8653
8758
|
"div",
|
|
8654
8759
|
{
|
|
8655
8760
|
className: "mt-4 border-t border-v2-border-default pt-3",
|
|
8656
8761
|
"aria-label": "Transi\xE7\xF5es",
|
|
8657
|
-
children: /* @__PURE__ */
|
|
8762
|
+
children: /* @__PURE__ */ jsx84("div", { className: "flex flex-wrap gap-2", children: edges.map((edge, idx) => /* @__PURE__ */ jsxs63(
|
|
8658
8763
|
"div",
|
|
8659
8764
|
{
|
|
8660
8765
|
className: "flex items-center gap-1 rounded-v2-sm border border-v2-border-default bg-v2-panel px-2 py-0.5",
|
|
8661
8766
|
title: `${edge.from} \u2192 ${edge.to}`,
|
|
8662
8767
|
children: [
|
|
8663
|
-
/* @__PURE__ */
|
|
8664
|
-
/* @__PURE__ */
|
|
8665
|
-
/* @__PURE__ */
|
|
8666
|
-
edge.trigger && /* @__PURE__ */
|
|
8768
|
+
/* @__PURE__ */ jsx84("span", { className: "font-mono text-v2-xs text-v2-fg-subtle", children: edge.from }),
|
|
8769
|
+
/* @__PURE__ */ jsx84("span", { className: "text-v2-xs text-v2-fg-subtle", children: "\u2192" }),
|
|
8770
|
+
/* @__PURE__ */ jsx84("span", { className: "font-mono text-v2-xs text-v2-fg-subtle", children: edge.to }),
|
|
8771
|
+
edge.trigger && /* @__PURE__ */ jsx84(Badge, { size: "sm", variant: "default", className: "ml-1", children: edge.trigger })
|
|
8667
8772
|
]
|
|
8668
8773
|
},
|
|
8669
8774
|
idx
|
|
@@ -8671,8 +8776,8 @@ function WorkflowDesigner({
|
|
|
8671
8776
|
}
|
|
8672
8777
|
)
|
|
8673
8778
|
] }),
|
|
8674
|
-
showPanel && /* @__PURE__ */
|
|
8675
|
-
showSidePanel !== false && !selectedNodeId && /* @__PURE__ */
|
|
8779
|
+
showPanel && /* @__PURE__ */ jsx84(SidePanel, { nodes, selectedNodeId }),
|
|
8780
|
+
showSidePanel !== false && !selectedNodeId && /* @__PURE__ */ jsx84(SidePanel, { nodes, selectedNodeId: void 0 })
|
|
8676
8781
|
] });
|
|
8677
8782
|
}
|
|
8678
8783
|
export {
|
|
@@ -8707,6 +8812,7 @@ export {
|
|
|
8707
8812
|
Dropdown,
|
|
8708
8813
|
EmptyState,
|
|
8709
8814
|
ErrorPageLayout,
|
|
8815
|
+
FileThumbnail,
|
|
8710
8816
|
FileUpload,
|
|
8711
8817
|
FilterBarV2,
|
|
8712
8818
|
FormAlert,
|
|
@@ -8764,7 +8870,9 @@ export {
|
|
|
8764
8870
|
dismissToast,
|
|
8765
8871
|
getShortcutKeys,
|
|
8766
8872
|
getShortcutLabel,
|
|
8873
|
+
isImageFile,
|
|
8767
8874
|
isMacOS,
|
|
8875
|
+
isPdfFile,
|
|
8768
8876
|
toast,
|
|
8769
8877
|
useDsV2Theme,
|
|
8770
8878
|
useToast
|