@mlw-packages/react-components 1.5.9 → 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
@@ -500,6 +500,7 @@ var buttonVariantsBase = cva(
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
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"
@@ -508,7 +509,8 @@ var buttonVariantsBase = cva(
508
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,
@@ -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",
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]);
@@ -3109,7 +3151,7 @@ ScrollBarBase.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
3109
3151
  import * as React19 from "react";
3110
3152
  import * as SelectPrimitive from "@radix-ui/react-select";
3111
3153
  import { CheckIcon as CheckIcon5, CaretDownIcon as CaretDownIcon3, CaretUpIcon } from "@phosphor-icons/react";
3112
- import { motion as motion4, AnimatePresence as AnimatePresence3 } from "framer-motion";
3154
+ import { motion as motion6, AnimatePresence as AnimatePresence4 } from "framer-motion";
3113
3155
  import { Fragment as Fragment2, jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
3114
3156
  var SelectBase = SelectPrimitive.Root;
3115
3157
  var SelectGroupBase = SelectPrimitive.Group;
@@ -3126,7 +3168,7 @@ var SelectTriggerBase = React19.forwardRef(({ className, children, open, ...prop
3126
3168
  children: [
3127
3169
  children,
3128
3170
  /* @__PURE__ */ jsx30(
3129
- motion4.span,
3171
+ motion6.span,
3130
3172
  {
3131
3173
  animate: { rotate: open ? 180 : 0 },
3132
3174
  transition: { duration: 0.3 },
@@ -3164,43 +3206,51 @@ var SelectScrollDownButtonBase = React19.forwardRef(({ className, ...props }, re
3164
3206
  }
3165
3207
  ));
3166
3208
  SelectScrollDownButtonBase.displayName = SelectPrimitive.ScrollDownButton.displayName;
3167
- 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(
3168
- SelectPrimitive.Content,
3169
- {
3170
- ref,
3171
- className: cn(
3172
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",
3173
- className
3174
- ),
3175
- position,
3176
- "data-testid": dataTestId,
3177
- ...props,
3178
- asChild: true,
3179
- children: /* @__PURE__ */ jsx30(
3180
- motion4.div,
3181
- {
3182
- initial: { opacity: 0, scale: 0.95 },
3183
- animate: { opacity: 1, scale: 1 },
3184
- exit: { opacity: 0, scale: 0.95 },
3185
- transition: { duration: 0.2 },
3186
- children: /* @__PURE__ */ jsxs20(Fragment2, { children: [
3187
- /* @__PURE__ */ jsx30(SelectScrollUpButtonBase, {}),
3188
- /* @__PURE__ */ jsx30(
3189
- SelectPrimitive.Viewport,
3190
- {
3191
- className: cn(
3192
- "p-1",
3193
- position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
3194
- ),
3195
- children
3196
- }
3197
- ),
3198
- /* @__PURE__ */ jsx30(SelectScrollDownButtonBase, {})
3199
- ] })
3200
- }
3201
- )
3202
- }
3203
- ) }) }));
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
+ );
3204
3254
  SelectContentBase.displayName = SelectPrimitive.Content.displayName;
3205
3255
  var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx30(
3206
3256
  SelectPrimitive.Label,
@@ -3211,19 +3261,36 @@ var SelectLabelBase = React19.forwardRef(({ className, ...props }, ref) => /* @_
3211
3261
  }
3212
3262
  ));
3213
3263
  SelectLabelBase.displayName = SelectPrimitive.Label.displayName;
3214
- var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs20(
3264
+ var SelectItemBase = React19.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx30(
3215
3265
  SelectPrimitive.Item,
3216
3266
  {
3217
3267
  ref,
3218
3268
  className: cn(
3219
- "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",
3220
3270
  className
3221
3271
  ),
3222
3272
  ...props,
3223
- children: [
3224
- /* @__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" }) }) }),
3225
- /* @__PURE__ */ jsx30(SelectPrimitive.ItemText, { children })
3226
- ]
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
+ )
3227
3294
  }
3228
3295
  ));
3229
3296
  SelectItemBase.displayName = SelectPrimitive.Item.displayName;
@@ -3240,7 +3307,7 @@ SelectSeparatorBase.displayName = SelectPrimitive.Separator.displayName;
3240
3307
  // src/components/ui/SeparatorBase.tsx
3241
3308
  import * as React20 from "react";
3242
3309
  import * as SeparatorPrimitive from "@radix-ui/react-separator";
3243
- import { motion as motion5 } from "framer-motion";
3310
+ import { motion as motion7 } from "framer-motion";
3244
3311
  import { jsx as jsx31 } from "react/jsx-runtime";
3245
3312
  var SeparatorBase = React20.forwardRef(
3246
3313
  ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
@@ -3254,7 +3321,7 @@ var SeparatorBase = React20.forwardRef(
3254
3321
  asChild: true,
3255
3322
  ...props,
3256
3323
  children: /* @__PURE__ */ jsx31(
3257
- motion5.div,
3324
+ motion7.div,
3258
3325
  {
3259
3326
  className: cn(
3260
3327
  "shrink-0 bg-border",
@@ -4311,7 +4378,7 @@ TabsContentBase.displayName = TabsPrimitive.Content.displayName;
4311
4378
 
4312
4379
  // src/components/ui/TextAreaBase.tsx
4313
4380
  import * as React28 from "react";
4314
- import { motion as motion6 } from "framer-motion";
4381
+ import { motion as motion8 } from "framer-motion";
4315
4382
  import { TrashIcon as TrashIcon2 } from "@phosphor-icons/react";
4316
4383
  import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
4317
4384
  var TextAreaBase = React28.forwardRef(
@@ -4392,7 +4459,7 @@ var TextAreaBase = React28.forwardRef(
4392
4459
  onOpenChange: setShowConfirmTooltip,
4393
4460
  children: [
4394
4461
  /* @__PURE__ */ jsx40(TooltipTriggerBase, { asChild: true, children: /* @__PURE__ */ jsx40(
4395
- motion6.button,
4462
+ motion8.button,
4396
4463
  {
4397
4464
  type: "button",
4398
4465
  initial: { opacity: 0, scale: 0.8 },
@@ -4456,7 +4523,7 @@ var TextAreaBase = React28.forwardRef(
4456
4523
  }
4457
4524
  ) }),
4458
4525
  /* @__PURE__ */ jsx40(
4459
- motion6.div,
4526
+ motion8.div,
4460
4527
  {
4461
4528
  className: "pointer-events-none absolute inset-0 rounded-lg",
4462
4529
  initial: { opacity: 0 },
@@ -4466,7 +4533,7 @@ var TextAreaBase = React28.forwardRef(
4466
4533
  }
4467
4534
  ),
4468
4535
  isFocused && hasContent && props.maxLength && /* @__PURE__ */ jsxs24(
4469
- motion6.div,
4536
+ motion8.div,
4470
4537
  {
4471
4538
  initial: { opacity: 0, y: -10 },
4472
4539
  animate: { opacity: 1, y: 0 },
@@ -4685,7 +4752,7 @@ import {
4685
4752
  XIcon as XIcon4,
4686
4753
  CalendarIcon
4687
4754
  } from "@phosphor-icons/react";
4688
- import { AnimatePresence as AnimatePresence4 } from "framer-motion";
4755
+ import { AnimatePresence as AnimatePresence5 } from "framer-motion";
4689
4756
  import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
4690
4757
  function CalendarBase2({
4691
4758
  className,
@@ -4710,7 +4777,7 @@ function CalendarBase2({
4710
4777
  "rounded-md border bg-background p-4 shadow-lg overflow-hidden w-full h-full flex flex-col",
4711
4778
  className
4712
4779
  ),
4713
- 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(
4714
4781
  "div",
4715
4782
  {
4716
4783
  className: "w-full h-full flex flex-col",
@@ -4782,7 +4849,7 @@ import { ptBR } from "date-fns/locale";
4782
4849
  import { useEffect as useEffect8, useState as useState9 } from "react";
4783
4850
 
4784
4851
  // src/components/date-time-picker/TimePicker.tsx
4785
- import { motion as motion7, AnimatePresence as AnimatePresence5 } from "framer-motion";
4852
+ import { motion as motion9, AnimatePresence as AnimatePresence6 } from "framer-motion";
4786
4853
  import * as React32 from "react";
4787
4854
 
4788
4855
  // src/components/date-time-picker/TimePickerInput.tsx
@@ -5154,7 +5221,7 @@ function TimePicker({
5154
5221
  visible: { opacity: 1, y: 0 }
5155
5222
  };
5156
5223
  return /* @__PURE__ */ jsxs29(
5157
- motion7.div,
5224
+ motion9.div,
5158
5225
  {
5159
5226
  variants: containerVariants,
5160
5227
  initial: "hidden",
@@ -5162,7 +5229,7 @@ function TimePicker({
5162
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",
5163
5230
  children: [
5164
5231
  /* @__PURE__ */ jsx46(
5165
- motion7.div,
5232
+ motion9.div,
5166
5233
  {
5167
5234
  variants: itemVariants2,
5168
5235
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -5180,7 +5247,7 @@ function TimePicker({
5180
5247
  }
5181
5248
  ),
5182
5249
  /* @__PURE__ */ jsx46(
5183
- motion7.div,
5250
+ motion9.div,
5184
5251
  {
5185
5252
  variants: itemVariants2,
5186
5253
  className: "grid gap-1 sm:gap-2 text-center flex-shrink-0 min-w-0",
@@ -5198,8 +5265,8 @@ function TimePicker({
5198
5265
  )
5199
5266
  }
5200
5267
  ),
5201
- /* @__PURE__ */ jsx46(AnimatePresence5, { children: !hideSeconds && /* @__PURE__ */ jsx46(Fragment4, { children: /* @__PURE__ */ jsx46(
5202
- motion7.div,
5268
+ /* @__PURE__ */ jsx46(AnimatePresence6, { children: !hideSeconds && /* @__PURE__ */ jsx46(Fragment4, { children: /* @__PURE__ */ jsx46(
5269
+ motion9.div,
5203
5270
  {
5204
5271
  variants: itemVariants2,
5205
5272
  initial: "hidden",
@@ -5284,9 +5351,9 @@ function DateTimePicker({
5284
5351
  variant: "outline",
5285
5352
  className: cn(
5286
5353
  "w-full justify-start text-left min-w-0 overflow-hidden",
5287
- "",
5354
+ "text-muted-foreground/90",
5288
5355
  "text-sm sm:text-base",
5289
- !date && "text-muted-foreground"
5356
+ !date && "text-muted-foreground/"
5290
5357
  ),
5291
5358
  children: [
5292
5359
  /* @__PURE__ */ jsx47("span", { className: "truncate flex-1", children: date ? format(date, getDisplayFormat(), { locale: ptBR }) : "Pick a date" }),
@@ -5389,6 +5456,7 @@ function DateTimePicker({
5389
5456
  }
5390
5457
 
5391
5458
  // src/components/selects/Select.tsx
5459
+ import { motion as motion10, AnimatePresence as AnimatePresence7 } from "framer-motion";
5392
5460
  import { Fragment as Fragment5, jsx as jsx48, jsxs as jsxs31 } from "react/jsx-runtime";
5393
5461
  function Select({
5394
5462
  items,
@@ -5399,53 +5467,77 @@ function Select({
5399
5467
  testIds = {}
5400
5468
  }) {
5401
5469
  return /* @__PURE__ */ jsxs31("div", { "data-testid": testIds.root ?? "select-root", children: [
5402
- /* @__PURE__ */ jsxs31(SelectBase, { onValueChange: onChange, "data-testid": testIds.base ?? "select-base", children: [
5403
- /* @__PURE__ */ jsx48(
5404
- SelectTriggerBase,
5405
- {
5406
- className: cn(
5407
- "flex h-12 w-full content-start text-lg shadow-md",
5408
- errorMessage && "border-red-500"
5409
- ),
5410
- "data-testid": testIds.trigger ?? "select-trigger",
5411
- children: /* @__PURE__ */ jsx48(
5412
- SelectValueBase,
5470
+ /* @__PURE__ */ jsxs31(
5471
+ SelectBase,
5472
+ {
5473
+ onValueChange: onChange,
5474
+ "data-testid": testIds.base ?? "select-base",
5475
+ children: [
5476
+ /* @__PURE__ */ jsx48(
5477
+ SelectTriggerBase,
5413
5478
  {
5414
- placeholder,
5415
- "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
+ )
5416
5491
  }
5417
- )
5418
- }
5419
- ),
5420
- /* @__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(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: [
5421
- /* @__PURE__ */ jsx48(SelectLabelBase, { "data-testid": testIds.label ?? "select-label", children: key }),
5422
- groupItems[key].map((item) => /* @__PURE__ */ jsx48(
5423
- SelectItemBase,
5424
- {
5425
- value: item.value,
5426
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5427
- children: item.label
5428
- },
5429
- item.value
5430
- ))
5431
- ] }, key)) }) : /* @__PURE__ */ jsx48(SelectGroupBase, { "data-testid": testIds.group ?? "select-group", children: items.map((item) => /* @__PURE__ */ jsx48(
5432
- SelectItemBase,
5433
- {
5434
- value: item.value,
5435
- "data-testid": testIds.item?.(item.value) ?? `select-item-${item.value}`,
5436
- children: item.label
5437
- },
5438
- item.value
5439
- )) }) }) })
5440
- ] }),
5441
- errorMessage && /* @__PURE__ */ jsx48(
5442
- "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,
5443
5531
  {
5532
+ initial: { opacity: 0, y: -10 },
5533
+ animate: { opacity: 1, y: 0 },
5534
+ exit: { opacity: 0, y: -10 },
5535
+ transition: { duration: 0.2 },
5444
5536
  className: "text-sm text-red-500",
5445
5537
  "data-testid": testIds.error ?? "select-error",
5446
5538
  children: errorMessage
5447
5539
  }
5448
- )
5540
+ ) })
5449
5541
  ] });
5450
5542
  }
5451
5543
 
@@ -5619,7 +5711,7 @@ import { toast as toast2 } from "sonner";
5619
5711
 
5620
5712
  // src/components/charts/components/controls/PeriodsDropdown.tsx
5621
5713
  import { useState as useState10, useRef as useRef3, useEffect as useEffect9 } from "react";
5622
- import { motion as motion8, AnimatePresence as AnimatePresence6 } from "framer-motion";
5714
+ import { motion as motion11, AnimatePresence as AnimatePresence8 } from "framer-motion";
5623
5715
  import { DotsThreeIcon as DotsThreeIcon2 } from "@phosphor-icons/react/dist/ssr";
5624
5716
  import { Check } from "@phosphor-icons/react/dist/ssr";
5625
5717
  import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -5694,8 +5786,8 @@ function PeriodsDropdown({
5694
5786
  ]
5695
5787
  }
5696
5788
  ),
5697
- /* @__PURE__ */ jsx49(AnimatePresence6, { children: open && /* @__PURE__ */ jsxs32(
5698
- motion8.div,
5789
+ /* @__PURE__ */ jsx49(AnimatePresence8, { children: open && /* @__PURE__ */ jsxs32(
5790
+ motion11.div,
5699
5791
  {
5700
5792
  initial: "hidden",
5701
5793
  animate: "visible",
@@ -5724,7 +5816,7 @@ function PeriodsDropdown({
5724
5816
  className: "flex flex-col p-2 gap-1",
5725
5817
  style: { maxHeight: 200, overflowY: "auto" },
5726
5818
  children: periods.map((p, idx) => /* @__PURE__ */ jsxs32(
5727
- motion8.button,
5819
+ motion11.button,
5728
5820
  {
5729
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"),
5730
5822
  variants: itemVariants,
@@ -5752,7 +5844,7 @@ function PeriodsDropdown({
5752
5844
  var PeriodsDropdown_default = PeriodsDropdown;
5753
5845
 
5754
5846
  // src/components/charts/components/controls/ShowOnly.tsx
5755
- import { motion as motion9 } from "framer-motion";
5847
+ import { motion as motion12 } from "framer-motion";
5756
5848
  import { Eye, EyeSlash } from "@phosphor-icons/react";
5757
5849
  import { Fragment as Fragment6, jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
5758
5850
  var ShowOnly = ({
@@ -5763,7 +5855,7 @@ var ShowOnly = ({
5763
5855
  const hasHighlights = highlightedSeriesSize > 0;
5764
5856
  if (!hasHighlights) return null;
5765
5857
  return /* @__PURE__ */ jsx50("div", { className: "ml-auto flex items-center gap-2", children: /* @__PURE__ */ jsx50(
5766
- motion9.div,
5858
+ motion12.div,
5767
5859
  {
5768
5860
  whileTap: { scale: hasHighlights ? 0.985 : 1 },
5769
5861
  whileHover: { y: hasHighlights ? -2 : 0 },
@@ -5796,7 +5888,7 @@ var ShowOnly = ({
5796
5888
  var ShowOnly_default = ShowOnly;
5797
5889
 
5798
5890
  // src/components/charts/components/controls/Highlights.tsx
5799
- import { motion as motion10, AnimatePresence as AnimatePresence7 } from "framer-motion";
5891
+ import { motion as motion13, AnimatePresence as AnimatePresence9 } from "framer-motion";
5800
5892
  import { CheckIcon as CheckIcon7 } from "@phosphor-icons/react/dist/ssr";
5801
5893
  import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
5802
5894
  var Highlights = ({
@@ -5817,13 +5909,13 @@ var Highlights = ({
5817
5909
  visible: { opacity: 1, transition: { staggerChildren: 0.03 } }
5818
5910
  };
5819
5911
  return /* @__PURE__ */ jsx51(
5820
- motion10.div,
5912
+ motion13.div,
5821
5913
  {
5822
5914
  className: "flex-1 flex items-center gap-2 flex-wrap",
5823
5915
  initial: "hidden",
5824
5916
  animate: "visible",
5825
5917
  variants: containerVariants,
5826
- 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) => {
5827
5919
  const isHighlighted = highlightedSeries.has(k);
5828
5920
  const label = mapperConfig[k]?.label ?? k;
5829
5921
  const color = finalColors[k];
@@ -5833,7 +5925,7 @@ var Highlights = ({
5833
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"
5834
5926
  );
5835
5927
  return /* @__PURE__ */ jsx51(
5836
- motion10.div,
5928
+ motion13.div,
5837
5929
  {
5838
5930
  layout: true,
5839
5931
  initial: "hidden",
@@ -5850,7 +5942,7 @@ var Highlights = ({
5850
5942
  style: { minWidth: showFullLabel ? void 0 : 36 },
5851
5943
  "aria-pressed": isHighlighted,
5852
5944
  children: /* @__PURE__ */ jsxs34(
5853
- motion10.button,
5945
+ motion13.button,
5854
5946
  {
5855
5947
  whileHover: { scale: isHighlighted ? 1.04 : 1.03 },
5856
5948
  whileTap: { scale: 0.96 },
@@ -5858,7 +5950,7 @@ var Highlights = ({
5858
5950
  className: "flex items-center gap-2 min-w-0 pr-2",
5859
5951
  children: [
5860
5952
  /* @__PURE__ */ jsx51(
5861
- motion10.span,
5953
+ motion13.span,
5862
5954
  {
5863
5955
  className: cn("w-3 h-3 rounded-sm flex-shrink-0 border"),
5864
5956
  style: {
@@ -5872,8 +5964,8 @@ var Highlights = ({
5872
5964
  transition: { type: "spring", stiffness: 400, damping: 30 }
5873
5965
  }
5874
5966
  ),
5875
- showFullLabel ? /* @__PURE__ */ jsx51(motion10.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ jsx51(
5876
- motion10.span,
5967
+ showFullLabel ? /* @__PURE__ */ jsx51(motion13.span, { className: "truncate max-w-[10rem] pr-2", layout: true, children: label }) : showShortLabel ? /* @__PURE__ */ jsx51(
5968
+ motion13.span,
5877
5969
  {
5878
5970
  className: "truncate max-w-[6rem] text-xs pr-2",
5879
5971
  layout: true,
@@ -5881,7 +5973,7 @@ var Highlights = ({
5881
5973
  }
5882
5974
  ) : null,
5883
5975
  /* @__PURE__ */ jsx51(
5884
- motion10.span,
5976
+ motion13.span,
5885
5977
  {
5886
5978
  "aria-hidden": true,
5887
5979
  initial: { opacity: 0, scale: 0.6 },
@@ -5997,7 +6089,7 @@ import React34, {
5997
6089
  useCallback as useCallback6,
5998
6090
  useMemo as useMemo5
5999
6091
  } from "react";
6000
- import { motion as motion11, AnimatePresence as AnimatePresence8 } from "framer-motion";
6092
+ import { motion as motion14, AnimatePresence as AnimatePresence10 } from "framer-motion";
6001
6093
  import { DotsSixVerticalIcon } from "@phosphor-icons/react";
6002
6094
  import { XIcon as XIcon6 } from "@phosphor-icons/react/dist/ssr";
6003
6095
  import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs36 } from "react/jsx-runtime";
@@ -6372,7 +6464,7 @@ var DraggableTooltipComponent = ({
6372
6464
  );
6373
6465
  return /* @__PURE__ */ jsxs36("div", { children: [
6374
6466
  /* @__PURE__ */ jsx53(
6375
- motion11.div,
6467
+ motion14.div,
6376
6468
  {
6377
6469
  className: "fixed pointer-events-none z-30",
6378
6470
  variants: guideVariants,
@@ -6394,7 +6486,7 @@ var DraggableTooltipComponent = ({
6394
6486
  }
6395
6487
  ),
6396
6488
  /* @__PURE__ */ jsx53(
6397
- motion11.div,
6489
+ motion14.div,
6398
6490
  {
6399
6491
  className: "fixed pointer-events-none z-31",
6400
6492
  variants: guideDotVariants,
@@ -6413,7 +6505,7 @@ var DraggableTooltipComponent = ({
6413
6505
  }
6414
6506
  ),
6415
6507
  /* @__PURE__ */ jsx53(
6416
- motion11.div,
6508
+ motion14.div,
6417
6509
  {
6418
6510
  className: "fixed pointer-events-none z-31",
6419
6511
  variants: guideDotVariants,
@@ -6433,8 +6525,8 @@ var DraggableTooltipComponent = ({
6433
6525
  )
6434
6526
  ] }, index);
6435
6527
  }),
6436
- /* @__PURE__ */ jsx53(AnimatePresence8, { children: /* @__PURE__ */ jsxs36(
6437
- motion11.div,
6528
+ /* @__PURE__ */ jsx53(AnimatePresence10, { children: /* @__PURE__ */ jsxs36(
6529
+ motion14.div,
6438
6530
  {
6439
6531
  className: "fixed bg-card border border-border rounded-lg shadow-lg z-50 min-w-80 select-none",
6440
6532
  variants: tooltipVariants,
@@ -8975,13 +9067,1180 @@ var useChartHighlights = () => {
8975
9067
  };
8976
9068
  };
8977
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
+
8978
10237
  // src/hooks/use-drag.tsx
8979
- import { useState as useState16, useCallback as useCallback11, useRef as useRef6, useEffect as useEffect14 } from "react";
10238
+ import { useState as useState18, useCallback as useCallback11, useRef as useRef7, useEffect as useEffect16 } from "react";
8980
10239
  var useDrag = (options = {}) => {
8981
- const [isDragging, setIsDragging] = useState16(null);
8982
- const [positions, setPositions] = useState16({});
8983
- const dragStartPos = useRef6(null);
8984
- const dragId = useRef6(null);
10240
+ const [isDragging, setIsDragging] = useState18(null);
10241
+ const [positions, setPositions] = useState18({});
10242
+ const dragStartPos = useRef7(null);
10243
+ const dragId = useRef7(null);
8985
10244
  const handleMouseDown = useCallback11((id, e) => {
8986
10245
  e.preventDefault();
8987
10246
  const currentPosition = positions[id] || { top: 0, left: 0 };
@@ -9019,7 +10278,7 @@ var useDrag = (options = {}) => {
9019
10278
  dragStartPos.current = null;
9020
10279
  dragId.current = null;
9021
10280
  }, [options]);
9022
- useEffect14(() => {
10281
+ useEffect16(() => {
9023
10282
  if (isDragging) {
9024
10283
  document.addEventListener("mousemove", handleMouseMove);
9025
10284
  document.addEventListener("mouseup", handleMouseUp);
@@ -9052,6 +10311,7 @@ var useDrag = (options = {}) => {
9052
10311
  };
9053
10312
  };
9054
10313
  export {
10314
+ AddButton,
9055
10315
  AlertDialogActionBase,
9056
10316
  AlertDialogBase,
9057
10317
  AlertDialogCancelBase,
@@ -9066,6 +10326,7 @@ export {
9066
10326
  AvatarBase,
9067
10327
  AvatarFallbackBase,
9068
10328
  AvatarImageBase,
10329
+ BackButton,
9069
10330
  BadgeBase,
9070
10331
  BarChart_default as BarChart,
9071
10332
  BreadcrumbBase,
@@ -9090,8 +10351,10 @@ export {
9090
10351
  CarouselNextBase,
9091
10352
  CarouselPrevious,
9092
10353
  Chart_default as Chart,
10354
+ CheckButton,
9093
10355
  CheckboxBase,
9094
10356
  CloseAllButton_default as CloseAllButton,
10357
+ CloseButton,
9095
10358
  CollapsibleBase,
9096
10359
  CollapsibleContentBase,
9097
10360
  CollapsibleTriggerBase,
@@ -9120,7 +10383,9 @@ export {
9120
10383
  ContextMenuSubContentBase,
9121
10384
  ContextMenuSubTriggerBase,
9122
10385
  ContextMenuTriggerBase,
10386
+ CopyButton,
9123
10387
  DateTimePicker,
10388
+ DeleteButton,
9124
10389
  DestructiveDialog,
9125
10390
  DialogBase,
9126
10391
  DialogCloseBase,
@@ -9132,6 +10397,7 @@ export {
9132
10397
  DialogPortalBase,
9133
10398
  DialogTitleBase,
9134
10399
  DialogTriggerBase,
10400
+ DownloadButton,
9135
10401
  DraggableTooltip_default as DraggableTooltip,
9136
10402
  DrawerBase,
9137
10403
  DrawerCloseBase,
@@ -9158,6 +10424,11 @@ export {
9158
10424
  DropDownMenuSubContentBase,
9159
10425
  DropDownMenuSubTriggerBase,
9160
10426
  DropDownMenuTriggerBase,
10427
+ EditButton,
10428
+ FavoriteButton,
10429
+ FileUploader,
10430
+ FilterButton,
10431
+ HideButton,
9161
10432
  Highlights_default as Highlights,
9162
10433
  HoverCardBase,
9163
10434
  HoverCardContentBase,
@@ -9168,9 +10439,12 @@ export {
9168
10439
  InputOTPSeparatorBase,
9169
10440
  InputOTPSlotBase,
9170
10441
  LabelBase_default as LabelBase,
10442
+ LikeButton,
9171
10443
  LineChart_default as LineChart,
9172
10444
  LoadingBase,
10445
+ LockButton,
9173
10446
  ModeToggleBase,
10447
+ MoreButton,
9174
10448
  MultiCombobox,
9175
10449
  NavigationMenuBase,
9176
10450
  NavigationMenuContentBase,
@@ -9180,6 +10454,7 @@ export {
9180
10454
  NavigationMenuListBase,
9181
10455
  NavigationMenuTriggerBase,
9182
10456
  NavigationMenuViewportBase,
10457
+ NotificationButton,
9183
10458
  PeriodsDropdown_default as PeriodsDropdown,
9184
10459
  PieChart_default as PieChart,
9185
10460
  PopoverAnchorBase,
@@ -9190,8 +10465,11 @@ export {
9190
10465
  ProgressCirclesBase,
9191
10466
  ProgressPanelsBase,
9192
10467
  ProgressSegmentsBase,
10468
+ RefreshButton,
10469
+ SaveButton,
9193
10470
  ScrollAreaBase,
9194
10471
  ScrollBarBase,
10472
+ SearchButton,
9195
10473
  Select,
9196
10474
  SelectBase,
9197
10475
  SelectContentBase,
@@ -9204,6 +10482,7 @@ export {
9204
10482
  SelectTriggerBase,
9205
10483
  SelectValueBase,
9206
10484
  SeparatorBase,
10485
+ SettingsButton,
9207
10486
  SheetBase,
9208
10487
  SheetCloseBase,
9209
10488
  SheetContentBase,
@@ -9264,7 +10543,11 @@ export {
9264
10543
  TooltipSimple_default as TooltipSimple,
9265
10544
  TooltipTriggerBase,
9266
10545
  TooltipWithTotal_default as TooltipWithTotal,
10546
+ UnlockButton,
10547
+ UploadButton,
9267
10548
  UseSideBarBase,
10549
+ ViewButton,
10550
+ VisibilityButton,
9268
10551
  badgeVariants,
9269
10552
  buttonVariantsBase,
9270
10553
  compactTick,