@sqrzro/ui 4.0.0-alpha.62 → 4.0.0-alpha.63
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.
|
@@ -5,5 +5,5 @@ interface MenuItemProps<Data, Response> extends ClassNameProps<MenuClassNames>,
|
|
|
5
5
|
isDownload?: boolean;
|
|
6
6
|
isNewWindow?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare function MenuItem<Data, Response>({ children, classNameProps, classNames, href, isDownload, isLoading, isNewWindow, onClick, }: MenuItemProps<Data, Response>): React.ReactElement;
|
|
8
|
+
declare function MenuItem<Data, Response>({ children, classNameProps, classNames, href, isDisabled, isDownload, isLoading, isNewWindow, onClick, }: MenuItemProps<Data, Response>): React.ReactElement;
|
|
9
9
|
export default MenuItem;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useClassNames } from '../../../styles/context';
|
|
4
|
+
import tw from '../../../styles/classnames/utility/tw';
|
|
4
5
|
import Link from '../Link';
|
|
5
|
-
function MenuItem({ children, classNameProps, classNames, href, isDownload, isLoading, isNewWindow, onClick, }) {
|
|
6
|
+
function MenuItem({ children, classNameProps, classNames, href, isDisabled, isDownload, isLoading, isNewWindow, onClick, }) {
|
|
6
7
|
const componentClassNames = useClassNames('menu', { props: classNameProps }, classNames);
|
|
8
|
+
const linkClass = tw(componentClassNames?.link, isDisabled ? 'pointer-events-none opacity-30' : null);
|
|
7
9
|
if (href) {
|
|
8
|
-
return (_jsx(Link, { className:
|
|
10
|
+
return (_jsx(Link, { className: linkClass, href: href, isDownload: isDownload, isNewWindow: isNewWindow, onClick: onClick, children: children }));
|
|
9
11
|
}
|
|
10
|
-
return (_jsxs("button", { className:
|
|
12
|
+
return (_jsxs("button", { className: linkClass, onClick: onClick, type: "button", children: [children, " ", isLoading && '...'] }));
|
|
11
13
|
}
|
|
12
14
|
export default MenuItem;
|