@mlw-packages/react-components 1.5.8 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -493,22 +493,24 @@ import { Slot } from "@radix-ui/react-slot";
493
493
  import { cva } from "class-variance-authority";
494
494
  import { jsx } from "react/jsx-runtime";
495
495
  var buttonVariantsBase = cva(
496
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
496
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive active:scale-95",
497
497
  {
498
498
  variants: {
499
499
  variant: {
500
500
  default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
501
501
  destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
502
- outline: "bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
502
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-background dark:border-input dark:hover:bg-background/95",
503
+ select: "box-border border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-background dark:hover:bg-background/95",
503
504
  secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
504
505
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
505
506
  link: "text-primary underline-offset-4 hover:underline"
506
507
  },
507
508
  size: {
508
- default: " px-4 py-2 has-[>svg]:px-3",
509
+ default: "h-9 py-2 px-4 has-[>svg]:px-3",
509
510
  sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
510
511
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
511
- icon: "size-9"
512
+ icon: "size-9",
513
+ select: "h-[34px] py-[7px] px-4 has-[>svg]:px-3"
512
514
  }
513
515
  },
514
516
  defaultVariants: {
@@ -518,7 +520,14 @@ var buttonVariantsBase = cva(
518
520
  }
519
521
  );
520
522
  var ButtonBase = React.forwardRef(
521
- ({ className, variant, size, asChild = false, testid = `button-${variant ?? "default"}`, ...props }, ref) => {
523
+ ({
524
+ className,
525
+ variant,
526
+ size,
527
+ asChild = false,
528
+ testid = `button-${variant ?? "default"}`,
529
+ ...props
530
+ }, ref) => {
522
531
  const Comp = asChild ? Slot : "button";
523
532
  return /* @__PURE__ */ jsx(
524
533
  Comp,
@@ -2131,7 +2140,7 @@ var InputBase = React12.forwardRef(
2131
2140
  "div",
2132
2141
  {
2133
2142
  className: cn(
2134
- "flex items-center rounded-md transition focus-within:ring-1 focus-within:ring-ring focus-within:border-ring bg-background overflow-hidden",
2143
+ "flex items-center rounded-md transition h-9 focus-within:ring-1 focus-within:ring-ring focus-within:border-ring bg-background overflow-hidden",
2135
2144
  type !== "file" && "border border-input"
2136
2145
  ),
2137
2146
  children: [
@@ -2141,7 +2150,7 @@ var InputBase = React12.forwardRef(
2141
2150
  {
2142
2151
  type,
2143
2152
  className: cn(
2144
- "w-full flex-1 text-sm py-2 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
2153
+ "w-full flex-1 text-sm p-1.5 px-3 focus:outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 bg-background text-foreground",
2145
2154
  className
2146
2155
  ),
2147
2156
  ref,
@@ -2187,6 +2196,7 @@ PopoverContentBase.displayName = PopoverPrimitive.Content.displayName;
2187
2196
  // src/components/selects/ComboboxBase.tsx
2188
2197
  import { CaretDownIcon, CheckIcon as CheckIcon4 } from "@phosphor-icons/react";
2189
2198
  import { useState as useState2 } from "react";
2199
+ import { motion as motion4 } from "framer-motion";
2190
2200
  import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
2191
2201
  function ComboboxBase({
2192
2202
  items,
@@ -2212,17 +2222,25 @@ function ComboboxBase({
2212
2222
  children: /* @__PURE__ */ jsxs11(
2213
2223
  ButtonBase,
2214
2224
  {
2215
- variant: "outline",
2225
+ variant: "select",
2226
+ size: "select",
2216
2227
  role: "combobox",
2217
2228
  "aria-expanded": open,
2218
2229
  className: cn(
2219
- "flex items-start gap-2 justify-between h-full border border-input",
2230
+ "flex items-center gap-2 justify-between h-auto [&>div]:line-clamp-1 [&>span]:line-clamp-1",
2220
2231
  errorMessage && "border-red-500"
2221
2232
  ),
2222
2233
  "data-testid": testIds.trigger ?? "combobox-trigger",
2223
2234
  children: [
2224
2235
  renderSelected,
2225
- /* @__PURE__ */ jsx19(CaretDownIcon, { size: 16, className: "mt-0.5" })
2236
+ /* @__PURE__ */ jsx19(
2237
+ motion4.div,
2238
+ {
2239
+ animate: { rotate: open ? 180 : 0 },
2240
+ transition: { duration: 0.3 },
2241
+ children: /* @__PURE__ */ jsx19(CaretDownIcon, { size: 16, className: "mt-0.5 flex-shrink-0" })
2242
+ }
2243
+ )
2226
2244
  ]
2227
2245
  }
2228
2246
  )
@@ -2264,13 +2282,25 @@ function ComboboxBase({
2264
2282
  children: [
2265
2283
  item.label,
2266
2284
  /* @__PURE__ */ jsx19(
2267
- CheckIcon4,
2285
+ motion4.div,
2268
2286
  {
2269
- className: cn(
2270
- "ml-auto",
2271
- isSelected ? "opacity-100" : "opacity-0"
2272
- ),
2273
- "data-testid": isSelected ? testIds.check ?? "combobox-option-check" : void 0
2287
+ initial: { scale: 0 },
2288
+ animate: { scale: isSelected ? 1 : 0 },
2289
+ transition: {
2290
+ type: "spring",
2291
+ stiffness: 500,
2292
+ damping: 30
2293
+ },
2294
+ children: /* @__PURE__ */ jsx19(
2295
+ CheckIcon4,
2296
+ {
2297
+ className: cn(
2298
+ "ml-auto",
2299
+ isSelected ? "opacity-100" : "opacity-0"
2300
+ ),
2301
+ "data-testid": isSelected ? testIds.check ?? "combobox-option-check" : void 0
2302
+ }
2303
+ )
2274
2304
  }
2275
2305
  )
2276
2306
  ]
@@ -2342,6 +2372,7 @@ function Combobox({
2342
2372
  // src/components/selects/MultiCombobox.tsx
2343
2373
  import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
2344
2374
  import { XIcon as XIcon2 } from "@phosphor-icons/react";
2375
+ import { motion as motion5, AnimatePresence as AnimatePresence3 } from "framer-motion";
2345
2376
  import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
2346
2377
  function MultiCombobox({
2347
2378
  items,
@@ -2376,7 +2407,7 @@ function MultiCombobox({
2376
2407
  "span",
2377
2408
  {
2378
2409
  "data-testid": testIds.emptyPlaceholder ?? "combobox-selected-empty",
2379
- className: "text-gray-500",
2410
+ className: "text-gray-500 truncate",
2380
2411
  children: placeholder ?? "Selecione uma op\xE7\xE3o..."
2381
2412
  }
2382
2413
  );
@@ -2385,16 +2416,25 @@ function MultiCombobox({
2385
2416
  "div",
2386
2417
  {
2387
2418
  "data-testid": testIds.selectedWrapper ?? "combobox-selected-wrapper",
2388
- className: "flex w-full flex-wrap gap-2",
2389
- children: selectedItems.map((item) => /* @__PURE__ */ jsxs13(
2390
- "div",
2419
+ className: "flex w-full flex-wrap gap-2 overflow-hidden pr-1.5",
2420
+ children: /* @__PURE__ */ jsx21(AnimatePresence3, { mode: "popLayout", children: selectedItems.map((item) => /* @__PURE__ */ jsxs13(
2421
+ motion5.div,
2391
2422
  {
2392
- className: "flex items-center gap-1 rounded-md border p-1",
2423
+ layout: true,
2424
+ initial: { scale: 0, opacity: 0 },
2425
+ animate: { scale: 1, opacity: 1 },
2426
+ exit: { scale: 0, opacity: 0 },
2427
+ transition: {
2428
+ type: "spring",
2429
+ stiffness: 500,
2430
+ damping: 30
2431
+ },
2432
+ className: "flex items-center justify-between gap-2 my-1 rounded-md border p-1 max-w-full",
2393
2433
  "data-testid": testIds.selectedItem?.(item.value) ?? `combobox-selected-${item.value}`,
2394
2434
  children: [
2395
- /* @__PURE__ */ jsx21("span", { className: "whitespace-break-spaces text-xs", children: item.label }),
2435
+ /* @__PURE__ */ jsx21("span", { className: "text-xs truncate", children: item.label }),
2396
2436
  /* @__PURE__ */ jsx21(
2397
- "span",
2437
+ motion5.span,
2398
2438
  {
2399
2439
  role: "button",
2400
2440
  tabIndex: 0,
@@ -2402,14 +2442,16 @@ function MultiCombobox({
2402
2442
  e.stopPropagation();
2403
2443
  handleSelection(item.value);
2404
2444
  },
2405
- className: "cursor-pointer p-0 m-0 text-xs flex items-center justify-center hover:text-red-500 hover:scale-110 transition-all",
2445
+ whileHover: { scale: 1.1 },
2446
+ whileTap: { scale: 0.95 },
2447
+ className: "cursor-pointer p-0.5 text-xs flex items-center justify-center hover:text-red-500 transition-colors flex-shrink-0 rounded hover:bg-red-50 ",
2406
2448
  children: /* @__PURE__ */ jsx21(XIcon2, { size: 14 })
2407
2449
  }
2408
2450
  )
2409
2451
  ]
2410
2452
  },
2411
2453
  item.value
2412
- ))
2454
+ )) })
2413
2455
  }
2414
2456
  );
2415
2457
  }, [handleSelection, placeholder, selectedItems, testIds]);
@@ -2887,34 +2929,78 @@ function NavigationMenuIndicatorBase({
2887
2929
  import * as React17 from "react";
2888
2930
  import * as ProgressPrimitive from "@radix-ui/react-progress";
2889
2931
  import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
2890
- var ProgressBase = React17.forwardRef(({ className, value, label, leftIcon, rightIcon, ...props }, ref) => {
2891
- return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
2892
- label && /* @__PURE__ */ jsx28(LabelBase_default, { className: "py-2", children: label }),
2893
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
2894
- leftIcon && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center", children: leftIcon }),
2895
- /* @__PURE__ */ jsx28(
2896
- ProgressPrimitive.Root,
2897
- {
2898
- ref,
2899
- className: cn(
2900
- "relative h-3 w-full overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800 shadow-inner transition-all",
2901
- className
2902
- ),
2903
- value,
2904
- ...props,
2905
- children: /* @__PURE__ */ jsx28(
2906
- ProgressPrimitive.Indicator,
2907
- {
2908
- className: "h-full w-full flex-1 bg-primary transition-all duration-500 ease-in-out",
2909
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
2910
- }
2911
- )
2912
- }
2913
- ),
2914
- rightIcon && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center", children: rightIcon })
2915
- ] })
2916
- ] });
2917
- });
2932
+ var ProgressBase = React17.forwardRef(
2933
+ ({
2934
+ className,
2935
+ value,
2936
+ label,
2937
+ leftIcon,
2938
+ rightIcon,
2939
+ variant = "bar",
2940
+ segments = 5,
2941
+ steps = [],
2942
+ currentStep = 0,
2943
+ ...props
2944
+ }, ref) => {
2945
+ switch (variant) {
2946
+ case "segments":
2947
+ return /* @__PURE__ */ jsx28(
2948
+ ProgressSegmentsBase,
2949
+ {
2950
+ label,
2951
+ segments,
2952
+ value: value || 0
2953
+ }
2954
+ );
2955
+ case "panels":
2956
+ return /* @__PURE__ */ jsx28(
2957
+ ProgressPanelsBase,
2958
+ {
2959
+ label,
2960
+ steps,
2961
+ currentStep
2962
+ }
2963
+ );
2964
+ case "circles":
2965
+ return /* @__PURE__ */ jsx28(
2966
+ ProgressCirclesBase,
2967
+ {
2968
+ label,
2969
+ steps,
2970
+ currentStep
2971
+ }
2972
+ );
2973
+ case "bar":
2974
+ default:
2975
+ return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1 w-full min-w-[150px]", children: [
2976
+ label && /* @__PURE__ */ jsx28(LabelBase_default, { className: "py-2", children: label }),
2977
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
2978
+ leftIcon && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center", children: leftIcon }),
2979
+ /* @__PURE__ */ jsx28(
2980
+ ProgressPrimitive.Root,
2981
+ {
2982
+ ref,
2983
+ className: cn(
2984
+ "relative h-3 w-full overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800 shadow-inner transition-all",
2985
+ className
2986
+ ),
2987
+ value,
2988
+ ...props,
2989
+ children: /* @__PURE__ */ jsx28(
2990
+ ProgressPrimitive.Indicator,
2991
+ {
2992
+ className: "h-full w-full flex-1 bg-primary transition-all duration-500 ease-in-out",
2993
+ style: { transform: `translateX(-${100 - (value || 0)}%)` }
2994
+ }
2995
+ )
2996
+ }
2997
+ ),
2998
+ rightIcon && /* @__PURE__ */ jsx28("div", { className: "flex items-center justify-center", children: rightIcon })
2999
+ ] })
3000
+ ] });
3001
+ }
3002
+ }
3003
+ );
2918
3004
  ProgressBase.displayName = "ProgressBase";
2919
3005
  var ProgressSegmentsBase = ({
2920
3006
  label,
@@ -3065,7 +3151,7 @@ ScrollBarBase.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
3065
3151
  import * as React19 from "react";
3066
3152
  import * as SelectPrimitive from "@radix-ui/react-select";
3067
3153
  import { CheckIcon as CheckIcon5, CaretDownIcon as CaretDownIcon3, CaretUpIcon } from "@phosphor-icons/react";
3068
- import { motion as motion4, AnimatePresence as AnimatePresence3 } from "framer-motion";
3154
+ import { motion as motion6, AnimatePresence as AnimatePresence4 } from "framer-motion";
3069
3155
  import { Fragment as Fragment2, jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
3070
3156
  var SelectBase = SelectPrimitive.Root;
3071
3157
  var SelectGroupBase = SelectPrimitive.Group;
@@ -3082,7 +3168,7 @@ var SelectTriggerBase = React19.forwardRef(({ className, children, open, ...prop
3082
3168
  children: [
3083
3169
  children,
3084
3170
  /* @__PURE__ */ jsx30(
3085
- motion4.span,
3171
+ motion6.span,
3086
3172
  {
3087
3173
  animate: { rotate: open ? 180 : 0 },
3088
3174
  transition: { duration: 0.3 },
@@ -3120,43 +3206,51 @@ var SelectScrollDownButtonBase = React19.forwardRef(({ className, ...props }, re
3120
3206
  }
3121
3207
  ));
3122
3208
  SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
3123
- var SelectContentBase = React19.forwardRef(({ className, children, position = "popper", testid: dataTestId = "select-content", ...props }, ref) => /* @__PURE__ */ jsx30(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx30(AnimatePresence3, { children: /* @__PURE__ */ jsx30(
3124
- SelectPrimitive.Content,
3125
- {
3126
- ref,
3127
- className: cn(
3128
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
3129
- className
3130
- ),
3131
- position,
3132
- "data-testid": dataTestId,
3133
- ...props,
3134
- asChild: true,
3135
- children: /* @__PURE__ */ jsx30(
3136
- motion4.div,
3137
- {
3138
- initial: { opacity: 0, scale: 0.95 },
3139
- animate: { opacity: 1, scale: 1 },
3140
- exit: { opacity: 0, scale: 0.95 },
3141
- transition: { duration: 0.2 },
3142
- children: /* @__PURE__ */ jsxs20(Fragment2, { children: [
3143
- /* @__PURE__ */ jsx30(SelectScrollUpButtonBase, {}),
3144
- /* @__PURE__ */ jsx30(
3145
- SelectPrimitive.Viewport,
3146
- {
3147
- className: cn(
3148
- "p-1",
3149
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
3150
- ),
3151
- children
3152
- }
3153
- ),
3154
- /* @__PURE__ */ jsx30(SelectScrollDownButtonBase, {})
3155
- ] })
3156
- }
3157
- )
3158
- }
3159
- ) }) }));
3209
+ var SelectContentBase = React19.forwardRef(
3210
+ ({
3211
+ className,
3212
+ children,
3213
+ position = "popper",
3214
+ testid: dataTestId = "select-content",
3215
+ ...props
3216
+ }, ref) => /* @__PURE__ */ jsx30(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx30(AnimatePresence4, { children: /* @__PURE__ */ jsx30(
3217
+ SelectPrimitive.Content,
3218
+ {
3219
+ ref,
3220
+ className: cn(
3221
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
3222
+ className
3223
+ ),
3224
+ position,
3225
+ "data-testid": dataTestId,
3226
+ ...props,
3227
+ asChild: true,
3228
+ children: /* @__PURE__ */ jsx30(
3229
+ motion6.div,
3230
+ {
3231
+ initial: { opacity: 0, scale: 0.95 },
3232
+ animate: { opacity: 1, scale: 1 },
3233
+ exit: { opacity: 0, scale: 0.95 },
3234
+ transition: { duration: 0.2 },
3235
+ children: /* @__PURE__ */ jsxs20(Fragment2, { children: [
3236
+ /* @__PURE__ */ jsx30(SelectScrollUpButtonBase, {}),
3237
+ /* @__PURE__ */ jsx30(
3238
+ SelectPrimitive.Viewport,
3239
+ {
3240
+ className: cn(
3241
+ "p-1",
3242
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
3243
+ ),
3244
+ children
3245
+ }
3246
+ ),
3247
+ /* @__PURE__ */ jsx30(SelectScrollDownButtonBase, {})
3248
+ ] })
3249
+ }
3250
+ )
3251
+ }
3252
+ ) }) })
3253
+ );
3160
3254
  SelectContentBase.displayName = SelectPrimitive.Content.displayName;
3161
3255
  var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
3162
3256
  SelectPrimitive.Label,
@@ -3167,19 +3261,36 @@ var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @_
3167
3261
  }
3168
3262
  ));
3169
3263
  SelectLabelBase.displayName = SelectPrimitive.Label.displayName;
3170
- var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(
3264
+ var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx30(
3171
3265
  SelectPrimitive.Item,
3172
3266
  {
3173
3267
  ref,
3174
3268
  className: cn(
3175
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
3269
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-colors",
3176
3270
  className
3177
3271
  ),
3178
3272
  ...props,
3179
- children: [
3180
- /* @__PURE__ */ jsx30("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx30(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx30(CheckIcon5, { className: "h-4 w-4" }) }) }),
3181
- /* @__PURE__ */ jsx30(SelectPrimitive.ItemText, { children })
3182
- ]
3273
+ asChild: true,
3274
+ children: /* @__PURE__ */ jsxs20(
3275
+ motion6.div,
3276
+ {
3277
+ whileHover: { x: 4 },
3278
+ whileTap: { scale: 0.98 },
3279
+ transition: { duration: 0.2 },
3280
+ children: [
3281
+ /* @__PURE__ */ jsx30("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx30(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx30(
3282
+ motion6.div,
3283
+ {
3284
+ initial: { scale: 0 },
3285
+ animate: { scale: 1 },
3286
+ transition: { type: "spring", stiffness: 500, damping: 30 },
3287
+ children: /* @__PURE__ */ jsx30(CheckIcon5, { className: "h-4 w-4" })
3288
+ }
3289
+ ) }) }),
3290
+ /* @__PURE__ */ jsx30(SelectPrimitive.ItemText, { children })
3291
+ ]
3292
+ }
3293
+ )
3183
3294
  }
3184
3295
  ));
3185
3296
  SelectItemBase.displayName = SelectPrimitive.Item.displayName;
@@ -3196,7 +3307,7 @@ SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
3196
3307
  // src/components/ui/SeparatorBase.tsx
3197
3308
  import * as React20 from "react";
3198
3309
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
3199
- import { motion as motion5 } from "framer-motion";
3310
+ import { motion as motion7 } from "framer-motion";
3200
3311
  import { jsx as jsx31 } from "react/jsx-runtime";
3201
3312
  var SeparatorBase = React20.forwardRef(
3202
3313
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
@@ -3210,7 +3321,7 @@ var SeparatorBase = React20.forwardRef(
3210
3321
  asChild: true,
3211
3322
  ...props,
3212
3323
  children: /* @__PURE__ */ jsx31(
3213
- motion5.div,
3324
+ motion7.div,
3214
3325
  {
3215
3326
  className: cn(
3216
3327
  "shrink-0 bg-border",
@@ -4223,7 +4334,8 @@ var TabsListBase = React27.forwardRef(({ className, ...props }, ref) => /* @__PU
4223
4334
  {
4224
4335
  ref,
4225
4336
  className: cn(
4226
- "relative flex w-full items-center justify-start gap-4 border-b-2 border-border",
4337
+ "relative flex w-full items-center justify-start gap-2 border-b border-border",
4338
+ "bg-transparent",
4227
4339
  className
4228
4340
  ),
4229
4341
  ...props
@@ -4235,13 +4347,15 @@ var TabsTriggerBase = React27.forwardRef(({ className, ...props }, ref) => /* @_
4235
4347
  {
4236
4348
  ref,
4237
4349
  className: cn(
4238
- "relative inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm font-medium transition-colors",
4239
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-3",
4350
+ "relative inline-flex items-center justify-center whitespace-nowrap px-4 py-2 text-sm font-medium",
4351
+ "text-muted-foreground hover:text-foreground",
4352
+ "transition-colors duration-300 ease-in-out",
4353
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
4240
4354
  "disabled:pointer-events-none disabled:opacity-50",
4241
4355
  "data-[state=active]:text-primary",
4242
- "after:absolute after:bottom-0 after:left-0 after:h-[1.5px] after:w-full",
4356
+ "after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full",
4243
4357
  "after:scale-x-0 after:bg-primary after:origin-left",
4244
- "after:transition-transform after:duration-300 after:ease-[cubic-bezier(0.65,0,0.35,1)]",
4358
+ "after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.34,1.56,0.64,1)]",
4245
4359
  "data-[state=active]:after:scale-x-100",
4246
4360
  className
4247
4361
  ),
@@ -4253,8 +4367,8 @@ var TabsContentBase = React27.forwardRef(({ className, ...props }, ref) => /* @_
4253
4367
  {
4254
4368
  ref,
4255
4369
  className: cn(
4256
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
4257
- "animate-fade-in",
4370
+ "mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
4371
+ "animate-in fade-in-0 duration-500 ease-in-out",
4258
4372
  className
4259
4373
  ),
4260
4374
  ...props
@@ -4264,27 +4378,184 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
4264
4378
 
4265
4379
  // src/components/ui/TextAreaBase.tsx
4266
4380
  import * as React28 from "react";
4267
- import { jsx as jsx40 } from "react/jsx-runtime";
4268
- var TextAreaBase = React28.forwardRef(({ className, ...props }, ref) => {
4269
- return /* @__PURE__ */ jsx40(
4270
- "textarea",
4271
- {
4272
- className: cn(
4273
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
4274
- className
4381
+ import { motion as motion8 } from "framer-motion";
4382
+ import { TrashIcon as TrashIcon2 } from "@phosphor-icons/react";
4383
+ import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
4384
+ var TextAreaBase = React28.forwardRef(
4385
+ ({ className, clearable = false, onClear, ...props }, ref) => {
4386
+ const [isFocused, setIsFocused] = React28.useState(false);
4387
+ const [hasContent, setHasContent] = React28.useState(
4388
+ !!props.value || !!props.defaultValue
4389
+ );
4390
+ const [showConfirmTooltip, setShowConfirmTooltip] = React28.useState(false);
4391
+ const textareaRef = React28.useRef(null);
4392
+ const handleFocus = (e) => {
4393
+ setIsFocused(true);
4394
+ props.onFocus?.(e);
4395
+ };
4396
+ const handleBlur = (e) => {
4397
+ setIsFocused(false);
4398
+ props.onBlur?.(e);
4399
+ };
4400
+ const handleChange = (e) => {
4401
+ setHasContent(e.target.value.length > 0);
4402
+ props.onChange?.(e);
4403
+ };
4404
+ const handleClearClick = () => {
4405
+ setShowConfirmTooltip(true);
4406
+ };
4407
+ const handleConfirmClear = () => {
4408
+ if (textareaRef.current) {
4409
+ const nativeInputValueSetter = Object.getOwnPropertyDescriptor(
4410
+ window.HTMLTextAreaElement.prototype,
4411
+ "value"
4412
+ )?.set;
4413
+ if (nativeInputValueSetter) {
4414
+ nativeInputValueSetter.call(textareaRef.current, "");
4415
+ const event = new Event("input", { bubbles: true });
4416
+ textareaRef.current.dispatchEvent(event);
4417
+ }
4418
+ setHasContent(false);
4419
+ setShowConfirmTooltip(false);
4420
+ textareaRef.current.focus();
4421
+ onClear?.();
4422
+ }
4423
+ };
4424
+ const handleCancelClear = () => {
4425
+ setShowConfirmTooltip(false);
4426
+ };
4427
+ React28.useImperativeHandle(ref, () => textareaRef.current);
4428
+ React28.useEffect(() => {
4429
+ setHasContent(!!props.value || !!props.defaultValue);
4430
+ }, [props.value, props.defaultValue]);
4431
+ return /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
4432
+ /* @__PURE__ */ jsx40(
4433
+ "textarea",
4434
+ {
4435
+ className: cn(
4436
+ "peer flex min-h-[80px] min-w-[200px] w-full rounded-lg border border-input bg-background/50 backdrop-blur-sm",
4437
+ "px-4 py-3 text-base shadow-sm placeholder:text-muted-foreground/60",
4438
+ "transition-all duration-300 ease-out",
4439
+ "hover:border-input/80 hover:shadow-md",
4440
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:border-ring",
4441
+ "focus-visible:shadow-lg focus-visible:bg-background",
4442
+ "disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-muted/30",
4443
+ "resize",
4444
+ "md:text-sm",
4445
+ clearable && hasContent && "pr-10",
4446
+ className
4447
+ ),
4448
+ ref: textareaRef,
4449
+ onFocus: handleFocus,
4450
+ onBlur: handleBlur,
4451
+ onChange: handleChange,
4452
+ ...props
4453
+ }
4275
4454
  ),
4276
- ref,
4277
- ...props
4278
- }
4279
- );
4280
- });
4455
+ clearable && hasContent && /* @__PURE__ */ jsx40(TooltipProviderBase, { children: /* @__PURE__ */ jsxs24(
4456
+ TooltipBase,
4457
+ {
4458
+ open: showConfirmTooltip,
4459
+ onOpenChange: setShowConfirmTooltip,
4460
+ children: [
4461
+ /* @__PURE__ */ jsx40(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx40(
4462
+ motion8.button,
4463
+ {
4464
+ type: "button",
4465
+ initial: { opacity: 0, scale: 0.8 },
4466
+ animate: { opacity: 1, scale: 1 },
4467
+ exit: { opacity: 0, scale: 0.8 },
4468
+ transition: { duration: 0.2 },
4469
+ onClick: handleClearClick,
4470
+ className: cn(
4471
+ "absolute top-3 right-3 p-1.5 rounded-md",
4472
+ "text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10",
4473
+ "transition-all duration-200",
4474
+ "focus:outline-none focus:ring-2 focus:ring-destructive/30",
4475
+ "disabled:opacity-50 disabled:cursor-not-allowed"
4476
+ ),
4477
+ disabled: props.disabled,
4478
+ "aria-label": "Limpar texto",
4479
+ children: /* @__PURE__ */ jsx40(TrashIcon2, { size: 16, weight: "regular" })
4480
+ }
4481
+ ) }),
4482
+ /* @__PURE__ */ jsxs24(
4483
+ TooltipContentBase,
4484
+ {
4485
+ side: "left",
4486
+ className: "bg-background border border-border shadow-lg p-3 flex flex-col gap-2",
4487
+ children: [
4488
+ /* @__PURE__ */ jsx40("p", { className: "text-sm text-foreground font-medium mb-1", children: "Limpar todo o texto?" }),
4489
+ /* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
4490
+ /* @__PURE__ */ jsx40(
4491
+ "button",
4492
+ {
4493
+ type: "button",
4494
+ onClick: handleConfirmClear,
4495
+ className: cn(
4496
+ "px-3 py-1.5 text-xs rounded-md font-medium",
4497
+ "bg-destructive text-destructive-foreground",
4498
+ "hover:bg-destructive/90",
4499
+ "transition-colors"
4500
+ ),
4501
+ children: "Confirmar"
4502
+ }
4503
+ ),
4504
+ /* @__PURE__ */ jsx40(
4505
+ "button",
4506
+ {
4507
+ type: "button",
4508
+ onClick: handleCancelClear,
4509
+ className: cn(
4510
+ "px-3 py-1.5 text-xs rounded-md font-medium",
4511
+ "bg-secondary text-secondary-foreground",
4512
+ "hover:bg-secondary/80",
4513
+ "transition-colors"
4514
+ ),
4515
+ children: "Cancelar"
4516
+ }
4517
+ )
4518
+ ] })
4519
+ ]
4520
+ }
4521
+ )
4522
+ ]
4523
+ }
4524
+ ) }),
4525
+ /* @__PURE__ */ jsx40(
4526
+ motion8.div,
4527
+ {
4528
+ className: "pointer-events-none absolute inset-0 rounded-lg",
4529
+ initial: { opacity: 0 },
4530
+ animate: { opacity: isFocused ? 1 : 0 },
4531
+ transition: { duration: 0.3 },
4532
+ children: /* @__PURE__ */ jsx40("div", { className: "absolute inset-0 rounded-lg bg-gradient-to-r from-ring/20 via-ring/10 to-ring/20 blur-sm" })
4533
+ }
4534
+ ),
4535
+ isFocused && hasContent && props.maxLength && /* @__PURE__ */ jsxs24(
4536
+ motion8.div,
4537
+ {
4538
+ initial: { opacity: 0, y: -10 },
4539
+ animate: { opacity: 1, y: 0 },
4540
+ exit: { opacity: 0, y: -10 },
4541
+ className: "absolute bottom-2 right-3 text-xs text-muted-foreground/70 font-medium",
4542
+ children: [
4543
+ props.value?.length || 0,
4544
+ " / ",
4545
+ props.maxLength
4546
+ ]
4547
+ }
4548
+ )
4549
+ ] });
4550
+ }
4551
+ );
4281
4552
  TextAreaBase.displayName = "TextAreaBase";
4282
4553
 
4283
4554
  // src/components/mode-toggle.tsx
4284
4555
  import { CheckIcon as CheckIcon6, MoonIcon, SunIcon } from "@phosphor-icons/react";
4285
4556
 
4286
4557
  // src/components/theme-provider.tsx
4287
- import { createContext as createContext3, useContext as useContext4, useEffect as useEffect6, useState as useState6 } from "react";
4558
+ import { createContext as createContext3, useContext as useContext4, useEffect as useEffect7, useState as useState7 } from "react";
4288
4559
  import { jsx as jsx41 } from "react/jsx-runtime";
4289
4560
  var initialState = {
4290
4561
  theme: "system",
@@ -4297,8 +4568,8 @@ function ThemeProviderBase({
4297
4568
  storageKey = "app-ui-theme",
4298
4569
  ...props
4299
4570
  }) {
4300
- const [theme, setThemeState] = useState6(defaultTheme);
4301
- useEffect6(() => {
4571
+ const [theme, setThemeState] = useState7(defaultTheme);
4572
+ useEffect7(() => {
4302
4573
  const root = window.document.documentElement;
4303
4574
  root.classList.remove(
4304
4575
  "light",
@@ -4324,7 +4595,7 @@ function ThemeProviderBase({
4324
4595
  document.body.style.color = "";
4325
4596
  }
4326
4597
  }, [theme]);
4327
- useEffect6(() => {
4598
+ useEffect7(() => {
4328
4599
  const stored = localStorage.getItem(storageKey);
4329
4600
  if (stored) setThemeState(stored);
4330
4601
  }, [storageKey]);
@@ -4345,7 +4616,7 @@ var useTheme = () => {
4345
4616
  };
4346
4617
 
4347
4618
  // src/components/mode-toggle.tsx
4348
- import { Fragment as Fragment3, jsx as jsx42, jsxs as jsxs24 } from "react/jsx-runtime";
4619
+ import { Fragment as Fragment3, jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
4349
4620
  var themeLabels = {
4350
4621
  light: "Light",
4351
4622
  dark: "Dark",
@@ -4362,15 +4633,15 @@ function ModeToggleBase({
4362
4633
  }) {
4363
4634
  const { setTheme, theme: currentTheme } = useTheme();
4364
4635
  const isDark = currentTheme?.includes("dark") || currentTheme === "system" && typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches;
4365
- return /* @__PURE__ */ jsxs24(DropDownMenuBase, { children: [
4366
- /* @__PURE__ */ jsx42(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs24(
4636
+ return /* @__PURE__ */ jsxs25(DropDownMenuBase, { children: [
4637
+ /* @__PURE__ */ jsx42(DropDownMenuTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs25(
4367
4638
  ButtonBase,
4368
4639
  {
4369
4640
  variant: "ghost",
4370
4641
  size: "icon",
4371
4642
  className: "relative overflow-hidden border-transparent",
4372
4643
  children: [
4373
- /* @__PURE__ */ jsxs24(Fragment3, { children: [
4644
+ /* @__PURE__ */ jsxs25(Fragment3, { children: [
4374
4645
  /* @__PURE__ */ jsx42(SunIcon, { className: `h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-90 scale-0" : "rotate-0 scale-100"}` }),
4375
4646
  /* @__PURE__ */ jsx42(MoonIcon, { className: `absolute h-[1.2rem] w-[1.2rem] transition-transform duration-300 ${isDark ? "rotate-0 scale-100" : "rotate-90 scale-0"}` })
4376
4647
  ] }),
@@ -4378,7 +4649,7 @@ function ModeToggleBase({
4378
4649
  ]
4379
4650
  }
4380
4651
  ) }),
4381
- /* @__PURE__ */ jsx42(DropDownMenuContentBase, { align: "end", className: "border-border bg-popover text-popover-foreground", children: themes.map((theme) => /* @__PURE__ */ jsxs24(
4652
+ /* @__PURE__ */ jsx42(DropDownMenuContentBase, { align: "end", className: "border-border bg-popover text-popover-foreground", children: themes.map((theme) => /* @__PURE__ */ jsxs25(
4382
4653
  DropDownMenuItemBase,
4383
4654
  {
4384
4655
  onClick: () => setTheme(theme),
@@ -4396,7 +4667,7 @@ function ModeToggleBase({
4396
4667
  // src/components/ui/DestructiveDialog.tsx
4397
4668
  import * as React29 from "react";
4398
4669
  import { XCircleIcon as XCircleIcon2 } from "@phosphor-icons/react";
4399
- import { jsx as jsx43, jsxs as jsxs25 } from "react/jsx-runtime";
4670
+ import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
4400
4671
  var DestructiveDialog = ({
4401
4672
  title,
4402
4673
  description,
@@ -4408,9 +4679,9 @@ var DestructiveDialog = ({
4408
4679
  const titleId = "destructive-dialog-title";
4409
4680
  const descriptionId = "destructive-dialog-description";
4410
4681
  const triggerEl = React29.isValidElement(children) ? /* @__PURE__ */ jsx43(AlertDialogTriggerBase, { asChild: true, children }) : /* @__PURE__ */ jsx43(AlertDialogTriggerBase, { children: /* @__PURE__ */ jsx43(ButtonBase, { variant: "destructive", children: triggerContent ?? "Excluir" }) });
4411
- return /* @__PURE__ */ jsxs25(AlertDialogBase, { children: [
4682
+ return /* @__PURE__ */ jsxs26(AlertDialogBase, { children: [
4412
4683
  triggerEl,
4413
- /* @__PURE__ */ jsxs25(
4684
+ /* @__PURE__ */ jsxs26(
4414
4685
  AlertDialogContentBase,
4415
4686
  {
4416
4687
  role: "alertdialog",
@@ -4419,9 +4690,9 @@ var DestructiveDialog = ({
4419
4690
  "aria-describedby": descriptionId,
4420
4691
  className: cn("border border-destructive bg-background"),
4421
4692
  children: [
4422
- /* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-4", children: [
4693
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-start gap-4", children: [
4423
4694
  /* @__PURE__ */ jsx43("div", { className: "flex items-center justify-center w-10 h-10 rounded-full ring-1 ring-destructive/30", children: /* @__PURE__ */ jsx43(XCircleIcon2, { className: "w-6 h-6 text-destructive" }) }),
4424
- /* @__PURE__ */ jsxs25("div", { className: "flex-1", children: [
4695
+ /* @__PURE__ */ jsxs26("div", { className: "flex-1", children: [
4425
4696
  /* @__PURE__ */ jsx43(
4426
4697
  AlertDialogTitleBase,
4427
4698
  {
@@ -4440,7 +4711,7 @@ var DestructiveDialog = ({
4440
4711
  )
4441
4712
  ] })
4442
4713
  ] }),
4443
- /* @__PURE__ */ jsxs25(AlertDialogFooterBase, { className: "mt-2 flex justify-end gap-3", children: [
4714
+ /* @__PURE__ */ jsxs26(AlertDialogFooterBase, { className: "mt-2 flex justify-end gap-3", children: [
4444
4715
  /* @__PURE__ */ jsx43(
4445
4716
  AlertDialogCancelBase,
4446
4717
  {
@@ -4481,8 +4752,8 @@ import {
4481
4752
  XIcon as XIcon4,
4482
4753
  CalendarIcon
4483
4754
  } from "@phosphor-icons/react";
4484
- import { AnimatePresence as AnimatePresence4 } from "framer-motion";
4485
- import { jsx as jsx44, jsxs as jsxs26 } from "react/jsx-runtime";
4755
+ import { AnimatePresence as AnimatePresence5 } from "framer-motion";
4756
+ import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
4486
4757
  function CalendarBase2({
4487
4758
  className,
4488
4759
  classNames,
@@ -4503,10 +4774,10 @@ function CalendarBase2({
4503
4774
  "div",
4504
4775
  {
4505
4776
  className: cn(
4506
- "rounded-2xl border bg-background p-4 shadow-lg overflow-hidden w-full h-full flex flex-col",
4777
+ "rounded-md border bg-background p-4 shadow-lg overflow-hidden w-full h-full flex flex-col",
4507
4778
  className
4508
4779
  ),
4509
- children: /* @__PURE__ */ jsx44("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ jsx44(AnimatePresence4, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ jsx44(
4780
+ children: /* @__PURE__ */ jsx44("div", { className: "relative flex-1 flex flex-col min-h-0", children: /* @__PURE__ */ jsx44(AnimatePresence5, { initial: false, mode: "wait", custom: direction, children: /* @__PURE__ */ jsx44(
4510
4781
  "div",
4511
4782
  {
4512
4783
  className: "w-full h-full flex flex-col",
@@ -4575,10 +4846,10 @@ CalendarBase2.displayName = "CalendarBase";
4575
4846
 
4576
4847
  // src/components/date-time-picker/DateTimePicker.tsx
4577
4848
  import { ptBR } from "date-fns/locale";
4578
- import { useEffect as useEffect7, useState as useState8 } from "react";
4849
+ import { useEffect as useEffect8, useState as useState9 } from "react";
4579
4850
 
4580
4851
  // src/components/date-time-picker/TimePicker.tsx
4581
- import { motion as motion6, AnimatePresence as AnimatePresence5 } from "framer-motion";
4852
+ import { motion as motion9, AnimatePresence as AnimatePresence6 } from "framer-motion";
4582
4853
  import * as React32 from "react";
4583
4854
 
4584
4855
  // src/components/date-time-picker/TimePickerInput.tsx
@@ -4725,7 +4996,7 @@ function display12HourValue(hours) {
4725
4996
  }
4726
4997
 
4727
4998
  // src/components/date-time-picker/TimePickerInput.tsx
4728
- import { jsx as jsx45, jsxs as jsxs27 } from "react/jsx-runtime";
4999
+ import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
4729
5000
  var TimePickerInput = React31.forwardRef(
4730
5001
  ({
4731
5002
  className,
@@ -4812,7 +5083,7 @@ var TimePickerInput = React31.forwardRef(
4812
5083
  const baseLabel = getPickerLabel();
4813
5084
  return `${baseLabel}, valor atual: ${calculatedValue}.`;
4814
5085
  };
4815
- return /* @__PURE__ */ jsxs27("div", { className: "relative group flex flex-col items-center", children: [
5086
+ return /* @__PURE__ */ jsxs28("div", { className: "relative group flex flex-col items-center", children: [
4816
5087
  getPickerLabel() && /* @__PURE__ */ jsx45(
4817
5088
  "label",
4818
5089
  {
@@ -4821,7 +5092,7 @@ var TimePickerInput = React31.forwardRef(
4821
5092
  children: getPickerLabel()
4822
5093
  }
4823
5094
  ),
4824
- /* @__PURE__ */ jsxs27(
5095
+ /* @__PURE__ */ jsxs28(
4825
5096
  "div",
4826
5097
  {
4827
5098
  className: cn(
@@ -4848,7 +5119,7 @@ var TimePickerInput = React31.forwardRef(
4848
5119
  children: /* @__PURE__ */ jsx45(CaretUpIcon2, { size: 14, className: "sm:w-4 sm:h-4" })
4849
5120
  }
4850
5121
  ),
4851
- /* @__PURE__ */ jsxs27("div", { className: "relative", children: [
5122
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
4852
5123
  /* @__PURE__ */ jsx45(
4853
5124
  "input",
4854
5125
  {
@@ -4924,7 +5195,7 @@ var TimePickerInput = React31.forwardRef(
4924
5195
  TimePickerInput.displayName = "TimePickerInput";
4925
5196
 
4926
5197
  // src/components/date-time-picker/TimePicker.tsx
4927
- import { Fragment as Fragment4, jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
5198
+ import { Fragment as Fragment4, jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
4928
5199
  function TimePicker({
4929
5200
  date,
4930
5201
  setDate,
@@ -4949,8 +5220,8 @@ function TimePicker({
4949
5220
  hidden: { opacity: 0, y: 10 },
4950
5221
  visible: { opacity: 1, y: 0 }
4951
5222
  };
4952
- return /* @__PURE__ */ jsxs28(
4953
- motion6.div,
5223
+ return /* @__PURE__ */ jsxs29(
5224
+ motion9.div,
4954
5225
  {
4955
5226
  variants: containerVariants,
4956
5227
  initial: "hidden",
@@ -4958,7 +5229,7 @@ function TimePicker({
4958
5229
  className: "flex items-end justify-center gap-2 sm:gap-3 p-2 sm:p-3 md:p-4 rounded-lg bg-muted/20 border border-border/50 w-full max-w-full overflow-hidden",
4959
5230
  children: [
4960
5231
  /* @__PURE__ */ jsx46(
4961
- motion6.div,
5232
+ motion9.div,
4962
5233
  {
4963
5234
  variants: itemVariants2,
4964
5235
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -4976,7 +5247,7 @@ function TimePicker({
4976
5247
  }
4977
5248
  ),
4978
5249
  /* @__PURE__ */ jsx46(
4979
- motion6.div,
5250
+ motion9.div,
4980
5251
  {
4981
5252
  variants: itemVariants2,
4982
5253
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -4994,8 +5265,8 @@ function TimePicker({
4994
5265
  )
4995
5266
  }
4996
5267
  ),
4997
- /* @__PURE__ */ jsx46(AnimatePresence5, { children: !hideSeconds && /* @__PURE__ */ jsx46(Fragment4, { children: /* @__PURE__ */ jsx46(
4998
- motion6.div,
5268
+ /* @__PURE__ */ jsx46(AnimatePresence6, { children: !hideSeconds && /* @__PURE__ */ jsx46(Fragment4, { children: /* @__PURE__ */ jsx46(
5269
+ motion9.div,
4999
5270
  {
5000
5271
  variants: itemVariants2,
5001
5272
  initial: "hidden",
@@ -5022,7 +5293,7 @@ function TimePicker({
5022
5293
 
5023
5294
  // src/components/date-time-picker/DateTimePicker.tsx
5024
5295
  import { CalendarBlankIcon, ClockIcon } from "@phosphor-icons/react";
5025
- import { jsx as jsx47, jsxs as jsxs29 } from "react/jsx-runtime";
5296
+ import { jsx as jsx47, jsxs as jsxs30 } from "react/jsx-runtime";
5026
5297
  function DateTimePicker({
5027
5298
  label,
5028
5299
  date,
@@ -5035,9 +5306,9 @@ function DateTimePicker({
5035
5306
  disabled,
5036
5307
  className
5037
5308
  }) {
5038
- const [internalDate, setInternalDate] = useState8(date);
5039
- const [open, setOpen] = useState8(false);
5040
- const [timePickerOpen, setTimePickerOpen] = useState8(false);
5309
+ const [internalDate, setInternalDate] = useState9(date);
5310
+ const [open, setOpen] = useState9(false);
5311
+ const [timePickerOpen, setTimePickerOpen] = useState9(false);
5041
5312
  const handleSelect = (newDay) => {
5042
5313
  if (!newDay) return;
5043
5314
  if (!internalDate) {
@@ -5066,24 +5337,23 @@ function DateTimePicker({
5066
5337
  if (!timeFormat) return "PPP";
5067
5338
  return `PPP - ${timeFormat}`;
5068
5339
  };
5069
- useEffect7(() => {
5340
+ useEffect8(() => {
5070
5341
  if (date) {
5071
5342
  setInternalDate(date);
5072
5343
  }
5073
5344
  }, [date, open]);
5074
- return /* @__PURE__ */ jsxs29("div", { className: cn("space-y-2 w-full sm:w-auto", className), children: [
5345
+ return /* @__PURE__ */ jsxs30("div", { className: cn("space-y-2 w-full sm:w-auto", className), children: [
5075
5346
  label && /* @__PURE__ */ jsx47(LabelBase_default, { children: label }),
5076
- /* @__PURE__ */ jsxs29(PopoverBase, { open, onOpenChange: setOpen, children: [
5077
- /* @__PURE__ */ jsx47(PopoverTriggerBase, { disabled, asChild: true, children: /* @__PURE__ */ jsxs29(
5347
+ /* @__PURE__ */ jsxs30(PopoverBase, { open, onOpenChange: setOpen, children: [
5348
+ /* @__PURE__ */ jsx47(PopoverTriggerBase, { disabled, asChild: true, children: /* @__PURE__ */ jsxs30(
5078
5349
  ButtonBase,
5079
5350
  {
5080
5351
  variant: "outline",
5081
- size: "lg",
5082
5352
  className: cn(
5083
5353
  "w-full justify-start text-left min-w-0 overflow-hidden",
5084
- "min-h-[44px] sm:min-h-[48px] px-3 sm:px-4",
5354
+ "text-muted-foreground/90",
5085
5355
  "text-sm sm:text-base",
5086
- !date && "text-muted-foreground"
5356
+ !date && "text-muted-foreground/"
5087
5357
  ),
5088
5358
  children: [
5089
5359
  /* @__PURE__ */ jsx47("span", { className: "truncate flex-1", children: date ? format(date, getDisplayFormat(), { locale: ptBR }) : "Pick a date" }),
@@ -5100,7 +5370,7 @@ function DateTimePicker({
5100
5370
  side: "bottom",
5101
5371
  avoidCollisions: true,
5102
5372
  collisionPadding: 8,
5103
- children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col space-y-2 sm:space-y-3 p-2 sm:p-3 md:p-4 max-h-[calc(100vh-4rem)] overflow-y-auto", children: [
5373
+ children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col space-y-2 sm:space-y-3 p-2 sm:p-3 md:p-4 max-h-[calc(100vh-4rem)] overflow-y-auto", children: [
5104
5374
  /* @__PURE__ */ jsx47(
5105
5375
  CalendarBase2,
5106
5376
  {
@@ -5114,13 +5384,13 @@ function DateTimePicker({
5114
5384
  className: "w-full"
5115
5385
  }
5116
5386
  ),
5117
- !(hideHour && hideMinute) && /* @__PURE__ */ jsx47("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ jsxs29(
5387
+ !(hideHour && hideMinute) && /* @__PURE__ */ jsx47("div", { className: "flex justify-center w-full px-2", children: /* @__PURE__ */ jsxs30(
5118
5388
  PopoverBase,
5119
5389
  {
5120
5390
  open: timePickerOpen,
5121
5391
  onOpenChange: setTimePickerOpen,
5122
5392
  children: [
5123
- /* @__PURE__ */ jsx47(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs29(
5393
+ /* @__PURE__ */ jsx47(PopoverTriggerBase, { asChild: true, children: /* @__PURE__ */ jsxs30(
5124
5394
  ButtonBase,
5125
5395
  {
5126
5396
  variant: "outline",
@@ -5130,13 +5400,13 @@ function DateTimePicker({
5130
5400
  "px-2 sm:px-3 py-1.5 sm:py-2",
5131
5401
  "text-sm sm:text-base font-semibold w-full max-w-xs",
5132
5402
  "border-2 border-primary/20 rounded-lg",
5133
- "bg-primary/5 hover:bg-primary/10 hover:border-primary/30",
5403
+ "bg-background hover:bg-primary/10 hover:border-primary/30",
5134
5404
  "transition-all duration-200",
5135
5405
  "shadow-sm hover:shadow-md active:scale-[0.98]",
5136
5406
  "min-h-[36px] sm:min-h-[40px]"
5137
5407
  ),
5138
5408
  children: [
5139
- /* @__PURE__ */ jsx47(ClockIcon, { className: "text-primary/70 flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
5409
+ /* @__PURE__ */ jsx47(ClockIcon, { className: "text-primary flex-shrink-0 w-4 h-4 sm:w-5 sm:h-5" }),
5140
5410
  /* @__PURE__ */ jsx47("span", { className: "text-foreground truncate", children: internalDate ? format(internalDate, getTimeFormat() || "HH:mm", {
5141
5411
  locale: ptBR
5142
5412
  }) : "00:00" })
@@ -5152,7 +5422,7 @@ function DateTimePicker({
5152
5422
  sideOffset: 8,
5153
5423
  avoidCollisions: true,
5154
5424
  collisionPadding: 8,
5155
- children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-col items-center space-y-2 sm:space-y-3", children: [
5425
+ children: /* @__PURE__ */ jsxs30("div", { className: "flex flex-col items-center space-y-2 sm:space-y-3", children: [
5156
5426
  /* @__PURE__ */ jsx47("h4", { className: "text-sm sm:text-base font-medium text-center", children: "Alterar Hor\xE1rio" }),
5157
5427
  /* @__PURE__ */ jsx47(
5158
5428
  TimePicker,
@@ -5186,7 +5456,8 @@ function DateTimePicker({
5186
5456
  }
5187
5457
 
5188
5458
  // src/components/selects/Select.tsx
5189
- import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs30 } from "react/jsx-runtime";
5459
+ import { motion as motion10, AnimatePresence as AnimatePresence7 } from "framer-motion";
5460
+ import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
5190
5461
  function Select({
5191
5462
  items,
5192
5463
  groupItems,
@@ -5195,64 +5466,88 @@ function Select({
5195
5466
  errorMessage,
5196
5467
  testIds = {}
5197
5468
  }) {
5198
- return /* @__PURE__ */ jsxs30("div", { "data-testid": testIds.root ?? "select-root", children: [
5199
- /* @__PURE__ */ jsxs30(SelectBase, { onValueChange: onChange, "data-testid": testIds.base ?? "select-base", children: [
5200
- /* @__PURE__ */ jsx48(
5201
- SelectTriggerBase,
5202
- {
5203
- className: cn(
5204
- "flex h-12 w-full content-start text-lg shadow-md",
5205
- errorMessage && "border-red-500"
5206
- ),
5207
- "data-testid": testIds.trigger ?? "select-trigger",
5208
- children: /* @__PURE__ */ jsx48(
5209
- SelectValueBase,
5469
+ return /* @__PURE__ */ jsxs31("div", { "data-testid": testIds.root ?? "select-root", children: [
5470
+ /* @__PURE__ */ jsxs31(
5471
+ SelectBase,
5472
+ {
5473
+ onValueChange: onChange,
5474
+ "data-testid": testIds.base ?? "select-base",
5475
+ children: [
5476
+ /* @__PURE__ */ jsx48(
5477
+ SelectTriggerBase,
5210
5478
  {
5211
- placeholder,
5212
- "data-testid": testIds.value ?? "select-value"
5479
+ className: cn(
5480
+ "flex h-9 w-full content-start text-lg shadow-md",
5481
+ errorMessage && "border-red-500"
5482
+ ),
5483
+ "data-testid": testIds.trigger ?? "select-trigger",
5484
+ children: /* @__PURE__ */ jsx48(
5485
+ SelectValueBase,
5486
+ {
5487
+ placeholder,
5488
+ "data-testid": testIds.value ?? "select-value"
5489
+ }
5490
+ )
5213
5491
  }
5214
- )
5215
- }
5216
- ),
5217
- /* @__PURE__ */ jsx48(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx48(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ jsx48(Fragment5, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs30(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: [
5218
- /* @__PURE__ */ jsx48(SelectLabelBase, { "data-testid": testIds.label ?? "select-label", children: key }),
5219
- groupItems[key].map((item) => /* @__PURE__ */ jsx48(
5220
- SelectItemBase,
5221
- {
5222
- value: item.value,
5223
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5224
- children: item.label
5225
- },
5226
- item.value
5227
- ))
5228
- ] }, key)) }) : /* @__PURE__ */ jsx48(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ jsx48(
5229
- SelectItemBase,
5230
- {
5231
- value: item.value,
5232
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5233
- children: item.label
5234
- },
5235
- item.value
5236
- )) }) }) })
5237
- ] }),
5238
- errorMessage && /* @__PURE__ */ jsx48(
5239
- "p",
5492
+ ),
5493
+ /* @__PURE__ */ jsx48(ScrollAreaBase, { "data-testid": testIds.scrollarea ?? "select-scrollarea", children: /* @__PURE__ */ jsx48(SelectContentBase, { "data-testid": testIds.content ?? "select-content", children: groupItems ? /* @__PURE__ */ jsx48(Fragment5, { children: Object.keys(groupItems).map((key) => /* @__PURE__ */ jsxs31(
5494
+ SelectGroupBase,
5495
+ {
5496
+ "data-testid": testIds.group ?? "select-group",
5497
+ children: [
5498
+ /* @__PURE__ */ jsx48(
5499
+ SelectLabelBase,
5500
+ {
5501
+ "data-testid": testIds.label ?? "select-label",
5502
+ children: key
5503
+ }
5504
+ ),
5505
+ groupItems[key].map((item) => /* @__PURE__ */ jsx48(
5506
+ SelectItemBase,
5507
+ {
5508
+ value: item.value,
5509
+ "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5510
+ children: item.label
5511
+ },
5512
+ item.value
5513
+ ))
5514
+ ]
5515
+ },
5516
+ key
5517
+ )) }) : /* @__PURE__ */ jsx48(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ jsx48(
5518
+ SelectItemBase,
5519
+ {
5520
+ value: item.value,
5521
+ "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5522
+ children: item.label
5523
+ },
5524
+ item.value
5525
+ )) }) }) })
5526
+ ]
5527
+ }
5528
+ ),
5529
+ /* @__PURE__ */ jsx48(AnimatePresence7, { children: errorMessage && /* @__PURE__ */ jsx48(
5530
+ motion10.p,
5240
5531
  {
5532
+ initial: { opacity: 0, y: -10 },
5533
+ animate: { opacity: 1, y: 0 },
5534
+ exit: { opacity: 0, y: -10 },
5535
+ transition: { duration: 0.2 },
5241
5536
  className: "text-sm text-red-500",
5242
5537
  "data-testid": testIds.error ?? "select-error",
5243
5538
  children: errorMessage
5244
5539
  }
5245
- )
5540
+ ) })
5246
5541
  ] });
5247
5542
  }
5248
5543
 
5249
5544
  // src/components/charts/Chart.tsx
5250
5545
  import {
5251
- useState as useState11,
5252
- useEffect as useEffect10,
5546
+ useState as useState12,
5547
+ useEffect as useEffect11,
5253
5548
  useCallback as useCallback7,
5254
5549
  useMemo as useMemo6,
5255
- useRef as useRef4,
5550
+ useRef as useRef5,
5256
5551
  useLayoutEffect
5257
5552
  } from "react";
5258
5553
  import {
@@ -5415,11 +5710,11 @@ var resolveChartMargins = (margins, chartMargins, showLabels) => {
5415
5710
  import { toast as toast2 } from "sonner";
5416
5711
 
5417
5712
  // src/components/charts/components/controls/PeriodsDropdown.tsx
5418
- import { useState as useState9, useRef as useRef2, useEffect as useEffect8 } from "react";
5419
- import { motion as motion7, AnimatePresence as AnimatePresence6 } from "framer-motion";
5713
+ import { useState as useState10, useRef as useRef3, useEffect as useEffect9 } from "react";
5714
+ import { motion as motion11, AnimatePresence as AnimatePresence8 } from "framer-motion";
5420
5715
  import { DotsThreeIcon as DotsThreeIcon2 } from "@phosphor-icons/react/dist/ssr";
5421
5716
  import { Check } from "@phosphor-icons/react/dist/ssr";
5422
- import { jsx as jsx49, jsxs as jsxs31 } from "react/jsx-runtime";
5717
+ import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
5423
5718
  var menuVariants = {
5424
5719
  hidden: { opacity: 0, y: -6, scale: 0.98 },
5425
5720
  visible: { opacity: 1, y: 0, scale: 1 },
@@ -5438,11 +5733,11 @@ function PeriodsDropdown({
5438
5733
  activePeriods
5439
5734
  }) {
5440
5735
  const periods = processedData.map((d) => String(d.name));
5441
- const [open, setOpen] = useState9(false);
5442
- const wrapperRef = useRef2(null);
5443
- const firstItemRef = useRef2(null);
5444
- const listRef = useRef2(null);
5445
- useEffect8(() => {
5736
+ const [open, setOpen] = useState10(false);
5737
+ const wrapperRef = useRef3(null);
5738
+ const firstItemRef = useRef3(null);
5739
+ const listRef = useRef3(null);
5740
+ useEffect9(() => {
5446
5741
  const handleClickOutside = (e) => {
5447
5742
  if (!wrapperRef.current) return;
5448
5743
  if (!wrapperRef.current.contains(e.target)) setOpen(false);
@@ -5457,7 +5752,7 @@ function PeriodsDropdown({
5457
5752
  document.removeEventListener("keydown", handleEscape);
5458
5753
  };
5459
5754
  }, []);
5460
- useEffect8(() => {
5755
+ useEffect9(() => {
5461
5756
  if (open && firstItemRef.current) {
5462
5757
  firstItemRef.current.focus();
5463
5758
  }
@@ -5467,8 +5762,8 @@ function PeriodsDropdown({
5467
5762
  setOpen(false);
5468
5763
  }
5469
5764
  const containerStyle = typeof rightOffset === "number" ? { position: "relative", zIndex: 30 } : { position: "relative", zIndex: 30 };
5470
- return /* @__PURE__ */ jsxs31("div", { ref: wrapperRef, style: containerStyle, className: "mr-4", children: [
5471
- /* @__PURE__ */ jsxs31(
5765
+ return /* @__PURE__ */ jsxs32("div", { ref: wrapperRef, style: containerStyle, className: "mr-4", children: [
5766
+ /* @__PURE__ */ jsxs32(
5472
5767
  "button",
5473
5768
  {
5474
5769
  className: "relative p-2.5 rounded-md hover:bg-accent/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-accent/50 transition flex items-center justify-center",
@@ -5491,8 +5786,8 @@ function PeriodsDropdown({
5491
5786
  ]
5492
5787
  }
5493
5788
  ),
5494
- /* @__PURE__ */ jsx49(AnimatePresence6, { children: open && /* @__PURE__ */ jsxs31(
5495
- motion7.div,
5789
+ /* @__PURE__ */ jsx49(AnimatePresence8, { children: open && /* @__PURE__ */ jsxs32(
5790
+ motion11.div,
5496
5791
  {
5497
5792
  initial: "hidden",
5498
5793
  animate: "visible",
@@ -5520,8 +5815,8 @@ function PeriodsDropdown({
5520
5815
  ref: listRef,
5521
5816
  className: "flex flex-col p-2 gap-1",
5522
5817
  style: { maxHeight: 200, overflowY: "auto" },
5523
- children: periods.map((p, idx) => /* @__PURE__ */ jsxs31(
5524
- motion7.button,
5818
+ children: periods.map((p, idx) => /* @__PURE__ */ jsxs32(
5819
+ motion11.button,
5525
5820
  {
5526
5821
  className: "flex items-center justify-between w-full text-left px-3 py-2.5 rounded focus:outline-none transition-colors " + (activePeriods && activePeriods.includes(p) || p === activePeriod ? "bg-accent/10 font-medium" : "hover:bg-accent/15 focus-visible:ring-2 focus-visible:ring-accent/30"),
5527
5822
  variants: itemVariants,
@@ -5549,9 +5844,9 @@ function PeriodsDropdown({
5549
5844
  var PeriodsDropdown_default = PeriodsDropdown;
5550
5845
 
5551
5846
  // src/components/charts/components/controls/ShowOnly.tsx
5552
- import { motion as motion8 } from "framer-motion";
5847
+ import { motion as motion12 } from "framer-motion";
5553
5848
  import { Eye, EyeSlash } from "@phosphor-icons/react";
5554
- import { Fragment as Fragment6, jsx as jsx50, jsxs as jsxs32 } from "react/jsx-runtime";
5849
+ import { Fragment as Fragment6, jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
5555
5850
  var ShowOnly = ({
5556
5851
  showOnlyHighlighted,
5557
5852
  setShowOnlyHighlighted,
@@ -5560,7 +5855,7 @@ var ShowOnly = ({
5560
5855
  const hasHighlights = highlightedSeriesSize > 0;
5561
5856
  if (!hasHighlights) return null;
5562
5857
  return /* @__PURE__ */ jsx50("div", { className: "ml-auto flex items-center gap-2", children: /* @__PURE__ */ jsx50(
5563
- motion8.div,
5858
+ motion12.div,
5564
5859
  {
5565
5860
  whileTap: { scale: hasHighlights ? 0.985 : 1 },
5566
5861
  whileHover: { y: hasHighlights ? -2 : 0 },
@@ -5578,10 +5873,10 @@ var ShowOnly = ({
5578
5873
  "focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary/60",
5579
5874
  !hasHighlights ? "opacity-60 cursor-not-allowed pointer-events-none" : showOnlyHighlighted ? "bg-primary/10 text-primary shadow-sm border border-primary/20" : "bg-transparent text-muted-foreground border border-transparent hover:bg-muted/10 hover:text-foreground"
5580
5875
  ),
5581
- children: showOnlyHighlighted ? /* @__PURE__ */ jsxs32(Fragment6, { children: [
5876
+ children: showOnlyHighlighted ? /* @__PURE__ */ jsxs33(Fragment6, { children: [
5582
5877
  /* @__PURE__ */ jsx50(EyeSlash, { size: 16, weight: "regular" }),
5583
5878
  /* @__PURE__ */ jsx50("span", { className: "sr-only", children: "Exibir todos" })
5584
- ] }) : /* @__PURE__ */ jsxs32(Fragment6, { children: [
5879
+ ] }) : /* @__PURE__ */ jsxs33(Fragment6, { children: [
5585
5880
  /* @__PURE__ */ jsx50(Eye, { size: 16, weight: "bold" }),
5586
5881
  /* @__PURE__ */ jsx50("span", { className: "sr-only", children: "Mostrar somente destacados" })
5587
5882
  ] })
@@ -5593,9 +5888,9 @@ var ShowOnly = ({
5593
5888
  var ShowOnly_default = ShowOnly;
5594
5889
 
5595
5890
  // src/components/charts/components/controls/Highlights.tsx
5596
- import { motion as motion9, AnimatePresence as AnimatePresence7 } from "framer-motion";
5891
+ import { motion as motion13, AnimatePresence as AnimatePresence9 } from "framer-motion";
5597
5892
  import { CheckIcon as CheckIcon7 } from "@phosphor-icons/react/dist/ssr";
5598
- import { jsx as jsx51, jsxs as jsxs33 } from "react/jsx-runtime";
5893
+ import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
5599
5894
  var Highlights = ({
5600
5895
  allKeys,
5601
5896
  mapperConfig,
@@ -5614,13 +5909,13 @@ var Highlights = ({
5614
5909
  visible: { opacity: 1, transition: { staggerChildren: 0.03 } }
5615
5910
  };
5616
5911
  return /* @__PURE__ */ jsx51(
5617
- motion9.div,
5912
+ motion13.div,
5618
5913
  {
5619
5914
  className: "flex-1 flex items-center gap-2 flex-wrap",
5620
5915
  initial: "hidden",
5621
5916
  animate: "visible",
5622
5917
  variants: containerVariants,
5623
- children: /* @__PURE__ */ jsx51(AnimatePresence7, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
5918
+ children: /* @__PURE__ */ jsx51(AnimatePresence9, { initial: false, mode: "popLayout", children: allKeys.map((k) => {
5624
5919
  const isHighlighted = highlightedSeries.has(k);
5625
5920
  const label = mapperConfig[k]?.label ?? k;
5626
5921
  const color = finalColors[k];
@@ -5630,7 +5925,7 @@ var Highlights = ({
5630
5925
  isHighlighted ? "bg-card/95 border-2 text-foreground shadow-[0_6px_18px_rgba(0,0,0,0.12)]" : "bg-muted/10 border-border text-muted-foreground hover:bg-muted/5"
5631
5926
  );
5632
5927
  return /* @__PURE__ */ jsx51(
5633
- motion9.div,
5928
+ motion13.div,
5634
5929
  {
5635
5930
  layout: true,
5636
5931
  initial: "hidden",
@@ -5646,8 +5941,8 @@ var Highlights = ({
5646
5941
  className: pillClasses,
5647
5942
  style: { minWidth: showFullLabel ? void 0 : 36 },
5648
5943
  "aria-pressed": isHighlighted,
5649
- children: /* @__PURE__ */ jsxs33(
5650
- motion9.button,
5944
+ children: /* @__PURE__ */ jsxs34(
5945
+ motion13.button,
5651
5946
  {
5652
5947
  whileHover: { scale: isHighlighted ? 1.04 : 1.03 },
5653
5948
  whileTap: { scale: 0.96 },
@@ -5655,7 +5950,7 @@ var Highlights = ({
5655
5950
  className: "flex items-center gap-2 min-w-0 pr-2",
5656
5951
  children: [
5657
5952
  /* @__PURE__ */ jsx51(
5658
- motion9.span,
5953
+ motion13.span,
5659
5954
  {
5660
5955
  className: cn("w-3 h-3 rounded-sm flex-shrink-0 border"),
5661
5956
  style: {
@@ -5669,8 +5964,8 @@ var Highlights = ({
5669
5964
  transition: { type: "spring", stiffness: 400, damping: 30 }
5670
5965
  }
5671
5966
  ),
5672
- showFullLabel ? /* @__PURE__ */ jsx51(motion9.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ jsx51(
5673
- motion9.span,
5967
+ showFullLabel ? /* @__PURE__ */ jsx51(motion13.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ jsx51(
5968
+ motion13.span,
5674
5969
  {
5675
5970
  className: "truncate max-w-[6rem] text-xs pr-2",
5676
5971
  layout: true,
@@ -5678,7 +5973,7 @@ var Highlights = ({
5678
5973
  }
5679
5974
  ) : null,
5680
5975
  /* @__PURE__ */ jsx51(
5681
- motion9.span,
5976
+ motion13.span,
5682
5977
  {
5683
5978
  "aria-hidden": true,
5684
5979
  initial: { opacity: 0, scale: 0.6 },
@@ -5708,7 +6003,7 @@ var Highlights_default = Highlights;
5708
6003
 
5709
6004
  // src/components/charts/components/controls/CloseAllButton.tsx
5710
6005
  import { XIcon as XIcon5 } from "@phosphor-icons/react/dist/ssr";
5711
- import { jsx as jsx52, jsxs as jsxs34 } from "react/jsx-runtime";
6006
+ import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
5712
6007
  var CloseAllButton = ({
5713
6008
  count,
5714
6009
  onCloseAll,
@@ -5744,7 +6039,7 @@ var CloseAllButton = ({
5744
6039
  `;
5745
6040
  };
5746
6041
  if (variant === "inline") {
5747
- return /* @__PURE__ */ jsx52("div", { className: "absolute top-4 right-4 z-30", children: /* @__PURE__ */ jsxs34(
6042
+ return /* @__PURE__ */ jsx52("div", { className: "absolute top-4 right-4 z-30", children: /* @__PURE__ */ jsxs35(
5748
6043
  ButtonBase,
5749
6044
  {
5750
6045
  variant: "ghost",
@@ -5762,7 +6057,7 @@ var CloseAllButton = ({
5762
6057
  "div",
5763
6058
  {
5764
6059
  className: `${getPositionClasses()} animate-in fade-in slide-in-from-top-2 duration-300`,
5765
- children: /* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsxs34(
6060
+ children: /* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsxs35(
5766
6061
  ButtonBase,
5767
6062
  {
5768
6063
  onClick: onCloseAll,
@@ -5788,16 +6083,16 @@ var CloseAllButton_default = CloseAllButton;
5788
6083
 
5789
6084
  // src/components/charts/components/tooltips/DraggableTooltip.tsx
5790
6085
  import React34, {
5791
- useEffect as useEffect9,
5792
- useRef as useRef3,
5793
- useState as useState10,
6086
+ useEffect as useEffect10,
6087
+ useRef as useRef4,
6088
+ useState as useState11,
5794
6089
  useCallback as useCallback6,
5795
6090
  useMemo as useMemo5
5796
6091
  } from "react";
5797
- import { motion as motion10, AnimatePresence as AnimatePresence8 } from "framer-motion";
6092
+ import { motion as motion14, AnimatePresence as AnimatePresence10 } from "framer-motion";
5798
6093
  import { DotsSixVerticalIcon } from "@phosphor-icons/react";
5799
6094
  import { XIcon as XIcon6 } from "@phosphor-icons/react/dist/ssr";
5800
- import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs35 } from "react/jsx-runtime";
6095
+ import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs36 } from "react/jsx-runtime";
5801
6096
  var ALIGNMENT_THRESHOLD = 25;
5802
6097
  var GUIDE_THRESHOLD = 60;
5803
6098
  var STRONG_SNAP_THRESHOLD = 35;
@@ -5882,7 +6177,7 @@ var DraggableTooltipComponent = ({
5882
6177
  const numeric = visibleKeys2.map((k) => data2[k]).filter((v) => typeof v === "number");
5883
6178
  return numeric.reduce((s, v) => s + (v || 0), 0);
5884
6179
  }, [data2, visibleKeys2]);
5885
- return /* @__PURE__ */ jsxs35("div", { className: "text-sm", children: [
6180
+ return /* @__PURE__ */ jsxs36("div", { className: "text-sm", children: [
5886
6181
  /* @__PURE__ */ jsx53("div", { className: "text-sm text-muted-foreground", children: "Total" }),
5887
6182
  /* @__PURE__ */ jsx53(
5888
6183
  "div",
@@ -5894,13 +6189,13 @@ var DraggableTooltipComponent = ({
5894
6189
  ] });
5895
6190
  }
5896
6191
  );
5897
- const [localPos, setLocalPos] = useState10(position);
5898
- const [dragging, setDragging] = useState10(false);
5899
- const offsetRef = useRef3({ x: 0, y: 0 });
5900
- const lastMouse = useRef3({ x: 0, y: 0 });
5901
- const [alignmentGuides, setAlignmentGuides] = useState10([]);
5902
- const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = useState10(0);
5903
- useEffect9(() => setLocalPos(position), [position]);
6192
+ const [localPos, setLocalPos] = useState11(position);
6193
+ const [dragging, setDragging] = useState11(false);
6194
+ const offsetRef = useRef4({ x: 0, y: 0 });
6195
+ const lastMouse = useRef4({ x: 0, y: 0 });
6196
+ const [alignmentGuides, setAlignmentGuides] = useState11([]);
6197
+ const [globalTooltipCountLocal, setGlobalTooltipCountLocal] = useState11(0);
6198
+ useEffect10(() => setLocalPos(position), [position]);
5904
6199
  const getAllTooltips = useCallback6(() => {
5905
6200
  const response = [];
5906
6201
  const ev = new CustomEvent("requestGlobalTooltips", {
@@ -6005,7 +6300,7 @@ var DraggableTooltipComponent = ({
6005
6300
  },
6006
6301
  [alignmentGuides]
6007
6302
  );
6008
- useEffect9(() => {
6303
+ useEffect10(() => {
6009
6304
  let rafId = null;
6010
6305
  const handleMouseMove = (e) => {
6011
6306
  if (!dragging) return;
@@ -6047,7 +6342,7 @@ var DraggableTooltipComponent = ({
6047
6342
  document.body.style.userSelect = "";
6048
6343
  };
6049
6344
  }, [dragging, snapToGuides, updateAlignmentGuides, id, onPositionChange]);
6050
- useEffect9(() => {
6345
+ useEffect10(() => {
6051
6346
  const handleCloseAll = () => onClose(id);
6052
6347
  const handleRequestTooltipCount = () => {
6053
6348
  window.dispatchEvent(
@@ -6078,7 +6373,7 @@ var DraggableTooltipComponent = ({
6078
6373
  });
6079
6374
  };
6080
6375
  }, [id, localPos, onClose]);
6081
- useEffect9(() => {
6376
+ useEffect10(() => {
6082
6377
  if (dragging) return;
6083
6378
  let total = 0;
6084
6379
  const timeoutId = setTimeout(() => {
@@ -6096,7 +6391,7 @@ var DraggableTooltipComponent = ({
6096
6391
  }, 0);
6097
6392
  return () => clearTimeout(timeoutId);
6098
6393
  }, [localPos, dragging]);
6099
- useEffect9(() => {
6394
+ useEffect10(() => {
6100
6395
  const recount = () => {
6101
6396
  if (dragging) return;
6102
6397
  let total = 0;
@@ -6147,7 +6442,7 @@ var DraggableTooltipComponent = ({
6147
6442
  },
6148
6443
  [id, onClose]
6149
6444
  );
6150
- return /* @__PURE__ */ jsxs35(Fragment7, { children: [
6445
+ return /* @__PURE__ */ jsxs36(Fragment7, { children: [
6151
6446
  dragging && alignmentGuides.map((guide, index) => {
6152
6447
  const isHorizontal = guide.type === "horizontal";
6153
6448
  const color = isHorizontal ? "#3b82f6" : "#ef4444";
@@ -6167,9 +6462,9 @@ var DraggableTooltipComponent = ({
6167
6462
  guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
6168
6463
  guide.targetTooltip.top + guide.targetTooltip.height / 2
6169
6464
  );
6170
- return /* @__PURE__ */ jsxs35("div", { children: [
6465
+ return /* @__PURE__ */ jsxs36("div", { children: [
6171
6466
  /* @__PURE__ */ jsx53(
6172
- motion10.div,
6467
+ motion14.div,
6173
6468
  {
6174
6469
  className: "fixed pointer-events-none z-30",
6175
6470
  variants: guideVariants,
@@ -6191,7 +6486,7 @@ var DraggableTooltipComponent = ({
6191
6486
  }
6192
6487
  ),
6193
6488
  /* @__PURE__ */ jsx53(
6194
- motion10.div,
6489
+ motion14.div,
6195
6490
  {
6196
6491
  className: "fixed pointer-events-none z-31",
6197
6492
  variants: guideDotVariants,
@@ -6210,7 +6505,7 @@ var DraggableTooltipComponent = ({
6210
6505
  }
6211
6506
  ),
6212
6507
  /* @__PURE__ */ jsx53(
6213
- motion10.div,
6508
+ motion14.div,
6214
6509
  {
6215
6510
  className: "fixed pointer-events-none z-31",
6216
6511
  variants: guideDotVariants,
@@ -6230,8 +6525,8 @@ var DraggableTooltipComponent = ({
6230
6525
  )
6231
6526
  ] }, index);
6232
6527
  }),
6233
- /* @__PURE__ */ jsx53(AnimatePresence8, { children: /* @__PURE__ */ jsxs35(
6234
- motion10.div,
6528
+ /* @__PURE__ */ jsx53(AnimatePresence10, { children: /* @__PURE__ */ jsxs36(
6529
+ motion14.div,
6235
6530
  {
6236
6531
  className: "fixed bg-card border border-border rounded-lg shadow-lg z-50 min-w-80 select-none",
6237
6532
  variants: tooltipVariants,
@@ -6248,7 +6543,7 @@ var DraggableTooltipComponent = ({
6248
6543
  role: "dialog",
6249
6544
  "aria-label": title ? `Tooltip ${title}` : `Tooltip ${data.name}`,
6250
6545
  children: [
6251
- /* @__PURE__ */ jsxs35(
6546
+ /* @__PURE__ */ jsxs36(
6252
6547
  "div",
6253
6548
  {
6254
6549
  className: "flex items-center justify-between p-3 pb-2 border-b bg-muted/20 rounded-t-lg",
@@ -6270,14 +6565,14 @@ var DraggableTooltipComponent = ({
6270
6565
  ]
6271
6566
  }
6272
6567
  ),
6273
- /* @__PURE__ */ jsx53("div", { className: "px-3 py-2 bg-accent/5 border-l-4 border-primary", children: /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between gap-2", children: [
6274
- /* @__PURE__ */ jsxs35("div", { children: [
6568
+ /* @__PURE__ */ jsx53("div", { className: "px-3 py-2 bg-accent/5 border-l-4 border-primary", children: /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between gap-2", children: [
6569
+ /* @__PURE__ */ jsxs36("div", { children: [
6275
6570
  /* @__PURE__ */ jsx53("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: periodLabel }),
6276
6571
  /* @__PURE__ */ jsx53("p", { className: "font-bold text-lg text-foreground mt-1 truncate", children: data.name })
6277
6572
  ] }),
6278
6573
  /* @__PURE__ */ jsx53("div", { className: "text-right", children: /* @__PURE__ */ jsx53(TotalDisplay, { data, visibleKeys }) })
6279
6574
  ] }) }),
6280
- /* @__PURE__ */ jsxs35("div", { className: "p-3 pt-2 space-y-2", children: [
6575
+ /* @__PURE__ */ jsxs36("div", { className: "p-3 pt-2 space-y-2", children: [
6281
6576
  /* @__PURE__ */ jsx53("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: dataLabel }),
6282
6577
  useMemo5(
6283
6578
  () => visibleKeys.map((key) => {
@@ -6294,7 +6589,7 @@ var DraggableTooltipComponent = ({
6294
6589
  const pct = absDenominator > 0 ? Math.abs(val) / absDenominator * 100 : 0;
6295
6590
  const isDimmed = highlightedSeries && highlightedSeries.size > 0 && !highlightedSeries.has(key);
6296
6591
  const isHighlighted = highlightedSeries && highlightedSeries.has(key);
6297
- return /* @__PURE__ */ jsxs35(
6592
+ return /* @__PURE__ */ jsxs36(
6298
6593
  "div",
6299
6594
  {
6300
6595
  role: "button",
@@ -6312,8 +6607,8 @@ var DraggableTooltipComponent = ({
6312
6607
  border: isHighlighted ? `1px solid ${finalColors[key] || "#666"}22` : void 0
6313
6608
  },
6314
6609
  children: [
6315
- /* @__PURE__ */ jsxs35("div", { className: "flex items-center justify-between", children: [
6316
- /* @__PURE__ */ jsxs35("div", { className: "flex items-center gap-2", children: [
6610
+ /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between", children: [
6611
+ /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2", children: [
6317
6612
  /* @__PURE__ */ jsx53(
6318
6613
  "div",
6319
6614
  {
@@ -6331,7 +6626,7 @@ var DraggableTooltipComponent = ({
6331
6626
  }
6332
6627
  )
6333
6628
  ] }),
6334
- /* @__PURE__ */ jsxs35("div", { className: "flex items-baseline gap-2", children: [
6629
+ /* @__PURE__ */ jsxs36("div", { className: "flex items-baseline gap-2", children: [
6335
6630
  /* @__PURE__ */ jsx53(
6336
6631
  "span",
6337
6632
  {
@@ -6368,7 +6663,7 @@ var DraggableTooltipComponent = ({
6368
6663
  finalColors
6369
6664
  ]
6370
6665
  ),
6371
- /* @__PURE__ */ jsx53("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ jsxs35("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
6666
+ /* @__PURE__ */ jsx53("div", { className: "mt-3 pt-2 border-t", children: /* @__PURE__ */ jsxs36("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
6372
6667
  "Clique no ",
6373
6668
  /* @__PURE__ */ jsx53(XIcon6, { size: 12 }),
6374
6669
  " para remover"
@@ -6394,7 +6689,7 @@ DraggableTooltip.displayName = "DraggableTooltip";
6394
6689
  var DraggableTooltip_default = DraggableTooltip;
6395
6690
 
6396
6691
  // src/components/charts/components/tooltips/TooltipWithTotal.tsx
6397
- import { jsx as jsx54, jsxs as jsxs36 } from "react/jsx-runtime";
6692
+ import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
6398
6693
  var RechartTooltipWithTotal = ({
6399
6694
  active,
6400
6695
  payload,
@@ -6413,7 +6708,7 @@ var RechartTooltipWithTotal = ({
6413
6708
  (sum, p) => sum + Math.abs(typeof p.value === "number" ? p.value : 0),
6414
6709
  0
6415
6710
  );
6416
- return /* @__PURE__ */ jsxs36(
6711
+ return /* @__PURE__ */ jsxs37(
6417
6712
  "div",
6418
6713
  {
6419
6714
  role: "dialog",
@@ -6421,12 +6716,12 @@ var RechartTooltipWithTotal = ({
6421
6716
  className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-xs",
6422
6717
  style: { minWidth: 220 },
6423
6718
  children: [
6424
- /* @__PURE__ */ jsxs36("div", { className: "flex items-start justify-between mb-2", children: [
6425
- /* @__PURE__ */ jsxs36("div", { className: "pr-2", children: [
6719
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-start justify-between mb-2", children: [
6720
+ /* @__PURE__ */ jsxs37("div", { className: "pr-2", children: [
6426
6721
  /* @__PURE__ */ jsx54("p", { className: "text-xs text-muted-foreground", children: periodLabel }),
6427
6722
  /* @__PURE__ */ jsx54("p", { className: "font-medium text-foreground truncate", children: label })
6428
6723
  ] }),
6429
- /* @__PURE__ */ jsxs36("div", { className: "text-right ml-3", children: [
6724
+ /* @__PURE__ */ jsxs37("div", { className: "text-right ml-3", children: [
6430
6725
  /* @__PURE__ */ jsx54("p", { className: "text-xs text-muted-foreground", children: totalLabel }),
6431
6726
  /* @__PURE__ */ jsx54(
6432
6727
  "p",
@@ -6442,9 +6737,9 @@ var RechartTooltipWithTotal = ({
6442
6737
  const pct = absDenominator > 0 ? Math.abs(value) / absDenominator * 100 : 0;
6443
6738
  const baseColor = finalColors[entry.dataKey] || entry.color || "#999";
6444
6739
  const isNeg = value < 0;
6445
- return /* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-1", children: [
6446
- /* @__PURE__ */ jsxs36("div", { className: "flex items-center justify-between text-sm", children: [
6447
- /* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-2 truncate", children: [
6740
+ return /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-1", children: [
6741
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-center justify-between text-sm", children: [
6742
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-2 truncate", children: [
6448
6743
  /* @__PURE__ */ jsx54(
6449
6744
  "span",
6450
6745
  {
@@ -6455,7 +6750,7 @@ var RechartTooltipWithTotal = ({
6455
6750
  ),
6456
6751
  /* @__PURE__ */ jsx54("span", { className: "text-muted-foreground truncate", children: entry.name })
6457
6752
  ] }),
6458
- /* @__PURE__ */ jsxs36("div", { className: "flex items-baseline gap-3 ml-3", children: [
6753
+ /* @__PURE__ */ jsxs37("div", { className: "flex items-baseline gap-3 ml-3", children: [
6459
6754
  /* @__PURE__ */ jsx54(
6460
6755
  "span",
6461
6756
  {
@@ -6485,7 +6780,7 @@ var RechartTooltipWithTotal = ({
6485
6780
  var TooltipWithTotal_default = RechartTooltipWithTotal;
6486
6781
 
6487
6782
  // src/components/charts/components/tooltips/TooltipSimple.tsx
6488
- import { jsx as jsx55, jsxs as jsxs37 } from "react/jsx-runtime";
6783
+ import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
6489
6784
  var TooltipSimple = ({
6490
6785
  active,
6491
6786
  payload,
@@ -6494,7 +6789,7 @@ var TooltipSimple = ({
6494
6789
  periodLabel = "Per\xEDodo"
6495
6790
  }) => {
6496
6791
  if (!active || !payload || payload.length === 0) return null;
6497
- return /* @__PURE__ */ jsxs37(
6792
+ return /* @__PURE__ */ jsxs38(
6498
6793
  "div",
6499
6794
  {
6500
6795
  role: "dialog",
@@ -6502,19 +6797,19 @@ var TooltipSimple = ({
6502
6797
  className: "bg-card border border-border rounded-lg p-3 shadow-2xl max-w-[280px]",
6503
6798
  style: { minWidth: 220 },
6504
6799
  children: [
6505
- /* @__PURE__ */ jsx55("div", { className: "mb-2", children: /* @__PURE__ */ jsx55("div", { className: "flex items-center justify-between gap-3", children: /* @__PURE__ */ jsxs37("div", { className: "min-w-0", children: [
6800
+ /* @__PURE__ */ jsx55("div", { className: "mb-2", children: /* @__PURE__ */ jsx55("div", { className: "flex items-center justify-between gap-3", children: /* @__PURE__ */ jsxs38("div", { className: "min-w-0", children: [
6506
6801
  /* @__PURE__ */ jsx55("p", { className: "text-xs text-muted-foreground", children: periodLabel }),
6507
6802
  /* @__PURE__ */ jsx55("p", { className: "font-medium text-foreground truncate", children: label })
6508
6803
  ] }) }) }),
6509
6804
  /* @__PURE__ */ jsx55("div", { className: "divide-y divide-border rounded-md overflow-hidden", children: payload.map((entry, index) => {
6510
6805
  const value = typeof entry.value === "number" ? entry.value : 0;
6511
6806
  const color = finalColors[entry.dataKey] || entry.color || "#999";
6512
- return /* @__PURE__ */ jsxs37(
6807
+ return /* @__PURE__ */ jsxs38(
6513
6808
  "div",
6514
6809
  {
6515
6810
  className: "flex items-center justify-between text-sm px-2 py-2 bg-card/0 hover:bg-muted transition-colors",
6516
6811
  children: [
6517
- /* @__PURE__ */ jsxs37("div", { className: "flex items-center gap-3 min-w-0", children: [
6812
+ /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-3 min-w-0", children: [
6518
6813
  /* @__PURE__ */ jsx55(
6519
6814
  "span",
6520
6815
  {
@@ -6544,7 +6839,7 @@ var TooltipSimple = ({
6544
6839
  var TooltipSimple_default = TooltipSimple;
6545
6840
 
6546
6841
  // src/components/charts/utils/pillLabelRenderer.tsx
6547
- import { jsx as jsx56, jsxs as jsxs38 } from "react/jsx-runtime";
6842
+ import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
6548
6843
  var formatCompactNumber = (value) => {
6549
6844
  const isNegative = value < 0;
6550
6845
  const absValue = Math.abs(value);
@@ -6625,7 +6920,7 @@ var renderPillLabel = (color, variant) => {
6625
6920
  textColor = "#374151";
6626
6921
  }
6627
6922
  }
6628
- return /* @__PURE__ */ jsxs38("g", { children: [
6923
+ return /* @__PURE__ */ jsxs39("g", { children: [
6629
6924
  /* @__PURE__ */ jsx56(
6630
6925
  "rect",
6631
6926
  {
@@ -6659,7 +6954,7 @@ var renderPillLabel = (color, variant) => {
6659
6954
  var pillLabelRenderer_default = renderPillLabel;
6660
6955
 
6661
6956
  // src/components/charts/Chart.tsx
6662
- import { jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
6957
+ import { jsx as jsx57, jsxs as jsxs40 } from "react/jsx-runtime";
6663
6958
  var DEFAULT_COLORS = ["#55af7d", "#8e68ff", "#2273e1"];
6664
6959
  var Chart = ({
6665
6960
  data,
@@ -6709,12 +7004,12 @@ var Chart = ({
6709
7004
  return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
6710
7005
  }, [data, xAxis, labelMap]);
6711
7006
  const { xAxisConfig, mapperConfig } = smartConfig;
6712
- const [activeTooltips, setActiveTooltips] = useState11([]);
6713
- const [highlightedSeries, setHighlightedSeries] = useState11(
7007
+ const [activeTooltips, setActiveTooltips] = useState12([]);
7008
+ const [highlightedSeries, setHighlightedSeries] = useState12(
6714
7009
  /* @__PURE__ */ new Set()
6715
7010
  );
6716
- const [showOnlyHighlighted, setShowOnlyHighlighted] = useState11(false);
6717
- useEffect10(() => {
7011
+ const [showOnlyHighlighted, setShowOnlyHighlighted] = useState12(false);
7012
+ useEffect11(() => {
6718
7013
  if (highlightedSeries.size === 0 && showOnlyHighlighted) {
6719
7014
  setShowOnlyHighlighted(false);
6720
7015
  }
@@ -6723,8 +7018,8 @@ var Chart = ({
6723
7018
  ...item,
6724
7019
  name: String(item[xAxisConfig.dataKey] || "N/A")
6725
7020
  }));
6726
- const wrapperRef = useRef4(null);
6727
- const [measuredWidth, setMeasuredWidth] = useState11(null);
7021
+ const wrapperRef = useRef5(null);
7022
+ const [measuredWidth, setMeasuredWidth] = useState12(null);
6728
7023
  useLayoutEffect(() => {
6729
7024
  const el = wrapperRef.current;
6730
7025
  if (!el) return;
@@ -6778,7 +7073,7 @@ var Chart = ({
6778
7073
  () => activeTooltips.map((t) => adaptDataForTooltip(t.data).name),
6779
7074
  [activeTooltips, adaptDataForTooltip]
6780
7075
  );
6781
- useEffect10(() => {
7076
+ useEffect11(() => {
6782
7077
  window.dispatchEvent(new Event("recountTooltips"));
6783
7078
  }, [activeTooltips.length]);
6784
7079
  const toggleHighlight = useCallback7((key) => {
@@ -7021,7 +7316,7 @@ var Chart = ({
7021
7316
  overflowY: "hidden",
7022
7317
  minWidth: 0
7023
7318
  },
7024
- children: /* @__PURE__ */ jsxs39(
7319
+ children: /* @__PURE__ */ jsxs40(
7025
7320
  "div",
7026
7321
  {
7027
7322
  className: cn("rounded-lg bg-card p-2 relative", className),
@@ -7042,7 +7337,7 @@ var Chart = ({
7042
7337
  children: /* @__PURE__ */ jsx57("h3", { className: titleClassName, children: title })
7043
7338
  }
7044
7339
  ),
7045
- allKeys.length > 0 && (finalEnableHighlights || finalEnableShowOnly) && /* @__PURE__ */ jsxs39(
7340
+ allKeys.length > 0 && (finalEnableHighlights || finalEnableShowOnly) && /* @__PURE__ */ jsxs40(
7046
7341
  "div",
7047
7342
  {
7048
7343
  className: "flex items-center w-full",
@@ -7117,7 +7412,7 @@ var Chart = ({
7117
7412
  )
7118
7413
  }
7119
7414
  ),
7120
- /* @__PURE__ */ jsx57(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs39(
7415
+ /* @__PURE__ */ jsx57(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs40(
7121
7416
  ComposedChart,
7122
7417
  {
7123
7418
  data: processedData,
@@ -7331,7 +7626,7 @@ var Chart = ({
7331
7626
  var Chart_default = Chart;
7332
7627
 
7333
7628
  // src/components/charts/BarChart.tsx
7334
- import { useState as useState12, useEffect as useEffect11, useCallback as useCallback8, useMemo as useMemo7 } from "react";
7629
+ import { useState as useState13, useEffect as useEffect12, useCallback as useCallback8, useMemo as useMemo7 } from "react";
7335
7630
  import {
7336
7631
  BarChart as RechartsBarChart,
7337
7632
  Bar as Bar2,
@@ -7343,7 +7638,7 @@ import {
7343
7638
  Legend as Legend2,
7344
7639
  LabelList as LabelList2
7345
7640
  } from "recharts";
7346
- import { jsx as jsx58, jsxs as jsxs40 } from "react/jsx-runtime";
7641
+ import { jsx as jsx58, jsxs as jsxs41 } from "react/jsx-runtime";
7347
7642
  var DEFAULT_COLORS2 = ["#55af7d", "#8e68ff", "#2273e1"];
7348
7643
  var BarChart = ({
7349
7644
  data,
@@ -7423,14 +7718,14 @@ var BarChart = ({
7423
7718
  return { xAxisConfig: xAxisConfig2, mapperConfig: mapperConfig2 };
7424
7719
  }, [data, xAxis, mapper, yAxis, autoDetect, labelMap]);
7425
7720
  const { xAxisConfig, mapperConfig } = smartConfig;
7426
- const [activeTooltips, setActiveTooltips] = useState12([]);
7427
- const [isDragging, setIsDragging] = useState12(null);
7428
- const [dragOffset, setDragOffset] = useState12({
7429
- x: 0,
7721
+ const [activeTooltips, setActiveTooltips] = useState13([]);
7722
+ const [isDragging, setIsDragging] = useState13(null);
7723
+ const [dragOffset, setDragOffset] = useState13({
7724
+ x: 0,
7430
7725
  y: 0
7431
7726
  });
7432
- const [globalTooltipCount, setGlobalTooltipCount] = useState12(0);
7433
- const [alignmentGuides, setAlignmentGuides] = useState12([]);
7727
+ const [globalTooltipCount, setGlobalTooltipCount] = useState13(0);
7728
+ const [alignmentGuides, setAlignmentGuides] = useState13([]);
7434
7729
  const processedData = data.map((item) => ({
7435
7730
  ...item,
7436
7731
  name: String(item[xAxisConfig.dataKey] || "N/A")
@@ -7633,7 +7928,7 @@ var BarChart = ({
7633
7928
  setIsDragging(tooltipId);
7634
7929
  setDragOffset({ x: offsetX, y: offsetY });
7635
7930
  };
7636
- useEffect11(() => {
7931
+ useEffect12(() => {
7637
7932
  let rafId;
7638
7933
  let lastMousePosition = { x: 0, y: 0 };
7639
7934
  const handleGlobalMouseMove = (e) => {
@@ -7691,7 +7986,7 @@ var BarChart = ({
7691
7986
  updateAlignmentGuides,
7692
7987
  snapToGuides
7693
7988
  ]);
7694
- useEffect11(() => {
7989
+ useEffect12(() => {
7695
7990
  const handleCloseAllTooltips = () => {
7696
7991
  setActiveTooltips([]);
7697
7992
  setGlobalTooltipCount(0);
@@ -7701,7 +7996,7 @@ var BarChart = ({
7701
7996
  window.removeEventListener("closeAllTooltips", handleCloseAllTooltips);
7702
7997
  };
7703
7998
  }, []);
7704
- useEffect11(() => {
7999
+ useEffect12(() => {
7705
8000
  const handleTooltipCountRequest = () => {
7706
8001
  window.dispatchEvent(
7707
8002
  new CustomEvent("tooltipCountResponse", {
@@ -7740,7 +8035,7 @@ var BarChart = ({
7740
8035
  );
7741
8036
  };
7742
8037
  }, [activeTooltips]);
7743
- useEffect11(() => {
8038
+ useEffect12(() => {
7744
8039
  if (isDragging) return;
7745
8040
  let totalCount = 0;
7746
8041
  const handleCountResponse = (event) => {
@@ -7764,10 +8059,10 @@ var BarChart = ({
7764
8059
  label
7765
8060
  }) => {
7766
8061
  if (!active || !payload) return null;
7767
- return /* @__PURE__ */ jsxs40("div", { className: "bg-card border border-border rounded-lg p-3 shadow-lg", children: [
8062
+ return /* @__PURE__ */ jsxs41("div", { className: "bg-card border border-border rounded-lg p-3 shadow-lg", children: [
7768
8063
  /* @__PURE__ */ jsx58("p", { className: "font-medium text-foreground mb-2", children: label }),
7769
8064
  payload.map(
7770
- (entry, index) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center gap-2 text-sm", children: [
8065
+ (entry, index) => /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2 text-sm", children: [
7771
8066
  /* @__PURE__ */ jsx58(
7772
8067
  "div",
7773
8068
  {
@@ -7775,7 +8070,7 @@ var BarChart = ({
7775
8070
  style: { backgroundColor: entry.color }
7776
8071
  }
7777
8072
  ),
7778
- /* @__PURE__ */ jsxs40("span", { className: "text-muted-foreground", children: [
8073
+ /* @__PURE__ */ jsxs41("span", { className: "text-muted-foreground", children: [
7779
8074
  entry.name,
7780
8075
  ":"
7781
8076
  ] }),
@@ -7796,7 +8091,7 @@ var BarChart = ({
7796
8091
  return `${baseClasses} text-left`;
7797
8092
  }
7798
8093
  };
7799
- return /* @__PURE__ */ jsxs40(
8094
+ return /* @__PURE__ */ jsxs41(
7800
8095
  "div",
7801
8096
  {
7802
8097
  className: cn("rounded-lg bg-card p-4 relative", className),
@@ -7806,7 +8101,7 @@ var BarChart = ({
7806
8101
  },
7807
8102
  children: [
7808
8103
  title && /* @__PURE__ */ jsx58("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx58("h3", { className: getTitleClassName(titlePosition), children: title }) }),
7809
- /* @__PURE__ */ jsxs40(
8104
+ /* @__PURE__ */ jsxs41(
7810
8105
  RechartsBarChart,
7811
8106
  {
7812
8107
  data: processedData,
@@ -7919,7 +8214,7 @@ var BarChart = ({
7919
8214
  guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
7920
8215
  guide.targetTooltip.top + guide.targetTooltip.height / 2
7921
8216
  );
7922
- return /* @__PURE__ */ jsxs40("div", { children: [
8217
+ return /* @__PURE__ */ jsxs41("div", { children: [
7923
8218
  /* @__PURE__ */ jsx58(
7924
8219
  "div",
7925
8220
  {
@@ -8006,7 +8301,7 @@ var BarChart = ({
8006
8301
  var BarChart_default = BarChart;
8007
8302
 
8008
8303
  // src/components/charts/LineChart.tsx
8009
- import { useState as useState13, useEffect as useEffect12, useCallback as useCallback9, useMemo as useMemo8 } from "react";
8304
+ import { useState as useState14, useEffect as useEffect13, useCallback as useCallback9, useMemo as useMemo8 } from "react";
8010
8305
  import {
8011
8306
  LineChart as RechartsLineChart,
8012
8307
  Line as Line2,
@@ -8017,7 +8312,7 @@ import {
8017
8312
  Legend as Legend3,
8018
8313
  LabelList as LabelList3
8019
8314
  } from "recharts";
8020
- import { jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
8315
+ import { jsx as jsx59, jsxs as jsxs42 } from "react/jsx-runtime";
8021
8316
  var defaultData = [
8022
8317
  { name: "A", value: 100 },
8023
8318
  { name: "B", value: 200 },
@@ -8049,14 +8344,14 @@ var CustomLineChart = ({
8049
8344
  containerPaddingLeft,
8050
8345
  16
8051
8346
  );
8052
- const [activeTooltips, setActiveTooltips] = useState13([]);
8053
- const [isDragging, setIsDragging] = useState13(null);
8054
- const [dragOffset, setDragOffset] = useState13({
8347
+ const [activeTooltips, setActiveTooltips] = useState14([]);
8348
+ const [isDragging, setIsDragging] = useState14(null);
8349
+ const [dragOffset, setDragOffset] = useState14({
8055
8350
  x: 0,
8056
8351
  y: 0
8057
8352
  });
8058
- const [globalTooltipCount, setGlobalTooltipCount] = useState13(0);
8059
- const [alignmentGuides, setAlignmentGuides] = useState13([]);
8353
+ const [globalTooltipCount, setGlobalTooltipCount] = useState14(0);
8354
+ const [alignmentGuides, setAlignmentGuides] = useState14([]);
8060
8355
  const generateColors = (dataKeys2) => {
8061
8356
  const colorMap = {};
8062
8357
  const allColors = generateAdditionalColors(colors2, dataKeys2.length);
@@ -8270,7 +8565,7 @@ var CustomLineChart = ({
8270
8565
  setIsDragging(tooltipId);
8271
8566
  setDragOffset({ x: offsetX, y: offsetY });
8272
8567
  };
8273
- useEffect12(() => {
8568
+ useEffect13(() => {
8274
8569
  let rafId;
8275
8570
  let lastMousePosition = { x: 0, y: 0 };
8276
8571
  const handleGlobalMouseMove = (e) => {
@@ -8317,7 +8612,7 @@ var CustomLineChart = ({
8317
8612
  updateAlignmentGuides,
8318
8613
  snapToGuides
8319
8614
  ]);
8320
- useEffect12(() => {
8615
+ useEffect13(() => {
8321
8616
  const handleCloseAllTooltips2 = () => {
8322
8617
  setActiveTooltips([]);
8323
8618
  setGlobalTooltipCount(0);
@@ -8327,7 +8622,7 @@ var CustomLineChart = ({
8327
8622
  window.removeEventListener("closeAllTooltips", handleCloseAllTooltips2);
8328
8623
  };
8329
8624
  }, []);
8330
- useEffect12(() => {
8625
+ useEffect13(() => {
8331
8626
  const handleTooltipCountRequest = () => {
8332
8627
  window.dispatchEvent(
8333
8628
  new CustomEvent("tooltipCountResponse", {
@@ -8371,7 +8666,7 @@ var CustomLineChart = ({
8371
8666
  );
8372
8667
  };
8373
8668
  }, [activeTooltips]);
8374
- useEffect12(() => {
8669
+ useEffect13(() => {
8375
8670
  if (isDragging) return;
8376
8671
  let totalCount = 0;
8377
8672
  const handleCountResponse = (event) => {
@@ -8399,7 +8694,7 @@ var CustomLineChart = ({
8399
8694
  return "text-left";
8400
8695
  }
8401
8696
  };
8402
- return /* @__PURE__ */ jsx59("div", { className: cn("relative", className), children: /* @__PURE__ */ jsxs41(
8697
+ return /* @__PURE__ */ jsx59("div", { className: cn("relative", className), children: /* @__PURE__ */ jsxs42(
8403
8698
  "div",
8404
8699
  {
8405
8700
  className: "rounded-lg bg-card p-4 relative border border-border",
@@ -8410,7 +8705,7 @@ var CustomLineChart = ({
8410
8705
  onClick: handleChartBackgroundClick,
8411
8706
  children: [
8412
8707
  title && /* @__PURE__ */ jsx59("div", { style: { paddingLeft: `${resolvedContainerPaddingLeft}px` }, children: /* @__PURE__ */ jsx59("div", { className: cn("mb-4", getTitleClass()), children: /* @__PURE__ */ jsx59("h3", { className: "text-lg font-semibold text-foreground", children: title }) }) }),
8413
- /* @__PURE__ */ jsxs41(
8708
+ /* @__PURE__ */ jsxs42(
8414
8709
  RechartsLineChart,
8415
8710
  {
8416
8711
  data,
@@ -8501,7 +8796,7 @@ var CustomLineChart = ({
8501
8796
  guide.sourceTooltip.top + guide.sourceTooltip.height / 2,
8502
8797
  guide.targetTooltip.top + guide.targetTooltip.height / 2
8503
8798
  );
8504
- return /* @__PURE__ */ jsxs41("div", { children: [
8799
+ return /* @__PURE__ */ jsxs42("div", { children: [
8505
8800
  /* @__PURE__ */ jsx59(
8506
8801
  "div",
8507
8802
  {
@@ -8594,7 +8889,7 @@ import {
8594
8889
  Tooltip as Tooltip4,
8595
8890
  Legend as Legend4
8596
8891
  } from "recharts";
8597
- import { jsx as jsx60, jsxs as jsxs42 } from "react/jsx-runtime";
8892
+ import { jsx as jsx60, jsxs as jsxs43 } from "react/jsx-runtime";
8598
8893
  var defaultData2 = [
8599
8894
  { name: "Vendas", value: 4e3 },
8600
8895
  { name: "Marketing", value: 3e3 },
@@ -8661,7 +8956,7 @@ var CustomPieChart = ({
8661
8956
  centerY = "50%"
8662
8957
  }) => {
8663
8958
  const finalColors = colors2 || DEFAULT_COLORS4;
8664
- return /* @__PURE__ */ jsx60("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx60(ResponsiveContainer2, { width, height, children: /* @__PURE__ */ jsxs42(RechartsPieChart, { children: [
8959
+ return /* @__PURE__ */ jsx60("div", { className: cn("w-full rounded-lg bg-card p-4", className), children: /* @__PURE__ */ jsx60(ResponsiveContainer2, { width, height, children: /* @__PURE__ */ jsxs43(RechartsPieChart, { children: [
8665
8960
  /* @__PURE__ */ jsx60(
8666
8961
  Pie,
8667
8962
  {
@@ -8700,12 +8995,12 @@ var CustomPieChart = ({
8700
8995
  var PieChart_default = CustomPieChart;
8701
8996
 
8702
8997
  // src/components/charts/hooks/useChartHighlights.tsx
8703
- import { useState as useState14, useCallback as useCallback10 } from "react";
8998
+ import { useState as useState15, useCallback as useCallback10 } from "react";
8704
8999
  var useChartHighlights = () => {
8705
- const [highlightedSeries, setHighlightedSeries] = useState14(
9000
+ const [highlightedSeries, setHighlightedSeries] = useState15(
8706
9001
  /* @__PURE__ */ new Set()
8707
9002
  );
8708
- const [showOnlyHighlighted, setShowOnlyHighlighted] = useState14(false);
9003
+ const [showOnlyHighlighted, setShowOnlyHighlighted] = useState15(false);
8709
9004
  const toggleHighlight = useCallback10((key) => {
8710
9005
  setHighlightedSeries((prev) => {
8711
9006
  const next = new Set(prev);
@@ -8772,13 +9067,1180 @@ var useChartHighlights = () => {
8772
9067
  };
8773
9068
  };
8774
9069
 
9070
+ // src/components/ui/SmallButtons.tsx
9071
+ import {
9072
+ PencilSimpleIcon,
9073
+ FloppyDiskIcon,
9074
+ PlusIcon as PlusIcon2,
9075
+ XIcon as XIcon7,
9076
+ TrashIcon as TrashIcon3,
9077
+ DownloadSimpleIcon,
9078
+ UploadSimpleIcon,
9079
+ CopyIcon,
9080
+ ArrowClockwiseIcon,
9081
+ MagnifyingGlassIcon as MagnifyingGlassIcon2,
9082
+ ArrowLeftIcon as ArrowLeftIcon2,
9083
+ GearIcon,
9084
+ BellIcon,
9085
+ DotsThreeIcon as DotsThreeIcon3,
9086
+ CheckIcon as CheckIcon8,
9087
+ FunnelIcon,
9088
+ HeartIcon,
9089
+ StarIcon,
9090
+ EyeIcon,
9091
+ EyeSlashIcon,
9092
+ LockIcon,
9093
+ LockOpenIcon
9094
+ } from "@phosphor-icons/react";
9095
+ import { jsx as jsx61 } from "react/jsx-runtime";
9096
+ var EditButton = ({
9097
+ disabled,
9098
+ onClick,
9099
+ testid = "button-edit",
9100
+ className,
9101
+ iconSize = 18,
9102
+ iconColor,
9103
+ variant = "default",
9104
+ size = "icon",
9105
+ ...props
9106
+ }) => /* @__PURE__ */ jsx61(
9107
+ ButtonBase,
9108
+ {
9109
+ variant,
9110
+ size,
9111
+ onClick,
9112
+ disabled,
9113
+ testid,
9114
+ className: cn(
9115
+ "transition-all duration-200 ease-in-out group",
9116
+ "hover:scale-105 hover:bg-primary",
9117
+ "active:scale-95",
9118
+ "disabled:hover:scale-100",
9119
+ className
9120
+ ),
9121
+ ...props,
9122
+ children: /* @__PURE__ */ jsx61(
9123
+ PencilSimpleIcon,
9124
+ {
9125
+ size: iconSize,
9126
+ color: iconColor,
9127
+ className: "transition-transform duration-200 group-hover:-rotate-12"
9128
+ }
9129
+ )
9130
+ }
9131
+ );
9132
+ var SaveButton = ({
9133
+ disabled,
9134
+ onClick,
9135
+ testid = "button-save",
9136
+ className,
9137
+ iconSize = 18,
9138
+ iconColor,
9139
+ variant = "default",
9140
+ size = "icon",
9141
+ ...props
9142
+ }) => /* @__PURE__ */ jsx61(
9143
+ ButtonBase,
9144
+ {
9145
+ variant,
9146
+ size,
9147
+ onClick,
9148
+ disabled,
9149
+ testid,
9150
+ className: cn(
9151
+ "transition-all duration-200 ease-in-out group",
9152
+ "hover:scale-105",
9153
+ "active:scale-95",
9154
+ "disabled:hover:scale-100",
9155
+ className
9156
+ ),
9157
+ ...props,
9158
+ children: /* @__PURE__ */ jsx61(
9159
+ FloppyDiskIcon,
9160
+ {
9161
+ size: iconSize,
9162
+ color: iconColor,
9163
+ className: "transition-transform duration-200 group-hover:scale-110"
9164
+ }
9165
+ )
9166
+ }
9167
+ );
9168
+ var AddButton = ({
9169
+ disabled,
9170
+ onClick,
9171
+ testid = "button-add",
9172
+ className,
9173
+ iconSize = 18,
9174
+ iconColor,
9175
+ variant = "default",
9176
+ size = "icon",
9177
+ ...props
9178
+ }) => /* @__PURE__ */ jsx61(
9179
+ ButtonBase,
9180
+ {
9181
+ variant,
9182
+ size,
9183
+ onClick,
9184
+ disabled,
9185
+ testid,
9186
+ className: cn(
9187
+ "transition-all duration-200 ease-in-out",
9188
+ "hover:scale-105",
9189
+ "active:scale-95",
9190
+ "disabled:hover:scale-100",
9191
+ className
9192
+ ),
9193
+ ...props,
9194
+ children: /* @__PURE__ */ jsx61(
9195
+ PlusIcon2,
9196
+ {
9197
+ size: iconSize,
9198
+ color: iconColor,
9199
+ className: "transition-transform duration-300"
9200
+ }
9201
+ )
9202
+ }
9203
+ );
9204
+ var CloseButton = ({
9205
+ disabled,
9206
+ onClick,
9207
+ testid = "button-close",
9208
+ className,
9209
+ iconSize = 18,
9210
+ iconColor,
9211
+ variant = "ghost",
9212
+ size = "icon",
9213
+ ...props
9214
+ }) => /* @__PURE__ */ jsx61(
9215
+ ButtonBase,
9216
+ {
9217
+ variant,
9218
+ size,
9219
+ onClick,
9220
+ disabled,
9221
+ testid,
9222
+ className: cn(
9223
+ "transition-all duration-200 ease-in-out",
9224
+ "hover:scale-110 hover:rotate-90 hover:bg-destructive/10",
9225
+ "active:scale-95 active:rotate-0",
9226
+ "disabled:hover:scale-100 disabled:hover:rotate-0",
9227
+ className
9228
+ ),
9229
+ ...props,
9230
+ children: /* @__PURE__ */ jsx61(
9231
+ XIcon7,
9232
+ {
9233
+ size: iconSize,
9234
+ color: iconColor,
9235
+ className: "transition-transform duration-300"
9236
+ }
9237
+ )
9238
+ }
9239
+ );
9240
+ var DeleteButton = ({
9241
+ disabled,
9242
+ onClick,
9243
+ testid = "button-delete",
9244
+ className,
9245
+ iconSize = 18,
9246
+ iconColor,
9247
+ variant = "destructive",
9248
+ size = "icon",
9249
+ ...props
9250
+ }) => /* @__PURE__ */ jsx61(
9251
+ ButtonBase,
9252
+ {
9253
+ variant,
9254
+ size,
9255
+ onClick,
9256
+ disabled,
9257
+ testid,
9258
+ className: cn(
9259
+ "transition-all duration-200 ease-in-out group",
9260
+ "hover:scale-105",
9261
+ "active:scale-95",
9262
+ "disabled:hover:scale-100",
9263
+ className
9264
+ ),
9265
+ ...props,
9266
+ children: /* @__PURE__ */ jsx61(
9267
+ TrashIcon3,
9268
+ {
9269
+ size: iconSize,
9270
+ color: iconColor,
9271
+ className: "transition-transform duration-200 group-hover:scale-110"
9272
+ }
9273
+ )
9274
+ }
9275
+ );
9276
+ var DownloadButton = ({
9277
+ disabled,
9278
+ onClick,
9279
+ testid = "button-download",
9280
+ ...props
9281
+ }) => /* @__PURE__ */ jsx61(
9282
+ ButtonBase,
9283
+ {
9284
+ variant: "outline",
9285
+ size: "icon",
9286
+ onClick,
9287
+ disabled,
9288
+ testid,
9289
+ className: cn(
9290
+ "transition-all duration-200 ease-in-out group",
9291
+ "hover:scale-105",
9292
+ "active:scale-95",
9293
+ "disabled:hover:scale-100"
9294
+ ),
9295
+ ...props,
9296
+ children: /* @__PURE__ */ jsx61(
9297
+ DownloadSimpleIcon,
9298
+ {
9299
+ size: 18,
9300
+ className: "transition-transform duration-300 group-hover:translate-y-0.5"
9301
+ }
9302
+ )
9303
+ }
9304
+ );
9305
+ var UploadButton = ({
9306
+ disabled,
9307
+ onClick,
9308
+ testid = "button-upload",
9309
+ ...props
9310
+ }) => /* @__PURE__ */ jsx61(
9311
+ ButtonBase,
9312
+ {
9313
+ variant: "outline",
9314
+ size: "icon",
9315
+ onClick,
9316
+ disabled,
9317
+ testid,
9318
+ className: cn(
9319
+ "transition-all duration-200 ease-in-out group",
9320
+ "hover:scale-105",
9321
+ "active:scale-95",
9322
+ "disabled:hover:scale-100"
9323
+ ),
9324
+ ...props,
9325
+ children: /* @__PURE__ */ jsx61(
9326
+ UploadSimpleIcon,
9327
+ {
9328
+ size: 18,
9329
+ className: "transition-transform duration-300 group-hover:-translate-y-0.5"
9330
+ }
9331
+ )
9332
+ }
9333
+ );
9334
+ var CopyButton = ({
9335
+ disabled,
9336
+ onClick,
9337
+ testid = "button-copy",
9338
+ ...props
9339
+ }) => /* @__PURE__ */ jsx61(
9340
+ ButtonBase,
9341
+ {
9342
+ variant: "ghost",
9343
+ size: "icon",
9344
+ onClick,
9345
+ disabled,
9346
+ testid,
9347
+ className: cn(
9348
+ "transition-all duration-200 ease-in-out group",
9349
+ "hover:scale-105",
9350
+ "active:scale-90",
9351
+ "disabled:hover:scale-100"
9352
+ ),
9353
+ ...props,
9354
+ children: /* @__PURE__ */ jsx61(
9355
+ CopyIcon,
9356
+ {
9357
+ size: 18,
9358
+ className: "transition-transform duration-200 group-hover:scale-110"
9359
+ }
9360
+ )
9361
+ }
9362
+ );
9363
+ var RefreshButton = ({
9364
+ disabled,
9365
+ onClick,
9366
+ testid = "button-refresh",
9367
+ ...props
9368
+ }) => /* @__PURE__ */ jsx61(
9369
+ ButtonBase,
9370
+ {
9371
+ variant: "ghost",
9372
+ size: "icon",
9373
+ onClick,
9374
+ disabled,
9375
+ testid,
9376
+ className: cn(
9377
+ "transition-all duration-200 ease-in-out group",
9378
+ "hover:scale-105",
9379
+ "active:scale-95",
9380
+ "disabled:hover:scale-100"
9381
+ ),
9382
+ ...props,
9383
+ children: /* @__PURE__ */ jsx61(
9384
+ ArrowClockwiseIcon,
9385
+ {
9386
+ size: 18,
9387
+ className: "transition-transform duration-500 group-hover:rotate-180"
9388
+ }
9389
+ )
9390
+ }
9391
+ );
9392
+ var SearchButton = ({
9393
+ disabled,
9394
+ onClick,
9395
+ testid = "button-search",
9396
+ ...props
9397
+ }) => /* @__PURE__ */ jsx61(
9398
+ ButtonBase,
9399
+ {
9400
+ variant: "outline",
9401
+ size: "icon",
9402
+ onClick,
9403
+ disabled,
9404
+ testid,
9405
+ className: cn(
9406
+ "transition-all duration-200 ease-in-out group",
9407
+ "hover:scale-105",
9408
+ "active:scale-95",
9409
+ "disabled:hover:scale-100"
9410
+ ),
9411
+ ...props,
9412
+ children: /* @__PURE__ */ jsx61(
9413
+ MagnifyingGlassIcon2,
9414
+ {
9415
+ size: 18,
9416
+ className: "transition-transform duration-200 group-hover:scale-110 group-hover:-rotate-12"
9417
+ }
9418
+ )
9419
+ }
9420
+ );
9421
+ var BackButton = ({
9422
+ disabled,
9423
+ onClick,
9424
+ testid = "button-back",
9425
+ ...props
9426
+ }) => /* @__PURE__ */ jsx61(
9427
+ ButtonBase,
9428
+ {
9429
+ variant: "ghost",
9430
+ size: "icon",
9431
+ onClick,
9432
+ disabled,
9433
+ testid,
9434
+ className: cn(
9435
+ "transition-all duration-200 ease-in-out group",
9436
+ "hover:scale-105",
9437
+ "active:scale-95",
9438
+ "disabled:hover:scale-100"
9439
+ ),
9440
+ ...props,
9441
+ children: /* @__PURE__ */ jsx61(
9442
+ ArrowLeftIcon2,
9443
+ {
9444
+ size: 18,
9445
+ className: "transition-transform duration-300 group-hover:-translate-x-1"
9446
+ }
9447
+ )
9448
+ }
9449
+ );
9450
+ var SettingsButton = ({
9451
+ disabled,
9452
+ onClick,
9453
+ testid = "button-settings",
9454
+ ...props
9455
+ }) => /* @__PURE__ */ jsx61(
9456
+ ButtonBase,
9457
+ {
9458
+ variant: "ghost",
9459
+ size: "icon",
9460
+ onClick,
9461
+ disabled,
9462
+ testid,
9463
+ className: cn(
9464
+ "transition-all duration-200 ease-in-out group",
9465
+ "hover:scale-105",
9466
+ "active:scale-95",
9467
+ "disabled:hover:scale-100"
9468
+ ),
9469
+ ...props,
9470
+ children: /* @__PURE__ */ jsx61(
9471
+ GearIcon,
9472
+ {
9473
+ size: 18,
9474
+ className: "transition-transform duration-500 group-hover:rotate-90"
9475
+ }
9476
+ )
9477
+ }
9478
+ );
9479
+ var NotificationButton = ({
9480
+ disabled,
9481
+ onClick,
9482
+ testid = "button-notification",
9483
+ ...props
9484
+ }) => /* @__PURE__ */ jsx61(
9485
+ ButtonBase,
9486
+ {
9487
+ variant: "ghost",
9488
+ size: "icon",
9489
+ onClick,
9490
+ disabled,
9491
+ testid,
9492
+ className: cn(
9493
+ "transition-all duration-200 ease-in-out group",
9494
+ "hover:scale-105",
9495
+ "active:scale-95",
9496
+ "disabled:hover:scale-100"
9497
+ ),
9498
+ ...props,
9499
+ children: /* @__PURE__ */ jsx61(
9500
+ BellIcon,
9501
+ {
9502
+ size: 18,
9503
+ className: "transition-transform duration-300 group-hover:scale-110 group-hover:-rotate-12"
9504
+ }
9505
+ )
9506
+ }
9507
+ );
9508
+ var MoreButton = ({
9509
+ disabled,
9510
+ onClick,
9511
+ testid = "button-more",
9512
+ ...props
9513
+ }) => /* @__PURE__ */ jsx61(
9514
+ ButtonBase,
9515
+ {
9516
+ variant: "ghost",
9517
+ size: "icon",
9518
+ onClick,
9519
+ disabled,
9520
+ testid,
9521
+ className: cn(
9522
+ "transition-all duration-200 ease-in-out group",
9523
+ "hover:scale-105",
9524
+ "active:scale-95",
9525
+ "disabled:hover:scale-100"
9526
+ ),
9527
+ ...props,
9528
+ children: /* @__PURE__ */ jsx61(
9529
+ DotsThreeIcon3,
9530
+ {
9531
+ size: 18,
9532
+ className: "transition-transform duration-200 group-hover:scale-110"
9533
+ }
9534
+ )
9535
+ }
9536
+ );
9537
+ var CheckButton = ({
9538
+ disabled,
9539
+ onClick,
9540
+ testid = "button-check",
9541
+ ...props
9542
+ }) => /* @__PURE__ */ jsx61(
9543
+ ButtonBase,
9544
+ {
9545
+ variant: "default",
9546
+ size: "icon",
9547
+ onClick,
9548
+ disabled,
9549
+ testid,
9550
+ className: cn(
9551
+ "transition-all duration-200 ease-in-out group",
9552
+ "hover:scale-110",
9553
+ "active:scale-95",
9554
+ "disabled:hover:scale-100"
9555
+ ),
9556
+ ...props,
9557
+ children: /* @__PURE__ */ jsx61(
9558
+ CheckIcon8,
9559
+ {
9560
+ size: 18,
9561
+ className: "transition-transform duration-200 group-hover:scale-110"
9562
+ }
9563
+ )
9564
+ }
9565
+ );
9566
+ var FilterButton = ({
9567
+ disabled,
9568
+ onClick,
9569
+ testid = "button-filter",
9570
+ active = false,
9571
+ className,
9572
+ iconSize = 18,
9573
+ iconColor,
9574
+ variant,
9575
+ size = "icon",
9576
+ ...props
9577
+ }) => /* @__PURE__ */ jsx61(
9578
+ ButtonBase,
9579
+ {
9580
+ variant: variant || (active ? "default" : "outline"),
9581
+ size,
9582
+ onClick,
9583
+ disabled,
9584
+ testid,
9585
+ className: cn(
9586
+ "transition-all duration-200 ease-in-out",
9587
+ "hover:scale-105",
9588
+ "active:scale-95",
9589
+ "disabled:hover:scale-100",
9590
+ className
9591
+ ),
9592
+ ...props,
9593
+ children: /* @__PURE__ */ jsx61(
9594
+ FunnelIcon,
9595
+ {
9596
+ size: iconSize,
9597
+ color: iconColor,
9598
+ weight: active ? "fill" : "regular",
9599
+ className: "transition-all duration-200"
9600
+ }
9601
+ )
9602
+ }
9603
+ );
9604
+ var LikeButton = ({
9605
+ disabled,
9606
+ onClick,
9607
+ testid = "button-like",
9608
+ isLiked = false,
9609
+ className,
9610
+ iconSize = 18,
9611
+ iconColor,
9612
+ variant = "ghost",
9613
+ size = "icon",
9614
+ ...props
9615
+ }) => /* @__PURE__ */ jsx61(
9616
+ ButtonBase,
9617
+ {
9618
+ variant,
9619
+ size,
9620
+ onClick,
9621
+ disabled,
9622
+ testid,
9623
+ className: cn(
9624
+ "transition-all duration-200 ease-in-out group",
9625
+ "hover:scale-110",
9626
+ "active:scale-95",
9627
+ "disabled:hover:scale-100",
9628
+ !iconColor && (isLiked ? "text-red-500 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300" : "hover:text-red-500 dark:hover:text-red-400"),
9629
+ className
9630
+ ),
9631
+ ...props,
9632
+ children: /* @__PURE__ */ jsx61(
9633
+ HeartIcon,
9634
+ {
9635
+ size: iconSize,
9636
+ color: iconColor,
9637
+ weight: isLiked ? "fill" : "regular",
9638
+ className: "transition-all duration-300 group-hover:scale-110"
9639
+ }
9640
+ )
9641
+ }
9642
+ );
9643
+ var FavoriteButton = ({
9644
+ disabled,
9645
+ onClick,
9646
+ testid = "button-favorite",
9647
+ isFavorite = false,
9648
+ className,
9649
+ iconSize = 18,
9650
+ iconColor,
9651
+ variant = "ghost",
9652
+ size = "icon",
9653
+ ...props
9654
+ }) => /* @__PURE__ */ jsx61(
9655
+ ButtonBase,
9656
+ {
9657
+ variant,
9658
+ size,
9659
+ onClick,
9660
+ disabled,
9661
+ testid,
9662
+ className: cn(
9663
+ "transition-all duration-200 ease-in-out group",
9664
+ "hover:scale-110",
9665
+ "active:scale-95",
9666
+ "disabled:hover:scale-100",
9667
+ !iconColor && (isFavorite ? "text-yellow-500 dark:text-yellow-400 hover:text-yellow-600 dark:hover:text-yellow-300" : "hover:text-yellow-500 dark:hover:text-yellow-400"),
9668
+ className
9669
+ ),
9670
+ ...props,
9671
+ children: /* @__PURE__ */ jsx61(
9672
+ StarIcon,
9673
+ {
9674
+ size: iconSize,
9675
+ color: iconColor,
9676
+ weight: isFavorite ? "fill" : "regular",
9677
+ className: "transition-all duration-300 group-hover:rotate-12"
9678
+ }
9679
+ )
9680
+ }
9681
+ );
9682
+ var VisibilityButton = ({
9683
+ disabled,
9684
+ onClick,
9685
+ testid = "button-visibility",
9686
+ isVisible = true,
9687
+ className,
9688
+ iconSize = 18,
9689
+ iconColor,
9690
+ variant = "ghost",
9691
+ size = "icon",
9692
+ ...props
9693
+ }) => /* @__PURE__ */ jsx61(
9694
+ ButtonBase,
9695
+ {
9696
+ variant,
9697
+ size,
9698
+ onClick,
9699
+ disabled,
9700
+ testid,
9701
+ className: cn(
9702
+ "transition-all duration-200 ease-in-out",
9703
+ "hover:scale-105",
9704
+ "active:scale-95",
9705
+ "disabled:hover:scale-100",
9706
+ className
9707
+ ),
9708
+ ...props,
9709
+ children: isVisible ? /* @__PURE__ */ jsx61(
9710
+ EyeIcon,
9711
+ {
9712
+ size: iconSize,
9713
+ color: iconColor,
9714
+ className: "transition-opacity duration-200"
9715
+ }
9716
+ ) : /* @__PURE__ */ jsx61(
9717
+ EyeSlashIcon,
9718
+ {
9719
+ size: iconSize,
9720
+ color: iconColor,
9721
+ className: "transition-opacity duration-200"
9722
+ }
9723
+ )
9724
+ }
9725
+ );
9726
+ var ViewButton = (props) => /* @__PURE__ */ jsx61(VisibilityButton, { isVisible: true, testid: "button-view", ...props });
9727
+ var HideButton = (props) => /* @__PURE__ */ jsx61(VisibilityButton, { isVisible: false, testid: "button-hide", ...props });
9728
+ var LockButton = ({
9729
+ disabled,
9730
+ onClick,
9731
+ testid = "button-lock",
9732
+ isLocked = true,
9733
+ className,
9734
+ iconSize = 18,
9735
+ iconColor,
9736
+ variant = "ghost",
9737
+ size = "icon",
9738
+ ...props
9739
+ }) => /* @__PURE__ */ jsx61(
9740
+ ButtonBase,
9741
+ {
9742
+ variant,
9743
+ size,
9744
+ onClick,
9745
+ disabled,
9746
+ testid,
9747
+ className: cn(
9748
+ "transition-all duration-200 ease-in-out group",
9749
+ "hover:scale-105",
9750
+ "active:scale-95",
9751
+ "disabled:hover:scale-100",
9752
+ !iconColor && (isLocked ? "text-red-500 dark:text-red-400 hover:text-red-600 dark:hover:text-red-300" : "text-emerald-500 dark:text-emerald-400 hover:text-emerald-600 dark:hover:text-emerald-300"),
9753
+ className
9754
+ ),
9755
+ ...props,
9756
+ children: isLocked ? /* @__PURE__ */ jsx61(
9757
+ LockIcon,
9758
+ {
9759
+ size: iconSize,
9760
+ color: iconColor,
9761
+ className: "transition-all duration-200 group-hover:scale-110"
9762
+ }
9763
+ ) : /* @__PURE__ */ jsx61(
9764
+ LockOpenIcon,
9765
+ {
9766
+ size: iconSize,
9767
+ color: iconColor,
9768
+ className: "transition-all duration-200 group-hover:scale-110"
9769
+ }
9770
+ )
9771
+ }
9772
+ );
9773
+ var UnlockButton = (props) => /* @__PURE__ */ jsx61(LockButton, { isLocked: false, testid: "button-unlock", ...props });
9774
+
9775
+ // src/components/ui/DebounceInput.tsx
9776
+ import { useEffect as useEffect14, useState as useState16 } from "react";
9777
+ import { CircleNotchIcon } from "@phosphor-icons/react";
9778
+ import { jsx as jsx62 } from "react/jsx-runtime";
9779
+
9780
+ // src/components/ui/FileUploader.tsx
9781
+ import * as React38 from "react";
9782
+ import { motion as motion15, AnimatePresence as AnimatePresence11 } from "framer-motion";
9783
+ import {
9784
+ CloudArrowUpIcon,
9785
+ CheckIcon as CheckIcon9,
9786
+ XIcon as XIcon8,
9787
+ FileTextIcon,
9788
+ FilePdfIcon,
9789
+ FileImageIcon,
9790
+ FileVideoIcon,
9791
+ FileAudioIcon,
9792
+ FileZipIcon,
9793
+ FileIcon,
9794
+ FileCsvIcon,
9795
+ FileXlsIcon,
9796
+ FilePptIcon,
9797
+ FileDocIcon
9798
+ } from "@phosphor-icons/react";
9799
+ import { Fragment as Fragment8, jsx as jsx63, jsxs as jsxs44 } from "react/jsx-runtime";
9800
+ var formatFileSize = (bytes) => {
9801
+ if (bytes === 0) return "0 Bytes";
9802
+ const k = 1024;
9803
+ const sizes = ["Bytes", "KB", "MB", "GB"];
9804
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
9805
+ return Math.round(bytes / Math.pow(k, i) * 100) / 100 + " " + sizes[i];
9806
+ };
9807
+ var getFileExtension = (filename) => {
9808
+ return filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2);
9809
+ };
9810
+ var getFileTypeIcon = (file) => {
9811
+ const extension = getFileExtension(file.name).toLowerCase();
9812
+ const mimeType = file.type.toLowerCase();
9813
+ if (extension === "pdf" || mimeType === "application/pdf") {
9814
+ return /* @__PURE__ */ jsx63(FilePdfIcon, { size: 20, className: "text-red-500" });
9815
+ }
9816
+ if (["doc", "docx"].includes(extension) || mimeType.includes("word")) {
9817
+ return /* @__PURE__ */ jsx63(FileDocIcon, { size: 20, className: "text-blue-500" });
9818
+ }
9819
+ if (["xls", "xlsx"].includes(extension) || mimeType.includes("sheet")) {
9820
+ return /* @__PURE__ */ jsx63(FileXlsIcon, { size: 20, className: "text-green-500" });
9821
+ }
9822
+ if (["ppt", "pptx"].includes(extension) || mimeType.includes("presentation")) {
9823
+ return /* @__PURE__ */ jsx63(FilePptIcon, { size: 20, className: "text-orange-500" });
9824
+ }
9825
+ if (extension === "csv" || mimeType === "text/csv") {
9826
+ return /* @__PURE__ */ jsx63(FileCsvIcon, { size: 20, className: "text-green-600" });
9827
+ }
9828
+ if (["txt", "md", "json", "xml", "js", "ts", "html", "css"].includes(
9829
+ extension
9830
+ ) || mimeType.includes("text")) {
9831
+ return /* @__PURE__ */ jsx63(FileTextIcon, { size: 20, className: "text-gray-500" });
9832
+ }
9833
+ if (mimeType.startsWith("image/")) {
9834
+ return /* @__PURE__ */ jsx63(FileImageIcon, { size: 20, className: "text-purple-500" });
9835
+ }
9836
+ if (mimeType.startsWith("video/")) {
9837
+ return /* @__PURE__ */ jsx63(FileVideoIcon, { size: 20, className: "text-pink-500" });
9838
+ }
9839
+ if (mimeType.startsWith("audio/")) {
9840
+ return /* @__PURE__ */ jsx63(FileAudioIcon, { size: 20, className: "text-indigo-500" });
9841
+ }
9842
+ if (["zip", "rar", "7z", "tar", "gz"].includes(extension)) {
9843
+ return /* @__PURE__ */ jsx63(FileZipIcon, { size: 20, className: "text-yellow-600" });
9844
+ }
9845
+ return /* @__PURE__ */ jsx63(FileIcon, { size: 20, className: "text-muted-foreground" });
9846
+ };
9847
+ var createImagePreview = (file) => {
9848
+ return new Promise((resolve) => {
9849
+ if (!file.type.startsWith("image/")) {
9850
+ resolve(null);
9851
+ return;
9852
+ }
9853
+ const reader = new FileReader();
9854
+ reader.onload = (e) => {
9855
+ resolve(e.target?.result);
9856
+ };
9857
+ reader.onerror = () => {
9858
+ resolve(null);
9859
+ };
9860
+ reader.readAsDataURL(file);
9861
+ });
9862
+ };
9863
+ var FileUploader = React38.forwardRef(
9864
+ ({
9865
+ className,
9866
+ accept,
9867
+ maxSize,
9868
+ maxFiles = 1,
9869
+ disabled = false,
9870
+ value = [],
9871
+ onValueChange,
9872
+ onUpload,
9873
+ showPreview = true,
9874
+ dropzoneText = "Arraste arquivos aqui ou clique para selecionar",
9875
+ dropzoneSubtext,
9876
+ animate = true,
9877
+ ...props
9878
+ }, ref) => {
9879
+ const [isDragging, setIsDragging] = React38.useState(false);
9880
+ const [files, setFiles] = React38.useState(value);
9881
+ const inputRef = React38.useRef(null);
9882
+ const dragCounterRef = React38.useRef(0);
9883
+ const multiple = maxFiles > 1;
9884
+ React38.useEffect(() => {
9885
+ setFiles(value);
9886
+ }, [value]);
9887
+ React38.useEffect(() => {
9888
+ return () => {
9889
+ files.forEach((file) => {
9890
+ if (file.preview) {
9891
+ URL.revokeObjectURL(file.preview);
9892
+ }
9893
+ });
9894
+ };
9895
+ }, [files]);
9896
+ const validateFile = (file) => {
9897
+ if (file.size > maxSize) {
9898
+ return `Arquivo muito grande. M\xE1ximo: ${formatFileSize(maxSize)}`;
9899
+ }
9900
+ if (accept.length > 0) {
9901
+ const fileExtension = `.${getFileExtension(file.name)}`;
9902
+ const fileType = file.type;
9903
+ const isAccepted = accept.some((acceptItem) => {
9904
+ if (acceptItem.startsWith(".")) {
9905
+ return fileExtension.toLowerCase() === acceptItem.toLowerCase();
9906
+ }
9907
+ if (acceptItem.endsWith("/*")) {
9908
+ return fileType.startsWith(acceptItem.replace("/*", ""));
9909
+ }
9910
+ return fileType === acceptItem;
9911
+ });
9912
+ if (!isAccepted) {
9913
+ return `Tipo de arquivo n\xE3o permitido. Aceitos: ${accept.join(", ")}`;
9914
+ }
9915
+ }
9916
+ return null;
9917
+ };
9918
+ const createFileWithPreview = async (file) => {
9919
+ const fileWithPreview = file;
9920
+ fileWithPreview.id = `${file.name}-${Date.now()}-${Math.random()}`;
9921
+ const error = validateFile(file);
9922
+ if (error) {
9923
+ fileWithPreview.error = error;
9924
+ }
9925
+ if (file.type.startsWith("image/")) {
9926
+ try {
9927
+ const preview = await createImagePreview(file);
9928
+ if (preview) {
9929
+ fileWithPreview.preview = preview;
9930
+ }
9931
+ } catch (error2) {
9932
+ console.warn("Erro ao criar preview da imagem:", error2);
9933
+ }
9934
+ }
9935
+ return fileWithPreview;
9936
+ };
9937
+ const handleFiles = async (newFiles) => {
9938
+ if (disabled) return;
9939
+ const availableSlots = maxFiles - files.length;
9940
+ const filesToAdd = multiple ? newFiles.slice(0, availableSlots) : [newFiles[0]];
9941
+ const filesWithPreview = await Promise.all(
9942
+ filesToAdd.map((file) => createFileWithPreview(file))
9943
+ );
9944
+ const updatedFiles = multiple ? [...files, ...filesWithPreview] : filesWithPreview;
9945
+ setFiles(updatedFiles);
9946
+ onValueChange(updatedFiles);
9947
+ if (onUpload) {
9948
+ const validFiles = filesWithPreview.filter((f) => !f.error);
9949
+ if (validFiles.length > 0) {
9950
+ try {
9951
+ await onUpload(validFiles);
9952
+ } catch (error) {
9953
+ console.error("Erro no upload:", error);
9954
+ }
9955
+ }
9956
+ }
9957
+ };
9958
+ const handleDragEnter = (e) => {
9959
+ e.preventDefault();
9960
+ e.stopPropagation();
9961
+ dragCounterRef.current++;
9962
+ if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
9963
+ setIsDragging(true);
9964
+ }
9965
+ };
9966
+ const handleDragLeave = (e) => {
9967
+ e.preventDefault();
9968
+ e.stopPropagation();
9969
+ dragCounterRef.current--;
9970
+ if (dragCounterRef.current === 0) {
9971
+ setIsDragging(false);
9972
+ }
9973
+ };
9974
+ const handleDragOver = (e) => {
9975
+ e.preventDefault();
9976
+ e.stopPropagation();
9977
+ };
9978
+ const handleDrop = (e) => {
9979
+ e.preventDefault();
9980
+ e.stopPropagation();
9981
+ setIsDragging(false);
9982
+ dragCounterRef.current = 0;
9983
+ if (disabled) return;
9984
+ const droppedFiles = Array.from(e.dataTransfer.files);
9985
+ handleFiles(droppedFiles);
9986
+ };
9987
+ const handleInputChange = (e) => {
9988
+ if (e.target.files) {
9989
+ const selectedFiles = Array.from(e.target.files);
9990
+ handleFiles(selectedFiles);
9991
+ }
9992
+ };
9993
+ const handleRemoveFile = (fileId) => {
9994
+ const fileToRemove = files.find((f) => f.id === fileId);
9995
+ if (fileToRemove?.preview) {
9996
+ URL.revokeObjectURL(fileToRemove.preview);
9997
+ }
9998
+ const updatedFiles = files.filter((f) => f.id !== fileId);
9999
+ setFiles(updatedFiles);
10000
+ onValueChange(updatedFiles);
10001
+ };
10002
+ const handleClick = () => {
10003
+ if (!disabled) {
10004
+ inputRef.current?.click();
10005
+ }
10006
+ };
10007
+ const acceptString = accept.join(",");
10008
+ const defaultSubtext = dropzoneSubtext || `Formatos: ${accept.join(", ")}. M\xE1ximo: ${formatFileSize(maxSize)}`;
10009
+ return /* @__PURE__ */ jsx63("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs44(
10010
+ motion15.div,
10011
+ {
10012
+ className: cn(
10013
+ "relative flex cursor-pointer flex-col items-center justify-center rounded-xl border-2 border-dashed p-10 transition-all duration-300 dark:shadow-black/20",
10014
+ isDragging && "border-primary bg-primary/10 scale-[1.02]",
10015
+ !isDragging && "border-border hover:border-primary/60 hover:bg-muted/50",
10016
+ disabled && "cursor-not-allowed opacity-50 hover:scale-100"
10017
+ ),
10018
+ onDragEnter: handleDragEnter,
10019
+ onDragOver: handleDragOver,
10020
+ onDragLeave: handleDragLeave,
10021
+ onDrop: handleDrop,
10022
+ onClick: handleClick,
10023
+ whileHover: !disabled ? { scale: 1.01 } : void 0,
10024
+ whileTap: !disabled ? { scale: 0.99 } : void 0,
10025
+ animate: isDragging ? {
10026
+ borderColor: `hsl(var(--primary))`,
10027
+ backgroundColor: `hsl(var(--primary) / 0.1)`,
10028
+ scale: 1.02
10029
+ } : {
10030
+ borderColor: `hsl(var(--border))`,
10031
+ backgroundColor: `hsl(var(--background))`,
10032
+ scale: 1
10033
+ },
10034
+ transition: {
10035
+ type: "spring",
10036
+ stiffness: 300,
10037
+ damping: 25,
10038
+ duration: 0.3
10039
+ },
10040
+ children: [
10041
+ /* @__PURE__ */ jsx63(
10042
+ "input",
10043
+ {
10044
+ ref: inputRef,
10045
+ type: "file",
10046
+ className: "hidden",
10047
+ accept: acceptString,
10048
+ multiple,
10049
+ disabled,
10050
+ onChange: handleInputChange
10051
+ }
10052
+ ),
10053
+ /* @__PURE__ */ jsx63(
10054
+ motion15.div,
10055
+ {
10056
+ animate: isDragging ? { scale: 1.2, rotate: 10 } : { scale: 1, rotate: 0 },
10057
+ transition: {
10058
+ type: "spring",
10059
+ stiffness: 300,
10060
+ damping: 20,
10061
+ duration: 0.3
10062
+ },
10063
+ children: /* @__PURE__ */ jsx63(
10064
+ motion15.div,
10065
+ {
10066
+ className: cn(
10067
+ "mb-4 h-16 w-16 text-muted-foreground transition-colors duration-300 drop-shadow-lg flex items-center justify-center",
10068
+ isDragging && "text-primary"
10069
+ ),
10070
+ initial: false,
10071
+ animate: {
10072
+ color: isDragging ? `hsl(var(--primary))` : `hsl(var(--muted-foreground))`
10073
+ },
10074
+ transition: { duration: 0.3 },
10075
+ children: /* @__PURE__ */ jsx63(CloudArrowUpIcon, { size: 64 })
10076
+ }
10077
+ )
10078
+ }
10079
+ ),
10080
+ /* @__PURE__ */ jsx63(
10081
+ motion15.p,
10082
+ {
10083
+ className: "mb-2 text-base font-semibold text-foreground",
10084
+ initial: animate ? { opacity: 0, y: -10 } : false,
10085
+ animate: { opacity: 1, y: 0 },
10086
+ transition: { delay: 0.1 },
10087
+ children: dropzoneText
10088
+ }
10089
+ ),
10090
+ /* @__PURE__ */ jsx63(
10091
+ motion15.p,
10092
+ {
10093
+ className: "text-sm text-muted-foreground",
10094
+ initial: animate ? { opacity: 0, y: -10 } : false,
10095
+ animate: { opacity: 1, y: 0 },
10096
+ transition: { delay: 0.2 },
10097
+ children: defaultSubtext
10098
+ }
10099
+ ),
10100
+ /* @__PURE__ */ jsx63(AnimatePresence11, { children: files.length > 0 && /* @__PURE__ */ jsxs44(
10101
+ motion15.div,
10102
+ {
10103
+ initial: { opacity: 0, scale: 0.8, y: 10 },
10104
+ animate: {
10105
+ opacity: 1,
10106
+ scale: 1,
10107
+ y: 0,
10108
+ backgroundColor: `hsl(var(--primary) / 0.1)`,
10109
+ borderColor: `hsl(var(--primary) / 0.2)`
10110
+ },
10111
+ exit: { opacity: 0, scale: 0.8, y: 10 },
10112
+ className: cn(
10113
+ "mt-4 flex items-center gap-2 rounded-full border px-4 py-2 backdrop-blur-sm bg-primary/20 border-primary/30 shadow-lg"
10114
+ ),
10115
+ transition: { duration: 0.3 },
10116
+ children: [
10117
+ /* @__PURE__ */ jsx63("div", { className: "h-4 w-4 text-primary flex items-center justify-center", children: /* @__PURE__ */ jsx63(CheckIcon9, { size: 16, className: "text-emerald-500" }) }),
10118
+ /* @__PURE__ */ jsxs44(
10119
+ motion15.span,
10120
+ {
10121
+ className: "text-sm font-semibold text-primary",
10122
+ animate: { color: `hsl(var(--primary))` },
10123
+ transition: { duration: 0.3 },
10124
+ children: [
10125
+ files.length,
10126
+ " ",
10127
+ files.length === 1 ? "arquivo selecionado" : "arquivos selecionados"
10128
+ ]
10129
+ }
10130
+ )
10131
+ ]
10132
+ }
10133
+ ) }),
10134
+ showPreview && files.length > 0 && /* @__PURE__ */ jsx63(
10135
+ motion15.div,
10136
+ {
10137
+ className: "mt-6 w-full",
10138
+ initial: animate ? { opacity: 0, y: 10 } : false,
10139
+ animate: { opacity: 1, y: 0 },
10140
+ transition: { delay: 0.3 },
10141
+ children: /* @__PURE__ */ jsxs44("div", { children: [
10142
+ /* @__PURE__ */ jsxs44("h4", { className: "mb-3 text-sm font-medium text-muted-foreground", children: [
10143
+ "Arquivos selecionados (",
10144
+ files.length,
10145
+ "/",
10146
+ maxFiles,
10147
+ ")"
10148
+ ] }),
10149
+ /* @__PURE__ */ jsx63("div", { className: "space-y-2 overflow-y-auto max-h-44", children: /* @__PURE__ */ jsx63(AnimatePresence11, { mode: "popLayout", children: files.map((file, index) => /* @__PURE__ */ jsxs44(
10150
+ motion15.div,
10151
+ {
10152
+ layout: true,
10153
+ initial: animate ? { opacity: 0, x: -20 } : false,
10154
+ animate: { opacity: 1, x: 0 },
10155
+ exit: {
10156
+ opacity: 0,
10157
+ x: -20,
10158
+ transition: { duration: 0.2 }
10159
+ },
10160
+ transition: {
10161
+ delay: animate ? index * 0.05 : 0,
10162
+ layout: { duration: 0.2 }
10163
+ },
10164
+ className: cn(
10165
+ "flex items-center gap-3 rounded-md border p-3 transition-all duration-300",
10166
+ file.error ? "border-destructive/50 bg-destructive/5" : "border-border bg-background/80 hover:bg-muted/50 hover:shadow-md hover:shadow-primary/10 hover:border-primary/30"
10167
+ ),
10168
+ children: [
10169
+ /* @__PURE__ */ jsx63("div", { className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-md bg-muted overflow-hidden", children: file.preview ? (
10170
+ // Preview de imagem
10171
+ /* @__PURE__ */ jsx63(
10172
+ "img",
10173
+ {
10174
+ src: file.preview,
10175
+ alt: file.name,
10176
+ className: "h-full w-full object-cover rounded-md"
10177
+ }
10178
+ )
10179
+ ) : (
10180
+ // Ícone baseado no tipo de arquivo
10181
+ getFileTypeIcon(file)
10182
+ ) }),
10183
+ /* @__PURE__ */ jsxs44("div", { className: "min-w-0 flex-1", children: [
10184
+ /* @__PURE__ */ jsx63(
10185
+ "p",
10186
+ {
10187
+ className: "truncate text-sm font-medium text-foreground",
10188
+ title: `${file.name} (${file.type || "Tipo desconhecido"})`,
10189
+ children: file.name
10190
+ }
10191
+ ),
10192
+ /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
10193
+ /* @__PURE__ */ jsx63("span", { children: formatFileSize(file.size) }),
10194
+ file.type && /* @__PURE__ */ jsxs44(Fragment8, { children: [
10195
+ /* @__PURE__ */ jsx63("span", { children: "\u2022" }),
10196
+ /* @__PURE__ */ jsx63("span", { className: "uppercase", children: getFileExtension(file.name) })
10197
+ ] })
10198
+ ] }),
10199
+ file.error && /* @__PURE__ */ jsx63(
10200
+ motion15.p,
10201
+ {
10202
+ className: "mt-1 text-xs text-destructive",
10203
+ initial: { opacity: 0, y: -5 },
10204
+ animate: { opacity: 1, y: 0 },
10205
+ children: file.error
10206
+ }
10207
+ )
10208
+ ] }),
10209
+ /* @__PURE__ */ jsx63(
10210
+ DeleteButton,
10211
+ {
10212
+ type: "button",
10213
+ variant: "destructive",
10214
+ size: "icon",
10215
+ onClick: (e) => {
10216
+ e?.stopPropagation();
10217
+ handleRemoveFile(file.id);
10218
+ },
10219
+ className: "",
10220
+ children: /* @__PURE__ */ jsx63(XIcon8, { size: 12 })
10221
+ }
10222
+ )
10223
+ ]
10224
+ },
10225
+ file.id
10226
+ )) }) })
10227
+ ] })
10228
+ }
10229
+ )
10230
+ ]
10231
+ }
10232
+ ) });
10233
+ }
10234
+ );
10235
+ FileUploader.displayName = "FileUploader";
10236
+
8775
10237
  // src/hooks/use-drag.tsx
8776
- import { useState as useState15, useCallback as useCallback11, useRef as useRef5, useEffect as useEffect13 } from "react";
10238
+ import { useState as useState18, useCallback as useCallback11, useRef as useRef7, useEffect as useEffect16 } from "react";
8777
10239
  var useDrag = (options = {}) => {
8778
- const [isDragging, setIsDragging] = useState15(null);
8779
- const [positions, setPositions] = useState15({});
8780
- const dragStartPos = useRef5(null);
8781
- const dragId = useRef5(null);
10240
+ const [isDragging, setIsDragging] = useState18(null);
10241
+ const [positions, setPositions] = useState18({});
10242
+ const dragStartPos = useRef7(null);
10243
+ const dragId = useRef7(null);
8782
10244
  const handleMouseDown = useCallback11((id, e) => {
8783
10245
  e.preventDefault();
8784
10246
  const currentPosition = positions[id] || { top: 0, left: 0 };
@@ -8816,7 +10278,7 @@ var useDrag = (options = {}) => {
8816
10278
  dragStartPos.current = null;
8817
10279
  dragId.current = null;
8818
10280
  }, [options]);
8819
- useEffect13(() => {
10281
+ useEffect16(() => {
8820
10282
  if (isDragging) {
8821
10283
  document.addEventListener("mousemove", handleMouseMove);
8822
10284
  document.addEventListener("mouseup", handleMouseUp);
@@ -8849,6 +10311,7 @@ var useDrag = (options = {}) => {
8849
10311
  };
8850
10312
  };
8851
10313
  export {
10314
+ AddButton,
8852
10315
  AlertDialogActionBase,
8853
10316
  AlertDialogBase,
8854
10317
  AlertDialogCancelBase,
@@ -8863,6 +10326,7 @@ export {
8863
10326
  AvatarBase,
8864
10327
  AvatarFallbackBase,
8865
10328
  AvatarImageBase,
10329
+ BackButton,
8866
10330
  BadgeBase,
8867
10331
  BarChart_default as BarChart,
8868
10332
  BreadcrumbBase,
@@ -8887,8 +10351,10 @@ export {
8887
10351
  CarouselNextBase,
8888
10352
  CarouselPrevious,
8889
10353
  Chart_default as Chart,
10354
+ CheckButton,
8890
10355
  CheckboxBase,
8891
10356
  CloseAllButton_default as CloseAllButton,
10357
+ CloseButton,
8892
10358
  CollapsibleBase,
8893
10359
  CollapsibleContentBase,
8894
10360
  CollapsibleTriggerBase,
@@ -8917,7 +10383,9 @@ export {
8917
10383
  ContextMenuSubContentBase,
8918
10384
  ContextMenuSubTriggerBase,
8919
10385
  ContextMenuTriggerBase,
10386
+ CopyButton,
8920
10387
  DateTimePicker,
10388
+ DeleteButton,
8921
10389
  DestructiveDialog,
8922
10390
  DialogBase,
8923
10391
  DialogCloseBase,
@@ -8929,6 +10397,7 @@ export {
8929
10397
  DialogPortalBase,
8930
10398
  DialogTitleBase,
8931
10399
  DialogTriggerBase,
10400
+ DownloadButton,
8932
10401
  DraggableTooltip_default as DraggableTooltip,
8933
10402
  DrawerBase,
8934
10403
  DrawerCloseBase,
@@ -8955,6 +10424,11 @@ export {
8955
10424
  DropDownMenuSubContentBase,
8956
10425
  DropDownMenuSubTriggerBase,
8957
10426
  DropDownMenuTriggerBase,
10427
+ EditButton,
10428
+ FavoriteButton,
10429
+ FileUploader,
10430
+ FilterButton,
10431
+ HideButton,
8958
10432
  Highlights_default as Highlights,
8959
10433
  HoverCardBase,
8960
10434
  HoverCardContentBase,
@@ -8965,9 +10439,12 @@ export {
8965
10439
  InputOTPSeparatorBase,
8966
10440
  InputOTPSlotBase,
8967
10441
  LabelBase_default as LabelBase,
10442
+ LikeButton,
8968
10443
  LineChart_default as LineChart,
8969
10444
  LoadingBase,
10445
+ LockButton,
8970
10446
  ModeToggleBase,
10447
+ MoreButton,
8971
10448
  MultiCombobox,
8972
10449
  NavigationMenuBase,
8973
10450
  NavigationMenuContentBase,
@@ -8977,6 +10454,7 @@ export {
8977
10454
  NavigationMenuListBase,
8978
10455
  NavigationMenuTriggerBase,
8979
10456
  NavigationMenuViewportBase,
10457
+ NotificationButton,
8980
10458
  PeriodsDropdown_default as PeriodsDropdown,
8981
10459
  PieChart_default as PieChart,
8982
10460
  PopoverAnchorBase,
@@ -8987,8 +10465,11 @@ export {
8987
10465
  ProgressCirclesBase,
8988
10466
  ProgressPanelsBase,
8989
10467
  ProgressSegmentsBase,
10468
+ RefreshButton,
10469
+ SaveButton,
8990
10470
  ScrollAreaBase,
8991
10471
  ScrollBarBase,
10472
+ SearchButton,
8992
10473
  Select,
8993
10474
  SelectBase,
8994
10475
  SelectContentBase,
@@ -9001,6 +10482,7 @@ export {
9001
10482
  SelectTriggerBase,
9002
10483
  SelectValueBase,
9003
10484
  SeparatorBase,
10485
+ SettingsButton,
9004
10486
  SheetBase,
9005
10487
  SheetCloseBase,
9006
10488
  SheetContentBase,
@@ -9061,7 +10543,11 @@ export {
9061
10543
  TooltipSimple_default as TooltipSimple,
9062
10544
  TooltipTriggerBase,
9063
10545
  TooltipWithTotal_default as TooltipWithTotal,
10546
+ UnlockButton,
10547
+ UploadButton,
9064
10548
  UseSideBarBase,
10549
+ ViewButton,
10550
+ VisibilityButton,
9065
10551
  badgeVariants,
9066
10552
  buttonVariantsBase,
9067
10553
  compactTick,