@agilant/toga-blox 1.0.319-beta.76 → 1.0.319-beta.77
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/components/SideNav/SideNav.d.ts +1 -3
- package/dist/components/SideNav/SideNav.js +3 -7
- package/dist/components/SideNav/SideNav.module.css +2 -1
- package/dist/components/SideNav/types.d.ts +7 -2
- package/dist/components/TableRecordModal/tableRecordModal.module.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ElementType, ReactNode } from "react";
|
|
2
2
|
import { PopoverRootProps, ContentProps, NavFooterProps, NavHeadingProps, NavigationItemProps, SideNavContextValue, PopoverTriggerProps, PopoverContentProps, UserProfileProps } from "./types.js";
|
|
3
|
-
import { BaseButton } from "../index.js";
|
|
4
3
|
export declare const SideNav: {
|
|
5
4
|
Root: ({ children, id }: PopoverRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
Trigger: ({ className, openIcon, ...props }: ComponentProps<"button"> & {
|
|
@@ -33,7 +32,6 @@ export declare const SideNav: {
|
|
|
33
32
|
as?: T;
|
|
34
33
|
className?: string;
|
|
35
34
|
} & import("react").PropsWithoutRef<ComponentProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
NavigationItem: ({
|
|
37
|
-
NavigationItemLink: ({ className, ...props }: ComponentProps<typeof BaseButton>) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
NavigationItem: ({ active, listClassName, btnClassName, prefixIconClassName, prefixIcon, liProps, buttonProps, children, }: NavigationItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
36
|
useSideNavContext: () => SideNavContextValue;
|
|
39
37
|
};
|
|
@@ -36,16 +36,13 @@ const NavHeading = ({ as, className, ...props }) => {
|
|
|
36
36
|
const Component = as || "h2";
|
|
37
37
|
return (_jsx(Component, { className: clsx(classes.navHeading, className), ...props }));
|
|
38
38
|
};
|
|
39
|
-
const NavigationItem = ({
|
|
40
|
-
return (_jsxs("li", { className: clsx(classes.navigationItem, active && classes.active, listClassName), ...props, children: [prefixIcon && (_jsx("span", { className: clsx(classes.prefixIcon, prefixIconClassName), children: prefixIcon })), children] }));
|
|
41
|
-
};
|
|
42
|
-
const NavigationItemLink = ({ className, ...props }) => {
|
|
39
|
+
const NavigationItem = ({ active, listClassName, btnClassName, prefixIconClassName, prefixIcon, liProps, buttonProps, children, }) => {
|
|
43
40
|
const { close } = useSideNavContext();
|
|
44
41
|
const handleClick = (e) => {
|
|
45
|
-
|
|
42
|
+
buttonProps.onClick?.(e);
|
|
46
43
|
close();
|
|
47
44
|
};
|
|
48
|
-
return (_jsx(BaseButton, { onClick: handleClick, className: clsx(classes.navigationItemLink,
|
|
45
|
+
return (_jsx("li", { className: clsx(classes.navigationItem, active && classes.active, listClassName), ...liProps, children: _jsxs(BaseButton, { onClick: handleClick, className: clsx(classes.navigationItemLink, btnClassName), ...buttonProps, children: [prefixIcon && (_jsx("span", { className: clsx(classes.prefixIcon, prefixIconClassName), children: prefixIcon })), children] }) }));
|
|
49
46
|
};
|
|
50
47
|
// side nav footer components:
|
|
51
48
|
// create logout context to share an id for the popover api
|
|
@@ -101,6 +98,5 @@ export const SideNav = {
|
|
|
101
98
|
Navigation,
|
|
102
99
|
NavigationList,
|
|
103
100
|
NavigationItem,
|
|
104
|
-
NavigationItemLink,
|
|
105
101
|
useSideNavContext,
|
|
106
102
|
};
|
|
@@ -219,11 +219,12 @@
|
|
|
219
219
|
|
|
220
220
|
/* link that's next to the icon within each nav item */
|
|
221
221
|
.navigationItemLink {
|
|
222
|
-
width:
|
|
222
|
+
width: 100%;
|
|
223
223
|
height: fit-content;
|
|
224
224
|
padding: 0;
|
|
225
225
|
background: transparent;
|
|
226
226
|
color: inherit;
|
|
227
|
+
place-content: start;
|
|
227
228
|
|
|
228
229
|
&:hover,
|
|
229
230
|
&:focus,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ComponentProps, ComponentPropsWithoutRef, ElementType, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { BaseButton } from '../BaseButton/index.js';
|
|
2
3
|
type NavHeadingOwnProps = {
|
|
3
4
|
as?: ElementType;
|
|
4
5
|
};
|
|
@@ -34,11 +35,15 @@ type ContentProps = ComponentProps<'div'> & {
|
|
|
34
35
|
closeIconClassName?: string;
|
|
35
36
|
closeIcon: ReactNode;
|
|
36
37
|
};
|
|
37
|
-
type NavigationItemProps =
|
|
38
|
+
type NavigationItemProps = {
|
|
38
39
|
active?: boolean;
|
|
39
40
|
listClassName?: string;
|
|
41
|
+
btnClassName?: string;
|
|
40
42
|
prefixIconClassName?: string;
|
|
41
|
-
prefixIcon
|
|
43
|
+
prefixIcon?: ReactNode;
|
|
44
|
+
liProps?: ComponentProps<'li'>;
|
|
45
|
+
buttonProps?: ComponentProps<typeof BaseButton>;
|
|
46
|
+
children: ReactNode;
|
|
42
47
|
};
|
|
43
48
|
type SideNavContextValue = {
|
|
44
49
|
popoverId: string;
|
package/package.json
CHANGED