sevago-sso-fe 1.0.23 → 1.0.25

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/README.md CHANGED
@@ -5,13 +5,15 @@ A comprehensive Single Sign-On (SSO) frontend library built with React, TypeScri
5
5
  ## Features
6
6
 
7
7
  - 🔐 Complete authentication system with login, logout, and token management
8
- - 🎨 Material-UI components with custom styling
8
+ - 🎨 Material-UI components with custom styling and theming
9
9
  - 📱 Responsive design with mobile support
10
10
  - 🔄 Redux state management with persistence
11
11
  - 🌐 API integration with axios
12
12
  - 🔔 Real-time notifications with Firebase
13
13
  - 📊 Dashboard components and layouts
14
14
  - 🎯 TypeScript support with full type definitions
15
+ - 🎭 Framer Motion animations
16
+ - 🔌 Socket.io integration for real-time features
15
17
 
16
18
  ## Installation
17
19
 
@@ -24,7 +26,7 @@ npm install sevago-sso-fe
24
26
  This library requires the following peer dependencies to be installed in your project:
25
27
 
26
28
  ```bash
27
- npm install react react-dom @emotion/react @emotion/styled @mui/material @mui/system @reduxjs/toolkit react-redux react-router-dom redux-persist
29
+ npm install react@>=17 react-dom@>=17 @emotion/react@>=11 @emotion/styled@>=11 @mui/material@>=5 @mui/system@>=5 @reduxjs/toolkit@^2.9.2 react-redux@^9.2.0 react-router-dom@^7.9.4 redux-persist@^6.0.0
28
30
  ```
29
31
 
30
32
  ## Usage
@@ -36,21 +38,28 @@ import React from 'react';
36
38
  import { Provider } from 'react-redux';
37
39
  import { PersistGate } from 'redux-persist/integration/react';
38
40
  import { BrowserRouter } from 'react-router-dom';
39
- import { SystemMonitorScreen, store, persistor } from 'sevago-sso-fe';
41
+ import {
42
+ App,
43
+ store,
44
+ persistor,
45
+ SnackbarProvider
46
+ } from 'sevago-sso-fe';
40
47
 
41
- function App() {
48
+ function RootApp() {
42
49
  return (
43
50
  <Provider store={store}>
44
51
  <PersistGate loading={null} persistor={persistor}>
45
52
  <BrowserRouter>
46
- <SystemMonitorScreen />
53
+ <SnackbarProvider>
54
+ <App />
55
+ </SnackbarProvider>
47
56
  </BrowserRouter>
48
57
  </PersistGate>
49
58
  </Provider>
50
59
  );
51
60
  }
52
61
 
53
- export default App;
62
+ export default RootApp;
54
63
  ```
55
64
 
56
65
  ### Using Individual Components
@@ -60,7 +69,10 @@ import {
60
69
  useSnackbar,
61
70
  useApps,
62
71
  authApi,
63
- userApi
72
+ userApi,
73
+ SystemMonitorScreen,
74
+ DashboardPage,
75
+ AuthPage
64
76
  } from 'sevago-sso-fe';
65
77
 
66
78
  function MyComponent() {
@@ -78,6 +90,7 @@ function MyComponent() {
78
90
 
79
91
  return (
80
92
  <div>
93
+ <SystemMonitorScreen />
81
94
  {/* Your content */}
82
95
  </div>
83
96
  );
@@ -91,13 +104,25 @@ import {
91
104
  useSnackbar,
92
105
  useApps,
93
106
  useVersionCheck,
94
- useUpdateCurrentAccess
107
+ useUpdateCurrentAccess,
108
+ useActiveSidebar,
109
+ useAllApps,
110
+ useIsSystemMonitor,
111
+ useSidebarState,
112
+ useTagSelector,
113
+ useSidebar
95
114
  } from 'sevago-sso-fe';
96
115
 
97
116
  function MyComponent() {
98
117
  const { showSnackbar } = useSnackbar();
99
118
  const { apps, loading } = useApps();
100
119
  const { updateAccess } = useUpdateCurrentAccess();
120
+ const { isActive } = useActiveSidebar();
121
+ const { allApps } = useAllApps();
122
+ const { isSystemMonitor } = useIsSystemMonitor();
123
+ const { sidebarState } = useSidebarState();
124
+ const { selectedTags, toggleTag } = useTagSelector();
125
+ const { sidebar } = useSidebar();
101
126
 
102
127
  // Version checking
103
128
  useVersionCheck({ interval: 5 * 60 * 1000 });
@@ -115,7 +140,7 @@ function MyComponent() {
115
140
  ### Using API Services
116
141
 
117
142
  ```tsx
118
- import { authApi, userApi, notificationApi } from 'sevago-sso-fe';
143
+ import { authApi, userApi, notificationApi, orgUnitApi } from 'sevago-sso-fe';
119
144
 
120
145
  // Authentication
121
146
  const loginResponse = await authApi.login({ email, password });
@@ -128,49 +153,108 @@ const updatedUser = await userApi.updateAccount(userData);
128
153
  // Notifications
129
154
  const notifications = await notificationApi.getListNotification(params);
130
155
  await notificationApi.subscribeTopic({ token });
156
+
157
+ // Organization units
158
+ const orgUnits = await orgUnitApi.getOrgUnits();
131
159
  ```
132
160
 
133
161
  ## API Reference
134
162
 
163
+ ### Main App Component
164
+ - `App` - Main application component with theme provider and routing
165
+
166
+ ### Pages
167
+ - `AuthPage` - Authentication page
168
+ - `DashboardPage` - Main dashboard page
169
+ - `ErrorPage` - Error page
170
+ - `NotFoundPage` - 404 not found page
171
+
172
+ ### Dashboard Screens
173
+ - `SystemMonitorScreen` - System monitoring dashboard screen
174
+
175
+ ### Layouts
176
+ - `AuthLayout` - Authentication layout
177
+ - `DashboardLayout` - Dashboard layout
178
+ - `DefaultLayout` - Default layout
179
+
135
180
  ### Components
136
- - `AppGrid`
137
- - `AvatarElement`
138
- - `AvatarUserInfo`
139
- - `AvatarUserComponent`
140
- - `BellComponent`
141
- - `EmptyComponent`
142
- - `LoadingComponent`
143
- - `LogoComponent`
144
- - `MotionBox`
145
- - `TimeAgoContentComponent`
146
- - `TimeAgoComponent`
181
+
182
+ #### Core Components
183
+ - `AppGrid` - Application grid component
184
+ - `AvatarElement` - Avatar element
185
+ - `AvatarUserInfo` - User info avatar
186
+ - `AvatarUserComponent` - User avatar component
187
+ - `BellComponent` - Notification bell component
188
+ - `EmptyComponent` - Empty state component
189
+ - `LoadingComponent` - Loading component
190
+ - `LogoComponent` - Logo component
191
+ - `MotionBox` - Framer Motion box component
192
+ - `TimeAgoContentComponent` - Time ago content
193
+ - `TimeAgoComponent` - Time ago component
194
+
195
+ #### UI Elements
196
+ - `ButtonElement` - Custom button element
197
+ - `IconElement` - Icon element
198
+ - `ImageElement` - Image element
199
+ - `RadioElement` - Radio button element
200
+ - `TextFieldElement` - Text field element
201
+ - `TooltipOnClickElement` - Tooltip on click element
202
+ - `TypographyContentCaption` - Typography caption
147
203
 
148
204
  ### Hooks
149
- - `useSnackbar()` - Snackbar notifications
205
+ - `useSnackbar()` - Snackbar notifications with SnackbarProvider
150
206
  - `useApps()` - Application management
207
+ - `useActiveSidebar()` - Active sidebar state
208
+ - `useAllApps()` - All applications access
209
+ - `useIsSystemMonitor()` - System monitor check
210
+ - `useSidebarState()` - Sidebar state management
151
211
  - `useTagSelector()` - Tag selection functionality
152
212
  - `useUpdateCurrentAccess()` - Access control updates
153
213
  - `useVersionCheck(options)` - Version checking
214
+ - `useSidebar()` - Sidebar management
154
215
 
155
216
  ### API Services
156
- - `authApi` - Authentication operations
157
- - `userApi` - User management
158
- - `notificationApi` - Notification handling
217
+ - `authApi` - Authentication operations (login, logout, refresh token, etc.)
218
+ - `userApi` - User management (get user, update account, etc.)
219
+ - `notificationApi` - Notification handling (get notifications, subscribe topics, etc.)
159
220
  - `orgUnitApi` - Organization unit management
160
221
 
161
222
  ### Redux Store
162
223
  - `store` - Redux store instance
163
224
  - `persistor` - Redux persist instance
164
- - `remainingWeightSlice ` - Redux remainingWeightSlice
165
- - `account` - login/logout/resetPassword/refreshToken/subscribeTopic/unsubscribeTopic/changeNotificationCount/changeSidebarCount/updateAccount/getAccount/updatePositionOrgUnit/updateCurrentAccess
166
- - `system` - changeMode(GlobalSystemState)
225
+ - `GlobalReduxState` - Global Redux state type
167
226
 
168
- ### Utilities
227
+ #### Redux Slices
228
+ - `remainingWeightSlice` - Remaining weight management
229
+ - `account` - Account management (login, logout, reset password, refresh token, subscribe topic, unsubscribe topic, change notification count, change sidebar count, update account, get account, update position org unit, update current access)
230
+ - `system` - System management (change mode, theme management)
231
+
232
+ ### Router Utilities
169
233
  - `renderRoutes` - Route rendering utility
170
- - `routeConstants` - Route constants
171
- - `STYLE` - Style constants
172
- - `MODE` - Theme modes
173
- - `timeUtils` - Time utility functions (getTimeAgo, getDateTime, getDate, checkNowYear,getMonthRangeForYear, getDayOffsetPx, isSameDateTime, getTimeDate, isDateString)
234
+ - `routes` - Route definitions
235
+ - `routeConstants` - Route constants (ALLOW_USER_TYPES, BOOKING_SCREEN, DASHBOARD_SCREEN, etc.)
236
+ - `RouteType` - Route type enum
237
+
238
+ ### Common Utilities
239
+
240
+ #### Constants
241
+ - `STYLE` - Style constants (padding, border radius, heights, etc.)
242
+ - `MODE` - Theme modes (light, dark, other)
243
+ - `OPACITY` - Opacity constants
244
+ - `APPS_CONSTANT` - Application constants
245
+ - `REG_EXP` - Regular expression constants
246
+ - `TYPOGRAPHY` - Typography constants
247
+
248
+ #### Utils
249
+ - `timeUtils` - Time utility functions (getTimeAgo, getDateTime, getDate, checkNowYear, getMonthRangeForYear, getDayOffsetPx, isSameDateTime, getTimeDate, isDateString)
250
+ - `stringUtils` - String utility functions
251
+ - `findCurrentAccessHelper` - Access control helper
252
+ - `otherUtils` - Other utility functions
253
+
254
+ #### Configuration
255
+ - `axiosConfig` - Axios configuration
256
+ - `firebaseConfig` - Firebase configuration
257
+ - `socketConfig` - Socket.io configuration
174
258
 
175
259
  ## Configuration
176
260
 
@@ -182,6 +266,12 @@ import { initializeApp } from 'firebase/app';
182
266
 
183
267
  const firebaseConfig = {
184
268
  // Your Firebase config
269
+ apiKey: "your-api-key",
270
+ authDomain: "your-auth-domain",
271
+ projectId: "your-project-id",
272
+ storageBucket: "your-storage-bucket",
273
+ messagingSenderId: "your-sender-id",
274
+ appId: "your-app-id"
185
275
  };
186
276
 
187
277
  initializeApp(firebaseConfig);
@@ -197,21 +287,33 @@ import { axiosRequest } from 'sevago-sso-fe';
197
287
  axiosRequest.defaults.baseURL = 'https://your-api.com';
198
288
  ```
199
289
 
290
+ ### Environment Variables
291
+ Set up the following environment variables:
292
+
293
+ ```env
294
+ REACT_APP_FIREBASE_VAPID_KEY=your-vapid-key
295
+ REACT_APP_API_BASE_URL=your-api-base-url
296
+ ```
297
+
200
298
  ## Styling
201
299
 
202
300
  The library includes comprehensive styling constants and Material-UI theme customization:
203
301
 
204
302
  ```tsx
205
- import { STYLE, MODE } from 'sevago-sso-fe';
303
+ import { STYLE, MODE, OPACITY } from 'sevago-sso-fe';
206
304
 
207
305
  // Use style constants
208
306
  const customStyle = {
209
307
  padding: STYLE.PADDING_GAP_LAYOUT,
210
308
  borderRadius: STYLE.BORDER_RADIUS_ELEMENT,
309
+ height: STYLE.HEIGHT_DEFAULT_TEXT_FIELD_BUTTON,
211
310
  };
212
311
 
213
312
  // Use theme modes
214
- const theme = createTheme(MODE.light); // or MODE.dark
313
+ const theme = createTheme(MODE.light); // or MODE.dark or MODE.other
314
+
315
+ // Use opacity constants
316
+ const semiTransparent = `${MODE.light.palette.primary.main}${OPACITY[50]}`;
215
317
  ```
216
318
 
217
319
  ## TypeScript Support
@@ -220,11 +322,12 @@ Full TypeScript support is included with comprehensive type definitions:
220
322
 
221
323
  ```tsx
222
324
  import type {
223
- RootState,
224
- AppDispatch,
325
+ GlobalReduxState,
225
326
  LoginDto,
226
327
  User,
227
- Notification
328
+ Notification,
329
+ SnackbarType,
330
+ RouteType
228
331
  } from 'sevago-sso-fe';
229
332
  ```
230
333
 
@@ -237,4 +340,25 @@ To contribute to this library:
237
340
  3. Run development server: `npm run dev`
238
341
  4. Build library: `npm run build:lib`
239
342
  5. Test the build: `npm run preview`
240
- ## Changelog
343
+ 6. Lint code: `npm run lint`
344
+
345
+ ## Changelog
346
+
347
+ ### Version 1.0.23
348
+ - Initial release with comprehensive SSO functionality
349
+ - Complete authentication system
350
+ - Material-UI integration with custom theming
351
+ - Redux state management with persistence
352
+ - Firebase notifications support
353
+ - Dashboard and system monitoring components
354
+ - TypeScript support throughout
355
+ - Socket.io integration for real-time features
356
+
357
+ ## License
358
+
359
+ MIT
360
+
361
+ ## Repository
362
+
363
+ - GitHub: https://github.com/dev1-gmail2025/sevago-sso-fe
364
+ - Issues: https://github.com/dev1-gmail2025/sevago-sso-fe/issues
@@ -1 +1 @@
1
- export declare const TypographyFilter: import('@emotion/styled').StyledComponent<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "position" | "p" | "style" | "children" | "m" | "classes" | "className" | "color" | "top" | "bottom" | "left" | "right" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
1
+ export declare const TypographyFilter: import('@emotion/styled').StyledComponent<import('@mui/material').TypographyOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "position" | "children" | "p" | "style" | "zIndex" | "typography" | "fontFamily" | "fontSize" | "fontWeight" | "textTransform" | "m" | "classes" | "className" | "color" | "top" | "bottom" | "left" | "right" | "border" | "boxShadow" | "alignContent" | "alignItems" | "alignSelf" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "rowGap" | "textAlign" | "textOverflow" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;