analytica-frontend-lib 1.1.68 → 1.1.70
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/Accordation/index.js +3 -3
- package/dist/Accordation/index.js.map +1 -1
- package/dist/Accordation/index.mjs +3 -3
- package/dist/Accordation/index.mjs.map +1 -1
- package/dist/Alert/index.js.map +1 -1
- package/dist/Alert/index.mjs.map +1 -1
- package/dist/AlertDialog/index.js.map +1 -1
- package/dist/AlertDialog/index.mjs.map +1 -1
- package/dist/Alternative/index.js.map +1 -1
- package/dist/Alternative/index.mjs.map +1 -1
- package/dist/Badge/index.js.map +1 -1
- package/dist/Badge/index.mjs.map +1 -1
- package/dist/Button/index.js.map +1 -1
- package/dist/Button/index.mjs.map +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar/index.js.map +1 -1
- package/dist/Calendar/index.mjs +1 -1
- package/dist/Calendar/index.mjs.map +1 -1
- package/dist/Card/index.js +3 -3
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.mjs +3 -3
- package/dist/Card/index.mjs.map +1 -1
- package/dist/CheckBox/index.js.map +1 -1
- package/dist/CheckBox/index.mjs.map +1 -1
- package/dist/Chips/index.js.map +1 -1
- package/dist/Chips/index.mjs.map +1 -1
- package/dist/Divider/index.js.map +1 -1
- package/dist/Divider/index.mjs.map +1 -1
- package/dist/DropdownMenu/index.js +110 -75
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +114 -79
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/IconButton/index.js.map +1 -1
- package/dist/IconButton/index.mjs.map +1 -1
- package/dist/IconRoundedButton/index.js.map +1 -1
- package/dist/IconRoundedButton/index.mjs.map +1 -1
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/Modal/index.js.map +1 -1
- package/dist/Modal/index.mjs.map +1 -1
- package/dist/MultipleChoice/index.js.map +1 -1
- package/dist/MultipleChoice/index.mjs.map +1 -1
- package/dist/NavButton/index.js.map +1 -1
- package/dist/NavButton/index.mjs.map +1 -1
- package/dist/NotFound/index.js.map +1 -1
- package/dist/NotFound/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +112 -77
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +123 -88
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/ProgressBar/index.js.map +1 -1
- package/dist/ProgressBar/index.mjs.map +1 -1
- package/dist/ProgressCircle/index.js.map +1 -1
- package/dist/ProgressCircle/index.mjs.map +1 -1
- package/dist/Quiz/index.js +4 -4
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +4 -4
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Radio/index.js.map +1 -1
- package/dist/Radio/index.mjs.map +1 -1
- package/dist/Search/index.js +110 -75
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +119 -84
- package/dist/Search/index.mjs.map +1 -1
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/index.mjs.map +1 -1
- package/dist/SelectionButton/index.js.map +1 -1
- package/dist/SelectionButton/index.mjs.map +1 -1
- package/dist/Skeleton/index.js.map +1 -1
- package/dist/Skeleton/index.mjs.map +1 -1
- package/dist/Stepper/index.js.map +1 -1
- package/dist/Stepper/index.mjs.map +1 -1
- package/dist/Table/index.js.map +1 -1
- package/dist/Table/index.mjs.map +1 -1
- package/dist/Text/index.js.map +1 -1
- package/dist/Text/index.mjs.map +1 -1
- package/dist/TextArea/index.js.map +1 -1
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/ThemeToggle/index.d.mts +3 -1
- package/dist/ThemeToggle/index.d.ts +3 -1
- package/dist/ThemeToggle/index.js +102 -67
- package/dist/ThemeToggle/index.js.map +1 -1
- package/dist/ThemeToggle/index.mjs +105 -70
- package/dist/ThemeToggle/index.mjs.map +1 -1
- package/dist/Toast/Toaster/index.js.map +1 -1
- package/dist/Toast/Toaster/index.mjs.map +1 -1
- package/dist/Toast/index.js.map +1 -1
- package/dist/Toast/index.mjs.map +1 -1
- package/dist/VideoPlayer/index.js.map +1 -1
- package/dist/VideoPlayer/index.mjs.map +1 -1
- package/dist/Whiteboard/index.js +1 -1
- package/dist/Whiteboard/index.js.map +1 -1
- package/dist/Whiteboard/index.mjs +1 -1
- package/dist/Whiteboard/index.mjs.map +1 -1
- package/dist/hooks/useTheme/index.d.mts +6 -2
- package/dist/hooks/useTheme/index.d.ts +6 -2
- package/dist/hooks/useTheme/index.js +102 -67
- package/dist/hooks/useTheme/index.js.map +1 -1
- package/dist/hooks/useTheme/index.mjs +103 -68
- package/dist/hooks/useTheme/index.mjs.map +1 -1
- package/dist/index.css +3 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +138 -101
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +257 -221
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -4
- package/dist/styles.css.map +1 -1
- package/dist/themeStore-P2X64zC-.d.mts +79 -0
- package/dist/themeStore-P2X64zC-.d.ts +79 -0
- package/dist/utils/index.d.mts +10 -1
- package/dist/utils/index.d.ts +10 -1
- package/dist/utils/index.js +24 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +22 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -33,7 +33,7 @@ export { MultipleChoiceList } from './MultipleChoice/index.mjs';
|
|
|
33
33
|
export { default as IconRender } from './IconRender/index.mjs';
|
|
34
34
|
export { d as SubjectData, e as SubjectEnum, I as SubjectIconProps, S as SubjectInfo, b as getSubjectColorClass, a as getSubjectIcon, g as getSubjectInfo, c as getSubjectName } from './SubjectInfo-Dvt0OodP.mjs';
|
|
35
35
|
export { DeviceType, getDeviceType, useMobile } from './hooks/useMobile/index.mjs';
|
|
36
|
-
export {
|
|
36
|
+
export { useTheme } from './hooks/useTheme/index.mjs';
|
|
37
37
|
export { cn } from './utils/index.mjs';
|
|
38
38
|
export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, ProfileToggleTheme } from './DropdownMenu/index.mjs';
|
|
39
39
|
export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.mjs';
|
|
@@ -55,6 +55,8 @@ export { default as LoadingModal } from './LoadingModal/index.mjs';
|
|
|
55
55
|
import { N as NotificationApiClient, a as Notification, F as FetchNotificationsParams, b as NotificationGroup, c as NotificationEntityType, d as NotificationType } from './NotificationCard-DMdkuVEr.mjs';
|
|
56
56
|
export { B as BackendNotification, g as BackendNotificationsResponse, e as NotificationCard, f as NotificationItem, h as NotificationsResponse, s as syncNotificationState } from './NotificationCard-DMdkuVEr.mjs';
|
|
57
57
|
export { ThemeToggle } from './ThemeToggle/index.mjs';
|
|
58
|
+
export { c as ThemeActions, T as ThemeMode, b as ThemeState, a as ThemeStore, u as useThemeStore } from './themeStore-P2X64zC-.mjs';
|
|
59
|
+
import 'zustand/middleware';
|
|
58
60
|
import 'clsx';
|
|
59
61
|
|
|
60
62
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export { MultipleChoiceList } from './MultipleChoice/index.js';
|
|
|
33
33
|
export { default as IconRender } from './IconRender/index.js';
|
|
34
34
|
export { d as SubjectData, e as SubjectEnum, I as SubjectIconProps, S as SubjectInfo, b as getSubjectColorClass, a as getSubjectIcon, g as getSubjectInfo, c as getSubjectName } from './SubjectInfo-Dvt0OodP.js';
|
|
35
35
|
export { DeviceType, getDeviceType, useMobile } from './hooks/useMobile/index.js';
|
|
36
|
-
export {
|
|
36
|
+
export { useTheme } from './hooks/useTheme/index.js';
|
|
37
37
|
export { cn } from './utils/index.js';
|
|
38
38
|
export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger, ProfileToggleTheme } from './DropdownMenu/index.js';
|
|
39
39
|
export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.js';
|
|
@@ -55,6 +55,8 @@ export { default as LoadingModal } from './LoadingModal/index.js';
|
|
|
55
55
|
import { N as NotificationApiClient, a as Notification, F as FetchNotificationsParams, b as NotificationGroup, c as NotificationEntityType, d as NotificationType } from './NotificationCard-DMdkuVEr.js';
|
|
56
56
|
export { B as BackendNotification, g as BackendNotificationsResponse, e as NotificationCard, f as NotificationItem, h as NotificationsResponse, s as syncNotificationState } from './NotificationCard-DMdkuVEr.js';
|
|
57
57
|
export { ThemeToggle } from './ThemeToggle/index.js';
|
|
58
|
+
export { c as ThemeActions, T as ThemeMode, b as ThemeState, a as ThemeStore, u as useThemeStore } from './themeStore-P2X64zC-.js';
|
|
59
|
+
import 'zustand/middleware';
|
|
58
60
|
import 'clsx';
|
|
59
61
|
|
|
60
62
|
/**
|
package/dist/index.js
CHANGED
|
@@ -159,6 +159,7 @@ __export(src_exports, {
|
|
|
159
159
|
useQuizStore: () => useQuizStore,
|
|
160
160
|
useRouteAuth: () => useRouteAuth,
|
|
161
161
|
useTheme: () => useTheme,
|
|
162
|
+
useThemeStore: () => useThemeStore,
|
|
162
163
|
useToastStore: () => ToastStore_default,
|
|
163
164
|
useUrlAuthentication: () => useUrlAuthentication,
|
|
164
165
|
withAuth: () => withAuth
|
|
@@ -1929,7 +1930,7 @@ var import_react14 = require("react");
|
|
|
1929
1930
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1930
1931
|
var import_phosphor_react9 = require("phosphor-react");
|
|
1931
1932
|
var import_react13 = require("react");
|
|
1932
|
-
var
|
|
1933
|
+
var import_zustand5 = require("zustand");
|
|
1933
1934
|
|
|
1934
1935
|
// src/components/Modal/Modal.tsx
|
|
1935
1936
|
var import_react10 = require("react");
|
|
@@ -2160,82 +2161,117 @@ var import_react12 = require("react");
|
|
|
2160
2161
|
|
|
2161
2162
|
// src/hooks/useTheme.ts
|
|
2162
2163
|
var import_react11 = require("react");
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2164
|
+
|
|
2165
|
+
// src/store/themeStore.ts
|
|
2166
|
+
var import_zustand4 = require("zustand");
|
|
2167
|
+
var import_middleware = require("zustand/middleware");
|
|
2168
|
+
var applyThemeToDOM = (mode) => {
|
|
2169
|
+
const htmlElement = document.documentElement;
|
|
2170
|
+
const originalTheme = htmlElement.getAttribute("data-original-theme");
|
|
2171
|
+
if (mode === "dark") {
|
|
2172
|
+
htmlElement.setAttribute("data-theme", "dark");
|
|
2173
|
+
return true;
|
|
2174
|
+
} else if (mode === "light") {
|
|
2175
|
+
if (originalTheme) {
|
|
2176
|
+
htmlElement.setAttribute("data-theme", originalTheme);
|
|
2177
|
+
}
|
|
2178
|
+
return false;
|
|
2179
|
+
} else if (mode === "system") {
|
|
2180
|
+
const isSystemDark = window.matchMedia(
|
|
2181
|
+
"(prefers-color-scheme: dark)"
|
|
2182
|
+
).matches;
|
|
2183
|
+
if (isSystemDark) {
|
|
2171
2184
|
htmlElement.setAttribute("data-theme", "dark");
|
|
2172
|
-
|
|
2173
|
-
} else if (
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2185
|
+
return true;
|
|
2186
|
+
} else if (originalTheme) {
|
|
2187
|
+
htmlElement.setAttribute("data-theme", originalTheme);
|
|
2188
|
+
return false;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
return false;
|
|
2192
|
+
};
|
|
2193
|
+
var saveOriginalTheme = () => {
|
|
2194
|
+
const htmlElement = document.documentElement;
|
|
2195
|
+
const currentTheme = htmlElement.getAttribute("data-theme");
|
|
2196
|
+
if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
|
|
2197
|
+
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
var useThemeStore = (0, import_zustand4.create)()(
|
|
2201
|
+
(0, import_middleware.devtools)(
|
|
2202
|
+
(0, import_middleware.persist)(
|
|
2203
|
+
(set, get) => ({
|
|
2204
|
+
// Initial state
|
|
2205
|
+
themeMode: "system",
|
|
2206
|
+
isDark: false,
|
|
2207
|
+
// Actions
|
|
2208
|
+
applyTheme: (mode) => {
|
|
2209
|
+
const isDark = applyThemeToDOM(mode);
|
|
2210
|
+
set({ isDark });
|
|
2211
|
+
},
|
|
2212
|
+
toggleTheme: () => {
|
|
2213
|
+
const { themeMode, applyTheme } = get();
|
|
2214
|
+
let newMode;
|
|
2215
|
+
if (themeMode === "light") {
|
|
2216
|
+
newMode = "dark";
|
|
2217
|
+
} else if (themeMode === "dark") {
|
|
2218
|
+
newMode = "light";
|
|
2219
|
+
} else {
|
|
2220
|
+
newMode = "dark";
|
|
2221
|
+
}
|
|
2222
|
+
set({ themeMode: newMode });
|
|
2223
|
+
applyTheme(newMode);
|
|
2224
|
+
},
|
|
2225
|
+
setTheme: (mode) => {
|
|
2226
|
+
const { applyTheme } = get();
|
|
2227
|
+
set({ themeMode: mode });
|
|
2228
|
+
applyTheme(mode);
|
|
2229
|
+
},
|
|
2230
|
+
initializeTheme: () => {
|
|
2231
|
+
const { themeMode, applyTheme } = get();
|
|
2232
|
+
saveOriginalTheme();
|
|
2233
|
+
applyTheme(themeMode);
|
|
2234
|
+
},
|
|
2235
|
+
handleSystemThemeChange: () => {
|
|
2236
|
+
const { themeMode, applyTheme } = get();
|
|
2237
|
+
if (themeMode === "system") {
|
|
2238
|
+
applyTheme("system");
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
}),
|
|
2242
|
+
{
|
|
2243
|
+
name: "theme-store",
|
|
2244
|
+
// Nome da chave no localStorage
|
|
2245
|
+
partialize: (state) => ({
|
|
2246
|
+
themeMode: state.themeMode
|
|
2247
|
+
})
|
|
2248
|
+
// Só persiste o themeMode, não o isDark
|
|
2188
2249
|
}
|
|
2250
|
+
),
|
|
2251
|
+
{
|
|
2252
|
+
name: "theme-store"
|
|
2189
2253
|
}
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
localStorage.setItem("theme-mode", newMode);
|
|
2204
|
-
}, [themeMode, applyTheme]);
|
|
2205
|
-
const setTheme = (0, import_react11.useCallback)(
|
|
2206
|
-
(mode) => {
|
|
2207
|
-
setThemeMode(mode);
|
|
2208
|
-
themeModeRef.current = mode;
|
|
2209
|
-
applyTheme(mode);
|
|
2210
|
-
localStorage.setItem("theme-mode", mode);
|
|
2211
|
-
},
|
|
2212
|
-
[applyTheme]
|
|
2213
|
-
);
|
|
2254
|
+
)
|
|
2255
|
+
);
|
|
2256
|
+
|
|
2257
|
+
// src/hooks/useTheme.ts
|
|
2258
|
+
var useTheme = () => {
|
|
2259
|
+
const {
|
|
2260
|
+
themeMode,
|
|
2261
|
+
isDark,
|
|
2262
|
+
toggleTheme,
|
|
2263
|
+
setTheme,
|
|
2264
|
+
initializeTheme,
|
|
2265
|
+
handleSystemThemeChange
|
|
2266
|
+
} = useThemeStore();
|
|
2214
2267
|
(0, import_react11.useEffect)(() => {
|
|
2215
|
-
|
|
2216
|
-
const currentTheme = htmlElement.getAttribute("data-theme");
|
|
2217
|
-
if (currentTheme && !htmlElement.getAttribute("data-original-theme")) {
|
|
2218
|
-
htmlElement.setAttribute("data-original-theme", currentTheme);
|
|
2219
|
-
}
|
|
2220
|
-
const savedThemeMode = localStorage.getItem("theme-mode");
|
|
2221
|
-
const initialMode = savedThemeMode || "system";
|
|
2222
|
-
if (!savedThemeMode) {
|
|
2223
|
-
localStorage.setItem("theme-mode", "system");
|
|
2224
|
-
}
|
|
2225
|
-
setThemeMode(initialMode);
|
|
2226
|
-
themeModeRef.current = initialMode;
|
|
2227
|
-
applyTheme(initialMode);
|
|
2268
|
+
initializeTheme();
|
|
2228
2269
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2229
|
-
const handleSystemThemeChange = () => {
|
|
2230
|
-
if (themeModeRef.current === "system") {
|
|
2231
|
-
applyTheme("system");
|
|
2232
|
-
}
|
|
2233
|
-
};
|
|
2234
2270
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
2235
2271
|
return () => {
|
|
2236
2272
|
mediaQuery.removeEventListener("change", handleSystemThemeChange);
|
|
2237
2273
|
};
|
|
2238
|
-
}, [
|
|
2274
|
+
}, [initializeTheme, handleSystemThemeChange]);
|
|
2239
2275
|
return {
|
|
2240
2276
|
themeMode,
|
|
2241
2277
|
isDark,
|
|
@@ -2315,7 +2351,7 @@ var ThemeToggle = ({
|
|
|
2315
2351
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2316
2352
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2317
2353
|
function createDropdownStore() {
|
|
2318
|
-
return (0,
|
|
2354
|
+
return (0, import_zustand5.create)((set) => ({
|
|
2319
2355
|
open: false,
|
|
2320
2356
|
setOpen: (open) => set({ open })
|
|
2321
2357
|
}));
|
|
@@ -2351,7 +2387,7 @@ var DropdownMenu = ({
|
|
|
2351
2387
|
const storeRef = (0, import_react13.useRef)(null);
|
|
2352
2388
|
storeRef.current ??= createDropdownStore();
|
|
2353
2389
|
const store = storeRef.current;
|
|
2354
|
-
const { open, setOpen: storeSetOpen } = (0,
|
|
2390
|
+
const { open, setOpen: storeSetOpen } = (0, import_zustand5.useStore)(store, (s) => s);
|
|
2355
2391
|
const setOpen = (newOpen) => {
|
|
2356
2392
|
storeSetOpen(newOpen);
|
|
2357
2393
|
};
|
|
@@ -2418,7 +2454,7 @@ var DropdownMenuTrigger = ({
|
|
|
2418
2454
|
...props
|
|
2419
2455
|
}) => {
|
|
2420
2456
|
const store = useDropdownStore(externalStore);
|
|
2421
|
-
const open = (0,
|
|
2457
|
+
const open = (0, import_zustand5.useStore)(store, (s) => s.open);
|
|
2422
2458
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2423
2459
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2424
2460
|
"button",
|
|
@@ -2478,7 +2514,7 @@ var DropdownMenuContent = (0, import_react13.forwardRef)(
|
|
|
2478
2514
|
...props
|
|
2479
2515
|
}, ref) => {
|
|
2480
2516
|
const store = useDropdownStore(externalStore);
|
|
2481
|
-
const open = (0,
|
|
2517
|
+
const open = (0, import_zustand5.useStore)(store, (s) => s.open);
|
|
2482
2518
|
const [isVisible, setIsVisible] = (0, import_react13.useState)(open);
|
|
2483
2519
|
(0, import_react13.useEffect)(() => {
|
|
2484
2520
|
if (open) {
|
|
@@ -2534,7 +2570,7 @@ var DropdownMenuItem = (0, import_react13.forwardRef)(
|
|
|
2534
2570
|
...props
|
|
2535
2571
|
}, ref) => {
|
|
2536
2572
|
const store = useDropdownStore(externalStore);
|
|
2537
|
-
const setOpen = (0,
|
|
2573
|
+
const setOpen = (0, import_zustand5.useStore)(store, (s) => s.setOpen);
|
|
2538
2574
|
const sizeClasses = ITEM_SIZE_CLASSES[size];
|
|
2539
2575
|
const handleClick = (e) => {
|
|
2540
2576
|
if (disabled) {
|
|
@@ -2595,7 +2631,7 @@ var DropdownMenuSeparator = (0, import_react13.forwardRef)(({ className, store:
|
|
|
2595
2631
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
2596
2632
|
var ProfileMenuTrigger = (0, import_react13.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
|
|
2597
2633
|
const store = useDropdownStore(externalStore);
|
|
2598
|
-
const open = (0,
|
|
2634
|
+
const open = (0, import_zustand5.useStore)(store, (s) => s.open);
|
|
2599
2635
|
const toggleOpen = () => store.setState({ open: !open });
|
|
2600
2636
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2601
2637
|
"button",
|
|
@@ -2728,7 +2764,7 @@ var ProfileMenuFooter = ({
|
|
|
2728
2764
|
...props
|
|
2729
2765
|
}) => {
|
|
2730
2766
|
const store = useDropdownStore(externalStore);
|
|
2731
|
-
const setOpen = (0,
|
|
2767
|
+
const setOpen = (0, import_zustand5.useStore)(store, (s) => s.setOpen);
|
|
2732
2768
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2733
2769
|
Button_default,
|
|
2734
2770
|
{
|
|
@@ -3962,7 +3998,7 @@ var MonthYearPicker = ({
|
|
|
3962
3998
|
"div",
|
|
3963
3999
|
{
|
|
3964
4000
|
ref: monthPickerRef,
|
|
3965
|
-
className: "absolute top-full left-0 z-50 mt-1 bg-
|
|
4001
|
+
className: "absolute top-full left-0 z-50 mt-1 bg-background rounded-lg shadow-lg border border-border-200 p-4 min-w-[280px]",
|
|
3966
4002
|
children: [
|
|
3967
4003
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-4", children: [
|
|
3968
4004
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "text-sm font-medium text-text-700 mb-2", children: "Selecionar Ano" }),
|
|
@@ -4648,8 +4684,8 @@ var ACTION_CARD_CLASSES = {
|
|
|
4648
4684
|
};
|
|
4649
4685
|
var ACTION_ICON_CLASSES = {
|
|
4650
4686
|
warning: "bg-warning-300 text-text",
|
|
4651
|
-
success: "bg-
|
|
4652
|
-
error: "bg-
|
|
4687
|
+
success: "bg-indicator-positive text-text-950",
|
|
4688
|
+
error: "bg-indicator-negative text-text",
|
|
4653
4689
|
info: "bg-info-500 text-text"
|
|
4654
4690
|
};
|
|
4655
4691
|
var ACTION_SUBTITLE_CLASSES = {
|
|
@@ -5789,7 +5825,7 @@ var CardSimulationHistory = (0, import_react17.forwardRef)(({ data, onSimulation
|
|
|
5789
5825
|
"div",
|
|
5790
5826
|
{
|
|
5791
5827
|
className: cn(
|
|
5792
|
-
"flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-
|
|
5828
|
+
"flex flex-row justify-center items-start px-4 py-6 gap-2 w-full bg-background",
|
|
5793
5829
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
5794
5830
|
),
|
|
5795
5831
|
children: [
|
|
@@ -6705,7 +6741,7 @@ var useMobile = () => {
|
|
|
6705
6741
|
};
|
|
6706
6742
|
|
|
6707
6743
|
// src/components/Select/Select.tsx
|
|
6708
|
-
var
|
|
6744
|
+
var import_zustand6 = require("zustand");
|
|
6709
6745
|
var import_react23 = require("react");
|
|
6710
6746
|
var import_phosphor_react18 = require("phosphor-react");
|
|
6711
6747
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -6744,7 +6780,7 @@ var ALIGN_CLASSES2 = {
|
|
|
6744
6780
|
end: "right-0"
|
|
6745
6781
|
};
|
|
6746
6782
|
function createSelectStore(onValueChange) {
|
|
6747
|
-
return (0,
|
|
6783
|
+
return (0, import_zustand6.create)((set) => ({
|
|
6748
6784
|
open: false,
|
|
6749
6785
|
setOpen: (open) => set({ open }),
|
|
6750
6786
|
value: "",
|
|
@@ -6810,7 +6846,7 @@ var Select = ({
|
|
|
6810
6846
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
6811
6847
|
const store = storeRef.current;
|
|
6812
6848
|
const selectRef = (0, import_react23.useRef)(null);
|
|
6813
|
-
const { open, setOpen, setValue, selectedLabel } = (0,
|
|
6849
|
+
const { open, setOpen, setValue, selectedLabel } = (0, import_zustand6.useStore)(store, (s) => s);
|
|
6814
6850
|
const generatedId = (0, import_react23.useId)();
|
|
6815
6851
|
const selectId = id ?? `select-${generatedId}`;
|
|
6816
6852
|
const findLabelForValue = (children2, targetValue) => {
|
|
@@ -6904,8 +6940,8 @@ var SelectValue = ({
|
|
|
6904
6940
|
store: externalStore
|
|
6905
6941
|
}) => {
|
|
6906
6942
|
const store = useSelectStore(externalStore);
|
|
6907
|
-
const selectedLabel = (0,
|
|
6908
|
-
const value = (0,
|
|
6943
|
+
const selectedLabel = (0, import_zustand6.useStore)(store, (s) => s.selectedLabel);
|
|
6944
|
+
const value = (0, import_zustand6.useStore)(store, (s) => s.value);
|
|
6909
6945
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
6910
6946
|
};
|
|
6911
6947
|
var SelectTrigger = (0, import_react23.forwardRef)(
|
|
@@ -6920,7 +6956,7 @@ var SelectTrigger = (0, import_react23.forwardRef)(
|
|
|
6920
6956
|
...props
|
|
6921
6957
|
}, ref) => {
|
|
6922
6958
|
const store = useSelectStore(externalStore);
|
|
6923
|
-
const open = (0,
|
|
6959
|
+
const open = (0, import_zustand6.useStore)(store, (s) => s.open);
|
|
6924
6960
|
const toggleOpen = () => store.setState({ open: !open });
|
|
6925
6961
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
6926
6962
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
@@ -6972,7 +7008,7 @@ var SelectContent = (0, import_react23.forwardRef)(
|
|
|
6972
7008
|
...props
|
|
6973
7009
|
}, ref) => {
|
|
6974
7010
|
const store = useSelectStore(externalStore);
|
|
6975
|
-
const open = (0,
|
|
7011
|
+
const open = (0, import_zustand6.useStore)(store, (s) => s.open);
|
|
6976
7012
|
if (!open) return null;
|
|
6977
7013
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
6978
7014
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
@@ -7008,7 +7044,7 @@ var SelectItem = (0, import_react23.forwardRef)(
|
|
|
7008
7044
|
setOpen,
|
|
7009
7045
|
setSelectedLabel,
|
|
7010
7046
|
onValueChange
|
|
7011
|
-
} = (0,
|
|
7047
|
+
} = (0, import_zustand6.useStore)(store, (s) => s);
|
|
7012
7048
|
const handleClick = (e) => {
|
|
7013
7049
|
const labelNode = getLabelAsNode(children);
|
|
7014
7050
|
if (!disabled) {
|
|
@@ -7050,11 +7086,11 @@ SelectItem.displayName = "SelectItem";
|
|
|
7050
7086
|
var Select_default = Select;
|
|
7051
7087
|
|
|
7052
7088
|
// src/components/Menu/Menu.tsx
|
|
7053
|
-
var
|
|
7089
|
+
var import_zustand7 = require("zustand");
|
|
7054
7090
|
var import_react24 = require("react");
|
|
7055
7091
|
var import_phosphor_react19 = require("phosphor-react");
|
|
7056
7092
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7057
|
-
var createMenuStore = (onValueChange) => (0,
|
|
7093
|
+
var createMenuStore = (onValueChange) => (0, import_zustand7.create)((set) => ({
|
|
7058
7094
|
value: "",
|
|
7059
7095
|
setValue: (value) => {
|
|
7060
7096
|
set({ value });
|
|
@@ -7085,7 +7121,7 @@ var Menu = (0, import_react24.forwardRef)(
|
|
|
7085
7121
|
const storeRef = (0, import_react24.useRef)(null);
|
|
7086
7122
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
7087
7123
|
const store = storeRef.current;
|
|
7088
|
-
const { setValue } = (0,
|
|
7124
|
+
const { setValue } = (0, import_zustand7.useStore)(store, (s) => s);
|
|
7089
7125
|
(0, import_react24.useEffect)(() => {
|
|
7090
7126
|
setValue(propValue ?? defaultValue);
|
|
7091
7127
|
}, [defaultValue, propValue, setValue]);
|
|
@@ -7141,7 +7177,7 @@ var MenuItem = (0, import_react24.forwardRef)(
|
|
|
7141
7177
|
...props
|
|
7142
7178
|
}, ref) => {
|
|
7143
7179
|
const store = useMenuStore(externalStore);
|
|
7144
|
-
const { value: selectedValue, setValue } = (0,
|
|
7180
|
+
const { value: selectedValue, setValue } = (0, import_zustand7.useStore)(store, (s) => s);
|
|
7145
7181
|
const handleClick = (e) => {
|
|
7146
7182
|
if (!disabled) {
|
|
7147
7183
|
setValue(value);
|
|
@@ -8358,7 +8394,7 @@ var Whiteboard = ({
|
|
|
8358
8394
|
"div",
|
|
8359
8395
|
{
|
|
8360
8396
|
className: cn(
|
|
8361
|
-
"flex items-center justify-center p-8 bg-
|
|
8397
|
+
"flex items-center justify-center p-8 bg-background border border-gray-100 rounded-xl",
|
|
8362
8398
|
className
|
|
8363
8399
|
),
|
|
8364
8400
|
...rest,
|
|
@@ -8782,8 +8818,8 @@ var import_phosphor_react23 = require("phosphor-react");
|
|
|
8782
8818
|
var import_react32 = require("react");
|
|
8783
8819
|
|
|
8784
8820
|
// src/components/Quiz/useQuizStore.ts
|
|
8785
|
-
var
|
|
8786
|
-
var
|
|
8821
|
+
var import_zustand8 = require("zustand");
|
|
8822
|
+
var import_middleware2 = require("zustand/middleware");
|
|
8787
8823
|
var QUESTION_DIFFICULTY = /* @__PURE__ */ ((QUESTION_DIFFICULTY2) => {
|
|
8788
8824
|
QUESTION_DIFFICULTY2["FACIL"] = "FACIL";
|
|
8789
8825
|
QUESTION_DIFFICULTY2["MEDIO"] = "MEDIO";
|
|
@@ -8830,8 +8866,8 @@ var SUBTYPE_ENUM = /* @__PURE__ */ ((SUBTYPE_ENUM2) => {
|
|
|
8830
8866
|
return SUBTYPE_ENUM2;
|
|
8831
8867
|
})(SUBTYPE_ENUM || {});
|
|
8832
8868
|
var MINUTE_INTERVAL_MS = 6e4;
|
|
8833
|
-
var useQuizStore = (0,
|
|
8834
|
-
(0,
|
|
8869
|
+
var useQuizStore = (0, import_zustand8.create)()(
|
|
8870
|
+
(0, import_middleware2.devtools)(
|
|
8835
8871
|
(set, get) => {
|
|
8836
8872
|
let timerInterval = null;
|
|
8837
8873
|
let minuteCallbackInterval = null;
|
|
@@ -9893,7 +9929,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
9893
9929
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
9894
9930
|
className: "inline-flex mb-2.5",
|
|
9895
9931
|
children: [
|
|
9896
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-
|
|
9932
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-background border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
9897
9933
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
9898
9934
|
]
|
|
9899
9935
|
},
|
|
@@ -11112,8 +11148,8 @@ var import_phosphor_react25 = require("phosphor-react");
|
|
|
11112
11148
|
var import_react35 = require("react");
|
|
11113
11149
|
|
|
11114
11150
|
// src/store/notificationStore.ts
|
|
11115
|
-
var
|
|
11116
|
-
var
|
|
11151
|
+
var import_zustand9 = require("zustand");
|
|
11152
|
+
var import_middleware3 = require("zustand/middleware");
|
|
11117
11153
|
|
|
11118
11154
|
// src/types/notifications.ts
|
|
11119
11155
|
var NotificationEntityType = /* @__PURE__ */ ((NotificationEntityType2) => {
|
|
@@ -11221,8 +11257,8 @@ var formatTimeAgo = (date) => {
|
|
|
11221
11257
|
return new Date(date).toLocaleDateString("pt-BR");
|
|
11222
11258
|
};
|
|
11223
11259
|
var createNotificationStore = (apiClient) => {
|
|
11224
|
-
return (0,
|
|
11225
|
-
(0,
|
|
11260
|
+
return (0, import_zustand9.create)()(
|
|
11261
|
+
(0, import_middleware3.devtools)(
|
|
11226
11262
|
(set, get) => ({
|
|
11227
11263
|
// Initial state
|
|
11228
11264
|
notifications: [],
|
|
@@ -12098,6 +12134,7 @@ var createNotificationsHook = (apiClient) => {
|
|
|
12098
12134
|
useQuizStore,
|
|
12099
12135
|
useRouteAuth,
|
|
12100
12136
|
useTheme,
|
|
12137
|
+
useThemeStore,
|
|
12101
12138
|
useToastStore,
|
|
12102
12139
|
useUrlAuthentication,
|
|
12103
12140
|
withAuth
|