UNPKG

902 BJavaScriptView Raw
1import classNames from 'classnames';
2import * as React from 'react';
3import { useBootstrapPrefix, useBootstrapBreakpoints, useBootstrapMinBreakpoint } from './ThemeProvider';
4import createUtilityClassName, { responsivePropType } from './createUtilityClasses';
5import { jsx as _jsx } from "react/jsx-runtime";
6const Stack = /*#__PURE__*/React.forwardRef(({
7 as: Component = 'div',
8 bsPrefix,
9 className,
10 direction,
11 gap,
12 ...props
13}, ref) => {
14 bsPrefix = useBootstrapPrefix(bsPrefix, direction === 'horizontal' ? 'hstack' : 'vstack');
15 const breakpoints = useBootstrapBreakpoints();
16 const minBreakpoint = useBootstrapMinBreakpoint();
17 return /*#__PURE__*/_jsx(Component, { ...props,
18 ref: ref,
19 className: classNames(className, bsPrefix, ...createUtilityClassName({
20 gap,
21 breakpoints,
22 minBreakpoint
23 }))
24 });
25});
26Stack.displayName = 'Stack';
27export default Stack;
\No newline at end of file