"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Definition = exports.DefinitionHorizontalBase = exports.DefinitionVerticalBase = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("../core");
const utils_1 = require("../utils");
const definitionContent_1 = require("./definitionContent");
/**
 * Properties are definition lists
 * */
// @formatter:off
exports.DefinitionVerticalBase = core_1.styled.dlBox `
  display: grid;
  gap: 1em;
  grid-template-columns: repeat(auto-fit, minmax(10em, 20em));

  .vui-definitionItemWrapper {
    display: flex;
    flex-direction: column;
  }

  dt {
    display: inline-flex;
  }

  dd {
    white-space: pre-wrap;
  }

  dd > * {
    margin-left: 0 !important;
  }
`;
exports.DefinitionHorizontalBase = core_1.styled.dlBox `
  padding: 10px;
  display: grid;
  gap: 0;

  .vui-definitionItemWrapper {
    display: flex;
    flex-direction: column;
    @media (min-width: 1024px) {
      flex-direction: row;
    }
  }

  dt,
  dd {
    display: inline-flex;
    padding-left: 5px;
  }

  dt {
    width: 20%;
    min-width: 130px;
  }

  dd {
    white-space: pre-wrap;
  }

  dd > * {
    margin-left: 0 !important;
  }
`;
// @formatter:on
exports.Definition = (0, core_1.vui)((props, ref) => {
    const _a = (0, core_1.omitThemingProps)(props), { orientation = 'horizontal', className } = _a, rest = __rest(_a, ["orientation", "className"]);
    const styles = (0, core_1.useStyleConfig)('Definition', props);
    return orientation === 'horizontal' ? ((0, jsx_runtime_1.jsx)(exports.DefinitionHorizontalBase, Object.assign({ className: (0, utils_1.cs)('vui-definition vui-definition-horizontal', className), ref: ref }, styles.container, rest, { children: (0, jsx_runtime_1.jsx)(definitionContent_1.DefinitionContent, Object.assign({ orientation: "horizontal" }, rest)) }))) : ((0, jsx_runtime_1.jsx)(exports.DefinitionVerticalBase, Object.assign({ className: (0, utils_1.cs)('vui-definition vui-definition-vertical', className), ref: ref }, styles.container, rest, { children: (0, jsx_runtime_1.jsx)(definitionContent_1.DefinitionContent, Object.assign({ orientation: "vertical" }, rest)) })));
});
exports.Definition.displayName = 'Definition';
exports.default = exports.Definition;
//# sourceMappingURL=definition.js.map