@yakad/ui 1.3.144 → 1.3.145
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/Stack/Stack.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from "classnames";
|
|
|
15
15
|
import boxingStyles from "../boxing.module.css";
|
|
16
16
|
import styles from "./Stack.module.css";
|
|
17
17
|
export const Stack = forwardRef(function Stack(_a, ref) {
|
|
18
|
-
var { align, fullWidth, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
|
|
18
|
+
var { align, fullWidth = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
|
|
19
19
|
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, styles.stack, className);
|
|
20
20
|
return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
|
|
21
21
|
});
|
|
@@ -21,6 +21,5 @@ export interface WithInteractionsProps extends StackProps {
|
|
|
21
21
|
onMouseHoverChange?: (isHover: boolean, e: MouseEvent) => void;
|
|
22
22
|
onMouseHoverStart?: (e: MouseEvent) => void;
|
|
23
23
|
onMouseHoverLeave?: (e: MouseEvent) => void;
|
|
24
|
-
children?: React.ReactNode;
|
|
25
24
|
}
|
|
26
25
|
export declare const WithInteractions: import("react").ForwardRefExoticComponent<WithInteractionsProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { RefObject } from "react";
|
|
2
|
-
import { Dropdown, DropdownProps, Popup, PopupProps } from "..";
|
|
2
|
+
import { Dropdown, DropdownProps, Popup, PopupProps, WithInteractionsProps } from "..";
|
|
3
3
|
export interface OverlayProps {
|
|
4
4
|
triggerref?: RefObject<HTMLElement | null>;
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
}
|
|
7
7
|
type AllowedOverlays = React.ReactElement<PopupProps, typeof Popup> | React.ReactElement<DropdownProps, typeof Dropdown>;
|
|
8
|
-
export interface WithOverlayProps {
|
|
8
|
+
export interface WithOverlayProps extends WithInteractionsProps {
|
|
9
9
|
trigger?: "onClick" | "onRightClick";
|
|
10
10
|
overlay?: AllowedOverlays;
|
|
11
11
|
children?: React.ReactElement;
|
|
12
12
|
}
|
|
13
|
-
export declare function WithOverlay({ trigger, overlay, children, }: WithOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function WithOverlay({ trigger, overlay, children, onRightClick, onClick, ...restProps }: WithOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
14
|
import { useState, cloneElement, useEffect, useRef } from "react";
|
|
4
15
|
import { WithInteractions, } from "..";
|
|
5
16
|
import { createPortal } from "react-dom";
|
|
6
|
-
export function WithOverlay(
|
|
17
|
+
export function WithOverlay(_a) {
|
|
18
|
+
var { trigger = "onClick", overlay, children, onRightClick, onClick } = _a, restProps = __rest(_a, ["trigger", "overlay", "children", "onRightClick", "onClick"]);
|
|
7
19
|
// Get Triggers ref and send to Overlay
|
|
8
20
|
const triggerRef = useRef(null);
|
|
9
21
|
const [showOverlay, setShowOverlay] = useState(false);
|
|
@@ -24,5 +36,11 @@ export function WithOverlay({ trigger = "onClick", overlay, children, }) {
|
|
|
24
36
|
setShowOverlay(false);
|
|
25
37
|
},
|
|
26
38
|
}), document.getElementsByClassName("portalRoot")[0] || document.body);
|
|
27
|
-
return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, { ref: triggerRef,
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, Object.assign({ ref: triggerRef }, restProps, { onRightClick: (e) => {
|
|
40
|
+
trigger === "onRightClick" && setShowOverlay(true);
|
|
41
|
+
onRightClick === null || onRightClick === void 0 ? void 0 : onRightClick(e);
|
|
42
|
+
}, onClick: (e) => {
|
|
43
|
+
trigger === "onClick" && setShowOverlay(true);
|
|
44
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
45
|
+
}, children: children })), showOverlay && teleport] }));
|
|
28
46
|
}
|