Page MenuHomec4science

TabsListUnstyled.js
No OneTemporary

File Metadata

Created
Fri, Jan 10, 06:33

TabsListUnstyled.js

import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["children", "component", "slotProps", "slots"];
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '../composeClasses';
import { useSlotProps } from '../utils';
import { getTabsListUnstyledUtilityClass } from './tabsListUnstyledClasses';
import useTabsList from './useTabsList';
import { jsx as _jsx } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
orientation
} = ownerState;
const slots = {
root: ['root', orientation]
};
return composeClasses(slots, getTabsListUnstyledUtilityClass, {});
};
/**
*
* Demos:
*
* - [Unstyled Tabs](https://mui.com/base/react-tabs/)
*
* API:
*
* - [TabsListUnstyled API](https://mui.com/base/api/tabs-list-unstyled/)
*/
const TabsListUnstyled = /*#__PURE__*/React.forwardRef((props, ref) => {
var _ref;
const {
component,
slotProps = {},
slots = {}
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const {
isRtl,
orientation,
getRootProps,
processChildren
} = useTabsList(_extends({}, props, {
ref
}));
const ownerState = _extends({}, props, {
isRtl,
orientation
});
const classes = useUtilityClasses(ownerState);
const TabsListRoot = (_ref = component != null ? component : slots.root) != null ? _ref : 'div';
const tabsListRootProps = useSlotProps({
elementType: TabsListRoot,
getSlotProps: getRootProps,
externalSlotProps: slotProps.root,
externalForwardedProps: other,
ownerState,
className: classes.root
});
const processedChildren = processChildren();
return /*#__PURE__*/_jsx(TabsListRoot, _extends({}, tabsListRootProps, {
children: processedChildren
}));
});
process.env.NODE_ENV !== "production" ? TabsListUnstyled.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit TypeScript types and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The content of the component.
*/
children: PropTypes.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* The props used for each slot inside the TabsList.
* @default {}
*/
slotProps: PropTypes.shape({
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
}),
/**
* The components used for each slot inside the TabsList.
* Either a string to use a HTML element or a component.
* @default {}
*/
slots: PropTypes.shape({
root: PropTypes.elementType
})
} : void 0;
export default TabsListUnstyled;

Event Timeline