@soul-refiner/design-system 0.2.54 → 0.2.56
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.
|
@@ -87,7 +87,8 @@ const Dropdown = ({ checkbox, children, closeOnChange = true, closeOnBlur = true
|
|
|
87
87
|
}
|
|
88
88
|
return (React.createElement(Wrapper, { "$sx": sx, tabIndex: 0, ref: wrapperRef, onBlurCapture: handleBlur, ...rest },
|
|
89
89
|
React.cloneElement(trigger, typeof trigger.type === 'string' ||
|
|
90
|
-
trigger.type?.displayName !== 'Button'
|
|
90
|
+
(trigger.type?.displayName !== 'Button' &&
|
|
91
|
+
trigger.type?.name !== 'Button')
|
|
91
92
|
? { onClick: handleOpen }
|
|
92
93
|
: { isDropdownOpen: open, onClick: handleOpen }),
|
|
93
94
|
open && (React.createElement(Container, { "$hasArrow": hasArrow, "$offset": offset, "$openDirection": openDirection, ref: optionsRef }, dropdownOptions))));
|
|
@@ -9,7 +9,7 @@ declare const InnerNav: {
|
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
|
11
11
|
Dropdown: {
|
|
12
|
-
({ children, href, icon, label, open, sx, }: InnerNavDropdownProps): React.JSX.Element;
|
|
12
|
+
({ children, href, icon, label, open, sx, onClick, }: InnerNavDropdownProps): React.JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
15
|
BackButton: {
|
|
@@ -59,11 +59,12 @@ export interface InnerNavItemProps {
|
|
|
59
59
|
* Dropdown
|
|
60
60
|
*/
|
|
61
61
|
export interface InnerNavDropdownProps extends React.PropsWithChildren {
|
|
62
|
-
href
|
|
62
|
+
href?: string;
|
|
63
63
|
icon?: React.ReactElement;
|
|
64
64
|
label: React.ReactNode;
|
|
65
65
|
open: boolean;
|
|
66
66
|
sx?: string;
|
|
67
|
+
onClick?: React.MouseEventHandler;
|
|
67
68
|
}
|
|
68
69
|
/*************************************************************************************************************************
|
|
69
70
|
* Back Button
|
|
@@ -82,10 +82,10 @@ const Item = styled.button `
|
|
|
82
82
|
`;
|
|
83
83
|
InnerNav.Item = InnerNavItem;
|
|
84
84
|
InnerNavItem.displayName = 'InnerNav.Item';
|
|
85
|
-
const InnerNavDropdown = ({ children, href, icon, label, open, sx, }) => {
|
|
85
|
+
const InnerNavDropdown = ({ children, href, icon, label, open, sx, onClick, }) => {
|
|
86
86
|
const isAnchor = !!href;
|
|
87
87
|
return (React.createElement(React.Fragment, null,
|
|
88
|
-
React.createElement(Item, { "$active": false, "$sx": sx, as: isAnchor ? 'a' : 'button', href: href },
|
|
88
|
+
React.createElement(Item, { "$active": false, "$sx": sx, as: isAnchor ? 'a' : 'button', href: !!onClick ? undefined : href, onClick: onClick },
|
|
89
89
|
icon,
|
|
90
90
|
React.createElement(DropdownTriggerWrapper, null,
|
|
91
91
|
label,
|