@trii/components 2.0.73 → 2.0.74

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/index.d.ts CHANGED
@@ -4,6 +4,9 @@ import { SxProps, Theme } from '@mui/material';
4
4
  import { IContact as IContact$1, IBusiness as IBusiness$1 } from '@trii/types/dist/Contacts/contacts';
5
5
  import React from 'react';
6
6
  import * as i18next from 'i18next';
7
+ import * as _reduxjs_toolkit from '@reduxjs/toolkit';
8
+ import * as redux_thunk from 'redux-thunk';
9
+ import * as redux from 'redux';
7
10
 
8
11
  interface ContactInfoPopupProps {
9
12
  open: boolean;
@@ -165,4 +168,129 @@ interface TaskData {
165
168
 
166
169
  declare const i18nInstance: i18next.i18n;
167
170
 
168
- export { type Calendar, type Contact, ContactInfoPopup, EditContactModal, type EventData, EventsDialog, type EventsDialogProps, type ItemType, type ModalMode, type Notification, type TaskData, i18nInstance as i18n };
171
+ declare const MuiComponentsConfig: (themeRedux: Theme) => Theme;
172
+
173
+ declare module '@mui/material/styles' {
174
+ interface TypeBackground {
175
+ mainCenter: string;
176
+ mainGradient: string;
177
+ navMenu: string;
178
+ dropdownMenu: string;
179
+ panel: string;
180
+ tooltip: string;
181
+ accordionHeader: string;
182
+ panelHeader: string;
183
+ panelCenter: string;
184
+ }
185
+ interface TypeText {
186
+ colorMain: string;
187
+ }
188
+ interface Palette {
189
+ containerBox: {
190
+ default: string;
191
+ main: string;
192
+ };
193
+ dropdownBox: string;
194
+ color: {
195
+ icons: string;
196
+ };
197
+ cellHeader: string;
198
+ Skeleton: {
199
+ bg: string;
200
+ };
201
+ messageBox: string;
202
+ boxShadow: string;
203
+ disabled: string;
204
+ }
205
+ interface PaletteOptions {
206
+ containerBox?: {
207
+ default?: string;
208
+ main?: string;
209
+ };
210
+ dropdownBox?: string;
211
+ color?: {
212
+ icons?: string;
213
+ };
214
+ cellHeader?: string;
215
+ Skeleton?: {
216
+ bg?: string;
217
+ };
218
+ messageBox?: string;
219
+ boxShadow?: string;
220
+ disabled?: string;
221
+ }
222
+ interface Theme {
223
+ name?: string;
224
+ }
225
+ interface ThemeOptions {
226
+ name?: string;
227
+ }
228
+ }
229
+ declare const lightBlueIndigo: Theme;
230
+ declare const lightBlue: Theme;
231
+ declare const lightRed: Theme;
232
+ declare const lightGreen: Theme;
233
+ declare const lightPink: Theme;
234
+ declare const lightPurple: Theme;
235
+ declare const lightTeal: Theme;
236
+ declare const lightLime: Theme;
237
+ declare const lightYellow: Theme;
238
+ declare const lightAmber: Theme;
239
+ declare const lightOrange: Theme;
240
+ declare const lightBrown: Theme;
241
+ declare const lightGray: Theme;
242
+ declare const darkBlue: Theme;
243
+ declare const darkBlack: Theme;
244
+
245
+ /**
246
+ * Minimal root state shape required by this slice.
247
+ * Consumer apps must include both Theme and User (with uid) in their store.
248
+ */
249
+ interface ThemeRootState {
250
+ User: {
251
+ user: {
252
+ uid: string;
253
+ };
254
+ };
255
+ Theme: ThemeState;
256
+ }
257
+ /**
258
+ * Theme name type - defines all available theme options
259
+ */
260
+ type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
261
+ /**
262
+ * Theme slice state interface
263
+ */
264
+ interface ThemeState {
265
+ themeSelected: Theme;
266
+ darkMode: boolean;
267
+ toggleStatus: 'idle' | 'toggled';
268
+ }
269
+ /**
270
+ * Async thunk to update theme on the server
271
+ */
272
+ declare const updateTheme: _reduxjs_toolkit.AsyncThunk<{
273
+ theme: ThemeName;
274
+ }, ThemeName, {
275
+ state: ThemeRootState;
276
+ dispatch?: redux_thunk.ThunkDispatch<unknown, unknown, redux.UnknownAction> | undefined;
277
+ extra?: unknown;
278
+ rejectValue?: unknown;
279
+ serializedErrorType?: unknown;
280
+ pendingMeta?: unknown;
281
+ fulfilledMeta?: unknown;
282
+ rejectedMeta?: unknown;
283
+ }>;
284
+ /**
285
+ * Type guard to check if a string is a valid ThemeName
286
+ * @param theme - String to validate
287
+ * @returns true if theme is a valid ThemeName
288
+ */
289
+ declare const isValidThemeName: (theme: string) => theme is ThemeName;
290
+ declare const toggleTheme: _reduxjs_toolkit.ActionCreatorWithPayload<ThemeName, "Theme/toggleTheme">;
291
+ declare const toggleModeTheme: _reduxjs_toolkit.ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
292
+ declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
293
+ declare const selectedTheme: (state: ThemeRootState) => Theme;
294
+ declare const selectedDarkTheme: (state: ThemeRootState) => boolean;
295
+
296
+ export { type Calendar, type Contact, ContactInfoPopup, EditContactModal, type EventData, EventsDialog, type EventsDialogProps, type ItemType, type ModalMode, MuiComponentsConfig, type Notification, type TaskData, type ThemeName, type ThemeRootState, type ThemeState, darkBlack, darkBlue, i18nInstance as i18n, isValidThemeName, lightAmber, lightBlue, lightBlueIndigo, lightBrown, lightGray, lightGreen, lightLime, lightOrange, lightPink, lightPurple, lightRed, lightTeal, lightYellow, selectThemeToggleStatus, selectedDarkTheme, selectedTheme, toggleModeTheme, toggleTheme, updateTheme };
@@ -0,0 +1,3 @@
1
+ export { default as MuiComponentsConfig } from './MuiComponentsConfig';
2
+ export * from './themeProvider';
3
+ export * from './themeSlice';
@@ -0,0 +1,72 @@
1
+ import { Theme } from '@mui/material';
2
+ declare module '@mui/material/styles' {
3
+ interface TypeBackground {
4
+ mainCenter: string;
5
+ mainGradient: string;
6
+ navMenu: string;
7
+ dropdownMenu: string;
8
+ panel: string;
9
+ tooltip: string;
10
+ accordionHeader: string;
11
+ panelHeader: string;
12
+ panelCenter: string;
13
+ }
14
+ interface TypeText {
15
+ colorMain: string;
16
+ }
17
+ interface Palette {
18
+ containerBox: {
19
+ default: string;
20
+ main: string;
21
+ };
22
+ dropdownBox: string;
23
+ color: {
24
+ icons: string;
25
+ };
26
+ cellHeader: string;
27
+ Skeleton: {
28
+ bg: string;
29
+ };
30
+ messageBox: string;
31
+ boxShadow: string;
32
+ disabled: string;
33
+ }
34
+ interface PaletteOptions {
35
+ containerBox?: {
36
+ default?: string;
37
+ main?: string;
38
+ };
39
+ dropdownBox?: string;
40
+ color?: {
41
+ icons?: string;
42
+ };
43
+ cellHeader?: string;
44
+ Skeleton?: {
45
+ bg?: string;
46
+ };
47
+ messageBox?: string;
48
+ boxShadow?: string;
49
+ disabled?: string;
50
+ }
51
+ interface Theme {
52
+ name?: string;
53
+ }
54
+ interface ThemeOptions {
55
+ name?: string;
56
+ }
57
+ }
58
+ export declare const lightBlueIndigo: Theme;
59
+ export declare const lightBlue: Theme;
60
+ export declare const lightRed: Theme;
61
+ export declare const lightGreen: Theme;
62
+ export declare const lightPink: Theme;
63
+ export declare const lightPurple: Theme;
64
+ export declare const lightTeal: Theme;
65
+ export declare const lightLime: Theme;
66
+ export declare const lightYellow: Theme;
67
+ export declare const lightAmber: Theme;
68
+ export declare const lightOrange: Theme;
69
+ export declare const lightBrown: Theme;
70
+ export declare const lightGray: Theme;
71
+ export declare const darkBlue: Theme;
72
+ export declare const darkBlack: Theme;
@@ -0,0 +1,52 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Minimal root state shape required by this slice.
4
+ * Consumer apps must include both Theme and User (with uid) in their store.
5
+ */
6
+ export interface ThemeRootState {
7
+ User: {
8
+ user: {
9
+ uid: string;
10
+ };
11
+ };
12
+ Theme: ThemeState;
13
+ }
14
+ /**
15
+ * Theme name type - defines all available theme options
16
+ */
17
+ export type ThemeName = 'lightBlueIndigo' | 'darkBlack' | 'darkBlue' | 'lightAmber' | 'lightBlue' | 'lightBrown' | 'lightGray' | 'lightGreen' | 'lightLime' | 'lightOrange' | 'lightPink' | 'lightPurple' | 'lightRed' | 'lightTeal' | 'lightYellow';
18
+ /**
19
+ * Theme slice state interface
20
+ */
21
+ export interface ThemeState {
22
+ themeSelected: Theme;
23
+ darkMode: boolean;
24
+ toggleStatus: 'idle' | 'toggled';
25
+ }
26
+ /**
27
+ * Async thunk to update theme on the server
28
+ */
29
+ export declare const updateTheme: import("@reduxjs/toolkit").AsyncThunk<{
30
+ theme: ThemeName;
31
+ }, ThemeName, {
32
+ state: ThemeRootState;
33
+ dispatch?: import("redux-thunk").ThunkDispatch<unknown, unknown, import("redux").UnknownAction> | undefined;
34
+ extra?: unknown;
35
+ rejectValue?: unknown;
36
+ serializedErrorType?: unknown;
37
+ pendingMeta?: unknown;
38
+ fulfilledMeta?: unknown;
39
+ rejectedMeta?: unknown;
40
+ }>;
41
+ /**
42
+ * Type guard to check if a string is a valid ThemeName
43
+ * @param theme - String to validate
44
+ * @returns true if theme is a valid ThemeName
45
+ */
46
+ export declare const isValidThemeName: (theme: string) => theme is ThemeName;
47
+ export declare const toggleTheme: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeName, "Theme/toggleTheme">, toggleModeTheme: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"Theme/toggleModeTheme">;
48
+ export declare const selectThemeToggleStatus: (state: ThemeRootState) => "idle" | "toggled";
49
+ export declare const selectedTheme: (state: ThemeRootState) => Theme;
50
+ export declare const selectedDarkTheme: (state: ThemeRootState) => boolean;
51
+ declare const _default: import("redux").Reducer<ThemeState>;
52
+ export default _default;
@@ -1,2 +1,3 @@
1
1
  export * from './components';
2
2
  export { i18n } from './i18n';
3
+ export * from './components/EventsDialog/theme';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/components",
3
- "version": "2.0.73",
3
+ "version": "2.0.74",
4
4
  "description": "Trii components package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -60,6 +60,7 @@
60
60
  "@mui/icons-material": "^5.15.15",
61
61
  "@mui/lab": "^5.0.0-alpha.176",
62
62
  "@mui/material": "^5.18.0",
63
+ "@reduxjs/toolkit": "^2.11.2",
63
64
  "@rollup/plugin-commonjs": "^25.0.4",
64
65
  "@rollup/plugin-json": "^6.1.0",
65
66
  "@rollup/plugin-node-resolve": "^15.2.1",
@@ -82,6 +83,7 @@
82
83
  "@types/react": "^18.2.23",
83
84
  "@typescript-eslint/eslint-plugin": "^8.53.0",
84
85
  "@typescript-eslint/parser": "^8.53.0",
86
+ "axios": "^1.14.0",
85
87
  "babel-jest": "^29.7.0",
86
88
  "esbuild": "^0.27.2",
87
89
  "eslint": "^9.39.2",
@@ -91,6 +93,7 @@
91
93
  "eslint-plugin-react": "^7.37.5",
92
94
  "eslint-plugin-react-hooks": "^7.0.1",
93
95
  "google-libphonenumber": "^3.2.44",
96
+ "immer": "^11.1.4",
94
97
  "jest": "^29.7.0",
95
98
  "jest-environment-jsdom": "^29.7.0",
96
99
  "npm-run-all": "^4.1.5",
@@ -111,6 +114,8 @@
111
114
  "@emotion/react": "^11.11.4",
112
115
  "@mui/x-date-pickers": "^8.24.0",
113
116
  "@mui/x-date-pickers-pro": "^8.24.0",
117
+ "@reduxjs/toolkit": ">=1.9.0",
118
+ "axios": ">=1.0.0",
114
119
  "dayjs": "^1.11.19",
115
120
  "google-libphonenumber": "^3.2.43",
116
121
  "i18next": "^25.8.0",