import { jsx as _jsx } from "react/jsx-runtime";
import { cva } from '../utils/cva';
import { descriptionClassnames } from './constants';
import { DescriptionContextProvider } from './DescriptionContext';
import { Name } from './Name';
import { Wrapper } from './styles';
import { useLogic } from './useLogic';
import { Value } from './Value';
const rootCva = cva(descriptionClassnames.root, {
    variants: {
        direction: {
            default: descriptionClassnames.directionDefault,
            column: descriptionClassnames.directionColumn,
            row: descriptionClassnames.directionRow,
        },
        justifyContent: {
            'space-between': descriptionClassnames.justifyContentSpaceBetween,
            start: descriptionClassnames.justifyContentStart,
        },
    },
});
export const Description = (props) => {
    const { descriptionContextProviderProps, direction } = useLogic(props);
    const { justifyContent = 'start', component = 'dl', children, leader = false, } = props;
    return (_jsx(DescriptionContextProvider, { leader: leader, direction: direction, ...descriptionContextProviderProps, children: _jsx(Wrapper, { className: rootCva({ direction, justifyContent }), as: component, children: children }) }));
};
Description.Name = Name;
Description.Value = Value;
