"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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Breadcrumbs = exports.BreadcrumbsBase = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const core_1 = require("../core");
const utils_1 = require("../utils");
const breadcrumbsItem_1 = __importDefault(require("./breadcrumbsItem"));
const breadcrumbsSeparator_1 = __importDefault(require("./breadcrumbsSeparator"));
const context_1 = require("./context");
exports.BreadcrumbsBase = core_1.styled.divBox `
  display: flex;
  min-width: 0;
  transition-duration: normal;

  .vui-breadcrumbs-item:last-of-type {
    font-weight: 600;
  }
`;
/** Breadcrumbs consist of a list of items that help a user visualize a page's location within the hierarchical structure of a website, and allow correspondent navigation. */
exports.Breadcrumbs = (0, core_1.vui)((props, ref) => {
    const { children, className, size, variant } = props, rest = __rest(props, ["children", "className", "size", "variant"]);
    const styles = (0, core_1.useStyleConfig)('Breadcrumbs', props);
    const context = (0, react_1.useMemo)(() => (0, utils_1.filterUndefined)({ size, variant }), [size, variant]);
    const aliasedProps = (0, utils_1.filterUndefined)({});
    const arrayChildren = react_1.Children.toArray(children);
    return ((0, jsx_runtime_1.jsx)(context_1.BreadcrumbsProvider, { value: context, children: (0, jsx_runtime_1.jsx)(exports.BreadcrumbsBase, Object.assign({ className: (0, utils_1.cs)('vui-breadcrumbs', className), ref: ref }, styles.main, aliasedProps, rest, { children: react_1.Children.map(arrayChildren, (child, key) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [child, key !== arrayChildren.length - 1 && (0, jsx_runtime_1.jsx)(breadcrumbsSeparator_1.default, {})] }, key))) })) }));
});
exports.Breadcrumbs.Item = breadcrumbsItem_1.default;
exports.Breadcrumbs.displayName = 'Breadcrumbs';
exports.default = exports.Breadcrumbs;
//# sourceMappingURL=breadcrumbs.js.map