@pushwoosh/dumb-components 1.0.26 → 1.0.28

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.
@@ -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
- return React.createElement(TabPanelContainer, null, children);
16
+ const Container = container || TabPanelContainer;
17
+ return React.createElement(Container, null, children);
16
18
  };
@@ -1,5 +1,6 @@
1
- import type { PropsWithChildren } from 'react';
1
+ import type { ElementType, PropsWithChildren } from 'react';
2
2
  import type { TabCode } from '../../types';
3
3
  export type TabPanelProps = PropsWithChildren<Readonly<{
4
4
  code: TabCode;
5
+ container?: ElementType;
5
6
  }>>;
@@ -5,13 +5,14 @@ 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]);
14
- const Container = props.container || TabsContainer;
15
+ const Container = container || TabsContainer;
15
16
  return React.createElement(TabContext.Provider, {
16
17
  value: contextValue
17
18
  }, React.createElement(Container, null, children));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",