proje-react-panel 1.6.0 → 1.7.0

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.
Files changed (90) hide show
  1. package/.cursor/rules.md +11 -1
  2. package/AUTH_LAYOUT_EXAMPLE.md +343 -0
  3. package/AUTH_LAYOUT_GUIDE.md +819 -0
  4. package/COLOR_SYSTEM_GUIDE.md +296 -0
  5. package/DASHBOARD_GUIDE.md +531 -0
  6. package/IMPLEMENTATION_GUIDE.md +899 -0
  7. package/README.md +18 -1
  8. package/dist/api/ApiConfig.d.ts +11 -0
  9. package/dist/api/AuthApi.d.ts +2 -5
  10. package/dist/api/CrudApi.d.ts +11 -12
  11. package/dist/components/DashboardContainer.d.ts +7 -0
  12. package/dist/components/DashboardGrid.d.ts +9 -0
  13. package/dist/components/DashboardItem.d.ts +10 -0
  14. package/dist/components/ThemeSwitcher.d.ts +7 -0
  15. package/dist/components/dashboard/Dashboard.d.ts +7 -0
  16. package/dist/components/dashboard/DashboardGrid.d.ts +7 -0
  17. package/dist/components/dashboard/DashboardItem.d.ts +6 -0
  18. package/dist/components/dashboard/index.d.ts +3 -0
  19. package/dist/decorators/auth/DefaultLoginForm.d.ts +4 -0
  20. package/dist/index.cjs.js +15 -1
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.esm.js +15 -1
  23. package/dist/store/themeStore.d.ts +23 -0
  24. package/dist/types/Login.d.ts +8 -0
  25. package/package.json +3 -1
  26. package/src/api/ApiConfig.ts +63 -0
  27. package/src/api/AuthApi.ts +8 -0
  28. package/src/api/CrudApi.ts +96 -60
  29. package/src/components/dashboard/Dashboard.tsx +11 -0
  30. package/src/components/dashboard/DashboardGrid.tsx +14 -0
  31. package/src/components/dashboard/DashboardItem.tsx +9 -0
  32. package/src/components/dashboard/index.ts +3 -0
  33. package/src/decorators/auth/DefaultLoginForm.ts +32 -0
  34. package/src/index.ts +26 -0
  35. package/src/styles/base/_variables.scss +45 -0
  36. package/src/styles/components/button.scss +3 -3
  37. package/src/styles/components/checkbox.scss +6 -6
  38. package/src/styles/components/form-header.scss +21 -19
  39. package/src/styles/components/uploader.scss +15 -37
  40. package/src/styles/counter.scss +25 -33
  41. package/src/styles/dashboard.scss +9 -0
  42. package/src/styles/details.scss +6 -15
  43. package/src/styles/error-boundary.scss +75 -74
  44. package/src/styles/filter-popup.scss +29 -27
  45. package/src/styles/form.scss +16 -15
  46. package/src/styles/index.scss +8 -4
  47. package/src/styles/layout.scss +9 -8
  48. package/src/styles/list.scss +29 -27
  49. package/src/styles/loading-screen.scss +4 -4
  50. package/src/styles/login.scss +3 -3
  51. package/src/styles/pagination.scss +13 -13
  52. package/src/styles/sidebar.scss +24 -22
  53. package/src/styles/utils/scrollbar.scss +4 -3
  54. package/src/types/Login.ts +9 -0
  55. package/src/utils/logout.ts +2 -0
  56. package/dist/components/components/Checkbox.d.ts +0 -7
  57. package/dist/components/components/Counter.d.ts +0 -9
  58. package/dist/components/components/ErrorBoundary.d.ts +0 -16
  59. package/dist/components/components/ErrorComponent.d.ts +0 -4
  60. package/dist/components/components/FormField.d.ts +0 -17
  61. package/dist/components/components/ImageUploader.d.ts +0 -15
  62. package/dist/components/components/InnerForm.d.ts +0 -17
  63. package/dist/components/components/Label.d.ts +0 -9
  64. package/dist/components/components/LoadingScreen.d.ts +0 -2
  65. package/dist/components/components/Uploader.d.ts +0 -8
  66. package/dist/components/components/index.d.ts +0 -8
  67. package/dist/components/components/list/Datagrid.d.ts +0 -9
  68. package/dist/components/components/list/EmptyList.d.ts +0 -2
  69. package/dist/components/components/list/FilterPopup.d.ts +0 -11
  70. package/dist/components/components/list/ListPage.d.ts +0 -20
  71. package/dist/components/components/list/Pagination.d.ts +0 -11
  72. package/dist/components/components/list/index.d.ts +0 -0
  73. package/dist/components/pages/ControllerDetails.d.ts +0 -5
  74. package/dist/components/pages/FormPage.d.ts +0 -18
  75. package/dist/components/pages/ListPage.d.ts +0 -18
  76. package/dist/components/pages/Login.d.ts +0 -13
  77. package/dist/decorators/Crud.d.ts +0 -6
  78. package/dist/decorators/form/FormOptions.d.ts +0 -7
  79. package/dist/decorators/form/getFormFields.d.ts +0 -3
  80. package/dist/decorators/list/GetCellFields.d.ts +0 -2
  81. package/dist/decorators/list/ImageCell.d.ts +0 -6
  82. package/dist/decorators/list/ListData.d.ts +0 -6
  83. package/dist/decorators/list/getListFields.d.ts +0 -2
  84. package/dist/initPanel.d.ts +0 -2
  85. package/dist/types/Screen.d.ts +0 -4
  86. package/dist/types/ScreenCreatorData.d.ts +0 -13
  87. package/dist/types/getDetailsData.d.ts +0 -1
  88. package/dist/types/initPanelOptions.d.ts +0 -2
  89. package/dist/utils/createScreens.d.ts +0 -1
  90. package/dist/utils/getFields.d.ts +0 -3
package/README.md CHANGED
@@ -10,17 +10,21 @@ A powerful and flexible React-based panel library for building administrative in
10
10
  - **Layout System**: Consistent layout management
11
11
  - **Panel Component**: Core panel functionality
12
12
  - **Counter Component**: Utility component for counting operations
13
+ - **Dashboard Components**: Flexible grid-based dashboard layout system
14
+ - **Color System**: Centralized color system with SCSS variables and CSS custom properties
13
15
 
14
16
  ## Decorators
15
17
 
16
18
  The library provides several decorators for enhanced functionality:
17
19
 
18
20
  ### List Decorators
21
+
19
22
  - `@List`: Main list decorator for creating list views
20
23
  - `@ImageCell`: Specialized cell for handling images in lists
21
24
  - `@Cell`: Base cell decorator for list items
22
25
 
23
26
  ### Form Decorators
27
+
24
28
  - `@Input`: Form input decorator
25
29
  - `@Crud`: CRUD operations decorator
26
30
 
@@ -35,7 +39,7 @@ yarn add proje-react-panel
35
39
  ## Usage
36
40
 
37
41
  ```typescript
38
- import { Panel, ListPage, FormPage, Login, Layout } from 'proje-react-panel';
42
+ import { Panel, ListPage, FormPage, Login, Layout, DashboardGrid, DashboardItem } from 'proje-react-panel';
39
43
 
40
44
  // Initialize the panel
41
45
  const panel = new Panel({
@@ -48,8 +52,21 @@ const panel = new Panel({
48
52
  <FormPage />
49
53
  <Login />
50
54
  </Layout>
55
+
56
+ // Dashboard example
57
+ <DashboardGrid columns={3}>
58
+ <DashboardItem>Content 1</DashboardItem>
59
+ <DashboardItem>Content 2</DashboardItem>
60
+ <DashboardItem>Content 3</DashboardItem>
61
+ </DashboardGrid>
51
62
  ```
52
63
 
64
+ ## Guides
65
+
66
+ - **[Dashboard Guide](./DASHBOARD_GUIDE.md)** - Complete guide for using Dashboard components
67
+ - **[Auth Layout Guide](./AUTH_LAYOUT_GUIDE.md)** - Guide for implementing authentication layouts with sidebar
68
+ - **[Color System Guide](./COLOR_SYSTEM_GUIDE.md)** - Complete documentation of the color system, SCSS variables, and CSS custom properties
69
+
53
70
  ## Type Definitions
54
71
 
55
72
  The library includes TypeScript definitions for better development experience:
@@ -0,0 +1,11 @@
1
+ import { AxiosInstance } from 'axios';
2
+ declare let axiosInstance: AxiosInstance;
3
+ export interface ApiConfig {
4
+ baseUrl: string;
5
+ }
6
+ export declare function initApi(config: ApiConfig): void;
7
+ export declare function initAuthToken(): void;
8
+ export declare function setAuthToken(token: string): void;
9
+ export declare function setAuthLogout(): void;
10
+ export declare function getAxiosInstance(): AxiosInstance;
11
+ export { axiosInstance };
@@ -1,5 +1,2 @@
1
- export declare const AuthApi: {
2
- login: (fetchSettings: {
3
- baseUrl: string;
4
- }, username: string, password: string) => Promise<any>;
5
- };
1
+ import { LoginForm, LoginResponse } from '../types/Login';
2
+ export declare function login<T>(data: LoginForm | FormData): Promise<LoginResponse<T>>;
@@ -1,12 +1,11 @@
1
- interface FetchOptions {
2
- token: string;
3
- baseUrl: string;
4
- }
5
- export declare const CrudApi: {
6
- getList: (options: FetchOptions, api: string) => Promise<any>;
7
- create: (options: FetchOptions, api: string, data: any) => Promise<any>;
8
- details: (options: FetchOptions, api: string, id: any) => Promise<any>;
9
- edit: (options: FetchOptions, api: string, data: any) => Promise<any>;
10
- delete: (options: FetchOptions, api: string, id: string) => Promise<any>;
11
- };
12
- export {};
1
+ import { GetDataForList } from '../decorators/list/List';
2
+ import { OnSubmitFN } from '../decorators/form/Form';
3
+ import { GetDetailsDataFN } from '../decorators/details/Details';
4
+ export declare function getAll<T>(endpoint: string): GetDataForList<T>;
5
+ export declare function getOne<T>(endpoint: string, key?: string): GetDetailsDataFN<T>;
6
+ export declare function create<T>(endpoint: string): OnSubmitFN<T>;
7
+ export declare function createFormData<T>(endpoint: string): OnSubmitFN<T>;
8
+ export declare function update<T>(endpoint: string, key?: string): OnSubmitFN<T>;
9
+ export declare function updateFormData<T>(endpoint: string, key?: string): OnSubmitFN<T>;
10
+ export declare function updateSimple<T>(endpoint: string): OnSubmitFN<T>;
11
+ export declare function remove<T>(endpoint: string, key?: string): (data: T) => Promise<void>;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface DashboardContainerProps {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ }
6
+ export declare function DashboardContainer({ children, className }: DashboardContainerProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface DashboardGridProps {
3
+ children: React.ReactNode;
4
+ columns?: number;
5
+ gap?: string;
6
+ className?: string;
7
+ }
8
+ export declare function DashboardGrid({ children, columns, gap, className, }: DashboardGridProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface DashboardItemProps {
3
+ targetNumber: number;
4
+ duration?: number;
5
+ image: React.ReactNode;
6
+ text: string;
7
+ className?: string;
8
+ }
9
+ export declare function DashboardItem({ targetNumber, duration, image, text, className, }: DashboardItemProps): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface ThemeSwitcherProps {
3
+ variant?: 'button' | 'dropdown';
4
+ className?: string;
5
+ }
6
+ export declare function ThemeSwitcher({ variant, className }: ThemeSwitcherProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface DashboardProps {
3
+ children: React.ReactNode;
4
+ columns?: number;
5
+ }
6
+ export declare function Dashboard({ children, columns }: DashboardProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface DashboardGridProps {
3
+ children: React.ReactNode;
4
+ columns?: number;
5
+ }
6
+ export declare function DashboardGrid({ children, columns }: DashboardGridProps): React.JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface DashboardItemProps {
3
+ children: React.ReactNode;
4
+ }
5
+ export declare function DashboardItem({ children }: DashboardItemProps): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export { Dashboard } from './Dashboard';
2
+ export { DashboardGrid } from './DashboardGrid';
3
+ export { DashboardItem } from './DashboardItem';
@@ -0,0 +1,4 @@
1
+ export declare class DefaultLoginForm {
2
+ username: string;
3
+ password: string;
4
+ }