'use strict';

var index = require('./index-Bq84pjsN.js');

const spacerCss = () => `@layer base {   :host .dds-spacer {     display: var(--dds-spacer-display, block);     block-size: var(--dds-spacer-size-y);     inline-size: var(--dds-spacer-size-x);   } }  @layer reset, base; `;

const Spacer = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    // MARK: Props
    x = 0;
    y = 0;
    // MARK: Render
    render() {
        const { x, y } = this;
        function getDisplayValue() {
            if ((x ?? 0) > 0) {
                return "inline-block";
            }
            else if ((y ?? 0) > 0) {
                return "block";
            }
            return null;
        }
        function handleSpacerStyles() {
            const spacerStyles = {};
            const setSpacerProperty = (value, property, suffix = "") => {
                const sizeValue = `var(--dds-size-${value})`;
                const tokenValue = property === "size" ? sizeValue : value;
                if (value) {
                    spacerStyles[`--dds-spacer-${property}${suffix}`] = tokenValue;
                }
            };
            setSpacerProperty(x, "size", "-x");
            setSpacerProperty(y, "size", "-y");
            setSpacerProperty(getDisplayValue(), "display");
            return spacerStyles;
        }
        return (index.jsx(index.Host, { part: "root", children: index.jsx("span", { class: "dds-spacer", "aria-hidden": "true", style: handleSpacerStyles() }) }));
    }
};
Spacer.style = spacerCss();

exports.dds_spacer = Spacer;
