"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Description = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const cva_1 = require("../utils/cva");
const constants_1 = require("./constants");
const DescriptionContext_1 = require("./DescriptionContext");
const Name_1 = require("./Name");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const Value_1 = require("./Value");
const rootCva = (0, cva_1.cva)(constants_1.descriptionClassnames.root, {
    variants: {
        direction: {
            default: constants_1.descriptionClassnames.directionDefault,
            column: constants_1.descriptionClassnames.directionColumn,
            row: constants_1.descriptionClassnames.directionRow,
        },
        justifyContent: {
            'space-between': constants_1.descriptionClassnames.justifyContentSpaceBetween,
            start: constants_1.descriptionClassnames.justifyContentStart,
        },
    },
});
const Description = (props) => {
    const { descriptionContextProviderProps, direction } = (0, useLogic_1.useLogic)(props);
    const { justifyContent = 'start', component = 'dl', children, leader = false, } = props;
    return ((0, jsx_runtime_1.jsx)(DescriptionContext_1.DescriptionContextProvider, { leader: leader, direction: direction, ...descriptionContextProviderProps, children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { className: rootCva({ direction, justifyContent }), as: component, children: children }) }));
};
exports.Description = Description;
exports.Description.Name = Name_1.Name;
exports.Description.Value = Value_1.Value;
