@momentum-design/components 0.81.2 → 0.81.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.
@@ -3429,7 +3429,7 @@
3429
3429
  :host::part(popover-content) {
3430
3430
  padding: 0.75rem 0.5rem;
3431
3431
  }
3432
- `,eu=[Pb];var Fn=class extends Vo(ke){constructor(){super(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleMouseClick)}connectedCallback(){super.connectedCallback(),this.role=wt.MENU,this.focusBackToTrigger=!0,this.focusTrap=!0,this.focusBackToTrigger=!0,this.hideOnEscape=!0,this.hideOnOutsideClick=!0,this.interactive=!0,this.placement=$t.BOTTOM_START,this.showArrow=!1,this.ariaOrientation=oe.VERTICAL}async firstUpdated(o){var e,s,a;await super.firstUpdated(o),(e=this.triggerElement)==null||e.setAttribute("aria-haspopup",wt.MENU),((a=(s=this.parentElement)==null?void 0:s.tagName)==null?void 0:a.toLowerCase())===We&&(this.interactive=!0,this.placement=$t.RIGHT_START)}};Fn.styles=[...ke.styles,...eu];var Fc=Fn;Fc.register(We);var Db=Fc;var Fb=[yt,j`
3432
+ `,eu=[Pb];var Fn=class extends Vo(ke){constructor(){super(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleMouseClick)}connectedCallback(){super.connectedCallback(),this.role=wt.MENU,this.focusBackToTrigger=!0,this.focusTrap=!0,this.focusBackToTrigger=!0,this.hideOnEscape=!0,this.hideOnOutsideClick=!0,this.interactive=!0,this.placement=$t.BOTTOM_START,this.showArrow=!1,this.ariaOrientation=oe.VERTICAL}async firstUpdated(o){var e,s,a;await super.firstUpdated(o),(e=this.triggerElement)==null||e.setAttribute("aria-haspopup",wt.MENU),((a=(s=this.parentElement)==null?void 0:s.tagName)==null?void 0:a.toLowerCase())===We&&(this.interactive=!0,this.placement=$t.RIGHT_START)}};Fn.styles=[...ke.styles,...eu];var Fc=Fn;Fc.register(We);var Db=Fc;var Js=class extends q{constructor(){super(...arguments);this.handleClick=e=>{this.toggleCheckedState(e.target)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",wt.GROUP),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick)}toggleCheckedState(e){if(!(e instanceof HTMLElement)||e.hasAttribute("disabled"))return;let s=e.tagName.toLowerCase(),a=e.getAttribute("aria-checked")===Pe.TRUE;switch(s){case Dn:e.setAttribute("aria-checked",String(!a));break;case Zs:if(a)return;this.radios.forEach(h=>{let m=h===e?Pe.TRUE:Pe.FALSE;h.setAttribute("aria-checked",m)});break;default:break}}render(){return O`<slot></slot>`}};Js.styles=[...q.styles],v([Ot({selector:`${Zs}:not([disabled])`})],Js.prototype,"radios",2);var $c=Js;$c.register(On);var Fb=$c;var $b=[yt,j`
3433
3433
  :host {
3434
3434
  --mdc-navitem-color: var(--mds-color-theme-text-primary-normal);
3435
3435
  --mdc-navitem-disabled-color: var(--mds-color-theme-text-primary-disabled);
@@ -3571,7 +3571,7 @@
3571
3571
  left: -0.75rem;
3572
3572
  top: 0.875rem;
3573
3573
  }
3574
- `,..._t()],ru=Fb;var $n=W.constructTagName("sidenavigation"),yr={FIXED_EXPANDED:"fixed-expanded",FIXED_COLLAPSED:"fixed-collapsed",FLEXIBLE:"flexible",HIDDEN:"hidden"},Js={VARIANT:yr.FLEXIBLE};var jo=W.constructTagName("navitem"),iu={DOT:Be.DOT,COUNTER:Be.COUNTER},ou={RIGHT_ARROW:"arrow-right-bold"},su={MAX_COUNTER:99,TEXT_TYPE:ot.BODY_MIDSIZE_REGULAR,TAG_NAME:bt.SPAN,SIZE:_i[24],VARIANT:yr.FLEXIBLE};var $b=j`
3574
+ `,..._t()],ru=$b;var $n=W.constructTagName("sidenavigation"),yr={FIXED_EXPANDED:"fixed-expanded",FIXED_COLLAPSED:"fixed-collapsed",FLEXIBLE:"flexible",HIDDEN:"hidden"},Qs={VARIANT:yr.FLEXIBLE};var jo=W.constructTagName("navitem"),iu={DOT:Be.DOT,COUNTER:Be.COUNTER},ou={RIGHT_ARROW:"arrow-right-bold"},su={MAX_COUNTER:99,TEXT_TYPE:ot.BODY_MIDSIZE_REGULAR,TAG_NAME:bt.SPAN,SIZE:_i[24],VARIANT:yr.FLEXIBLE};var zb=j`
3575
3575
  :host {
3576
3576
  --mdc-sidenavigation-expanded-width: 15rem;
3577
3577
  --mdc-sidenavigation-collapsed-width: 4.5rem;
@@ -3636,7 +3636,7 @@
3636
3636
  :host::part(separator) {
3637
3637
  margin-bottom: 0.75rem;
3638
3638
  }
3639
- `,au=[$b];var zn=class{constructor(o,e,s){this.variant=o,this.expanded=e,this.parentNavTooltipText=s}hasSiblingWithTriggerId(o){var a,h;let e=o==null?void 0:o.getAttribute("id");return e?Array.from((h=(a=o==null?void 0:o.parentElement)==null?void 0:a.children)!=null?h:[]).some(m=>m!==o&&m.tagName.toLowerCase()===We&&m.getAttribute("triggerid")===e):!1}getParentNavItems(o){if(!o)return[];let e=[],s=o;for(;s;){let a=s==null?void 0:s.closest(We);if(!a)break;let h=a.getAttribute("triggerid");if(!h)break;let m=document.getElementById(h);if(m&&m.tagName.toLowerCase()===jo)e.push(m),s=m;else break}return e}setCurrentActiveNavItem(o){var h;let e=((h=this.currentActiveNavItem)==null?void 0:h.navId)===(o==null?void 0:o.navId),s=(o==null?void 0:o.disableAriaCurrent)||this.hasSiblingWithTriggerId(o);if(e||s||(this.currentActiveNavItem&&(this.currentActiveNavItem.removeAttribute("aria-current"),this.currentActiveNavItem.removeAttribute("active"),this.getParentNavItems(this.currentActiveNavItem).forEach(y=>{y.removeAttribute("tooltip-text"),y.removeAttribute("active")})),!o))return;this.currentActiveNavItem=o,o.setAttribute("aria-current","page"),o.setAttribute("active",""),this.getParentNavItems(o).forEach(m=>{m.setAttribute("tooltip-text",this.parentNavTooltipText||""),m.setAttribute("tooltip-placement",$t.BOTTOM),m.setAttribute("active","")})}};zn.context=$n;var Vn=zn;var lr=class extends ii{constructor(){super({context:Vn.context,initialValue:new Vn(Js.VARIANT,!0)});this.variant=Js.VARIANT;this.customerName="";this.flexibleExpanded=this.variant===Js.VARIANT;this.arrowDirection=this.flexibleExpanded?ge.NEGATIVE:ge.POSITIVE;this.updateExpansionState=()=>{switch(this.variant){case yr.FLEXIBLE:this.expanded=this.flexibleExpanded;break;case yr.FIXED_EXPANDED:this.expanded=!0;break;case yr.FIXED_COLLAPSED:this.expanded=!1;break;default:}}}connectedCallback(){super.connectedCallback(),this.role=wt.NAVIGATION}static get Context(){return Vn.context}updated(e){super.updated(e),e.has("variant")&&(this.setVariant(this.variant),this.updateExpansionState()),(e.has("variant")||e.has("expanded"))&&this.updateContext()}updateContext(){(this.context.value.variant!==this.variant||this.context.value.expanded!==this.expanded||this.context.value.parentNavTooltipText!==this.parentNavTooltipText)&&(this.context.value.variant=this.variant,this.context.value.expanded=this.expanded,this.context.value.parentNavTooltipText=this.parentNavTooltipText,this.context.updateObservers())}setVariant(e){this.setAttribute("variant",Object.values(yr).includes(e)?e:Js.VARIANT)}toggleSideNavigation(){this.flexibleExpanded=!this.flexibleExpanded,this.arrowDirection=this.arrowDirection===ge.NEGATIVE?ge.POSITIVE:ge.NEGATIVE,this.updateExpansionState()}render(){var e;return this.variant===yr.HIDDEN?O``:O`
3639
+ `,au=[zb];var zn=class{constructor(o,e,s){this.variant=o,this.expanded=e,this.parentNavTooltipText=s}hasSiblingWithTriggerId(o){var a,h;let e=o==null?void 0:o.getAttribute("id");return e?Array.from((h=(a=o==null?void 0:o.parentElement)==null?void 0:a.children)!=null?h:[]).some(m=>m!==o&&m.tagName.toLowerCase()===We&&m.getAttribute("triggerid")===e):!1}getParentNavItems(o){if(!o)return[];let e=[],s=o;for(;s;){let a=s==null?void 0:s.closest(We);if(!a)break;let h=a.getAttribute("triggerid");if(!h)break;let m=document.getElementById(h);if(m&&m.tagName.toLowerCase()===jo)e.push(m),s=m;else break}return e}setCurrentActiveNavItem(o){var h;let e=((h=this.currentActiveNavItem)==null?void 0:h.navId)===(o==null?void 0:o.navId),s=(o==null?void 0:o.disableAriaCurrent)||this.hasSiblingWithTriggerId(o);if(e||s||(this.currentActiveNavItem&&(this.currentActiveNavItem.removeAttribute("aria-current"),this.currentActiveNavItem.removeAttribute("active"),this.getParentNavItems(this.currentActiveNavItem).forEach(y=>{y.removeAttribute("tooltip-text"),y.removeAttribute("active")})),!o))return;this.currentActiveNavItem=o,o.setAttribute("aria-current","page"),o.setAttribute("active",""),this.getParentNavItems(o).forEach(m=>{m.setAttribute("tooltip-text",this.parentNavTooltipText||""),m.setAttribute("tooltip-placement",$t.BOTTOM),m.setAttribute("active","")})}};zn.context=$n;var Vn=zn;var lr=class extends ii{constructor(){super({context:Vn.context,initialValue:new Vn(Qs.VARIANT,!0)});this.variant=Qs.VARIANT;this.customerName="";this.flexibleExpanded=this.variant===Qs.VARIANT;this.arrowDirection=this.flexibleExpanded?ge.NEGATIVE:ge.POSITIVE;this.updateExpansionState=()=>{switch(this.variant){case yr.FLEXIBLE:this.expanded=this.flexibleExpanded;break;case yr.FIXED_EXPANDED:this.expanded=!0;break;case yr.FIXED_COLLAPSED:this.expanded=!1;break;default:}}}connectedCallback(){super.connectedCallback(),this.role=wt.NAVIGATION}static get Context(){return Vn.context}updated(e){super.updated(e),e.has("variant")&&(this.setVariant(this.variant),this.updateExpansionState()),(e.has("variant")||e.has("expanded"))&&this.updateContext()}updateContext(){(this.context.value.variant!==this.variant||this.context.value.expanded!==this.expanded||this.context.value.parentNavTooltipText!==this.parentNavTooltipText)&&(this.context.value.variant=this.variant,this.context.value.expanded=this.expanded,this.context.value.parentNavTooltipText=this.parentNavTooltipText,this.context.updateObservers())}setVariant(e){this.setAttribute("variant",Object.values(yr).includes(e)?e:Qs.VARIANT)}toggleSideNavigation(){this.flexibleExpanded=!this.flexibleExpanded,this.arrowDirection=this.arrowDirection===ge.NEGATIVE?ge.POSITIVE:ge.NEGATIVE,this.updateExpansionState()}render(){var e;return this.variant===yr.HIDDEN?O``:O`
3640
3640
  <div part="side-navigation-container" id='side-nav-container'>
3641
3641
  <div part="scrollable-section">
3642
3642
  <slot name="scrollable-section"></slot>
@@ -3693,7 +3693,7 @@
3693
3693
  </div>
3694
3694
  ${this.showLabel?O`${this.renderTextLabel(this.label)}${this.renderBadge(this.showLabel)}`:Y}
3695
3695
  ${e!=null&&e.hasSiblingWithTriggerId(this)?this.renderArrowIcon(this.showLabel):Y}
3696
- `}};qe.styles=[...Ye.styles,...ru],v([T({type:Boolean,reflect:!0})],qe.prototype,"active",2),v([T({type:String,reflect:!0,attribute:"badge-type"})],qe.prototype,"badgeType",2),v([T({type:Number,reflect:!0})],qe.prototype,"counter",2),v([T({type:Number,attribute:"max-counter",reflect:!0})],qe.prototype,"maxCounter",2),v([T({type:String,reflect:!0,attribute:"nav-id"})],qe.prototype,"navId",2),v([T({type:Boolean,reflect:!0,attribute:"show-label"})],qe.prototype,"showLabel",2),v([T({type:String,attribute:"aria-label"})],qe.prototype,"ariaLabel",2),v([T({type:Boolean,reflect:!0,attribute:"disable-aria-current"})],qe.prototype,"disableAriaCurrent",2);var $c=qe;$c.register(jo);var zb=$c;var Vb=j`
3696
+ `}};qe.styles=[...Ye.styles,...ru],v([T({type:Boolean,reflect:!0})],qe.prototype,"active",2),v([T({type:String,reflect:!0,attribute:"badge-type"})],qe.prototype,"badgeType",2),v([T({type:Number,reflect:!0})],qe.prototype,"counter",2),v([T({type:Number,attribute:"max-counter",reflect:!0})],qe.prototype,"maxCounter",2),v([T({type:String,reflect:!0,attribute:"nav-id"})],qe.prototype,"navId",2),v([T({type:Boolean,reflect:!0,attribute:"show-label"})],qe.prototype,"showLabel",2),v([T({type:String,attribute:"aria-label"})],qe.prototype,"ariaLabel",2),v([T({type:Boolean,reflect:!0,attribute:"disable-aria-current"})],qe.prototype,"disableAriaCurrent",2);var zc=qe;zc.register(jo);var Vb=zc;var Bb=j`
3697
3697
  :host {
3698
3698
  gap: 0.25rem;
3699
3699
  }
@@ -3713,7 +3713,7 @@
3713
3713
  ::slotted(mdc-divider) {
3714
3714
  margin: 0.75rem 0;
3715
3715
  }
3716
- `,nu=[Vb];var Wo=class extends Vo(Bo){constructor(){super(...arguments);this.ariaLabel=null;this.sideNavigationContext=go.consume({host:this,context:qi.Context});this.handleNestedNavItemActiveChange=e=>{var a;let s=this.findNav(this.navItems||[],e.detail.navId);(a=this.sideNavigationContext)!=null&&a.value&&this.sideNavigationContext.value.setCurrentActiveNavItem(s)};this.findNav=(e,s)=>e.find(a=>a.navId===s)}connectedCallback(){super.connectedCallback(),this.ariaOrientation=oe.VERTICAL,this.addEventListener("activechange",this.handleNestedNavItemActiveChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("activechange",this.handleNestedNavItemActiveChange)}updated(){var a;let e=(a=this.sideNavigationContext)==null?void 0:a.value;if(!e)return;let{expanded:s}=e;this.showLabel=s}get navItems(){return Array.from(this.querySelectorAll(`${jo}:not([disabled])`))}};Wo.styles=[...Bo.styles,...nu],v([T({type:Boolean,reflect:!0,attribute:"show-label"})],Wo.prototype,"showLabel",2),v([T({type:String,attribute:"aria-label"})],Wo.prototype,"ariaLabel",2);var zc=Wo;zc.register(zo);var Bb=zc;var Qs=class extends q{constructor(){super(...arguments);this.handleClick=e=>{this.toggleCheckedState(e.target)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role",wt.GROUP),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick)}toggleCheckedState(e){if(!(e instanceof HTMLElement)||e.hasAttribute("disabled"))return;let s=e.tagName.toLowerCase(),a=e.getAttribute("aria-checked")===Pe.TRUE;switch(s){case Dn:e.setAttribute("aria-checked",String(!a));break;case Zs:if(a)return;this.radios.forEach(h=>{let m=h===e?Pe.TRUE:Pe.FALSE;h.setAttribute("aria-checked",m)});break;default:break}}render(){return O`<slot></slot>`}};Qs.styles=[...q.styles],v([Ot({selector:`${Zs}:not([disabled])`})],Qs.prototype,"radios",2);var Vc=Qs;Vc.register(On);var Ub=Vc;var Bn=W.constructTagName("optgroup"),Bc="header-id";var Hb=j`
3716
+ `,nu=[Bb];var Wo=class extends Vo(Bo){constructor(){super(...arguments);this.ariaLabel=null;this.sideNavigationContext=go.consume({host:this,context:qi.Context});this.handleNestedNavItemActiveChange=e=>{var a;let s=this.findNav(this.navItems||[],e.detail.navId);(a=this.sideNavigationContext)!=null&&a.value&&this.sideNavigationContext.value.setCurrentActiveNavItem(s)};this.findNav=(e,s)=>e.find(a=>a.navId===s)}connectedCallback(){super.connectedCallback(),this.ariaOrientation=oe.VERTICAL,this.addEventListener("activechange",this.handleNestedNavItemActiveChange)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("activechange",this.handleNestedNavItemActiveChange)}updated(){var a;let e=(a=this.sideNavigationContext)==null?void 0:a.value;if(!e)return;let{expanded:s}=e;this.showLabel=s}get navItems(){return Array.from(this.querySelectorAll(`${jo}:not([disabled])`))}};Wo.styles=[...Bo.styles,...nu],v([T({type:Boolean,reflect:!0,attribute:"show-label"})],Wo.prototype,"showLabel",2),v([T({type:String,attribute:"aria-label"})],Wo.prototype,"ariaLabel",2);var Vc=Wo;Vc.register(zo);var Ub=Vc;var Bn=W.constructTagName("optgroup"),Bc="header-id";var Hb=j`
3717
3717
  :host {
3718
3718
  --mdc-optgroup-disabled-color: var(--mds-color-theme-text-primary-disabled);
3719
3719
  }