sevago-library 1.1.0 → 1.1.2
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/CHANGELOG.md +19 -0
- package/README.md +155 -228
- package/package.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# sevago-library
|
|
2
|
+
|
|
3
|
+
## 1.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- update deploy.sh
|
|
8
|
+
|
|
9
|
+
## 1.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9332de0: add readme and how to use packages
|
|
14
|
+
|
|
15
|
+
## 1.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- e3c7ce0: add changeset in packages
|
package/README.md
CHANGED
|
@@ -1,248 +1,175 @@
|
|
|
1
|
-
# Sevago SSO Frontend Library
|
|
2
|
-
|
|
3
|
-
<div align="center">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/sevago-library)
|
|
8
|
-
[; // or MODE.dark or MODE.other
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
#### Opacity Constants
|
|
97
|
-
|
|
98
|
-
```tsx
|
|
99
|
-
import { MODE, OPACITY } from 'sevago-library';
|
|
100
|
-
|
|
101
|
-
const semiTransparent = `${MODE.light.palette.primary.main}${OPACITY[50]}`;
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Utilities
|
|
105
|
-
|
|
106
|
-
#### Time Utils
|
|
107
|
-
|
|
108
|
-
```tsx
|
|
109
|
-
import { timeUtils } from 'sevago-library';
|
|
110
|
-
|
|
111
|
-
const timeAgo = timeUtils.getTimeAgo(new Date());
|
|
112
|
-
const dateTime = timeUtils.getDateTime(new Date());
|
|
113
|
-
const date = timeUtils.getDate(new Date());
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
#### String Utils
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
import { stringUtils } from 'sevago-library';
|
|
120
|
-
|
|
121
|
-
// Use string utility functions
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
#### App Utils
|
|
125
|
-
|
|
126
|
-
```tsx
|
|
127
|
-
import { Environment, getCurrentEnvironment } from 'sevago-library';
|
|
128
|
-
|
|
129
|
-
// Get current environment based on hostname
|
|
130
|
-
const env = getCurrentEnvironment();
|
|
131
|
-
// Returns: Environment.DEVELOP | Environment.STAGING | Environment.PRODUCTION
|
|
132
|
-
|
|
133
|
-
// Environment enum values
|
|
134
|
-
const develop = Environment.DEVELOP; // "develop"
|
|
135
|
-
const staging = Environment.STAGING; // "staging"
|
|
136
|
-
const production = Environment.PRODUCTION; // "production"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Enums
|
|
140
|
-
|
|
141
|
-
```tsx
|
|
142
|
-
import { AppCategory, Mode, OrderType, Environment } from 'sevago-library';
|
|
143
|
-
|
|
144
|
-
// Use enums
|
|
145
|
-
const category = AppCategory.ALL;
|
|
146
|
-
const mode = Mode.LIGHT;
|
|
147
|
-
const order = OrderType.ASC;
|
|
148
|
-
const env = Environment.DEVELOP;
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## API Reference
|
|
154
|
-
|
|
155
|
-
### Components
|
|
156
|
-
|
|
157
|
-
| Component | Description | Props |
|
|
158
|
-
| -------------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
159
|
-
| `App` | Main application component with theme provider | None |
|
|
160
|
-
| `SystemMonitorScreen` | System monitoring dashboard screen | `env: Environment`, `blacklist?: string[]` |
|
|
161
|
-
| `AppGrid` | Application grid component with smart URL routing | `apps: AppInfo[]`, `env: Environment`, `columns?: number`, `rows?: number`, `iconSize?: number`, `iconRadius?: number`, `gap?: number \| string`, `showPagination?: boolean`, `titleVariant?`, `titleColor?`, `captionColor?` |
|
|
162
|
-
| `AppsSidebar` | Applications sidebar component | `isOpen: boolean`, `onClose: () => void`, `env: Environment`, `position?: "left" \| "right"`, `blacklist?: string[]` |
|
|
163
|
-
| `SystemMonitorSidebarPart` | System monitor sidebar part | - |
|
|
164
|
-
|
|
165
|
-
## TypeScript Support
|
|
166
|
-
|
|
167
|
-
Full TypeScript support with comprehensive type definitions:
|
|
168
|
-
|
|
169
|
-
```tsx
|
|
170
|
-
import type { AppInfo, AppGridProps, SystemMonitorScreenProps, AppsSidebarProps, Environment } from 'sevago-library';
|
|
171
|
-
|
|
172
|
-
// AppInfo interface
|
|
173
|
-
interface AppInfo {
|
|
174
|
-
path: {
|
|
175
|
-
develop: string;
|
|
176
|
-
staging: string;
|
|
177
|
-
production: string;
|
|
178
|
-
};
|
|
179
|
-
content: string;
|
|
180
|
-
color: string;
|
|
181
|
-
icon: string;
|
|
182
|
-
group: AppGroup;
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Development
|
|
189
|
-
|
|
190
|
-
### Prerequisites
|
|
191
|
-
|
|
192
|
-
- Node.js >= 16.x
|
|
193
|
-
- npm >= 7.x
|
|
194
|
-
|
|
195
|
-
### Getting Started
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# Clone the repository
|
|
199
|
-
git clone https://github.com/dev1-gmail2025/sevago-library.git
|
|
200
|
-
cd sevago-library
|
|
201
|
-
|
|
202
|
-
# Install dependencies
|
|
203
|
-
npm install
|
|
204
|
-
|
|
205
|
-
# Run development server
|
|
206
|
-
npm run dev
|
|
207
|
-
|
|
208
|
-
# Build library
|
|
209
|
-
npm run build:lib
|
|
210
|
-
|
|
211
|
-
# Lint code
|
|
212
|
-
npm run lint
|
|
1
|
+
# Sevago SSO Frontend Library
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**React + TypeScript component library for the Sevago SSO ecosystem.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/sevago-library)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
Sevago SSO Frontend Library provides reusable React components, shared constants, utilities, and TypeScript types used across Sevago frontend applications.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Install the package in your project:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install sevago-library
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Install required peer dependencies:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install react react-dom @emotion/react @emotion/styled @mui/material @mui/system @reduxjs/toolkit react-redux react-router-dom redux-persist
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Import components, constants, utilities, and types directly from the package:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { AppGrid, MODE, timeUtils } from 'sevago-library';
|
|
38
|
+
import type { AppInfo } from 'sevago-library';
|
|
39
|
+
|
|
40
|
+
const theme = MODE.light;
|
|
41
|
+
const dateText = timeUtils.getDateTime(new Date());
|
|
42
|
+
|
|
43
|
+
function AppList({ apps }: { apps: AppInfo[] }) {
|
|
44
|
+
return (
|
|
45
|
+
<AppGrid
|
|
46
|
+
apps={apps}
|
|
47
|
+
columns={5}
|
|
48
|
+
rows={3}
|
|
49
|
+
onClickApp={(app) => window.open(app.path.production)}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
For applications that use the bundled provider/app shell:
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import React from 'react';
|
|
59
|
+
import { Provider } from 'react-redux';
|
|
60
|
+
import { PersistGate } from 'redux-persist/integration/react';
|
|
61
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
62
|
+
import App from 'sevago-library';
|
|
63
|
+
|
|
64
|
+
function RootApp() {
|
|
65
|
+
return (
|
|
66
|
+
<Provider store={store}>
|
|
67
|
+
<PersistGate loading={null} persistor={persistor}>
|
|
68
|
+
<BrowserRouter>
|
|
69
|
+
<App />
|
|
70
|
+
</BrowserRouter>
|
|
71
|
+
</PersistGate>
|
|
72
|
+
</Provider>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default RootApp;
|
|
213
77
|
```
|
|
214
78
|
|
|
215
|
-
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
Useful project references:
|
|
84
|
+
|
|
85
|
+
- [Repository](https://github.com/core-sevago/sevago-library)
|
|
86
|
+
- [npm package](https://www.npmjs.com/package/sevago-library)
|
|
87
|
+
- [Material Symbols](https://fonts.google.com/icons)
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Components
|
|
216
92
|
|
|
217
|
-
|
|
93
|
+
Common exports include:
|
|
94
|
+
|
|
95
|
+
- `AppGrid`
|
|
96
|
+
- `AppsSidebar`
|
|
97
|
+
- `SystemMonitorScreen`
|
|
98
|
+
- `SystemMonitorSidebarPart`
|
|
99
|
+
- `DefaultLayout`
|
|
100
|
+
- `LoadingComponent`
|
|
101
|
+
- `LogoComponent`
|
|
102
|
+
- `MotionBox`
|
|
103
|
+
- `NoteComponent`
|
|
104
|
+
- `PriceComponent`
|
|
105
|
+
- `ReviewComponent`
|
|
106
|
+
|
|
107
|
+
The library also exports shared elements, styles, constants, enums, interfaces, and utility functions.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## TypeScript
|
|
112
|
+
|
|
113
|
+
The package ships with generated TypeScript declarations from `dist`.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import type { AppInfo, AppGridProps, Environment } from 'sevago-library';
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Questions
|
|
122
|
+
|
|
123
|
+
For issues and usage questions, use the project repository:
|
|
124
|
+
|
|
125
|
+
[https://github.com/core-sevago/sevago-library/issues](https://github.com/core-sevago/sevago-library/issues)
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Contributing
|
|
130
|
+
|
|
131
|
+
Create a changeset for every public change:
|
|
218
132
|
|
|
219
133
|
```bash
|
|
220
|
-
# Add one for every public change
|
|
221
134
|
npm run changeset
|
|
222
135
|
```
|
|
223
136
|
|
|
224
137
|
Choose `patch`, `minor`, or `major`, then commit the generated file in `.changeset/`.
|
|
225
138
|
|
|
226
|
-
|
|
139
|
+
To publish a new version from a clean `master` branch:
|
|
227
140
|
|
|
228
141
|
```bash
|
|
229
142
|
bash deploy.sh
|
|
230
143
|
```
|
|
231
144
|
|
|
232
|
-
The deploy script
|
|
145
|
+
The deploy script applies Changesets, builds the library, commits release artifacts, publishes to npm, and pushes the release commit with tags.
|
|
233
146
|
|
|
234
|
-
|
|
147
|
+
---
|
|
235
148
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
npm run release
|
|
240
|
-
```
|
|
149
|
+
## Changelog
|
|
150
|
+
|
|
151
|
+
The [changelog](https://github.com/core-sevago/sevago-library/blob/master/CHANGELOG.md) is generated by Changesets and updated for every release.
|
|
241
152
|
|
|
242
153
|
---
|
|
243
154
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
155
|
+
## Roadmap
|
|
156
|
+
|
|
157
|
+
Future changes should be tracked through GitHub issues and released with Changesets.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
This project is licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Security
|
|
168
|
+
|
|
169
|
+
Do not publish credentials, tokens, private URLs, or environment files. Report security issues through the project maintainers.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Keywords
|
|
174
|
+
|
|
175
|
+
`sso` `authentication` `react` `typescript` `sevago`
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sevago-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Sevago SSO Frontend Library - A comprehensive SSO solution with React components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
+
"CHANGELOG.md",
|
|
10
11
|
"README.md"
|
|
11
12
|
],
|
|
12
13
|
"publishConfig": {
|