@ctrliq/quantic-components 1.67.2 → 1.67.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37027,7 +37027,7 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37027
37027
  flex-shrink: 0;
37028
37028
  display: flex;
37029
37029
  }
37030
- `,t([Ie({type:"boolean",default:"false",reflect:!0,description:"Highlights the item as the currently active route."})],e.NavbarMenuItem.prototype,"selected",void 0),t([Ie({type:"string",default:"",description:"URL to navigate to. When set the element renders as an <a> tag."})],e.NavbarMenuItem.prototype,"href",void 0),t([Ie({type:"string",default:"",attribute:"aria-label",description:"Accessible label for the nav item (required for icon-only items)."})],e.NavbarMenuItem.prototype,"ariaLabel",void 0),e.NavbarMenuItem=t([be("quantic-navbar-menu-item")],e.NavbarMenuItem);class Po{constructor(e,t){this.host=e,this.matchesValue=!1,this.handleChange=e=>{this.matchesValue=e.matches,this.host.requestUpdate()},"undefined"!=typeof window&&window.matchMedia&&(this.mediaQuery=window.matchMedia(t),this.matchesValue=this.mediaQuery.matches),this.host.addController(this)}hostConnected(){this.mediaQuery?.addEventListener("change",this.handleChange)}hostDisconnected(){this.mediaQuery?.removeEventListener("change",this.handleChange)}get matches(){return!!this.mediaQuery&&this.matchesValue}}class jo{static below(e){return`(max-width: ${e-1}px)`}static above(e){return`(min-width: ${e}px)`}static between(e,t){return`(min-width: ${e}px) and (max-width: ${t-1}px)`}}function zo(e){return function(t,i){const n=Symbol(i);Object.defineProperty(t,i,{get(){return this[n]||(this[n]=new Po(this,e)),this[n].matches},enumerable:!0,configurable:!0})}}const Ho="aside.expanded";e.Button.ensureDefined(),e.LucideIconMenu.ensureDefined(),e.Layout=class extends(Me(Ce,["logo","titlebar","toolbar","navbar","sidebar"])){constructor(){super(...arguments),this.variant=Ao.Default,this.hasSidebarSlot=!1,this.hasTitlebarSlot=!1,this.hasNavbarSlot=!1,this.hasLogoSlot=!1,this._isAsideExpanded=!0,this.handleAsideExpand=e=>{this.isAsideExpanded=e.detail.expanded},this.handleKeydown=e=>{"Escape"===e.key&&this.isAsideExpanded&&(this.isAsideExpanded=!1)}}get isAsideExpanded(){return this._isAsideExpanded}set isAsideExpanded(e){const t=this._isAsideExpanded;this._isAsideExpanded=e,t!==e&&(this.requestUpdate("isAsideExpanded",t),e?this.activateFocusTrap():this.deactivateFocusTrap())}toggleAsideExpanded(){this.isAsideExpanded=!this.isAsideExpanded}async activateFocusTrap(){if(this.isSmallViewport&&this.asideElement){await this.updateComplete;try{this.focusTrap=Jn(this.asideElement,{escapeDeactivates:!1,clickOutsideDeactivates:!1,allowOutsideClick:!0,initialFocus:!1,returnFocusOnDeactivate:!0,setReturnFocus:()=>this.toggleButtonElement||document.body,tabbableOptions:{getShadowRoot:!0}}),this.focusTrap.activate()}catch(e){console.error("Failed to activate focus trap:",e),this.focusTrap=null}}}deactivateFocusTrap(){if(this.focusTrap)try{this.focusTrap.deactivate()}catch(e){console.error("Failed to deactivate focus trap:",e)}finally{this.focusTrap=null}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown),this.deactivateFocusTrap()}willUpdate(e){void 0===this.previousIsSmallViewport&&(this._isAsideExpanded=!this.isSmallViewport,this.previousIsSmallViewport=this.isSmallViewport)}updated(e){super.updated(e),this.previousIsSmallViewport!==this.isSmallViewport&&(this.isAsideExpanded=!this.isSmallViewport),this.previousIsSmallViewport=this.isSmallViewport}get isAsideCollapsible(){return this.isSmallViewport&&this.hasSidebar}get hasSidebar(){return this.hasSidebarSlot}get hasTitlebar(){return this.hasTitlebarSlot}get hasHeader(){return this.isAsideCollapsible||this.hasTitlebarSlot||this.hasNavbarSlot||this.hasLogoSlot}render(){const e=je`<quantic-button
37030
+ `,t([Ie({type:"boolean",default:"false",reflect:!0,description:"Highlights the item as the currently active route."})],e.NavbarMenuItem.prototype,"selected",void 0),t([Ie({type:"string",default:"",description:"URL to navigate to. When set the element renders as an <a> tag."})],e.NavbarMenuItem.prototype,"href",void 0),t([Ie({type:"string",default:"",attribute:"aria-label",description:"Accessible label for the nav item (required for icon-only items)."})],e.NavbarMenuItem.prototype,"ariaLabel",void 0),e.NavbarMenuItem=t([be("quantic-navbar-menu-item")],e.NavbarMenuItem);class Po{constructor(e,t){this.host=e,this.matchesValue=!1,this.handleChange=e=>{this.matchesValue=e.matches,this.host.requestUpdate()},"undefined"!=typeof window&&window.matchMedia&&(this.mediaQuery=window.matchMedia(t),this.matchesValue=this.mediaQuery.matches),this.host.addController(this)}hostConnected(){this.mediaQuery?.addEventListener("change",this.handleChange)}hostDisconnected(){this.mediaQuery?.removeEventListener("change",this.handleChange)}get matches(){return!!this.mediaQuery&&this.matchesValue}}class jo{static below(e){return`(max-width: ${e-1}px)`}static above(e){return`(min-width: ${e}px)`}static between(e,t){return`(min-width: ${e}px) and (max-width: ${t-1}px)`}}function zo(e){return function(t,i){const n=Symbol(i);Object.defineProperty(t,i,{get(){return this[n]||(this[n]=new Po(this,e)),this[n].matches},enumerable:!0,configurable:!0})}}const Ho="aside.expanded";e.Button.ensureDefined(),e.LucideIconMenu.ensureDefined(),e.Layout=class extends(Me(Ce,["logo","titlebar","toolbar","navbar","sidebar"])){constructor(){super(...arguments),this.variant=Ao.Default,this.hasSidebarSlot=!1,this.hasTitlebarSlot=!1,this._isAsideExpanded=!0,this.handleAsideExpand=e=>{this.isAsideExpanded=e.detail.expanded},this.handleKeydown=e=>{"Escape"===e.key&&this.isAsideExpanded&&(this.isAsideExpanded=!1)}}get isAsideExpanded(){return this._isAsideExpanded}set isAsideExpanded(e){const t=this._isAsideExpanded;this._isAsideExpanded=e,t!==e&&(this.requestUpdate("isAsideExpanded",t),e?this.activateFocusTrap():this.deactivateFocusTrap())}toggleAsideExpanded(){this.isAsideExpanded=!this.isAsideExpanded}async activateFocusTrap(){if(this.isSmallViewport&&this.asideElement){await this.updateComplete;try{this.focusTrap=Jn(this.asideElement,{escapeDeactivates:!1,clickOutsideDeactivates:!1,allowOutsideClick:!0,initialFocus:!1,returnFocusOnDeactivate:!0,setReturnFocus:()=>this.toggleButtonElement||document.body,tabbableOptions:{getShadowRoot:!0}}),this.focusTrap.activate()}catch(e){console.error("Failed to activate focus trap:",e),this.focusTrap=null}}}deactivateFocusTrap(){if(this.focusTrap)try{this.focusTrap.deactivate()}catch(e){console.error("Failed to deactivate focus trap:",e)}finally{this.focusTrap=null}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown),this.deactivateFocusTrap()}willUpdate(e){void 0===this.previousIsSmallViewport&&(this._isAsideExpanded=!this.isSmallViewport,this.previousIsSmallViewport=this.isSmallViewport)}updated(e){super.updated(e),this.previousIsSmallViewport!==this.isSmallViewport&&(this.isAsideExpanded=!this.isSmallViewport),this.previousIsSmallViewport=this.isSmallViewport}static finalizeStyles(e){return[...super.finalizeStyles(e)??[],r('@layer quantic-header-visibility {\n .header { display: none; }\n .header.collapsible,\n :host(:has([slot="navbar"])) .header,\n :host(:has([slot="titlebar"])) .header,\n :host(:has([slot="logo"])) .header { display: revert-layer; }\n @scope {\n :scope:has([slot="navbar"]) .header,\n :scope:has([slot="titlebar"]) .header,\n :scope:has([slot="logo"]) .header { display: revert-layer; }\n }\n }')]}get isAsideCollapsible(){return this.isSmallViewport&&this.hasSidebar}get hasSidebar(){return this.hasSidebarSlot}get hasTitlebar(){return this.hasTitlebarSlot}render(){const e=je`<quantic-button
37031
37031
  class="toggle-button"
37032
37032
  variant="outline"
37033
37033
  size="sm"
@@ -37040,7 +37040,6 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37040
37040
  </quantic-button>`,t=je`<slot
37041
37041
  name="logo"
37042
37042
  class="logo"
37043
- @slotchange=${nn(e=>this.hasLogoSlot=e)}
37044
37043
  ></slot>`,i=je`<slot
37045
37044
  class="titlebar"
37046
37045
  name="titlebar"
@@ -37050,14 +37049,13 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37050
37049
  class=${Oe({wrapper:!0,"has-sidebar":this.hasSidebar,"is-aside-expanded":this.isAsideExpanded,[`variant--${this.variant}`]:!0})}
37051
37050
  @expanded-changed=${this.handleAsideExpand}
37052
37051
  >
37053
- <header class="header" ?hidden=${!this.hasHeader}>
37052
+ <header class=${Oe({header:!0,collapsible:this.isAsideCollapsible})}>
37054
37053
  ${this.hasSidebar?null:t}
37055
37054
  ${this.isAsideCollapsible?e:null}
37056
37055
  ${this.isSmallViewport?null:i}
37057
37056
  <slot
37058
37057
  class="navbar"
37059
37058
  name="navbar"
37060
- @slotchange=${nn(e=>this.hasNavbarSlot=e)}
37061
37059
  ></slot>
37062
37060
  </header>
37063
37061
 
@@ -37070,7 +37068,6 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37070
37068
 
37071
37069
  <div
37072
37070
  class="aside-backdrop"
37073
- ?hidden=${!this.hasSidebar}
37074
37071
  aria-hidden="true"
37075
37072
  @click=${this.toggleAsideExpanded}
37076
37073
  ></div>
@@ -37237,7 +37234,7 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37237
37234
  opacity: 0;
37238
37235
  }
37239
37236
 
37240
- .is-aside-expanded .aside-backdrop {
37237
+ .has-sidebar.is-aside-expanded .aside-backdrop {
37241
37238
  display: block;
37242
37239
  pointer-events: auto;
37243
37240
  opacity: var(--quantic-component-layout-aside-backdrop-opacity);
@@ -37262,8 +37259,6 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37262
37259
 
37263
37260
  .header {
37264
37261
  grid-area: header;
37265
- display: flex;
37266
- align-items: center;
37267
37262
  }
37268
37263
 
37269
37264
  .logo {
@@ -37290,7 +37285,7 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37290
37285
  pointer-events: auto;
37291
37286
  }
37292
37287
 
37293
- .is-aside-expanded .aside-backdrop {
37288
+ .has-sidebar.is-aside-expanded .aside-backdrop {
37294
37289
  display: none;
37295
37290
  }
37296
37291
 
@@ -37334,7 +37329,7 @@ const io="important",no=" !"+io,oo=Fe(class extends Re{constructor(e){if(super(e
37334
37329
  min-width: var(--quantic-spacing-80);
37335
37330
  max-width: var(--quantic-spacing-160);
37336
37331
  }
37337
- `,t([Ie({type:"LayoutVariant",options:Object.values(Ao),default:Ao.Default,reflect:!0,description:'Layout mode. "default" uses full-bleed content; "focused" centres content with a max-width cap.'})],e.Layout.prototype,"variant",void 0),t([zo(jo.below(1024))],e.Layout.prototype,"isSmallViewport",void 0),t([we()],e.Layout.prototype,"hasSidebarSlot",void 0),t([we()],e.Layout.prototype,"hasTitlebarSlot",void 0),t([we()],e.Layout.prototype,"hasNavbarSlot",void 0),t([we()],e.Layout.prototype,"hasLogoSlot",void 0),t([ke(".aside")],e.Layout.prototype,"asideElement",void 0),t([ke(".toggle-button")],e.Layout.prototype,"toggleButtonElement",void 0),t([Qi({context:Ho})],e.Layout.prototype,"_isAsideExpanded",void 0),e.Layout=t([be("quantic-layout")],e.Layout),e.LayoutLogo=class extends Ce{render(){return!0===this.expanded?G`<slot name="expanded"></slot>`:G`<slot name="collapsed"></slot>`}},e.LayoutLogo.meta={tag:"quantic-layout-logo",description:"Logo area that lives inside the quantic-layout header or sidebar. Automatically switches between expanded and collapsed slots based on the sidebar state consumed from context.",category:"layout",slots:{expanded:{description:"Logo shown when the sidebar is expanded (full wordmark)."},collapsed:{description:"Logo shown when the sidebar is collapsed (icon only)."}}},e.LayoutLogo.styles=l`
37332
+ `,t([Ie({type:"LayoutVariant",options:Object.values(Ao),default:Ao.Default,reflect:!0,description:'Layout mode. "default" uses full-bleed content; "focused" centres content with a max-width cap.'})],e.Layout.prototype,"variant",void 0),t([zo(jo.below(1024))],e.Layout.prototype,"isSmallViewport",void 0),t([we()],e.Layout.prototype,"hasSidebarSlot",void 0),t([we()],e.Layout.prototype,"hasTitlebarSlot",void 0),t([ke(".aside")],e.Layout.prototype,"asideElement",void 0),t([ke(".toggle-button")],e.Layout.prototype,"toggleButtonElement",void 0),t([Qi({context:Ho})],e.Layout.prototype,"_isAsideExpanded",void 0),e.Layout=t([be("quantic-layout")],e.Layout),e.LayoutLogo=class extends Ce{render(){return!0===this.expanded?G`<slot name="expanded"></slot>`:G`<slot name="collapsed"></slot>`}},e.LayoutLogo.meta={tag:"quantic-layout-logo",description:"Logo area that lives inside the quantic-layout header or sidebar. Automatically switches between expanded and collapsed slots based on the sidebar state consumed from context.",category:"layout",slots:{expanded:{description:"Logo shown when the sidebar is expanded (full wordmark)."},collapsed:{description:"Logo shown when the sidebar is collapsed (icon only)."}}},e.LayoutLogo.styles=l`
37338
37333
  :host {
37339
37334
  display: contents;
37340
37335
  }