kelt-ui-kit-react 0.6.0 → 0.6.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/README.md +46 -46
- package/dist/button/button.interface.d.ts +6 -0
- package/dist/button/buttonActions/ButtonActions.d.ts +13 -0
- package/dist/card/card.interface.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.html +43 -43
- package/dist/index.js +1235 -1157
- package/dist/loader/Loader.d.ts +2 -1
- package/dist/manifest.json +25 -25
- package/dist/quantity/Quantity.d.ts +2 -1
- package/dist/robots.txt +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/public/index.html +43 -43
- package/public/manifest.json +25 -25
- package/public/robots.txt +3 -3
- package/src/App.css +11 -11
- package/src/button/Button.tsx +2 -0
- package/src/button/Button.view.tsx +27 -3
- package/src/button/button.css +2 -0
- package/src/button/button.interface.tsx +6 -0
- package/src/button/buttonActions/ButtonActions.tsx +101 -0
- package/src/card/Card.tsx +2 -1
- package/src/card/card.interface.tsx +2 -2
- package/src/card/cardAction/CardAction.tsx +19 -18
- package/src/form/Form.tsx +7 -10
- package/src/index.css +9 -0
- package/src/index.ts +1 -0
- package/src/loader/Loader.tsx +21 -3
- package/src/loader/Loader.view.tsx +13 -5
- package/src/loader/loader.css +12 -0
- package/src/modal/modal.css +1 -1
- package/src/overlayPanel/OverlayPanel.tsx +5 -1
- package/src/overlayPanel/overlayPanel.css +7 -0
- package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +1 -0
- package/src/quantity/Quantity.tsx +9 -3
- package/src/quantity/quantity.css +4 -0
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
-
<!--
|
|
14
|
-
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
-
-->
|
|
17
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
-
<!--
|
|
19
|
-
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
-
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
-
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
-
|
|
23
|
-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
-
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
-
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
-
-->
|
|
27
|
-
<title>React App</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
-
<div id="root"></div>
|
|
32
|
-
<!--
|
|
33
|
-
This HTML file is a template.
|
|
34
|
-
If you open it directly in the browser, you will see an empty page.
|
|
35
|
-
|
|
36
|
-
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
-
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
-
|
|
39
|
-
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
-
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
-
-->
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<meta name="theme-color" content="#000000" />
|
|
8
|
+
<meta
|
|
9
|
+
name="description"
|
|
10
|
+
content="Web site created using create-react-app"
|
|
11
|
+
/>
|
|
12
|
+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
+
<!--
|
|
14
|
+
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
+
-->
|
|
17
|
+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
+
<!--
|
|
19
|
+
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
+
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
+
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
+
|
|
23
|
+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
+
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
+
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
+
-->
|
|
27
|
+
<title>React App</title>
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
+
<div id="root"></div>
|
|
32
|
+
<!--
|
|
33
|
+
This HTML file is a template.
|
|
34
|
+
If you open it directly in the browser, you will see an empty page.
|
|
35
|
+
|
|
36
|
+
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
+
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
+
|
|
39
|
+
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
+
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
+
-->
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
package/public/manifest.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"short_name": "React App",
|
|
3
|
+
"name": "Create React App Sample",
|
|
4
|
+
"icons": [
|
|
5
|
+
{
|
|
6
|
+
"src": "favicon.ico",
|
|
7
|
+
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
+
"type": "image/x-icon"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"src": "logo192.png",
|
|
12
|
+
"type": "image/png",
|
|
13
|
+
"sizes": "192x192"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "logo512.png",
|
|
17
|
+
"type": "image/png",
|
|
18
|
+
"sizes": "512x512"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"start_url": ".",
|
|
22
|
+
"display": "standalone",
|
|
23
|
+
"theme_color": "#000000",
|
|
24
|
+
"background_color": "#ffffff"
|
|
25
|
+
}
|
package/public/robots.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# https://www.robotstxt.org/robotstxt.html
|
|
2
|
-
User-agent: *
|
|
3
|
-
Disallow:
|
|
1
|
+
# https://www.robotstxt.org/robotstxt.html
|
|
2
|
+
User-agent: *
|
|
3
|
+
Disallow:
|
package/src/App.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.main-layout {
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
container: app-container/ inline-size;
|
|
7
|
-
& .main-layout-content {
|
|
8
|
-
flex: 1;
|
|
9
|
-
padding: 2rem;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
.main-layout {
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
container: app-container/ inline-size;
|
|
7
|
+
& .main-layout-content {
|
|
8
|
+
flex: 1;
|
|
9
|
+
padding: 2rem;
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/button/Button.tsx
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { Button } from "./Button";
|
|
2
3
|
import { ButtonInterface } from "./button.interface";
|
|
4
|
+
import {
|
|
5
|
+
ButtonActions,
|
|
6
|
+
ButtonActionsProps,
|
|
7
|
+
} from "./buttonActions/ButtonActions";
|
|
3
8
|
|
|
4
9
|
export const ButtonView = (): JSX.Element => {
|
|
5
10
|
const mockButtonItems: ButtonInterface[] = [
|
|
@@ -15,14 +20,33 @@ export const ButtonView = (): JSX.Element => {
|
|
|
15
20
|
className: "button--secondary",
|
|
16
21
|
},
|
|
17
22
|
];
|
|
18
|
-
|
|
23
|
+
const mockButtonAction: ButtonActionsProps = useMemo(() => {
|
|
24
|
+
return {
|
|
25
|
+
title: "Supprimer",
|
|
26
|
+
onClick: () => console.log("Supprimer"),
|
|
27
|
+
className: "button--secondary",
|
|
28
|
+
actions: [
|
|
29
|
+
{
|
|
30
|
+
id: "1",
|
|
31
|
+
label: "Supprimer",
|
|
32
|
+
onClick: () => console.log("Supprimer action"),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "2",
|
|
36
|
+
label: "Supprimer définitivement",
|
|
37
|
+
onClick: () => console.log("Supprimer définitivement"),
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
19
42
|
return (
|
|
20
43
|
<div className="d-flex">
|
|
21
|
-
{mockButtonItems.map((item) => (
|
|
22
|
-
<div className="mr-2">
|
|
44
|
+
{mockButtonItems.map((item, index) => (
|
|
45
|
+
<div className="mr-2" key={index}>
|
|
23
46
|
<Button {...item} />
|
|
24
47
|
</div>
|
|
25
48
|
))}
|
|
49
|
+
<ButtonActions {...mockButtonAction} />
|
|
26
50
|
</div>
|
|
27
51
|
);
|
|
28
52
|
};
|
package/src/button/button.css
CHANGED
|
@@ -14,6 +14,7 @@ button {
|
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: center;
|
|
16
16
|
font-family: "Raleway", sans-serif !important;
|
|
17
|
+
|
|
17
18
|
&:disabled {
|
|
18
19
|
opacity: 0.5;
|
|
19
20
|
cursor: not-allowed;
|
|
@@ -28,6 +29,7 @@ button {
|
|
|
28
29
|
&.button--transparent {
|
|
29
30
|
background-color: transparent;
|
|
30
31
|
color: var(--primary-color);
|
|
32
|
+
border: 1px solid;
|
|
31
33
|
}
|
|
32
34
|
&.button--success {
|
|
33
35
|
background-color: var(--success-color);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
|
+
import { IconSizeEnum } from "../../icon/iconSize.enum";
|
|
4
|
+
import { MenuInterface } from "../../menus/menu/menu.interface";
|
|
5
|
+
import { Menus } from "../../menus/Menus";
|
|
6
|
+
import { OverlayPanel, PositionOverlay } from "../../overlayPanel/OverlayPanel";
|
|
7
|
+
import { Button } from "../Button";
|
|
8
|
+
import { buttonActionInterface } from "../button.interface";
|
|
9
|
+
|
|
10
|
+
export type ButtonActionsProps = {
|
|
11
|
+
className?: string;
|
|
12
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
13
|
+
title: string;
|
|
14
|
+
actions?: buttonActionInterface[];
|
|
15
|
+
classIcon?: string;
|
|
16
|
+
positionActions?: PositionOverlay;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export const ButtonActions = ({
|
|
20
|
+
className,
|
|
21
|
+
onClick,
|
|
22
|
+
title,
|
|
23
|
+
actions,
|
|
24
|
+
positionActions = "topRight",
|
|
25
|
+
disabled = false,
|
|
26
|
+
}: ButtonActionsProps) => {
|
|
27
|
+
const handleClick = (e: React.MouseEvent) => {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
if (onClick) {
|
|
30
|
+
onClick(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const refButton = useRef<HTMLDivElement>(null);
|
|
34
|
+
const [openOverlay, setOpenOverlay] = useState(false);
|
|
35
|
+
const onClickActions = useCallback(
|
|
36
|
+
(e: React.MouseEvent) => {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
if (actions) setOpenOverlay(!openOverlay);
|
|
39
|
+
},
|
|
40
|
+
[openOverlay, setOpenOverlay]
|
|
41
|
+
);
|
|
42
|
+
const overlayMenu: MenuInterface[] = useMemo(() => {
|
|
43
|
+
if (!actions) return [];
|
|
44
|
+
return actions.map((a, index) => {
|
|
45
|
+
return {
|
|
46
|
+
id: a.id ?? index,
|
|
47
|
+
icon: a.icon,
|
|
48
|
+
name: a.label,
|
|
49
|
+
children: (
|
|
50
|
+
<Button
|
|
51
|
+
key={index}
|
|
52
|
+
classIcon={a.icon}
|
|
53
|
+
sizeIcon={IconSizeEnum.LARGE}
|
|
54
|
+
onClick={(e) => {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
closeOverlay();
|
|
57
|
+
a.onClick && a.onClick(a);
|
|
58
|
+
}}
|
|
59
|
+
title={a.label || ""}
|
|
60
|
+
/>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
}) as MenuInterface[];
|
|
64
|
+
}, [actions]);
|
|
65
|
+
const closeOverlay = useCallback(() => {
|
|
66
|
+
setOpenOverlay(false);
|
|
67
|
+
}, [setOpenOverlay]);
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<button
|
|
71
|
+
disabled={disabled}
|
|
72
|
+
type="submit"
|
|
73
|
+
onClick={(e) => handleClick(e)}
|
|
74
|
+
className={` ${className} button-actions`}
|
|
75
|
+
>
|
|
76
|
+
<span className="mr-2 flex-1">{title}</span>
|
|
77
|
+
|
|
78
|
+
<span
|
|
79
|
+
className="ml-2"
|
|
80
|
+
ref={refButton}
|
|
81
|
+
onClick={(e) => onClickActions(e)}
|
|
82
|
+
>
|
|
83
|
+
<Icon classIcon="bi-chevron-up" />
|
|
84
|
+
</span>
|
|
85
|
+
</button>
|
|
86
|
+
{actions && openOverlay && refButton.current && (
|
|
87
|
+
<OverlayPanel
|
|
88
|
+
show={openOverlay}
|
|
89
|
+
position={positionActions}
|
|
90
|
+
closeOverlay={setOpenOverlay}
|
|
91
|
+
referenceElement={refButton.current}
|
|
92
|
+
children={
|
|
93
|
+
<div>
|
|
94
|
+
<Menus className="card-action-menu" items={overlayMenu} />
|
|
95
|
+
</div>
|
|
96
|
+
}
|
|
97
|
+
/>
|
|
98
|
+
)}
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
};
|
package/src/card/Card.tsx
CHANGED
|
@@ -37,6 +37,7 @@ export const Card = ({
|
|
|
37
37
|
(e: React.MouseEvent, item: CardInterface) => {
|
|
38
38
|
e.stopPropagation();
|
|
39
39
|
if (openActions) {
|
|
40
|
+
setPositions(undefined);
|
|
40
41
|
return setOpenActions(false);
|
|
41
42
|
}
|
|
42
43
|
if (
|
|
@@ -80,7 +81,7 @@ export const Card = ({
|
|
|
80
81
|
<div className="card-text d-flex">
|
|
81
82
|
{item.image && (
|
|
82
83
|
<div className="card-img">
|
|
83
|
-
<img src={item.image} alt={
|
|
84
|
+
<img src={item.image} alt={"card-image"} />
|
|
84
85
|
</div>
|
|
85
86
|
)}
|
|
86
87
|
{item.title && <div className="card-title">{item.title}</div>}
|
|
@@ -43,6 +43,7 @@ export const CardAction = ({
|
|
|
43
43
|
|
|
44
44
|
const handleChangeOverlay = useCallback(
|
|
45
45
|
(e: any, openOverlay: boolean) => {
|
|
46
|
+
if (actions.length === 0) return;
|
|
46
47
|
e.preventDefault();
|
|
47
48
|
console.log("je set la position");
|
|
48
49
|
setPosition("bottomRight");
|
|
@@ -73,6 +74,7 @@ export const CardAction = ({
|
|
|
73
74
|
children: (
|
|
74
75
|
<Button
|
|
75
76
|
classIcon={a.icon}
|
|
77
|
+
key={index}
|
|
76
78
|
sizeIcon={IconSizeEnum.LARGE}
|
|
77
79
|
onClick={(e) => {
|
|
78
80
|
e.stopPropagation();
|
|
@@ -87,24 +89,23 @@ export const CardAction = ({
|
|
|
87
89
|
}, [actions]);
|
|
88
90
|
return (
|
|
89
91
|
<div className="card-actions">
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)}
|
|
92
|
+
<div
|
|
93
|
+
ref={refButton}
|
|
94
|
+
className={`card-action ${
|
|
95
|
+
actions.filter((a) => a.type === "menu").length ? "visible" : "hidden"
|
|
96
|
+
}`}
|
|
97
|
+
onClick={(e) => handleChangeOverlay(e, !openOverlay)}
|
|
98
|
+
>
|
|
99
|
+
<Icon
|
|
100
|
+
size={IconSizeEnum.MEDIUM}
|
|
101
|
+
classIcon={"bi-three-dots-vertical cursor-pointer"}
|
|
102
|
+
/>
|
|
103
|
+
<Icon
|
|
104
|
+
size={IconSizeEnum.MEDIUM}
|
|
105
|
+
classIcon={"bi-three-dots cursor-pointer"}
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
108
109
|
{openOverlay && refButton.current && (
|
|
109
110
|
<OverlayPanel
|
|
110
111
|
position={position}
|
package/src/form/Form.tsx
CHANGED
|
@@ -67,15 +67,12 @@ export const DynamicForm = forwardRef(
|
|
|
67
67
|
[onChange]
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
-
const handleSubmit = useCallback(
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
[onSubmit, values]
|
|
78
|
-
);
|
|
70
|
+
const handleSubmit = useCallback(() => {
|
|
71
|
+
console.log("je passeee");
|
|
72
|
+
if (onSubmit) {
|
|
73
|
+
onSubmit(values);
|
|
74
|
+
}
|
|
75
|
+
}, [onSubmit, values]);
|
|
79
76
|
|
|
80
77
|
const resetForm = () => {
|
|
81
78
|
setValues(() => {
|
|
@@ -100,7 +97,7 @@ export const DynamicForm = forwardRef(
|
|
|
100
97
|
const focusedField = initialForm.find((field) => field.focus);
|
|
101
98
|
if (focusedField && inputRefs.current[focusedField.name]) {
|
|
102
99
|
setTimeout(() => {
|
|
103
|
-
inputRefs.current[focusedField.name]?.
|
|
100
|
+
inputRefs.current[focusedField.name]?.select();
|
|
104
101
|
}, 500);
|
|
105
102
|
}
|
|
106
103
|
};
|
package/src/index.css
CHANGED
|
@@ -33,6 +33,9 @@ body {
|
|
|
33
33
|
.d-flex {
|
|
34
34
|
display: flex;
|
|
35
35
|
}
|
|
36
|
+
.justify-content-start {
|
|
37
|
+
justify-content: start;
|
|
38
|
+
}
|
|
36
39
|
.justify-content-end {
|
|
37
40
|
justify-content: end;
|
|
38
41
|
}
|
|
@@ -387,6 +390,12 @@ a {
|
|
|
387
390
|
}
|
|
388
391
|
|
|
389
392
|
/* class generique*/
|
|
393
|
+
.visible {
|
|
394
|
+
visibility: visible;
|
|
395
|
+
}
|
|
396
|
+
.hidden {
|
|
397
|
+
visibility: hidden;
|
|
398
|
+
}
|
|
390
399
|
.position-relative {
|
|
391
400
|
position: relative;
|
|
392
401
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import "bootstrap-icons/font/bootstrap-icons.css";
|
|
|
2
2
|
import "./index.css";
|
|
3
3
|
export { ButtonAction } from "./action/ButtonAction";
|
|
4
4
|
export { Button } from "./button/Button";
|
|
5
|
+
export { ButtonActions } from "./button/buttonActions/ButtonActions";
|
|
5
6
|
export { Card } from "./card/Card";
|
|
6
7
|
export { Carousel } from "./carousel/Carousel";
|
|
7
8
|
export { Damier } from "./damier/Damier";
|
package/src/loader/Loader.tsx
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import { createPortal } from "react-dom";
|
|
1
2
|
import { IconSizeEnum } from "../icon/iconSize.enum";
|
|
2
3
|
import "./loader.css";
|
|
3
4
|
export type LoaderProps = {
|
|
4
5
|
display: boolean;
|
|
5
6
|
message?: string;
|
|
6
7
|
size?: IconSizeEnum;
|
|
8
|
+
full?: true;
|
|
7
9
|
};
|
|
8
|
-
export const Loader = ({ display, message }: LoaderProps) => (
|
|
10
|
+
export const Loader = ({ display, full, message }: LoaderProps) => (
|
|
9
11
|
<>
|
|
10
|
-
{display && (
|
|
11
|
-
<div className=
|
|
12
|
+
{display && !full && (
|
|
13
|
+
<div className={`d-flex flex-column align-items-center`}>
|
|
12
14
|
{message && <span className="mb-3">{message}</span>}
|
|
13
15
|
<div className="position-relative">
|
|
14
16
|
<span className="loader"></span>
|
|
15
17
|
</div>
|
|
16
18
|
</div>
|
|
17
19
|
)}
|
|
20
|
+
|
|
21
|
+
{display &&
|
|
22
|
+
full &&
|
|
23
|
+
createPortal(
|
|
24
|
+
<div className="loader-overlay">
|
|
25
|
+
<div>
|
|
26
|
+
<div className={`d-flex flex-column align-items-center`}>
|
|
27
|
+
{message && <span className="mb-3">{message}</span>}
|
|
28
|
+
<div className="position-relative">
|
|
29
|
+
<span className="loader"></span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>,
|
|
34
|
+
document.body
|
|
35
|
+
)}
|
|
18
36
|
</>
|
|
19
37
|
);
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Button } from "../button/Button";
|
|
1
3
|
import { IconSizeEnum } from "../icon/iconSize.enum";
|
|
2
4
|
import { Loader } from "./Loader";
|
|
3
5
|
|
|
4
6
|
export const LoaderView = () => {
|
|
7
|
+
const [display, setDisplay] = useState(false);
|
|
8
|
+
|
|
5
9
|
return (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
<>
|
|
11
|
+
<Button title={"loader-overlay"} onClick={() => setDisplay(!display)} />
|
|
12
|
+
<Loader
|
|
13
|
+
size={IconSizeEnum.EXTRA_LARGE}
|
|
14
|
+
display={!display}
|
|
15
|
+
message={"Loading..."}
|
|
16
|
+
/>
|
|
17
|
+
<Loader display={display} message={"Loading..."} full={true} />
|
|
18
|
+
</>
|
|
11
19
|
);
|
|
12
20
|
};
|
package/src/loader/loader.css
CHANGED
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
-webkit-animation: rotation 1s linear infinite;
|
|
9
9
|
animation: rotation 1s linear infinite;
|
|
10
10
|
}
|
|
11
|
+
.loader-overlay {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
z-index: 1000;
|
|
22
|
+
}
|
|
11
23
|
@keyframes rotation {
|
|
12
24
|
0% {
|
|
13
25
|
transform: rotate(0deg);
|
package/src/modal/modal.css
CHANGED
|
@@ -172,7 +172,11 @@ export const OverlayPanel = forwardRef(
|
|
|
172
172
|
|
|
173
173
|
return ReactDOM.createPortal(
|
|
174
174
|
<OverlayPanelStyled ref={boxRef} $top={coords.top} $left={coords.left}>
|
|
175
|
-
<div
|
|
175
|
+
<div
|
|
176
|
+
className={`overlayPanel ${
|
|
177
|
+
coords.top > 0 && coords.left > 0 ? "visible" : "hide"
|
|
178
|
+
}`}
|
|
179
|
+
>
|
|
176
180
|
<button className="toggle-btn" onClick={closeOverlayHandler}>
|
|
177
181
|
<Icon classIcon="bi-x-lg" />
|
|
178
182
|
</button>
|