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";
const Responsive = forwardRef((_a, ref) => {
    var { as: Component = "div", className, above, below, variant, asChild } = _a, rest = __rest(_a, ["as", "className", "above", "below", "variant", "asChild"]);
    const aboveProp = variant === "show" ? above : below;
    const belowProp = variant === "show" ? below : above;
    const Comp = asChild ? Slot : Component;
    return (React.createElement(Comp, Object.assign({}, rest, { ref: ref, className: cl("aksel-responsive", className, {
            [`aksel-responsive__above--${aboveProp}`]: aboveProp,
            [`aksel-responsive__below--${belowProp}`]: belowProp,
        }) })));
});
/**
 * Responsive view Primitive to show/hide elements based on breakpoints
 *
 * @see [📝 Documentation](https://aksel.nav.no/komponenter/primitives/hide)
 * @see 🏷️ {@link ResponsiveProps}
 *
 * @example
 * <HGrid columns={{ xs: 1, md: 2 }} gap="space-16">
 *   <div/>
 *   <Hide below="md" asChild>
 *      // Only visible above "md"
 *   </Hide>
 * </HGrid>
 * @example
 * <HGrid columns={{ xs: 1, md: 2 }} gap="space-16">
 *   <div/>
 *   <Hide above="md" asChild>
 *      // Only visible below "md"
 *   </Hide>
 * </HGrid>
 */
export const Hide = forwardRef((props, ref) => React.createElement(Responsive, Object.assign({}, props, { ref: ref, variant: "hide" })));
/**
 * Responsive view Primitive to show/hide elements based on breakpoints
 *
 * @see [📝 Documentation](https://aksel.nav.no/komponenter/primitives/show)
 * @see 🏷️ {@link ResponsiveProps}
 *
 * @example
 * <HGrid columns={{ xs: 1, md: 2 }} gap="space-16">
 *   <div/>
 *   <Show below="md" asChild>
 *      // Only visible below "md"
 *   </Show>
 * </HGrid>
 * @example
 * <HGrid columns={{ xs: 1, md: 2 }} gap="space-16">
 *   <div/>
 *   <Show above="md" asChild>
 *      // Only visible above "md"
 *   </Show>
 * </HGrid>
 */
export const Show = forwardRef((props, ref) => React.createElement(Responsive, Object.assign({}, props, { ref: ref, variant: "show" })));
//# sourceMappingURL=Responsive.js.map