analytica-frontend-lib 1.0.36 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DropdownMenu/index.d.mts +16 -8
- package/dist/DropdownMenu/index.d.ts +16 -8
- package/dist/DropdownMenu/index.js +122 -45
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +122 -45
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/ProgressCircle/index.d.mts +60 -0
- package/dist/ProgressCircle/index.d.ts +60 -0
- package/dist/ProgressCircle/index.js +244 -0
- package/dist/ProgressCircle/index.js.map +1 -0
- package/dist/ProgressCircle/index.mjs +222 -0
- package/dist/ProgressCircle/index.mjs.map +1 -0
- package/dist/Select/index.d.mts +51 -0
- package/dist/Select/index.d.ts +51 -0
- package/dist/Select/index.js +323 -0
- package/dist/Select/index.js.map +1 -0
- package/dist/Select/index.mjs +300 -0
- package/dist/Select/index.mjs.map +1 -0
- package/dist/index.css +181 -9
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +4 -44
- package/dist/index.d.ts +4 -44
- package/dist/index.js +248 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +247 -62
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +181 -9
- package/dist/styles.css.map +1 -1
- package/package.json +2 -1
|
@@ -12,7 +12,67 @@ import {
|
|
|
12
12
|
useState
|
|
13
13
|
} from "react";
|
|
14
14
|
import { create, useStore } from "zustand";
|
|
15
|
+
|
|
16
|
+
// src/components/Button/Button.tsx
|
|
15
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var VARIANT_ACTION_CLASSES = {
|
|
19
|
+
solid: {
|
|
20
|
+
primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
21
|
+
positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
22
|
+
negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
23
|
+
},
|
|
24
|
+
outline: {
|
|
25
|
+
primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
26
|
+
positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
27
|
+
negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
28
|
+
},
|
|
29
|
+
link: {
|
|
30
|
+
primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
31
|
+
positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
32
|
+
negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var SIZE_CLASSES = {
|
|
36
|
+
"extra-small": "text-xs px-3.5 py-2",
|
|
37
|
+
small: "text-sm px-4 py-2.5",
|
|
38
|
+
medium: "text-md px-5 py-2.5",
|
|
39
|
+
large: "text-lg px-6 py-3",
|
|
40
|
+
"extra-large": "text-lg px-7 py-3.5"
|
|
41
|
+
};
|
|
42
|
+
var Button = ({
|
|
43
|
+
children,
|
|
44
|
+
iconLeft,
|
|
45
|
+
iconRight,
|
|
46
|
+
size = "medium",
|
|
47
|
+
variant = "solid",
|
|
48
|
+
action = "primary",
|
|
49
|
+
className = "",
|
|
50
|
+
disabled,
|
|
51
|
+
type = "button",
|
|
52
|
+
...props
|
|
53
|
+
}) => {
|
|
54
|
+
const sizeClasses = SIZE_CLASSES[size];
|
|
55
|
+
const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
|
|
56
|
+
const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
|
|
57
|
+
return /* @__PURE__ */ jsxs(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
className: `${baseClasses} ${variantClasses} ${sizeClasses} ${className}`,
|
|
61
|
+
disabled,
|
|
62
|
+
type,
|
|
63
|
+
...props,
|
|
64
|
+
children: [
|
|
65
|
+
iconLeft && /* @__PURE__ */ jsx("span", { className: "mr-2 flex items-center", children: iconLeft }),
|
|
66
|
+
children,
|
|
67
|
+
iconRight && /* @__PURE__ */ jsx("span", { className: "ml-2 flex items-center", children: iconRight })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
var Button_default = Button;
|
|
73
|
+
|
|
74
|
+
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
75
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
16
76
|
function createDropdownStore() {
|
|
17
77
|
return create((set) => ({
|
|
18
78
|
open: false,
|
|
@@ -103,28 +163,34 @@ var DropdownMenu = ({ children, open, onOpenChange }) => {
|
|
|
103
163
|
store.setState({ open });
|
|
104
164
|
}
|
|
105
165
|
}, []);
|
|
106
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ jsx2("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
|
|
107
167
|
};
|
|
108
|
-
var DropdownMenuTrigger =
|
|
168
|
+
var DropdownMenuTrigger = ({
|
|
169
|
+
className,
|
|
170
|
+
children,
|
|
171
|
+
onClick,
|
|
172
|
+
store: externalStore,
|
|
173
|
+
...props
|
|
174
|
+
}) => {
|
|
109
175
|
const store = useDropdownStore(externalStore);
|
|
110
176
|
const open = useStore(store, (s) => s.open);
|
|
111
177
|
const toggleOpen = () => store.setState({ open: !open });
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
|
|
178
|
+
return /* @__PURE__ */ jsx2(
|
|
179
|
+
Button_default,
|
|
114
180
|
{
|
|
115
|
-
|
|
116
|
-
className: `border border-border-200 cursor-pointer bg-background-muted hover:bg-background-200 transition-colors px-4 py-2 rounded-sm ${className}`,
|
|
181
|
+
variant: "outline",
|
|
117
182
|
onClick: (e) => {
|
|
118
183
|
e.stopPropagation();
|
|
119
184
|
toggleOpen();
|
|
120
185
|
if (onClick) onClick(e);
|
|
121
186
|
},
|
|
122
187
|
"aria-expanded": open,
|
|
188
|
+
className: `${className}`,
|
|
123
189
|
...props,
|
|
124
190
|
children
|
|
125
191
|
}
|
|
126
192
|
);
|
|
127
|
-
}
|
|
193
|
+
};
|
|
128
194
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
129
195
|
var ITEM_SIZE_CLASSES = {
|
|
130
196
|
small: "text-sm",
|
|
@@ -141,8 +207,12 @@ var ALIGN_CLASSES = {
|
|
|
141
207
|
center: "left-1/2 -translate-x-1/2",
|
|
142
208
|
end: "right-0"
|
|
143
209
|
};
|
|
210
|
+
var MENUCONTENT_VARIANT_CLASSES = {
|
|
211
|
+
menu: "p-1",
|
|
212
|
+
profile: "p-6"
|
|
213
|
+
};
|
|
144
214
|
var MenuLabel = forwardRef(({ className, inset, store: _store, ...props }, ref) => {
|
|
145
|
-
return /* @__PURE__ */
|
|
215
|
+
return /* @__PURE__ */ jsx2(
|
|
146
216
|
"div",
|
|
147
217
|
{
|
|
148
218
|
ref,
|
|
@@ -157,6 +227,7 @@ var MenuContent = forwardRef(
|
|
|
157
227
|
className,
|
|
158
228
|
align = "start",
|
|
159
229
|
side = "bottom",
|
|
230
|
+
variant = "menu",
|
|
160
231
|
sideOffset = 4,
|
|
161
232
|
children,
|
|
162
233
|
store: externalStore,
|
|
@@ -179,15 +250,17 @@ var MenuContent = forwardRef(
|
|
|
179
250
|
const horizontal = ALIGN_CLASSES[align];
|
|
180
251
|
return `absolute ${vertical} ${horizontal}`;
|
|
181
252
|
};
|
|
182
|
-
|
|
253
|
+
const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
|
|
254
|
+
return /* @__PURE__ */ jsx2(
|
|
183
255
|
"div",
|
|
184
256
|
{
|
|
185
257
|
ref,
|
|
186
258
|
role: "menu",
|
|
187
259
|
className: `
|
|
188
|
-
bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover
|
|
260
|
+
bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md border-border-100
|
|
189
261
|
${open ? "animate-in fade-in-0 zoom-in-95" : "animate-out fade-out-0 zoom-out-95"}
|
|
190
262
|
${getPositionClasses()}
|
|
263
|
+
${variantClasses}
|
|
191
264
|
${className}
|
|
192
265
|
`,
|
|
193
266
|
style: {
|
|
@@ -230,14 +303,14 @@ var MenuItem = forwardRef(
|
|
|
230
303
|
};
|
|
231
304
|
const getVariantClasses = () => {
|
|
232
305
|
if (variant === "profile") {
|
|
233
|
-
return "relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-
|
|
306
|
+
return "relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-4 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0";
|
|
234
307
|
}
|
|
235
308
|
return "relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0";
|
|
236
309
|
};
|
|
237
310
|
const getVariantProps = () => {
|
|
238
311
|
return variant === "profile" ? { "data-variant": "profile" } : {};
|
|
239
312
|
};
|
|
240
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ jsxs2(
|
|
241
314
|
"div",
|
|
242
315
|
{
|
|
243
316
|
ref,
|
|
@@ -259,7 +332,7 @@ var MenuItem = forwardRef(
|
|
|
259
332
|
...props,
|
|
260
333
|
children: [
|
|
261
334
|
iconLeft,
|
|
262
|
-
children,
|
|
335
|
+
/* @__PURE__ */ jsx2("span", { className: "w-full text-md", children }),
|
|
263
336
|
iconRight
|
|
264
337
|
]
|
|
265
338
|
}
|
|
@@ -267,7 +340,7 @@ var MenuItem = forwardRef(
|
|
|
267
340
|
}
|
|
268
341
|
);
|
|
269
342
|
MenuItem.displayName = "MenuItem";
|
|
270
|
-
var MenuSeparator = forwardRef(({ className, store: _store, ...props }, ref) => /* @__PURE__ */
|
|
343
|
+
var MenuSeparator = forwardRef(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
271
344
|
"div",
|
|
272
345
|
{
|
|
273
346
|
ref,
|
|
@@ -280,7 +353,7 @@ var ProfileMenuTrigger = forwardRef(({ className, onClick, store: externalStore,
|
|
|
280
353
|
const store = useDropdownStore(externalStore);
|
|
281
354
|
const open = useStore(store, (s) => s.open);
|
|
282
355
|
const toggleOpen = () => store.setState({ open: !open });
|
|
283
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ jsx2(
|
|
284
357
|
"button",
|
|
285
358
|
{
|
|
286
359
|
ref,
|
|
@@ -292,13 +365,13 @@ var ProfileMenuTrigger = forwardRef(({ className, onClick, store: externalStore,
|
|
|
292
365
|
},
|
|
293
366
|
"aria-expanded": open,
|
|
294
367
|
...props,
|
|
295
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ jsx2("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ jsx2(User, { className: "text-background-950", size: 18 }) })
|
|
296
369
|
}
|
|
297
370
|
);
|
|
298
371
|
});
|
|
299
372
|
ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
|
|
300
373
|
var ProfileMenuHeader = forwardRef(({ className, name, email, store: _store, ...props }, ref) => {
|
|
301
|
-
return /* @__PURE__ */
|
|
374
|
+
return /* @__PURE__ */ jsxs2(
|
|
302
375
|
"div",
|
|
303
376
|
{
|
|
304
377
|
ref,
|
|
@@ -309,10 +382,10 @@ var ProfileMenuHeader = forwardRef(({ className, name, email, store: _store, ...
|
|
|
309
382
|
`,
|
|
310
383
|
...props,
|
|
311
384
|
children: [
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ jsx2("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx2(User, { size: 34, className: "text-background-950" }) }),
|
|
386
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col ", children: [
|
|
387
|
+
/* @__PURE__ */ jsx2("p", { className: "text-xl font-bold text-text-950", children: name }),
|
|
388
|
+
/* @__PURE__ */ jsx2("p", { className: "text-md text-text-600", children: email })
|
|
316
389
|
] })
|
|
317
390
|
]
|
|
318
391
|
}
|
|
@@ -320,7 +393,7 @@ var ProfileMenuHeader = forwardRef(({ className, name, email, store: _store, ...
|
|
|
320
393
|
});
|
|
321
394
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
322
395
|
var ProfileMenuSection = forwardRef(({ className, children, store: _store, ...props }, ref) => {
|
|
323
|
-
return /* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ jsx2(
|
|
324
397
|
"div",
|
|
325
398
|
{
|
|
326
399
|
ref,
|
|
@@ -334,29 +407,33 @@ var ProfileMenuSection = forwardRef(({ className, children, store: _store, ...pr
|
|
|
334
407
|
);
|
|
335
408
|
});
|
|
336
409
|
ProfileMenuSection.displayName = "ProfileMenuSection";
|
|
337
|
-
var ProfileMenuFooter =
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
)
|
|
410
|
+
var ProfileMenuFooter = ({
|
|
411
|
+
className,
|
|
412
|
+
disabled = false,
|
|
413
|
+
onClick,
|
|
414
|
+
store: externalStore,
|
|
415
|
+
...props
|
|
416
|
+
}) => {
|
|
417
|
+
const store = useDropdownStore(externalStore);
|
|
418
|
+
const setOpen = useStore(store, (s) => s.setOpen);
|
|
419
|
+
return /* @__PURE__ */ jsxs2(
|
|
420
|
+
Button_default,
|
|
421
|
+
{
|
|
422
|
+
variant: "outline",
|
|
423
|
+
className: `w-full ${className}`,
|
|
424
|
+
disabled,
|
|
425
|
+
onClick: (e) => {
|
|
426
|
+
setOpen(false);
|
|
427
|
+
onClick?.(e);
|
|
428
|
+
},
|
|
429
|
+
...props,
|
|
430
|
+
children: [
|
|
431
|
+
/* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx2(SignOut, {}) }),
|
|
432
|
+
/* @__PURE__ */ jsx2("span", { children: "Sair" })
|
|
433
|
+
]
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
};
|
|
360
437
|
ProfileMenuFooter.displayName = "ProfileMenuFooter";
|
|
361
438
|
var DropdownMenu_default = DropdownMenu;
|
|
362
439
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["'use client';\n\nimport { SignOut, User } from 'phosphor-react';\nimport {\n forwardRef,\n ReactNode,\n ButtonHTMLAttributes,\n useEffect,\n useRef,\n HTMLAttributes,\n MouseEvent,\n KeyboardEvent,\n isValidElement,\n Children,\n cloneElement,\n ReactElement,\n useState,\n} from 'react';\nimport { create, StoreApi, useStore } from 'zustand';\n\ninterface DropdownStore {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\ntype DropdownStoreApi = StoreApi<DropdownStore>;\n\nexport function createDropdownStore(): DropdownStoreApi {\n return create<DropdownStore>((set) => ({\n open: false,\n setOpen: (open) => set({ open }),\n }));\n}\n\nexport const useDropdownStore = (externalStore?: DropdownStoreApi) => {\n if (!externalStore) {\n throw new Error(\n 'Component must be used within a DropdownMenu (store is missing)'\n );\n }\n\n return externalStore;\n};\n\nconst injectStore = (\n children: ReactNode,\n store: DropdownStoreApi\n): ReactNode => {\n return Children.map(children, (child) => {\n if (isValidElement(child)) {\n const typedChild = child as ReactElement<{\n store?: DropdownStoreApi;\n children?: ReactNode;\n }>;\n\n const newProps: Partial<{\n store: DropdownStoreApi;\n children: ReactNode;\n }> = {\n store,\n };\n\n if (typedChild.props.children) {\n newProps.children = injectStore(typedChild.props.children, store);\n }\n\n return cloneElement(typedChild, newProps);\n }\n return child;\n });\n};\n\ninterface DropdownMenuProps {\n children: ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenu = ({ children, open, onOpenChange }: DropdownMenuProps) => {\n const storeRef = useRef<DropdownStoreApi | null>(null);\n storeRef.current ??= createDropdownStore();\n const store = storeRef.current;\n const isControlled = open !== undefined;\n const uncontrolledOpen = useStore(store, (s) => s.open);\n const currentOpen = isControlled ? open : uncontrolledOpen;\n\n const setOpen = (newOpen: boolean) => {\n onOpenChange?.(newOpen);\n if (!isControlled) store.setState({ open: newOpen });\n };\n\n const menuRef = useRef<HTMLDivElement | null>(null);\n\n const handleArrowDownOrArrowUp = (event: globalThis.KeyboardEvent) => {\n const menuContent = menuRef.current?.querySelector('[role=\"menu\"]');\n if (menuContent) {\n event.preventDefault();\n\n const items = Array.from(\n menuContent.querySelectorAll(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ).filter((el): el is HTMLElement => el instanceof HTMLElement);\n\n if (items.length === 0) return;\n\n const focusedItem = document.activeElement as HTMLElement;\n const currentIndex = items.findIndex((item) => item === focusedItem);\n\n let nextIndex;\n if (event.key === 'ArrowDown') {\n nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n } else {\n // ArrowUp\n nextIndex =\n currentIndex === -1\n ? items.length - 1\n : (currentIndex - 1 + items.length) % items.length;\n }\n\n items[nextIndex]?.focus();\n }\n };\n\n const handleDownkey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n handleArrowDownOrArrowUp(event);\n }\n };\n\n const handleClickOutside = (event: globalThis.MouseEvent) => {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n\n useEffect(() => {\n onOpenChange?.(currentOpen);\n if (currentOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleDownkey);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleDownkey);\n };\n }, [currentOpen]);\n\n useEffect(() => {\n if (isControlled) {\n store.setState({ open: open });\n }\n }, []);\n\n return (\n <div className=\"relative\" ref={menuRef}>\n {injectStore(children, store)}\n </div>\n );\n};\n\n// Componentes genéricos do DropdownMenu\nconst DropdownMenuTrigger = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { store?: DropdownStoreApi }\n>(({ className, children, onClick, store: externalStore, ...props }, ref) => {\n const store = useDropdownStore(externalStore);\n\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <button\n ref={ref}\n className={`border border-border-200 cursor-pointer bg-background-muted hover:bg-background-200 transition-colors px-4 py-2 rounded-sm ${className}`}\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n if (onClick) onClick(e);\n }}\n aria-expanded={open}\n {...props}\n >\n {children}\n </button>\n );\n});\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nconst ITEM_SIZE_CLASSES = {\n small: 'text-sm',\n medium: 'text-md',\n} as const;\n\nconst SIDE_CLASSES = {\n top: 'bottom-full',\n right: 'top-full',\n bottom: 'top-full',\n left: 'top-full',\n};\n\nconst ALIGN_CLASSES = {\n start: 'left-0',\n center: 'left-1/2 -translate-x-1/2',\n end: 'right-0',\n};\n\nconst MenuLabel = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n store?: DropdownStoreApi;\n }\n>(({ className, inset, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`text-sm w-full ${inset ? 'pl-8' : ''} ${className ?? ''}`}\n {...props}\n />\n );\n});\nMenuLabel.displayName = 'MenuLabel';\n\nconst MenuContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n align?: 'start' | 'center' | 'end';\n side?: 'top' | 'right' | 'bottom' | 'left';\n sideOffset?: number;\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n align = 'start',\n side = 'bottom',\n sideOffset = 4,\n children,\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const [isVisible, setIsVisible] = useState(open);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n } else {\n const timer = setTimeout(() => setIsVisible(false), 200);\n return () => clearTimeout(timer);\n }\n }, [open]);\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const vertical = SIDE_CLASSES[side];\n const horizontal = ALIGN_CLASSES[align];\n\n return `absolute ${vertical} ${horizontal}`;\n };\n\n return (\n <div\n ref={ref}\n role=\"menu\"\n className={`\n bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md border-border-100\n ${open ? 'animate-in fade-in-0 zoom-in-95' : 'animate-out fade-out-0 zoom-out-95'}\n ${getPositionClasses()}\n ${className}\n `}\n style={{\n marginTop: side === 'bottom' ? sideOffset : undefined,\n marginBottom: side === 'top' ? sideOffset : undefined,\n marginLeft: side === 'right' ? sideOffset : undefined,\n marginRight: side === 'left' ? sideOffset : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nMenuContent.displayName = 'MenuContent';\n\nconst MenuItem = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n size?: 'small' | 'medium';\n iconLeft?: ReactNode;\n iconRight?: ReactNode;\n disabled?: boolean;\n variant?: 'profile' | 'menu';\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n size = 'small',\n children,\n iconRight,\n iconLeft,\n disabled = false,\n onClick,\n variant = 'menu',\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n const sizeClasses = ITEM_SIZE_CLASSES[size];\n\n const handleClick = (\n e: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>\n ) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n onClick?.(e as MouseEvent<HTMLDivElement>);\n setOpen(false);\n };\n\n const getVariantClasses = () => {\n if (variant === 'profile') {\n return 'relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0';\n }\n return 'relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0';\n };\n\n const getVariantProps = () => {\n return variant === 'profile' ? { 'data-variant': 'profile' } : {};\n };\n\n return (\n <div\n ref={ref}\n role=\"menuitem\"\n {...getVariantProps()}\n aria-disabled={disabled}\n className={`\n focus-visible:bg-background-50\n ${getVariantClasses()}\n ${sizeClasses}\n ${className}\n ${\n disabled\n ? 'cursor-not-allowed text-text-400'\n : 'cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground'\n }\n `}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick(e);\n }}\n tabIndex={disabled ? -1 : 0}\n {...props}\n >\n {iconLeft}\n {children}\n {iconRight}\n </div>\n );\n }\n);\nMenuItem.displayName = 'MenuItem';\n\nconst MenuSeparator = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, store: _store, ...props }, ref) => (\n <div\n ref={ref}\n className={`my-1 h-px bg-border-200 ${className}`}\n {...props}\n />\n));\nMenuSeparator.displayName = 'MenuSeparator';\n\n// Componentes específicos do ProfileMenu\nconst ProfileMenuTrigger = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { store?: DropdownStoreApi }\n>(({ className, onClick, store: externalStore, ...props }, ref) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <button\n ref={ref}\n className={`rounded-lg size-10 bg-background-50 flex items-center justify-center ${className}`}\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n onClick?.(e);\n }}\n aria-expanded={open}\n {...props}\n >\n <span className=\"size-6 rounded-full bg-background-100 flex items-center justify-center\">\n <User className=\"text-background-950\" size={18} />\n </span>\n </button>\n );\n});\nProfileMenuTrigger.displayName = 'ProfileMenuTrigger';\n\nconst ProfileMenuHeader = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n name: string;\n email: string;\n store?: DropdownStoreApi;\n }\n>(({ className, name, email, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-component=\"ProfileMenuHeader\"\n className={`\n flex flex-row gap-4 items-center\n ${className}\n `}\n {...props}\n >\n <span className=\"size-16 bg-background-100 rounded-full flex items-center justify-center\">\n <User size={34} className=\"text-background-950\" />\n </span>\n <div className=\"flex flex-col \">\n <p className=\"text-xl font-bold text-text-950\">{name}</p>\n <p className=\"text-md text-text-600\">{email}</p>\n </div>\n </div>\n );\n});\nProfileMenuHeader.displayName = 'ProfileMenuHeader';\n\nconst ProfileMenuSection = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, children, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`\n flex flex-col p-2\n ${className}\n `}\n {...props}\n >\n {children}\n </div>\n );\n});\nProfileMenuSection.displayName = 'ProfileMenuSection';\n\nconst ProfileMenuFooter = forwardRef<\n HTMLButtonElement,\n HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n }\n>(\n (\n { className, disabled = false, onClick, store: externalStore, ...props },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n\n return (\n <button\n ref={ref}\n className={`inline-flex items-center justify-center rounded-full cursor-pointer font-medium text-md px-5 py-2.5 w-full bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed ${className}`}\n disabled={disabled}\n onClick={(e) => {\n setOpen(false);\n onClick?.(e);\n }}\n {...props}\n >\n <span className=\"mr-2 flex items-center\">\n <SignOut />\n </span>\n <span>Sair</span>\n </button>\n );\n }\n);\nProfileMenuFooter.displayName = 'ProfileMenuFooter';\n\n// Exportações\nexport default DropdownMenu;\nexport {\n // Componentes genéricos\n DropdownMenuTrigger,\n MenuContent,\n MenuItem,\n MenuLabel,\n MenuSeparator,\n\n // Componentes específicos do ProfileMenu\n ProfileMenuTrigger,\n ProfileMenuHeader,\n ProfileMenuSection,\n ProfileMenuFooter,\n};\n"],"mappings":";;;AAEA,SAAS,SAAS,YAAY;AAC9B;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,QAAkB,gBAAgB;AA4IvC,cAgME,YAhMF;AAnIG,SAAS,sBAAwC;AACtD,SAAO,OAAsB,CAAC,SAAS;AAAA,IACrC,MAAM;AAAA,IACN,SAAS,CAAC,SAAS,IAAI,EAAE,KAAK,CAAC;AAAA,EACjC,EAAE;AACJ;AAEO,IAAM,mBAAmB,CAAC,kBAAqC;AACpE,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEA,IAAM,cAAc,CAClB,UACA,UACc;AACd,SAAO,SAAS,IAAI,UAAU,CAAC,UAAU;AACvC,QAAI,eAAe,KAAK,GAAG;AACzB,YAAM,aAAa;AAKnB,YAAM,WAGD;AAAA,QACH;AAAA,MACF;AAEA,UAAI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'use client';\n\nimport { SignOut, User } from 'phosphor-react';\nimport {\n forwardRef,\n ReactNode,\n ButtonHTMLAttributes,\n useEffect,\n useRef,\n HTMLAttributes,\n MouseEvent,\n KeyboardEvent,\n isValidElement,\n Children,\n cloneElement,\n ReactElement,\n useState,\n} from 'react';\nimport { create, StoreApi, useStore } from 'zustand';\nimport Button from '../Button/Button';\n\ninterface DropdownStore {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\ntype DropdownStoreApi = StoreApi<DropdownStore>;\n\nexport function createDropdownStore(): DropdownStoreApi {\n return create<DropdownStore>((set) => ({\n open: false,\n setOpen: (open) => set({ open }),\n }));\n}\n\nexport const useDropdownStore = (externalStore?: DropdownStoreApi) => {\n if (!externalStore) {\n throw new Error(\n 'Component must be used within a DropdownMenu (store is missing)'\n );\n }\n\n return externalStore;\n};\n\nconst injectStore = (\n children: ReactNode,\n store: DropdownStoreApi\n): ReactNode => {\n return Children.map(children, (child) => {\n if (isValidElement(child)) {\n const typedChild = child as ReactElement<{\n store?: DropdownStoreApi;\n children?: ReactNode;\n }>;\n\n const newProps: Partial<{\n store: DropdownStoreApi;\n children: ReactNode;\n }> = {\n store,\n };\n\n if (typedChild.props.children) {\n newProps.children = injectStore(typedChild.props.children, store);\n }\n\n return cloneElement(typedChild, newProps);\n }\n return child;\n });\n};\n\ninterface DropdownMenuProps {\n children: ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nconst DropdownMenu = ({ children, open, onOpenChange }: DropdownMenuProps) => {\n const storeRef = useRef<DropdownStoreApi | null>(null);\n storeRef.current ??= createDropdownStore();\n const store = storeRef.current;\n const isControlled = open !== undefined;\n const uncontrolledOpen = useStore(store, (s) => s.open);\n const currentOpen = isControlled ? open : uncontrolledOpen;\n\n const setOpen = (newOpen: boolean) => {\n onOpenChange?.(newOpen);\n if (!isControlled) store.setState({ open: newOpen });\n };\n\n const menuRef = useRef<HTMLDivElement | null>(null);\n\n const handleArrowDownOrArrowUp = (event: globalThis.KeyboardEvent) => {\n const menuContent = menuRef.current?.querySelector('[role=\"menu\"]');\n if (menuContent) {\n event.preventDefault();\n\n const items = Array.from(\n menuContent.querySelectorAll(\n '[role=\"menuitem\"]:not([aria-disabled=\"true\"])'\n )\n ).filter((el): el is HTMLElement => el instanceof HTMLElement);\n\n if (items.length === 0) return;\n\n const focusedItem = document.activeElement as HTMLElement;\n const currentIndex = items.findIndex((item) => item === focusedItem);\n\n let nextIndex;\n if (event.key === 'ArrowDown') {\n nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n } else {\n // ArrowUp\n nextIndex =\n currentIndex === -1\n ? items.length - 1\n : (currentIndex - 1 + items.length) % items.length;\n }\n\n items[nextIndex]?.focus();\n }\n };\n\n const handleDownkey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape') {\n setOpen(false);\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n handleArrowDownOrArrowUp(event);\n }\n };\n\n const handleClickOutside = (event: globalThis.MouseEvent) => {\n if (menuRef.current && !menuRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n\n useEffect(() => {\n onOpenChange?.(currentOpen);\n if (currentOpen) {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', handleDownkey);\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', handleDownkey);\n };\n }, [currentOpen]);\n\n useEffect(() => {\n if (isControlled) {\n store.setState({ open: open });\n }\n }, []);\n\n return (\n <div className=\"relative\" ref={menuRef}>\n {injectStore(children, store)}\n </div>\n );\n};\n\n// Componentes genéricos do DropdownMenu\nconst DropdownMenuTrigger = ({\n className,\n children,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <Button\n variant=\"outline\"\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n if (onClick) onClick(e);\n }}\n aria-expanded={open}\n className={`${className}`}\n {...props}\n >\n {children}\n </Button>\n );\n};\nDropdownMenuTrigger.displayName = 'DropdownMenuTrigger';\n\nconst ITEM_SIZE_CLASSES = {\n small: 'text-sm',\n medium: 'text-md',\n} as const;\n\nconst SIDE_CLASSES = {\n top: 'bottom-full',\n right: 'top-full',\n bottom: 'top-full',\n left: 'top-full',\n};\n\nconst ALIGN_CLASSES = {\n start: 'left-0',\n center: 'left-1/2 -translate-x-1/2',\n end: 'right-0',\n};\n\nconst MENUCONTENT_VARIANT_CLASSES = {\n menu: 'p-1',\n profile: 'p-6',\n};\n\nconst MenuLabel = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n store?: DropdownStoreApi;\n }\n>(({ className, inset, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`text-sm w-full ${inset ? 'pl-8' : ''} ${className ?? ''}`}\n {...props}\n />\n );\n});\nMenuLabel.displayName = 'MenuLabel';\n\nconst MenuContent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n align?: 'start' | 'center' | 'end';\n side?: 'top' | 'right' | 'bottom' | 'left';\n variant?: 'menu' | 'profile';\n sideOffset?: number;\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n align = 'start',\n side = 'bottom',\n variant = 'menu',\n sideOffset = 4,\n children,\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const [isVisible, setIsVisible] = useState(open);\n\n useEffect(() => {\n if (open) {\n setIsVisible(true);\n } else {\n const timer = setTimeout(() => setIsVisible(false), 200);\n return () => clearTimeout(timer);\n }\n }, [open]);\n\n if (!isVisible) return null;\n\n const getPositionClasses = () => {\n const vertical = SIDE_CLASSES[side];\n const horizontal = ALIGN_CLASSES[align];\n\n return `absolute ${vertical} ${horizontal}`;\n };\n\n const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];\n return (\n <div\n ref={ref}\n role=\"menu\"\n className={`\n bg-background z-50 min-w-[210px] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md border-border-100\n ${open ? 'animate-in fade-in-0 zoom-in-95' : 'animate-out fade-out-0 zoom-out-95'}\n ${getPositionClasses()}\n ${variantClasses}\n ${className}\n `}\n style={{\n marginTop: side === 'bottom' ? sideOffset : undefined,\n marginBottom: side === 'top' ? sideOffset : undefined,\n marginLeft: side === 'right' ? sideOffset : undefined,\n marginRight: side === 'left' ? sideOffset : undefined,\n }}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nMenuContent.displayName = 'MenuContent';\n\nconst MenuItem = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n inset?: boolean;\n size?: 'small' | 'medium';\n iconLeft?: ReactNode;\n iconRight?: ReactNode;\n disabled?: boolean;\n variant?: 'profile' | 'menu';\n store?: DropdownStoreApi;\n }\n>(\n (\n {\n className,\n size = 'small',\n children,\n iconRight,\n iconLeft,\n disabled = false,\n onClick,\n variant = 'menu',\n store: externalStore,\n ...props\n },\n ref\n ) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n const sizeClasses = ITEM_SIZE_CLASSES[size];\n\n const handleClick = (\n e: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>\n ) => {\n if (disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n onClick?.(e as MouseEvent<HTMLDivElement>);\n setOpen(false);\n };\n\n const getVariantClasses = () => {\n if (variant === 'profile') {\n return 'relative flex flex-row justify-between select-none items-center gap-2 rounded-sm p-4 text-sm outline-none transition-colors [&>svg]:size-6 [&>svg]:shrink-0';\n }\n return 'relative flex select-none items-center gap-2 rounded-sm p-3 text-sm outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0';\n };\n\n const getVariantProps = () => {\n return variant === 'profile' ? { 'data-variant': 'profile' } : {};\n };\n\n return (\n <div\n ref={ref}\n role=\"menuitem\"\n {...getVariantProps()}\n aria-disabled={disabled}\n className={`\n focus-visible:bg-background-50\n ${getVariantClasses()}\n ${sizeClasses}\n ${className}\n ${\n disabled\n ? 'cursor-not-allowed text-text-400'\n : 'cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground'\n }\n `}\n onClick={handleClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick(e);\n }}\n tabIndex={disabled ? -1 : 0}\n {...props}\n >\n {iconLeft}\n <span className=\"w-full text-md\">{children}</span>\n {iconRight}\n </div>\n );\n }\n);\nMenuItem.displayName = 'MenuItem';\n\nconst MenuSeparator = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, store: _store, ...props }, ref) => (\n <div\n ref={ref}\n className={`my-1 h-px bg-border-200 ${className}`}\n {...props}\n />\n));\nMenuSeparator.displayName = 'MenuSeparator';\n\n// Componentes específicos do ProfileMenu\nconst ProfileMenuTrigger = forwardRef<\n HTMLButtonElement,\n ButtonHTMLAttributes<HTMLButtonElement> & { store?: DropdownStoreApi }\n>(({ className, onClick, store: externalStore, ...props }, ref) => {\n const store = useDropdownStore(externalStore);\n const open = useStore(store, (s) => s.open);\n const toggleOpen = () => store.setState({ open: !open });\n\n return (\n <button\n ref={ref}\n className={`rounded-lg size-10 bg-background-50 flex items-center justify-center ${className}`}\n onClick={(e) => {\n e.stopPropagation();\n toggleOpen();\n onClick?.(e);\n }}\n aria-expanded={open}\n {...props}\n >\n <span className=\"size-6 rounded-full bg-background-100 flex items-center justify-center\">\n <User className=\"text-background-950\" size={18} />\n </span>\n </button>\n );\n});\nProfileMenuTrigger.displayName = 'ProfileMenuTrigger';\n\nconst ProfileMenuHeader = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & {\n name: string;\n email: string;\n store?: DropdownStoreApi;\n }\n>(({ className, name, email, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n data-component=\"ProfileMenuHeader\"\n className={`\n flex flex-row gap-4 items-center\n ${className}\n `}\n {...props}\n >\n <span className=\"size-16 bg-background-100 rounded-full flex items-center justify-center\">\n <User size={34} className=\"text-background-950\" />\n </span>\n <div className=\"flex flex-col \">\n <p className=\"text-xl font-bold text-text-950\">{name}</p>\n <p className=\"text-md text-text-600\">{email}</p>\n </div>\n </div>\n );\n});\nProfileMenuHeader.displayName = 'ProfileMenuHeader';\n\nconst ProfileMenuSection = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLDivElement> & { store?: DropdownStoreApi }\n>(({ className, children, store: _store, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={`\n flex flex-col p-2\n ${className}\n `}\n {...props}\n >\n {children}\n </div>\n );\n});\nProfileMenuSection.displayName = 'ProfileMenuSection';\n\nconst ProfileMenuFooter = ({\n className,\n disabled = false,\n onClick,\n store: externalStore,\n ...props\n}: HTMLAttributes<HTMLButtonElement> & {\n disabled?: boolean;\n store?: DropdownStoreApi;\n}) => {\n const store = useDropdownStore(externalStore);\n const setOpen = useStore(store, (s) => s.setOpen);\n\n return (\n <Button\n variant=\"outline\"\n className={`w-full ${className}`}\n disabled={disabled}\n onClick={(e) => {\n setOpen(false);\n onClick?.(e);\n }}\n {...props}\n >\n <span className=\"mr-2 flex items-center\">\n <SignOut />\n </span>\n <span>Sair</span>\n </Button>\n );\n};\nProfileMenuFooter.displayName = 'ProfileMenuFooter';\n\n// Exportações\nexport default DropdownMenu;\nexport {\n // Componentes genéricos\n DropdownMenuTrigger,\n MenuContent,\n MenuItem,\n MenuLabel,\n MenuSeparator,\n\n // Componentes específicos do ProfileMenu\n ProfileMenuTrigger,\n ProfileMenuHeader,\n ProfileMenuSection,\n ProfileMenuFooter,\n};\n","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n/**\n * Lookup table for variant and action class combinations\n */\nconst VARIANT_ACTION_CLASSES = {\n solid: {\n primary:\n 'bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n outline: {\n primary:\n 'bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n link: {\n primary:\n 'bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed',\n positive:\n 'bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed',\n negative:\n 'bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed',\n },\n} as const;\n\n/**\n * Lookup table for size classes\n */\nconst SIZE_CLASSES = {\n 'extra-small': 'text-xs px-3.5 py-2',\n small: 'text-sm px-4 py-2.5',\n medium: 'text-md px-5 py-2.5',\n large: 'text-lg px-6 py-3',\n 'extra-large': 'text-lg px-7 py-3.5',\n} as const;\n\n/**\n * Button component props interface\n */\ntype ButtonProps = {\n /** Content to be displayed inside the button */\n children: ReactNode;\n /** Ícone à esquerda do texto */\n iconLeft?: ReactNode;\n /** Ícone à direita do texto */\n iconRight?: ReactNode;\n /** Size of the button */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n /** Visual variant of the button */\n variant?: 'solid' | 'outline' | 'link';\n /** Action type of the button */\n action?: 'primary' | 'positive' | 'negative';\n /** Additional CSS classes to apply */\n className?: string;\n} & ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button component for Analytica Ensino platforms\n *\n * A flexible button component with multiple variants, sizes and actions.\n * Fully compatible with Next.js 15 and React 19.\n *\n * @param children - The content to display inside the button\n * @param size - The size variant (extra-small, small, medium, large, extra-large)\n * @param variant - The visual style variant (solid, outline, link)\n * @param action - The action type (primary, positive, negative)\n * @param className - Additional CSS classes\n * @param props - All other standard button HTML attributes\n * @returns A styled button element\n *\n * @example\n * ```tsx\n * <Button variant=\"solid\" action=\"primary\" size=\"medium\" onClick={() => console.log('clicked')}>\n * Click me\n * </Button>\n * ```\n */\nconst Button = ({\n children,\n iconLeft,\n iconRight,\n size = 'medium',\n variant = 'solid',\n action = 'primary',\n className = '',\n disabled,\n type = 'button',\n ...props\n}: ButtonProps) => {\n // Get classes from lookup tables\n const sizeClasses = SIZE_CLASSES[size];\n const variantClasses = VARIANT_ACTION_CLASSES[variant][action];\n\n const baseClasses =\n 'inline-flex items-center justify-center rounded-full cursor-pointer font-medium';\n\n return (\n <button\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`}\n disabled={disabled}\n type={type}\n {...props}\n >\n {iconLeft && <span className=\"mr-2 flex items-center\">{iconLeft}</span>}\n {children}\n {iconRight && <span className=\"ml-2 flex items-center\">{iconRight}</span>}\n </button>\n );\n};\n\nexport default Button;\n"],"mappings":";;;AAEA,SAAS,SAAS,YAAY;AAC9B;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,QAAkB,gBAAgB;;;ACsFvC,SAMe,KANf;AAnGJ,IAAM,yBAAyB;AAAA,EAC7B,OAAO;AAAA,IACL,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,SAAS;AAAA,IACP,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AAAA,EACA,MAAM;AAAA,IACJ,SACE;AAAA,IACF,UACE;AAAA,IACF,UACE;AAAA,EACJ;AACF;AAKA,IAAM,eAAe;AAAA,EACnB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,eAAe;AACjB;AA2CA,IAAM,SAAS,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,E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Ac;AAGhC,IAAO,uBAAQ;","names":["jsx","jsxs"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Progress circle size variants
|
|
6
|
+
*/
|
|
7
|
+
type ProgressCircleSize = 'small' | 'medium';
|
|
8
|
+
/**
|
|
9
|
+
* Progress circle color variants
|
|
10
|
+
*/
|
|
11
|
+
type ProgressCircleVariant = 'blue' | 'green';
|
|
12
|
+
/**
|
|
13
|
+
* ProgressCircle component props interface
|
|
14
|
+
*/
|
|
15
|
+
type ProgressCircleProps = {
|
|
16
|
+
/** Progress value between 0 and 100 */
|
|
17
|
+
value: number;
|
|
18
|
+
/** Maximum value (defaults to 100) */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** Size variant of the progress circle */
|
|
21
|
+
size?: ProgressCircleSize;
|
|
22
|
+
/** Color variant of the progress circle */
|
|
23
|
+
variant?: ProgressCircleVariant;
|
|
24
|
+
/** Optional label to display below percentage */
|
|
25
|
+
label?: ReactNode;
|
|
26
|
+
/** Show percentage text */
|
|
27
|
+
showPercentage?: boolean;
|
|
28
|
+
/** Additional CSS classes */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Label CSS classes */
|
|
31
|
+
labelClassName?: string;
|
|
32
|
+
/** Percentage text CSS classes */
|
|
33
|
+
percentageClassName?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* ProgressCircle component for Analytica Ensino platforms
|
|
37
|
+
*
|
|
38
|
+
* A circular progress indicator with size and color variants designed for tracking
|
|
39
|
+
* activity progress (blue) and performance metrics (green).
|
|
40
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
41
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Basic progress circle
|
|
46
|
+
* <ProgressCircle value={65} />
|
|
47
|
+
*
|
|
48
|
+
* // Activity progress (blue)
|
|
49
|
+
* <ProgressCircle variant="blue" value={45} label="CONCLUÍDO" showPercentage />
|
|
50
|
+
*
|
|
51
|
+
* // Performance metrics (green)
|
|
52
|
+
* <ProgressCircle variant="green" size="medium" value={85} label="MÉDIA" />
|
|
53
|
+
*
|
|
54
|
+
* // Small size with custom max value
|
|
55
|
+
* <ProgressCircle size="small" value={3} max={5} showPercentage />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const ProgressCircle: ({ value, max, size, variant, label, showPercentage, className, labelClassName, percentageClassName, }: ProgressCircleProps) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
export { type ProgressCircleProps, ProgressCircle as default };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Progress circle size variants
|
|
6
|
+
*/
|
|
7
|
+
type ProgressCircleSize = 'small' | 'medium';
|
|
8
|
+
/**
|
|
9
|
+
* Progress circle color variants
|
|
10
|
+
*/
|
|
11
|
+
type ProgressCircleVariant = 'blue' | 'green';
|
|
12
|
+
/**
|
|
13
|
+
* ProgressCircle component props interface
|
|
14
|
+
*/
|
|
15
|
+
type ProgressCircleProps = {
|
|
16
|
+
/** Progress value between 0 and 100 */
|
|
17
|
+
value: number;
|
|
18
|
+
/** Maximum value (defaults to 100) */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** Size variant of the progress circle */
|
|
21
|
+
size?: ProgressCircleSize;
|
|
22
|
+
/** Color variant of the progress circle */
|
|
23
|
+
variant?: ProgressCircleVariant;
|
|
24
|
+
/** Optional label to display below percentage */
|
|
25
|
+
label?: ReactNode;
|
|
26
|
+
/** Show percentage text */
|
|
27
|
+
showPercentage?: boolean;
|
|
28
|
+
/** Additional CSS classes */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Label CSS classes */
|
|
31
|
+
labelClassName?: string;
|
|
32
|
+
/** Percentage text CSS classes */
|
|
33
|
+
percentageClassName?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* ProgressCircle component for Analytica Ensino platforms
|
|
37
|
+
*
|
|
38
|
+
* A circular progress indicator with size and color variants designed for tracking
|
|
39
|
+
* activity progress (blue) and performance metrics (green).
|
|
40
|
+
* Uses the Analytica Ensino Design System colors from styles.css with automatic
|
|
41
|
+
* light/dark mode support. Includes Text component integration for consistent typography.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // Basic progress circle
|
|
46
|
+
* <ProgressCircle value={65} />
|
|
47
|
+
*
|
|
48
|
+
* // Activity progress (blue)
|
|
49
|
+
* <ProgressCircle variant="blue" value={45} label="CONCLUÍDO" showPercentage />
|
|
50
|
+
*
|
|
51
|
+
* // Performance metrics (green)
|
|
52
|
+
* <ProgressCircle variant="green" size="medium" value={85} label="MÉDIA" />
|
|
53
|
+
*
|
|
54
|
+
* // Small size with custom max value
|
|
55
|
+
* <ProgressCircle size="small" value={3} max={5} showPercentage />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const ProgressCircle: ({ value, max, size, variant, label, showPercentage, className, labelClassName, percentageClassName, }: ProgressCircleProps) => react_jsx_runtime.JSX.Element;
|
|
59
|
+
|
|
60
|
+
export { type ProgressCircleProps, ProgressCircle as default };
|