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;
};
import React, { forwardRef } from "react";
import { Slot } from "../../utils/components/slot/Slot.js";
import { cl } from "../../utils/helpers/index.js";
import { getResponsiveProps } from "../utilities/css.js";
/**
 * Foundational Layout-primitive for generic encapsulation & styling.
 *
 * @see [📝 Documentation](https://aksel.nav.no/komponenter/primitives/Bleed)
 * @see 🏷️ {@link BleedProps}
 * @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
 *
 * @example
 * <Box padding="space-16">
 *   <Bleed marginInline="space-16" marginBlock="space-16">
 *     <BodyLong>Some content</BodyLong>
 *   </Bleed>
 * </Box>
 */
export const Bleed = forwardRef((_a, ref) => {
    var { className, marginInline, marginBlock, reflectivePadding, style: _style, asChild } = _a, rest = __rest(_a, ["className", "marginInline", "marginBlock", "reflectivePadding", "style", "asChild"]);
    let style = Object.assign(Object.assign(Object.assign({}, _style), getResponsiveProps("bleed", "margin-inline", "space", marginInline, true)), getResponsiveProps("bleed", "margin-block", "space", marginBlock, true));
    if (reflectivePadding) {
        style = Object.assign(Object.assign(Object.assign({}, style), getResponsiveProps("bleed", "padding-inline", "space", marginInline, false)), getResponsiveProps("bleed", "padding-block", "space", marginBlock, false));
    }
    const Comp = asChild ? Slot : "div";
    return (React.createElement(Comp, Object.assign({}, rest, { className: cl("aksel-bleed", className, {
            "aksel-bleed--padding": reflectivePadding,
        }), ref: ref, style: style })));
});
export default Bleed;
//# sourceMappingURL=Bleed.js.map