rc-lib-ui 1.0.20 → 1.0.22

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 (49) hide show
  1. package/README.md +129 -10
  2. package/dist/Dashboard/Dashboard.d.ts +25 -0
  3. package/dist/Dashboard/Dashboard.js +4367 -0
  4. package/dist/Dashboard/components/ContentBox.d.ts +3 -0
  5. package/dist/Dashboard/components/ContentBox.js +9 -0
  6. package/dist/Dashboard/components/DrawerToggleMenu.d.ts +1 -0
  7. package/dist/Dashboard/components/DrawerToggleMenu.js +22 -0
  8. package/dist/Dashboard/components/ListMemu/ListMenu.d.ts +35 -0
  9. package/dist/Dashboard/components/ListMemu/ListMenu.js +103 -0
  10. package/dist/Dashboard/components/ListMemu/helpers.d.ts +5 -0
  11. package/dist/Dashboard/components/ListMemu/helpers.js +16 -0
  12. package/dist/Dashboard/components/ListMemu/ui/ListButton.d.ts +9 -0
  13. package/dist/Dashboard/components/ListMemu/ui/ListButton.js +23 -0
  14. package/dist/Dashboard/components/ListMemu/ui/ListButtonInner.d.ts +3 -0
  15. package/dist/Dashboard/components/ListMemu/ui/ListButtonInner.js +12 -0
  16. package/dist/Dashboard/components/ListMemu/ui/ListButtonStyled.d.ts +10 -0
  17. package/dist/Dashboard/components/ListMemu/ui/ListButtonStyled.js +14 -0
  18. package/dist/Dashboard/components/ListMemu/ui/ListText.d.ts +9 -0
  19. package/dist/Dashboard/components/ListMemu/ui/ListText.js +17 -0
  20. package/dist/Dashboard/components/ListMemu/ui/MuiNavLink.d.ts +6 -0
  21. package/dist/Dashboard/components/ListMemu/ui/MuiNavLink.js +15 -0
  22. package/dist/Dashboard/components/ListMemu/ui/RenderIcon.d.ts +7 -0
  23. package/dist/Dashboard/components/ListMemu/ui/RenderIcon.js +21 -0
  24. package/dist/Dashboard/components/ListMemu/ui/RenderList.d.ts +6 -0
  25. package/dist/Dashboard/components/ListMemu/ui/RenderList.js +51 -0
  26. package/dist/Dashboard/components/MuiFooter.d.ts +5 -0
  27. package/dist/Dashboard/components/MuiFooter.js +14 -0
  28. package/dist/Dashboard/components/MuiHeader.d.ts +16 -0
  29. package/dist/Dashboard/components/MuiHeader.js +49 -0
  30. package/dist/Dashboard/components/MuiMenu.d.ts +11 -0
  31. package/dist/Dashboard/components/MuiMenu.js +50 -0
  32. package/dist/Dashboard/components/MuiMenuHeader.d.ts +3 -0
  33. package/dist/Dashboard/components/MuiMenuHeader.js +9 -0
  34. package/dist/Dashboard/components/index.d.ts +5 -0
  35. package/dist/Dashboard/components/index.js +12 -0
  36. package/dist/Dashboard/index.d.ts +1 -0
  37. package/dist/Dashboard/index.js +4 -0
  38. package/dist/Preloaders/components/Ball/Ball.js +2 -2
  39. package/dist/Preloaders/components/Spinner3D/Spinner3D.js +2 -2
  40. package/dist/Preloaders/components/Time/Time.js +13 -13
  41. package/dist/Tooltips/Tooltips.d.ts +6 -0
  42. package/dist/Tooltips/Tooltips.js +37 -0
  43. package/dist/_helpers/index.d.ts +10 -0
  44. package/dist/_helpers/index.js +23 -0
  45. package/dist/common/ControlStatusItem.d.ts +9 -0
  46. package/dist/common/ControlStatusItem.js +10 -0
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +4 -2
  49. package/package.json +7 -4
package/README.md CHANGED
@@ -1,21 +1,140 @@
1
- # React Components
1
+ <h1 align="center">rc-ui-lib</h1>
2
+
3
+ #### Preloaders
2
4
 
3
- ### Example
4
5
  ```tsx
5
- import { Preloaders } from 'rc-lib-ui'
6
+ import { Preloaders } from "rc-lib-ui";
6
7
 
7
8
  export const App = () => {
8
- //SpinnerGrow | SpinnerBorder | Spinner3D | Ball | Time | Cube | RotateCube
9
+ //SpinnerGrow | SpinnerBorder | Spinner3D | Ball | Time | Cube | RotateCube
9
10
 
10
11
  return (
11
- <div style={{position: 'relative', width: '100vw', height: '100vh'}}>
12
- <Preloaders name='Ball' show={true} >
13
- <div className='content'></div>
14
- </Preloaders>
12
+ <div style={{ position: "relative", width: "100vw", height: "100vh" }}>
13
+ <Preloaders name="Ball" show={true}>
14
+ <div className="content"></div>
15
+ </Preloaders>
15
16
  </div>
16
- )
17
- }
17
+ );
18
+ };
19
+ ```
20
+
21
+ ---
22
+
23
+ #### Dashboard
24
+
25
+ ```tsx
26
+ import { Dashboard } from "rc-lib-ui";
27
+
28
+ const listMen = [
29
+ {
30
+ icon: <Archive sx={{ width: 25 }} />,
31
+ title: "Archive loooooooooooooooooooooooooooong text",
32
+ path: "/test",
33
+ action: <Chip label={7} color="primary" size="small" />,
34
+ },
35
+ {
36
+ icon: <ListSharp />,
37
+ title: "Lists",
38
+ action: popoverMenuAction,
39
+ children: [
40
+ { title: "List 1", path: "/listOne" },
41
+ { title: "List 2", path: "/listTwo", icon: <StarBorder /> },
42
+ ],
43
+ },
44
+ ] as DashboardProps["listMenu"];
18
45
 
46
+
47
+ export const App = () => {
48
+ return (
49
+ <Dashboard
50
+ listMenu={listMenu}
51
+ children={
52
+ <div className={"content"} style={{ position: "relative" }}>
53
+ Content
54
+ </div>
55
+ }
56
+ />
57
+ );
58
+ };
19
59
  ```
60
+ ```tsx
61
+ /*
62
+ //default
63
+ statuses={{ isHeader: true, isHeaderResize: true, isMenuHeader: true }}
64
+
65
+ Example variants
66
+ variant 1: statuses={{ isHeaderResize: false }}
67
+ variant 2: statuses={{ isHeader: false, isMenuHeader: false }}
20
68
 
69
+ Extends variant
70
+ statuses={{
71
+ ...,
72
+ isDefaultOpen: true,
73
+ isButtonCenterMenu: false, //you can disable the menu control button at manage via.
74
+ //If you want to manage manually, use the methods via ref|| or if you want to completely replace the header using HeaderContent
75
+ }}
76
+
77
+ */
78
+
79
+ <Dashboard
80
+ listMenu={listMenu}
81
+ HeaderContent={(config) => (
82
+ <>
83
+ <Toolbar>
84
+ <IconButton onClick={config.handleMenuToggle} size="large" edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }} children={<MenuIcon />} />
85
+ <Typography variant="h6" component="div" sx={{ flexGrow: 1 }} children={"App"} />
86
+ </Toolbar>
87
+ </>
88
+ )}
89
+ children={/*...*/}
90
+ />;
91
+
92
+ ```
93
+ ```tsx
94
+ // My Header. variant control by ref
95
+ export const App = () => {
96
+
97
+ const dashboardControlRef = useRef<DashboardControlProps>(null)
98
+ const handleMenuToggle = () => { dashboardControlRef.current?.handleMenuToggle() }
99
+
100
+ return (
101
+ <>
102
+ <Dashboard
103
+ ref={dashboardControlRef}
104
+ styleList='variant2'
105
+ listMenu={listMenu}
106
+
107
+ columnMenu={{
108
+ initWidth: 280,
109
+ minWidthColumn: {
110
+ width: 80,
111
+ // variant1 - min 40, variant2 - min 53,
112
+ },
113
+ position: "right",
114
+ }}
115
+ HeaderContent={
116
+ <header style={{ position: "fixed", zIndex: 1, width: "100%", backgroundColor: "#456789" }}>
117
+ <Toolbar>
118
+ <IconButton onClick={handleMenuToggle} size="large" edge="start" color="inherit" aria-label="menu" sx={{ mr: 2 }} children={<MenuIcon />} />
119
+ <Typography variant="h6" component="div" sx={{ flexGrow: 1 }} children={"App"} />
120
+ </Toolbar>
121
+ </header>
122
+ }
123
+ statuses={{
124
+ isHeaderDefault: false,
125
+ isButtonCenterMenu: false
126
+ //isHeader: false, full off header
127
+ }}
128
+ Footer={
129
+ <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%'}}>
130
+ Footer
131
+ </div>
132
+ }
133
+ children={/*...*/}
134
+ />
135
+ </>
136
+ )
137
+ }
138
+ ```
21
139
 
140
+ ---
@@ -0,0 +1,25 @@
1
+ import { default as React, ReactNode } from 'react';
2
+ import { SxProps, Theme } from '@mui/system';
3
+ import { ListMenuProps } from './components/ListMemu/ListMenu';
4
+ import { MuiHeaderProps } from './components/MuiHeader';
5
+ import { MuiMenuProps } from './components/MuiMenu';
6
+ export type DashboardControlProps = Record<'handleMenuOpen' | 'handleMenuClose' | 'handleMenuToggle', () => void> & {
7
+ isOpen: boolean;
8
+ };
9
+ type Statuses_OR = 'isDefaultOpen' | 'isHeader' | 'isMenuHeader' | 'isHeaderResize' | 'isButtonCenterMenu' | 'isHeaderDefault';
10
+ export interface DashboardProps extends Pick<ListMenuProps, 'listMenu' | 'styleList'> {
11
+ Footer?: ReactNode;
12
+ columnMenu?: Partial<MuiMenuProps['columnMenu'] & {
13
+ position?: 'right' | 'left';
14
+ }>;
15
+ children?: ReactNode;
16
+ HeaderContent?: ReactNode | ((config: DashboardControlProps) => React.ReactNode);
17
+ statuses?: Partial<Record<Statuses_OR, boolean>>;
18
+ sx?: SxProps<Theme>;
19
+ itemsProps?: {
20
+ MuiHeader?: Pick<MuiHeaderProps, 'sx' | 'bgColor'>;
21
+ };
22
+ classes?: Partial<Record<'listMenu' | 'header', string>>;
23
+ }
24
+ export declare const Dashboard: React.MemoExoticComponent<React.ForwardRefExoticComponent<DashboardProps & React.RefAttributes<DashboardControlProps>>>;
25
+ export {};