@limetech/lime-elements
Version:
38 lines (34 loc) • 2.2 kB
JavaScript
import { r as registerInstance, h } from './index-2714248e.js';
const bannerCss = ".lime-banner{min-height:3.25rem;display:none;background-color:rgba(var(--contrast-100), 0.7);backdrop-filter:blur(0.3125rem);box-shadow:var(--shadow-depth-16)}.lime-banner.lime-banner--open{display:block}.lime-banner.lime-banner--open .lime-banner__surface{opacity:1}.lime-banner .lime-banner__surface{display:flex;justify-content:center;box-sizing:border-box;opacity:0}.lime-banner .lime-banner__content{display:flex;align-items:center;align-content:stretch;padding:1rem;flex-wrap:wrap}.lime-banner .icon-message{display:flex;align-items:center}.lime-banner div[class^=mdc-typography]{color:rgb(var(--contrast-1200))}.lime-banner .lime-banner__icon{margin:0 0.625rem;align-self:flex-start}.lime-banner .lime-banner__actions{margin-left:3.125rem;display:flex;justify-content:flex-end}.lime-banner limel-icon{color:var(--banner-icon-fill-color, rgb(var(--contrast-100)));background-color:var(--banner-icon-background-color, rgb(var(--contrast-800)))}@media screen and (max-width: 760px){.lime-banner__content{flex-direction:column;gap:0.5rem}.icon-message{display:flex;align-items:center}.lime-banner__actions{margin-left:0}}";
const Banner = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.message = undefined;
this.icon = undefined;
this.isOpen = false;
}
/**
* Open the banner
*/
async open() {
this.isOpen = true;
}
/**
* Close the banner
*/
async close() {
this.isOpen = false;
}
render() {
return (h("div", { class: `lime-banner ${this.isOpen ? 'lime-banner--open' : ''}` }, h("div", { class: "lime-banner__surface" }, h("div", { class: "lime-banner__content" }, h("div", { class: "icon-message" }, this.renderIcon(), h("div", null, this.message)), h("div", { class: "lime-banner__actions" }, h("slot", { name: "buttons" }))))));
}
renderIcon() {
if (!this.icon) {
return;
}
return (h("div", { class: "lime-banner__icon" }, h("limel-icon", { name: this.icon, badge: true, size: "large" })));
}
};
Banner.style = bannerCss;
export { Banner as limel_banner };
//# sourceMappingURL=limel-banner.entry.js.map