@snksergio/design-system 0.1.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 (73) hide show
  1. package/README.md +260 -0
  2. package/dist-lib/chunks/app-shell-BNTvOETJ.mjs +2681 -0
  3. package/dist-lib/chunks/app-shell-BNTvOETJ.mjs.map +1 -0
  4. package/dist-lib/chunks/app-shell-CDy42aNI.mjs +2663 -0
  5. package/dist-lib/chunks/app-shell-CDy42aNI.mjs.map +1 -0
  6. package/dist-lib/chunks/app-shell-mocks-kWIVSzLs.mjs +208 -0
  7. package/dist-lib/chunks/app-shell-mocks-kWIVSzLs.mjs.map +1 -0
  8. package/dist-lib/chunks/app-shell-mocks-oO_IV3Gw.mjs +207 -0
  9. package/dist-lib/chunks/app-shell-mocks-oO_IV3Gw.mjs.map +1 -0
  10. package/dist-lib/chunks/badge-B_2Zt52o.mjs +797 -0
  11. package/dist-lib/chunks/badge-B_2Zt52o.mjs.map +1 -0
  12. package/dist-lib/chunks/badge-DKpXURa1.mjs +813 -0
  13. package/dist-lib/chunks/badge-DKpXURa1.mjs.map +1 -0
  14. package/dist-lib/chunks/chat-v2-mocks-BV9Wha_Z.mjs +192 -0
  15. package/dist-lib/chunks/chat-v2-mocks-BV9Wha_Z.mjs.map +1 -0
  16. package/dist-lib/chunks/chat-v2-mocks-DvZRkhmz.mjs +193 -0
  17. package/dist-lib/chunks/chat-v2-mocks-DvZRkhmz.mjs.map +1 -0
  18. package/dist-lib/chunks/chip-group-CsKBBHW2.mjs +796 -0
  19. package/dist-lib/chunks/chip-group-CsKBBHW2.mjs.map +1 -0
  20. package/dist-lib/chunks/chip-group-D3D0i72q.mjs +780 -0
  21. package/dist-lib/chunks/chip-group-D3D0i72q.mjs.map +1 -0
  22. package/dist-lib/chunks/clientes-showcase-mocks-BMfbNNJh.mjs +185 -0
  23. package/dist-lib/chunks/clientes-showcase-mocks-BMfbNNJh.mjs.map +1 -0
  24. package/dist-lib/chunks/clientes-showcase-mocks-Cq9u3nGZ.mjs +169 -0
  25. package/dist-lib/chunks/clientes-showcase-mocks-Cq9u3nGZ.mjs.map +1 -0
  26. package/dist-lib/chunks/input-374MpdBL.mjs +72 -0
  27. package/dist-lib/chunks/input-374MpdBL.mjs.map +1 -0
  28. package/dist-lib/chunks/input-DF4XAWmr.mjs +56 -0
  29. package/dist-lib/chunks/input-DF4XAWmr.mjs.map +1 -0
  30. package/dist-lib/chunks/page-header-Dw-3wqAG.mjs +75 -0
  31. package/dist-lib/chunks/page-header-Dw-3wqAG.mjs.map +1 -0
  32. package/dist-lib/chunks/page-header-mC1gGtOI.mjs +76 -0
  33. package/dist-lib/chunks/page-header-mC1gGtOI.mjs.map +1 -0
  34. package/dist-lib/chunks/panel-Ds15whqp.mjs +9717 -0
  35. package/dist-lib/chunks/panel-Ds15whqp.mjs.map +1 -0
  36. package/dist-lib/chunks/panel-bzNmFlEZ.mjs +9737 -0
  37. package/dist-lib/chunks/panel-bzNmFlEZ.mjs.map +1 -0
  38. package/dist-lib/chunks/useTheme-BUPLZBMs.mjs +66 -0
  39. package/dist-lib/chunks/useTheme-BUPLZBMs.mjs.map +1 -0
  40. package/dist-lib/chunks/useTheme-Dee4mo-A.mjs +65 -0
  41. package/dist-lib/chunks/useTheme-Dee4mo-A.mjs.map +1 -0
  42. package/dist-lib/index.cjs +1207 -0
  43. package/dist-lib/index.cjs.map +1 -0
  44. package/dist-lib/index.d.ts +2 -0
  45. package/dist-lib/index.mjs +1209 -0
  46. package/dist-lib/index.mjs.map +1 -0
  47. package/dist-lib/preview/chat.cjs +1120 -0
  48. package/dist-lib/preview/chat.cjs.map +1 -0
  49. package/dist-lib/preview/chat.d.ts +6 -0
  50. package/dist-lib/preview/chat.mjs +1120 -0
  51. package/dist-lib/preview/chat.mjs.map +1 -0
  52. package/dist-lib/preview/clientes.cjs +897 -0
  53. package/dist-lib/preview/clientes.cjs.map +1 -0
  54. package/dist-lib/preview/clientes.d.ts +6 -0
  55. package/dist-lib/preview/clientes.mjs +897 -0
  56. package/dist-lib/preview/clientes.mjs.map +1 -0
  57. package/dist-lib/preview/dashboard.cjs +733 -0
  58. package/dist-lib/preview/dashboard.cjs.map +1 -0
  59. package/dist-lib/preview/dashboard.d.ts +4 -0
  60. package/dist-lib/preview/dashboard.mjs +733 -0
  61. package/dist-lib/preview/dashboard.mjs.map +1 -0
  62. package/dist-lib/preview/mocks.cjs +15 -0
  63. package/dist-lib/preview/mocks.cjs.map +1 -0
  64. package/dist-lib/preview/mocks.d.ts +2 -0
  65. package/dist-lib/preview/mocks.mjs +15 -0
  66. package/dist-lib/preview/mocks.mjs.map +1 -0
  67. package/dist-lib/theme.css +668 -0
  68. package/dist-lib/tokens.cjs +915 -0
  69. package/dist-lib/tokens.cjs.map +1 -0
  70. package/dist-lib/tokens.d.ts +2 -0
  71. package/dist-lib/tokens.mjs +915 -0
  72. package/dist-lib/tokens.mjs.map +1 -0
  73. package/package.json +142 -0
@@ -0,0 +1,2681 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const chipGroup = require("./chip-group-CsKBBHW2.mjs");
5
+ const lucideReact = require("lucide-react");
6
+ const cmdk = require("cmdk");
7
+ const SheetPrimitive = require("@radix-ui/react-dialog");
8
+ const classVarianceAuthority = require("class-variance-authority");
9
+ const DropdownMenuPrimitive = require("@radix-ui/react-dropdown-menu");
10
+ const AvatarPrimitive = require("@radix-ui/react-avatar");
11
+ function _interopNamespaceDefault(e) {
12
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
+ if (e) {
14
+ for (const k in e) {
15
+ if (k !== "default") {
16
+ const d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: () => e[k]
20
+ });
21
+ }
22
+ }
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
28
+ const SheetPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SheetPrimitive);
29
+ const DropdownMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenuPrimitive);
30
+ const AvatarPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AvatarPrimitive);
31
+ const headerRoot = chipGroup.tv({
32
+ base: [
33
+ "flex items-center justify-between gap-gp-lg",
34
+ "h-[60px] flex-none px-pad-2xl",
35
+ "bg-bg-canvas border-b border-border-subtle",
36
+ "text-fg-default font-sans"
37
+ ]
38
+ });
39
+ const headerLeft = chipGroup.tv({
40
+ base: "flex items-center gap-gp-md min-w-0 flex-1"
41
+ });
42
+ const headerRight = chipGroup.tv({
43
+ base: "flex items-center gap-gp-sm shrink-0"
44
+ });
45
+ const headerDivider = chipGroup.tv({
46
+ base: "h-[24px] w-px bg-border-default shrink-0 mx-pad-xs"
47
+ });
48
+ const headerIconBtn = chipGroup.tv({
49
+ base: [
50
+ "relative inline-flex items-center justify-center",
51
+ "w-form-md h-form-md rounded-radius-md",
52
+ "cursor-pointer text-fg-default",
53
+ "transition-colors duration-150",
54
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
55
+ ],
56
+ variants: {
57
+ variant: {
58
+ ghost: "bg-transparent border-0 hover:bg-bg-muted"
59
+ }
60
+ },
61
+ defaultVariants: { variant: "ghost" }
62
+ });
63
+ const headerIconBtnBadge = chipGroup.tv({
64
+ base: "absolute top-[4px] right-[4px] w-[8px] h-[8px] rounded-full ring-2 ring-bg-canvas",
65
+ variants: {
66
+ kind: {
67
+ brand: "bg-bg-brand",
68
+ danger: "bg-bg-danger"
69
+ }
70
+ },
71
+ defaultVariants: { kind: "brand" }
72
+ });
73
+ const breadcrumbRoot = chipGroup.tv({
74
+ base: "flex items-center gap-gp-sm min-w-0"
75
+ });
76
+ const breadcrumbItem = chipGroup.tv({
77
+ base: "font-medium truncate transition-colors leading-none",
78
+ variants: {
79
+ current: {
80
+ true: "text-fg-default font-semibold",
81
+ false: "text-fg-muted hover:text-fg-default cursor-pointer"
82
+ },
83
+ /** Quando único item no breadcrumb (= título da página), font-size sobe pra 15px */
84
+ standalone: {
85
+ true: "text-[15px]",
86
+ false: "text-[13px]"
87
+ }
88
+ },
89
+ defaultVariants: { current: false, standalone: false }
90
+ });
91
+ const breadcrumbSeparator = chipGroup.tv({
92
+ base: "text-fg-subtle shrink-0"
93
+ });
94
+ const searchFakeInput = chipGroup.tv({
95
+ base: [
96
+ "inline-flex items-center gap-gp-md h-form-md w-[180px]",
97
+ "px-pad-xl rounded-radius-md",
98
+ "bg-bg-subtle border border-border-subtle cursor-pointer",
99
+ "text-fg-subtle text-[13px]",
100
+ "transition-colors duration-150",
101
+ "hover:bg-bg-muted hover:border-border-default",
102
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
103
+ ]
104
+ });
105
+ const searchFakeInputIcon = chipGroup.tv({
106
+ base: "size-[14px] text-fg-subtle shrink-0"
107
+ });
108
+ const searchFakeInputText = chipGroup.tv({
109
+ base: "flex-1 text-left truncate"
110
+ });
111
+ const searchFakeInputKbd = chipGroup.tv({
112
+ base: [
113
+ "ml-auto inline-flex items-center justify-center",
114
+ "h-[20px] px-pad-xs rounded-radius-xs",
115
+ "bg-bg-canvas border border-border-subtle dark:bg-bg-muted",
116
+ "text-[10px] font-semibold text-fg-muted tabular-nums shrink-0"
117
+ ]
118
+ });
119
+ const hdWrap = chipGroup.tv({
120
+ base: "relative inline-flex"
121
+ });
122
+ const hdDropdown = chipGroup.tv({
123
+ base: [
124
+ "absolute top-[calc(100%+8px)] right-0 z-50",
125
+ "w-[380px] max-w-[calc(100vw-32px)] max-h-[520px] flex flex-col",
126
+ "rounded-[12px] bg-bg-dropdown",
127
+ "border border-border-default shadow-sh-lg outline-float",
128
+ "before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150",
129
+ "overflow-hidden",
130
+ // Animation
131
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
132
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
133
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95"
134
+ ]
135
+ });
136
+ const hdTop = chipGroup.tv({
137
+ base: "flex flex-col gap-gp-md p-pad-xl border-b border-border-subtle bg-bg-canvas/40"
138
+ });
139
+ const hdHeader = chipGroup.tv({
140
+ base: "flex items-center justify-between"
141
+ });
142
+ const hdTitle = chipGroup.tv({
143
+ base: "flex items-center gap-gp-sm text-[15px] font-semibold text-fg-default"
144
+ });
145
+ const hdTitleCount = chipGroup.tv({
146
+ base: [
147
+ "inline-flex items-center justify-center min-w-[20px] h-[20px] px-pad-xs",
148
+ "rounded-radius-xs bg-bg-brand text-fg-on-brand",
149
+ "text-[11px] font-bold tabular-nums"
150
+ ]
151
+ });
152
+ const hdHeaderActions = chipGroup.tv({
153
+ base: "flex items-center gap-gp-xs"
154
+ });
155
+ chipGroup.tv({
156
+ base: [
157
+ "inline-flex items-center gap-gp-sm h-form-sm w-full",
158
+ "px-pad-lg rounded-radius-md",
159
+ "bg-bg-input border border-border-input",
160
+ "transition-colors duration-150",
161
+ "focus-within:border-border-brand focus-within:ring-4 focus-within:ring-ring-brand"
162
+ ]
163
+ });
164
+ chipGroup.tv({
165
+ base: "size-[14px] text-fg-muted shrink-0"
166
+ });
167
+ chipGroup.tv({
168
+ base: "flex-1 min-w-0 bg-transparent border-0 outline-none text-[13px] text-fg-default placeholder:text-fg-subtle"
169
+ });
170
+ chipGroup.tv({
171
+ base: "flex items-center gap-gp-2xs p-[3px] rounded-radius-lg bg-bg-muted"
172
+ });
173
+ chipGroup.tv({
174
+ base: [
175
+ "inline-flex items-center justify-center gap-gp-xs",
176
+ "h-[28px] px-[10px] rounded-radius-sm",
177
+ "text-[12px] font-medium text-fg-muted cursor-pointer",
178
+ "bg-transparent border-0",
179
+ "transition-colors duration-150",
180
+ "hover:text-fg-default",
181
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring-secondary"
182
+ ],
183
+ variants: {
184
+ active: {
185
+ true: "bg-bg-accent text-fg-default font-semibold shadow-sh-sm dark:shadow-sh-none"
186
+ }
187
+ }
188
+ });
189
+ chipGroup.tv({
190
+ base: "text-[10px] font-bold tabular-nums opacity-70"
191
+ });
192
+ const hdBody = chipGroup.tv({
193
+ base: "flex-1 overflow-y-auto p-pad-sm flex flex-col gap-px"
194
+ });
195
+ const hdEmpty = chipGroup.tv({
196
+ base: "flex flex-col items-center justify-center gap-gp-md py-pad-7xl text-fg-subtle"
197
+ });
198
+ const hdEmptyText = chipGroup.tv({
199
+ base: "text-paragraph-sm"
200
+ });
201
+ const hdNotif = chipGroup.tv({
202
+ base: [
203
+ "relative flex items-start gap-gp-lg p-pad-lg rounded-radius-md text-left w-full",
204
+ "bg-transparent border-0 cursor-pointer",
205
+ "transition-colors duration-150",
206
+ "hover:bg-bg-muted",
207
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring-secondary"
208
+ ]
209
+ });
210
+ const hdNotifIcon = chipGroup.tv({
211
+ base: "flex-none w-[28px] h-[28px] rounded-radius-md grid place-items-center"
212
+ });
213
+ const hdNotifBody = chipGroup.tv({
214
+ base: "flex-1 min-w-0 flex flex-col gap-gp-2xs"
215
+ });
216
+ const hdNotifTitle = chipGroup.tv({
217
+ base: "text-[13px] font-semibold text-fg-default leading-tight"
218
+ });
219
+ const hdNotifText = chipGroup.tv({
220
+ base: "text-[12px] text-fg-muted leading-snug line-clamp-2"
221
+ });
222
+ const hdNotifTime = chipGroup.tv({
223
+ base: "text-[11px] text-fg-subtle"
224
+ });
225
+ const hdNotifDot = chipGroup.tv({
226
+ base: "shrink-0 mt-pad-xs w-[8px] h-[8px] rounded-full bg-bg-brand"
227
+ });
228
+ const hdMsg = chipGroup.tv({
229
+ base: [
230
+ "relative flex items-center gap-gp-lg p-pad-lg rounded-radius-md text-left w-full",
231
+ "bg-transparent border-0 cursor-pointer",
232
+ "transition-colors duration-150",
233
+ "hover:bg-bg-muted",
234
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring-secondary"
235
+ ]
236
+ });
237
+ const hdMsgAvatar = chipGroup.tv({
238
+ base: [
239
+ "flex-none grid place-items-center w-icon-lg h-icon-lg rounded-full",
240
+ "text-white text-[11px] font-bold uppercase tracking-[0.02em] leading-none"
241
+ ]
242
+ });
243
+ const hdMsgBody = chipGroup.tv({
244
+ base: "flex-1 min-w-0 flex flex-col gap-gp-2xs"
245
+ });
246
+ const hdMsgRow = chipGroup.tv({
247
+ base: "flex items-center justify-between gap-gp-sm"
248
+ });
249
+ const hdMsgName = chipGroup.tv({
250
+ base: "text-[13px] font-semibold text-fg-default truncate"
251
+ });
252
+ const hdMsgTime = chipGroup.tv({
253
+ base: "text-[11px] text-fg-subtle shrink-0"
254
+ });
255
+ const hdMsgPreviewRow = chipGroup.tv({
256
+ base: "flex items-center gap-gp-sm"
257
+ });
258
+ const hdMsgPreview = chipGroup.tv({
259
+ base: "flex-1 min-w-0 text-[12px] text-fg-muted truncate"
260
+ });
261
+ const hdMsgDot = chipGroup.tv({
262
+ base: "shrink-0 w-[8px] h-[8px] rounded-full bg-bg-brand"
263
+ });
264
+ const hdFooter = chipGroup.tv({
265
+ base: "flex-none p-pad-md border-t border-border-subtle text-center"
266
+ });
267
+ const hdFooterLink = chipGroup.tv({
268
+ base: [
269
+ "inline-flex items-center justify-center gap-gp-sm",
270
+ "h-form-sm px-pad-lg rounded-radius-md w-full",
271
+ "text-[13px] font-medium text-fg-brand no-underline",
272
+ "transition-colors duration-150",
273
+ "hover:bg-bg-brand-subtle",
274
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring-brand"
275
+ ]
276
+ });
277
+ function HeaderBreadcrumb({
278
+ items,
279
+ mobileShowLastOnly,
280
+ className
281
+ }) {
282
+ if (items.length === 0) return null;
283
+ const isStandalone = items.length === 1;
284
+ const lastItem = items[items.length - 1];
285
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
286
+ /* @__PURE__ */ jsxRuntime.jsx(
287
+ "nav",
288
+ {
289
+ className: chipGroup.cn(
290
+ breadcrumbRoot(),
291
+ mobileShowLastOnly && "hidden md:flex",
292
+ className
293
+ ),
294
+ "aria-label": "Breadcrumb",
295
+ children: items.map((item, idx) => {
296
+ const isLast = idx === items.length - 1;
297
+ const isClickable = !isLast && (item.href !== void 0 || item.onClick !== void 0);
298
+ return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
299
+ idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
300
+ lucideReact.ChevronRight,
301
+ {
302
+ size: 14,
303
+ strokeWidth: 1.7,
304
+ className: breadcrumbSeparator(),
305
+ "aria-hidden": "true"
306
+ }
307
+ ),
308
+ isClickable ? /* @__PURE__ */ jsxRuntime.jsx(
309
+ "a",
310
+ {
311
+ href: item.href ?? "#",
312
+ className: breadcrumbItem({
313
+ current: false,
314
+ standalone: isStandalone
315
+ }),
316
+ onClick: (e) => {
317
+ if (!item.href) e.preventDefault();
318
+ item.onClick?.(e);
319
+ },
320
+ children: item.label
321
+ }
322
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
323
+ "span",
324
+ {
325
+ className: breadcrumbItem({
326
+ current: isLast,
327
+ standalone: isStandalone
328
+ }),
329
+ "aria-current": isLast ? "page" : void 0,
330
+ children: item.label
331
+ }
332
+ )
333
+ ] }, `${item.label}-${idx}`);
334
+ })
335
+ }
336
+ ),
337
+ mobileShowLastOnly && /* @__PURE__ */ jsxRuntime.jsx(
338
+ "nav",
339
+ {
340
+ className: chipGroup.cn(breadcrumbRoot(), "md:hidden", className),
341
+ "aria-label": "Seção atual",
342
+ children: /* @__PURE__ */ jsxRuntime.jsx(
343
+ "span",
344
+ {
345
+ className: breadcrumbItem({ current: true, standalone: true }),
346
+ "aria-current": "page",
347
+ children: lastItem.label
348
+ }
349
+ )
350
+ }
351
+ )
352
+ ] });
353
+ }
354
+ const Dialog = SheetPrimitive__namespace.Root;
355
+ const DialogTrigger = SheetPrimitive__namespace.Trigger;
356
+ const DialogPortal = SheetPrimitive__namespace.Portal;
357
+ const DialogClose = SheetPrimitive__namespace.Close;
358
+ const DialogOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
359
+ SheetPrimitive__namespace.Overlay,
360
+ {
361
+ ref,
362
+ className: chipGroup.cn(
363
+ "fixed inset-0 z-50 bg-black/30 supports-[backdrop-filter]:backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
364
+ className
365
+ ),
366
+ ...props
367
+ }
368
+ ));
369
+ DialogOverlay.displayName = SheetPrimitive__namespace.Overlay.displayName;
370
+ const DialogContent = React__namespace.forwardRef(({ className, children, hideClose, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
371
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
372
+ /* @__PURE__ */ jsxRuntime.jsxs(
373
+ SheetPrimitive__namespace.Content,
374
+ {
375
+ ref,
376
+ className: chipGroup.cn(
377
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-gp-4xl rounded-radius-base bg-bg-surface p-pad-4xl text-paragraph-sm text-fg-default shadow-sh-xl outline-float duration-200 sm:max-w-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
378
+ className
379
+ ),
380
+ ...props,
381
+ children: [
382
+ children,
383
+ !hideClose && /* @__PURE__ */ jsxRuntime.jsxs(SheetPrimitive__namespace.Close, { className: "absolute right-4 top-4 rounded-radius-sm opacity-70 transition-opacity hover:opacity-100 outline-none ring-0 ring-ring-brand focus-visible:ring-4 disabled:pointer-events-none data-[state=open]:bg-bg-muted data-[state=open]:text-fg-muted", children: [
384
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" }),
385
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
386
+ ] })
387
+ ]
388
+ }
389
+ )
390
+ ] }));
391
+ DialogContent.displayName = SheetPrimitive__namespace.Content.displayName;
392
+ const DialogTitle = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
393
+ SheetPrimitive__namespace.Title,
394
+ {
395
+ ref,
396
+ className: chipGroup.cn(
397
+ "text-title-md font-medium text-fg-default leading-none",
398
+ className
399
+ ),
400
+ ...props
401
+ }
402
+ ));
403
+ DialogTitle.displayName = SheetPrimitive__namespace.Title.displayName;
404
+ const DialogDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
405
+ SheetPrimitive__namespace.Description,
406
+ {
407
+ ref,
408
+ className: chipGroup.cn("text-paragraph-sm text-fg-muted", className),
409
+ ...props
410
+ }
411
+ ));
412
+ DialogDescription.displayName = SheetPrimitive__namespace.Description.displayName;
413
+ const Command = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
414
+ cmdk.Command,
415
+ {
416
+ ref,
417
+ className: chipGroup.cn(
418
+ "flex h-full w-full flex-col overflow-hidden p-pad-xl bg-popover text-popover-foreground",
419
+ className
420
+ ),
421
+ ...props
422
+ }
423
+ ));
424
+ Command.displayName = cmdk.Command.displayName;
425
+ const CommandDialog = ({ children, ...props }) => {
426
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
427
+ DialogContent,
428
+ {
429
+ hideClose: true,
430
+ className: chipGroup.cn(
431
+ "overflow-hidden p-0 gap-0 sm:max-w-[384px]",
432
+ "rounded-[12px] border border-border-default",
433
+ // Outline padrão de elementos flutuantes
434
+ "outline-float"
435
+ ),
436
+ children: /* @__PURE__ */ jsxRuntime.jsx(Command, { children })
437
+ }
438
+ ) });
439
+ };
440
+ const CommandInput = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
441
+ "div",
442
+ {
443
+ "cmdk-input-wrapper": "",
444
+ className: chipGroup.cn(
445
+ "flex items-center gap-gp-md h-form-md px-pad-xl rounded-radius-lg",
446
+ "bg-bg-input border border-border-subtle shadow-sh-sm",
447
+ "transition-[border-color,box-shadow,background-color] duration-150",
448
+ "focus-within:border-border-brand focus-within:shadow-sh-ring",
449
+ "dark:bg-bg-muted dark:border-border-input dark:shadow-sh-none"
450
+ ),
451
+ children: [
452
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-[14px] text-fg-muted shrink-0", strokeWidth: 1.8 }),
453
+ /* @__PURE__ */ jsxRuntime.jsx(
454
+ cmdk.Command.Input,
455
+ {
456
+ ref,
457
+ className: chipGroup.cn(
458
+ "flex-1 min-w-0 bg-transparent border-0 outline-none",
459
+ "text-[13px] text-fg-default placeholder:text-fg-muted",
460
+ "disabled:cursor-not-allowed disabled:opacity-50",
461
+ className
462
+ ),
463
+ ...props
464
+ }
465
+ )
466
+ ]
467
+ }
468
+ ));
469
+ CommandInput.displayName = cmdk.Command.Input.displayName;
470
+ const CommandList = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
471
+ cmdk.Command.List,
472
+ {
473
+ ref,
474
+ className: chipGroup.cn(
475
+ "max-h-[300px] overflow-y-auto overflow-x-hidden mt-pad-md scrollbar-thin",
476
+ className
477
+ ),
478
+ ...props
479
+ }
480
+ ));
481
+ CommandList.displayName = cmdk.Command.List.displayName;
482
+ const CommandEmpty = React__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
483
+ cmdk.Command.Empty,
484
+ {
485
+ ref,
486
+ className: "py-pad-5xl text-center text-paragraph-sm text-fg-muted",
487
+ ...props
488
+ }
489
+ ));
490
+ CommandEmpty.displayName = cmdk.Command.Empty.displayName;
491
+ const CommandGroup = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
492
+ cmdk.Command.Group,
493
+ {
494
+ ref,
495
+ className: chipGroup.cn(
496
+ "overflow-hidden text-fg-default",
497
+ "[&_[cmdk-group-heading]]:flex [&_[cmdk-group-heading]]:items-center",
498
+ "[&_[cmdk-group-heading]]:h-[28px] [&_[cmdk-group-heading]]:px-pad-xl",
499
+ "[&_[cmdk-group-heading]]:text-[10px] [&_[cmdk-group-heading]]:font-bold",
500
+ "[&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wider",
501
+ "[&_[cmdk-group-heading]]:text-fg-subtle",
502
+ className
503
+ ),
504
+ ...props
505
+ }
506
+ ));
507
+ CommandGroup.displayName = cmdk.Command.Group.displayName;
508
+ const CommandSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
509
+ cmdk.Command.Separator,
510
+ {
511
+ ref,
512
+ className: chipGroup.cn("mx-pad-xs my-pad-xs h-px bg-border-default", className),
513
+ ...props
514
+ }
515
+ ));
516
+ CommandSeparator.displayName = cmdk.Command.Separator.displayName;
517
+ const CommandItem = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
518
+ cmdk.Command.Item,
519
+ {
520
+ ref,
521
+ className: chipGroup.cn(
522
+ "relative flex cursor-default select-none items-center gap-gp-md",
523
+ "rounded-radius-lg px-pad-xl py-pad-md",
524
+ "text-[13px] font-medium text-fg-muted",
525
+ "outline-none transition-colors",
526
+ "data-[selected='true']:bg-bg-muted data-[selected='true']:text-fg-default data-[selected='true']:[&_svg]:text-fg-default",
527
+ "data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
528
+ "[&_svg]:pointer-events-none [&_svg]:size-[18px] [&_svg]:shrink-0 [&_svg]:text-fg-muted",
529
+ className
530
+ ),
531
+ ...props
532
+ }
533
+ ));
534
+ CommandItem.displayName = cmdk.Command.Item.displayName;
535
+ const CommandShortcut = ({
536
+ className,
537
+ ...props
538
+ }) => {
539
+ return /* @__PURE__ */ jsxRuntime.jsx(
540
+ "span",
541
+ {
542
+ className: chipGroup.cn(
543
+ "ml-auto text-[11px] tracking-wider text-fg-subtle",
544
+ className
545
+ ),
546
+ ...props
547
+ }
548
+ );
549
+ };
550
+ CommandShortcut.displayName = "CommandShortcut";
551
+ function HeaderSearch({
552
+ placeholder = "Buscar...",
553
+ shortcut = "⌘K",
554
+ commandGroups = [],
555
+ commandPlaceholder = "Digite um comando ou busque...",
556
+ commandEmptyMessage = "Nenhum resultado encontrado.",
557
+ hotkey = { key: "k", meta: true, ctrl: true },
558
+ className
559
+ }) {
560
+ const [open, setOpen] = React.useState(false);
561
+ React.useEffect(() => {
562
+ const handler = (e) => {
563
+ if (e.key.toLowerCase() !== hotkey.key.toLowerCase()) return;
564
+ const meta = hotkey.meta && e.metaKey;
565
+ const ctrl = hotkey.ctrl && e.ctrlKey;
566
+ if (meta || ctrl) {
567
+ e.preventDefault();
568
+ setOpen((o) => !o);
569
+ }
570
+ };
571
+ window.addEventListener("keydown", handler);
572
+ return () => window.removeEventListener("keydown", handler);
573
+ }, [hotkey.key, hotkey.meta, hotkey.ctrl]);
574
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
575
+ /* @__PURE__ */ jsxRuntime.jsxs(
576
+ "button",
577
+ {
578
+ type: "button",
579
+ className: chipGroup.cn(searchFakeInput(), "hidden md:inline-flex", className),
580
+ onClick: () => setOpen(true),
581
+ "aria-label": "Abrir busca",
582
+ children: [
583
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: searchFakeInputIcon(), strokeWidth: 1.8 }),
584
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: searchFakeInputText(), children: placeholder }),
585
+ /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: searchFakeInputKbd(), children: shortcut })
586
+ ]
587
+ }
588
+ ),
589
+ /* @__PURE__ */ jsxRuntime.jsx(
590
+ chipGroup.Button,
591
+ {
592
+ color: "secondary",
593
+ variant: "outline",
594
+ size: "icon-sm",
595
+ className: "md:hidden rounded-radius-md",
596
+ onClick: () => setOpen(true),
597
+ "aria-label": "Abrir busca",
598
+ title: `Buscar (${shortcut})`,
599
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, {})
600
+ }
601
+ ),
602
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandDialog, { open, onOpenChange: setOpen, children: [
603
+ /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { placeholder: commandPlaceholder }),
604
+ /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { children: [
605
+ /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { children: commandEmptyMessage }),
606
+ commandGroups.map((group, gIdx) => /* @__PURE__ */ jsxRuntime.jsx(
607
+ CommandGroupBlock,
608
+ {
609
+ group,
610
+ isLast: gIdx === commandGroups.length - 1,
611
+ onSelect: () => setOpen(false)
612
+ },
613
+ group.heading
614
+ ))
615
+ ] })
616
+ ] })
617
+ ] });
618
+ }
619
+ function CommandGroupBlock({
620
+ group,
621
+ isLast,
622
+ onSelect
623
+ }) {
624
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
625
+ /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { heading: group.heading, children: group.items.map((item) => {
626
+ const Icon = item.icon;
627
+ return /* @__PURE__ */ jsxRuntime.jsxs(
628
+ CommandItem,
629
+ {
630
+ value: item.id ?? item.label,
631
+ keywords: item.keywords,
632
+ onSelect: () => {
633
+ item.onSelect();
634
+ onSelect();
635
+ },
636
+ className: item.destructive ? "text-fg-danger [&_svg]:text-fg-danger" : void 0,
637
+ children: [
638
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
639
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label }),
640
+ item.shortcut && /* @__PURE__ */ jsxRuntime.jsx(CommandShortcut, { children: item.shortcut })
641
+ ]
642
+ },
643
+ item.id ?? item.label
644
+ );
645
+ }) }),
646
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx(CommandSeparator, {})
647
+ ] });
648
+ }
649
+ const DEFAULT_FILTERS$1 = [
650
+ { id: "all", label: "Todas", predicate: () => true },
651
+ { id: "unread", label: "Não lidas", predicate: (n) => !!n.unread },
652
+ { id: "mentions", label: "Menções", predicate: (n) => n.kind === "mention" }
653
+ ];
654
+ function HeaderNotifications({ config, className }) {
655
+ const {
656
+ items,
657
+ filters = DEFAULT_FILTERS$1,
658
+ emptyMessage = "Nenhuma notificação por aqui.",
659
+ onMarkAllRead,
660
+ onMoreActions,
661
+ onViewAll,
662
+ viewAllLabel = "Ver todas as notificações"
663
+ } = config;
664
+ const [open, setOpen] = React.useState(false);
665
+ const [activeFilter, setActiveFilter] = React.useState(filters[0]?.id ?? "all");
666
+ const wrapRef = React.useRef(null);
667
+ const unreadCount = items.filter((n) => n.unread).length;
668
+ React.useEffect(() => {
669
+ if (!open) return;
670
+ const onClick = (e) => {
671
+ if (!wrapRef.current?.contains(e.target)) setOpen(false);
672
+ };
673
+ const onEsc = (e) => {
674
+ if (e.key === "Escape") setOpen(false);
675
+ };
676
+ document.addEventListener("mousedown", onClick);
677
+ document.addEventListener("keydown", onEsc);
678
+ return () => {
679
+ document.removeEventListener("mousedown", onClick);
680
+ document.removeEventListener("keydown", onEsc);
681
+ };
682
+ }, [open]);
683
+ const filtered = items.filter(
684
+ filters.find((f) => f.id === activeFilter)?.predicate ?? (() => true)
685
+ );
686
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapRef, className: chipGroup.cn(hdWrap(), className), children: [
687
+ /* @__PURE__ */ jsxRuntime.jsxs(
688
+ chipGroup.Button,
689
+ {
690
+ color: "secondary",
691
+ variant: "outline",
692
+ size: "icon-sm",
693
+ className: "rounded-radius-md relative",
694
+ "aria-label": "Notificações",
695
+ title: "Notificações",
696
+ "aria-expanded": open,
697
+ onClick: () => setOpen((o) => !o),
698
+ children: [
699
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, {}),
700
+ unreadCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: headerIconBtnBadge({ kind: "danger" }), "aria-hidden": "true" })
701
+ ]
702
+ }
703
+ ),
704
+ open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdDropdown(), role: "dialog", "aria-label": "Notificações", children: [
705
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdTop(), children: [
706
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdHeader(), children: [
707
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdTitle(), children: [
708
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Notificações" }),
709
+ unreadCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdTitleCount(), children: unreadCount })
710
+ ] }),
711
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdHeaderActions(), children: [
712
+ onMarkAllRead && /* @__PURE__ */ jsxRuntime.jsx(
713
+ chipGroup.Button,
714
+ {
715
+ color: "secondary",
716
+ variant: "ghost",
717
+ size: "icon-2xs",
718
+ className: "rounded-radius-sm",
719
+ title: "Marcar todas como lidas",
720
+ onClick: onMarkAllRead,
721
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, {})
722
+ }
723
+ ),
724
+ onMoreActions && /* @__PURE__ */ jsxRuntime.jsx(
725
+ chipGroup.Button,
726
+ {
727
+ color: "secondary",
728
+ variant: "ghost",
729
+ size: "icon-2xs",
730
+ className: "rounded-radius-sm",
731
+ title: "Mais ações",
732
+ onClick: onMoreActions,
733
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, {})
734
+ }
735
+ )
736
+ ] })
737
+ ] }),
738
+ filters.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
739
+ chipGroup.ChipGroup,
740
+ {
741
+ type: "single",
742
+ value: activeFilter,
743
+ onValueChange: (v) => v && setActiveFilter(v),
744
+ size: "lg",
745
+ ariaLabel: "Filtrar notificações",
746
+ children: filters.map((f) => {
747
+ const count = items.filter(f.predicate ?? (() => true)).length;
748
+ return /* @__PURE__ */ jsxRuntime.jsxs(chipGroup.ChipGroupItem, { value: f.id, children: [
749
+ f.label,
750
+ count > 0 && ` (${count})`
751
+ ] }, f.id);
752
+ })
753
+ }
754
+ )
755
+ ] }),
756
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: hdBody(), children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdEmpty(), children: [
757
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bell, { size: 28, strokeWidth: 1.4 }),
758
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: hdEmptyText(), children: emptyMessage })
759
+ ] }) : filtered.map((n) => /* @__PURE__ */ jsxRuntime.jsx(NotificationRow, { item: n }, n.id)) }),
760
+ onViewAll && /* @__PURE__ */ jsxRuntime.jsx("div", { className: hdFooter(), children: /* @__PURE__ */ jsxRuntime.jsx(
761
+ "a",
762
+ {
763
+ href: "#",
764
+ className: hdFooterLink(),
765
+ onClick: (e) => {
766
+ e.preventDefault();
767
+ onViewAll();
768
+ setOpen(false);
769
+ },
770
+ children: viewAllLabel
771
+ }
772
+ ) })
773
+ ] })
774
+ ] });
775
+ }
776
+ function NotificationRow({ item }) {
777
+ const Icon = item.icon;
778
+ return /* @__PURE__ */ jsxRuntime.jsxs(
779
+ "button",
780
+ {
781
+ type: "button",
782
+ className: hdNotif(),
783
+ onClick: item.onClick,
784
+ children: [
785
+ /* @__PURE__ */ jsxRuntime.jsx(
786
+ "span",
787
+ {
788
+ className: hdNotifIcon(),
789
+ style: { color: item.color, background: `${item.color}1f` },
790
+ "aria-hidden": "true",
791
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 15, strokeWidth: 1.8 })
792
+ }
793
+ ),
794
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: hdNotifBody(), children: [
795
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdNotifTitle(), children: item.title }),
796
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdNotifText(), children: item.body }),
797
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdNotifTime(), children: item.time })
798
+ ] }),
799
+ item.unread && /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdNotifDot(), "aria-label": "não lida" })
800
+ ]
801
+ }
802
+ );
803
+ }
804
+ const inputGroupVariants = classVarianceAuthority.cva(
805
+ [
806
+ "group/input-group relative flex w-full items-center",
807
+ "bg-bg-input dark:bg-bg-muted",
808
+ "hover:bg-bg-input-hover dark:hover:bg-bg-muted-hover",
809
+ "border border-border-input rounded-radius-lg",
810
+ "transition-[border-color,box-shadow,background-color] outline-none",
811
+ "has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50 has-[input:disabled]:hover:bg-bg-input dark:has-[input:disabled]:hover:bg-bg-muted"
812
+ ],
813
+ {
814
+ variants: {
815
+ size: {
816
+ xxs: "min-h-form-xs px-pad-md gap-gp-xs rounded-radius-md text-[13px]",
817
+ xs: "min-h-form-sm px-pad-xl gap-gp-md rounded-radius-md text-[13px]",
818
+ sm: "min-h-form-md px-pad-xl gap-gp-md rounded-radius-lg text-[13px]",
819
+ md: "min-h-form-lg px-pad-xl gap-gp-md rounded-radius-lg text-[13px]"
820
+ },
821
+ state: {
822
+ default: "focus-within:border-border-brand focus-within:shadow-sh-ring",
823
+ error: "border-border-danger-muted focus-within:border-border-danger-muted focus-within:shadow-sh-ring-danger",
824
+ warning: "border-border-warning-muted focus-within:border-border-warning-muted focus-within:shadow-sh-ring-warning",
825
+ success: "border-border-success-muted focus-within:border-border-success-muted focus-within:shadow-sh-ring-success"
826
+ }
827
+ },
828
+ defaultVariants: { size: "md", state: "default" }
829
+ }
830
+ );
831
+ const InputGroup = React__namespace.forwardRef(
832
+ ({ className, size, state, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
833
+ "div",
834
+ {
835
+ ref,
836
+ role: "group",
837
+ "data-slot": "input-group",
838
+ className: chipGroup.cn(inputGroupVariants({ size, state }), className),
839
+ ...props
840
+ }
841
+ )
842
+ );
843
+ InputGroup.displayName = "InputGroup";
844
+ const inputGroupInputVariants = classVarianceAuthority.cva([
845
+ "flex-1 min-w-0 bg-transparent border-0 outline-none",
846
+ "text-[13px] text-fg-default placeholder:text-fg-muted placeholder:opacity-70",
847
+ "disabled:cursor-not-allowed",
848
+ "file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-fg-default"
849
+ ]);
850
+ const InputGroupInput = React__namespace.forwardRef(({ className, type, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
851
+ "input",
852
+ {
853
+ ref,
854
+ type,
855
+ "data-slot": "input-group-input",
856
+ className: chipGroup.cn(inputGroupInputVariants(), className),
857
+ ...props
858
+ }
859
+ ));
860
+ InputGroupInput.displayName = "InputGroupInput";
861
+ const inputGroupTextareaVariants = classVarianceAuthority.cva([
862
+ "flex-1 min-w-0 bg-transparent border-0 outline-none resize-y",
863
+ "py-pad-md",
864
+ "text-[13px] leading-[1.5] text-fg-default placeholder:text-fg-muted placeholder:opacity-70",
865
+ "disabled:cursor-not-allowed"
866
+ ]);
867
+ const InputGroupTextarea = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
868
+ "textarea",
869
+ {
870
+ ref,
871
+ "data-slot": "input-group-textarea",
872
+ className: chipGroup.cn(inputGroupTextareaVariants(), className),
873
+ ...props
874
+ }
875
+ ));
876
+ InputGroupTextarea.displayName = "InputGroupTextarea";
877
+ const inputGroupAddonVariants = classVarianceAuthority.cva(
878
+ "flex items-center text-fg-muted shrink-0 select-none [&_svg]:size-4 [&_svg]:shrink-0",
879
+ {
880
+ variants: {
881
+ align: {
882
+ // Inline = horizontal (start/end do eixo do texto)
883
+ "inline-start": "",
884
+ "inline-end": "",
885
+ // Block = vertical (top/bottom — multi-linha em textarea)
886
+ "block-start": "",
887
+ "block-end": ""
888
+ }
889
+ },
890
+ defaultVariants: { align: "inline-start" }
891
+ }
892
+ );
893
+ const InputGroupAddon = React__namespace.forwardRef(({ className, align = "inline-start", onClick, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
894
+ "div",
895
+ {
896
+ ref,
897
+ role: "group",
898
+ "data-slot": "input-group-addon",
899
+ "data-align": align,
900
+ className: chipGroup.cn(inputGroupAddonVariants({ align }), className),
901
+ onClick: (e) => {
902
+ if (e.target.closest("button")) {
903
+ onClick?.(e);
904
+ return;
905
+ }
906
+ e.currentTarget.parentElement?.querySelector(
907
+ "input, textarea"
908
+ )?.focus();
909
+ onClick?.(e);
910
+ },
911
+ ...props
912
+ }
913
+ ));
914
+ InputGroupAddon.displayName = "InputGroupAddon";
915
+ const InputGroupText = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
916
+ "span",
917
+ {
918
+ ref,
919
+ "data-slot": "input-group-text",
920
+ className: chipGroup.cn(
921
+ "text-[12.5px] font-medium text-fg-muted whitespace-nowrap",
922
+ className
923
+ ),
924
+ ...props
925
+ }
926
+ ));
927
+ InputGroupText.displayName = "InputGroupText";
928
+ const inputGroupButtonVariants = classVarianceAuthority.cva(
929
+ [
930
+ "inline-flex items-center justify-center shrink-0",
931
+ "rounded-radius-md transition-colors outline-none cursor-pointer",
932
+ "focus-visible:ring-4 focus-visible:ring-ring-brand",
933
+ "disabled:cursor-not-allowed disabled:opacity-50",
934
+ "[&_svg]:size-4 [&_svg]:shrink-0"
935
+ ],
936
+ {
937
+ variants: {
938
+ size: {
939
+ xs: "h-form-xs px-pad-md gap-gp-xs text-[12px]",
940
+ "icon-xs": "size-form-xs",
941
+ sm: "h-form-sm px-pad-lg gap-gp-md text-[12.5px]",
942
+ "icon-sm": "size-form-sm"
943
+ },
944
+ variant: {
945
+ default: "bg-bg-muted text-fg-default hover:bg-bg-muted-hover",
946
+ destructive: "bg-bg-danger text-fg-on-danger hover:bg-bg-danger-hover",
947
+ outline: "border border-border-input bg-transparent text-fg-default hover:bg-bg-muted",
948
+ secondary: "bg-bg-emphasis text-fg-default hover:bg-bg-muted-hover",
949
+ ghost: "bg-transparent text-fg-muted hover:bg-bg-muted hover:text-fg-default",
950
+ link: "bg-transparent text-fg-brand underline-offset-4 hover:underline"
951
+ }
952
+ },
953
+ defaultVariants: { size: "xs", variant: "ghost" }
954
+ }
955
+ );
956
+ const InputGroupButton = React__namespace.forwardRef(({ className, size, variant, type = "button", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
957
+ "button",
958
+ {
959
+ ref,
960
+ type,
961
+ "data-slot": "input-group-button",
962
+ className: chipGroup.cn(inputGroupButtonVariants({ size, variant }), className),
963
+ ...props
964
+ }
965
+ ));
966
+ InputGroupButton.displayName = "InputGroupButton";
967
+ const DEFAULT_FILTERS = [
968
+ { id: "all", label: "Tudo", predicate: () => true },
969
+ { id: "unread", label: "Não lidas", predicate: (m) => !!m.unread },
970
+ { id: "groups", label: "Grupos", predicate: (m) => !!m.group }
971
+ ];
972
+ function HeaderMessages({ config, className }) {
973
+ const {
974
+ items,
975
+ filters = DEFAULT_FILTERS,
976
+ showSearch = true,
977
+ searchPlaceholder = "Pesquisar conversas...",
978
+ emptyMessage = "Nenhuma conversa encontrada.",
979
+ onNewMessage,
980
+ onExpand,
981
+ onViewAll,
982
+ viewAllLabel = "Ver todas no Chat Interno"
983
+ } = config;
984
+ const [open, setOpen] = React.useState(false);
985
+ const [activeFilter, setActiveFilter] = React.useState(filters[0]?.id ?? "all");
986
+ const [search, setSearch] = React.useState("");
987
+ const wrapRef = React.useRef(null);
988
+ const unreadCount = items.filter((m) => m.unread).length;
989
+ React.useEffect(() => {
990
+ if (!open) return;
991
+ const onClick = (e) => {
992
+ if (!wrapRef.current?.contains(e.target)) setOpen(false);
993
+ };
994
+ const onEsc = (e) => {
995
+ if (e.key === "Escape") setOpen(false);
996
+ };
997
+ document.addEventListener("mousedown", onClick);
998
+ document.addEventListener("keydown", onEsc);
999
+ return () => {
1000
+ document.removeEventListener("mousedown", onClick);
1001
+ document.removeEventListener("keydown", onEsc);
1002
+ };
1003
+ }, [open]);
1004
+ const filtered = items.filter(filters.find((f) => f.id === activeFilter)?.predicate ?? (() => true)).filter(
1005
+ (m) => search ? m.name.toLowerCase().includes(search.toLowerCase()) : true
1006
+ );
1007
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: wrapRef, className: chipGroup.cn(hdWrap(), className), children: [
1008
+ /* @__PURE__ */ jsxRuntime.jsxs(
1009
+ chipGroup.Button,
1010
+ {
1011
+ color: "secondary",
1012
+ variant: "outline",
1013
+ size: "icon-sm",
1014
+ className: "rounded-radius-md relative",
1015
+ "aria-label": "Mensagens",
1016
+ title: "Mensagens",
1017
+ "aria-expanded": open,
1018
+ onClick: () => setOpen((o) => !o),
1019
+ children: [
1020
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, {}),
1021
+ unreadCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: headerIconBtnBadge({ kind: "brand" }), "aria-hidden": "true" })
1022
+ ]
1023
+ }
1024
+ ),
1025
+ open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdDropdown(), role: "dialog", "aria-label": "Mensagens", children: [
1026
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdTop(), children: [
1027
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdHeader(), children: [
1028
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdTitle(), children: [
1029
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Conversas" }),
1030
+ unreadCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdTitleCount(), children: unreadCount })
1031
+ ] }),
1032
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdHeaderActions(), children: [
1033
+ onNewMessage && /* @__PURE__ */ jsxRuntime.jsx(
1034
+ chipGroup.Button,
1035
+ {
1036
+ color: "secondary",
1037
+ variant: "ghost",
1038
+ size: "icon-2xs",
1039
+ className: "rounded-radius-sm",
1040
+ title: "Nova mensagem",
1041
+ onClick: onNewMessage,
1042
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PenLine, {})
1043
+ }
1044
+ ),
1045
+ onExpand && /* @__PURE__ */ jsxRuntime.jsx(
1046
+ chipGroup.Button,
1047
+ {
1048
+ color: "secondary",
1049
+ variant: "ghost",
1050
+ size: "icon-2xs",
1051
+ className: "rounded-radius-sm",
1052
+ title: "Expandir",
1053
+ onClick: onExpand,
1054
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, {})
1055
+ }
1056
+ )
1057
+ ] })
1058
+ ] }),
1059
+ showSearch && /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { size: "sm", children: [
1060
+ /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { align: "inline-start", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { strokeWidth: 1.8 }) }),
1061
+ /* @__PURE__ */ jsxRuntime.jsx(
1062
+ InputGroupInput,
1063
+ {
1064
+ type: "text",
1065
+ placeholder: searchPlaceholder,
1066
+ value: search,
1067
+ onChange: (e) => setSearch(e.target.value)
1068
+ }
1069
+ )
1070
+ ] }),
1071
+ filters.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1072
+ chipGroup.ChipGroup,
1073
+ {
1074
+ type: "single",
1075
+ value: activeFilter,
1076
+ onValueChange: (v) => v && setActiveFilter(v),
1077
+ size: "lg",
1078
+ ariaLabel: "Filtrar mensagens",
1079
+ children: filters.map((f) => {
1080
+ const count = items.filter(f.predicate ?? (() => true)).length;
1081
+ return /* @__PURE__ */ jsxRuntime.jsxs(chipGroup.ChipGroupItem, { value: f.id, children: [
1082
+ f.label,
1083
+ count > 0 && ` (${count})`
1084
+ ] }, f.id);
1085
+ })
1086
+ }
1087
+ )
1088
+ ] }),
1089
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: hdBody(), children: filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: hdEmpty(), children: [
1090
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { size: 28, strokeWidth: 1.4 }),
1091
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: hdEmptyText(), children: emptyMessage })
1092
+ ] }) : filtered.map((m) => /* @__PURE__ */ jsxRuntime.jsx(MessageRow, { item: m }, m.id)) }),
1093
+ onViewAll && /* @__PURE__ */ jsxRuntime.jsx("div", { className: hdFooter(), children: /* @__PURE__ */ jsxRuntime.jsx(
1094
+ "a",
1095
+ {
1096
+ href: "#",
1097
+ className: hdFooterLink(),
1098
+ onClick: (e) => {
1099
+ e.preventDefault();
1100
+ onViewAll();
1101
+ setOpen(false);
1102
+ },
1103
+ children: viewAllLabel
1104
+ }
1105
+ ) })
1106
+ ] })
1107
+ ] });
1108
+ }
1109
+ function MessageRow({ item }) {
1110
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1111
+ "button",
1112
+ {
1113
+ type: "button",
1114
+ className: hdMsg(),
1115
+ onClick: item.onClick,
1116
+ title: `Conversar com ${item.name}`,
1117
+ children: [
1118
+ item.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(
1119
+ "img",
1120
+ {
1121
+ src: item.avatarUrl,
1122
+ alt: item.name,
1123
+ className: "flex-none w-icon-lg h-icon-lg rounded-full object-cover"
1124
+ }
1125
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdMsgAvatar(), style: { backgroundColor: item.color }, children: item.initials }),
1126
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: hdMsgBody(), children: [
1127
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: hdMsgRow(), children: [
1128
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdMsgName(), children: item.name }),
1129
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdMsgTime(), children: item.time })
1130
+ ] }),
1131
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: hdMsgPreviewRow(), children: [
1132
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdMsgPreview(), children: item.preview }),
1133
+ item.unread && /* @__PURE__ */ jsxRuntime.jsx("span", { className: hdMsgDot(), "aria-label": "não lida" })
1134
+ ] })
1135
+ ] })
1136
+ ]
1137
+ }
1138
+ );
1139
+ }
1140
+ const DropdownMenu = DropdownMenuPrimitive__namespace.Root;
1141
+ const DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
1142
+ const DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
1143
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
1144
+ const CONTAINER_CLASSES = [
1145
+ "relative z-50 min-w-[180px] overflow-hidden",
1146
+ "flex flex-col gap-px",
1147
+ "rounded-[12px] bg-bg-dropdown p-pad-sm",
1148
+ "border border-border-default shadow-sh-lg",
1149
+ // Outline padrão de elementos flutuantes
1150
+ "outline-float",
1151
+ "text-fg-muted",
1152
+ // Frosted-glass blur (necessário pra fazer o bg-dropdown semi-transparent render correto no dark)
1153
+ "before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150",
1154
+ // Animações Radix
1155
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
1156
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1157
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
1158
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
1159
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1160
+ "origin-[--radix-dropdown-menu-content-transform-origin]"
1161
+ ].join(" ");
1162
+ const ITEM_BASE = [
1163
+ "relative flex cursor-default select-none items-center",
1164
+ "gap-pad-lg px-pad-lg py-pad-md rounded-radius-sm",
1165
+ "text-[13px] font-medium",
1166
+ "outline-none transition-colors",
1167
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1168
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
1169
+ ].join(" ");
1170
+ const ITEM_VARIANT_DEFAULT = [
1171
+ "text-fg-muted [&_svg]:text-fg-muted",
1172
+ "focus:bg-bg-muted focus:text-fg-default focus:[&_svg]:text-fg-default"
1173
+ ].join(" ");
1174
+ const ITEM_VARIANT_DESTRUCTIVE = [
1175
+ "text-fg-danger [&_svg]:text-fg-danger",
1176
+ "focus:bg-bg-danger-muted focus:text-fg-danger focus:[&_svg]:text-fg-danger"
1177
+ ].join(" ");
1178
+ const DropdownMenuSubTrigger = React__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1179
+ DropdownMenuPrimitive__namespace.SubTrigger,
1180
+ {
1181
+ ref,
1182
+ className: chipGroup.cn(
1183
+ ITEM_BASE,
1184
+ ITEM_VARIANT_DEFAULT,
1185
+ "data-[state=open]:bg-bg-muted data-[state=open]:text-fg-default",
1186
+ inset && "pl-8",
1187
+ className
1188
+ ),
1189
+ ...props,
1190
+ children: [
1191
+ children,
1192
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto" })
1193
+ ]
1194
+ }
1195
+ ));
1196
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
1197
+ const DropdownMenuSubContent = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1198
+ DropdownMenuPrimitive__namespace.SubContent,
1199
+ {
1200
+ ref,
1201
+ className: chipGroup.cn(CONTAINER_CLASSES, className),
1202
+ ...props
1203
+ }
1204
+ ));
1205
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
1206
+ const DropdownMenuContent = React__namespace.forwardRef(({ className, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
1207
+ DropdownMenuPrimitive__namespace.Content,
1208
+ {
1209
+ ref,
1210
+ sideOffset,
1211
+ className: chipGroup.cn(
1212
+ CONTAINER_CLASSES,
1213
+ "max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden",
1214
+ className
1215
+ ),
1216
+ ...props
1217
+ }
1218
+ ) }));
1219
+ DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
1220
+ const DropdownMenuItem = React__namespace.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1221
+ DropdownMenuPrimitive__namespace.Item,
1222
+ {
1223
+ ref,
1224
+ className: chipGroup.cn(
1225
+ ITEM_BASE,
1226
+ variant === "destructive" ? ITEM_VARIANT_DESTRUCTIVE : ITEM_VARIANT_DEFAULT,
1227
+ inset && "pl-8",
1228
+ className
1229
+ ),
1230
+ ...props
1231
+ }
1232
+ ));
1233
+ DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
1234
+ const DropdownMenuCheckboxItem = React__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1235
+ DropdownMenuPrimitive__namespace.CheckboxItem,
1236
+ {
1237
+ ref,
1238
+ className: chipGroup.cn(
1239
+ ITEM_BASE,
1240
+ ITEM_VARIANT_DEFAULT,
1241
+ "pl-8 pr-pad-lg",
1242
+ className
1243
+ ),
1244
+ checked,
1245
+ ...props,
1246
+ children: [
1247
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-pad-md flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
1248
+ children
1249
+ ]
1250
+ }
1251
+ ));
1252
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
1253
+ const DropdownMenuRadioItem = React__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1254
+ DropdownMenuPrimitive__namespace.RadioItem,
1255
+ {
1256
+ ref,
1257
+ className: chipGroup.cn(
1258
+ ITEM_BASE,
1259
+ ITEM_VARIANT_DEFAULT,
1260
+ "pl-8 pr-pad-lg",
1261
+ // Selected state — brand tint (mantém no focus pra não voltar pra muted)
1262
+ "data-[state=checked]:bg-bg-brand-subtle data-[state=checked]:text-fg-brand",
1263
+ "data-[state=checked]:[&_svg]:text-fg-brand",
1264
+ "data-[state=checked]:focus:bg-bg-brand-subtle data-[state=checked]:focus:text-fg-brand",
1265
+ className
1266
+ ),
1267
+ ...props,
1268
+ children: [
1269
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-pad-md flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-4" }) }) }),
1270
+ children
1271
+ ]
1272
+ }
1273
+ ));
1274
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
1275
+ const DropdownMenuLabel = React__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1276
+ DropdownMenuPrimitive__namespace.Label,
1277
+ {
1278
+ ref,
1279
+ className: chipGroup.cn(
1280
+ "px-pad-lg py-pad-sm text-caption-sm font-semibold uppercase tracking-wider text-fg-subtle",
1281
+ inset && "pl-8",
1282
+ className
1283
+ ),
1284
+ ...props
1285
+ }
1286
+ ));
1287
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
1288
+ const DropdownMenuSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1289
+ DropdownMenuPrimitive__namespace.Separator,
1290
+ {
1291
+ ref,
1292
+ className: chipGroup.cn("mx-pad-xs my-pad-xs h-px bg-border-default", className),
1293
+ ...props
1294
+ }
1295
+ ));
1296
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
1297
+ const DEFAULT_OPTIONS = [
1298
+ { id: "light", label: "Claro", icon: lucideReact.Sun },
1299
+ { id: "dark", label: "Escuro", icon: lucideReact.Moon }
1300
+ ];
1301
+ function HeaderThemeSwitcher({
1302
+ theme,
1303
+ onThemeChange,
1304
+ options = DEFAULT_OPTIONS,
1305
+ className
1306
+ }) {
1307
+ const current = options.find((o) => o.id === theme) ?? options[0];
1308
+ const CurrentIcon = current?.icon ?? lucideReact.Sun;
1309
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
1310
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1311
+ chipGroup.Button,
1312
+ {
1313
+ color: "secondary",
1314
+ variant: "outline",
1315
+ size: "icon-sm",
1316
+ className: chipGroup.cn("rounded-radius-md", className),
1317
+ "aria-label": "Trocar tema",
1318
+ title: `Tema: ${current?.label ?? ""}`,
1319
+ children: /* @__PURE__ */ jsxRuntime.jsx(CurrentIcon, {})
1320
+ }
1321
+ ) }),
1322
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align: "end", sideOffset: 8, className: "min-w-[160px]", children: options.map((opt) => {
1323
+ const Icon = opt.icon;
1324
+ const isActive = opt.id === theme;
1325
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1326
+ DropdownMenuItem,
1327
+ {
1328
+ onSelect: () => onThemeChange(opt.id),
1329
+ children: [
1330
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
1331
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children: opt.label }),
1332
+ isActive && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "text-fg-brand" })
1333
+ ]
1334
+ },
1335
+ opt.id
1336
+ );
1337
+ }) })
1338
+ ] });
1339
+ }
1340
+ function Header({
1341
+ breadcrumb,
1342
+ onCollapseMenu,
1343
+ menuCollapsed,
1344
+ showSearch = true,
1345
+ searchPlaceholder = "Buscar...",
1346
+ searchShortcut = "⌘K",
1347
+ commandGroups,
1348
+ commandPlaceholder,
1349
+ commandEmptyMessage,
1350
+ notifications,
1351
+ messages,
1352
+ theme,
1353
+ onThemeChange,
1354
+ themeOptions,
1355
+ rightSlot,
1356
+ className
1357
+ }) {
1358
+ return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: chipGroup.cn(headerRoot(), className), children: [
1359
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: headerLeft(), children: [
1360
+ onCollapseMenu && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1361
+ /* @__PURE__ */ jsxRuntime.jsx(
1362
+ "button",
1363
+ {
1364
+ type: "button",
1365
+ className: chipGroup.cn(
1366
+ headerIconBtn({ variant: "ghost" }),
1367
+ "hidden md:inline-flex text-fg-muted hover:text-fg-default"
1368
+ ),
1369
+ onClick: onCollapseMenu,
1370
+ "aria-label": menuCollapsed ? "Expandir menu" : "Colapsar menu",
1371
+ title: menuCollapsed ? "Expandir menu" : "Colapsar menu",
1372
+ children: menuCollapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftOpen, { size: 20, strokeWidth: 1.7 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelLeftClose, { size: 20, strokeWidth: 1.7 })
1373
+ }
1374
+ ),
1375
+ /* @__PURE__ */ jsxRuntime.jsx(
1376
+ "button",
1377
+ {
1378
+ type: "button",
1379
+ className: chipGroup.cn(
1380
+ headerIconBtn({ variant: "ghost" }),
1381
+ "md:hidden text-fg-muted hover:text-fg-default"
1382
+ ),
1383
+ onClick: onCollapseMenu,
1384
+ "aria-label": "Abrir menu",
1385
+ title: "Menu",
1386
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { size: 20, strokeWidth: 1.8 })
1387
+ }
1388
+ ),
1389
+ /* @__PURE__ */ jsxRuntime.jsx(
1390
+ "span",
1391
+ {
1392
+ className: chipGroup.cn(headerDivider(), "hidden md:block"),
1393
+ "aria-hidden": "true"
1394
+ }
1395
+ )
1396
+ ] }),
1397
+ /* @__PURE__ */ jsxRuntime.jsx(
1398
+ HeaderBreadcrumb,
1399
+ {
1400
+ items: breadcrumb,
1401
+ mobileShowLastOnly: true
1402
+ }
1403
+ )
1404
+ ] }),
1405
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: headerRight(), children: [
1406
+ rightSlot,
1407
+ showSearch && /* @__PURE__ */ jsxRuntime.jsx(
1408
+ HeaderSearch,
1409
+ {
1410
+ placeholder: searchPlaceholder,
1411
+ shortcut: searchShortcut,
1412
+ commandGroups,
1413
+ commandPlaceholder,
1414
+ commandEmptyMessage
1415
+ }
1416
+ ),
1417
+ theme !== void 0 && onThemeChange && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden md:contents", children: /* @__PURE__ */ jsxRuntime.jsx(
1418
+ HeaderThemeSwitcher,
1419
+ {
1420
+ theme,
1421
+ onThemeChange,
1422
+ options: themeOptions
1423
+ }
1424
+ ) }),
1425
+ messages && /* @__PURE__ */ jsxRuntime.jsx(HeaderMessages, { config: messages }),
1426
+ notifications && /* @__PURE__ */ jsxRuntime.jsx(HeaderNotifications, { config: notifications })
1427
+ ] })
1428
+ ] });
1429
+ }
1430
+ const sidebarRoot = chipGroup.tv({
1431
+ base: "relative flex h-screen w-fit bg-bg-sidebar text-fg-default font-sans",
1432
+ variants: {
1433
+ mobile: {
1434
+ true: "fixed inset-y-0 left-0 z-50 h-screen w-auto transition-transform duration-200 ease-out",
1435
+ false: ""
1436
+ },
1437
+ mobileOpen: {
1438
+ true: "translate-x-0",
1439
+ false: ""
1440
+ }
1441
+ },
1442
+ compoundVariants: [
1443
+ // Mobile + fechado: empurra pra fora da tela
1444
+ { mobile: true, mobileOpen: false, class: "-translate-x-full" }
1445
+ ]
1446
+ });
1447
+ chipGroup.tv({
1448
+ base: "relative flex h-full w-fit bg-bg-sidebar text-fg-default font-sans"
1449
+ });
1450
+ const sidebarMobileBackdrop = chipGroup.tv({
1451
+ base: "fixed inset-0 z-40 bg-overlay-scrim transition-opacity duration-200"
1452
+ });
1453
+ const sidebarMobileCloseBtn = chipGroup.tv({
1454
+ base: [
1455
+ "absolute top-[14px] right-[14px] z-10",
1456
+ "w-form-sm h-form-sm rounded-radius-md grid place-items-center",
1457
+ "bg-transparent border-0 cursor-pointer",
1458
+ "text-fg-muted",
1459
+ "transition-colors duration-150",
1460
+ "hover:bg-bg-sidebar-accent-hover hover:text-fg-default",
1461
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1462
+ ]
1463
+ });
1464
+ const sidebarRail = chipGroup.tv({
1465
+ base: [
1466
+ "flex flex-col items-center w-[64px] flex-none",
1467
+ "h-full sticky top-0 z-30",
1468
+ "gap-gp-sm py-pad-md",
1469
+ "bg-bg-sidebar border-r border-border-sidebar"
1470
+ ]
1471
+ });
1472
+ const sidebarRailBrand = chipGroup.tv({
1473
+ base: [
1474
+ "w-form-lg h-form-lg rounded-radius-xl grid place-items-center",
1475
+ "bg-bg-brand text-fg-on-brand mb-pad-sm",
1476
+ "transition-opacity hover:opacity-90"
1477
+ ]
1478
+ });
1479
+ const sidebarRailList = chipGroup.tv({
1480
+ base: "flex flex-col items-center gap-gp-sm flex-1"
1481
+ });
1482
+ const sidebarRailItem = chipGroup.tv({
1483
+ base: [
1484
+ "group/rail-item relative w-form-lg h-form-lg rounded-radius-xl grid place-items-center",
1485
+ "bg-transparent border-0 cursor-pointer",
1486
+ "text-fg-muted",
1487
+ "transition-colors duration-150",
1488
+ "hover:bg-bg-sidebar-accent-hover hover:text-fg-default",
1489
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1490
+ ],
1491
+ variants: {
1492
+ active: {
1493
+ // Light: bg sidebar-accent (= branco via token), ícone mantém cor padrão (sem brand).
1494
+ // Dark: bg sidebar-accent (alpha-8), ícone ganha fg-brand.
1495
+ true: "bg-bg-sidebar-accent dark:text-fg-brand"
1496
+ }
1497
+ }
1498
+ });
1499
+ const sidebarRailActiveBar = chipGroup.tv({
1500
+ base: [
1501
+ "absolute -left-pad-2xl top-pad-md bottom-pad-md w-[3px]",
1502
+ "rounded-r-radius-sm bg-bg-brand"
1503
+ ]
1504
+ });
1505
+ const sidebarRailTooltip = chipGroup.tv({
1506
+ base: [
1507
+ "pointer-events-none absolute left-full ml-[14px] top-1/2 -translate-y-1/2",
1508
+ "px-pad-md py-[5px] rounded-radius-sm",
1509
+ "bg-fg-default text-bg-sidebar",
1510
+ "text-[11.5px] font-semibold tracking-[0.01em] whitespace-nowrap",
1511
+ "opacity-0 group-hover/rail-item:opacity-100",
1512
+ "transition-opacity duration-150 z-50",
1513
+ "shadow-sh-md"
1514
+ ]
1515
+ });
1516
+ const sidebarRailAdd = chipGroup.tv({
1517
+ base: [
1518
+ "w-form-lg h-form-lg rounded-radius-xl grid place-items-center",
1519
+ "text-fg-muted bg-transparent border-0 cursor-pointer mt-pad-xs opacity-70",
1520
+ "transition-[opacity,background-color,color] duration-150",
1521
+ "hover:opacity-100 hover:bg-bg-sidebar-accent-hover hover:text-fg-brand",
1522
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1523
+ ]
1524
+ });
1525
+ const sidebarRailUser = chipGroup.tv({
1526
+ base: "mt-auto"
1527
+ });
1528
+ const sidebarRailUserDefault = chipGroup.tv({
1529
+ base: [
1530
+ "grid place-items-center w-9 h-9 rounded-full",
1531
+ // tracking-[0.02em] preserva tracking original (preset usa +0.06em)
1532
+ "bg-bg-brand text-fg-on-brand font-bold text-[11px] uppercase tracking-[0.02em]"
1533
+ ]
1534
+ });
1535
+ const sidebarPanel = chipGroup.tv({
1536
+ base: [
1537
+ "w-[264px] flex-none h-full sticky top-0 flex flex-col overflow-hidden",
1538
+ "bg-bg-sidebar border-r border-border-sidebar",
1539
+ "transition-[width,opacity,border-color] duration-200 ease-out"
1540
+ ],
1541
+ variants: {
1542
+ collapsed: {
1543
+ true: "w-0 border-r-0 opacity-0 pointer-events-none"
1544
+ },
1545
+ /** Quando true: overlay absoluto sobre o conteúdo (hover-to-expand). */
1546
+ floating: {
1547
+ true: "absolute left-[64px] top-0 h-full z-40"
1548
+ }
1549
+ }
1550
+ });
1551
+ const sidebarPanelHeader = chipGroup.tv({
1552
+ base: "flex items-center h-[60px] flex-none px-[14px] border-b border-border-sidebar"
1553
+ });
1554
+ const sidebarPanelTitle = chipGroup.tv({
1555
+ base: [
1556
+ "flex-1 min-w-0 inline-flex items-center gap-gp-sm",
1557
+ "py-pad-sm px-pad-md rounded-radius-md",
1558
+ "bg-transparent border-0 cursor-pointer text-left",
1559
+ "font-bold text-fg-default text-[14.5px]",
1560
+ "transition-colors hover:bg-bg-sidebar-accent-hover",
1561
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1562
+ ]
1563
+ });
1564
+ const sidebarPanelBody = chipGroup.tv({
1565
+ base: "flex-1 overflow-y-auto p-[14px] scrollbar-thin"
1566
+ });
1567
+ const sidebarPanelGroup = chipGroup.tv({
1568
+ base: "flex flex-col gap-px"
1569
+ });
1570
+ const sidebarItem = chipGroup.tv({
1571
+ base: [
1572
+ "flex items-center gap-[11px] h-form-lg w-full px-pad-xl rounded-radius-md",
1573
+ "text-fg-default text-[13px] font-medium text-left no-underline cursor-pointer",
1574
+ "bg-transparent border-0",
1575
+ "transition-colors duration-150",
1576
+ // Hover usa sidebar-accent-hover (mineral subtle no light, alpha-12 no dark) —
1577
+ // assim fica distinto do active (sidebar-accent = white no light).
1578
+ "hover:bg-bg-sidebar-accent-hover hover:text-fg-default",
1579
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1580
+ ],
1581
+ variants: {
1582
+ active: {
1583
+ // Light: sidebar-accent (= white via token) + brand text + shadow.
1584
+ // Dark: sidebar-accent (alpha-8) + brand text + sem shadow.
1585
+ true: [
1586
+ "bg-bg-sidebar-accent text-fg-brand font-semibold shadow-sh-sm",
1587
+ "dark:shadow-sh-none"
1588
+ ]
1589
+ },
1590
+ subitem: {
1591
+ true: "h-form-sm px-pad-lg text-[12.5px] text-fg-muted hover:text-fg-default"
1592
+ }
1593
+ },
1594
+ compoundVariants: [
1595
+ {
1596
+ subitem: true,
1597
+ active: true,
1598
+ class: "bg-bg-sidebar-accent text-fg-default shadow-sh-none"
1599
+ }
1600
+ ]
1601
+ });
1602
+ const sidebarItemIcon = chipGroup.tv({
1603
+ base: "flex-none w-[17px] h-[17px] text-fg-muted transition-colors",
1604
+ variants: {
1605
+ active: {
1606
+ true: "text-fg-brand"
1607
+ },
1608
+ parentActive: {
1609
+ true: "text-fg-brand"
1610
+ }
1611
+ }
1612
+ });
1613
+ const sidebarItemText = chipGroup.tv({
1614
+ base: "flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis"
1615
+ });
1616
+ const sidebarPill = chipGroup.tv({
1617
+ base: [
1618
+ "inline-flex items-center justify-center flex-none",
1619
+ "min-w-[22px] h-[22px] px-[7px] rounded-radius-sm",
1620
+ // tracking-[0.02em] e leading-none preservam visual original (preset usa +0.06em e lineHeight 14px)
1621
+ "text-[11px] font-bold leading-none tracking-[0.02em] tabular-nums"
1622
+ ],
1623
+ variants: {
1624
+ kind: {
1625
+ // Light: consome border-sidebar (mineral-200, warm) — combina com sidebar mineral-100.
1626
+ // Dark: bg-muted (alpha-white subtle).
1627
+ default: "bg-border-sidebar text-fg-muted dark:bg-bg-muted",
1628
+ counter: "bg-border-sidebar text-fg-muted dark:bg-bg-brand dark:text-fg-on-brand",
1629
+ success: "bg-bg-success-muted text-fg-success dark:bg-bg-brand dark:text-fg-on-brand"
1630
+ },
1631
+ active: {
1632
+ true: "bg-bg-muted-hover text-fg-default dark:bg-bg-muted-hover dark:text-fg-default"
1633
+ }
1634
+ },
1635
+ defaultVariants: { kind: "default" }
1636
+ });
1637
+ const sidebarSubgroupRoot = chipGroup.tv({
1638
+ base: "flex flex-col gap-px"
1639
+ });
1640
+ const sidebarSubgroupChev = chipGroup.tv({
1641
+ base: "flex-none w-[13px] h-[13px] text-fg-muted ml-auto transition-transform duration-200",
1642
+ variants: {
1643
+ collapsed: {
1644
+ true: "-rotate-90"
1645
+ }
1646
+ }
1647
+ });
1648
+ const sidebarSubgroupList = chipGroup.tv({
1649
+ base: [
1650
+ "flex flex-col gap-px overflow-hidden",
1651
+ "ml-pad-xl pl-[14px] py-pad-2xs",
1652
+ "border-l border-border-sidebar",
1653
+ "transition-[max-height,opacity,padding] duration-200 ease-out"
1654
+ ],
1655
+ variants: {
1656
+ collapsed: {
1657
+ true: "max-h-0 opacity-0 py-0",
1658
+ false: "max-h-[400px] opacity-100"
1659
+ }
1660
+ },
1661
+ defaultVariants: { collapsed: false }
1662
+ });
1663
+ const sidebarSection = chipGroup.tv({
1664
+ base: "flex flex-col gap-px pt-[18px] mt-pad-xl border-t border-border-sidebar"
1665
+ });
1666
+ const sidebarSectionHeader = chipGroup.tv({
1667
+ base: [
1668
+ "flex items-center gap-gp-sm px-pad-lg pt-pad-sm pb-pad-md",
1669
+ "bg-transparent border-0 text-left cursor-pointer select-none w-full",
1670
+ "text-[10px] font-bold uppercase tracking-[0.06em] text-fg-default",
1671
+ "transition-colors hover:text-fg-default",
1672
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary rounded-radius-sm",
1673
+ // Dark: enfraquecer (mais sutil)
1674
+ "dark:text-fg-muted dark:font-medium dark:opacity-70"
1675
+ ]
1676
+ });
1677
+ const sidebarSectionChev = chipGroup.tv({
1678
+ base: "flex-none w-[12px] h-[12px] transition-transform duration-200",
1679
+ variants: {
1680
+ collapsed: {
1681
+ true: "-rotate-90"
1682
+ }
1683
+ }
1684
+ });
1685
+ const sidebarSectionAdd = chipGroup.tv({
1686
+ base: [
1687
+ "ml-auto w-[18px] h-[18px] grid place-items-center rounded-radius-xs",
1688
+ "text-fg-muted bg-transparent border-0 cursor-pointer text-[14px] leading-none",
1689
+ "transition-colors hover:bg-bg-sidebar-accent-hover hover:text-fg-default",
1690
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring-secondary"
1691
+ ]
1692
+ });
1693
+ const sidebarSectionList = chipGroup.tv({
1694
+ base: "flex flex-col gap-px overflow-hidden transition-[max-height,opacity] duration-200 ease-out",
1695
+ variants: {
1696
+ collapsed: {
1697
+ true: "max-h-0 opacity-0",
1698
+ false: "max-h-[600px] opacity-100"
1699
+ },
1700
+ variant: {
1701
+ bookmark: "",
1702
+ chat: "gap-gp-sm"
1703
+ }
1704
+ },
1705
+ defaultVariants: { collapsed: false, variant: "bookmark" }
1706
+ });
1707
+ const sidebarSectionItem = chipGroup.tv({
1708
+ base: [
1709
+ "flex items-center gap-[11px] h-form-sm w-full px-pad-lg rounded-radius-md",
1710
+ "text-[12.5px] font-medium text-fg-muted no-underline cursor-pointer",
1711
+ "bg-transparent border-0 text-left",
1712
+ "transition-colors duration-150",
1713
+ "hover:bg-bg-sidebar-accent-hover hover:text-fg-default",
1714
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary"
1715
+ ]
1716
+ });
1717
+ const sidebarBookmarkDot = chipGroup.tv({
1718
+ base: "flex-none w-[10px] h-[10px] rounded-full"
1719
+ });
1720
+ const sidebarChatAvatar = chipGroup.tv({
1721
+ base: [
1722
+ "flex-none grid place-items-center w-icon-lg h-icon-lg rounded-full",
1723
+ // tracking-[0.02em] preserva o tracking original (preset usa +0.06em); leading-none mantém centralização vertical
1724
+ "text-white text-[10px] font-bold uppercase tracking-[0.02em] leading-none"
1725
+ ]
1726
+ });
1727
+ const sidebarChatStatus = chipGroup.tv({
1728
+ base: "flex-none w-[7px] h-[7px] rounded-full ml-auto",
1729
+ variants: {
1730
+ status: {
1731
+ online: "bg-fg-success",
1732
+ offline: "bg-fg-subtle"
1733
+ }
1734
+ },
1735
+ defaultVariants: { status: "online" }
1736
+ });
1737
+ function SidebarBrandIcon({ size = 18 }) {
1738
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1739
+ "svg",
1740
+ {
1741
+ width: size,
1742
+ height: size * (25 / 18),
1743
+ viewBox: "0 0 46 64",
1744
+ fill: "none",
1745
+ xmlns: "http://www.w3.org/2000/svg",
1746
+ "aria-label": "iGreen",
1747
+ children: [
1748
+ /* @__PURE__ */ jsxRuntime.jsx(
1749
+ "path",
1750
+ {
1751
+ fillRule: "evenodd",
1752
+ clipRule: "evenodd",
1753
+ d: "M23.164 30.3908C18.9426 33.9472 15.488 37.9995 14.4032 43.8429H14.4073C14.5406 43.8429 14.6469 43.8482 14.7351 43.8526C14.8818 43.86 14.9789 43.8649 15.068 43.8386C15.8605 43.5936 16.6564 43.3583 17.4522 43.123C19.3184 42.5713 21.1848 42.0195 23.009 41.3416C32.3202 37.8861 35.2732 29.344 32.2837 19.9864C32.2369 19.9956 32.1889 20.0014 32.1404 20.0072C32.0324 20.0204 31.9238 20.0336 31.8309 20.083C30.7722 20.6536 29.7117 21.2208 28.6512 21.7879C25.7732 23.3269 22.8951 24.8663 20.0519 26.4727C17.0665 28.1586 14.8314 30.5925 13.7466 34.006C13.7044 34.1395 13.5982 34.2516 13.5398 34.3134C13.5245 34.3293 13.5127 34.342 13.5059 34.3507C13.1946 34.0579 12.9032 33.742 12.6157 33.4305C11.9956 32.7583 11.395 32.1074 10.6591 31.7569C8.30519 30.6325 5.89307 29.6329 3.45529 28.6228C2.48425 28.2202 1.50909 27.8162 0.532006 27.4018C-0.683422 31.5972 0.20163 35.225 3.0036 38.3864C5.54867 41.2617 8.72989 42.485 12.6372 42.279C11.9072 38.8362 10.1329 36.2047 7.93458 33.8001C9.89561 34.8394 10.9816 36.6237 12.1043 38.469C12.6255 39.3256 13.1549 40.1952 13.7832 41.0095C15.5819 36.0574 18.5797 32.4674 23.164 30.3908ZM18.3593 48.1644C17.3457 48.1644 16.524 49.0113 16.524 50.0562C16.524 51.1009 17.3457 51.9478 18.3593 51.9478H33.6948C34.7084 51.9478 35.5301 51.1009 35.5301 50.0562C35.5301 49.0113 34.7084 48.1644 33.6948 48.1644H18.3593ZM18.2779 54.7121C18.2779 53.6673 19.0996 52.8204 20.1132 52.8204H31.8593C32.8731 52.8204 33.6948 53.6673 33.6948 54.7121C33.6948 55.7568 32.8731 56.6039 31.8593 56.6039H20.1132C19.0996 56.6039 18.2779 55.7568 18.2779 54.7121ZM21.4161 57.3921C20.5164 57.3921 19.7869 58.144 19.7869 59.0716C19.7869 59.8346 20.2376 60.5206 20.9249 60.8039L22.4227 61.4216C22.7004 61.536 22.946 61.72 23.1376 61.9567C24.5776 63.7379 27.2319 63.7379 28.6719 61.9567C28.8634 61.72 29.109 61.536 29.3867 61.4216L30.8846 60.8039C31.5719 60.5206 32.0226 59.8346 32.0226 59.0716C32.0226 58.144 31.2931 57.3921 30.3933 57.3921H21.4161Z",
1754
+ fill: "currentColor"
1755
+ }
1756
+ ),
1757
+ /* @__PURE__ */ jsxRuntime.jsx(
1758
+ "path",
1759
+ {
1760
+ fillRule: "evenodd",
1761
+ clipRule: "evenodd",
1762
+ d: "M44.6078 8.96738C45.0034 8.58801 45.3999 8.20795 45.7978 7.82772H45.7937C45.7145 7.72076 45.6474 7.62532 45.5867 7.53882C45.4751 7.38013 45.3846 7.25152 45.2788 7.13705C45.2014 7.05134 45.1245 6.96498 45.0476 6.87858C44.7386 6.53188 44.4293 6.18462 44.0858 5.87783C39.8486 2.08758 34.8311 0.289299 29.3028 0.0366203C23.2801 -0.237139 17.5271 0.992601 12.6525 4.78709C5.81257 10.1145 3.26295 17.4129 4.20688 26.101C4.313 27.0907 4.86457 27.5708 5.73095 27.8193C8.29274 28.5562 10.7771 29.4659 12.9181 31.2853C12.9839 31.2072 13.0497 31.1297 13.1153 31.0521C14.3138 29.6385 15.4412 28.3083 14.7323 26.2401C14.6277 25.9331 14.5969 25.6008 14.5662 25.268C14.5502 25.0939 14.5342 24.9198 14.5076 24.7493C13.2041 16.499 18.8019 9.38173 26.9165 8.92689C31.4397 8.67 35.3295 10.144 38.6923 13.2268C38.9498 13.4626 39.6035 13.6774 39.7588 13.5342C41.3958 12.0464 42.9959 10.5126 44.6078 8.96738ZM19.2274 44.0715C19.0668 44.13 18.88 44.1982 18.6507 44.2775C18.8702 44.3799 19.0457 44.4679 19.1938 44.5423C19.454 44.6729 19.6304 44.7615 19.8153 44.8124C28.404 47.1833 36.4696 45.8736 43.9797 41.0264C44.4986 40.6935 44.9806 39.8177 44.9889 39.1901C45.0334 35.5838 45.021 31.9754 45.0085 28.3664C45.0029 26.6821 44.997 24.9976 44.997 23.313C44.997 22.5592 44.7111 22.294 43.9674 22.3066C41.6833 22.3488 39.3952 22.3697 37.1111 22.2982C36.0651 22.2644 35.7872 22.6435 35.8036 23.6711C35.8302 25.2672 35.826 26.8634 35.8221 28.4595C35.8179 30.0556 35.8138 31.6517 35.8404 33.2478C35.8607 34.5828 35.4726 35.4294 34.1855 35.9642C33.0701 36.4274 31.9097 37.0424 31.0721 37.9014C27.9422 41.1064 24.1136 42.8162 19.9173 43.8438C19.7115 43.8947 19.5103 43.9682 19.2274 44.0715Z",
1763
+ fill: "currentColor"
1764
+ }
1765
+ )
1766
+ ]
1767
+ }
1768
+ );
1769
+ }
1770
+ function SidebarRail({
1771
+ contexts,
1772
+ activeContextId,
1773
+ onContextChange,
1774
+ brand,
1775
+ user,
1776
+ showAdd = false,
1777
+ onAddClick,
1778
+ className
1779
+ }) {
1780
+ return /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: chipGroup.cn(sidebarRail(), className), children: [
1781
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/", className: sidebarRailBrand(), "aria-label": "Home", children: brand ?? /* @__PURE__ */ jsxRuntime.jsx(SidebarBrandIcon, {}) }),
1782
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: sidebarRailList(), children: [
1783
+ contexts.map((ctx) => {
1784
+ const Icon = ctx.icon;
1785
+ const isActive = activeContextId === ctx.id;
1786
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1787
+ "button",
1788
+ {
1789
+ type: "button",
1790
+ className: sidebarRailItem({ active: isActive }),
1791
+ onClick: () => onContextChange(ctx.id),
1792
+ "aria-label": ctx.label,
1793
+ "aria-current": isActive ? "page" : void 0,
1794
+ children: [
1795
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 18, strokeWidth: 1.7 }),
1796
+ isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarRailActiveBar(), "aria-hidden": "true" }),
1797
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarRailTooltip(), children: ctx.label })
1798
+ ]
1799
+ },
1800
+ ctx.id
1801
+ );
1802
+ }),
1803
+ showAdd && /* @__PURE__ */ jsxRuntime.jsx(
1804
+ "button",
1805
+ {
1806
+ type: "button",
1807
+ className: sidebarRailAdd(),
1808
+ onClick: onAddClick,
1809
+ "aria-label": "Adicionar contexto",
1810
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { size: 16, strokeWidth: 2 })
1811
+ }
1812
+ )
1813
+ ] }),
1814
+ user !== null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: sidebarRailUser(), children: user ?? /* @__PURE__ */ jsxRuntime.jsx("div", { className: sidebarRailUserDefault(), children: "SV" }) })
1815
+ ] });
1816
+ }
1817
+ const SidebarItem = React.forwardRef(
1818
+ ({ item, active, subitem, iconBrand, onClick, className }, ref) => {
1819
+ const Icon = item.icon;
1820
+ const classes = chipGroup.cn(sidebarItem({ active, subitem }), className);
1821
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1822
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(
1823
+ Icon,
1824
+ {
1825
+ size: subitem ? 15 : 17,
1826
+ strokeWidth: 1.7,
1827
+ className: sidebarItemIcon({ active, parentActive: iconBrand })
1828
+ }
1829
+ ),
1830
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarItemText(), children: item.name }),
1831
+ item.badge && /* @__PURE__ */ jsxRuntime.jsx(SidebarPill, { kind: item.badgeKind, active, children: item.badge })
1832
+ ] });
1833
+ const handleClick = (e) => {
1834
+ if (item.onClick) item.onClick(e);
1835
+ onClick?.(e);
1836
+ };
1837
+ if (item.href) {
1838
+ return /* @__PURE__ */ jsxRuntime.jsx(
1839
+ "a",
1840
+ {
1841
+ ref,
1842
+ href: item.href,
1843
+ className: classes,
1844
+ onClick: handleClick,
1845
+ "aria-current": active ? "page" : void 0,
1846
+ children: content
1847
+ }
1848
+ );
1849
+ }
1850
+ return /* @__PURE__ */ jsxRuntime.jsx(
1851
+ "button",
1852
+ {
1853
+ ref,
1854
+ type: "button",
1855
+ className: classes,
1856
+ onClick: handleClick,
1857
+ "aria-current": active ? "page" : void 0,
1858
+ children: content
1859
+ }
1860
+ );
1861
+ }
1862
+ );
1863
+ SidebarItem.displayName = "SidebarItem";
1864
+ function SidebarPill({
1865
+ kind,
1866
+ active,
1867
+ children,
1868
+ className
1869
+ }) {
1870
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: chipGroup.cn(sidebarPill({ kind, active }), className), children });
1871
+ }
1872
+ function SidebarSubgroup({
1873
+ item,
1874
+ activeItemHref,
1875
+ onItemClick,
1876
+ open,
1877
+ defaultOpen,
1878
+ onOpenChange,
1879
+ className
1880
+ }) {
1881
+ const hasActiveChild = item.subitems?.some(
1882
+ (s) => s.href !== void 0 && s.href === activeItemHref
1883
+ );
1884
+ const [internalOpen, setInternalOpen] = React.useState(
1885
+ defaultOpen ?? item.defaultOpen ?? hasActiveChild ?? false
1886
+ );
1887
+ const isOpen = open ?? internalOpen;
1888
+ const collapsed = !isOpen;
1889
+ const setOpen = (next) => {
1890
+ if (open === void 0) setInternalOpen(next);
1891
+ onOpenChange?.(next);
1892
+ };
1893
+ const Icon = item.icon;
1894
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chipGroup.cn(sidebarSubgroupRoot(), className), children: [
1895
+ /* @__PURE__ */ jsxRuntime.jsxs(
1896
+ "button",
1897
+ {
1898
+ type: "button",
1899
+ className: chipGroup.cn(sidebarItem(), "select-none"),
1900
+ onClick: () => setOpen(!isOpen),
1901
+ "aria-expanded": isOpen,
1902
+ "aria-controls": `subgroup-${item.name}`,
1903
+ children: [
1904
+ Icon && /* @__PURE__ */ jsxRuntime.jsx(
1905
+ Icon,
1906
+ {
1907
+ size: 17,
1908
+ strokeWidth: 1.7,
1909
+ className: sidebarItemIcon({ parentActive: hasActiveChild })
1910
+ }
1911
+ ),
1912
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarItemText(), children: item.name }),
1913
+ /* @__PURE__ */ jsxRuntime.jsx(
1914
+ lucideReact.ChevronDown,
1915
+ {
1916
+ size: 13,
1917
+ strokeWidth: 2,
1918
+ className: sidebarSubgroupChev({ collapsed })
1919
+ }
1920
+ )
1921
+ ]
1922
+ }
1923
+ ),
1924
+ /* @__PURE__ */ jsxRuntime.jsx("div", { id: `subgroup-${item.name}`, className: sidebarSubgroupList({ collapsed }), children: item.subitems?.map((sub) => /* @__PURE__ */ jsxRuntime.jsx(
1925
+ SidebarItem,
1926
+ {
1927
+ item: sub,
1928
+ subitem: true,
1929
+ active: sub.href !== void 0 && sub.href === activeItemHref,
1930
+ onClick: () => onItemClick?.(sub)
1931
+ },
1932
+ sub.href ?? sub.name
1933
+ )) })
1934
+ ] });
1935
+ }
1936
+ function SidebarSection({
1937
+ section,
1938
+ open,
1939
+ onOpenChange,
1940
+ className
1941
+ }) {
1942
+ const [internalOpen, setInternalOpen] = React.useState(section.defaultOpen ?? true);
1943
+ const isOpen = open ?? internalOpen;
1944
+ const collapsed = !isOpen;
1945
+ const setOpen = (next) => {
1946
+ if (open === void 0) setInternalOpen(next);
1947
+ onOpenChange?.(next);
1948
+ };
1949
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chipGroup.cn(sidebarSection(), className), children: [
1950
+ /* @__PURE__ */ jsxRuntime.jsxs(
1951
+ "button",
1952
+ {
1953
+ type: "button",
1954
+ className: sidebarSectionHeader(),
1955
+ onClick: () => setOpen(!isOpen),
1956
+ "aria-expanded": isOpen,
1957
+ "aria-controls": `section-${section.id}`,
1958
+ children: [
1959
+ /* @__PURE__ */ jsxRuntime.jsx(
1960
+ lucideReact.ChevronDown,
1961
+ {
1962
+ size: 12,
1963
+ strokeWidth: 2,
1964
+ className: sidebarSectionChev({ collapsed })
1965
+ }
1966
+ ),
1967
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: section.label }),
1968
+ section.onAdd && /* @__PURE__ */ jsxRuntime.jsx(
1969
+ "span",
1970
+ {
1971
+ role: "button",
1972
+ tabIndex: 0,
1973
+ className: sidebarSectionAdd(),
1974
+ onClick: (e) => {
1975
+ e.stopPropagation();
1976
+ section.onAdd?.();
1977
+ },
1978
+ onKeyDown: (e) => {
1979
+ if (e.key === "Enter" || e.key === " ") {
1980
+ e.preventDefault();
1981
+ section.onAdd?.();
1982
+ }
1983
+ },
1984
+ "aria-label": `Adicionar em ${section.label}`,
1985
+ children: "+"
1986
+ }
1987
+ )
1988
+ ]
1989
+ }
1990
+ ),
1991
+ /* @__PURE__ */ jsxRuntime.jsxs(
1992
+ "div",
1993
+ {
1994
+ id: `section-${section.id}`,
1995
+ className: sidebarSectionList({ collapsed, variant: section.variant }),
1996
+ children: [
1997
+ section.variant === "bookmark" && section.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
1998
+ SidebarSectionLink,
1999
+ {
2000
+ href: item.href,
2001
+ onClick: item.onClick,
2002
+ title: item.name,
2003
+ children: [
2004
+ /* @__PURE__ */ jsxRuntime.jsx(
2005
+ "span",
2006
+ {
2007
+ className: sidebarBookmarkDot(),
2008
+ style: { backgroundColor: item.color },
2009
+ "aria-hidden": "true"
2010
+ }
2011
+ ),
2012
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarItemText(), children: item.name })
2013
+ ]
2014
+ },
2015
+ item.name
2016
+ )),
2017
+ section.variant === "chat" && section.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2018
+ SidebarSectionLink,
2019
+ {
2020
+ href: item.href,
2021
+ onClick: item.onClick,
2022
+ title: `Conversar com ${item.name}`,
2023
+ children: [
2024
+ /* @__PURE__ */ jsxRuntime.jsx(
2025
+ "span",
2026
+ {
2027
+ className: sidebarChatAvatar(),
2028
+ style: { backgroundColor: item.color },
2029
+ children: item.initials
2030
+ }
2031
+ ),
2032
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: sidebarItemText(), children: item.name }),
2033
+ /* @__PURE__ */ jsxRuntime.jsx(
2034
+ "span",
2035
+ {
2036
+ className: sidebarChatStatus({ status: item.status }),
2037
+ "aria-hidden": "true"
2038
+ }
2039
+ )
2040
+ ]
2041
+ },
2042
+ item.name
2043
+ ))
2044
+ ]
2045
+ }
2046
+ )
2047
+ ] });
2048
+ }
2049
+ function SidebarSectionLink({
2050
+ href,
2051
+ onClick,
2052
+ title,
2053
+ children
2054
+ }) {
2055
+ const handleClick = (e) => {
2056
+ if (!href || href === "#") e.preventDefault();
2057
+ onClick?.(e);
2058
+ };
2059
+ return /* @__PURE__ */ jsxRuntime.jsx(
2060
+ "a",
2061
+ {
2062
+ href: href ?? "#",
2063
+ className: sidebarSectionItem(),
2064
+ onClick: handleClick,
2065
+ title,
2066
+ children
2067
+ }
2068
+ );
2069
+ }
2070
+ function SidebarPanel({
2071
+ context,
2072
+ collapsed,
2073
+ floating,
2074
+ activeItemHref,
2075
+ onItemClick,
2076
+ contexts,
2077
+ onContextChange,
2078
+ onTitleClick,
2079
+ children,
2080
+ className
2081
+ }) {
2082
+ const hasSwitcher = contexts && contexts.length > 1 && onContextChange;
2083
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2084
+ "aside",
2085
+ {
2086
+ className: chipGroup.cn(sidebarPanel({ collapsed, floating }), className),
2087
+ "aria-hidden": collapsed,
2088
+ children: [
2089
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sidebarPanelHeader(), children: hasSwitcher ? /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
2090
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: sidebarPanelTitle(), children: [
2091
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis", children: context.label }),
2092
+ /* @__PURE__ */ jsxRuntime.jsx(
2093
+ lucideReact.ChevronDown,
2094
+ {
2095
+ size: 14,
2096
+ strokeWidth: 2,
2097
+ className: "flex-none w-[14px] h-[14px] text-fg-muted"
2098
+ }
2099
+ )
2100
+ ] }) }),
2101
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuContent, { align: "start", sideOffset: 6, className: "min-w-[220px]", children: contexts.map((ctx) => {
2102
+ const Icon = ctx.icon;
2103
+ const isActive = ctx.id === context.id;
2104
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2105
+ DropdownMenuItem,
2106
+ {
2107
+ onSelect: () => onContextChange?.(ctx.id),
2108
+ children: [
2109
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4 text-fg-muted", strokeWidth: 1.7 }),
2110
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: ctx.label }),
2111
+ isActive && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-4 text-fg-brand", strokeWidth: 2 })
2112
+ ]
2113
+ },
2114
+ ctx.id
2115
+ );
2116
+ }) })
2117
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: sidebarPanelTitle(), onClick: onTitleClick, children: [
2118
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 min-w-0 whitespace-nowrap overflow-hidden text-ellipsis", children: context.label }),
2119
+ /* @__PURE__ */ jsxRuntime.jsx(
2120
+ lucideReact.ChevronDown,
2121
+ {
2122
+ size: 14,
2123
+ strokeWidth: 2,
2124
+ className: "flex-none w-[14px] h-[14px] text-fg-muted"
2125
+ }
2126
+ )
2127
+ ] }) }),
2128
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sidebarPanelBody(), children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2129
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: sidebarPanelGroup(), children: context.items.map((item) => {
2130
+ if (item.subitems && item.subitems.length > 0) {
2131
+ return /* @__PURE__ */ jsxRuntime.jsx(
2132
+ SidebarSubgroup,
2133
+ {
2134
+ item,
2135
+ activeItemHref,
2136
+ onItemClick
2137
+ },
2138
+ item.name
2139
+ );
2140
+ }
2141
+ return /* @__PURE__ */ jsxRuntime.jsx(
2142
+ SidebarItem,
2143
+ {
2144
+ item,
2145
+ active: item.href !== void 0 && item.href === activeItemHref,
2146
+ onClick: () => onItemClick?.(item)
2147
+ },
2148
+ item.href ?? item.name
2149
+ );
2150
+ }) }),
2151
+ context.sections?.map((section) => /* @__PURE__ */ jsxRuntime.jsx(SidebarSection, { section }, section.id))
2152
+ ] }) })
2153
+ ]
2154
+ }
2155
+ );
2156
+ }
2157
+ function useControllable(controlledValue, defaultValue, onChange) {
2158
+ const isControlled = controlledValue !== void 0;
2159
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
2160
+ const value = isControlled ? controlledValue : internalValue;
2161
+ const setValue = React.useCallback(
2162
+ (next) => {
2163
+ if (!isControlled) setInternalValue(next);
2164
+ onChange?.(next);
2165
+ },
2166
+ [isControlled, onChange]
2167
+ );
2168
+ return [value, setValue];
2169
+ }
2170
+ function useMediaQuery(query) {
2171
+ const [matches, setMatches] = React.useState(() => {
2172
+ if (typeof window === "undefined") return false;
2173
+ return window.matchMedia(query).matches;
2174
+ });
2175
+ React.useEffect(() => {
2176
+ if (typeof window === "undefined") return;
2177
+ const mql = window.matchMedia(query);
2178
+ const handler = (e) => setMatches(e.matches);
2179
+ setMatches(mql.matches);
2180
+ mql.addEventListener("change", handler);
2181
+ return () => mql.removeEventListener("change", handler);
2182
+ }, [query]);
2183
+ return matches;
2184
+ }
2185
+ function MenuSidebar({
2186
+ contexts,
2187
+ brand,
2188
+ user,
2189
+ showRailAdd,
2190
+ onRailAddClick,
2191
+ activeContextId,
2192
+ defaultActiveContextId,
2193
+ onContextChange,
2194
+ activeItemHref,
2195
+ defaultActiveItemHref,
2196
+ onItemClick,
2197
+ panelCollapsed,
2198
+ defaultPanelCollapsed,
2199
+ onPanelCollapseChange,
2200
+ expandOnHover = true,
2201
+ onPanelTitleClick,
2202
+ mobileOpen,
2203
+ defaultMobileOpen,
2204
+ onMobileOpenChange,
2205
+ mobileBreakpoint = "(max-width: 767px)",
2206
+ className
2207
+ }) {
2208
+ const isMobile = useMediaQuery(mobileBreakpoint);
2209
+ const [ctxId, setCtxId] = useControllable(
2210
+ activeContextId,
2211
+ defaultActiveContextId ?? contexts[0]?.id ?? "",
2212
+ onContextChange
2213
+ );
2214
+ const [itemHref, setItemHref] = useControllable(
2215
+ activeItemHref,
2216
+ defaultActiveItemHref ?? "",
2217
+ () => {
2218
+ }
2219
+ );
2220
+ const [collapsed] = useControllable(
2221
+ panelCollapsed,
2222
+ defaultPanelCollapsed ?? false,
2223
+ onPanelCollapseChange
2224
+ );
2225
+ const [openMobile, setOpenMobile] = useControllable(
2226
+ mobileOpen,
2227
+ defaultMobileOpen ?? false,
2228
+ onMobileOpenChange
2229
+ );
2230
+ const [hoverExpanded, setHoverExpanded] = React.useState(false);
2231
+ const [hoverExiting, setHoverExiting] = React.useState(false);
2232
+ const exitTimerRef = React.useRef(null);
2233
+ React.useEffect(() => {
2234
+ return () => {
2235
+ if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
2236
+ };
2237
+ }, []);
2238
+ const shouldFloat = !isMobile && !!expandOnHover && collapsed && (hoverExpanded || hoverExiting);
2239
+ const activeContext = contexts.find((c) => c.id === ctxId) ?? contexts[0];
2240
+ const handleItemClick = (item) => {
2241
+ if (item.href && activeItemHref === void 0) {
2242
+ setItemHref(item.href);
2243
+ }
2244
+ onItemClick?.(item);
2245
+ if (isMobile && item.href) setOpenMobile(false);
2246
+ };
2247
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2248
+ isMobile && openMobile && /* @__PURE__ */ jsxRuntime.jsx(
2249
+ "div",
2250
+ {
2251
+ className: sidebarMobileBackdrop(),
2252
+ onClick: () => setOpenMobile(false),
2253
+ "aria-hidden": "true"
2254
+ }
2255
+ ),
2256
+ /* @__PURE__ */ jsxRuntime.jsxs(
2257
+ "div",
2258
+ {
2259
+ className: chipGroup.cn(
2260
+ sidebarRoot({ mobile: isMobile, mobileOpen: isMobile && openMobile }),
2261
+ className
2262
+ ),
2263
+ onMouseEnter: () => {
2264
+ if (!isMobile && expandOnHover && collapsed) {
2265
+ if (exitTimerRef.current) {
2266
+ clearTimeout(exitTimerRef.current);
2267
+ exitTimerRef.current = null;
2268
+ }
2269
+ setHoverExiting(false);
2270
+ setHoverExpanded(true);
2271
+ }
2272
+ },
2273
+ onMouseLeave: () => {
2274
+ setHoverExpanded(false);
2275
+ if (!isMobile && expandOnHover && collapsed) {
2276
+ setHoverExiting(true);
2277
+ if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
2278
+ exitTimerRef.current = setTimeout(() => {
2279
+ setHoverExiting(false);
2280
+ exitTimerRef.current = null;
2281
+ }, 200);
2282
+ }
2283
+ },
2284
+ children: [
2285
+ /* @__PURE__ */ jsxRuntime.jsx(
2286
+ SidebarRail,
2287
+ {
2288
+ contexts,
2289
+ activeContextId: ctxId,
2290
+ onContextChange: setCtxId,
2291
+ brand,
2292
+ user,
2293
+ showAdd: showRailAdd,
2294
+ onAddClick: onRailAddClick
2295
+ }
2296
+ ),
2297
+ activeContext && /* @__PURE__ */ jsxRuntime.jsx(
2298
+ SidebarPanel,
2299
+ {
2300
+ context: activeContext,
2301
+ collapsed: isMobile ? false : hoverExpanded ? false : collapsed,
2302
+ floating: shouldFloat,
2303
+ activeItemHref: itemHref,
2304
+ onItemClick: handleItemClick,
2305
+ contexts,
2306
+ onContextChange: setCtxId,
2307
+ onTitleClick: onPanelTitleClick
2308
+ }
2309
+ ),
2310
+ isMobile && openMobile && /* @__PURE__ */ jsxRuntime.jsx(
2311
+ "button",
2312
+ {
2313
+ type: "button",
2314
+ className: sidebarMobileCloseBtn(),
2315
+ onClick: () => setOpenMobile(false),
2316
+ "aria-label": "Fechar menu",
2317
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 18, strokeWidth: 1.7 })
2318
+ }
2319
+ )
2320
+ ]
2321
+ }
2322
+ )
2323
+ ] });
2324
+ }
2325
+ const Avatar = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2326
+ AvatarPrimitive__namespace.Root,
2327
+ {
2328
+ ref,
2329
+ className: chipGroup.cn(
2330
+ "relative flex size-8 shrink-0 overflow-hidden rounded-full",
2331
+ className
2332
+ ),
2333
+ ...props
2334
+ }
2335
+ ));
2336
+ Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
2337
+ const AvatarImage = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2338
+ AvatarPrimitive__namespace.Image,
2339
+ {
2340
+ ref,
2341
+ className: chipGroup.cn("aspect-square h-full w-full", className),
2342
+ ...props
2343
+ }
2344
+ ));
2345
+ AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
2346
+ const AvatarFallback = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
2347
+ AvatarPrimitive__namespace.Fallback,
2348
+ {
2349
+ ref,
2350
+ className: chipGroup.cn(
2351
+ "flex h-full w-full items-center justify-center rounded-full bg-bg-muted text-fg-muted text-caption-md",
2352
+ className
2353
+ ),
2354
+ ...props
2355
+ }
2356
+ ));
2357
+ AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
2358
+ function deriveInitials(name) {
2359
+ return name.split(" ").filter(Boolean).map((p) => p[0]).join("").slice(0, 2).toUpperCase();
2360
+ }
2361
+ function UserMenu({
2362
+ user,
2363
+ layout,
2364
+ onLayoutChange,
2365
+ layoutOptions,
2366
+ theme,
2367
+ onThemeChange,
2368
+ themeOptions,
2369
+ onSettings,
2370
+ onLogout
2371
+ }) {
2372
+ const initials = user.initials ?? deriveInitials(user.name);
2373
+ const hasLayout = !!(layoutOptions && layoutOptions.length > 0);
2374
+ const hasTheme = !!(themeOptions && themeOptions.length > 0);
2375
+ const hasGroups = hasLayout || hasTheme || !!onSettings;
2376
+ const currentLayoutLabel = hasLayout && layout ? layoutOptions.find((o) => o.id === layout)?.label : void 0;
2377
+ const currentThemeLabel = hasTheme && theme ? themeOptions.find((o) => o.id === theme)?.label : void 0;
2378
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
2379
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2380
+ "button",
2381
+ {
2382
+ type: "button",
2383
+ "aria-label": `Menu do usuário (${user.name})`,
2384
+ className: [
2385
+ "grid place-items-center w-9 h-9 rounded-full shrink-0",
2386
+ "bg-bg-brand text-fg-on-brand text-[11px] font-bold uppercase tracking-[0.02em]",
2387
+ "cursor-pointer transition-opacity duration-150",
2388
+ "hover:opacity-90",
2389
+ "focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-ring-secondary",
2390
+ "data-[state=open]:ring-4 data-[state=open]:ring-ring-secondary"
2391
+ ].join(" "),
2392
+ style: user.avatarColor ? { background: user.avatarColor } : void 0,
2393
+ children: user.avatarSrc ? /* @__PURE__ */ jsxRuntime.jsxs(Avatar, { className: "size-9", children: [
2394
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: user.avatarSrc, alt: user.name }),
2395
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "bg-transparent text-fg-on-brand", children: initials })
2396
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: initials })
2397
+ }
2398
+ ) }),
2399
+ /* @__PURE__ */ jsxRuntime.jsxs(
2400
+ DropdownMenuContent,
2401
+ {
2402
+ side: "right",
2403
+ align: "end",
2404
+ sideOffset: 12,
2405
+ className: "min-w-[240px]",
2406
+ children: [
2407
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-gp-md px-pad-lg py-pad-md", children: [
2408
+ /* @__PURE__ */ jsxRuntime.jsxs(
2409
+ Avatar,
2410
+ {
2411
+ className: "size-9 shrink-0",
2412
+ style: user.avatarColor ? { background: user.avatarColor } : void 0,
2413
+ children: [
2414
+ user.avatarSrc && /* @__PURE__ */ jsxRuntime.jsx(AvatarImage, { src: user.avatarSrc, alt: user.name }),
2415
+ /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { className: "bg-bg-brand text-fg-on-brand text-[12px] font-bold uppercase", children: initials })
2416
+ ]
2417
+ }
2418
+ ),
2419
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-0 flex-1", children: [
2420
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-medium text-fg-default truncate", children: user.name }),
2421
+ user.email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-fg-muted truncate", children: user.email })
2422
+ ] })
2423
+ ] }),
2424
+ hasGroups && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2425
+ hasLayout && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSub, { children: [
2426
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { children: [
2427
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutGrid, {}),
2428
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Layout" }),
2429
+ currentLayoutLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-right text-[11px] text-fg-subtle", children: currentLayoutLabel })
2430
+ ] }),
2431
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSubContent, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
2432
+ DropdownMenuRadioGroup,
2433
+ {
2434
+ value: layout,
2435
+ onValueChange: onLayoutChange,
2436
+ children: layoutOptions.map((opt) => {
2437
+ const Icon = opt.icon;
2438
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuRadioItem, { value: opt.id, children: [
2439
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
2440
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label })
2441
+ ] }, opt.id);
2442
+ })
2443
+ }
2444
+ ) })
2445
+ ] }),
2446
+ hasTheme && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSub, { children: [
2447
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuSubTrigger, { children: [
2448
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SunMoon, {}),
2449
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tema" }),
2450
+ currentThemeLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-right text-[11px] text-fg-subtle", children: currentThemeLabel })
2451
+ ] }),
2452
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSubContent, { sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
2453
+ DropdownMenuRadioGroup,
2454
+ {
2455
+ value: theme,
2456
+ onValueChange: onThemeChange,
2457
+ children: themeOptions.map((opt) => {
2458
+ const Icon = opt.icon;
2459
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuRadioItem, { value: opt.id, children: [
2460
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, {}),
2461
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: opt.label })
2462
+ ] }, opt.id);
2463
+ })
2464
+ }
2465
+ ) })
2466
+ ] }),
2467
+ onSettings && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: onSettings, children: [
2468
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, {}),
2469
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Configurações" })
2470
+ ] }),
2471
+ onLogout && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2472
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
2473
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: onLogout, children: [
2474
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, {}),
2475
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Sair" })
2476
+ ] })
2477
+ ] })
2478
+ ]
2479
+ }
2480
+ )
2481
+ ] });
2482
+ }
2483
+ const root = chipGroup.tv({
2484
+ base: [
2485
+ "flex h-screen w-full bg-bg-canvas",
2486
+ "overflow-hidden"
2487
+ // garante que sidebar + main não vazem viewport
2488
+ ]
2489
+ });
2490
+ const main = chipGroup.tv({
2491
+ base: [
2492
+ "flex flex-col flex-1 min-w-0",
2493
+ "overflow-hidden"
2494
+ ]
2495
+ });
2496
+ const body = chipGroup.tv({
2497
+ base: [
2498
+ "flex flex-col flex-1 min-h-0",
2499
+ "overflow-auto scrollbar-thin"
2500
+ ]
2501
+ });
2502
+ const bodyInner = chipGroup.tv({
2503
+ base: [
2504
+ "flex flex-col flex-1 min-h-0 w-full mx-auto",
2505
+ "gap-gp-4xl p-pad-6xl"
2506
+ ],
2507
+ variants: {
2508
+ layout: {
2509
+ fluid: "max-w-full",
2510
+ compact: "max-w-[var(--container-main-content-max)]"
2511
+ },
2512
+ /**
2513
+ * Em mobile (<md):
2514
+ * - `false` (default): padding reduzido pra 18px (telas pequenas
2515
+ * precisam respiro mínimo).
2516
+ * - `true`: padding zero — útil pra patterns "app feel" (chat,
2517
+ * navegação por overlays fullscreen) onde a page controla o
2518
+ * próprio padding interno.
2519
+ */
2520
+ mobileEdgeToEdge: {
2521
+ true: "max-md:p-0",
2522
+ false: "max-md:p-[18px]"
2523
+ }
2524
+ },
2525
+ defaultVariants: {
2526
+ layout: "fluid",
2527
+ mobileEdgeToEdge: false
2528
+ }
2529
+ });
2530
+ function AppShell({
2531
+ // Sidebar
2532
+ contexts,
2533
+ defaultActiveContextId,
2534
+ activeContextId,
2535
+ onContextChange,
2536
+ defaultActiveItemHref,
2537
+ activeItemHref,
2538
+ onItemClick,
2539
+ // Header
2540
+ breadcrumb,
2541
+ commandGroups,
2542
+ commandPlaceholder,
2543
+ commandEmptyMessage,
2544
+ searchPlaceholder,
2545
+ notifications,
2546
+ messages,
2547
+ theme,
2548
+ onThemeChange,
2549
+ themeOptions,
2550
+ headerRightSlot,
2551
+ // User menu
2552
+ user,
2553
+ layout,
2554
+ onLayoutChange,
2555
+ layoutOptions,
2556
+ onSettings,
2557
+ onLogout,
2558
+ // Menu collapse (controlled/uncontrolled)
2559
+ menuCollapsed: controlledCollapsed,
2560
+ defaultMenuCollapsed = false,
2561
+ onMenuCollapseChange,
2562
+ // Body
2563
+ children,
2564
+ bodyClassName,
2565
+ mobileEdgeToEdge,
2566
+ className
2567
+ }) {
2568
+ const [internalCollapsed, setInternalCollapsed] = React.useState(defaultMenuCollapsed);
2569
+ const menuCollapsed = controlledCollapsed ?? internalCollapsed;
2570
+ const toggleMenuCollapsed = React.useCallback(() => {
2571
+ const next = !menuCollapsed;
2572
+ if (controlledCollapsed === void 0) setInternalCollapsed(next);
2573
+ onMenuCollapseChange?.(next);
2574
+ }, [menuCollapsed, controlledCollapsed, onMenuCollapseChange]);
2575
+ const userNode = user ? /* @__PURE__ */ jsxRuntime.jsx(
2576
+ UserMenu,
2577
+ {
2578
+ user,
2579
+ layout,
2580
+ onLayoutChange,
2581
+ layoutOptions,
2582
+ theme,
2583
+ onThemeChange,
2584
+ themeOptions,
2585
+ onSettings,
2586
+ onLogout
2587
+ }
2588
+ ) : void 0;
2589
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chipGroup.cn(root(), className), children: [
2590
+ /* @__PURE__ */ jsxRuntime.jsx(
2591
+ MenuSidebar,
2592
+ {
2593
+ contexts,
2594
+ activeContextId,
2595
+ defaultActiveContextId,
2596
+ onContextChange,
2597
+ activeItemHref,
2598
+ defaultActiveItemHref,
2599
+ onItemClick,
2600
+ user: userNode,
2601
+ panelCollapsed: menuCollapsed,
2602
+ onPanelCollapseChange: (next) => {
2603
+ if (controlledCollapsed === void 0) setInternalCollapsed(next);
2604
+ onMenuCollapseChange?.(next);
2605
+ }
2606
+ }
2607
+ ),
2608
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: main(), children: [
2609
+ /* @__PURE__ */ jsxRuntime.jsx(
2610
+ Header,
2611
+ {
2612
+ breadcrumb,
2613
+ onCollapseMenu: toggleMenuCollapsed,
2614
+ menuCollapsed,
2615
+ commandGroups,
2616
+ commandPlaceholder,
2617
+ commandEmptyMessage,
2618
+ searchPlaceholder,
2619
+ notifications,
2620
+ messages,
2621
+ theme,
2622
+ onThemeChange,
2623
+ themeOptions,
2624
+ rightSlot: headerRightSlot
2625
+ }
2626
+ ),
2627
+ /* @__PURE__ */ jsxRuntime.jsx("main", { className: chipGroup.cn(body(), bodyClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
2628
+ "div",
2629
+ {
2630
+ className: bodyInner({
2631
+ layout: layout === "compact" ? "compact" : "fluid",
2632
+ mobileEdgeToEdge: mobileEdgeToEdge ?? false
2633
+ }),
2634
+ children
2635
+ }
2636
+ ) })
2637
+ ] })
2638
+ ] });
2639
+ }
2640
+ AppShell.displayName = "AppShell";
2641
+ exports.AppShell = AppShell;
2642
+ exports.Avatar = Avatar;
2643
+ exports.AvatarFallback = AvatarFallback;
2644
+ exports.Dialog = Dialog;
2645
+ exports.DialogClose = DialogClose;
2646
+ exports.DialogContent = DialogContent;
2647
+ exports.DialogTitle = DialogTitle;
2648
+ exports.DialogTrigger = DialogTrigger;
2649
+ exports.DropdownMenu = DropdownMenu;
2650
+ exports.DropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
2651
+ exports.DropdownMenuContent = DropdownMenuContent;
2652
+ exports.DropdownMenuItem = DropdownMenuItem;
2653
+ exports.DropdownMenuLabel = DropdownMenuLabel;
2654
+ exports.DropdownMenuRadioGroup = DropdownMenuRadioGroup;
2655
+ exports.DropdownMenuRadioItem = DropdownMenuRadioItem;
2656
+ exports.DropdownMenuSeparator = DropdownMenuSeparator;
2657
+ exports.DropdownMenuTrigger = DropdownMenuTrigger;
2658
+ exports.Header = Header;
2659
+ exports.HeaderBreadcrumb = HeaderBreadcrumb;
2660
+ exports.HeaderMessages = HeaderMessages;
2661
+ exports.HeaderNotifications = HeaderNotifications;
2662
+ exports.HeaderSearch = HeaderSearch;
2663
+ exports.HeaderThemeSwitcher = HeaderThemeSwitcher;
2664
+ exports.InputGroup = InputGroup;
2665
+ exports.InputGroupAddon = InputGroupAddon;
2666
+ exports.InputGroupButton = InputGroupButton;
2667
+ exports.InputGroupInput = InputGroupInput;
2668
+ exports.InputGroupText = InputGroupText;
2669
+ exports.InputGroupTextarea = InputGroupTextarea;
2670
+ exports.MenuSidebar = MenuSidebar;
2671
+ exports.SidebarBrandIcon = SidebarBrandIcon;
2672
+ exports.SidebarItem = SidebarItem;
2673
+ exports.SidebarPanel = SidebarPanel;
2674
+ exports.SidebarPill = SidebarPill;
2675
+ exports.SidebarRail = SidebarRail;
2676
+ exports.SidebarSection = SidebarSection;
2677
+ exports.SidebarSubgroup = SidebarSubgroup;
2678
+ exports.UserMenu = UserMenu;
2679
+ exports.useControllable = useControllable;
2680
+ exports.useMediaQuery = useMediaQuery;
2681
+ //# sourceMappingURL=app-shell-BNTvOETJ.mjs.map