@zohodesk/components
Version:
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development
31 lines (28 loc) • 1.23 kB
JavaScript
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import { TabContentWrapper_defaultProps } from "./props/defaultProps";
import { TabContentWrapper_propTypes } from "./props/propTypes";
import { Box } from "../Layout";
/* eslint-disable react/forbid-component-props */
const TabContentWrapper = ({
style,
className,
children,
dataId,
selectedTab,
onScroll,
dataSelectorId,
tagName,
a11y
}) => /*#__PURE__*/React.createElement(Box, _extends({
flexible: true,
style: style,
dataId: dataId,
className: className,
onScroll: onScroll,
dataSelectorId: dataSelectorId,
tagName: tagName
}, a11y), React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
TabContentWrapper.defaultProps = TabContentWrapper_defaultProps;
TabContentWrapper.propTypes = TabContentWrapper_propTypes;
export default TabContentWrapper;