kelt-ui-kit-react 1.9.2 → 1.9.3
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/dist/header/Header.d.ts +1 -1
- package/dist/header/header.interface.d.ts +1 -0
- package/dist/index.js +730 -715
- package/dist/overlayPanel/OverlayPanel.d.ts +1 -0
- package/package.json +1 -1
- package/src/header/Header.tsx +2 -0
- package/src/header/header.interface.tsx +1 -0
- package/src/overlayPanel/OverlayPanel.tsx +13 -6
- package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +1 -1
package/package.json
CHANGED
package/src/header/Header.tsx
CHANGED
|
@@ -11,6 +11,7 @@ export const Header = ({
|
|
|
11
11
|
onClickMenu,
|
|
12
12
|
userChildren,
|
|
13
13
|
positionFixed,
|
|
14
|
+
overlayClassName,
|
|
14
15
|
onClickLogo,
|
|
15
16
|
showBackNavigation,
|
|
16
17
|
onClickBackNavigation,
|
|
@@ -49,6 +50,7 @@ export const Header = ({
|
|
|
49
50
|
</div>
|
|
50
51
|
{openOverlay && refButton.current && (
|
|
51
52
|
<OverlayPanel
|
|
53
|
+
className={overlayClassName}
|
|
52
54
|
position="bottomRight"
|
|
53
55
|
show={openOverlay}
|
|
54
56
|
closeOverlay={setOpenOverlay}
|
|
@@ -27,6 +27,7 @@ export type OverlayPanelProps = {
|
|
|
27
27
|
coordonnees?: { top: number; left: number };
|
|
28
28
|
position?: PositionOverlay;
|
|
29
29
|
children: React.ReactNode;
|
|
30
|
+
className?: string;
|
|
30
31
|
show?: boolean;
|
|
31
32
|
id?: string;
|
|
32
33
|
closeOverlay?: (close: boolean) => void;
|
|
@@ -38,6 +39,7 @@ export const OverlayPanel = forwardRef(
|
|
|
38
39
|
referenceElement,
|
|
39
40
|
position,
|
|
40
41
|
coordonnees,
|
|
42
|
+
className,
|
|
41
43
|
children,
|
|
42
44
|
show,
|
|
43
45
|
id,
|
|
@@ -45,12 +47,12 @@ export const OverlayPanel = forwardRef(
|
|
|
45
47
|
}: OverlayPanelProps,
|
|
46
48
|
ref: React.Ref<{
|
|
47
49
|
setCoords?: (coords: { top: number; left: number }) => void;
|
|
48
|
-
}
|
|
50
|
+
}>,
|
|
49
51
|
) => {
|
|
50
52
|
const { activeOverlayId, setActiveOverlay } = useOverlayContext();
|
|
51
53
|
const [isShow, setIsShow] = useState(show || false);
|
|
52
54
|
const [coords, setCoords] = useState<{ top: number; left: number }>(
|
|
53
|
-
coordonnees ?? { top: 0, left: 0 }
|
|
55
|
+
coordonnees ?? { top: 0, left: 0 },
|
|
54
56
|
);
|
|
55
57
|
const boxRef = useRef<HTMLDivElement>(null);
|
|
56
58
|
const overlayId = useId();
|
|
@@ -147,7 +149,7 @@ export const OverlayPanel = forwardRef(
|
|
|
147
149
|
closeOverlay(false);
|
|
148
150
|
}
|
|
149
151
|
},
|
|
150
|
-
[closeOverlay, setActiveOverlay]
|
|
152
|
+
[closeOverlay, setActiveOverlay],
|
|
151
153
|
);
|
|
152
154
|
useEffect(() => {
|
|
153
155
|
const handleClickOutside = (event: MouseEvent) => {
|
|
@@ -173,7 +175,12 @@ export const OverlayPanel = forwardRef(
|
|
|
173
175
|
if (!isShow) return null;
|
|
174
176
|
|
|
175
177
|
return ReactDOM.createPortal(
|
|
176
|
-
<OverlayPanelStyled
|
|
178
|
+
<OverlayPanelStyled
|
|
179
|
+
className={className}
|
|
180
|
+
ref={boxRef}
|
|
181
|
+
$top={coords.top}
|
|
182
|
+
$left={coords.left}
|
|
183
|
+
>
|
|
177
184
|
<div
|
|
178
185
|
className={`overlayPanel ${
|
|
179
186
|
coords.top > 0 || coords.left > 0 ? "visible" : "hide"
|
|
@@ -189,7 +196,7 @@ export const OverlayPanel = forwardRef(
|
|
|
189
196
|
{children}
|
|
190
197
|
</div>
|
|
191
198
|
</OverlayPanelStyled>,
|
|
192
|
-
document.body
|
|
199
|
+
document.body,
|
|
193
200
|
);
|
|
194
|
-
}
|
|
201
|
+
},
|
|
195
202
|
);
|