pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
import { PolymorphicComponent } from '../utils';
|
||||
import { TabsListTypeMap } from './TabsList.types';
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Tabs](https://mui.com/base-ui/react-tabs/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [TabsList API](https://mui.com/base-ui/react-tabs/components-api/#tabs-list)
|
||||
*/
|
||||
declare const TabsList: PolymorphicComponent<TabsListTypeMap<{}, "div">>;
|
||||
export { TabsList };
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
'use client';
|
||||
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
||||
const _excluded = ["children", "slotProps", "slots"];
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { unstable_composeClasses as composeClasses } from '../composeClasses';
|
||||
import { useSlotProps } from '../utils';
|
||||
import { getTabsListUtilityClass } from './tabsListClasses';
|
||||
import { useTabsList } from '../useTabsList';
|
||||
import { useClassNamesOverride } from '../utils/ClassNameConfigurator';
|
||||
import { TabsListProvider } from '../useTabsList/TabsListProvider';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const useUtilityClasses = ownerState => {
|
||||
const {
|
||||
orientation
|
||||
} = ownerState;
|
||||
const slots = {
|
||||
root: ['root', orientation]
|
||||
};
|
||||
return composeClasses(slots, useClassNamesOverride(getTabsListUtilityClass));
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Demos:
|
||||
*
|
||||
* - [Tabs](https://mui.com/base-ui/react-tabs/)
|
||||
*
|
||||
* API:
|
||||
*
|
||||
* - [TabsList API](https://mui.com/base-ui/react-tabs/components-api/#tabs-list)
|
||||
*/
|
||||
const TabsList = /*#__PURE__*/React.forwardRef(function TabsList(props, forwardedRef) {
|
||||
var _slots$root;
|
||||
const {
|
||||
children,
|
||||
slotProps = {},
|
||||
slots = {}
|
||||
} = props,
|
||||
other = _objectWithoutPropertiesLoose(props, _excluded);
|
||||
const {
|
||||
isRtl,
|
||||
orientation,
|
||||
getRootProps,
|
||||
contextValue
|
||||
} = useTabsList({
|
||||
rootRef: forwardedRef
|
||||
});
|
||||
const ownerState = _extends({}, props, {
|
||||
isRtl,
|
||||
orientation
|
||||
});
|
||||
const classes = useUtilityClasses(ownerState);
|
||||
const TabsListRoot = (_slots$root = slots.root) != null ? _slots$root : 'div';
|
||||
const tabsListRootProps = useSlotProps({
|
||||
elementType: TabsListRoot,
|
||||
getSlotProps: getRootProps,
|
||||
externalSlotProps: slotProps.root,
|
||||
externalForwardedProps: other,
|
||||
ownerState,
|
||||
className: classes.root
|
||||
});
|
||||
return /*#__PURE__*/_jsx(TabsListProvider, {
|
||||
value: contextValue,
|
||||
children: /*#__PURE__*/_jsx(TabsListRoot, _extends({}, tabsListRootProps, {
|
||||
children: children
|
||||
}))
|
||||
});
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? TabsList.propTypes /* remove-proptypes */ = {
|
||||
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
||||
// │ These PropTypes are generated from the TypeScript type definitions. │
|
||||
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* 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 { TabsList };
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
import * as React from 'react';
|
||||
import { Simplify } from '@mui/types';
|
||||
import { UseTabsListRootSlotProps } from '../useTabsList';
|
||||
import { PolymorphicProps, SlotComponentProps } from '../utils';
|
||||
export interface TabsListRootSlotPropsOverrides {
|
||||
}
|
||||
export interface TabsListOwnProps {
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
/**
|
||||
* The props used for each slot inside the TabsList.
|
||||
* @default {}
|
||||
*/
|
||||
slotProps?: {
|
||||
root?: SlotComponentProps<'div', TabsListRootSlotPropsOverrides, TabsListOwnerState>;
|
||||
};
|
||||
/**
|
||||
* The components used for each slot inside the TabsList.
|
||||
* Either a string to use a HTML element or a component.
|
||||
* @default {}
|
||||
*/
|
||||
slots?: TabsListSlots;
|
||||
}
|
||||
export interface TabsListSlots {
|
||||
/**
|
||||
* The component that renders the root.
|
||||
* @default 'div'
|
||||
*/
|
||||
root?: React.ElementType;
|
||||
}
|
||||
export interface TabsListTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
|
||||
props: TabsListOwnProps & AdditionalProps;
|
||||
defaultComponent: RootComponentType;
|
||||
}
|
||||
export type TabsListProps<RootComponentType extends React.ElementType = TabsListTypeMap['defaultComponent']> = PolymorphicProps<TabsListTypeMap<{}, RootComponentType>, RootComponentType>;
|
||||
export type TabsListOwnerState = Simplify<TabsListOwnProps & {
|
||||
isRtl: boolean;
|
||||
orientation: 'horizontal' | 'vertical';
|
||||
}>;
|
||||
export type TabsListRootSlotProps = UseTabsListRootSlotProps & {
|
||||
className?: string;
|
||||
ownerState: TabsListOwnerState;
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export { TabsList } from './TabsList';
|
||||
export * from './TabsList.types';
|
||||
export * from './tabsListClasses';
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
'use client';
|
||||
|
||||
export { TabsList } from './TabsList';
|
||||
export * from './TabsList.types';
|
||||
export * from './tabsListClasses';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/TabsList/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
export interface TabsListClasses {
|
||||
/** Class name applied to the root element. */
|
||||
root: string;
|
||||
/** Class name applied to the root element if `orientation='horizontal'`. */
|
||||
horizontal: string;
|
||||
/** Class name applied to the root element if `orientation='vertical'`. */
|
||||
vertical: string;
|
||||
}
|
||||
export type TabsListClassKey = keyof TabsListClasses;
|
||||
export declare function getTabsListUtilityClass(slot: string): string;
|
||||
export declare const tabsListClasses: TabsListClasses;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { generateUtilityClass } from '../generateUtilityClass';
|
||||
import { generateUtilityClasses } from '../generateUtilityClasses';
|
||||
const COMPONENT_NAME = 'TabsList';
|
||||
export function getTabsListUtilityClass(slot) {
|
||||
return generateUtilityClass(COMPONENT_NAME, slot);
|
||||
}
|
||||
export const tabsListClasses = generateUtilityClasses(COMPONENT_NAME, ['root', 'horizontal', 'vertical']);
|
||||
Reference in new issue
Block a user