// // Copyright 2026 DXOS.org // import { ark } from '@ark-ui/react/factory'; import React from 'react'; import { mx } from '@dxos/ui-theme'; import { composableProps, slottable } from '../../util/slots.ts'; import { type Align, type Gap, type Justify, alignClasses, gapClasses, justifyClasses } from '../layout.ts'; export type FlexProps = { /** Stack on the block axis instead of the inline axis. */ column?: boolean; gap?: Gap; align?: Align; justify?: Justify; wrap?: boolean; /** Absorb slack from the parent track (`flex-1`) and clip rather than push it wider. */ grow?: boolean; /** Center on both axes; equivalent to `align='center' justify='center'`. */ center?: boolean; }; /** * One-axis layout box: the primitive that replaces hand-written `flex …` wrapper divs. * * `gap` is restricted to the named steps of the theme spacing ramp (see {@link Gap}), which is the * point of the prop — an off-ramp `gap-2`/`gap-3` literal in a container is the drift it prevents. * Anything the props don't cover (padding, sizing, overflow, colour) goes through `classNames`; the * component deliberately grows no padding or colour props, since components own their own spacing. * * There is no implicit `align`. Row-centering is the common case, but defaulting it would silently * restyle any consumer relying on the CSS `stretch` initial value. * * Use `asChild` to project the layout onto a semantic element (`
`, `