diff --git a/components.js b/components.js index f14dc99..edcfa20 100644 --- a/components.js +++ b/components.js @@ -74,11 +74,13 @@ smButton.innerHTML = ` background-color: rgba(var(--text-color), 0.3); } @media (hover: hover){ - :host(:not([disabled])) .button:hover{ + :host(:not([disabled])) .button:hover, + :host(:focus-within:not([disabled])) .button{ -webkit-box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); - box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); + box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.8rem rgba(0, 0, 0, 0.12); } - :host([variant='outlined']) .button:hover{ + :host([variant='outlined']:not([disabled])) .button:hover, + :host(:focus-within[variant='outlined']:not([disabled])) .button:hover{ -webkit-box-shadow: 0 0 0 1px rgba(var(--text-color), 0.2) inset, 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.4rem 0.8rem rgba(0, 0, 0, 0.12); box-shadow: 0 0 0 1px rgba(var(--text-color), 0.2) inset, 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.4rem 0.8rem rgba(0, 0, 0, 0.12); } @@ -120,6 +122,9 @@ customElements.define('sm-button', this.removeAttribute('disabled'); } } + focusIn() { + this.focus(); + } handleKeyDown(e) { if (!this.hasAttribute('disabled') && (e.key === 'Enter' || e.code === 'Space')) { @@ -156,12 +161,11 @@ smForm.innerHTML = ` } :host{ display: flex; - --gap: 1rem; width: 100%; } form{ display: grid; - gap: var(--gap); + gap: var(--gap, 1.5rem); width: 100%; } @@ -986,6 +990,27 @@ customElements.define('sm-notifications', class extends HTMLElement { }); } }); + + + +class Stack { + constructor() { + this.items = []; + } + push(element) { + this.items.push(element); + } + pop() { + if (this.items.length == 0) + return "Underflow"; + return this.items.pop(); + } + peek() { + return this.items[this.items.length - 1]; + } +} +const popupStack = new Stack(); + const smPopup = document.createElement('template'); smPopup.innerHTML = ` -
@@ -214,15 +228,29 @@