sevago-library 1.0.2 → 1.0.6

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
@@ -4,7 +4,7 @@
4
4
 
5
5
  A comprehensive Single Sign-On (SSO) frontend library built with React, TypeScript, and Material-UI.
6
6
 
7
- [![npm version](https://img.shields.io/npm/v/sevago-sso-fe)](https://www.npmjs.com/package/sevago-sso-fe)
7
+ [![npm version](https://img.shields.io/npm/v/sevago-library)](https://www.npmjs.com/package/sevago-library)
8
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
9
 
10
10
  </div>
@@ -13,9 +13,10 @@ A comprehensive Single Sign-On (SSO) frontend library built with React, TypeScri
13
13
 
14
14
  ## Support
15
15
 
16
- - **GitHub Issues:** [https://github.com/dev1-gmail2025/sevago-sso-fe/issues](https://github.com/dev1-gmail2025/sevago-sso-fe/issues)
17
- - **Repository:** [https://github.com/dev1-gmail2025/sevago-sso-fe](https://github.com/dev1-gmail2025/sevago-sso-fe)
16
+ - **GitHub Issues:** [https://github.com/dev1-gmail2025/sevago-library/issues](https://github.com/dev1-gmail2025/sevago-library/issues)
17
+ - **Repository:** [https://github.com/dev1-gmail2025/sevago-library](https://github.com/dev1-gmail2025/sevago-library)
18
18
  - **Material Symbols:** [https://fonts.google.com/icons](https://fonts.google.com/icons)
19
+
19
20
  ## Features
20
21
 
21
22
  - 🎨 Material-UI components with custom styling and theming
@@ -30,7 +31,7 @@ A comprehensive Single Sign-On (SSO) frontend library built with React, TypeScri
30
31
  ## Installation
31
32
 
32
33
  ```bash
33
- npm install sevago-sso-fe
34
+ npm install sevago-library
34
35
  ```
35
36
 
36
37
  ### Peer Dependencies
@@ -50,7 +51,7 @@ import React from 'react';
50
51
  import { Provider } from 'react-redux';
51
52
  import { PersistGate } from 'redux-persist/integration/react';
52
53
  import { BrowserRouter } from 'react-router-dom';
53
- import App from 'sevago-sso-fe';
54
+ import App from 'sevago-library';
54
55
 
55
56
  function RootApp() {
56
57
  return (
@@ -74,7 +75,7 @@ export default RootApp;
74
75
  #### Style Constants
75
76
 
76
77
  ```tsx
77
- import { STYLE, MODE, OPACITY } from 'sevago-sso-fe';
78
+ import { STYLE, MODE, OPACITY } from 'sevago-library';
78
79
 
79
80
  const customStyle = {
80
81
  padding: STYLE.PADDING_GAP_LAYOUT,
@@ -86,7 +87,7 @@ const customStyle = {
86
87
  #### Theme Modes
87
88
 
88
89
  ```tsx
89
- import { MODE } from 'sevago-sso-fe';
90
+ import { MODE } from 'sevago-library';
90
91
  import { createTheme } from '@mui/material/styles';
91
92
 
92
93
  const theme = createTheme(MODE.light); // or MODE.dark or MODE.other
@@ -95,7 +96,7 @@ const theme = createTheme(MODE.light); // or MODE.dark or MODE.other
95
96
  #### Opacity Constants
96
97
 
97
98
  ```tsx
98
- import { MODE, OPACITY } from 'sevago-sso-fe';
99
+ import { MODE, OPACITY } from 'sevago-library';
99
100
 
100
101
  const semiTransparent = `${MODE.light.palette.primary.main}${OPACITY[50]}`;
101
102
  ```
@@ -105,7 +106,7 @@ const semiTransparent = `${MODE.light.palette.primary.main}${OPACITY[50]}`;
105
106
  #### Time Utils
106
107
 
107
108
  ```tsx
108
- import { timeUtils } from 'sevago-sso-fe';
109
+ import { timeUtils } from 'sevago-library';
109
110
 
110
111
  const timeAgo = timeUtils.getTimeAgo(new Date());
111
112
  const dateTime = timeUtils.getDateTime(new Date());
@@ -115,7 +116,7 @@ const date = timeUtils.getDate(new Date());
115
116
  #### String Utils
116
117
 
117
118
  ```tsx
118
- import { stringUtils } from 'sevago-sso-fe';
119
+ import { stringUtils } from 'sevago-library';
119
120
 
120
121
  // Use string utility functions
121
122
  ```
@@ -123,7 +124,7 @@ import { stringUtils } from 'sevago-sso-fe';
123
124
  #### App Utils
124
125
 
125
126
  ```tsx
126
- import { Environment, getCurrentEnvironment } from 'sevago-sso-fe';
127
+ import { Environment, getCurrentEnvironment } from 'sevago-library';
127
128
 
128
129
  // Get current environment based on hostname
129
130
  const env = getCurrentEnvironment();
@@ -138,7 +139,7 @@ const production = Environment.PRODUCTION; // "production"
138
139
  ### Enums
139
140
 
140
141
  ```tsx
141
- import { AppCategory, Mode, OrderType, Environment } from 'sevago-sso-fe';
142
+ import { AppCategory, Mode, OrderType, Environment } from 'sevago-library';
142
143
 
143
144
  // Use enums
144
145
  const category = AppCategory.ALL;
@@ -153,20 +154,20 @@ const env = Environment.DEVELOP;
153
154
 
154
155
  ### Components
155
156
 
156
- | Component | Description | Props |
157
- | --------------------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
158
- | `App` | Main application component with theme provider | None |
159
- | `SystemMonitorScreen` | System monitoring dashboard screen | `env: Environment`, `blacklist?: string[]` |
160
- | `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?` |
161
- | `AppsSidebar` | Applications sidebar component | `isOpen: boolean`, `onClose: () => void`, `env: Environment`, `position?: "left" \| "right"`, `blacklist?: string[]` |
162
- | `SystemMonitorSidebarPart` | System monitor sidebar part | - |
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 | - |
163
164
 
164
165
  ## TypeScript Support
165
166
 
166
167
  Full TypeScript support with comprehensive type definitions:
167
168
 
168
169
  ```tsx
169
- import type { AppInfo, AppGridProps, SystemMonitorScreenProps, AppsSidebarProps, Environment } from 'sevago-sso-fe';
170
+ import type { AppInfo, AppGridProps, SystemMonitorScreenProps, AppsSidebarProps, Environment } from 'sevago-library';
170
171
 
171
172
  // AppInfo interface
172
173
  interface AppInfo {
@@ -195,8 +196,8 @@ interface AppInfo {
195
196
 
196
197
  ```bash
197
198
  # Clone the repository
198
- git clone https://github.com/dev1-gmail2025/sevago-sso-fe.git
199
- cd sevago-sso-fe
199
+ git clone https://github.com/dev1-gmail2025/sevago-library.git
200
+ cd sevago-library
200
201
 
201
202
  # Install dependencies
202
203
  npm install
@@ -211,7 +212,6 @@ npm run build:lib
211
212
  npm run lint
212
213
  ```
213
214
 
214
-
215
215
  ---
216
216
 
217
217
  <div align="center">
package/dist/index.cjs.js CHANGED
@@ -73709,6 +73709,68 @@ const TextFieldElement = ({
73709
73709
  )
73710
73710
  ] });
73711
73711
  };
73712
+ const TagElement = ({
73713
+ type,
73714
+ content,
73715
+ width: width2 = "fit-content",
73716
+ variation = "caption",
73717
+ size = "medium",
73718
+ variant = "contained",
73719
+ sx,
73720
+ color: color2,
73721
+ iconProps
73722
+ }) => {
73723
+ const TAG_VARIANT = {
73724
+ contained: {
73725
+ backgroundColor: type,
73726
+ color: color2 || "white"
73727
+ },
73728
+ outlined: {
73729
+ backgroundColor: lightenColor(type, 0.8),
73730
+ color: type
73731
+ },
73732
+ "outlined-border": {
73733
+ backgroundColor: lightenColor(type, 0.8),
73734
+ border: `1px solid ${type}`,
73735
+ color: type
73736
+ }
73737
+ };
73738
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: iconProps ? /* @__PURE__ */ jsxRuntime.jsxs(
73739
+ material.Stack,
73740
+ {
73741
+ sx: {
73742
+ borderRadius: BORDER_RADIUS_ELEMENT_SMALL,
73743
+ width: width2,
73744
+ textAlign: "center",
73745
+ textWrap: "nowrap",
73746
+ ...TAG_SIZE[size],
73747
+ ...TAG_VARIANT[variant],
73748
+ ...sx
73749
+ },
73750
+ children: [
73751
+ iconProps && iconProps,
73752
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: variation, children: content })
73753
+ ]
73754
+ }
73755
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
73756
+ material.Typography,
73757
+ {
73758
+ variant: variation,
73759
+ sx: {
73760
+ borderRadius: BORDER_RADIUS_ELEMENT_SMALL,
73761
+ width: width2,
73762
+ textAlign: "center",
73763
+ textWrap: "nowrap",
73764
+ justifyContent: "center",
73765
+ ...getLimitLineCss(1),
73766
+ ...TAG_SIZE[size],
73767
+ ...TAG_VARIANT[variant],
73768
+ ...sx
73769
+ },
73770
+ children: content
73771
+ }
73772
+ ) });
73773
+ };
73712
73774
  const TypographyInfoUser = ({
73713
73775
  items,
73714
73776
  columns = 2,
@@ -73718,7 +73780,8 @@ const TypographyInfoUser = ({
73718
73780
  showEmptyAsDots = true,
73719
73781
  gridTemplateColumns: gridTemplateColumns2 = "1.75fr 2fr",
73720
73782
  highlightQuery,
73721
- direction = "row"
73783
+ direction = "row",
73784
+ color: color2
73722
73785
  }) => {
73723
73786
  return /* @__PURE__ */ jsxRuntime.jsx(
73724
73787
  StackRow,
@@ -73734,37 +73797,27 @@ const TypographyInfoUser = ({
73734
73797
  system.Stack,
73735
73798
  {
73736
73799
  sx: {
73737
- display: direction === "row" ? "grid" : "flex",
73738
73800
  gridTemplateColumns: direction === "row" ? columns === 1 ? "1fr 3fr" : gridTemplateColumns2 : "unset",
73739
73801
  height: "fit-content",
73740
- flexDirection: direction === "column" ? "column" : "row"
73802
+ flexDirection: direction === "column" ? "column" : "row",
73803
+ gap: 0
73741
73804
  },
73742
73805
  children: [
73743
- /* @__PURE__ */ jsxRuntime.jsxs(
73744
- material.Typography,
73806
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Typography, { sx: { ...TYPOGRAPHY.textSm.regular, color: COMMON.gray6, flex: 1 }, children: [
73807
+ highlightYellow(item.label, highlightQuery ?? "", showEmptyAsDots),
73808
+ ":"
73809
+ ] }),
73810
+ item.statusTag ? /* @__PURE__ */ jsxRuntime.jsx(
73811
+ TagElement,
73745
73812
  {
73746
- sx: {
73747
- ...TYPOGRAPHY.textSm.regular,
73748
- color: COMMON.gray6,
73749
- flex: 1
73750
- },
73751
- children: [
73752
- highlightYellow(item.label, highlightQuery ?? "", showEmptyAsDots),
73753
- ":"
73754
- ]
73813
+ sx: { textTransform: "none", width: "100%", ...sx },
73814
+ content: item.value,
73815
+ type: color2 || "inherit"
73755
73816
  }
73756
- ),
73757
- /* @__PURE__ */ jsxRuntime.jsx(
73817
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
73758
73818
  material.Typography,
73759
73819
  {
73760
- sx: {
73761
- ...TYPOGRAPHY.textSm.regular,
73762
- color: COMMON.black,
73763
- flex: 1,
73764
- borderBottom: `1px solid ${COMMON.gray8}`,
73765
- textAlign: "right",
73766
- ...item.sxValue
73767
- },
73820
+ sx: { ...TYPOGRAPHY.textSm.regular, color: COMMON.black, flex: 1, ...item.sxValue },
73768
73821
  children: highlightYellow(item.value, highlightQuery ?? "", showEmptyAsDots)
73769
73822
  }
73770
73823
  )
@@ -75989,68 +76042,6 @@ const tableArgTypes = {
75989
76042
  getRowMenu: { control: false },
75990
76043
  onDisabled: { control: false }
75991
76044
  };
75992
- const TagElement = ({
75993
- type,
75994
- content,
75995
- width: width2 = "fit-content",
75996
- variation = "caption",
75997
- size = "medium",
75998
- variant = "contained",
75999
- sx,
76000
- color: color2,
76001
- iconProps
76002
- }) => {
76003
- const TAG_VARIANT = {
76004
- contained: {
76005
- backgroundColor: type,
76006
- color: color2 || "white"
76007
- },
76008
- outlined: {
76009
- backgroundColor: lightenColor(type, 0.8),
76010
- color: type
76011
- },
76012
- "outlined-border": {
76013
- backgroundColor: lightenColor(type, 0.8),
76014
- border: `1px solid ${type}`,
76015
- color: type
76016
- }
76017
- };
76018
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: iconProps ? /* @__PURE__ */ jsxRuntime.jsxs(
76019
- material.Stack,
76020
- {
76021
- sx: {
76022
- borderRadius: BORDER_RADIUS_ELEMENT_SMALL,
76023
- width: width2,
76024
- textAlign: "center",
76025
- textWrap: "nowrap",
76026
- ...TAG_SIZE[size],
76027
- ...TAG_VARIANT[variant],
76028
- ...sx
76029
- },
76030
- children: [
76031
- iconProps && iconProps,
76032
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: variation, children: content })
76033
- ]
76034
- }
76035
- ) : /* @__PURE__ */ jsxRuntime.jsx(
76036
- material.Typography,
76037
- {
76038
- variant: variation,
76039
- sx: {
76040
- borderRadius: BORDER_RADIUS_ELEMENT_SMALL,
76041
- width: width2,
76042
- textAlign: "center",
76043
- textWrap: "nowrap",
76044
- justifyContent: "center",
76045
- ...getLimitLineCss(1),
76046
- ...TAG_SIZE[size],
76047
- ...TAG_VARIANT[variant],
76048
- ...sx
76049
- },
76050
- children: content
76051
- }
76052
- ) });
76053
- };
76054
76045
  const UserInfo = ({
76055
76046
  name = "Hệ thống",
76056
76047
  department = "Hệ thống",