@pushwoosh/dumb-components 1.0.25 → 1.0.27
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.
|
@@ -9,6 +9,7 @@ export type DropdownMenuButtonProps = {
|
|
|
9
9
|
color: RequiredButtonProps['color'];
|
|
10
10
|
size?: RequiredButtonProps['size'];
|
|
11
11
|
view?: RequiredButtonProps['view'];
|
|
12
|
+
className?: string;
|
|
12
13
|
icon?: RequiredButtonProps['icon'];
|
|
13
14
|
rightIcon?: RequiredButtonProps['rightIcon'];
|
|
14
15
|
children: (() => ReactNode) | ReactNode;
|
|
@@ -4,6 +4,7 @@ import { useTabsContext } from '../../context';
|
|
|
4
4
|
export const TabPanel = props => {
|
|
5
5
|
const {
|
|
6
6
|
code,
|
|
7
|
+
container,
|
|
7
8
|
children
|
|
8
9
|
} = props;
|
|
9
10
|
const {
|
|
@@ -12,5 +13,6 @@ export const TabPanel = props => {
|
|
|
12
13
|
if (code !== activeTabCode) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
const Container = container || TabPanelContainer;
|
|
17
|
+
return React.createElement(Container, null, children);
|
|
16
18
|
};
|
|
@@ -5,13 +5,15 @@ export function Tabs(props) {
|
|
|
5
5
|
const {
|
|
6
6
|
activeCode: activeTabCode,
|
|
7
7
|
onChange: setActiveTabCode,
|
|
8
|
+
container,
|
|
8
9
|
children
|
|
9
10
|
} = props;
|
|
10
11
|
const contextValue = useMemo(() => ({
|
|
11
12
|
activeTabCode,
|
|
12
13
|
setActiveTabCode
|
|
13
14
|
}), [activeTabCode, setActiveTabCode]);
|
|
15
|
+
const Container = container || TabsContainer;
|
|
14
16
|
return React.createElement(TabContext.Provider, {
|
|
15
17
|
value: contextValue
|
|
16
|
-
}, React.createElement(
|
|
18
|
+
}, React.createElement(Container, null, children));
|
|
17
19
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { PropsWithChildren } from 'react';
|
|
1
|
+
import type { ElementType, PropsWithChildren } from 'react';
|
|
2
2
|
import { type TabCode } from '../../types';
|
|
3
3
|
export type TabsProps = PropsWithChildren<Readonly<{
|
|
4
4
|
activeCode: TabCode;
|
|
5
5
|
onChange: (code: TabCode) => void;
|
|
6
|
+
container?: ElementType;
|
|
6
7
|
}>>;
|