import * as React from 'react'; import type { BoxProps } from "../Box/Box.js"; import type { AdaptiveProp, MediaPartial, Space } from "../types.js"; import "./Flex.css"; export interface FlexProps extends BoxProps { /** * `flex-direction` property */ direction?: AdaptiveProp<'flexDirection'>; /** * `flex-grow` property */ grow?: true | React.CSSProperties['flexGrow']; /** * `flex-basis` property */ basis?: React.CSSProperties['flexBasis']; /** * `flex-shrink` property */ shrink?: React.CSSProperties['flexShrink']; /** * `align-` properties */ alignContent?: AdaptiveProp<'justifyContent'>; alignItems?: AdaptiveProp<'alignItems'>; alignSelf?: AdaptiveProp<'alignSelf'>; /** * `justify-` properties */ justifyContent?: AdaptiveProp<'justifyContent'>; justifyItems?: AdaptiveProp<'justifyItems'>; justifySelf?: AdaptiveProp<'justifySelf'>; /** * Shortcut for: * * ```css * justify-content: center; align-items: center; * ``` */ centerContent?: true; /** * `flex-wrap` property * * If value equals `true`, add css property `flex-wrap: wrap`; */ wrap?: true | React.CSSProperties['flexWrap']; /** * display: inline-flex; */ inline?: boolean; gap?: Space | MediaPartial; gapRow?: Space | MediaPartial; /** * @deprecated - use native gap property * Space between children. Works like gap but supports in old browsers. Under the hoods uses negative margins. Vertical and horizontal directions are also supported * * --- * instead of ~imperfection of the world~ browser compatibility for margins between layout components used negative margins there is passible issues with `background-color` css property and others that depends of current block position. Use in this situations wrappers. In future version this issues will be avoided during flex `gap` properties * * ```tsx * // wrong * * * * * * // right * *
* *
*
* *
*
* ``` */ space?: Space | MediaPartial; } type FlexRef = React.ComponentPropsWithRef['ref']; type FlexPropsWithTypedAttrs = FlexProps & Omit, keyof FlexProps>; /** * Flexbox model utility component. * * ```tsx * import {Flex, Button} from '@gravity-ui/uikit'; * * * * * * ``` * * Use build in media goods via props * * ```tsx * * {...} * * ``` * --- * Storybook - https://preview.gravity-ui.com/uikit/?path=/docs/layout--playground#flex */ export declare const Flex: ((props: FlexPropsWithTypedAttrs & { ref?: FlexRef; }) => React.ReactElement) & { displayName: string; }; export {};