import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';

const klevuProductGridCss = ":host{--grid-spacing:var(--klevu-product-grid-spacing, var(--klevu-spacing-05));--product-width:var(--klevu-product-grid-product-width, 250px)}.gridcontainer{display:grid;grid-gap:var(--grid-spacing);grid-template-columns:repeat(auto-fill, minmax(var(--product-width), 1fr))}";

const KlevuProductGrid = /*@__PURE__*/ proxyCustomElement(class KlevuProductGrid extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
    this.itemsPerRow = undefined;
  }
  render() {
    const style = {};
    if (this.itemsPerRow) {
      style.gridTemplateColumns = `repeat(${this.itemsPerRow}, 1fr)`;
    }
    return (h(Host, null, h("div", { class: "gridcontainer", style: style, part: "product-grid-base" }, h("slot", null))));
  }
  static get style() { return klevuProductGridCss; }
}, [1, "klevu-product-grid", {
    "itemsPerRow": [2, "items-per-row"]
  }]);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["klevu-product-grid"];
  components.forEach(tagName => { switch (tagName) {
    case "klevu-product-grid":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, KlevuProductGrid);
      }
      break;
  } });
}
defineCustomElement();

export { KlevuProductGrid as K, defineCustomElement as d };

//# sourceMappingURL=klevu-product-grid2.js.map