analytica-frontend-lib 1.1.68 → 1.1.69

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.
@@ -0,0 +1,79 @@
1
+ import * as zustand_middleware from 'zustand/middleware';
2
+ import * as zustand from 'zustand';
3
+
4
+ type ThemeMode = 'light' | 'dark' | 'system';
5
+ /**
6
+ * Theme store state interface
7
+ */
8
+ interface ThemeState {
9
+ /**
10
+ * Current theme mode
11
+ */
12
+ themeMode: ThemeMode;
13
+ /**
14
+ * Whether the current theme is dark
15
+ */
16
+ isDark: boolean;
17
+ }
18
+ /**
19
+ * Theme store actions interface
20
+ */
21
+ interface ThemeActions {
22
+ /**
23
+ * Apply theme based on the mode selected
24
+ */
25
+ applyTheme: (mode: ThemeMode) => void;
26
+ /**
27
+ * Toggle between themes
28
+ */
29
+ toggleTheme: () => void;
30
+ /**
31
+ * Set a specific theme mode
32
+ */
33
+ setTheme: (mode: ThemeMode) => void;
34
+ /**
35
+ * Initialize theme on app start
36
+ */
37
+ initializeTheme: () => void;
38
+ /**
39
+ * Handle system theme change
40
+ */
41
+ handleSystemThemeChange: () => void;
42
+ }
43
+ type ThemeStore = ThemeState & ThemeActions;
44
+ /**
45
+ * Theme store using Zustand with persistence
46
+ */
47
+ declare const useThemeStore: zustand.UseBoundStore<Omit<Omit<zustand.StoreApi<ThemeStore>, "setState" | "devtools"> & {
48
+ setState(partial: ThemeStore | Partial<ThemeStore> | ((state: ThemeStore) => ThemeStore | Partial<ThemeStore>), replace?: false | undefined, action?: (string | {
49
+ [x: string]: unknown;
50
+ [x: number]: unknown;
51
+ [x: symbol]: unknown;
52
+ type: string;
53
+ }) | undefined): void;
54
+ setState(state: ThemeStore | ((state: ThemeStore) => ThemeStore), replace: true, action?: (string | {
55
+ [x: string]: unknown;
56
+ [x: number]: unknown;
57
+ [x: symbol]: unknown;
58
+ type: string;
59
+ }) | undefined): void;
60
+ devtools: {
61
+ cleanup: () => void;
62
+ };
63
+ }, "persist"> & {
64
+ persist: {
65
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<ThemeStore, {
66
+ themeMode: ThemeMode;
67
+ }>>) => void;
68
+ clearStorage: () => void;
69
+ rehydrate: () => Promise<void> | void;
70
+ hasHydrated: () => boolean;
71
+ onHydrate: (fn: (state: ThemeStore) => void) => () => void;
72
+ onFinishHydration: (fn: (state: ThemeStore) => void) => () => void;
73
+ getOptions: () => Partial<zustand_middleware.PersistOptions<ThemeStore, {
74
+ themeMode: ThemeMode;
75
+ }>>;
76
+ };
77
+ }>;
78
+
79
+ export { type ThemeMode as T, type ThemeStore as a, type ThemeState as b, type ThemeActions as c, useThemeStore as u };
@@ -0,0 +1,79 @@
1
+ import * as zustand_middleware from 'zustand/middleware';
2
+ import * as zustand from 'zustand';
3
+
4
+ type ThemeMode = 'light' | 'dark' | 'system';
5
+ /**
6
+ * Theme store state interface
7
+ */
8
+ interface ThemeState {
9
+ /**
10
+ * Current theme mode
11
+ */
12
+ themeMode: ThemeMode;
13
+ /**
14
+ * Whether the current theme is dark
15
+ */
16
+ isDark: boolean;
17
+ }
18
+ /**
19
+ * Theme store actions interface
20
+ */
21
+ interface ThemeActions {
22
+ /**
23
+ * Apply theme based on the mode selected
24
+ */
25
+ applyTheme: (mode: ThemeMode) => void;
26
+ /**
27
+ * Toggle between themes
28
+ */
29
+ toggleTheme: () => void;
30
+ /**
31
+ * Set a specific theme mode
32
+ */
33
+ setTheme: (mode: ThemeMode) => void;
34
+ /**
35
+ * Initialize theme on app start
36
+ */
37
+ initializeTheme: () => void;
38
+ /**
39
+ * Handle system theme change
40
+ */
41
+ handleSystemThemeChange: () => void;
42
+ }
43
+ type ThemeStore = ThemeState & ThemeActions;
44
+ /**
45
+ * Theme store using Zustand with persistence
46
+ */
47
+ declare const useThemeStore: zustand.UseBoundStore<Omit<Omit<zustand.StoreApi<ThemeStore>, "setState" | "devtools"> & {
48
+ setState(partial: ThemeStore | Partial<ThemeStore> | ((state: ThemeStore) => ThemeStore | Partial<ThemeStore>), replace?: false | undefined, action?: (string | {
49
+ [x: string]: unknown;
50
+ [x: number]: unknown;
51
+ [x: symbol]: unknown;
52
+ type: string;
53
+ }) | undefined): void;
54
+ setState(state: ThemeStore | ((state: ThemeStore) => ThemeStore), replace: true, action?: (string | {
55
+ [x: string]: unknown;
56
+ [x: number]: unknown;
57
+ [x: symbol]: unknown;
58
+ type: string;
59
+ }) | undefined): void;
60
+ devtools: {
61
+ cleanup: () => void;
62
+ };
63
+ }, "persist"> & {
64
+ persist: {
65
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<ThemeStore, {
66
+ themeMode: ThemeMode;
67
+ }>>) => void;
68
+ clearStorage: () => void;
69
+ rehydrate: () => Promise<void> | void;
70
+ hasHydrated: () => boolean;
71
+ onHydrate: (fn: (state: ThemeStore) => void) => () => void;
72
+ onFinishHydration: (fn: (state: ThemeStore) => void) => () => void;
73
+ getOptions: () => Partial<zustand_middleware.PersistOptions<ThemeStore, {
74
+ themeMode: ThemeMode;
75
+ }>>;
76
+ };
77
+ }>;
78
+
79
+ export { type ThemeMode as T, type ThemeStore as a, type ThemeState as b, type ThemeActions as c, useThemeStore as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analytica-frontend-lib",
3
- "version": "1.1.68",
3
+ "version": "1.1.69",
4
4
  "description": "Repositório público dos componentes utilizados nas plataformas da Analytica Ensino",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "./dist/index.js",