@mlw-packages/react-components 1.10.16 → 1.10.18

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.js CHANGED
@@ -38,12 +38,12 @@ var ContextMenuPrimitive = require('@radix-ui/react-context-menu');
38
38
  var reactSyntaxHighlighter = require('react-syntax-highlighter');
39
39
  var dateFns = require('date-fns');
40
40
  var locale = require('date-fns/locale');
41
- var ptBR3 = require('date-fns/locale/pt-BR');
42
41
  var core = require('@dnd-kit/core');
43
42
  var utilities = require('@dnd-kit/utilities');
44
43
  var reactRadioGroup = require('@radix-ui/react-radio-group');
45
44
  var recharts = require('recharts');
46
45
  var useEmblaCarousel = require('embla-carousel-react');
46
+ var reactVirtual = require('@tanstack/react-virtual');
47
47
 
48
48
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
49
49
 
@@ -84,7 +84,6 @@ var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespace(SeparatorPrim
84
84
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
85
85
  var NavigationMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(NavigationMenuPrimitive);
86
86
  var ContextMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(ContextMenuPrimitive);
87
- var ptBR3__default = /*#__PURE__*/_interopDefault(ptBR3);
88
87
  var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
89
88
 
90
89
  var __create = Object.create;
@@ -2556,7 +2555,7 @@ function Combobox({
2556
2555
  ] });
2557
2556
  }
2558
2557
  var badgeVariants = classVarianceAuthority.cva(
2559
- "inline-flex items-center justify-center rounded-md border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden",
2558
+ "inline-flex items-center justify-center rounded-md border text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden border-border",
2560
2559
  {
2561
2560
  variants: {
2562
2561
  size: {
@@ -2573,6 +2572,7 @@ var badgeVariants = classVarianceAuthority.cva(
2573
2572
  function Badge({
2574
2573
  className,
2575
2574
  color,
2575
+ rank,
2576
2576
  size = "md",
2577
2577
  asChild = false,
2578
2578
  children,
@@ -2589,6 +2589,12 @@ function Badge({
2589
2589
  blue: "bg-blue-50 text-blue-500 border-blue-200",
2590
2590
  purple: "bg-purple-50 text-purple-500 border-purple-200"
2591
2591
  };
2592
+ const rankClasses = {
2593
+ diamond: "bg-cyan-100 text-cyan-600 border-cyan-300",
2594
+ gold: "bg-yellow-100 text-yellow-500 border-yellow-300",
2595
+ silver: "bg-gray-100 text-gray-500 border-gray-300",
2596
+ bronze: "bg-orange-100 text-orange-700 border-orange-300"
2597
+ };
2592
2598
  return /* @__PURE__ */ jsxRuntime.jsx(
2593
2599
  Comp,
2594
2600
  {
@@ -2596,6 +2602,7 @@ function Badge({
2596
2602
  className: cn(
2597
2603
  badgeVariants({ size }),
2598
2604
  color ? colorClasses[color] : void 0,
2605
+ rank ? rankClasses[rank] : void 0,
2599
2606
  className
2600
2607
  ),
2601
2608
  style: customStyle,
@@ -7859,7 +7866,8 @@ function DateTimePicker({
7859
7866
  disabled,
7860
7867
  className,
7861
7868
  error,
7862
- hideClear = true
7869
+ hideClear = true,
7870
+ triggerIcon
7863
7871
  }) {
7864
7872
  const [internalDate, setInternalDate] = React32.useState(date);
7865
7873
  const [open, setOpen] = React32.useState(false);
@@ -7909,193 +7917,222 @@ function DateTimePicker({
7909
7917
  const { ref: contentRef, center } = use_auto_center_default(open);
7910
7918
  const basePopoverClass = "w-auto max-w-[calc(100vw-16px)] p-0 border-none shadow-none";
7911
7919
  const centeredPopoverClass = "w-auto max-w-[calc(100vw-16px)] p-0 border-none shadow-none fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-50";
7912
- const renderTriggerButton = () => /* @__PURE__ */ jsxRuntime.jsxs(
7913
- ButtonBase,
7914
- {
7915
- variant: "outline",
7916
- disabled,
7917
- className: cn(
7918
- "w-full justify-start text-left min-w-0 overflow-hidden",
7919
- !date && "text-muted-foreground"
7920
- ),
7921
- children: [
7922
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("truncate flex-1", !date && "text-muted-foreground"), children: date ? dateFns.format(date, getDisplayFormat(), { locale: locale.ptBR }) : "Selecione uma data" }),
7923
- /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.span, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-0 items-center ", children: [
7924
- hideClear && (date || internalDate) && /* @__PURE__ */ jsxRuntime.jsx(
7925
- ClearButton,
7926
- {
7927
- onClick: (e) => {
7928
- e?.stopPropagation();
7929
- setInternalDate(null);
7930
- onChange?.(null);
7931
- onConfirm?.(null);
7932
- }
7933
- }
7934
- ),
7935
- /* @__PURE__ */ jsxRuntime.jsx(
7936
- framerMotion.motion.div,
7937
- {
7938
- animate: { rotate: open ? 15 : 0 },
7939
- transition: { duration: 0.03 },
7940
- children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarBlankIcon, { className: "h-4 w-4" })
7941
- }
7942
- )
7943
- ] }) })
7944
- ]
7920
+ const renderTriggerButton = () => {
7921
+ if (triggerIcon) {
7922
+ return /* @__PURE__ */ jsxRuntime.jsx(
7923
+ ButtonBase,
7924
+ {
7925
+ variant: "outline",
7926
+ size: "icon",
7927
+ disabled,
7928
+ className: cn("no-active-animation", error && "border-red-500"),
7929
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarBlankIcon, { className: "h-4 w-4" })
7930
+ }
7931
+ );
7945
7932
  }
7946
- );
7947
- const renderPickerContent = () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-2 sm:p-3 border border-border rounded-md", children: [
7948
- isMobile && !hideTime ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-h-0", children: [
7949
- internalDate && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 px-4 py-3 rounded-lg ", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-md font-semibold", children: [
7950
- dateFns.format(internalDate, "dd 'de' MMMM 'de' yyyy", {
7951
- locale: locale.ptBR
7952
- }),
7953
- " ",
7954
- "- ",
7955
- dateFns.format(internalDate, hideSeconds ? "HH:mm" : "HH:mm:ss")
7956
- ] }) }),
7957
- /* @__PURE__ */ jsxRuntime.jsxs(TabsBase, { value: activeTab, onValueChange: setActiveTab, children: [
7958
- /* @__PURE__ */ jsxRuntime.jsxs(TabsListBase, { className: "", children: [
7959
- /* @__PURE__ */ jsxRuntime.jsx(TabsTriggerBase, { value: "calendar", className: "flex-1", children: "Data" }),
7960
- /* @__PURE__ */ jsxRuntime.jsx(TabsTriggerBase, { value: "time", className: "flex-1", children: "Hor\xE1rio" })
7961
- ] }),
7962
- /* @__PURE__ */ jsxRuntime.jsx(TabsContentBase, { value: "calendar", className: "mt-0", children: /* @__PURE__ */ jsxRuntime.jsx(
7963
- CalendarBase2,
7964
- {
7965
- mode: "single",
7966
- locale: locale.ptBR,
7967
- selected: internalDate ?? void 0,
7968
- onSelect: (d) => handleSelect(d ?? null),
7969
- autoFocus: true,
7970
- defaultMonth: fromDate ?? toDate ?? internalDate ?? void 0,
7971
- ...fromDate && { startMonth: fromDate },
7972
- ...toDate && { endMonth: toDate },
7973
- ...fromDate || toDate ? {
7974
- disabled: [
7975
- ...fromDate ? [{ before: fromDate }] : [],
7976
- ...toDate ? [{ after: toDate }] : []
7977
- ]
7978
- } : {},
7979
- className: cn("w-full rounded-none border-none")
7980
- }
7981
- ) }),
7982
- /* @__PURE__ */ jsxRuntime.jsx(TabsContentBase, { value: "time", className: "mt-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center gap-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
7983
- TimeScrollPicker,
7984
- {
7985
- setDate: (d) => handleTimeChange(d ?? null),
7986
- date: internalDate,
7987
- hideSeconds
7988
- }
7989
- ) }) })
7990
- ] })
7991
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
7992
- "div",
7933
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7934
+ ButtonBase,
7993
7935
  {
7994
- ref: contentRef,
7995
- className: "flex flex-col sm:flex-row max-h-auto overflow-y-auto border-none rounded-md",
7936
+ variant: "outline",
7937
+ disabled,
7938
+ className: cn(
7939
+ "w-full justify-start text-left min-w-0 overflow-hidden",
7940
+ !date && "text-muted-foreground"
7941
+ ),
7996
7942
  children: [
7997
7943
  /* @__PURE__ */ jsxRuntime.jsx(
7998
- CalendarBase2,
7944
+ "span",
7999
7945
  {
8000
- mode: "single",
8001
- locale: locale.ptBR,
8002
- selected: internalDate ?? void 0,
8003
- onSelect: (d) => handleSelect(d ?? null),
8004
- autoFocus: true,
8005
- defaultMonth: fromDate ?? toDate ?? internalDate ?? void 0,
8006
- ...fromDate && { startMonth: fromDate },
8007
- ...toDate && { endMonth: toDate },
8008
- ...fromDate || toDate ? {
8009
- disabled: [
8010
- ...fromDate ? [{ before: fromDate }] : [],
8011
- ...toDate ? [{ after: toDate }] : []
8012
- ]
8013
- } : {},
8014
- className: cn(
8015
- "w-max rounded-none border-none",
8016
- !hideTime && "sm:rounded-r-none"
8017
- )
7946
+ className: cn("truncate flex-1", !date && "text-muted-foreground"),
7947
+ children: date ? dateFns.format(date, getDisplayFormat(), { locale: locale.ptBR }) : "Selecione uma data"
8018
7948
  }
8019
7949
  ),
8020
- !hideTime && /* @__PURE__ */ jsxRuntime.jsxs(
8021
- "div",
8022
- {
8023
- className: cn(
8024
- "flex flex-col items-center justify-center",
8025
- "border-l"
8026
- ),
8027
- children: [
8028
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[clamp(0.85rem,1.4vw,1.125rem)] sm:text-[clamp(0.9rem,1.6vw,1.125rem)] font-semibold capitalize text-left", children: "Hor\xE1rio" }),
8029
- /* @__PURE__ */ jsxRuntime.jsx(
8030
- TimeScrollPicker,
8031
- {
8032
- setDate: (d) => handleTimeChange(d ?? null),
8033
- date: internalDate,
8034
- hideSeconds
8035
- }
8036
- )
8037
- ]
8038
- }
8039
- )
7950
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.span, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-0 items-center ", children: [
7951
+ hideClear && (date || internalDate) && /* @__PURE__ */ jsxRuntime.jsx(
7952
+ ClearButton,
7953
+ {
7954
+ onClick: (e) => {
7955
+ e?.stopPropagation();
7956
+ setInternalDate(null);
7957
+ onChange?.(null);
7958
+ onConfirm?.(null);
7959
+ }
7960
+ }
7961
+ ),
7962
+ /* @__PURE__ */ jsxRuntime.jsx(
7963
+ framerMotion.motion.div,
7964
+ {
7965
+ animate: { rotate: open ? 15 : 0 },
7966
+ transition: { duration: 0.03 },
7967
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarBlankIcon, { className: "h-4 w-4" })
7968
+ }
7969
+ )
7970
+ ] }) })
8040
7971
  ]
8041
7972
  }
8042
- ),
8043
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex rounded-md p-1.5 gap-2", children: [
8044
- /* @__PURE__ */ jsxRuntime.jsx(
8045
- ButtonBase,
8046
- {
8047
- variant: "outline",
8048
- className: "no-active-animation",
8049
- tooltip: "Hoje",
8050
- size: "icon",
8051
- onClick: () => {
8052
- const now = /* @__PURE__ */ new Date();
8053
- const selected = hideTime ? new Date(
8054
- Date.UTC(
8055
- now.getUTCFullYear(),
8056
- now.getUTCMonth(),
8057
- now.getUTCDate(),
8058
- 0,
8059
- 0,
8060
- 0,
8061
- 0
8062
- )
8063
- ) : now;
8064
- setInternalDate(selected);
8065
- onChange?.(selected);
8066
- onConfirm?.(selected);
8067
- },
8068
- children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarDotIcon, { className: "h-4 w-4" })
8069
- }
7973
+ );
7974
+ };
7975
+ const renderPickerContent = () => /* @__PURE__ */ jsxRuntime.jsxs(
7976
+ "div",
7977
+ {
7978
+ className: cn(
7979
+ "p-2 sm:p-3",
7980
+ !isMobile && "border border-border rounded-md"
8070
7981
  ),
8071
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 sm:flex-row w-full gap-2", children: [
8072
- /* @__PURE__ */ jsxRuntime.jsx(
8073
- ButtonBase,
7982
+ children: [
7983
+ isMobile && !hideTime ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-h-0", children: [
7984
+ internalDate && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 px-4 py-3 rounded-lg ", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-md font-semibold", children: [
7985
+ dateFns.format(internalDate, "dd 'de' MMMM 'de' yyyy", {
7986
+ locale: locale.ptBR
7987
+ }),
7988
+ " ",
7989
+ "- ",
7990
+ dateFns.format(internalDate, hideSeconds ? "HH:mm" : "HH:mm:ss")
7991
+ ] }) }),
7992
+ /* @__PURE__ */ jsxRuntime.jsxs(TabsBase, { value: activeTab, onValueChange: setActiveTab, children: [
7993
+ /* @__PURE__ */ jsxRuntime.jsxs(TabsListBase, { className: "", children: [
7994
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTriggerBase, { value: "calendar", className: "flex-1", children: "Data" }),
7995
+ /* @__PURE__ */ jsxRuntime.jsx(TabsTriggerBase, { value: "time", className: "flex-1", children: "Hor\xE1rio" })
7996
+ ] }),
7997
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContentBase, { value: "calendar", className: "mt-0", children: /* @__PURE__ */ jsxRuntime.jsx(
7998
+ CalendarBase2,
7999
+ {
8000
+ mode: "single",
8001
+ locale: locale.ptBR,
8002
+ selected: internalDate ?? void 0,
8003
+ onSelect: (d) => handleSelect(d ?? null),
8004
+ autoFocus: true,
8005
+ defaultMonth: fromDate ?? toDate ?? internalDate ?? void 0,
8006
+ ...fromDate && { startMonth: fromDate },
8007
+ ...toDate && { endMonth: toDate },
8008
+ ...fromDate || toDate ? {
8009
+ disabled: [
8010
+ ...fromDate ? [{ before: fromDate }] : [],
8011
+ ...toDate ? [{ after: toDate }] : []
8012
+ ]
8013
+ } : {},
8014
+ className: cn("w-full rounded-none border-none")
8015
+ }
8016
+ ) }),
8017
+ /* @__PURE__ */ jsxRuntime.jsx(TabsContentBase, { value: "time", className: "mt-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center justify-center gap-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
8018
+ TimeScrollPicker,
8019
+ {
8020
+ setDate: (d) => handleTimeChange(d ?? null),
8021
+ date: internalDate,
8022
+ hideSeconds
8023
+ }
8024
+ ) }) })
8025
+ ] })
8026
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
8027
+ "div",
8074
8028
  {
8075
- className: "no-active-animation rounded-md bg-background text-primary border hover:bg-muted/50 overflow-hidden flex-1 min-w-0 border-border",
8076
- onClick: () => setOpen(false),
8077
- children: "Cancelar"
8029
+ ref: contentRef,
8030
+ className: "flex flex-col sm:flex-row max-h-auto overflow-y-auto border-none rounded-md",
8031
+ children: [
8032
+ /* @__PURE__ */ jsxRuntime.jsx(
8033
+ CalendarBase2,
8034
+ {
8035
+ mode: "single",
8036
+ locale: locale.ptBR,
8037
+ selected: internalDate ?? void 0,
8038
+ onSelect: (d) => handleSelect(d ?? null),
8039
+ autoFocus: true,
8040
+ defaultMonth: fromDate ?? toDate ?? internalDate ?? void 0,
8041
+ ...fromDate && { startMonth: fromDate },
8042
+ ...toDate && { endMonth: toDate },
8043
+ ...fromDate || toDate ? {
8044
+ disabled: [
8045
+ ...fromDate ? [{ before: fromDate }] : [],
8046
+ ...toDate ? [{ after: toDate }] : []
8047
+ ]
8048
+ } : {},
8049
+ className: cn(
8050
+ "w-max rounded-none border-none",
8051
+ !hideTime && "sm:rounded-r-none"
8052
+ )
8053
+ }
8054
+ ),
8055
+ !hideTime && /* @__PURE__ */ jsxRuntime.jsxs(
8056
+ "div",
8057
+ {
8058
+ className: cn(
8059
+ "flex flex-col items-center justify-center",
8060
+ "border-l"
8061
+ ),
8062
+ children: [
8063
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[clamp(0.85rem,1.4vw,1.125rem)] sm:text-[clamp(0.9rem,1.6vw,1.125rem)] font-semibold capitalize text-left", children: "Hor\xE1rio" }),
8064
+ /* @__PURE__ */ jsxRuntime.jsx(
8065
+ TimeScrollPicker,
8066
+ {
8067
+ setDate: (d) => handleTimeChange(d ?? null),
8068
+ date: internalDate,
8069
+ hideSeconds
8070
+ }
8071
+ )
8072
+ ]
8073
+ }
8074
+ )
8075
+ ]
8078
8076
  }
8079
8077
  ),
8080
- /* @__PURE__ */ jsxRuntime.jsx(
8081
- ButtonBase,
8082
- {
8083
- className: cn(
8084
- "no-active-animation rounded-md bg-emerald-600",
8085
- internalDate ? "hover:bg-emerald-700" : "opacity-50 cursor-not-allowed"
8078
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex rounded-md p-1.5 gap-2", children: [
8079
+ /* @__PURE__ */ jsxRuntime.jsx(
8080
+ ButtonBase,
8081
+ {
8082
+ variant: "outline",
8083
+ className: "no-active-animation",
8084
+ tooltip: "Hoje",
8085
+ size: "icon",
8086
+ onClick: () => {
8087
+ const now = /* @__PURE__ */ new Date();
8088
+ const selected = hideTime ? new Date(
8089
+ Date.UTC(
8090
+ now.getUTCFullYear(),
8091
+ now.getUTCMonth(),
8092
+ now.getUTCDate(),
8093
+ 0,
8094
+ 0,
8095
+ 0,
8096
+ 0
8097
+ )
8098
+ ) : now;
8099
+ setInternalDate(selected);
8100
+ onChange?.(selected);
8101
+ onConfirm?.(selected);
8102
+ },
8103
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.CalendarDotIcon, { className: "h-4 w-4" })
8104
+ }
8105
+ ),
8106
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 sm:flex-row w-full gap-2", children: [
8107
+ /* @__PURE__ */ jsxRuntime.jsx(
8108
+ ButtonBase,
8109
+ {
8110
+ className: "no-active-animation rounded-md bg-background text-primary border hover:bg-muted/50 overflow-hidden flex-1 min-w-0 border-border",
8111
+ onClick: () => setOpen(false),
8112
+ children: "Cancelar"
8113
+ }
8086
8114
  ),
8087
- disabled: !internalDate,
8088
- onClick: () => {
8089
- if (!internalDate) return;
8090
- setOpen(false);
8091
- onConfirm?.(internalDate);
8092
- },
8093
- children: "Confirmar"
8094
- }
8095
- )
8096
- ] })
8097
- ] })
8098
- ] });
8115
+ /* @__PURE__ */ jsxRuntime.jsx(
8116
+ ButtonBase,
8117
+ {
8118
+ className: cn(
8119
+ "no-active-animation rounded-md bg-emerald-600",
8120
+ internalDate ? "hover:bg-emerald-700" : "opacity-50 cursor-not-allowed"
8121
+ ),
8122
+ disabled: !internalDate,
8123
+ onClick: () => {
8124
+ if (!internalDate) return;
8125
+ setOpen(false);
8126
+ onConfirm?.(internalDate);
8127
+ },
8128
+ children: "Confirmar"
8129
+ }
8130
+ )
8131
+ ] })
8132
+ ] })
8133
+ ]
8134
+ }
8135
+ );
8099
8136
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full sm:w-auto", className), children: [
8100
8137
  label && /* @__PURE__ */ jsxRuntime.jsx(LabelBase_default, { children: label }),
8101
8138
  isMobile ? /* @__PURE__ */ jsxRuntime.jsxs(DialogBase, { open, onOpenChange: setOpen, children: [
@@ -8109,7 +8146,7 @@ function DateTimePicker({
8109
8146
  }
8110
8147
  ),
8111
8148
  /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage_default, { error }),
8112
- /* @__PURE__ */ jsxRuntime.jsx(DialogContentBase, { className: "p-0 max-h-[95vh] w-3/6 overflow-hidden flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto flex-1", children: renderPickerContent() }) })
8149
+ /* @__PURE__ */ jsxRuntime.jsx(DialogContentBase, { className: "p-0 max-h-[95vh] w-[95%] sm:max-w-lg overflow-hidden flex flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto flex-1", children: renderPickerContent() }) })
8113
8150
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(PopoverBase, { open, onOpenChange: setOpen, children: [
8114
8151
  /* @__PURE__ */ jsxRuntime.jsx(
8115
8152
  PopoverTriggerBase,
@@ -8131,7 +8168,6 @@ function DateTimePicker({
8131
8168
  ] })
8132
8169
  ] });
8133
8170
  }
8134
- var dateFnsLocale = ptBR3__default.default?.default ?? ptBR3__default.default;
8135
8171
  function RangePicker({
8136
8172
  value,
8137
8173
  onChange,
@@ -8186,8 +8222,8 @@ function RangePicker({
8186
8222
  !range && "text-muted-foreground"
8187
8223
  ),
8188
8224
  children: range?.from && range?.to ? `${dateFns.format(range.from, "P", {
8189
- locale: dateFnsLocale
8190
- })} - ${dateFns.format(range.to, "P", { locale: dateFnsLocale })}` : "Selecione um intervalo"
8225
+ locale: locale.ptBR
8226
+ })} - ${dateFns.format(range.to, "P", { locale: locale.ptBR })}` : "Selecione um intervalo"
8191
8227
  }
8192
8228
  ),
8193
8229
  /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.span, { className: "flex items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-0 items-center ", children: [
@@ -8247,7 +8283,7 @@ function RangePicker({
8247
8283
  mode: "range",
8248
8284
  selected: range,
8249
8285
  onSelect: handleSelect,
8250
- locale: dateFnsLocale,
8286
+ locale: locale.ptBR,
8251
8287
  showOutsideDays: true,
8252
8288
  fixedWeeks: true,
8253
8289
  weekStartsOn: 1,
@@ -21518,6 +21554,676 @@ function processIntegrationData(integrations, targetSystemName) {
21518
21554
  connections
21519
21555
  };
21520
21556
  }
21557
+ function normalizeStr(s) {
21558
+ return s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
21559
+ }
21560
+ function scoreMatch(item, query) {
21561
+ const q = normalizeStr(query);
21562
+ const label = normalizeStr(item.label);
21563
+ const desc = normalizeStr(item.description ?? "");
21564
+ const keywords = (item.keywords ?? []).map(normalizeStr);
21565
+ if (label === q) return 100;
21566
+ if (label.startsWith(q)) return 90;
21567
+ if (label.includes(q)) return 70;
21568
+ if (desc.includes(q)) return 50;
21569
+ if (keywords.some((k) => k.includes(q))) return 40;
21570
+ return -1;
21571
+ }
21572
+ function filterAndScore(groups, query) {
21573
+ if (!query.trim()) return groups;
21574
+ return groups.map((g) => ({
21575
+ ...g,
21576
+ items: g.items.map((item) => ({ item, score: scoreMatch(item, query) })).filter(({ score }) => score >= 0).sort((a, b) => b.score - a.score).map(({ item }) => item)
21577
+ })).filter((g) => g.items.length > 0).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
21578
+ }
21579
+ function normaliseGroups(items = [], groups = []) {
21580
+ const result = [];
21581
+ if (items.length > 0) {
21582
+ result.push({ id: "__flat__", label: "", items });
21583
+ }
21584
+ result.push(...groups);
21585
+ return result;
21586
+ }
21587
+ function unionGroups(base, terms) {
21588
+ if (terms.length === 0) return base;
21589
+ const allMatchedIds = /* @__PURE__ */ new Set();
21590
+ terms.forEach((term) => {
21591
+ const filtered = filterAndScore(base, term);
21592
+ filtered.forEach((g) => g.items.forEach((i) => allMatchedIds.add(i.id)));
21593
+ });
21594
+ return base.map((group) => ({
21595
+ ...group,
21596
+ items: group.items.filter((item) => allMatchedIds.has(item.id))
21597
+ })).filter((group) => group.items.length > 0);
21598
+ }
21599
+ function createGroup(id, label, items, opts) {
21600
+ return { id, label, items, ...opts };
21601
+ }
21602
+ function createItem(item) {
21603
+ return item;
21604
+ }
21605
+ var STORAGE_KEY = "cmd:recents";
21606
+ var MAX_RECENTS = 5;
21607
+ function readStorage() {
21608
+ try {
21609
+ return JSON.parse(localStorage.getItem(STORAGE_KEY) ?? "[]");
21610
+ } catch {
21611
+ return [];
21612
+ }
21613
+ }
21614
+ function writeStorage(ids) {
21615
+ try {
21616
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(ids));
21617
+ } catch {
21618
+ console.error("Failed to write to localStorage");
21619
+ }
21620
+ }
21621
+ function useRecents(allItems) {
21622
+ const [recentIds, setRecentIds] = React32.useState(readStorage);
21623
+ const push = React32.useCallback((item) => {
21624
+ setRecentIds((prev) => {
21625
+ const next = [item.id, ...prev.filter((id) => id !== item.id)].slice(
21626
+ 0,
21627
+ MAX_RECENTS
21628
+ );
21629
+ writeStorage(next);
21630
+ return next;
21631
+ });
21632
+ }, []);
21633
+ const clear = React32.useCallback(() => {
21634
+ setRecentIds([]);
21635
+ writeStorage([]);
21636
+ }, []);
21637
+ const items = recentIds.map((id) => allItems.find((i) => i.id === id)).filter(Boolean);
21638
+ return { items, push, clear };
21639
+ }
21640
+ function Kbd({ className, ...props }) {
21641
+ return /* @__PURE__ */ jsxRuntime.jsx(
21642
+ "kbd",
21643
+ {
21644
+ "data-slot": "kbd",
21645
+ className: cn(
21646
+ "bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none",
21647
+ className
21648
+ ),
21649
+ ...props
21650
+ }
21651
+ );
21652
+ }
21653
+ function KbdGroup({ className, ...props }) {
21654
+ return /* @__PURE__ */ jsxRuntime.jsx(
21655
+ "kbd",
21656
+ {
21657
+ "data-slot": "kbd-group",
21658
+ className: cn("gap-1 inline-flex items-center", className),
21659
+ ...props
21660
+ }
21661
+ );
21662
+ }
21663
+ function GroupLabel({ group }) {
21664
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 mb-1", children: [
21665
+ group.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground w-3.5 h-3.5", children: group.icon }),
21666
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold text-muted-foreground uppercase tracking-widest", children: group.label })
21667
+ ] });
21668
+ }
21669
+ function mapBadgeVariantToColor(variant) {
21670
+ if (!variant) return void 0;
21671
+ switch (variant) {
21672
+ case "success":
21673
+ return "green";
21674
+ case "warning":
21675
+ return "yellow";
21676
+ case "danger":
21677
+ return "red";
21678
+ case "primary":
21679
+ return "blue";
21680
+ case "secondary":
21681
+ return "purple";
21682
+ case "destructive":
21683
+ return "red";
21684
+ case "muted":
21685
+ return "gray";
21686
+ case "default":
21687
+ return "gray";
21688
+ default:
21689
+ return void 0;
21690
+ }
21691
+ }
21692
+ function CommandItemRow({
21693
+ item,
21694
+ isActive,
21695
+ onSelect,
21696
+ onHover
21697
+ }) {
21698
+ return /* @__PURE__ */ jsxRuntime.jsxs(
21699
+ framerMotion.motion.button,
21700
+ {
21701
+ layout: true,
21702
+ onClick: onSelect,
21703
+ onMouseEnter: onHover,
21704
+ className: `
21705
+ w-full flex items-center gap-1 px-2 py-1 rounded-md text-left cursor-pointer
21706
+ transition-colors duration-75 group relative
21707
+ ${isActive ? "text-accent-foreground hover:bg-accent" : "hover:bg-accent hover:text-accent-foreground"}
21708
+ `,
21709
+ children: [
21710
+ item.icon && /* @__PURE__ */ jsxRuntime.jsx(
21711
+ "span",
21712
+ {
21713
+ className: `relative flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base
21714
+ ${isActive ? "bg-primary/20 text-primary" : "bg-muted text-muted-foreground group-hover:text-foreground"}`,
21715
+ children: item.icon
21716
+ }
21717
+ ),
21718
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 min-w-0 px-1", children: [
21719
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [
21720
+ /* @__PURE__ */ jsxRuntime.jsx(
21721
+ "span",
21722
+ {
21723
+ className: `text-sm font-medium truncate ${isActive ? "text-foreground" : "text-foreground/80"}`,
21724
+ children: item.label
21725
+ }
21726
+ ),
21727
+ item.badge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { color: mapBadgeVariantToColor(item.badgeVariant), children: item.badge.toUpperCase() })
21728
+ ] }),
21729
+ item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate", children: item.description })
21730
+ ] }),
21731
+ item.shortcut && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative hidden sm:flex items-center gap-1 flex-shrink-0", children: item.shortcut.map((k, i) => /* @__PURE__ */ jsxRuntime.jsx(Kbd, { children: k }, i)) }),
21732
+ isActive && /* @__PURE__ */ jsxRuntime.jsx(
21733
+ react.CaretRightIcon,
21734
+ {
21735
+ className: "relative w-4 h-4 text-primary flex-shrink-0",
21736
+ weight: "bold"
21737
+ }
21738
+ )
21739
+ ]
21740
+ }
21741
+ );
21742
+ }
21743
+ var PAGE_SIZE = 8;
21744
+ function useCommandPalette({
21745
+ items = [],
21746
+ groups = [],
21747
+ open,
21748
+ onOpenChange,
21749
+ recentItems = [],
21750
+ onRecentItemsChange,
21751
+ maxRecentItems = 5,
21752
+ multiSearch = false
21753
+ }) {
21754
+ const [query, setQuery] = React32__namespace.useState("");
21755
+ const [activeIndex, setActiveIndex] = React32__namespace.useState(0);
21756
+ const [page, setPage] = React32__namespace.useState(0);
21757
+ const baseGroups = React32__namespace.useMemo(
21758
+ () => normaliseGroups(items, groups),
21759
+ [items, groups]
21760
+ );
21761
+ React32__namespace.useEffect(() => {
21762
+ if (open) {
21763
+ setQuery("");
21764
+ setActiveIndex(0);
21765
+ setPage(0);
21766
+ }
21767
+ }, [open]);
21768
+ const searchTerms = React32__namespace.useMemo(() => {
21769
+ const parts = query.split(",");
21770
+ if (parts.length <= 1 && !multiSearch) return [];
21771
+ return parts.map((t) => t.trim().toLowerCase()).filter(Boolean);
21772
+ }, [query, multiSearch]);
21773
+ const allMatchedGroups = React32__namespace.useMemo(() => {
21774
+ if (!query.trim()) {
21775
+ if (recentItems.length > 0) {
21776
+ return [
21777
+ {
21778
+ id: "__recent__",
21779
+ label: "Recent",
21780
+ icon: React32__namespace.createElement(react.ClockCounterClockwiseIcon),
21781
+ items: recentItems,
21782
+ priority: 999
21783
+ },
21784
+ ...baseGroups
21785
+ ];
21786
+ }
21787
+ return baseGroups;
21788
+ }
21789
+ if (searchTerms.length > 1 || multiSearch && searchTerms.length > 0) {
21790
+ return unionGroups(baseGroups, searchTerms);
21791
+ }
21792
+ return filterAndScore(baseGroups, query);
21793
+ }, [query, baseGroups, recentItems, multiSearch, searchTerms]);
21794
+ const allFlatItems = React32.useMemo(
21795
+ () => allMatchedGroups.flatMap((g) => g.items),
21796
+ [allMatchedGroups]
21797
+ );
21798
+ const totalItems = allFlatItems.length;
21799
+ const totalPages = Math.max(1, Math.ceil(totalItems / PAGE_SIZE));
21800
+ React32.useEffect(() => {
21801
+ setPage(0);
21802
+ setActiveIndex(0);
21803
+ }, [query]);
21804
+ React32.useEffect(() => {
21805
+ setActiveIndex(0);
21806
+ }, [page]);
21807
+ const displayedGroups = React32.useMemo(() => {
21808
+ const start = page * PAGE_SIZE;
21809
+ const end = start + PAGE_SIZE;
21810
+ let count = 0;
21811
+ const result = [];
21812
+ for (const group of allMatchedGroups) {
21813
+ const slicedItems = [];
21814
+ for (const item of group.items) {
21815
+ if (count >= start && count < end) slicedItems.push(item);
21816
+ count++;
21817
+ if (count >= end) break;
21818
+ }
21819
+ if (slicedItems.length > 0) {
21820
+ result.push({ ...group, items: slicedItems });
21821
+ }
21822
+ if (count >= end) break;
21823
+ }
21824
+ return result;
21825
+ }, [allMatchedGroups, page]);
21826
+ const flatItems = React32.useMemo(
21827
+ () => displayedGroups.flatMap((g) => g.items),
21828
+ [displayedGroups]
21829
+ );
21830
+ const pageItemCount = flatItems.length;
21831
+ React32.useEffect(() => {
21832
+ setActiveIndex((i) => Math.min(i, Math.max(pageItemCount - 1, 0)));
21833
+ }, [pageItemCount]);
21834
+ function handleSelect(item) {
21835
+ if (!item) return;
21836
+ item.onSelect();
21837
+ onOpenChange?.(false);
21838
+ if (onRecentItemsChange) {
21839
+ const next = [item, ...recentItems.filter((r) => r.id !== item.id)].slice(
21840
+ 0,
21841
+ maxRecentItems
21842
+ );
21843
+ onRecentItemsChange(next);
21844
+ }
21845
+ }
21846
+ React32.useEffect(() => {
21847
+ if (!open) return;
21848
+ const handler = (e) => {
21849
+ if (e.key === "ArrowDown") {
21850
+ e.preventDefault();
21851
+ if (activeIndex === pageItemCount - 1 && page < totalPages - 1) {
21852
+ setPage((p) => p + 1);
21853
+ } else {
21854
+ setActiveIndex((i) => (i + 1) % Math.max(pageItemCount, 1));
21855
+ }
21856
+ } else if (e.key === "ArrowUp") {
21857
+ e.preventDefault();
21858
+ if (activeIndex === 0 && page > 0) {
21859
+ setPage((p) => p - 1);
21860
+ setActiveIndex(PAGE_SIZE - 1);
21861
+ } else {
21862
+ setActiveIndex(
21863
+ (i) => (i - 1 + Math.max(pageItemCount, 1)) % Math.max(pageItemCount, 1)
21864
+ );
21865
+ }
21866
+ } else if (e.key === "Enter") {
21867
+ e.preventDefault();
21868
+ handleSelect(flatItems[activeIndex]);
21869
+ }
21870
+ };
21871
+ document.addEventListener("keydown", handler);
21872
+ return () => document.removeEventListener("keydown", handler);
21873
+ }, [open, flatItems, activeIndex, pageItemCount, page, totalPages]);
21874
+ return {
21875
+ query,
21876
+ setQuery,
21877
+ activeIndex,
21878
+ setActiveIndex,
21879
+ page,
21880
+ setPage,
21881
+ searchTerms,
21882
+ allMatchedGroups,
21883
+ allFlatItems,
21884
+ displayedGroups,
21885
+ flatItems,
21886
+ totalItems,
21887
+ totalPages,
21888
+ handleSelect,
21889
+ isEmpty: totalItems === 0 && query.trim().length > 0,
21890
+ showList: query.trim() !== "" || recentItems.length > 0
21891
+ };
21892
+ }
21893
+ function useKeyboardShortcut(key, callback, options = {}) {
21894
+ React32.useEffect(() => {
21895
+ const handleKeyDown = (event) => {
21896
+ const { ctrl, meta, shift, alt } = options;
21897
+ const isKeyMatch = event.key.toLowerCase() === key.toLowerCase();
21898
+ const isCtrlMatch = ctrl === void 0 || event.ctrlKey === ctrl;
21899
+ const isMetaMatch = meta === void 0 || event.metaKey === meta;
21900
+ const isShiftMatch = shift === void 0 || event.shiftKey === shift;
21901
+ const isAltMatch = alt === void 0 || event.altKey === alt;
21902
+ if (isKeyMatch && isCtrlMatch && isMetaMatch && isShiftMatch && isAltMatch) {
21903
+ event.preventDefault();
21904
+ callback();
21905
+ }
21906
+ };
21907
+ window.addEventListener("keydown", handleKeyDown);
21908
+ return () => window.removeEventListener("keydown", handleKeyDown);
21909
+ }, [key, callback, options]);
21910
+ }
21911
+ var ITEM_HEIGHT2 = 40;
21912
+ var LABEL_HEIGHT = 28;
21913
+ var LIST_MAX_HEIGHT = 460;
21914
+ var ANIMATION = {
21915
+ overlay: { duration: 0.18 },
21916
+ panel: { duration: 0.2, ease: [0.16, 1, 0.3, 1] },
21917
+ mobilePanel: { duration: 0.18, ease: [0.16, 1, 0.3, 1] },
21918
+ empty: { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 } }
21919
+ };
21920
+ var SearchBadges = React32.memo(({ terms }) => {
21921
+ if (terms.length === 0) return null;
21922
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 px-4 py-1.5 border-b border-border flex-wrap", children: terms.map((term, i) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { children: term }, i)) });
21923
+ });
21924
+ SearchBadges.displayName = "SearchBadges";
21925
+ var EmptyState = React32.memo(({ message }) => /* @__PURE__ */ jsxRuntime.jsxs(
21926
+ framerMotion.motion.div,
21927
+ {
21928
+ ...ANIMATION.empty,
21929
+ className: "flex flex-col items-center justify-center py-14 text-center gap-3",
21930
+ children: [
21931
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-12 h-12 rounded-md bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(react.MagnifyingGlassIcon, { className: "w-6 h-6 text-muted-foreground" }) }),
21932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
21933
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: message }),
21934
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/60 mt-1", children: "Try a different search term" })
21935
+ ] })
21936
+ ]
21937
+ }
21938
+ ));
21939
+ EmptyState.displayName = "EmptyState";
21940
+ var VirtualResultList = React32.memo(
21941
+ ({
21942
+ listRef,
21943
+ isEmpty,
21944
+ emptyMessage,
21945
+ displayedGroups,
21946
+ flatItems,
21947
+ activeIndex,
21948
+ onHover,
21949
+ onSelect
21950
+ }) => {
21951
+ const rows = React32.useMemo(() => {
21952
+ const acc = [];
21953
+ for (const group of displayedGroups) {
21954
+ if (group.label) acc.push({ kind: "label", group });
21955
+ for (const item of group.items) {
21956
+ const globalIdx = flatItems.findIndex((f) => f.id === item.id);
21957
+ acc.push({ kind: "item", item, globalIdx });
21958
+ }
21959
+ }
21960
+ return acc;
21961
+ }, [displayedGroups, flatItems]);
21962
+ const virtualizer = reactVirtual.useVirtualizer({
21963
+ count: rows.length,
21964
+ getScrollElement: () => listRef.current,
21965
+ estimateSize: (i) => rows[i].kind === "label" ? LABEL_HEIGHT : ITEM_HEIGHT2,
21966
+ overscan: 8
21967
+ });
21968
+ const virtualItems = virtualizer.getVirtualItems();
21969
+ const totalSize = virtualizer.getTotalSize();
21970
+ if (isEmpty) {
21971
+ return /* @__PURE__ */ jsxRuntime.jsx(
21972
+ "div",
21973
+ {
21974
+ ref: listRef,
21975
+ className: "overflow-y-auto overscroll-contain px-2 py-1",
21976
+ style: { maxHeight: `min(${LIST_MAX_HEIGHT}px, 60vh)` },
21977
+ children: /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { message: emptyMessage })
21978
+ }
21979
+ );
21980
+ }
21981
+ return /* @__PURE__ */ jsxRuntime.jsx(
21982
+ "div",
21983
+ {
21984
+ ref: listRef,
21985
+ className: "overflow-y-auto overscroll-contain px-2 py-1 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-muted-foreground/30 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/50 transition-colors",
21986
+ style: { maxHeight: `min(${LIST_MAX_HEIGHT}px, 60vh)` },
21987
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: totalSize, position: "relative" }, children: virtualItems.map((vItem) => {
21988
+ const row = rows[vItem.index];
21989
+ return /* @__PURE__ */ jsxRuntime.jsx(
21990
+ "div",
21991
+ {
21992
+ "data-index": vItem.index,
21993
+ ref: virtualizer.measureElement,
21994
+ style: {
21995
+ position: "absolute",
21996
+ top: vItem.start,
21997
+ left: 0,
21998
+ right: 0
21999
+ },
22000
+ children: row.kind === "label" ? /* @__PURE__ */ jsxRuntime.jsx(GroupLabel, { group: row.group }) : /* @__PURE__ */ jsxRuntime.jsx("div", { "data-active": row.globalIdx === activeIndex, children: /* @__PURE__ */ jsxRuntime.jsx(
22001
+ CommandItemRow,
22002
+ {
22003
+ item: row.item,
22004
+ isActive: row.globalIdx === activeIndex,
22005
+ onHover: () => onHover(row.globalIdx),
22006
+ onSelect: () => onSelect(row.item)
22007
+ }
22008
+ ) })
22009
+ },
22010
+ vItem.key
22011
+ );
22012
+ }) })
22013
+ }
22014
+ );
22015
+ }
22016
+ );
22017
+ VirtualResultList.displayName = "VirtualResultList";
22018
+ var FooterBar = React32.memo(({ footer, totalItems }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 border-t border-border bg-muted/30", children: [
22019
+ footer ?? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 text-[11px] text-muted-foreground", children: [
22020
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22021
+ /* @__PURE__ */ jsxRuntime.jsx(react.ArrowElbowDownRightIcon, { className: "w-3 h-3" }),
22022
+ "Selecionar"
22023
+ ] }),
22024
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22025
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono", children: "\u2191\u2193" }),
22026
+ "Navegar"
22027
+ ] }),
22028
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
22029
+ /* @__PURE__ */ jsxRuntime.jsx(react.ArrowBendUpLeftIcon, { className: "w-3 h-3" }),
22030
+ "Fechar"
22031
+ ] })
22032
+ ] }),
22033
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground", children: [
22034
+ /* @__PURE__ */ jsxRuntime.jsx(react.CommandIcon, { className: "w-3 h-3" }),
22035
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
22036
+ totalItems,
22037
+ " resultado",
22038
+ totalItems !== 1 ? "s" : ""
22039
+ ] })
22040
+ ] })
22041
+ ] }));
22042
+ FooterBar.displayName = "FooterBar";
22043
+ function CommandPalette(props) {
22044
+ const {
22045
+ placeholder = "Buscar comandos\u2026",
22046
+ open,
22047
+ onOpenChange,
22048
+ footer,
22049
+ debounceDelay = 300,
22050
+ multiSearch = false,
22051
+ emptyMessage = "Nenhum resultado encontrado.",
22052
+ shortcut = { key: "k", ctrl: true }
22053
+ } = props;
22054
+ const inputRef = React32.useRef(null);
22055
+ const listRef = React32.useRef(null);
22056
+ const isMobile = useIsMobile();
22057
+ const {
22058
+ query,
22059
+ setQuery,
22060
+ activeIndex,
22061
+ setActiveIndex,
22062
+ searchTerms,
22063
+ displayedGroups,
22064
+ flatItems,
22065
+ totalItems,
22066
+ handleSelect,
22067
+ isEmpty,
22068
+ showList
22069
+ } = useCommandPalette({
22070
+ ...props,
22071
+ open: isMobile ? true : props.open
22072
+ });
22073
+ useKeyboardShortcut(shortcut.key, () => onOpenChange(!open), {
22074
+ ctrl: shortcut.ctrl,
22075
+ meta: shortcut.meta,
22076
+ shift: shortcut.shift,
22077
+ alt: shortcut.alt
22078
+ });
22079
+ React32.useEffect(() => {
22080
+ if (!open) return;
22081
+ const handleEscape = (e) => {
22082
+ if (e.key === "Escape") onOpenChange(false);
22083
+ };
22084
+ document.addEventListener("keydown", handleEscape);
22085
+ return () => document.removeEventListener("keydown", handleEscape);
22086
+ }, [open, onOpenChange]);
22087
+ React32.useEffect(() => {
22088
+ if (!open) return;
22089
+ const timer = setTimeout(() => inputRef.current?.focus(), 50);
22090
+ return () => clearTimeout(timer);
22091
+ }, [open]);
22092
+ React32.useEffect(() => {
22093
+ const el = listRef.current?.querySelector(
22094
+ `[data-active="true"]`
22095
+ );
22096
+ el?.scrollIntoView({ block: "nearest" });
22097
+ }, [activeIndex]);
22098
+ const handleQueryChange = React32.useCallback(
22099
+ (val) => {
22100
+ setQuery(val);
22101
+ setActiveIndex(0);
22102
+ },
22103
+ [setQuery, setActiveIndex]
22104
+ );
22105
+ const handleQueryChangeMobile = React32.useCallback(
22106
+ (val) => {
22107
+ setQuery(val);
22108
+ setActiveIndex(0);
22109
+ if (!open && val.trim() !== "") onOpenChange(true);
22110
+ },
22111
+ [setQuery, setActiveIndex, open, onOpenChange]
22112
+ );
22113
+ const handleClose = React32.useCallback(() => onOpenChange(false), [onOpenChange]);
22114
+ const handleClearQuery = React32.useCallback(() => setQuery(""), [setQuery]);
22115
+ const searchPlaceholder = multiSearch ? "Buscar\u2026 (separe termos por v\xEDrgula)" : placeholder;
22116
+ const sharedListProps = {
22117
+ listRef,
22118
+ isEmpty,
22119
+ emptyMessage,
22120
+ displayedGroups,
22121
+ flatItems,
22122
+ activeIndex,
22123
+ onHover: setActiveIndex,
22124
+ onSelect: handleSelect
22125
+ };
22126
+ if (isMobile) {
22127
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22128
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed top-0 left-0 right-0 z-[100] px-3 py-2 bg-background", children: /* @__PURE__ */ jsxRuntime.jsx(
22129
+ DebouncedInput,
22130
+ {
22131
+ ref: inputRef,
22132
+ value: query,
22133
+ debounce: debounceDelay,
22134
+ onChange: handleQueryChangeMobile,
22135
+ placeholder: searchPlaceholder
22136
+ }
22137
+ ) }),
22138
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: showList && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22139
+ /* @__PURE__ */ jsxRuntime.jsx(
22140
+ framerMotion.motion.div,
22141
+ {
22142
+ initial: { opacity: 0 },
22143
+ animate: { opacity: 1 },
22144
+ exit: { opacity: 0 },
22145
+ transition: ANIMATION.overlay,
22146
+ className: "fixed inset-0 z-[98] bg-background/60 backdrop-blur-[2px]",
22147
+ onClick: handleClose
22148
+ }
22149
+ ),
22150
+ /* @__PURE__ */ jsxRuntime.jsxs(
22151
+ framerMotion.motion.div,
22152
+ {
22153
+ initial: { opacity: 0, y: -6 },
22154
+ animate: { opacity: 1, y: 0 },
22155
+ exit: { opacity: 0, y: -6 },
22156
+ transition: ANIMATION.mobilePanel,
22157
+ className: "fixed left-3 right-3 z-[99] bg-popover border border-border rounded-lg shadow-2xl shadow-black/20 dark:shadow-black/50 overflow-hidden top-14",
22158
+ children: [
22159
+ /* @__PURE__ */ jsxRuntime.jsx(SearchBadges, { terms: searchTerms }),
22160
+ /* @__PURE__ */ jsxRuntime.jsx(VirtualResultList, { ...sharedListProps })
22161
+ ]
22162
+ }
22163
+ )
22164
+ ] }) })
22165
+ ] });
22166
+ }
22167
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { children: open && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22168
+ /* @__PURE__ */ jsxRuntime.jsx(
22169
+ framerMotion.motion.div,
22170
+ {
22171
+ initial: { opacity: 0 },
22172
+ animate: { opacity: 1 },
22173
+ exit: { opacity: 0 },
22174
+ transition: ANIMATION.overlay,
22175
+ className: "fixed inset-0 z-[100] bg-background/80 backdrop-blur-sm",
22176
+ onClick: handleClose
22177
+ }
22178
+ ),
22179
+ /* @__PURE__ */ jsxRuntime.jsxs(
22180
+ framerMotion.motion.div,
22181
+ {
22182
+ initial: { opacity: 0, scale: 0.96, y: -8 },
22183
+ animate: { opacity: 1, scale: 1, y: 0 },
22184
+ exit: { opacity: 0, scale: 0.96, y: -8 },
22185
+ transition: ANIMATION.panel,
22186
+ className: "fixed z-[100] top-12 -translate-x-1/2 -translate-y-1/2 w-full max-w-xl rounded-xl border border-border overflow-hidden shadow-2xl shadow-black/20 dark:shadow-black/60 bg-popover/95 backdrop-blur-xl",
22187
+ style: { maxHeight: "min(600px, 80vh)" },
22188
+ children: [
22189
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 px-4 py-2 border-b border-border", children: [
22190
+ /* @__PURE__ */ jsxRuntime.jsx(
22191
+ react.MagnifyingGlassIcon,
22192
+ {
22193
+ className: "w-4 h-4 text-muted-foreground flex-shrink-0",
22194
+ weight: "bold"
22195
+ }
22196
+ ),
22197
+ /* @__PURE__ */ jsxRuntime.jsx(
22198
+ DebouncedInput,
22199
+ {
22200
+ ref: inputRef,
22201
+ value: query,
22202
+ debounce: debounceDelay,
22203
+ onChange: handleQueryChange,
22204
+ placeholder: searchPlaceholder,
22205
+ rightIcon: query ? /* @__PURE__ */ jsxRuntime.jsx(
22206
+ ButtonBase,
22207
+ {
22208
+ variant: "ghost",
22209
+ size: "icon",
22210
+ onClick: handleClearQuery,
22211
+ className: "text-muted-foreground hover:text-red-500 hover:bg-transparent transition-colors",
22212
+ children: /* @__PURE__ */ jsxRuntime.jsx(react.XIcon, { className: "w-4 h-4" })
22213
+ }
22214
+ ) : void 0,
22215
+ className: "flex-1 bg-transparent border-none focus-visible:ring-0 outline-none shadow-none px-0 h-7 text-sm caret-primary"
22216
+ }
22217
+ )
22218
+ ] }),
22219
+ /* @__PURE__ */ jsxRuntime.jsx(SearchBadges, { terms: searchTerms }),
22220
+ showList && /* @__PURE__ */ jsxRuntime.jsx(VirtualResultList, { ...sharedListProps }),
22221
+ /* @__PURE__ */ jsxRuntime.jsx(FooterBar, { footer, totalItems })
22222
+ ]
22223
+ }
22224
+ )
22225
+ ] }) });
22226
+ }
21521
22227
 
21522
22228
  exports.AddButton = AddButton;
21523
22229
  exports.Agenda = Agenda;
@@ -21585,7 +22291,9 @@ exports.CommandEmptyBase = CommandEmptyBase;
21585
22291
  exports.CommandGroupBase = CommandGroupBase;
21586
22292
  exports.CommandInputBase = CommandInputBase;
21587
22293
  exports.CommandItemBase = CommandItemBase;
22294
+ exports.CommandItemRow = CommandItemRow;
21588
22295
  exports.CommandListBase = CommandListBase;
22296
+ exports.CommandPalette = CommandPalette;
21589
22297
  exports.CommandSeparatorBase = CommandSeparatorBase;
21590
22298
  exports.CommandShortcutBase = CommandShortcutBase;
21591
22299
  exports.ContextMenuBase = ContextMenuBase;
@@ -21673,6 +22381,7 @@ exports.FavoriteButton = FavoriteButton;
21673
22381
  exports.FileAccept = FileAccept;
21674
22382
  exports.FileUploader = FileUploader;
21675
22383
  exports.FilterButton = FilterButton;
22384
+ exports.GroupLabel = GroupLabel;
21676
22385
  exports.HideButton = HideButton;
21677
22386
  exports.Highlights = Highlights_default;
21678
22387
  exports.HorizontalChart = HorizontalChart_default;
@@ -21687,6 +22396,8 @@ exports.InputOTPGroupBase = InputOTPGroupBase;
21687
22396
  exports.InputOTPSeparatorBase = InputOTPSeparatorBase;
21688
22397
  exports.InputOTPSlotBase = InputOTPSlotBase;
21689
22398
  exports.IntegrationModal = IntegrationModal_default;
22399
+ exports.Kbd = Kbd;
22400
+ exports.KbdGroup = KbdGroup;
21690
22401
  exports.LabelBase = LabelBase_default;
21691
22402
  exports.Leaderboard = Leaderboard;
21692
22403
  exports.LikeButton = LikeButton;
@@ -21846,11 +22557,14 @@ exports.computeChartWidth = computeChartWidth;
21846
22557
  exports.computeNiceMax = computeNiceMax;
21847
22558
  exports.computeYAxisTickWidth = computeYAxisTickWidth;
21848
22559
  exports.convert12HourTo24Hour = convert12HourTo24Hour;
22560
+ exports.createGroup = createGroup;
22561
+ exports.createItem = createItem;
21849
22562
  exports.createValueFormatter = createValueFormatter;
21850
22563
  exports.createYTickFormatter = createYTickFormatter;
21851
22564
  exports.detectDataFields = detectDataFields;
21852
22565
  exports.detectXAxis = detectXAxis;
21853
22566
  exports.display12HourValue = display12HourValue;
22567
+ exports.filterAndScore = filterAndScore;
21854
22568
  exports.formatDurationAgenda = formatDurationAgenda;
21855
22569
  exports.formatDurationAgendaDays = formatDurationAgendaDays;
21856
22570
  exports.formatFieldName = formatFieldName;
@@ -21891,13 +22605,16 @@ exports.isValid12Hour = isValid12Hour;
21891
22605
  exports.isValidHour = isValidHour;
21892
22606
  exports.isValidMinuteOrSecond = isValidMinuteOrSecond;
21893
22607
  exports.niceCeil = niceCeil;
22608
+ exports.normaliseGroups = normaliseGroups;
21894
22609
  exports.normalizeAttendDate = normalizeAttendDate;
22610
+ exports.normalizeStr = normalizeStr;
21895
22611
  exports.processIntegrationData = processIntegrationData;
21896
22612
  exports.processNeo4jData = processNeo4jData;
21897
22613
  exports.renderInsideBarLabel = renderInsideBarLabel;
21898
22614
  exports.renderPillLabel = pillLabelRenderer_default;
21899
22615
  exports.resolveChartMargins = resolveChartMargins;
21900
22616
  exports.resolveContainerPaddingLeft = resolveContainerPaddingLeft;
22617
+ exports.scoreMatch = scoreMatch;
21901
22618
  exports.set12Hours = set12Hours;
21902
22619
  exports.setDateByType = setDateByType;
21903
22620
  exports.setHours = setHours;
@@ -21907,6 +22624,7 @@ exports.sortEvents = sortEvents;
21907
22624
  exports.sortEventsAgenda = sortEventsAgenda;
21908
22625
  exports.startOfLocalDay = startOfLocalDay;
21909
22626
  exports.toast = toast;
22627
+ exports.unionGroups = unionGroups;
21910
22628
  exports.useBiaxial = useBiaxial;
21911
22629
  exports.useCalendarDnd = useCalendarDnd;
21912
22630
  exports.useCalendarDndAgenda = useCalendarDndAgenda;
@@ -21916,6 +22634,7 @@ exports.useChartHighlights = useChartHighlights;
21916
22634
  exports.useChartLayout = useChartLayout;
21917
22635
  exports.useChartMinMax = useChartMinMax;
21918
22636
  exports.useChartTooltips = useChartTooltips;
22637
+ exports.useCommandPalette = useCommandPalette;
21919
22638
  exports.useCurrentTimeIndicator = useCurrentTimeIndicator;
21920
22639
  exports.useCurrentTimeIndicatorAgenda = useCurrentTimeIndicatorAgenda;
21921
22640
  exports.useDrag = useDrag;
@@ -21925,6 +22644,7 @@ exports.useIsMobile = useIsMobile;
21925
22644
  exports.useIsTruncated = useIsTruncated;
21926
22645
  exports.useOpenTooltipForPeriod = useOpenTooltipForPeriod;
21927
22646
  exports.useProcessedData = useProcessedData;
22647
+ exports.useRecents = useRecents;
21928
22648
  exports.useSeriesOpacity = useSeriesOpacity;
21929
22649
  exports.useTheme = useTheme;
21930
22650
  exports.useTimeSeriesRange = useTimeSeriesRange;