@snksergio/design-system 0.40.0 → 0.41.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.
Files changed (70) hide show
  1. package/dist-lib/chunks/{avatar-DQYiVRlE.mjs → avatar-DFWEwBKu.mjs} +101 -51
  2. package/dist-lib/chunks/avatar-DFWEwBKu.mjs.map +1 -0
  3. package/dist-lib/chunks/{avatar-BiaG9OJS.cjs → avatar-eM5txRFZ.cjs} +53 -1
  4. package/dist-lib/chunks/avatar-eM5txRFZ.cjs.map +1 -0
  5. package/dist-lib/chunks/{input-CaC0B-_v.mjs → input-CfmzMYtd.mjs} +2 -2
  6. package/dist-lib/chunks/{input-CaC0B-_v.mjs.map → input-CfmzMYtd.mjs.map} +1 -1
  7. package/dist-lib/chunks/{input-DMH5rSP1.cjs → input-az2SuVXQ.cjs} +2 -2
  8. package/dist-lib/chunks/{input-DMH5rSP1.cjs.map → input-az2SuVXQ.cjs.map} +1 -1
  9. package/dist-lib/chunks/{kpi-delta-NnEu4oIs.cjs → kpi-delta-DAfakvFp.cjs} +3 -3
  10. package/dist-lib/chunks/{kpi-delta-NnEu4oIs.cjs.map → kpi-delta-DAfakvFp.cjs.map} +1 -1
  11. package/dist-lib/chunks/{kpi-delta-CjR0OsdC.mjs → kpi-delta-DaDwKOaP.mjs} +3 -3
  12. package/dist-lib/chunks/{kpi-delta-CjR0OsdC.mjs.map → kpi-delta-DaDwKOaP.mjs.map} +1 -1
  13. package/dist-lib/chunks/{page-header-DEGbgT4w.mjs → page-header--cPS_Z-a.mjs} +2 -2
  14. package/dist-lib/chunks/{page-header-DEGbgT4w.mjs.map → page-header--cPS_Z-a.mjs.map} +1 -1
  15. package/dist-lib/chunks/{page-header-Cp_9Wog4.cjs → page-header-DvAJoEfb.cjs} +2 -2
  16. package/dist-lib/chunks/{page-header-Cp_9Wog4.cjs.map → page-header-DvAJoEfb.cjs.map} +1 -1
  17. package/dist-lib/chunks/{panel-B1xKDbjB.mjs → panel-Bje0kUTh.mjs} +5 -5
  18. package/dist-lib/chunks/{panel-B1xKDbjB.mjs.map → panel-Bje0kUTh.mjs.map} +1 -1
  19. package/dist-lib/chunks/{panel-ma7e3s4C.cjs → panel-DtU3KlKY.cjs} +5 -5
  20. package/dist-lib/chunks/{panel-ma7e3s4C.cjs.map → panel-DtU3KlKY.cjs.map} +1 -1
  21. package/dist-lib/chunks/{textarea-DivoQmJw.mjs → textarea-BPRIHZVd.mjs} +2 -2
  22. package/dist-lib/chunks/{textarea-DivoQmJw.mjs.map → textarea-BPRIHZVd.mjs.map} +1 -1
  23. package/dist-lib/chunks/{textarea-c80RFmMP.cjs → textarea-K20CL_gF.cjs} +2 -2
  24. package/dist-lib/chunks/{textarea-c80RFmMP.cjs.map → textarea-K20CL_gF.cjs.map} +1 -1
  25. package/dist-lib/chunks/{tooltip-pvZ_X-Ub.cjs → toggle-group-BEPs3e0Y.cjs} +2 -54
  26. package/dist-lib/chunks/toggle-group-BEPs3e0Y.cjs.map +1 -0
  27. package/dist-lib/chunks/{tooltip-mMF4YHZg.mjs → toggle-group-XMO6ReVo.mjs} +77 -127
  28. package/dist-lib/chunks/toggle-group-XMO6ReVo.mjs.map +1 -0
  29. package/dist-lib/chunks/{useTheme-BD0nloAv.cjs → useTheme-3iZAognE.cjs} +876 -73
  30. package/dist-lib/chunks/useTheme-3iZAognE.cjs.map +1 -0
  31. package/dist-lib/chunks/{useTheme-D1QVzZDW.mjs → useTheme-B3ZakPqk.mjs} +886 -83
  32. package/dist-lib/chunks/useTheme-B3ZakPqk.mjs.map +1 -0
  33. package/dist-lib/index.cjs +40 -732
  34. package/dist-lib/index.cjs.map +1 -1
  35. package/dist-lib/index.mjs +94 -786
  36. package/dist-lib/index.mjs.map +1 -1
  37. package/dist-lib/preview/chat.cjs +3 -3
  38. package/dist-lib/preview/chat.mjs +3 -3
  39. package/dist-lib/preview/clientes.cjs +6 -6
  40. package/dist-lib/preview/clientes.mjs +6 -6
  41. package/dist-lib/preview/dashboard.cjs +4 -4
  42. package/dist-lib/preview/dashboard.mjs +4 -4
  43. package/dist-lib/shadcn.cjs +112 -112
  44. package/dist-lib/shadcn.mjs +136 -136
  45. package/dist-lib/src/components/ui/AppShell/app-shell.d.ts +1 -1
  46. package/dist-lib/src/components/ui/AppShell/app-shell.d.ts.map +1 -1
  47. package/dist-lib/src/components/ui/AppShell/app-shell.styles.d.ts +45 -1
  48. package/dist-lib/src/components/ui/AppShell/app-shell.styles.d.ts.map +1 -1
  49. package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts +106 -3
  50. package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts.map +1 -1
  51. package/dist-lib/src/components/ui/MenuSidebar/index.d.ts +2 -2
  52. package/dist-lib/src/components/ui/MenuSidebar/index.d.ts.map +1 -1
  53. package/dist-lib/src/components/ui/SingleMenuSidebar/category.d.ts +1 -1
  54. package/dist-lib/src/components/ui/SingleMenuSidebar/category.d.ts.map +1 -1
  55. package/dist-lib/src/components/ui/SingleMenuSidebar/menu-item.d.ts +25 -1
  56. package/dist-lib/src/components/ui/SingleMenuSidebar/menu-item.d.ts.map +1 -1
  57. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.d.ts +1 -1
  58. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.d.ts.map +1 -1
  59. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.types.d.ts +57 -2
  60. package/dist-lib/src/components/ui/SingleMenuSidebar/single-menu-sidebar.types.d.ts.map +1 -1
  61. package/dist-lib/src/utils/nav-link.d.ts.map +1 -0
  62. package/package.json +207 -207
  63. package/dist-lib/chunks/avatar-BiaG9OJS.cjs.map +0 -1
  64. package/dist-lib/chunks/avatar-DQYiVRlE.mjs.map +0 -1
  65. package/dist-lib/chunks/tooltip-mMF4YHZg.mjs.map +0 -1
  66. package/dist-lib/chunks/tooltip-pvZ_X-Ub.cjs.map +0 -1
  67. package/dist-lib/chunks/useTheme-BD0nloAv.cjs.map +0 -1
  68. package/dist-lib/chunks/useTheme-D1QVzZDW.mjs.map +0 -1
  69. package/dist-lib/src/components/ui/MenuSidebar/nav-link.d.ts.map +0 -1
  70. /package/dist-lib/src/{components/ui/MenuSidebar → utils}/nav-link.d.ts +0 -0
@@ -1,26 +1,26 @@
1
- import { g as getContrastTextColor, a as FormField, e as Avatar, i as isFilterEntryActive, f as FilterPopover, T as ToolbarToolButton, h as ButtonGroup, j as ToolbarSimpleFilterDrawer, k as ACTIONS_COLUMN_WIDTH, l as TableToolbar, m as ToolbarActions, n as ToolbarFilterButton, o as ToolbarSearch, q as ToolbarApplied, r as ToolbarTabs, s as columnTypeRegistry, L as ListItem, t as List } from "./chunks/panel-B1xKDbjB.mjs";
2
- import { u, A, B, v, C, w, x, y, D, z, E, G, H, I, J, K, M, N, d, O, Q, R, S, U, F, b, V, c, W, X, P, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, p, aj, ak, al, am, an } from "./chunks/panel-B1xKDbjB.mjs";
3
- import { C as Chip } from "./chunks/useTheme-D1QVzZDW.mjs";
4
- import { A as A2, a, b as b2, H as H2, c as c2, d as d2, e, f, g, M as M2, S as S2, h, i, j, k, l, m, U as U2, n, o, p as p2, q, r, s, t, v as v2, u as u2 } from "./chunks/useTheme-D1QVzZDW.mjs";
5
- import { t as tv, U as Popover, Y as PopoverTrigger, X as PopoverContent, B as Button, D as Dialog, u as DialogTrigger, c as cn, m as DialogContent, s as DialogTitle, V as PopoverAnchor, l as DialogClose, n as DialogDescription, v as DropdownMenu, N as DropdownMenuTrigger, x as DropdownMenuContent, z as DropdownMenuItem, d as CommandDialog, g as CommandInput, i as CommandList, e as CommandEmpty, f as CommandGroup, h as CommandItem, y as DropdownMenuGroup, E as DropdownMenuLabel, I as DropdownMenuSeparator } from "./chunks/avatar-DQYiVRlE.mjs";
6
- import { O as O2, P as P2, Q as Q2, R as R2, S as S3, T, w as w2, G as G2, H as H3, a2 as a22, a1 as a12 } from "./chunks/avatar-DQYiVRlE.mjs";
1
+ import { g as getContrastTextColor, a as FormField, e as Avatar, i as isFilterEntryActive, f as FilterPopover, T as ToolbarToolButton, h as ButtonGroup, j as ToolbarSimpleFilterDrawer, k as ACTIONS_COLUMN_WIDTH, l as TableToolbar, m as ToolbarActions, n as ToolbarFilterButton, o as ToolbarSearch, q as ToolbarApplied, r as ToolbarTabs, s as columnTypeRegistry, L as ListItem, t as List } from "./chunks/panel-Bje0kUTh.mjs";
2
+ import { u, A, B, v, C, w, x, y, D, z, E, G, H, I, J, K, M, N, d, O, Q, R, S, U, F, b, V, c, W, X, P, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, p, aj, ak, al, am, an } from "./chunks/panel-Bje0kUTh.mjs";
3
+ import { C as Chip } from "./chunks/useTheme-B3ZakPqk.mjs";
4
+ import { A as A2, a, b as b2, H as H2, c as c2, d as d2, e, f, g, M as M2, S as S2, h, i, j, k, l, m, n, U as U2, o, p as p2, q, r, s, t, v as v2, w as w2, u as u2 } from "./chunks/useTheme-B3ZakPqk.mjs";
5
+ import { t as tv, X as Popover, $ as PopoverTrigger, _ as PopoverContent, B as Button, D as Dialog, x as DialogTrigger, c as cn, p as DialogContent, w as DialogTitle, Y as PopoverAnchor, o as DialogClose, q as DialogDescription, a0 as Tooltip, a3 as TooltipTrigger, a1 as TooltipContent, y as DropdownMenu, Q as DropdownMenuTrigger, E as DropdownMenuContent, L as DropdownMenuSeparator, G as DropdownMenuItem } from "./chunks/avatar-DFWEwBKu.mjs";
6
+ import { R as R2, S as S3, T, U as U3, V as V2, W as W2, z as z2, H as H3, J as J2, K as K2, a9 as a92, a8 as a82 } from "./chunks/avatar-DFWEwBKu.mjs";
7
7
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
8
8
  import * as React from "react";
9
- import { forwardRef, useId, useState, Fragment as Fragment$1, isValidElement, useCallback, useMemo, createElement, useRef, useEffect, useLayoutEffect, createContext, useContext } from "react";
10
- import { l as Checkbox, C as Calendar, T as Textarea } from "./chunks/textarea-DivoQmJw.mjs";
11
- import { G as G3, H as H4, F as F2, O as O3 } from "./chunks/textarea-DivoQmJw.mjs";
12
- import { Check, MoreHorizontal, SlidersHorizontal, Calendar as Calendar$1, AlertCircle, CheckCheck, Clock, MoreVertical, Ban, X as X2, CalendarDays, ChevronDown, ChevronLeft, ChevronRight, PanelLeftClose, ChevronsUpDown, Search, User, RefreshCw, OctagonX, TriangleAlert, CircleCheck, Info, Bell } from "lucide-react";
9
+ import { forwardRef, useId, useState, Fragment as Fragment$1, isValidElement, useCallback, useMemo, createElement, useRef, useEffect, useLayoutEffect } from "react";
10
+ import { l as Checkbox, C as Calendar, T as Textarea } from "./chunks/textarea-BPRIHZVd.mjs";
11
+ import { G as G2, H as H4, F as F2, O as O2 } from "./chunks/textarea-BPRIHZVd.mjs";
12
+ import { Check, MoreHorizontal, SlidersHorizontal, Calendar as Calendar$1, AlertCircle, CheckCheck, Clock, MoreVertical, Ban, X as X2, CalendarDays, ChevronDown, ChevronLeft, ChevronRight, RefreshCw, OctagonX, TriangleAlert, CircleCheck, Info, Bell } from "lucide-react";
13
13
  import { Reply } from "lucide-react";
14
- import { aB as Separator, aK as Tooltip, aN as TooltipTrigger, aL as TooltipContent, x as Collapsible, z as CollapsibleTrigger, y as CollapsibleContent, aM as TooltipProvider } from "./chunks/tooltip-mMF4YHZg.mjs";
15
- import { B as B2, aO } from "./chunks/tooltip-mMF4YHZg.mjs";
14
+ import { ay as Separator } from "./chunks/toggle-group-XMO6ReVo.mjs";
15
+ import { B as B2, aH } from "./chunks/toggle-group-XMO6ReVo.mjs";
16
16
  import "@radix-ui/react-aspect-ratio";
17
17
  import "react-day-picker";
18
18
  import "@radix-ui/react-collapsible";
19
- import { I as Input } from "./chunks/input-CaC0B-_v.mjs";
20
- import { i as i2 } from "./chunks/input-CaC0B-_v.mjs";
19
+ import { I as Input } from "./chunks/input-CfmzMYtd.mjs";
20
+ import { i as i2 } from "./chunks/input-CfmzMYtd.mjs";
21
21
  import { toast as toast$1 } from "sonner";
22
- import { a as a10, b as b3, K as K2 } from "./chunks/kpi-delta-CjR0OsdC.mjs";
23
- import { P as P3, p as p3 } from "./chunks/page-header-DEGbgT4w.mjs";
22
+ import { a as a10, b as b3, K as K3 } from "./chunks/kpi-delta-DaDwKOaP.mjs";
23
+ import { P as P2, p as p3 } from "./chunks/page-header--cPS_Z-a.mjs";
24
24
  import * as RechartsPrimitive from "recharts";
25
25
  import { useVirtualizer } from "@tanstack/react-virtual";
26
26
  import "@hello-pangea/dnd";
@@ -4035,7 +4035,7 @@ const messageBubbleStyles = tv({
4035
4035
  tail: true
4036
4036
  }
4037
4037
  });
4038
- const styles$1 = messageBubbleStyles();
4038
+ const styles = messageBubbleStyles();
4039
4039
  function handleMediaKeyDown(event, onMediaClick) {
4040
4040
  if (!onMediaClick) return;
4041
4041
  if (event.key === "Enter" || event.key === " ") {
@@ -4070,12 +4070,12 @@ function MessageMediaRenderer({
4070
4070
  }) {
4071
4071
  switch (mediaType) {
4072
4072
  case "image":
4073
- return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? /* @__PURE__ */ jsx(
4073
+ return /* @__PURE__ */ jsx("div", { className: styles.media(), children: mediaUrl ? /* @__PURE__ */ jsx(
4074
4074
  "img",
4075
4075
  {
4076
4076
  src: mediaUrl,
4077
4077
  alt: body2 || "Imagem",
4078
- className: styles$1.mediaImage(),
4078
+ className: styles.mediaImage(),
4079
4079
  role: onMediaClick ? "button" : void 0,
4080
4080
  tabIndex: onMediaClick ? 0 : void 0,
4081
4081
  onClick: onMediaClick,
@@ -4083,19 +4083,19 @@ function MessageMediaRenderer({
4083
4083
  }
4084
4084
  ) : null });
4085
4085
  case "audio":
4086
- return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? (
4086
+ return /* @__PURE__ */ jsx("div", { className: styles.media(), children: mediaUrl ? (
4087
4087
  // eslint-disable-next-line jsx-a11y/media-has-caption
4088
- /* @__PURE__ */ jsx("audio", { controls: true, src: mediaUrl, className: styles$1.mediaAudio() })
4088
+ /* @__PURE__ */ jsx("audio", { controls: true, src: mediaUrl, className: styles.mediaAudio() })
4089
4089
  ) : null });
4090
4090
  case "video":
4091
- return /* @__PURE__ */ jsx("div", { className: styles$1.media(), children: mediaUrl ? (
4091
+ return /* @__PURE__ */ jsx("div", { className: styles.media(), children: mediaUrl ? (
4092
4092
  // eslint-disable-next-line jsx-a11y/media-has-caption
4093
4093
  /* @__PURE__ */ jsx(
4094
4094
  "video",
4095
4095
  {
4096
4096
  controls: true,
4097
4097
  src: mediaUrl,
4098
- className: styles$1.mediaVideo(),
4098
+ className: styles.mediaVideo(),
4099
4099
  role: onMediaClick ? "button" : void 0,
4100
4100
  tabIndex: onMediaClick ? 0 : void 0,
4101
4101
  onClick: onMediaClick,
@@ -4104,18 +4104,18 @@ function MessageMediaRenderer({
4104
4104
  )
4105
4105
  ) : null });
4106
4106
  case "document":
4107
- return /* @__PURE__ */ jsxs("div", { className: styles$1.mediaDoc(), children: [
4107
+ return /* @__PURE__ */ jsxs("div", { className: styles.mediaDoc(), children: [
4108
4108
  /* @__PURE__ */ jsx(
4109
4109
  Icon,
4110
4110
  {
4111
4111
  name: "line-file",
4112
4112
  size: "lg",
4113
- className: styles$1.mediaDocIcon()
4113
+ className: styles.mediaDocIcon()
4114
4114
  }
4115
4115
  ),
4116
- /* @__PURE__ */ jsxs("div", { className: styles$1.mediaDocInfo(), children: [
4117
- /* @__PURE__ */ jsx("span", { className: styles$1.mediaDocName(), children: body2 || "Documento" }),
4118
- /* @__PURE__ */ jsx("span", { className: styles$1.mediaDocHint(), children: "Toque para baixar" })
4116
+ /* @__PURE__ */ jsxs("div", { className: styles.mediaDocInfo(), children: [
4117
+ /* @__PURE__ */ jsx("span", { className: styles.mediaDocName(), children: body2 || "Documento" }),
4118
+ /* @__PURE__ */ jsx("span", { className: styles.mediaDocHint(), children: "Toque para baixar" })
4119
4119
  ] }),
4120
4120
  mediaUrl ? /* @__PURE__ */ jsx(
4121
4121
  Button,
@@ -4137,7 +4137,7 @@ function MessageMediaRenderer({
4137
4137
  href: mediaUrl,
4138
4138
  target: "_blank",
4139
4139
  rel: "noopener noreferrer",
4140
- className: styles$1.mediaLocation(),
4140
+ className: styles.mediaLocation(),
4141
4141
  onClick: onMediaClick,
4142
4142
  children: [
4143
4143
  /* @__PURE__ */ jsx(
@@ -4145,37 +4145,37 @@ function MessageMediaRenderer({
4145
4145
  {
4146
4146
  name: "line-pin",
4147
4147
  size: "md",
4148
- className: styles$1.mediaLocationIcon()
4148
+ className: styles.mediaLocationIcon()
4149
4149
  }
4150
4150
  ),
4151
4151
  /* @__PURE__ */ jsx("span", { children: body2 || "Ver localização" })
4152
4152
  ]
4153
4153
  }
4154
- ) : /* @__PURE__ */ jsxs("div", { className: styles$1.mediaLocation(), children: [
4154
+ ) : /* @__PURE__ */ jsxs("div", { className: styles.mediaLocation(), children: [
4155
4155
  /* @__PURE__ */ jsx(
4156
4156
  Icon,
4157
4157
  {
4158
4158
  name: "line-pin",
4159
4159
  size: "md",
4160
- className: styles$1.mediaLocationIcon()
4160
+ className: styles.mediaLocationIcon()
4161
4161
  }
4162
4162
  ),
4163
4163
  /* @__PURE__ */ jsx("span", { children: body2 || "Localização" })
4164
4164
  ] });
4165
4165
  case "vcard":
4166
4166
  case "contact":
4167
- return /* @__PURE__ */ jsxs("div", { className: styles$1.mediaContact(), children: [
4167
+ return /* @__PURE__ */ jsxs("div", { className: styles.mediaContact(), children: [
4168
4168
  /* @__PURE__ */ jsx(
4169
4169
  Icon,
4170
4170
  {
4171
4171
  name: "line-user",
4172
4172
  size: "lg",
4173
- className: styles$1.mediaDocIcon()
4173
+ className: styles.mediaDocIcon()
4174
4174
  }
4175
4175
  ),
4176
- /* @__PURE__ */ jsxs("div", { className: styles$1.mediaContactInfo(), children: [
4177
- /* @__PURE__ */ jsx("span", { className: styles$1.mediaContactName(), children: body2 || "Contato" }),
4178
- /* @__PURE__ */ jsx("span", { className: styles$1.mediaContactHint(), children: "Cartão de contato" })
4176
+ /* @__PURE__ */ jsxs("div", { className: styles.mediaContactInfo(), children: [
4177
+ /* @__PURE__ */ jsx("span", { className: styles.mediaContactName(), children: body2 || "Contato" }),
4178
+ /* @__PURE__ */ jsx("span", { className: styles.mediaContactHint(), children: "Cartão de contato" })
4179
4179
  ] })
4180
4180
  ] });
4181
4181
  case "text":
@@ -4971,698 +4971,6 @@ const MonthYearPicker = forwardRef(function MonthYearPicker2({
4971
4971
  ] });
4972
4972
  });
4973
4973
  MonthYearPicker.displayName = "MonthYearPicker";
4974
- const SingleMenuSidebarContext = createContext({
4975
- expanded: true,
4976
- isHoverExpand: false,
4977
- toggle: () => {
4978
- },
4979
- openCategoryId: null,
4980
- setOpenCategoryId: () => {
4981
- }
4982
- });
4983
- function useSingleMenuSidebar() {
4984
- return useContext(SingleMenuSidebarContext);
4985
- }
4986
- function useSingleMenuSidebarState(defaultExpanded, controlledExpanded, onExpandedChange) {
4987
- const [internal, setInternal] = useState(defaultExpanded);
4988
- const isControlled = controlledExpanded !== void 0;
4989
- const expanded = isControlled ? controlledExpanded : internal;
4990
- const [lockedOpen, setLockedOpen] = useState(defaultExpanded);
4991
- const [hoverOpen, setHoverOpen] = useState(false);
4992
- const hoverTimeoutRef = useRef(null);
4993
- const suppressHoverRef = useRef(false);
4994
- const suppressTimerRef = useRef(null);
4995
- const setExpanded = useCallback(
4996
- (v3) => {
4997
- if (!isControlled) setInternal(v3);
4998
- onExpandedChange?.(v3);
4999
- },
5000
- [isControlled, onExpandedChange]
5001
- );
5002
- const toggle = useCallback(() => {
5003
- const next = !lockedOpen;
5004
- setLockedOpen(next);
5005
- setHoverOpen(false);
5006
- if (!next) {
5007
- suppressHoverRef.current = true;
5008
- if (suppressTimerRef.current) clearTimeout(suppressTimerRef.current);
5009
- suppressTimerRef.current = setTimeout(() => {
5010
- suppressHoverRef.current = false;
5011
- }, 500);
5012
- }
5013
- setExpanded(next);
5014
- }, [lockedOpen, setExpanded]);
5015
- const onMouseEnter = useCallback(() => {
5016
- if (lockedOpen) return;
5017
- if (suppressHoverRef.current) return;
5018
- if (hoverTimeoutRef.current) {
5019
- clearTimeout(hoverTimeoutRef.current);
5020
- hoverTimeoutRef.current = null;
5021
- }
5022
- setHoverOpen(true);
5023
- setExpanded(true);
5024
- }, [lockedOpen, setExpanded]);
5025
- const onMouseLeave = useCallback(() => {
5026
- if (lockedOpen) return;
5027
- hoverTimeoutRef.current = setTimeout(() => {
5028
- setHoverOpen(false);
5029
- setExpanded(false);
5030
- }, 200);
5031
- }, [lockedOpen, setExpanded]);
5032
- useEffect(() => {
5033
- return () => {
5034
- if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
5035
- if (suppressTimerRef.current) clearTimeout(suppressTimerRef.current);
5036
- };
5037
- }, []);
5038
- const isHoverExpand = hoverOpen && !lockedOpen;
5039
- const [openCategoryId, setOpenCategoryId] = useState(null);
5040
- return {
5041
- expanded,
5042
- isHoverExpand,
5043
- toggle,
5044
- onMouseEnter,
5045
- onMouseLeave,
5046
- openCategoryId,
5047
- setOpenCategoryId
5048
- };
5049
- }
5050
- const sidebarRoot = tv({
5051
- base: [
5052
- "relative flex h-full flex-col overflow-x-hidden",
5053
- "border-r border-border-sidebar bg-bg-sidebar",
5054
- "transition-[width] duration-300 ease-in-out"
5055
- ],
5056
- variants: {
5057
- // Mobile (< md): expandida = 100% da largura; recolhida = SOME (hidden).
5058
- // Desktop (md+): largura fixa, expandida (280px) ou recolhida (rail 80px).
5059
- expanded: {
5060
- true: "w-full md:w-[280px]",
5061
- false: "hidden md:flex md:w-20"
5062
- }
5063
- },
5064
- defaultVariants: {
5065
- expanded: true
5066
- }
5067
- });
5068
- const category = tv({
5069
- slots: {
5070
- root: "flex items-center rounded-radius-lg cursor-pointer transition-all",
5071
- text: "flex-1 text-left text-body-sm whitespace-nowrap overflow-hidden text-ellipsis",
5072
- // SVG do consumidor (ícone bare do lucide vem 24px) dimensionado no slot → 18px
5073
- icon: "grid size-[18px] shrink-0 place-items-center [&>svg]:size-[18px]",
5074
- chevron: "size-icon-sm shrink-0 transition-transform"
5075
- },
5076
- variants: {
5077
- // selected = folha ativa OU pai que contém o item ativo → card cheio
5078
- // default = nada marcado (inclui pai apenas aberto, sem filho ativo)
5079
- state: {
5080
- selected: {
5081
- root: "bg-bg-sidebar-accent shadow-sh-sm",
5082
- text: "font-bold text-fg-brand",
5083
- icon: "text-fg-brand",
5084
- chevron: "text-fg-brand"
5085
- },
5086
- default: {
5087
- root: "hover:bg-bg-sidebar-accent",
5088
- text: "font-medium text-fg-default",
5089
- icon: "text-fg-muted",
5090
- chevron: "text-fg-subtle"
5091
- }
5092
- },
5093
- collapsed: {
5094
- true: { root: "justify-center px-0 size-form-xl" },
5095
- false: { root: "w-full gap-gp-lg px-pad-2xl py-pad-xl" }
5096
- }
5097
- },
5098
- defaultVariants: {
5099
- state: "default",
5100
- collapsed: false
5101
- }
5102
- });
5103
- const menuItem = tv({
5104
- slots: {
5105
- root: "flex h-[38px] items-center gap-[18px] pl-[18px] pr-pad-2xl cursor-pointer transition-colors hover:bg-bg-sidebar-accent",
5106
- border: "h-full w-0 shrink-0",
5107
- text: "text-body-sm text-left"
5108
- },
5109
- variants: {
5110
- selected: {
5111
- true: {
5112
- border: "border-l-[3px] border-border-brand",
5113
- text: "font-semibold text-fg-default"
5114
- },
5115
- false: {
5116
- border: "border-l border-border-subtle",
5117
- text: "font-medium text-fg-muted"
5118
- }
5119
- }
5120
- },
5121
- defaultVariants: {
5122
- selected: false
5123
- }
5124
- });
5125
- const styles = {
5126
- // Header
5127
- header: {
5128
- wrapper: "flex h-layout-navbar items-center overflow-hidden px-pad-4xl py-pad-md shrink-0",
5129
- wrapperCollapsed: "justify-center px-0",
5130
- inner: "flex items-center gap-gp-md",
5131
- logo: "shrink-0",
5132
- title: "text-title-sm font-bold text-fg-default whitespace-nowrap",
5133
- collapseBtn: "ml-auto shrink-0 cursor-pointer rounded-radius-md p-pad-xs text-fg-subtle hover:bg-bg-sidebar-accent hover:text-fg-muted transition-colors",
5134
- expandBtn: "absolute right-0 top-16 translate-x-1/2 z-10 cursor-pointer rounded-radius-full bg-bg-surface border border-border-default p-pad-xs shadow-sh-sm text-fg-subtle hover:text-fg-muted transition-colors",
5135
- expandBtnIcon: "size-icon-sm"
5136
- },
5137
- // Module selector
5138
- module: {
5139
- trigger: "flex w-full cursor-pointer items-center gap-gp-lg rounded-radius-md bg-bg-sidebar-accent py-pad-md pl-pad-md pr-pad-2xl shadow-sh-sm transition-colors hover:bg-bg-sidebar-accent-hover focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
5140
- iconContainer: "flex size-icon-xl shrink-0 items-center justify-center rounded-radius-md bg-bg-brand text-fg-on-brand",
5141
- textContainer: "flex flex-col items-start gap-gp-xs overflow-hidden",
5142
- title: "text-body-md font-bold leading-4 text-fg-default truncate text-left",
5143
- subtitle: "text-caption-sm font-semibold text-fg-subtle text-left",
5144
- chevron: "ml-auto shrink-0 size-icon-sm text-fg-subtle",
5145
- dropdownItem: "flex items-center gap-gp-lg cursor-pointer",
5146
- // selecionado: realça a linha (bg-brand-subtle) + label/check em fg-brand
5147
- dropdownItemSelected: "bg-bg-brand-subtle text-fg-brand",
5148
- // [&>svg]:!text-fg-on-brand: o DropdownMenuItem força [&_svg]:text-fg-muted
5149
- // (+ fg-default no hover) em TODOS os svgs descendentes — o ! garante que o
5150
- // ícone do chip siga fg-on-brand igual ao trigger (branco light / preto dark).
5151
- dropdownItemIcon: "flex size-icon-lg shrink-0 items-center justify-center rounded-radius-sm bg-bg-brand [&>svg]:size-icon-sm [&>svg]:!text-fg-on-brand",
5152
- dropdownItemLabel: "flex-1 text-body-md font-medium",
5153
- dropdownItemCheck: "ml-auto shrink-0 size-icon-sm !text-fg-brand"
5154
- },
5155
- // Search
5156
- search: {
5157
- wrapper: "flex w-full items-center justify-between rounded-radius-lg bg-bg-muted py-pad-sm pl-pad-lg pr-pad-sm transition-all focus-within:bg-bg-surface focus-within:ring-4 focus-within:ring-ring-brand",
5158
- inner: "flex flex-1 items-center gap-gp-md opacity-60 focus-within:opacity-100",
5159
- icon: "shrink-0 size-icon-sm text-fg-muted",
5160
- text: "text-body-sm font-medium text-fg-default placeholder:text-fg-subtle",
5161
- shortcutBadge: "shrink-0 flex items-center justify-center rounded-radius-md bg-bg-surface px-pad-md py-pad-xs shadow-sh-sm",
5162
- shortcutText: "text-body-sm font-medium text-fg-muted"
5163
- },
5164
- // Footer
5165
- footer: {
5166
- wrapper: "px-pad-lg py-pad-xl",
5167
- button: "flex w-full cursor-pointer items-center gap-gp-lg rounded-radius-lg bg-bg-sidebar-accent px-pad-2xl py-pad-xl transition-colors hover:bg-bg-sidebar-accent-hover focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-brand",
5168
- avatar: "flex size-form-sm shrink-0 items-center justify-center rounded-radius-full bg-bg-muted overflow-hidden",
5169
- avatarIcon: "shrink-0 size-icon-sm text-fg-muted",
5170
- textContainer: "flex flex-col items-start gap-gp-2xs overflow-hidden",
5171
- name: "text-body-sm font-semibold text-fg-default truncate w-full text-left",
5172
- email: "text-caption-sm font-medium text-fg-muted truncate w-full text-left",
5173
- chevron: "ml-auto shrink-0 size-icon-sm text-fg-subtle",
5174
- dropdownLabel: "flex flex-col gap-gp-2xs px-pad-sm py-pad-xs normal-case tracking-normal",
5175
- dropdownLabelName: "text-body-md font-semibold",
5176
- dropdownLabelEmail: "text-caption-md font-normal text-fg-muted",
5177
- dropdownItem: "flex items-center gap-gp-md cursor-pointer",
5178
- dropdownItemIcon: "size-icon-sm shrink-0"
5179
- },
5180
- // Layout
5181
- // Fade do conteúdo textual durante a transição de largura (evita wrap visível)
5182
- textFadeIn: "animate-in fade-in-0 duration-200",
5183
- divider: "mx-pad-3xl h-px bg-border-sidebar",
5184
- sectionPadding: "flex flex-col gap-gp-2xl px-pad-3xl py-pad-4xl shrink-0 overflow-hidden",
5185
- navContainer: "scrollbar-thin flex flex-1 flex-col overflow-y-auto overflow-x-hidden py-pad-4xl",
5186
- navContainerExpanded: "px-pad-3xl",
5187
- navContainerCollapsed: "items-center",
5188
- navList: "flex flex-col",
5189
- subItemList: "flex flex-col py-pad-lg"
5190
- };
5191
- function SingleMenuHeader({
5192
- logo,
5193
- title: title2,
5194
- showToggleIndicator = false
5195
- }) {
5196
- const { expanded, isHoverExpand, toggle } = useSingleMenuSidebar();
5197
- const isFlipped = isHoverExpand || !expanded;
5198
- return /* @__PURE__ */ jsxs(
5199
- "div",
5200
- {
5201
- className: cn(
5202
- styles.header.wrapper,
5203
- !expanded && styles.header.wrapperCollapsed
5204
- ),
5205
- children: [
5206
- /* @__PURE__ */ jsxs("div", { className: styles.header.inner, children: [
5207
- /* @__PURE__ */ jsx("div", { className: styles.header.logo, children: logo }),
5208
- expanded && /* @__PURE__ */ jsx("span", { className: cn(styles.header.title, styles.textFadeIn), children: title2 })
5209
- ] }),
5210
- expanded ? /* @__PURE__ */ jsx(
5211
- "button",
5212
- {
5213
- type: "button",
5214
- onClick: toggle,
5215
- className: styles.header.collapseBtn,
5216
- "aria-label": isFlipped ? "Expandir sidebar" : "Recolher sidebar",
5217
- children: /* @__PURE__ */ jsx(
5218
- PanelLeftClose,
5219
- {
5220
- className: cn(
5221
- "size-icon-sm transition-transform duration-300",
5222
- isFlipped && "rotate-180"
5223
- )
5224
- }
5225
- )
5226
- }
5227
- ) : showToggleIndicator ? /* @__PURE__ */ jsx(
5228
- "button",
5229
- {
5230
- type: "button",
5231
- onClick: toggle,
5232
- className: styles.header.expandBtn,
5233
- "aria-label": "Expandir sidebar",
5234
- children: /* @__PURE__ */ jsx(
5235
- PanelLeftClose,
5236
- {
5237
- className: cn(
5238
- styles.header.expandBtnIcon,
5239
- "transition-transform duration-300 rotate-180"
5240
- )
5241
- }
5242
- )
5243
- }
5244
- ) : null
5245
- ]
5246
- }
5247
- );
5248
- }
5249
- SingleMenuHeader.displayName = "SingleMenuHeader";
5250
- function SingleMenuModuleSelector({
5251
- icon,
5252
- title: title2,
5253
- subtitle,
5254
- options,
5255
- onModuleChange
5256
- }) {
5257
- const s2 = styles.module;
5258
- const triggerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
5259
- /* @__PURE__ */ jsx("div", { className: s2.iconContainer, children: icon }),
5260
- /* @__PURE__ */ jsxs("div", { className: s2.textContainer, children: [
5261
- /* @__PURE__ */ jsx("span", { className: s2.title, children: title2 }),
5262
- /* @__PURE__ */ jsx("span", { className: s2.subtitle, children: subtitle })
5263
- ] }),
5264
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: s2.chevron })
5265
- ] });
5266
- if (!options || options.length === 0) {
5267
- return /* @__PURE__ */ jsx("div", { className: s2.trigger, children: triggerContent });
5268
- }
5269
- return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
5270
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { className: s2.trigger, children: triggerContent }),
5271
- /* @__PURE__ */ jsx(DropdownMenuContent, { side: "bottom", sideOffset: 4, align: "start", children: options.map((option) => {
5272
- const isSelected = option.label === title2;
5273
- return /* @__PURE__ */ jsxs(
5274
- DropdownMenuItem,
5275
- {
5276
- className: cn(
5277
- s2.dropdownItem,
5278
- isSelected && s2.dropdownItemSelected
5279
- ),
5280
- onClick: () => onModuleChange?.(option.id),
5281
- children: [
5282
- /* @__PURE__ */ jsx("div", { className: s2.dropdownItemIcon, children: option.icon }),
5283
- /* @__PURE__ */ jsx("span", { className: s2.dropdownItemLabel, children: option.label }),
5284
- isSelected && /* @__PURE__ */ jsx(Check, { className: s2.dropdownItemCheck })
5285
- ]
5286
- },
5287
- option.id
5288
- );
5289
- }) })
5290
- ] });
5291
- }
5292
- SingleMenuModuleSelector.displayName = "SingleMenuModuleSelector";
5293
- function SingleMenuSearch({
5294
- placeholder = "Buscar",
5295
- onOpen
5296
- }) {
5297
- const s2 = styles.search;
5298
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: onOpen, className: s2.wrapper, children: [
5299
- /* @__PURE__ */ jsxs("div", { className: s2.inner, children: [
5300
- /* @__PURE__ */ jsx(Search, { className: s2.icon }),
5301
- /* @__PURE__ */ jsx("span", { className: s2.text, children: placeholder })
5302
- ] }),
5303
- /* @__PURE__ */ jsx("div", { className: s2.shortcutBadge, children: /* @__PURE__ */ jsx("span", { className: s2.shortcutText, children: "⌘K" }) })
5304
- ] });
5305
- }
5306
- SingleMenuSearch.displayName = "SingleMenuSearch";
5307
- function SingleMenuCommand({
5308
- open,
5309
- onOpenChange,
5310
- categories,
5311
- placeholder = "Buscar no menu…",
5312
- onSelect,
5313
- custom
5314
- }) {
5315
- const leaves = categories.filter((c3) => !c3.items?.length);
5316
- const groups = categories.filter((c3) => c3.items?.length);
5317
- const handle = (id, parentId) => {
5318
- onSelect(id, parentId);
5319
- onOpenChange(false);
5320
- };
5321
- return /* @__PURE__ */ jsxs(CommandDialog, { open, onOpenChange, children: [
5322
- /* @__PURE__ */ jsx(CommandInput, { placeholder }),
5323
- /* @__PURE__ */ jsxs(CommandList, { children: [
5324
- /* @__PURE__ */ jsx(CommandEmpty, { children: "Nenhum resultado." }),
5325
- custom ?? /* @__PURE__ */ jsxs(Fragment, { children: [
5326
- leaves.length > 0 && /* @__PURE__ */ jsx(CommandGroup, { heading: "Menu", children: leaves.map((c3) => /* @__PURE__ */ jsxs(
5327
- CommandItem,
5328
- {
5329
- value: c3.label,
5330
- onSelect: () => handle(c3.id),
5331
- children: [
5332
- c3.icon,
5333
- /* @__PURE__ */ jsx("span", { children: c3.label })
5334
- ]
5335
- },
5336
- c3.id
5337
- )) }),
5338
- groups.map((cat) => /* @__PURE__ */ jsx(CommandGroup, { heading: cat.label, children: cat.items.map((item) => /* @__PURE__ */ jsx(
5339
- CommandItem,
5340
- {
5341
- value: `${cat.label} ${item.label}`,
5342
- onSelect: () => handle(item.id, cat.id),
5343
- children: /* @__PURE__ */ jsx("span", { children: item.label })
5344
- },
5345
- item.id
5346
- )) }, cat.id))
5347
- ] })
5348
- ] })
5349
- ] });
5350
- }
5351
- SingleMenuCommand.displayName = "SingleMenuCommand";
5352
- function SingleMenuItem({
5353
- label,
5354
- selected = false,
5355
- onClick
5356
- }) {
5357
- const s2 = menuItem({ selected });
5358
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick, className: s2.root(), children: [
5359
- /* @__PURE__ */ jsx("div", { className: s2.border() }),
5360
- /* @__PURE__ */ jsx("span", { className: s2.text(), children: label })
5361
- ] });
5362
- }
5363
- SingleMenuItem.displayName = "SingleMenuItem";
5364
- function SingleMenuCategory({
5365
- id,
5366
- icon,
5367
- label,
5368
- active = false,
5369
- items,
5370
- activeItemId,
5371
- onItemClick,
5372
- onCategoryClick
5373
- }) {
5374
- const { expanded, openCategoryId, setOpenCategoryId } = useSingleMenuSidebar();
5375
- const hasItems = !!items && items.length > 0;
5376
- const isOpen = hasItems ? openCategoryId === id : false;
5377
- const isLeafActive = !hasItems && (activeItemId !== void 0 ? activeItemId === id : !!active);
5378
- const containsActive = hasItems && items.some((item) => item.id === activeItemId);
5379
- const selected = !expanded ? hasItems ? isOpen || containsActive : isLeafActive : hasItems ? isOpen : isLeafActive && openCategoryId == null;
5380
- const state = selected ? "selected" : "default";
5381
- const s2 = category({ state, collapsed: !expanded });
5382
- const handleToggle = () => {
5383
- if (hasItems) {
5384
- setOpenCategoryId(isOpen ? null : id);
5385
- onCategoryClick?.();
5386
- } else {
5387
- onItemClick?.(id);
5388
- setOpenCategoryId(null);
5389
- onCategoryClick?.();
5390
- }
5391
- };
5392
- if (!expanded) {
5393
- return /* @__PURE__ */ jsxs(Tooltip, { children: [
5394
- /* @__PURE__ */ jsx(
5395
- TooltipTrigger,
5396
- {
5397
- role: "button",
5398
- tabIndex: 0,
5399
- onClick: handleToggle,
5400
- onKeyDown: (e2) => {
5401
- if (e2.key === "Enter" || e2.key === " ") {
5402
- e2.preventDefault();
5403
- handleToggle();
5404
- }
5405
- },
5406
- className: s2.root(),
5407
- children: /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon })
5408
- }
5409
- ),
5410
- /* @__PURE__ */ jsx(TooltipContent, { side: "right", sideOffset: 8, children: label })
5411
- ] });
5412
- }
5413
- if (!hasItems) {
5414
- return /* @__PURE__ */ jsxs("button", { type: "button", onClick: handleToggle, className: s2.root(), children: [
5415
- /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon }),
5416
- /* @__PURE__ */ jsx("span", { className: cn(s2.text(), styles.textFadeIn), children: label })
5417
- ] });
5418
- }
5419
- return /* @__PURE__ */ jsxs(
5420
- Collapsible,
5421
- {
5422
- open: isOpen,
5423
- onOpenChange: (open) => {
5424
- setOpenCategoryId(open ? id : null);
5425
- onCategoryClick?.();
5426
- },
5427
- children: [
5428
- /* @__PURE__ */ jsxs(CollapsibleTrigger, { className: s2.root(), children: [
5429
- /* @__PURE__ */ jsx("span", { className: s2.icon(), children: icon }),
5430
- /* @__PURE__ */ jsx("span", { className: cn(s2.text(), styles.textFadeIn), children: label }),
5431
- /* @__PURE__ */ jsx(ChevronDown, { className: cn(s2.chevron(), isOpen && "rotate-180") })
5432
- ] }),
5433
- /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", { className: styles.subItemList, children: items.map((item) => /* @__PURE__ */ jsx(
5434
- SingleMenuItem,
5435
- {
5436
- label: item.label,
5437
- selected: item.id === activeItemId,
5438
- onClick: () => onItemClick?.(item.id)
5439
- },
5440
- item.id
5441
- )) }) })
5442
- ]
5443
- }
5444
- );
5445
- }
5446
- SingleMenuCategory.displayName = "SingleMenuCategory";
5447
- function SingleMenuFooter({
5448
- name,
5449
- email,
5450
- avatar,
5451
- actions,
5452
- onAction
5453
- }) {
5454
- const { expanded } = useSingleMenuSidebar();
5455
- const s2 = styles.footer;
5456
- const triggerContent = /* @__PURE__ */ jsxs(Fragment, { children: [
5457
- /* @__PURE__ */ jsx("div", { className: s2.avatar, children: avatar ?? /* @__PURE__ */ jsx(User, { className: s2.avatarIcon }) }),
5458
- expanded && /* @__PURE__ */ jsxs(Fragment, { children: [
5459
- /* @__PURE__ */ jsxs("div", { className: s2.textContainer, children: [
5460
- /* @__PURE__ */ jsx("span", { className: s2.name, children: name }),
5461
- /* @__PURE__ */ jsx("span", { className: s2.email, children: email })
5462
- ] }),
5463
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: s2.chevron })
5464
- ] })
5465
- ] });
5466
- if (!actions || actions.length === 0) {
5467
- return /* @__PURE__ */ jsx("div", { className: s2.wrapper, children: /* @__PURE__ */ jsx("div", { className: cn(s2.button, !expanded && "justify-center px-0"), children: triggerContent }) });
5468
- }
5469
- return /* @__PURE__ */ jsx("div", { className: s2.wrapper, children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
5470
- /* @__PURE__ */ jsx(
5471
- DropdownMenuTrigger,
5472
- {
5473
- className: cn(s2.button, !expanded && "justify-center px-0"),
5474
- children: triggerContent
5475
- }
5476
- ),
5477
- /* @__PURE__ */ jsxs(
5478
- DropdownMenuContent,
5479
- {
5480
- side: expanded ? "top" : "right",
5481
- sideOffset: 8,
5482
- align: expanded ? "end" : "start",
5483
- children: [
5484
- /* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: s2.dropdownLabel, children: [
5485
- /* @__PURE__ */ jsx("span", { className: s2.dropdownLabelName, children: name }),
5486
- /* @__PURE__ */ jsx("span", { className: s2.dropdownLabelEmail, children: email })
5487
- ] }) }),
5488
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
5489
- actions.map((action) => /* @__PURE__ */ jsxs(
5490
- DropdownMenuItem,
5491
- {
5492
- variant: action.variant === "destructive" ? "destructive" : "default",
5493
- onClick: () => onAction?.(action.id),
5494
- className: s2.dropdownItem,
5495
- children: [
5496
- action.icon && /* @__PURE__ */ jsx("span", { className: s2.dropdownItemIcon, children: action.icon }),
5497
- /* @__PURE__ */ jsx("span", { children: action.label })
5498
- ]
5499
- },
5500
- action.id
5501
- ))
5502
- ]
5503
- }
5504
- )
5505
- ] }) });
5506
- }
5507
- SingleMenuFooter.displayName = "SingleMenuFooter";
5508
- function SingleMenuSidebar({
5509
- logo,
5510
- title: title2,
5511
- module,
5512
- modules,
5513
- activeModuleId,
5514
- defaultModuleId,
5515
- onModuleChange,
5516
- showSearch = true,
5517
- searchPlaceholder,
5518
- searchCommand,
5519
- categories,
5520
- activeItemId,
5521
- onItemClick,
5522
- user,
5523
- defaultExpanded = true,
5524
- expanded: controlledExpanded,
5525
- onExpandedChange,
5526
- showToggleIndicator = false,
5527
- className,
5528
- ...props
5529
- }) {
5530
- const {
5531
- expanded,
5532
- isHoverExpand,
5533
- toggle,
5534
- onMouseEnter,
5535
- onMouseLeave,
5536
- openCategoryId,
5537
- setOpenCategoryId
5538
- } = useSingleMenuSidebarState(
5539
- defaultExpanded,
5540
- controlledExpanded,
5541
- onExpandedChange
5542
- );
5543
- const hasModules = !!modules && modules.length > 0;
5544
- const [internalModuleId, setInternalModuleId] = useState(
5545
- defaultModuleId ?? modules?.[0]?.id
5546
- );
5547
- const currentModuleId = activeModuleId ?? internalModuleId;
5548
- const activeModule = hasModules ? modules.find((m2) => m2.id === currentModuleId) ?? modules[0] : void 0;
5549
- const handleModuleChange = (id) => {
5550
- if (activeModuleId === void 0) setInternalModuleId(id);
5551
- onModuleChange?.(id);
5552
- };
5553
- const moduleDisplay = hasModules ? {
5554
- icon: activeModule.icon,
5555
- title: activeModule.title,
5556
- subtitle: activeModule.subtitle ?? "",
5557
- options: modules.map((m2) => ({
5558
- id: m2.id,
5559
- label: m2.title,
5560
- icon: m2.icon
5561
- })),
5562
- onModuleChange: handleModuleChange
5563
- } : module;
5564
- const effectiveCategories = hasModules ? activeModule.categories : categories ?? [];
5565
- const [commandOpen, setCommandOpen] = useState(false);
5566
- useEffect(() => {
5567
- if (!showSearch) return;
5568
- const onKey = (e2) => {
5569
- if (e2.key.toLowerCase() === "k" && (e2.metaKey || e2.ctrlKey)) {
5570
- e2.preventDefault();
5571
- setCommandOpen((o2) => !o2);
5572
- }
5573
- };
5574
- document.addEventListener("keydown", onKey);
5575
- return () => document.removeEventListener("keydown", onKey);
5576
- }, [showSearch]);
5577
- const selectFromSearch = (id, parentId) => {
5578
- onItemClick?.(id);
5579
- setOpenCategoryId(parentId ?? null);
5580
- };
5581
- const resolvedOpenCategoryId = openCategoryId ?? effectiveCategories.find(
5582
- (cat) => cat.items?.some((item) => item.id === activeItemId)
5583
- )?.id ?? null;
5584
- const contextValue = useMemo(
5585
- () => ({
5586
- expanded,
5587
- isHoverExpand,
5588
- toggle,
5589
- openCategoryId: resolvedOpenCategoryId,
5590
- setOpenCategoryId
5591
- }),
5592
- [
5593
- expanded,
5594
- isHoverExpand,
5595
- toggle,
5596
- resolvedOpenCategoryId,
5597
- setOpenCategoryId
5598
- ]
5599
- );
5600
- return /* @__PURE__ */ jsxs(SingleMenuSidebarContext.Provider, { value: contextValue, children: [
5601
- /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsxs(
5602
- "aside",
5603
- {
5604
- "aria-label": "Navegação lateral",
5605
- className: cn(sidebarRoot({ expanded }), className),
5606
- onMouseEnter,
5607
- onMouseLeave,
5608
- ...props,
5609
- children: [
5610
- /* @__PURE__ */ jsx(
5611
- SingleMenuHeader,
5612
- {
5613
- logo,
5614
- title: title2,
5615
- showToggleIndicator
5616
- }
5617
- ),
5618
- /* @__PURE__ */ jsx("div", { className: styles.divider }),
5619
- expanded && (moduleDisplay || showSearch) && /* @__PURE__ */ jsxs("div", { className: cn(styles.sectionPadding, styles.textFadeIn), children: [
5620
- moduleDisplay && /* @__PURE__ */ jsx(SingleMenuModuleSelector, { ...moduleDisplay }),
5621
- showSearch && /* @__PURE__ */ jsx(
5622
- SingleMenuSearch,
5623
- {
5624
- placeholder: searchPlaceholder,
5625
- onOpen: () => setCommandOpen(true)
5626
- }
5627
- )
5628
- ] }),
5629
- expanded && /* @__PURE__ */ jsx("div", { className: styles.divider }),
5630
- /* @__PURE__ */ jsx(
5631
- "nav",
5632
- {
5633
- className: cn(
5634
- styles.navContainer,
5635
- expanded ? styles.navContainerExpanded : styles.navContainerCollapsed
5636
- ),
5637
- children: /* @__PURE__ */ jsx("div", { className: styles.navList, children: effectiveCategories.map((cat) => /* @__PURE__ */ jsx(
5638
- SingleMenuCategory,
5639
- {
5640
- ...cat,
5641
- activeItemId,
5642
- onItemClick
5643
- },
5644
- cat.id
5645
- )) })
5646
- }
5647
- ),
5648
- /* @__PURE__ */ jsx(SingleMenuFooter, { ...user })
5649
- ]
5650
- }
5651
- ) }),
5652
- showSearch && /* @__PURE__ */ jsx(
5653
- SingleMenuCommand,
5654
- {
5655
- open: commandOpen,
5656
- onOpenChange: setCommandOpen,
5657
- categories: effectiveCategories,
5658
- placeholder: searchPlaceholder,
5659
- onSelect: selectFromSearch,
5660
- custom: searchCommand
5661
- }
5662
- )
5663
- ] });
5664
- }
5665
- SingleMenuSidebar.displayName = "SingleMenuSidebar";
5666
4974
  const spinnerStyles = tv({
5667
4975
  base: ["inline-block shrink-0", "animate-spin motion-reduce:animate-none"],
5668
4976
  variants: {
@@ -5914,16 +5222,16 @@ function rotationLambda(deltaLambda) {
5914
5222
  function rotationPhiGamma(deltaPhi, deltaGamma) {
5915
5223
  var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
5916
5224
  function rotation2(lambda, phi) {
5917
- var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k2 = z2 * cosDeltaPhi + x2 * sinDeltaPhi;
5225
+ var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z3 = sin(phi), k2 = z3 * cosDeltaPhi + x2 * sinDeltaPhi;
5918
5226
  return [
5919
- atan2(y2 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z2 * sinDeltaPhi),
5227
+ atan2(y2 * cosDeltaGamma - k2 * sinDeltaGamma, x2 * cosDeltaPhi - z3 * sinDeltaPhi),
5920
5228
  asin(k2 * cosDeltaGamma + y2 * sinDeltaGamma)
5921
5229
  ];
5922
5230
  }
5923
5231
  rotation2.invert = function(lambda, phi) {
5924
- var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z2 = sin(phi), k2 = z2 * cosDeltaGamma - y2 * sinDeltaGamma;
5232
+ var cosPhi = cos(phi), x2 = cos(lambda) * cosPhi, y2 = sin(lambda) * cosPhi, z3 = sin(phi), k2 = z3 * cosDeltaGamma - y2 * sinDeltaGamma;
5925
5233
  return [
5926
- atan2(y2 * cosDeltaGamma + z2 * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi),
5234
+ atan2(y2 * cosDeltaGamma + z3 * sinDeltaGamma, x2 * cosDeltaPhi + k2 * sinDeltaPhi),
5927
5235
  asin(k2 * cosDeltaPhi - x2 * sinDeltaPhi)
5928
5236
  ];
5929
5237
  };
@@ -6338,10 +5646,10 @@ function clipCircle(radius) {
6338
5646
  cartesianAddInPlace(q2, A3);
6339
5647
  q2 = spherical(q2);
6340
5648
  if (!two) return q2;
6341
- var lambda0 = a11[0], lambda1 = b4[0], phi0 = a11[1], phi1 = b4[1], z2;
6342
- if (lambda1 < lambda0) z2 = lambda0, lambda0 = lambda1, lambda1 = z2;
5649
+ var lambda0 = a11[0], lambda1 = b4[0], phi0 = a11[1], phi1 = b4[1], z3;
5650
+ if (lambda1 < lambda0) z3 = lambda0, lambda0 = lambda1, lambda1 = z3;
6343
5651
  var delta2 = lambda1 - lambda0, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
6344
- if (!polar && phi1 < phi0) z2 = phi0, phi0 = phi1, phi1 = z2;
5652
+ if (!polar && phi1 < phi0) z3 = phi0, phi0 = phi1, phi1 = z3;
6345
5653
  if (meridian ? polar ? phi0 + phi1 > 0 ^ q2[1] < (abs(q2[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q2[1] && q2[1] <= phi1 : delta2 > pi ^ (lambda0 <= q2[0] && q2[0] <= lambda1)) {
6346
5654
  var q1 = cartesianScale(u3, (-w3 + t3) / uu);
6347
5655
  cartesianAddInPlace(q1, A3);
@@ -6410,11 +5718,11 @@ function clipRectangle(x02, y02, x12, y12) {
6410
5718
  return x02 <= x2 && x2 <= x12 && y02 <= y2 && y2 <= y12;
6411
5719
  }
6412
5720
  function interpolate(from, to, direction, stream) {
6413
- var a11 = 0, a13 = 0;
6414
- if (from == null || (a11 = corner(from, direction)) !== (a13 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
5721
+ var a11 = 0, a12 = 0;
5722
+ if (from == null || (a11 = corner(from, direction)) !== (a12 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
6415
5723
  do
6416
5724
  stream.point(a11 === 0 || a11 === 3 ? x02 : x12, a11 > 1 ? y12 : y02);
6417
- while ((a11 = (a11 + direction + 4) % 4) !== a13);
5725
+ while ((a11 = (a11 + direction + 4) % 4) !== a12);
6418
5726
  } else {
6419
5727
  stream.point(to[0], to[1]);
6420
5728
  }
@@ -6444,12 +5752,12 @@ function clipRectangle(x02, y02, x12, y12) {
6444
5752
  function polygonInside() {
6445
5753
  var winding = 0;
6446
5754
  for (var i3 = 0, n2 = polygon.length; i3 < n2; ++i3) {
6447
- for (var ring2 = polygon[i3], j2 = 1, m2 = ring2.length, point2 = ring2[0], a02, a13, b0 = point2[0], b1 = point2[1]; j2 < m2; ++j2) {
6448
- a02 = b0, a13 = b1, point2 = ring2[j2], b0 = point2[0], b1 = point2[1];
6449
- if (a13 <= y12) {
6450
- if (b1 > y12 && (b0 - a02) * (y12 - a13) > (b1 - a13) * (x02 - a02)) ++winding;
5755
+ for (var ring2 = polygon[i3], j2 = 1, m2 = ring2.length, point2 = ring2[0], a02, a12, b0 = point2[0], b1 = point2[1]; j2 < m2; ++j2) {
5756
+ a02 = b0, a12 = b1, point2 = ring2[j2], b0 = point2[0], b1 = point2[1];
5757
+ if (a12 <= y12) {
5758
+ if (b1 > y12 && (b0 - a02) * (y12 - a12) > (b1 - a12) * (x02 - a02)) ++winding;
6451
5759
  } else {
6452
- if (b1 <= y12 && (b0 - a02) * (y12 - a13) < (b1 - a13) * (x02 - a02)) --winding;
5760
+ if (b1 <= y12 && (b0 - a02) * (y12 - a12) < (b1 - a12) * (x02 - a02)) --winding;
6453
5761
  }
6454
5762
  }
6455
5763
  }
@@ -6611,10 +5919,10 @@ function centroidPointFirstLine(x2, y2) {
6611
5919
  centroidPoint(x0$1 = x2, y0$1 = y2);
6612
5920
  }
6613
5921
  function centroidPointLine(x2, y2) {
6614
- var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt(dx * dx + dy * dy);
6615
- X1 += z2 * (x0$1 + x2) / 2;
6616
- Y1 += z2 * (y0$1 + y2) / 2;
6617
- Z1 += z2;
5922
+ var dx = x2 - x0$1, dy = y2 - y0$1, z3 = sqrt(dx * dx + dy * dy);
5923
+ X1 += z3 * (x0$1 + x2) / 2;
5924
+ Y1 += z3 * (y0$1 + y2) / 2;
5925
+ Z1 += z3;
6618
5926
  centroidPoint(x0$1 = x2, y0$1 = y2);
6619
5927
  }
6620
5928
  function centroidLineEnd() {
@@ -6631,14 +5939,14 @@ function centroidPointFirstRing(x2, y2) {
6631
5939
  centroidPoint(x00$1 = x0$1 = x2, y00$1 = y0$1 = y2);
6632
5940
  }
6633
5941
  function centroidPointRing(x2, y2) {
6634
- var dx = x2 - x0$1, dy = y2 - y0$1, z2 = sqrt(dx * dx + dy * dy);
6635
- X1 += z2 * (x0$1 + x2) / 2;
6636
- Y1 += z2 * (y0$1 + y2) / 2;
6637
- Z1 += z2;
6638
- z2 = y0$1 * x2 - x0$1 * y2;
6639
- X22 += z2 * (x0$1 + x2);
6640
- Y2 += z2 * (y0$1 + y2);
6641
- Z2 += z2 * 3;
5942
+ var dx = x2 - x0$1, dy = y2 - y0$1, z3 = sqrt(dx * dx + dy * dy);
5943
+ X1 += z3 * (x0$1 + x2) / 2;
5944
+ Y1 += z3 * (y0$1 + y2) / 2;
5945
+ Z1 += z3;
5946
+ z3 = y0$1 * x2 - x0$1 * y2;
5947
+ X22 += z3 * (x0$1 + x2);
5948
+ Y2 += z3 * (y0$1 + y2);
5949
+ Z2 += z3 * 3;
6642
5950
  centroidPoint(x0$1 = x2, y0$1 = y2);
6643
5951
  }
6644
5952
  function PathContext(context) {
@@ -6923,14 +6231,14 @@ function resampleNone(project) {
6923
6231
  });
6924
6232
  }
6925
6233
  function resample$1(project, delta2) {
6926
- function resampleLineTo(x02, y02, lambda0, a02, b0, c0, x12, y12, lambda1, a13, b1, c1, depth, stream) {
6234
+ function resampleLineTo(x02, y02, lambda0, a02, b0, c0, x12, y12, lambda1, a12, b1, c1, depth, stream) {
6927
6235
  var dx = x12 - x02, dy = y12 - y02, d22 = dx * dx + dy * dy;
6928
6236
  if (d22 > 4 * delta2 && depth--) {
6929
- var a11 = a02 + a13, b4 = b0 + b1, c3 = c0 + c1, m2 = sqrt(a11 * a11 + b4 * b4 + c3 * c3), phi2 = asin(c3 /= m2), lambda2 = abs(abs(c3) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b4, a11), p4 = project(lambda2, phi2), x2 = p4[0], y2 = p4[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
6930
- if (dz * dz / d22 > delta2 || abs((dx * dx2 + dy * dy2) / d22 - 0.5) > 0.3 || a02 * a13 + b0 * b1 + c0 * c1 < cosMinDistance) {
6237
+ var a11 = a02 + a12, b4 = b0 + b1, c3 = c0 + c1, m2 = sqrt(a11 * a11 + b4 * b4 + c3 * c3), phi2 = asin(c3 /= m2), lambda2 = abs(abs(c3) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b4, a11), p4 = project(lambda2, phi2), x2 = p4[0], y2 = p4[1], dx2 = x2 - x02, dy2 = y2 - y02, dz = dy * dx2 - dx * dy2;
6238
+ if (dz * dz / d22 > delta2 || abs((dx * dx2 + dy * dy2) / d22 - 0.5) > 0.3 || a02 * a12 + b0 * b1 + c0 * c1 < cosMinDistance) {
6931
6239
  resampleLineTo(x02, y02, lambda0, a02, b0, c0, x2, y2, lambda2, a11 /= m2, b4 /= m2, c3, depth, stream);
6932
6240
  stream.point(x2, y2);
6933
- resampleLineTo(x2, y2, lambda2, a11, b4, c3, x12, y12, lambda1, a13, b1, c1, depth, stream);
6241
+ resampleLineTo(x2, y2, lambda2, a11, b4, c3, x12, y12, lambda1, a12, b1, c1, depth, stream);
6934
6242
  }
6935
6243
  }
6936
6244
  }
@@ -8624,16 +7932,16 @@ export {
8624
7932
  g as HeaderThemeSwitcher,
8625
7933
  Icon,
8626
7934
  Input,
8627
- O2 as InputGroup,
8628
- P2 as InputGroupAddon,
8629
- Q2 as InputGroupButton,
8630
- R2 as InputGroupInput,
8631
- S3 as InputGroupText,
8632
- T as InputGroupTextarea,
7935
+ R2 as InputGroup,
7936
+ S3 as InputGroupAddon,
7937
+ T as InputGroupButton,
7938
+ U3 as InputGroupInput,
7939
+ V2 as InputGroupText,
7940
+ W2 as InputGroupTextarea,
8633
7941
  W as Kanban,
8634
7942
  a10 as Kpi,
8635
7943
  b3 as KpiDelta,
8636
- K2 as KpiGroup,
7944
+ K3 as KpiGroup,
8637
7945
  List,
8638
7946
  ListItem,
8639
7947
  MarkdownText,
@@ -8646,21 +7954,21 @@ export {
8646
7954
  Modal,
8647
7955
  MonthYearPicker,
8648
7956
  X as MoreMenu,
8649
- w2 as MoreMenuCheckboxItem,
7957
+ z2 as MoreMenuCheckboxItem,
8650
7958
  DropdownMenuItem as MoreMenuItem,
8651
- DropdownMenuLabel as MoreMenuLabel,
8652
- G2 as MoreMenuRadioGroup,
8653
- H3 as MoreMenuRadioItem,
7959
+ H3 as MoreMenuLabel,
7960
+ J2 as MoreMenuRadioGroup,
7961
+ K2 as MoreMenuRadioItem,
8654
7962
  DropdownMenuSeparator as MoreMenuSeparator,
8655
- P3 as PageHeader,
7963
+ P2 as PageHeader,
8656
7964
  P as Panel,
8657
7965
  Y as PanelBody,
8658
- G3 as PanelCloseAction,
7966
+ G2 as PanelCloseAction,
8659
7967
  H4 as PanelContent,
8660
7968
  Z as PanelFooter,
8661
7969
  _ as PanelHeader,
8662
7970
  F2 as PanelRoot,
8663
- O3 as PanelTrigger,
7971
+ O2 as PanelTrigger,
8664
7972
  $ as SELECTION_COLUMN_WIDTH,
8665
7973
  S2 as SidebarBrandIcon,
8666
7974
  h as SidebarItem,
@@ -8669,7 +7977,7 @@ export {
8669
7977
  k as SidebarRail,
8670
7978
  l as SidebarSection,
8671
7979
  m as SidebarSubgroup,
8672
- SingleMenuSidebar,
7980
+ n as SingleMenuSidebar,
8673
7981
  a0 as SortPanel,
8674
7982
  a1 as SortPopover,
8675
7983
  Spinner,
@@ -8701,11 +8009,11 @@ export {
8701
8009
  af as ViewsPopover,
8702
8010
  actionColumn,
8703
8011
  ag as avatarVariants,
8704
- aO as badgeVariants,
8705
- a22 as buttonVariants,
8012
+ aH as badgeVariants,
8013
+ a92 as buttonVariants,
8706
8014
  cardCheckbox,
8707
- n as chipCount,
8708
- o as chipVariants,
8015
+ o as chipCount,
8016
+ p2 as chipVariants,
8709
8017
  colorPickerStyles,
8710
8018
  columnTypeRegistry,
8711
8019
  conversationListItemStyles,
@@ -8718,12 +8026,12 @@ export {
8718
8026
  ah as floatingPanelStyles,
8719
8027
  iconStyles,
8720
8028
  icons,
8721
- a12 as inputGroupVariants,
8029
+ a82 as inputGroupVariants,
8722
8030
  i2 as inputVariants,
8723
- p2 as isExternalHref,
8031
+ q as isExternalHref,
8724
8032
  isFilterEntryActive,
8725
- q as isHashHref,
8726
- r as isModifiedClick,
8033
+ r as isHashHref,
8034
+ s as isModifiedClick,
8727
8035
  markdownTextStyles,
8728
8036
  messageAckStyles,
8729
8037
  messageBubbleStyles,
@@ -8735,7 +8043,7 @@ export {
8735
8043
  phoneColumn,
8736
8044
  p as presetView,
8737
8045
  aj as savedViewsMockService,
8738
- s as shouldPreventNavigation,
8046
+ t as shouldPreventNavigation,
8739
8047
  statusColumn,
8740
8048
  textColumn,
8741
8049
  toast,
@@ -8744,10 +8052,10 @@ export {
8744
8052
  useChart,
8745
8053
  ak as useColumnResize,
8746
8054
  al as useColumnWidths,
8747
- t as useControllable,
8055
+ v2 as useControllable,
8748
8056
  am as useDataTableContext,
8749
8057
  an as useFloatingPanelResize,
8750
- v2 as useMediaQuery,
8058
+ w2 as useMediaQuery,
8751
8059
  u2 as useTheme,
8752
8060
  useToolbarFilterControl,
8753
8061
  useToolbarFilters,