analytica-frontend-lib 1.1.53 → 1.1.55

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 (51) hide show
  1. package/dist/DropdownMenu/index.d.mts +5 -1
  2. package/dist/DropdownMenu/index.d.ts +5 -1
  3. package/dist/DropdownMenu/index.js +606 -37
  4. package/dist/DropdownMenu/index.js.map +1 -1
  5. package/dist/DropdownMenu/index.mjs +605 -37
  6. package/dist/DropdownMenu/index.mjs.map +1 -1
  7. package/dist/Modal/index.d.mts +14 -5
  8. package/dist/Modal/index.d.ts +14 -5
  9. package/dist/Modal/index.js +216 -31
  10. package/dist/Modal/index.js.map +1 -1
  11. package/dist/Modal/index.mjs +217 -32
  12. package/dist/Modal/index.mjs.map +1 -1
  13. package/dist/Modal/utils/videoUtils/index.d.mts +28 -0
  14. package/dist/Modal/utils/videoUtils/index.d.ts +28 -0
  15. package/dist/Modal/utils/videoUtils/index.js +76 -0
  16. package/dist/Modal/utils/videoUtils/index.js.map +1 -0
  17. package/dist/Modal/utils/videoUtils/index.mjs +49 -0
  18. package/dist/Modal/utils/videoUtils/index.mjs.map +1 -0
  19. package/dist/NotificationCard/index.js +716 -295
  20. package/dist/NotificationCard/index.js.map +1 -1
  21. package/dist/NotificationCard/index.mjs +713 -292
  22. package/dist/NotificationCard/index.mjs.map +1 -1
  23. package/dist/Quiz/index.js +154 -26
  24. package/dist/Quiz/index.js.map +1 -1
  25. package/dist/Quiz/index.mjs +166 -38
  26. package/dist/Quiz/index.mjs.map +1 -1
  27. package/dist/Search/index.js +625 -58
  28. package/dist/Search/index.js.map +1 -1
  29. package/dist/Search/index.mjs +628 -61
  30. package/dist/Search/index.mjs.map +1 -1
  31. package/dist/ThemeToggle/index.d.mts +8 -49
  32. package/dist/ThemeToggle/index.d.ts +8 -49
  33. package/dist/ThemeToggle/index.js +128 -114
  34. package/dist/ThemeToggle/index.js.map +1 -1
  35. package/dist/ThemeToggle/index.mjs +119 -105
  36. package/dist/ThemeToggle/index.mjs.map +1 -1
  37. package/dist/hooks/useTheme/index.d.mts +1 -1
  38. package/dist/hooks/useTheme/index.d.ts +1 -1
  39. package/dist/hooks/useTheme/index.js.map +1 -1
  40. package/dist/hooks/useTheme/index.mjs.map +1 -1
  41. package/dist/index.css +10 -39
  42. package/dist/index.css.map +1 -1
  43. package/dist/index.d.mts +3 -3
  44. package/dist/index.d.ts +3 -3
  45. package/dist/index.js +995 -825
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +1083 -914
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/styles.css +10 -39
  50. package/dist/styles.css.map +1 -1
  51. package/package.json +2 -1
@@ -1,24 +1,24 @@
1
1
  // src/components/Search/Search.tsx
2
- import { CaretLeft, X } from "phosphor-react";
2
+ import { CaretLeft, X as X2 } from "phosphor-react";
3
3
  import {
4
- forwardRef as forwardRef2,
5
- useState as useState2,
6
- useId,
4
+ forwardRef as forwardRef3,
5
+ useState as useState4,
6
+ useId as useId2,
7
7
  useMemo,
8
- useEffect as useEffect2,
9
- useRef as useRef2
8
+ useEffect as useEffect5,
9
+ useRef as useRef3
10
10
  } from "react";
11
11
 
12
12
  // src/components/DropdownMenu/DropdownMenu.tsx
13
- import { SignOut, User } from "phosphor-react";
13
+ import { CaretRight, SignOut, User } from "phosphor-react";
14
14
  import {
15
- forwardRef,
16
- useEffect,
17
- useRef,
15
+ forwardRef as forwardRef2,
16
+ useEffect as useEffect4,
17
+ useRef as useRef2,
18
18
  isValidElement,
19
19
  Children,
20
20
  cloneElement,
21
- useState
21
+ useState as useState3
22
22
  } from "react";
23
23
  import { create, useStore } from "zustand";
24
24
 
@@ -87,8 +87,495 @@ var Button = ({
87
87
  };
88
88
  var Button_default = Button;
89
89
 
90
+ // src/components/Text/Text.tsx
91
+ import { jsx as jsx2 } from "react/jsx-runtime";
92
+ var Text = ({
93
+ children,
94
+ size = "md",
95
+ weight = "normal",
96
+ color = "text-text-950",
97
+ as,
98
+ className = "",
99
+ ...props
100
+ }) => {
101
+ let sizeClasses = "";
102
+ let weightClasses = "";
103
+ const sizeClassMap = {
104
+ "2xs": "text-2xs",
105
+ xs: "text-xs",
106
+ sm: "text-sm",
107
+ md: "text-md",
108
+ lg: "text-lg",
109
+ xl: "text-xl",
110
+ "2xl": "text-2xl",
111
+ "3xl": "text-3xl",
112
+ "4xl": "text-4xl",
113
+ "5xl": "text-5xl",
114
+ "6xl": "text-6xl"
115
+ };
116
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
117
+ const weightClassMap = {
118
+ hairline: "font-hairline",
119
+ light: "font-light",
120
+ normal: "font-normal",
121
+ medium: "font-medium",
122
+ semibold: "font-semibold",
123
+ bold: "font-bold",
124
+ extrabold: "font-extrabold",
125
+ black: "font-black"
126
+ };
127
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
128
+ const baseClasses = "font-primary";
129
+ const Component = as ?? "p";
130
+ return /* @__PURE__ */ jsx2(
131
+ Component,
132
+ {
133
+ className: cn(baseClasses, sizeClasses, weightClasses, color, className),
134
+ ...props,
135
+ children
136
+ }
137
+ );
138
+ };
139
+ var Text_default = Text;
140
+
141
+ // src/components/Modal/Modal.tsx
142
+ import { useEffect, useId } from "react";
143
+ import { X } from "phosphor-react";
144
+
145
+ // src/components/Modal/utils/videoUtils.ts
146
+ var isYouTubeUrl = (url) => {
147
+ const youtubeRegex = /^(https?:\/\/)?((www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/.+/i;
148
+ return youtubeRegex.test(url);
149
+ };
150
+ var isValidYouTubeHost = (host) => {
151
+ if (host === "youtu.be") return "youtu.be";
152
+ const isValidYouTubeCom = host === "youtube.com" || host.endsWith(".youtube.com") && /^(www|m|music)\.youtube\.com$/.test(host);
153
+ if (isValidYouTubeCom) return "youtube";
154
+ const isValidNoCookie = host === "youtube-nocookie.com" || host.endsWith(".youtube-nocookie.com") && /^(www|m|music)\.youtube-nocookie\.com$/.test(host);
155
+ if (isValidNoCookie) return "nocookie";
156
+ return null;
157
+ };
158
+ var extractYoutuBeId = (pathname) => {
159
+ const firstSeg = pathname.split("/").filter(Boolean)[0];
160
+ return firstSeg || null;
161
+ };
162
+ var extractYouTubeId = (pathname, searchParams) => {
163
+ const parts = pathname.split("/").filter(Boolean);
164
+ const [first, second] = parts;
165
+ if (first === "embed" && second) return second;
166
+ if (first === "shorts" && second) return second;
167
+ if (first === "live" && second) return second;
168
+ const v = searchParams.get("v");
169
+ if (v) return v;
170
+ return null;
171
+ };
172
+ var getYouTubeVideoId = (url) => {
173
+ try {
174
+ const u = new URL(url);
175
+ const hostType = isValidYouTubeHost(u.hostname.toLowerCase());
176
+ if (!hostType) return null;
177
+ if (hostType === "youtu.be") {
178
+ return extractYoutuBeId(u.pathname);
179
+ }
180
+ return extractYouTubeId(u.pathname, u.searchParams);
181
+ } catch {
182
+ return null;
183
+ }
184
+ };
185
+ var getYouTubeEmbedUrl = (videoId) => {
186
+ return `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=0&rel=0&modestbranding=1`;
187
+ };
188
+
189
+ // src/components/Modal/Modal.tsx
190
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
191
+ var SIZE_CLASSES2 = {
192
+ xs: "max-w-[360px]",
193
+ sm: "max-w-[420px]",
194
+ md: "max-w-[510px]",
195
+ lg: "max-w-[640px]",
196
+ xl: "max-w-[970px]"
197
+ };
198
+ var Modal = ({
199
+ isOpen,
200
+ onClose,
201
+ title,
202
+ children,
203
+ size = "md",
204
+ className = "",
205
+ closeOnEscape = true,
206
+ footer,
207
+ hideCloseButton = false,
208
+ variant = "default",
209
+ description,
210
+ image,
211
+ imageAlt,
212
+ actionLink,
213
+ actionLabel
214
+ }) => {
215
+ const titleId = useId();
216
+ useEffect(() => {
217
+ if (!isOpen || !closeOnEscape) return;
218
+ const handleEscape = (event) => {
219
+ if (event.key === "Escape") {
220
+ onClose();
221
+ }
222
+ };
223
+ document.addEventListener("keydown", handleEscape);
224
+ return () => document.removeEventListener("keydown", handleEscape);
225
+ }, [isOpen, closeOnEscape, onClose]);
226
+ useEffect(() => {
227
+ const originalOverflow = document.body.style.overflow;
228
+ if (isOpen) {
229
+ document.body.style.overflow = "hidden";
230
+ } else {
231
+ document.body.style.overflow = originalOverflow;
232
+ }
233
+ return () => {
234
+ document.body.style.overflow = originalOverflow;
235
+ };
236
+ }, [isOpen]);
237
+ if (!isOpen) return null;
238
+ const sizeClasses = SIZE_CLASSES2[size];
239
+ const baseClasses = "bg-secondary-50 rounded-3xl shadow-hard-shadow-2 border border-border-100 w-full mx-4";
240
+ const dialogResetClasses = "p-0 m-0 border-none outline-none max-h-none static";
241
+ const modalClasses = cn(
242
+ baseClasses,
243
+ sizeClasses,
244
+ dialogResetClasses,
245
+ className
246
+ );
247
+ const normalizeUrl = (href) => /^https?:\/\//i.test(href) ? href : `https://${href}`;
248
+ const handleActionClick = () => {
249
+ if (actionLink) {
250
+ window.open(normalizeUrl(actionLink), "_blank", "noopener,noreferrer");
251
+ }
252
+ };
253
+ if (variant === "activity") {
254
+ return /* @__PURE__ */ jsx3("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ jsxs2(
255
+ "dialog",
256
+ {
257
+ className: modalClasses,
258
+ "aria-labelledby": titleId,
259
+ "aria-modal": "true",
260
+ open: true,
261
+ children: [
262
+ /* @__PURE__ */ jsx3("div", { className: "flex justify-end p-6 pb-0", children: !hideCloseButton && /* @__PURE__ */ jsx3(
263
+ "button",
264
+ {
265
+ onClick: onClose,
266
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
267
+ "aria-label": "Fechar modal",
268
+ children: /* @__PURE__ */ jsx3(X, { size: 18 })
269
+ }
270
+ ) }),
271
+ /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center px-6 pb-6 gap-5", children: [
272
+ image && /* @__PURE__ */ jsx3("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx3(
273
+ "img",
274
+ {
275
+ src: image,
276
+ alt: imageAlt ?? "",
277
+ className: "w-[122px] h-[122px] object-contain"
278
+ }
279
+ ) }),
280
+ /* @__PURE__ */ jsx3(
281
+ "h2",
282
+ {
283
+ id: titleId,
284
+ className: "text-lg font-semibold text-text-950 text-center",
285
+ children: title
286
+ }
287
+ ),
288
+ description && /* @__PURE__ */ jsx3("p", { className: "text-sm font-normal text-text-400 text-center max-w-md leading-[21px]", children: description }),
289
+ actionLink && /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
290
+ (() => {
291
+ const normalized = normalizeUrl(actionLink);
292
+ const isYT = isYouTubeUrl(normalized);
293
+ if (!isYT) return null;
294
+ const id = getYouTubeVideoId(normalized);
295
+ if (!id) {
296
+ return /* @__PURE__ */ jsx3(
297
+ Button_default,
298
+ {
299
+ variant: "solid",
300
+ action: "primary",
301
+ size: "large",
302
+ className: "w-full",
303
+ onClick: handleActionClick,
304
+ children: actionLabel || "Iniciar Atividade"
305
+ }
306
+ );
307
+ }
308
+ return /* @__PURE__ */ jsx3(
309
+ "iframe",
310
+ {
311
+ src: getYouTubeEmbedUrl(id),
312
+ className: "w-full aspect-video rounded-lg",
313
+ allowFullScreen: true,
314
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
315
+ title: "V\xEDdeo YouTube"
316
+ }
317
+ );
318
+ })(),
319
+ !isYouTubeUrl(normalizeUrl(actionLink)) && /* @__PURE__ */ jsx3(
320
+ Button_default,
321
+ {
322
+ variant: "solid",
323
+ action: "primary",
324
+ size: "large",
325
+ className: "w-full",
326
+ onClick: handleActionClick,
327
+ children: actionLabel || "Iniciar Atividade"
328
+ }
329
+ )
330
+ ] })
331
+ ] })
332
+ ]
333
+ }
334
+ ) });
335
+ }
336
+ return /* @__PURE__ */ jsx3("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs border-none p-0 m-0 w-full cursor-default", children: /* @__PURE__ */ jsxs2(
337
+ "dialog",
338
+ {
339
+ className: modalClasses,
340
+ "aria-labelledby": titleId,
341
+ "aria-modal": "true",
342
+ open: true,
343
+ children: [
344
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-6", children: [
345
+ /* @__PURE__ */ jsx3("h2", { id: titleId, className: "text-lg font-semibold text-text-950", children: title }),
346
+ !hideCloseButton && /* @__PURE__ */ jsx3(
347
+ "button",
348
+ {
349
+ onClick: onClose,
350
+ className: "p-1 text-text-500 hover:text-text-700 hover:bg-background-50 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-indicator-info focus:ring-offset-2",
351
+ "aria-label": "Fechar modal",
352
+ children: /* @__PURE__ */ jsx3(X, { size: 18 })
353
+ }
354
+ )
355
+ ] }),
356
+ children && /* @__PURE__ */ jsx3("div", { className: "px-6 pb-6", children: /* @__PURE__ */ jsx3("div", { className: "text-text-500 font-normal text-sm leading-6", children }) }),
357
+ footer && /* @__PURE__ */ jsx3("div", { className: "flex justify-end gap-3 px-6 pb-6", children: footer })
358
+ ]
359
+ }
360
+ ) });
361
+ };
362
+ var Modal_default = Modal;
363
+
364
+ // src/components/ThemeToggle/ThemeToggle.tsx
365
+ import { Moon, Sun } from "phosphor-react";
366
+ import { useState as useState2, useEffect as useEffect3 } from "react";
367
+
368
+ // src/components/SelectionButton/SelectionButton.tsx
369
+ import { forwardRef } from "react";
370
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
371
+ var SelectionButton = forwardRef(
372
+ ({ icon, label, selected = false, className = "", disabled, ...props }, ref) => {
373
+ const baseClasses = [
374
+ "inline-flex",
375
+ "items-center",
376
+ "justify-start",
377
+ "gap-2",
378
+ "p-4",
379
+ "rounded-xl",
380
+ "cursor-pointer",
381
+ "border",
382
+ "border-border-50",
383
+ "bg-background",
384
+ "text-sm",
385
+ "text-text-700",
386
+ "font-bold",
387
+ "shadow-soft-shadow-1",
388
+ "hover:bg-background-100",
389
+ "focus-visible:outline-none",
390
+ "focus-visible:ring-2",
391
+ "focus-visible:ring-indicator-info",
392
+ "focus-visible:ring-offset-0",
393
+ "focus-visible:shadow-none",
394
+ "active:ring-2",
395
+ "active:ring-primary-950",
396
+ "active:ring-offset-0",
397
+ "active:shadow-none",
398
+ "disabled:opacity-50",
399
+ "disabled:cursor-not-allowed"
400
+ ];
401
+ const stateClasses = selected ? ["ring-primary-950", "ring-2", "ring-offset-0", "shadow-none"] : [];
402
+ const allClasses = [...baseClasses, ...stateClasses].join(" ");
403
+ return /* @__PURE__ */ jsxs3(
404
+ "button",
405
+ {
406
+ ref,
407
+ type: "button",
408
+ className: cn(allClasses, className),
409
+ disabled,
410
+ "aria-pressed": selected,
411
+ ...props,
412
+ children: [
413
+ /* @__PURE__ */ jsx4("span", { className: "flex items-center justify-center w-6 h-6", children: icon }),
414
+ /* @__PURE__ */ jsx4("span", { children: label })
415
+ ]
416
+ }
417
+ );
418
+ }
419
+ );
420
+ SelectionButton.displayName = "SelectionButton";
421
+ var SelectionButton_default = SelectionButton;
422
+
423
+ // src/hooks/useTheme.ts
424
+ import { useEffect as useEffect2, useState, useCallback, useRef } from "react";
425
+ var useTheme = () => {
426
+ const [themeMode, setThemeMode] = useState("system");
427
+ const [isDark, setIsDark] = useState(false);
428
+ const themeModeRef = useRef("system");
429
+ const applyTheme = useCallback((mode) => {
430
+ const htmlElement = document.documentElement;
431
+ const originalTheme = htmlElement.getAttribute("data-original-theme");
432
+ if (mode === "dark") {
433
+ htmlElement.setAttribute("data-theme", "dark");
434
+ setIsDark(true);
435
+ } else if (mode === "light") {
436
+ if (originalTheme) {
437
+ htmlElement.setAttribute("data-theme", originalTheme);
438
+ }
439
+ setIsDark(false);
440
+ } else if (mode === "system") {
441
+ const isSystemDark = window.matchMedia(
442
+ "(prefers-color-scheme: dark)"
443
+ ).matches;
444
+ if (isSystemDark) {
445
+ htmlElement.setAttribute("data-theme", "dark");
446
+ setIsDark(true);
447
+ } else if (originalTheme) {
448
+ htmlElement.setAttribute("data-theme", originalTheme);
449
+ setIsDark(false);
450
+ }
451
+ }
452
+ }, []);
453
+ const toggleTheme = useCallback(() => {
454
+ let newMode;
455
+ if (themeMode === "light") {
456
+ newMode = "dark";
457
+ } else if (themeMode === "dark") {
458
+ newMode = "light";
459
+ } else {
460
+ newMode = "dark";
461
+ }
462
+ setThemeMode(newMode);
463
+ themeModeRef.current = newMode;
464
+ applyTheme(newMode);
465
+ localStorage.setItem("theme-mode", newMode);
466
+ }, [themeMode, applyTheme]);
467
+ const setTheme = useCallback(
468
+ (mode) => {
469
+ setThemeMode(mode);
470
+ themeModeRef.current = mode;
471
+ applyTheme(mode);
472
+ localStorage.setItem("theme-mode", mode);
473
+ },
474
+ [applyTheme]
475
+ );
476
+ useEffect2(() => {
477
+ const htmlElement = document.documentElement;
478
+ const currentTheme = htmlElement.getAttribute("data-theme");
479
+ if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
480
+ htmlElement.setAttribute("data-original-theme", currentTheme);
481
+ }
482
+ const savedThemeMode = localStorage.getItem("theme-mode");
483
+ const initialMode = savedThemeMode || "system";
484
+ if (!savedThemeMode) {
485
+ localStorage.setItem("theme-mode", "system");
486
+ }
487
+ setThemeMode(initialMode);
488
+ themeModeRef.current = initialMode;
489
+ applyTheme(initialMode);
490
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
491
+ const handleSystemThemeChange = () => {
492
+ if (themeModeRef.current === "system") {
493
+ applyTheme("system");
494
+ }
495
+ };
496
+ mediaQuery.addEventListener("change", handleSystemThemeChange);
497
+ return () => {
498
+ mediaQuery.removeEventListener("change", handleSystemThemeChange);
499
+ };
500
+ }, [applyTheme]);
501
+ return {
502
+ themeMode,
503
+ isDark,
504
+ toggleTheme,
505
+ setTheme
506
+ };
507
+ };
508
+
509
+ // src/components/ThemeToggle/ThemeToggle.tsx
510
+ import { jsx as jsx5 } from "react/jsx-runtime";
511
+ var ThemeToggle = ({
512
+ variant = "default",
513
+ onToggle
514
+ }) => {
515
+ const { themeMode, setTheme } = useTheme();
516
+ const [tempTheme, setTempTheme] = useState2(themeMode);
517
+ useEffect3(() => {
518
+ setTempTheme(themeMode);
519
+ }, [themeMode]);
520
+ const problemTypes = [
521
+ {
522
+ id: "light",
523
+ title: "Claro",
524
+ icon: /* @__PURE__ */ jsx5(Sun, { size: 24 })
525
+ },
526
+ {
527
+ id: "dark",
528
+ title: "Escuro",
529
+ icon: /* @__PURE__ */ jsx5(Moon, { size: 24 })
530
+ },
531
+ {
532
+ id: "system",
533
+ title: "Sistema",
534
+ icon: /* @__PURE__ */ jsx5(
535
+ "svg",
536
+ {
537
+ width: "25",
538
+ height: "25",
539
+ viewBox: "0 0 25 25",
540
+ fill: "none",
541
+ xmlns: "http://www.w3.org/2000/svg",
542
+ children: /* @__PURE__ */ jsx5(
543
+ "path",
544
+ {
545
+ d: "M12.5 2.75C15.085 2.75276 17.5637 3.78054 19.3916 5.6084C21.2195 7.43628 22.2473 9.915 22.25 12.5C22.25 14.4284 21.6778 16.3136 20.6064 17.917C19.5352 19.5201 18.0128 20.7699 16.2314 21.5078C14.4499 22.2458 12.489 22.4387 10.5977 22.0625C8.70642 21.6863 6.96899 20.758 5.60547 19.3945C4.24197 18.031 3.31374 16.2936 2.9375 14.4023C2.56129 12.511 2.75423 10.5501 3.49219 8.76855C4.23012 6.98718 5.47982 5.46483 7.08301 4.39355C8.68639 3.32221 10.5716 2.75 12.5 2.75ZM11.75 4.28516C9.70145 4.47452 7.7973 5.42115 6.41016 6.94043C5.02299 8.4599 4.25247 10.4426 4.25 12.5C4.25247 14.5574 5.02299 16.5401 6.41016 18.0596C7.7973 19.5789 9.70145 20.5255 11.75 20.7148V4.28516Z",
546
+ fill: "#525252"
547
+ }
548
+ )
549
+ }
550
+ )
551
+ }
552
+ ];
553
+ const handleThemeSelect = (selectedTheme) => {
554
+ if (variant === "with-save") {
555
+ setTempTheme(selectedTheme);
556
+ } else {
557
+ setTheme(selectedTheme);
558
+ }
559
+ if (onToggle) {
560
+ onToggle(selectedTheme);
561
+ }
562
+ };
563
+ const currentTheme = variant === "with-save" ? tempTheme : themeMode;
564
+ return /* @__PURE__ */ jsx5("div", { className: "flex flex-row gap-2 sm:gap-4 py-2", children: problemTypes.map((type) => /* @__PURE__ */ jsx5(
565
+ SelectionButton_default,
566
+ {
567
+ icon: type.icon,
568
+ label: type.title,
569
+ selected: currentTheme === type.id,
570
+ onClick: () => handleThemeSelect(type.id),
571
+ className: "w-full p-2 sm:p-4"
572
+ },
573
+ type.id
574
+ )) });
575
+ };
576
+
90
577
  // src/components/DropdownMenu/DropdownMenu.tsx
91
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
578
+ import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
92
579
  function createDropdownStore() {
93
580
  return create((set) => ({
94
581
  open: false,
@@ -123,14 +610,14 @@ var DropdownMenu = ({
123
610
  open: propOpen,
124
611
  onOpenChange
125
612
  }) => {
126
- const storeRef = useRef(null);
613
+ const storeRef = useRef2(null);
127
614
  storeRef.current ??= createDropdownStore();
128
615
  const store = storeRef.current;
129
616
  const { open, setOpen: storeSetOpen } = useStore(store, (s) => s);
130
617
  const setOpen = (newOpen) => {
131
618
  storeSetOpen(newOpen);
132
619
  };
133
- const menuRef = useRef(null);
620
+ const menuRef = useRef2(null);
134
621
  const handleArrowDownOrArrowUp = (event) => {
135
622
  const menuContent = menuRef.current?.querySelector('[role="menu"]');
136
623
  if (menuContent) {
@@ -164,7 +651,7 @@ var DropdownMenu = ({
164
651
  setOpen(false);
165
652
  }
166
653
  };
167
- useEffect(() => {
654
+ useEffect4(() => {
168
655
  if (open) {
169
656
  document.addEventListener("mousedown", handleClickOutside);
170
657
  document.addEventListener("keydown", handleDownkey);
@@ -174,16 +661,16 @@ var DropdownMenu = ({
174
661
  document.removeEventListener("keydown", handleDownkey);
175
662
  };
176
663
  }, [open]);
177
- useEffect(() => {
664
+ useEffect4(() => {
178
665
  setOpen(open);
179
666
  onOpenChange?.(open);
180
667
  }, [open, onOpenChange]);
181
- useEffect(() => {
668
+ useEffect4(() => {
182
669
  if (propOpen) {
183
670
  setOpen(propOpen);
184
671
  }
185
672
  }, [propOpen]);
186
- return /* @__PURE__ */ jsx2("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
673
+ return /* @__PURE__ */ jsx6("div", { className: "relative", ref: menuRef, children: injectStore(children, store) });
187
674
  };
188
675
  var DropdownMenuTrigger = ({
189
676
  className,
@@ -195,7 +682,7 @@ var DropdownMenuTrigger = ({
195
682
  const store = useDropdownStore(externalStore);
196
683
  const open = useStore(store, (s) => s.open);
197
684
  const toggleOpen = () => store.setState({ open: !open });
198
- return /* @__PURE__ */ jsx2(
685
+ return /* @__PURE__ */ jsx6(
199
686
  "button",
200
687
  {
201
688
  onClick: (e) => {
@@ -230,8 +717,8 @@ var MENUCONTENT_VARIANT_CLASSES = {
230
717
  menu: "p-1",
231
718
  profile: "p-6"
232
719
  };
233
- var MenuLabel = forwardRef(({ className, inset, store: _store, ...props }, ref) => {
234
- return /* @__PURE__ */ jsx2(
720
+ var MenuLabel = forwardRef2(({ className, inset, store: _store, ...props }, ref) => {
721
+ return /* @__PURE__ */ jsx6(
235
722
  "div",
236
723
  {
237
724
  ref,
@@ -241,7 +728,7 @@ var MenuLabel = forwardRef(({ className, inset, store: _store, ...props }, ref)
241
728
  );
242
729
  });
243
730
  MenuLabel.displayName = "MenuLabel";
244
- var DropdownMenuContent = forwardRef(
731
+ var DropdownMenuContent = forwardRef2(
245
732
  ({
246
733
  className,
247
734
  align = "start",
@@ -254,8 +741,8 @@ var DropdownMenuContent = forwardRef(
254
741
  }, ref) => {
255
742
  const store = useDropdownStore(externalStore);
256
743
  const open = useStore(store, (s) => s.open);
257
- const [isVisible, setIsVisible] = useState(open);
258
- useEffect(() => {
744
+ const [isVisible, setIsVisible] = useState3(open);
745
+ useEffect4(() => {
259
746
  if (open) {
260
747
  setIsVisible(true);
261
748
  } else {
@@ -270,7 +757,7 @@ var DropdownMenuContent = forwardRef(
270
757
  return `absolute ${vertical} ${horizontal}`;
271
758
  };
272
759
  const variantClasses = MENUCONTENT_VARIANT_CLASSES[variant];
273
- return /* @__PURE__ */ jsx2(
760
+ return /* @__PURE__ */ jsx6(
274
761
  "div",
275
762
  {
276
763
  ref,
@@ -295,7 +782,7 @@ var DropdownMenuContent = forwardRef(
295
782
  }
296
783
  );
297
784
  DropdownMenuContent.displayName = "DropdownMenuContent";
298
- var DropdownMenuItem = forwardRef(
785
+ var DropdownMenuItem = forwardRef2(
299
786
  ({
300
787
  className,
301
788
  size = "small",
@@ -329,7 +816,7 @@ var DropdownMenuItem = forwardRef(
329
816
  const getVariantProps = () => {
330
817
  return variant === "profile" ? { "data-variant": "profile" } : {};
331
818
  };
332
- return /* @__PURE__ */ jsxs2(
819
+ return /* @__PURE__ */ jsxs4(
333
820
  "div",
334
821
  {
335
822
  ref,
@@ -351,7 +838,7 @@ var DropdownMenuItem = forwardRef(
351
838
  ...props,
352
839
  children: [
353
840
  iconLeft,
354
- /* @__PURE__ */ jsx2("span", { className: "w-full text-md", children }),
841
+ /* @__PURE__ */ jsx6("div", { className: "w-full", children }),
355
842
  iconRight
356
843
  ]
357
844
  }
@@ -359,7 +846,7 @@ var DropdownMenuItem = forwardRef(
359
846
  }
360
847
  );
361
848
  DropdownMenuItem.displayName = "DropdownMenuItem";
362
- var DropdownMenuSeparator = forwardRef(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx2(
849
+ var DropdownMenuSeparator = forwardRef2(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ jsx6(
363
850
  "div",
364
851
  {
365
852
  ref,
@@ -368,11 +855,11 @@ var DropdownMenuSeparator = forwardRef(({ className, store: _store, ...props },
368
855
  }
369
856
  ));
370
857
  DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
371
- var ProfileMenuTrigger = forwardRef(({ className, onClick, store: externalStore, ...props }, ref) => {
858
+ var ProfileMenuTrigger = forwardRef2(({ className, onClick, store: externalStore, ...props }, ref) => {
372
859
  const store = useDropdownStore(externalStore);
373
860
  const open = useStore(store, (s) => s.open);
374
861
  const toggleOpen = () => store.setState({ open: !open });
375
- return /* @__PURE__ */ jsx2(
862
+ return /* @__PURE__ */ jsx6(
376
863
  "button",
377
864
  {
378
865
  ref,
@@ -387,13 +874,13 @@ var ProfileMenuTrigger = forwardRef(({ className, onClick, store: externalStore,
387
874
  },
388
875
  "aria-expanded": open,
389
876
  ...props,
390
- children: /* @__PURE__ */ jsx2("span", { className: "size-6 rounded-full bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ jsx2(User, { className: "text-primary-950", size: 18 }) })
877
+ children: /* @__PURE__ */ jsx6("span", { className: "size-6 rounded-full bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ jsx6(User, { className: "text-primary-950", size: 18 }) })
391
878
  }
392
879
  );
393
880
  });
394
881
  ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
395
- var ProfileMenuHeader = forwardRef(({ className, name, email, store: _store, ...props }, ref) => {
396
- return /* @__PURE__ */ jsxs2(
882
+ var ProfileMenuHeader = forwardRef2(({ className, name, email, store: _store, ...props }, ref) => {
883
+ return /* @__PURE__ */ jsxs4(
397
884
  "div",
398
885
  {
399
886
  ref,
@@ -401,18 +888,98 @@ var ProfileMenuHeader = forwardRef(({ className, name, email, store: _store, ...
401
888
  className: cn("flex flex-row gap-4 items-center", className),
402
889
  ...props,
403
890
  children: [
404
- /* @__PURE__ */ jsx2("span", { className: "size-16 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx2(User, { size: 34, className: "text-primary-950" }) }),
405
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-col ", children: [
406
- /* @__PURE__ */ jsx2("p", { className: "text-xl font-bold text-text-950", children: name }),
407
- /* @__PURE__ */ jsx2("p", { className: "text-md text-text-600", children: email })
891
+ /* @__PURE__ */ jsx6("span", { className: "size-16 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx6(User, { size: 34, className: "text-primary-950" }) }),
892
+ /* @__PURE__ */ jsxs4("div", { className: "flex flex-col ", children: [
893
+ /* @__PURE__ */ jsx6(Text_default, { size: "xl", weight: "bold", color: "text-text-950", children: name }),
894
+ /* @__PURE__ */ jsx6(Text_default, { size: "md", color: "text-text-600", children: email })
408
895
  ] })
409
896
  ]
410
897
  }
411
898
  );
412
899
  });
413
900
  ProfileMenuHeader.displayName = "ProfileMenuHeader";
414
- var ProfileMenuSection = forwardRef(({ className, children, store: _store, ...props }, ref) => {
415
- return /* @__PURE__ */ jsx2("div", { ref, className: cn("flex flex-col p-2", className), ...props, children });
901
+ var ProfileToggleTheme = ({ ...props }) => {
902
+ const { themeMode, setTheme } = useTheme();
903
+ const [modalThemeToggle, setModalThemeToggle] = useState3(false);
904
+ const [selectedTheme, setSelectedTheme] = useState3(themeMode);
905
+ const handleClick = (e) => {
906
+ e.preventDefault();
907
+ e.stopPropagation();
908
+ setModalThemeToggle(true);
909
+ };
910
+ const handleSave = () => {
911
+ setTheme(selectedTheme);
912
+ setModalThemeToggle(false);
913
+ };
914
+ return /* @__PURE__ */ jsxs4(Fragment, { children: [
915
+ /* @__PURE__ */ jsxs4(
916
+ "div",
917
+ {
918
+ role: "menuitem",
919
+ "data-variant": "profile",
920
+ className: "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 cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground",
921
+ onClick: handleClick,
922
+ onKeyDown: (e) => {
923
+ if (e.key === "Enter" || e.key === " ") {
924
+ e.preventDefault();
925
+ e.stopPropagation();
926
+ setModalThemeToggle(true);
927
+ }
928
+ },
929
+ tabIndex: 0,
930
+ ...props,
931
+ children: [
932
+ /* @__PURE__ */ jsx6(
933
+ "svg",
934
+ {
935
+ width: "25",
936
+ height: "25",
937
+ viewBox: "0 0 25 25",
938
+ fill: "none",
939
+ xmlns: "http://www.w3.org/2000/svg",
940
+ children: /* @__PURE__ */ jsx6(
941
+ "path",
942
+ {
943
+ d: "M12.5 2.75C15.085 2.75276 17.5637 3.78054 19.3916 5.6084C21.2195 7.43628 22.2473 9.915 22.25 12.5C22.25 14.4284 21.6778 16.3136 20.6064 17.917C19.5352 19.5201 18.0128 20.7699 16.2314 21.5078C14.4499 22.2458 12.489 22.4387 10.5977 22.0625C8.70642 21.6863 6.96899 20.758 5.60547 19.3945C4.24197 18.031 3.31374 16.2936 2.9375 14.4023C2.56129 12.511 2.75423 10.5501 3.49219 8.76855C4.23012 6.98718 5.47982 5.46483 7.08301 4.39355C8.68639 3.32221 10.5716 2.75 12.5 2.75ZM11.75 4.28516C9.70145 4.47452 7.7973 5.42115 6.41016 6.94043C5.02299 8.4599 4.25247 10.4426 4.25 12.5C4.25247 14.5574 5.02299 16.5401 6.41016 18.0596C7.7973 19.5789 9.70145 20.5255 11.75 20.7148V4.28516Z",
944
+ fill: "#525252"
945
+ }
946
+ )
947
+ }
948
+ ),
949
+ /* @__PURE__ */ jsx6(Text_default, { className: "w-full", size: "md", children: "Apar\xEAncia" }),
950
+ /* @__PURE__ */ jsx6(CaretRight, {})
951
+ ]
952
+ }
953
+ ),
954
+ /* @__PURE__ */ jsx6(
955
+ Modal_default,
956
+ {
957
+ isOpen: modalThemeToggle,
958
+ onClose: () => setModalThemeToggle(false),
959
+ title: "Apar\xEAncia",
960
+ size: "md",
961
+ footer: /* @__PURE__ */ jsxs4("div", { className: "flex gap-3", children: [
962
+ /* @__PURE__ */ jsx6(
963
+ Button_default,
964
+ {
965
+ variant: "outline",
966
+ onClick: () => setModalThemeToggle(false),
967
+ children: "Cancelar"
968
+ }
969
+ ),
970
+ /* @__PURE__ */ jsx6(Button_default, { variant: "solid", onClick: () => handleSave(), children: "Salvar" })
971
+ ] }),
972
+ children: /* @__PURE__ */ jsxs4("div", { className: "flex flex-col", children: [
973
+ /* @__PURE__ */ jsx6("p", { className: "text-sm text-text-500", children: "Escolha o tema:" }),
974
+ /* @__PURE__ */ jsx6(ThemeToggle, { variant: "with-save", onToggle: setSelectedTheme })
975
+ ] })
976
+ }
977
+ )
978
+ ] });
979
+ };
980
+ ProfileToggleTheme.displayName = "ProfileToggleTheme";
981
+ var ProfileMenuSection = forwardRef2(({ className, children, store: _store, ...props }, ref) => {
982
+ return /* @__PURE__ */ jsx6("div", { ref, className: cn("flex flex-col p-2", className), ...props, children });
416
983
  });
417
984
  ProfileMenuSection.displayName = "ProfileMenuSection";
418
985
  var ProfileMenuFooter = ({
@@ -424,7 +991,7 @@ var ProfileMenuFooter = ({
424
991
  }) => {
425
992
  const store = useDropdownStore(externalStore);
426
993
  const setOpen = useStore(store, (s) => s.setOpen);
427
- return /* @__PURE__ */ jsxs2(
994
+ return /* @__PURE__ */ jsxs4(
428
995
  Button_default,
429
996
  {
430
997
  variant: "outline",
@@ -436,8 +1003,8 @@ var ProfileMenuFooter = ({
436
1003
  },
437
1004
  ...props,
438
1005
  children: [
439
- /* @__PURE__ */ jsx2("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx2(SignOut, {}) }),
440
- /* @__PURE__ */ jsx2("span", { children: "Sair" })
1006
+ /* @__PURE__ */ jsx6("span", { className: "mr-2 flex items-center", children: /* @__PURE__ */ jsx6(SignOut, {}) }),
1007
+ /* @__PURE__ */ jsx6(Text_default, { children: "Sair" })
441
1008
  ]
442
1009
  }
443
1010
  );
@@ -446,7 +1013,7 @@ ProfileMenuFooter.displayName = "ProfileMenuFooter";
446
1013
  var DropdownMenu_default = DropdownMenu;
447
1014
 
448
1015
  // src/components/Search/Search.tsx
449
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1016
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
450
1017
  var filterOptions = (options, query) => {
451
1018
  if (!query || query.length < 1) return [];
452
1019
  return options.filter(
@@ -471,7 +1038,7 @@ var updateInputValue = (value, ref, onChange) => {
471
1038
  onChange(event);
472
1039
  }
473
1040
  };
474
- var Search = forwardRef2(
1041
+ var Search = forwardRef3(
475
1042
  ({
476
1043
  options = [],
477
1044
  onSelect,
@@ -491,9 +1058,9 @@ var Search = forwardRef2(
491
1058
  placeholder = "Buscar...",
492
1059
  ...props
493
1060
  }, ref) => {
494
- const [dropdownOpen, setDropdownOpen] = useState2(false);
495
- const dropdownStore = useRef2(createDropdownStore()).current;
496
- const dropdownRef = useRef2(null);
1061
+ const [dropdownOpen, setDropdownOpen] = useState4(false);
1062
+ const dropdownStore = useRef3(createDropdownStore()).current;
1063
+ const dropdownRef = useRef3(null);
497
1064
  const filteredOptions = useMemo(() => {
498
1065
  if (!options.length) {
499
1066
  return [];
@@ -502,7 +1069,7 @@ var Search = forwardRef2(
502
1069
  return filtered;
503
1070
  }, [options, value]);
504
1071
  const showDropdown = controlledShowDropdown ?? (dropdownOpen && value && String(value).length > 0);
505
- useEffect2(() => {
1072
+ useEffect5(() => {
506
1073
  const shouldShow = Boolean(value && String(value).length > 0);
507
1074
  setDropdownOpen(shouldShow);
508
1075
  dropdownStore.setState({ open: shouldShow });
@@ -514,7 +1081,7 @@ var Search = forwardRef2(
514
1081
  dropdownStore.setState({ open: false });
515
1082
  updateInputValue(option, ref, onChange);
516
1083
  };
517
- useEffect2(() => {
1084
+ useEffect5(() => {
518
1085
  const handleClickOutside = (event) => {
519
1086
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
520
1087
  setDropdownOpen(false);
@@ -528,7 +1095,7 @@ var Search = forwardRef2(
528
1095
  document.removeEventListener("mousedown", handleClickOutside);
529
1096
  };
530
1097
  }, [showDropdown, dropdownStore]);
531
- const generatedId = useId();
1098
+ const generatedId = useId2();
532
1099
  const inputId = id ?? `search-${generatedId}`;
533
1100
  const handleClear = () => {
534
1101
  if (onClear) {
@@ -557,24 +1124,24 @@ var Search = forwardRef2(
557
1124
  return "hover:border-border-400";
558
1125
  };
559
1126
  const showClearButton = value && !disabled && !readOnly;
560
- return /* @__PURE__ */ jsxs3(
1127
+ return /* @__PURE__ */ jsxs5(
561
1128
  "div",
562
1129
  {
563
1130
  ref: dropdownRef,
564
1131
  className: `w-full max-w-lg md:w-[488px] ${containerClassName}`,
565
1132
  children: [
566
- /* @__PURE__ */ jsxs3("div", { className: "relative flex items-center", children: [
567
- /* @__PURE__ */ jsx3("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx3(
1133
+ /* @__PURE__ */ jsxs5("div", { className: "relative flex items-center", children: [
1134
+ /* @__PURE__ */ jsx7("div", { className: "absolute left-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx7(
568
1135
  "button",
569
1136
  {
570
1137
  type: "button",
571
1138
  className: "w-6 h-6 text-text-800 flex items-center justify-center bg-transparent border-0 p-0 cursor-pointer hover:text-text-600 transition-colors",
572
1139
  onClick: handleLeftIconClick,
573
1140
  "aria-label": "Voltar",
574
- children: /* @__PURE__ */ jsx3(CaretLeft, {})
1141
+ children: /* @__PURE__ */ jsx7(CaretLeft, {})
575
1142
  }
576
1143
  ) }),
577
- /* @__PURE__ */ jsx3(
1144
+ /* @__PURE__ */ jsx7(
578
1145
  "input",
579
1146
  {
580
1147
  ref,
@@ -592,24 +1159,24 @@ var Search = forwardRef2(
592
1159
  ...props
593
1160
  }
594
1161
  ),
595
- showClearButton && /* @__PURE__ */ jsx3("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx3(
1162
+ showClearButton && /* @__PURE__ */ jsx7("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsx7(
596
1163
  "button",
597
1164
  {
598
1165
  type: "button",
599
1166
  className: "p-0 border-0 bg-transparent cursor-pointer",
600
1167
  onMouseDown: handleClearClick,
601
1168
  "aria-label": "Limpar busca",
602
- children: /* @__PURE__ */ jsx3("span", { className: "w-6 h-6 text-text-800 flex items-center justify-center hover:text-text-600 transition-colors", children: /* @__PURE__ */ jsx3(X, {}) })
1169
+ children: /* @__PURE__ */ jsx7("span", { className: "w-6 h-6 text-text-800 flex items-center justify-center hover:text-text-600 transition-colors", children: /* @__PURE__ */ jsx7(X2, {}) })
603
1170
  }
604
1171
  ) })
605
1172
  ] }),
606
- showDropdown && /* @__PURE__ */ jsx3(DropdownMenu_default, { open: showDropdown, onOpenChange: setDropdownOpen, children: /* @__PURE__ */ jsx3(
1173
+ showDropdown && /* @__PURE__ */ jsx7(DropdownMenu_default, { open: showDropdown, onOpenChange: setDropdownOpen, children: /* @__PURE__ */ jsx7(
607
1174
  DropdownMenuContent,
608
1175
  {
609
1176
  className: "w-full mt-1",
610
1177
  style: { maxHeight: dropdownMaxHeight },
611
1178
  align: "start",
612
- children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsx3(
1179
+ children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsx7(
613
1180
  DropdownMenuItem,
614
1181
  {
615
1182
  onClick: () => handleSelectOption(option),
@@ -617,7 +1184,7 @@ var Search = forwardRef2(
617
1184
  children: option
618
1185
  },
619
1186
  option
620
- )) : /* @__PURE__ */ jsx3("div", { className: "px-3 py-3 text-text-700 text-base", children: noResultsText })
1187
+ )) : /* @__PURE__ */ jsx7("div", { className: "px-3 py-3 text-text-700 text-base", children: noResultsText })
621
1188
  }
622
1189
  ) })
623
1190
  ]