scb-wc 0.1.84 → 0.1.85

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.
package/scb-wc.bundle.js CHANGED
@@ -8369,6 +8369,50 @@
8369
8369
  scrollbar-width: none;
8370
8370
  width: 100%;
8371
8371
  }
8372
+ :host([data-scroll-left]:not([variant='inline'])) .scb-horizontal-scroller {
8373
+ -webkit-mask-image: linear-gradient(
8374
+ to right,
8375
+ transparent 0,
8376
+ black var(--scb-horizontal-scroller-edge-fade-size, 56px),
8377
+ black 100%
8378
+ );
8379
+ mask-image: linear-gradient(
8380
+ to right,
8381
+ transparent 0,
8382
+ black var(--scb-horizontal-scroller-edge-fade-size, 56px),
8383
+ black 100%
8384
+ );
8385
+ }
8386
+ :host([data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller {
8387
+ -webkit-mask-image: linear-gradient(
8388
+ to right,
8389
+ black 0,
8390
+ black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),
8391
+ transparent 100%
8392
+ );
8393
+ mask-image: linear-gradient(
8394
+ to right,
8395
+ black 0,
8396
+ black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),
8397
+ transparent 100%
8398
+ );
8399
+ }
8400
+ :host([data-scroll-left][data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller {
8401
+ -webkit-mask-image: linear-gradient(
8402
+ to right,
8403
+ transparent 0,
8404
+ black var(--scb-horizontal-scroller-edge-fade-size, 56px),
8405
+ black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),
8406
+ transparent 100%
8407
+ );
8408
+ mask-image: linear-gradient(
8409
+ to right,
8410
+ transparent 0,
8411
+ black var(--scb-horizontal-scroller-edge-fade-size, 56px),
8412
+ black calc(100% - var(--scb-horizontal-scroller-edge-fade-size, 56px)),
8413
+ transparent 100%
8414
+ );
8415
+ }
8372
8416
  :host([show-scrollbar]) .scb-horizontal-scroller {
8373
8417
  scrollbar-width: auto;
8374
8418
  }
@@ -8535,10 +8579,10 @@
8535
8579
  right: 0;
8536
8580
  }
8537
8581
  :host([data-scroll-left]) .scroll-shadow-left {
8538
- background: var(--md-sys-color-surface-container-lowest);
8582
+ background: transparent;
8539
8583
  box-shadow:
8540
- 12px 0 30px rgba(0, 0, 0, 0.24),
8541
- 4px 0 12px rgba(78, 5, 5, 0.14);
8584
+ 12px 0 30px color-mix(in srgb, currentColor 18%, transparent),
8585
+ 4px 0 12px color-mix(in srgb, currentColor 12%, transparent);
8542
8586
  }
8543
8587
  :host([data-scroll-left]) .scroll-shadow-left::after {
8544
8588
  content: '';
@@ -8546,10 +8590,10 @@
8546
8590
  inset-block: 0;
8547
8591
  }
8548
8592
  :host([data-scroll-right]) .scroll-shadow-right {
8549
- background: var(--md-sys-color-surface-container-lowest);
8593
+ background: transparent;
8550
8594
  box-shadow:
8551
- -12px 0 30px rgba(0, 0, 0, 0.24),
8552
- -4px 0 12px rgba(0, 0, 0, 0.14);
8595
+ -12px 0 30px color-mix(in srgb, currentColor 18%, transparent),
8596
+ -4px 0 12px color-mix(in srgb, currentColor 12%, transparent);
8553
8597
  }
8554
8598
  :host([data-scroll-right]) .scroll-shadow-right::after {
8555
8599
  content: '';
@@ -10724,17 +10768,28 @@
10724
10768
  .label {
10725
10769
  pointer-events: none;
10726
10770
  }
10727
- `}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.__onClick),this.addEventListener(`keydown`,this.__onKeyDown),this.addEventListener(`keyup`,this.__onKeyUp),this.__syncA11y()}disconnectedCallback(){this.removeEventListener(`click`,this.__onClick),this.removeEventListener(`keydown`,this.__onKeyDown),this.removeEventListener(`keyup`,this.__onKeyUp),super.disconnectedCallback()}updated(){this.__syncA11y()}__syncA11y(){let e=!!(this.href||``).trim();if(this.disabled){this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1,this.removeAttribute(`role`);return}this.removeAttribute(`aria-disabled`),this.tabIndex=0,this.setAttribute(`role`,e?`link`:`button`)}render(){return x`<span class="label"><slot></slot></span>`}};P([_({type:String})],rf.prototype,`href`,void 0),P([_({type:String,attribute:`data-href`})],rf.prototype,`dataHref`,void 0),P([_({type:Boolean,reflect:!0})],rf.prototype,`disabled`,void 0),rf=P([a(`scb-nav-item`)],rf),w(),b(),E(),N(),F();var af={fromAttribute(e){return e===null?!1:e.toLowerCase()!==`false`}},of=class extends C{constructor(...e){super(...e),this.label=``,this.activeHref=``,this.activateOnClick=!0,this.sticky=!1,this.stickyTop=`0px`,this.stickyZIndex=5,this.stickyBackground=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__autoAriaLabel=!1,this.__itemIdPrefix=`scb-nav-${Math.random().toString(36).slice(2)}`,this.__itemIdCounter=0,this.__onSlotChange=async()=>{await this.__decorateItems(),this.__applyActiveHref()},this.__onClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&(e.tagName===`A`||e.tagName===`BUTTON`||e.tagName===`SCB-NAV-ITEM`));if(!t)return;let n=this.__getItemHref(t);this.dispatchEvent(new CustomEvent(`scb-nav-select`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.dispatchEvent(new CustomEvent(`scbnavselect`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.activateOnClick&&n&&(this.activeHref=n)}}static{this.styles=p`
10771
+ `}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this.__onClick),this.addEventListener(`keydown`,this.__onKeyDown),this.addEventListener(`keyup`,this.__onKeyUp),this.__syncA11y()}disconnectedCallback(){this.removeEventListener(`click`,this.__onClick),this.removeEventListener(`keydown`,this.__onKeyDown),this.removeEventListener(`keyup`,this.__onKeyUp),super.disconnectedCallback()}updated(){this.__syncA11y()}__syncA11y(){let e=!!(this.href||``).trim();if(this.disabled){this.setAttribute(`aria-disabled`,`true`),this.tabIndex=-1,this.removeAttribute(`role`);return}this.removeAttribute(`aria-disabled`),this.tabIndex=0,this.setAttribute(`role`,e?`link`:`button`)}render(){return x`<span class="label"><slot></slot></span>`}};P([_({type:String})],rf.prototype,`href`,void 0),P([_({type:String,attribute:`data-href`})],rf.prototype,`dataHref`,void 0),P([_({type:Boolean,reflect:!0})],rf.prototype,`disabled`,void 0),rf=P([a(`scb-nav-item`)],rf),w(),b(),E(),N(),F();var af={fromAttribute(e){return e===null?!1:e.toLowerCase()!==`false`}},of=class extends C{constructor(...e){super(...e),this.__itemsEl=null,this.__resizeObserver=null,this.__resizeRaf=null,this.__canScrollLeft=!1,this.__canScrollRight=!1,this.label=``,this.activeHref=``,this.activateOnClick=!0,this.sticky=!1,this.stickyTop=`0px`,this.stickyZIndex=5,this.stickyBackground=``,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__autoAriaLabel=!1,this.__itemIdPrefix=`scb-nav-${Math.random().toString(36).slice(2)}`,this.__itemIdCounter=0,this.__onSlotChange=async()=>{await this.__decorateItems(),this.__applyActiveHref(),this.__scheduleScrollControlUpdate()},this.__scrollLeft=()=>{this.__scrollBy(-this.__getScrollStep())},this.__scrollRight=()=>{this.__scrollBy(this.__getScrollStep())},this.__onWheel=e=>{if(e.ctrlKey)return;let t=this.__itemsEl;if(!t)return;let n=t.scrollWidth-t.clientWidth;if(n<=1)return;let r=this.__normalizeWheelDelta(e);if(r===0)return;let i=Math.max(0,Math.min(n,t.scrollLeft+r));i!==t.scrollLeft&&(e.preventDefault(),t.scrollLeft=i,this.__updateScrollControls())},this.__onItemsScroll=()=>{this.__updateScrollControls()},this.__onClick=e=>{let t=e.composedPath().find(e=>e instanceof HTMLElement&&(e.tagName===`A`||e.tagName===`BUTTON`||e.tagName===`SCB-NAV-ITEM`));if(!t)return;let n=this.__getItemHref(t);this.dispatchEvent(new CustomEvent(`scb-nav-select`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.dispatchEvent(new CustomEvent(`scbnavselect`,{bubbles:!0,composed:!0,detail:{item:t,href:n}})),this.activateOnClick&&n&&(this.activeHref=n)}}static{this.styles=p`
10728
10772
  :host {
10773
+ --_scb-nav-scroll-shadow-color: rgba(0, 0, 0, 0.24);
10774
+ --_scb-nav-scroll-shadow-soft-color: rgba(0, 0, 0, 0.14);
10775
+
10729
10776
  display: block;
10730
10777
  color: var(--md-sys-color-on-surface);
10731
- font-family: var(--brand-font, Inter);
10778
+ font-family: var(--brand-font, Inter);
10732
10779
  margin-block-start: var(--scb-nav-spacing-block-start, 0);
10733
10780
  margin-block-end: var(--scb-nav-spacing-block-end, 0);
10734
10781
  margin-inline-start: var(--scb-nav-spacing-inline-start, 0);
10735
10782
  margin-inline-end: var(--scb-nav-spacing-inline-end, 0);
10736
- overflow-x: auto;
10737
- }
10783
+ min-inline-size: 0;
10784
+ overflow-x: hidden;
10785
+ }
10786
+
10787
+ @supports (color: color-mix(in srgb, black, white)) {
10788
+ :host {
10789
+ --_scb-nav-scroll-shadow-color: color-mix(in srgb, currentColor 24%, transparent);
10790
+ --_scb-nav-scroll-shadow-soft-color: color-mix(in srgb, currentColor 14%, transparent);
10791
+ }
10792
+ }
10738
10793
 
10739
10794
  :host([sticky]) {
10740
10795
  position: sticky;
@@ -10748,28 +10803,84 @@
10748
10803
  );
10749
10804
  background: var(
10750
10805
  --_scb-nav-sticky-background,
10751
- var(--scb-nav-sticky-background, var(--md-sys-color-surface-container-lowest))
10806
+ var(--scb-nav-sticky-background, transparent)
10752
10807
  );
10753
10808
  }
10754
10809
 
10755
10810
  .scb-nav {
10811
+ display: flex;
10812
+ align-items: center;
10813
+ position: relative;
10756
10814
  max-inline-size: var(--scb-nav-max-width, 1400px);
10757
10815
  margin-inline: auto;
10758
10816
  padding-block: var(--scb-nav-padding-block, var(--spacing-5, 16px));
10759
10817
  padding-inline: var(--scb-nav-padding-inline, var(--spacing-0, 0px));
10760
10818
  box-sizing: border-box;
10819
+ min-inline-size: 0;
10820
+ overflow-x: hidden;
10761
10821
  }
10762
10822
 
10763
10823
  .scb-nav__items {
10764
10824
  display: flex;
10825
+ flex: 1 1 auto;
10765
10826
  align-items: center;
10766
10827
  gap: var(--scb-nav-gap, var(--spacing-3, 8px));
10828
+ min-inline-size: 0;
10767
10829
 
10768
10830
  overflow-x: auto;
10769
- overflow-y: visible;
10831
+ overflow-y: hidden;
10770
10832
  -webkit-overflow-scrolling: touch;
10771
10833
  scrollbar-width: none;
10772
- width: fit-content;
10834
+ inline-size: 100%;
10835
+ max-inline-size: 100%;
10836
+ --_scb-nav-edge-fade-size: var(--scb-nav-edge-fade-size, 64px);
10837
+ }
10838
+
10839
+ :host([data-scroll-left]) .scb-nav__items {
10840
+ -webkit-mask-image: linear-gradient(
10841
+ to right,
10842
+ transparent 0,
10843
+ #000 var(--_scb-nav-edge-fade-size),
10844
+ #000 100%
10845
+ );
10846
+ mask-image: linear-gradient(
10847
+ to right,
10848
+ transparent 0,
10849
+ #000 var(--_scb-nav-edge-fade-size),
10850
+ #000 100%
10851
+ );
10852
+ }
10853
+
10854
+ :host([data-scroll-right]) .scb-nav__items {
10855
+ -webkit-mask-image: linear-gradient(
10856
+ to right,
10857
+ #000 0,
10858
+ #000 calc(100% - var(--_scb-nav-edge-fade-size)),
10859
+ transparent 100%
10860
+ );
10861
+ mask-image: linear-gradient(
10862
+ to right,
10863
+ #000 0,
10864
+ #000 calc(100% - var(--_scb-nav-edge-fade-size)),
10865
+ transparent 100%
10866
+ );
10867
+ }
10868
+
10869
+ :host([data-scroll-left][data-scroll-right]) .scb-nav__items {
10870
+ -webkit-mask-image: linear-gradient(
10871
+ to right,
10872
+ transparent 0,
10873
+ #000 var(--_scb-nav-edge-fade-size),
10874
+ #000 calc(100% - var(--_scb-nav-edge-fade-size)),
10875
+ transparent 100%
10876
+ );
10877
+ mask-image: linear-gradient(
10878
+ to right,
10879
+ transparent 0,
10880
+ #000 var(--_scb-nav-edge-fade-size),
10881
+ #000 calc(100% - var(--_scb-nav-edge-fade-size)),
10882
+ transparent 100%
10883
+ );
10773
10884
  }
10774
10885
 
10775
10886
  .scb-nav__items::-webkit-scrollbar {
@@ -10780,6 +10891,7 @@
10780
10891
  ::slotted(button),
10781
10892
  ::slotted(scb-nav-item) {
10782
10893
  display: inline-flex;
10894
+ flex: 0 0 auto;
10783
10895
  align-items: center;
10784
10896
  justify-content: center;
10785
10897
 
@@ -10823,13 +10935,154 @@
10823
10935
  color: var(--md-sys-color-on-secondary-container);
10824
10936
  font-weight: 600;
10825
10937
  }
10826
- `}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-nav-spacing-block-start`,t):this.style.removeProperty(`--scb-nav-spacing-block-start`),n?this.style.setProperty(`--scb-nav-spacing-block-end`,n):this.style.removeProperty(`--scb-nav-spacing-block-end`),r?this.style.setProperty(`--scb-nav-spacing-inline-start`,r):this.style.removeProperty(`--scb-nav-spacing-inline-start`),i?this.style.setProperty(`--scb-nav-spacing-inline-end`,i):this.style.removeProperty(`--scb-nav-spacing-inline-end`)}__syncStickyStyles(){if(!this.sticky){this.style.removeProperty(`--_scb-nav-sticky-top`),this.style.removeProperty(`--_scb-nav-sticky-z-index`),this.style.removeProperty(`--_scb-nav-sticky-background`);return}let e=(this.stickyTop||``).trim()||`0px`;this.style.setProperty(`--_scb-nav-sticky-top`,e);let t=Number.isFinite(this.stickyZIndex)?this.stickyZIndex:5;this.style.setProperty(`--_scb-nav-sticky-z-index`,String(t));let n=(this.stickyBackground||``).trim();if(!n){this.style.removeProperty(`--_scb-nav-sticky-background`);return}let r=n.startsWith(`--`)?`var(${n})`:n;this.style.setProperty(`--_scb-nav-sticky-background`,r)}connectedCallback(){super.connectedCallback(),this.__removeLazyFocusRingListeners=ac(this,this.renderRoot),this.hasAttribute(`role`)||this.setAttribute(`role`,`navigation`),this.__syncStickyStyles(),this.__syncAriaLabel()}disconnectedCallback(){this.__removeLazyFocusRingListeners?.(),this.__removeLazyFocusRingListeners=void 0,super.disconnectedCallback()}async firstUpdated(){await this.__decorateItems(),this.__applyActiveHref(),this.__applySpacing()}updated(e){e.has(`label`)&&this.__syncAriaLabel(),(e.has(`sticky`)||e.has(`stickyTop`)||e.has(`stickyZIndex`)||e.has(`stickyBackground`))&&this.__syncStickyStyles(),e.has(`activeHref`)&&this.__applyActiveHref(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__syncAriaLabel(){if(this.hasAttribute(`aria-label`)){this.__autoAriaLabel=!1;return}let e=(this.label||``).trim();if(!e){this.__autoAriaLabel&&=(this.removeAttribute(`aria-label`),!1);return}this.setAttribute(`aria-label`,e),this.__autoAriaLabel=!0}async __decorateItems(){let e=this.__getSlottedItems();if(e.some(e=>e.tagName===`A`||e.tagName===`BUTTON`||e.tagName===`SCB-NAV-ITEM`))for(let t of e){let e=t instanceof HTMLAnchorElement,n=t instanceof HTMLButtonElement,r=t.tagName===`SCB-NAV-ITEM`;if(!e&&!n&&!r||(n&&!t.hasAttribute(`type`)&&t.setAttribute(`type`,`button`),t.getAttribute(`data-scb-nav-decorated`)===`true`))continue;t.id||=(this.__itemIdCounter+=1,`${this.__itemIdPrefix}-${this.__itemIdCounter}`);let i=e=>{let n=t.querySelector(e);if(n instanceof HTMLElement)return n;let r=document.createElement(e);return t.appendChild(r),r},a=i(`md-ripple`);a&&a.style.setProperty(`--md-ripple-focus-opacity`,`0`);let o=i(`md-focus-ring`);o&&(o.setAttribute(`inward`,``),o.setAttribute(`for`,t.id),o.style.position=`absolute`,o.style.inset=`0`,o.style.pointerEvents=`none`,o.style.borderRadius=`24px`),t.setAttribute(`data-scb-nav-decorated`,`true`)}}__getSlottedItems(){let e=this.renderRoot.querySelector(`slot`);return e?e.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}__getItemHref(e){return e instanceof HTMLAnchorElement?(e.getAttribute(`href`)||``).trim():e.tagName===`SCB-NAV-ITEM`?(e.getAttribute(`href`)||e.getAttribute(`data-href`)||e.href||e.dataHref||``).trim():(e.getAttribute(`data-href`)||``).trim()}__applyActiveHref(){let e=(this.activeHref||``).trim(),t=this.__getSlottedItems();for(let n of t){let t=n instanceof HTMLAnchorElement,r=n instanceof HTMLButtonElement,i=n.tagName===`SCB-NAV-ITEM`;if(!t&&!r&&!i)continue;r&&!n.hasAttribute(`type`)&&n.setAttribute(`type`,`button`);let a=this.__getItemHref(n);e&&a===e?(n.setAttribute(`aria-current`,`location`),n.setAttribute(`data-scb-nav-managed`,`true`),n.setAttribute(`data-active`,`true`)):(n.getAttribute(`data-scb-nav-managed`)===`true`&&(n.removeAttribute(`aria-current`),n.removeAttribute(`data-scb-nav-managed`)),n.removeAttribute(`data-active`))}}render(){return x`
10938
+
10939
+ .scb-nav__scroll-control {
10940
+ position: absolute;
10941
+ z-index: 3;
10942
+ display: inline-flex;
10943
+ align-items: center;
10944
+ justify-content: center;
10945
+ box-sizing: border-box;
10946
+ inline-size: var(--scb-icon-button-container-size, 40px);
10947
+ block-size: var(--scb-icon-button-container-size, 40px);
10948
+ padding: 0;
10949
+ border: 0;
10950
+ border-radius: var(--radius-full, 1000px);
10951
+ background: var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff)));
10952
+ color: var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be)));
10953
+ cursor: pointer;
10954
+ font-family: var(--brand-font, var(--brand, "Inter"), sans-serif);
10955
+ font-weight: var(--weight-semibold, 600);
10956
+ overflow: hidden;
10957
+ appearance: none;
10958
+ -webkit-appearance: none;
10959
+ -webkit-tap-highlight-color: transparent;
10960
+ touch-action: manipulation;
10961
+ }
10962
+
10963
+ .scb-nav__scroll-control::before {
10964
+ content: '';
10965
+ position: absolute;
10966
+ inset: 0;
10967
+ border-radius: inherit;
10968
+ background: currentColor;
10969
+ opacity: 0;
10970
+ pointer-events: none;
10971
+ transition: opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease);
10972
+ }
10973
+
10974
+ .scb-nav__scroll-control:hover::before {
10975
+ opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08);
10976
+ }
10977
+
10978
+ .scb-nav__scroll-control:active::before {
10979
+ opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.12);
10980
+ }
10981
+
10982
+ .scb-nav__scroll-control:focus {
10983
+ outline: none;
10984
+ }
10985
+
10986
+ .scb-nav__scroll-control:focus-visible {
10987
+ outline: var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));
10988
+ outline-offset: var(--spacing-1, 2px);
10989
+ }
10990
+
10991
+ .scb-nav__scroll-control-icon {
10992
+ position: relative;
10993
+ display: inline-block;
10994
+ inline-size: var(--icon-size-medium, 24px);
10995
+ block-size: var(--icon-size-medium, 24px);
10996
+ overflow: hidden;
10997
+ font-family: 'Material Symbols Outlined';
10998
+ font-size: var(--icon-size-medium, 24px);
10999
+ line-height: 1;
11000
+ text-align: center;
11001
+ white-space: nowrap;
11002
+ text-transform: none;
11003
+ word-wrap: normal;
11004
+ direction: ltr;
11005
+ font-feature-settings: 'liga' 1;
11006
+ font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
11007
+ -webkit-font-smoothing: antialiased;
11008
+ -moz-osx-font-smoothing: grayscale;
11009
+ }
11010
+
11011
+ .scb-nav__scroll-control-icon.scb-svg-icon {
11012
+ fill: currentColor;
11013
+ font: inherit;
11014
+ }
11015
+
11016
+ .scb-nav__scroll-control--left {
11017
+ inset-inline-start: 0;
11018
+ }
11019
+
11020
+ .scb-nav__scroll-control--right {
11021
+ inset-inline-end: 2px;
11022
+ }
11023
+
11024
+ .scb-nav__scroll-shadow-left,
11025
+ .scb-nav__scroll-shadow-right {
11026
+ position: absolute;
11027
+ inset-block: 0;
11028
+ z-index: 2;
11029
+ inline-size: 5px;
11030
+ pointer-events: none;
11031
+ background: none;
11032
+ box-shadow: none;
11033
+ transition: box-shadow 0.2s;
11034
+ }
11035
+
11036
+ .scb-nav__scroll-shadow-left {
11037
+ inset-inline-start: 0;
11038
+ }
11039
+
11040
+ .scb-nav__scroll-shadow-right {
11041
+ inset-inline-end: 0;
11042
+ }
11043
+
11044
+ :host([data-scroll-left]) .scb-nav__scroll-shadow-left {
11045
+ background: transparent;
11046
+ box-shadow:
11047
+ 12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),
11048
+ 4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color));
11049
+ }
11050
+
11051
+ :host([data-scroll-right]) .scb-nav__scroll-shadow-right {
11052
+ background: transparent;
11053
+ box-shadow:
11054
+ -12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),
11055
+ -4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color));
11056
+ }
11057
+ `}mapSpacingToken(e){if(!e)return;let t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){let e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,n=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty(`--scb-nav-spacing-block-start`,t):this.style.removeProperty(`--scb-nav-spacing-block-start`),n?this.style.setProperty(`--scb-nav-spacing-block-end`,n):this.style.removeProperty(`--scb-nav-spacing-block-end`),r?this.style.setProperty(`--scb-nav-spacing-inline-start`,r):this.style.removeProperty(`--scb-nav-spacing-inline-start`),i?this.style.setProperty(`--scb-nav-spacing-inline-end`,i):this.style.removeProperty(`--scb-nav-spacing-inline-end`)}__syncStickyStyles(){if(!this.sticky){this.style.removeProperty(`--_scb-nav-sticky-top`),this.style.removeProperty(`--_scb-nav-sticky-z-index`),this.style.removeProperty(`--_scb-nav-sticky-background`);return}let e=(this.stickyTop||``).trim()||`0px`;this.style.setProperty(`--_scb-nav-sticky-top`,e);let t=Number.isFinite(this.stickyZIndex)?this.stickyZIndex:5;this.style.setProperty(`--_scb-nav-sticky-z-index`,String(t));let n=(this.stickyBackground||``).trim();if(!n){this.style.removeProperty(`--_scb-nav-sticky-background`);return}let r=n.startsWith(`--`)?`var(${n})`:n;this.style.setProperty(`--_scb-nav-sticky-background`,r)}connectedCallback(){super.connectedCallback(),this.__removeLazyFocusRingListeners=ac(this,this.renderRoot),this.hasAttribute(`role`)||this.setAttribute(`role`,`navigation`),this.__syncStickyStyles(),this.__syncAriaLabel()}disconnectedCallback(){this.__removeLazyFocusRingListeners?.(),this.__removeLazyFocusRingListeners=void 0,this.__itemsEl?.removeEventListener(`scroll`,this.__onItemsScroll),this.__itemsEl=null,this.__resizeObserver?.disconnect(),this.__resizeObserver=null,this.__resizeRaf!==null&&(cancelAnimationFrame(this.__resizeRaf),this.__resizeRaf=null),super.disconnectedCallback()}async firstUpdated(){this.__itemsEl=this.renderRoot.querySelector(`.scb-nav__items`),this.__itemsEl&&this.__itemsEl.addEventListener(`scroll`,this.__onItemsScroll,{passive:!0}),this.__resizeObserver=new ResizeObserver(()=>{this.__scheduleScrollControlUpdate()}),this.__resizeObserver.observe(this),this.__itemsEl&&this.__resizeObserver.observe(this.__itemsEl),await this.__decorateItems(),this.__applyActiveHref(),this.__applySpacing(),this.__scheduleScrollControlUpdate(),document.fonts?.ready?.then(()=>{this.isConnected&&this.__scheduleScrollControlUpdate()})}updated(e){e.has(`label`)&&this.__syncAriaLabel(),(e.has(`sticky`)||e.has(`stickyTop`)||e.has(`stickyZIndex`)||e.has(`stickyBackground`))&&this.__syncStickyStyles(),e.has(`activeHref`)&&this.__applyActiveHref(),(e.has(`spacing`)||e.has(`spacingTop`)||e.has(`spacingBottom`)||e.has(`spacingLeft`)||e.has(`spacingRight`))&&this.__applySpacing()}__syncAriaLabel(){if(this.hasAttribute(`aria-label`)){this.__autoAriaLabel=!1;return}let e=(this.label||``).trim();if(!e){this.__autoAriaLabel&&=(this.removeAttribute(`aria-label`),!1);return}this.setAttribute(`aria-label`,e),this.__autoAriaLabel=!0}async __decorateItems(){let e=this.__getSlottedItems();if(e.some(e=>e.tagName===`A`||e.tagName===`BUTTON`||e.tagName===`SCB-NAV-ITEM`))for(let t of e){let e=t instanceof HTMLAnchorElement,n=t instanceof HTMLButtonElement,r=t.tagName===`SCB-NAV-ITEM`;if(!e&&!n&&!r||(n&&!t.hasAttribute(`type`)&&t.setAttribute(`type`,`button`),t.getAttribute(`data-scb-nav-decorated`)===`true`))continue;t.id||=(this.__itemIdCounter+=1,`${this.__itemIdPrefix}-${this.__itemIdCounter}`);let i=e=>{let n=t.querySelector(e);if(n instanceof HTMLElement)return n;let r=document.createElement(e);return t.appendChild(r),r},a=i(`md-ripple`);a&&a.style.setProperty(`--md-ripple-focus-opacity`,`0`);let o=i(`md-focus-ring`);o&&(o.setAttribute(`inward`,``),o.setAttribute(`for`,t.id),o.style.position=`absolute`,o.style.inset=`0`,o.style.pointerEvents=`none`,o.style.borderRadius=`24px`),t.setAttribute(`data-scb-nav-decorated`,`true`)}}__getSlottedItems(){let e=this.renderRoot.querySelector(`slot`);return e?e.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}__getItemHref(e){return e instanceof HTMLAnchorElement?(e.getAttribute(`href`)||``).trim():e.tagName===`SCB-NAV-ITEM`?(e.getAttribute(`href`)||e.getAttribute(`data-href`)||e.href||e.dataHref||``).trim():(e.getAttribute(`data-href`)||``).trim()}__applyActiveHref(){let e=(this.activeHref||``).trim(),t=this.__getSlottedItems();for(let n of t){let t=n instanceof HTMLAnchorElement,r=n instanceof HTMLButtonElement,i=n.tagName===`SCB-NAV-ITEM`;if(!t&&!r&&!i)continue;r&&!n.hasAttribute(`type`)&&n.setAttribute(`type`,`button`);let a=this.__getItemHref(n);e&&a===e?(n.setAttribute(`aria-current`,`location`),n.setAttribute(`data-scb-nav-managed`,`true`),n.setAttribute(`data-active`,`true`)):(n.getAttribute(`data-scb-nav-managed`)===`true`&&(n.removeAttribute(`aria-current`),n.removeAttribute(`data-scb-nav-managed`)),n.removeAttribute(`data-active`))}}__getScrollStep(){let e=this.__itemsEl;return e?Math.max(Math.round(e.clientWidth*.8),120):200}__scrollBy(e){this.__itemsEl?.scrollBy({left:e,behavior:`smooth`})}__normalizeWheelDelta(e){let t=this.__itemsEl,n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;return t?e.deltaMode===WheelEvent.DOM_DELTA_LINE?n*16:e.deltaMode===WheelEvent.DOM_DELTA_PAGE?n*t.clientWidth:n:n}__scheduleScrollControlUpdate(){this.__resizeRaf===null&&(this.__resizeRaf=requestAnimationFrame(()=>{this.__resizeRaf=null,this.__updateScrollControls()}))}__updateScrollControls(){let e=this.__itemsEl;if(!e){this.__canScrollLeft=!1,this.__canScrollRight=!1,this.toggleAttribute(`data-scroll-left`,!1),this.toggleAttribute(`data-scroll-right`,!1);return}let t=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth-1;this.__canScrollLeft=t,this.__canScrollRight=n,this.toggleAttribute(`data-scroll-left`,t),this.toggleAttribute(`data-scroll-right`,n)}render(){return x`
10827
11058
  <div class="scb-nav">
10828
- <div class="scb-nav__items" @click=${this.__onClick}>
11059
+ ${this.__canScrollLeft?x`
11060
+ <button
11061
+ class="scb-nav__scroll-control scb-nav__scroll-control--left"
11062
+ type="button"
11063
+ aria-label="Scrolla vänster"
11064
+ @click=${this.__scrollLeft}
11065
+ >
11066
+ ${md(`chevron_left`,`scb-nav__scroll-control-icon`)}
11067
+ </button>
11068
+ `:``}
11069
+ <div class="scb-nav__scroll-shadow-left"></div>
11070
+ <div class="scb-nav__items" @click=${this.__onClick} @wheel=${this.__onWheel}>
10829
11071
  <slot @slotchange=${this.__onSlotChange}></slot>
10830
11072
  </div>
11073
+ <div class="scb-nav__scroll-shadow-right"></div>
11074
+ ${this.__canScrollRight?x`
11075
+ <button
11076
+ class="scb-nav__scroll-control scb-nav__scroll-control--right"
11077
+ type="button"
11078
+ aria-label="Scrolla höger"
11079
+ @click=${this.__scrollRight}
11080
+ >
11081
+ ${md(`chevron_right`,`scb-nav__scroll-control-icon`)}
11082
+ </button>
11083
+ `:``}
10831
11084
  </div>
10832
- `}};P([_({type:String})],of.prototype,`label`,void 0),P([_({type:String,attribute:`active-href`})],of.prototype,`activeHref`,void 0),P([_({type:Boolean,attribute:`activate-on-click`,converter:af})],of.prototype,`activateOnClick`,void 0),P([_({type:Boolean,reflect:!0})],of.prototype,`sticky`,void 0),P([_({type:String,attribute:`sticky-top`})],of.prototype,`stickyTop`,void 0),P([_({type:Number,attribute:`sticky-z-index`})],of.prototype,`stickyZIndex`,void 0),P([_({type:String,attribute:`sticky-background`})],of.prototype,`stickyBackground`,void 0),P([_({type:String,reflect:!0})],of.prototype,`spacing`,void 0),P([_({type:String,attribute:`spacing-top`,reflect:!0})],of.prototype,`spacingTop`,void 0),P([_({type:String,attribute:`spacing-bottom`,reflect:!0})],of.prototype,`spacingBottom`,void 0),P([_({type:String,attribute:`spacing-left`,reflect:!0})],of.prototype,`spacingLeft`,void 0),P([_({type:String,attribute:`spacing-right`,reflect:!0})],of.prototype,`spacingRight`,void 0),of=P([a(`scb-nav`)],of),w(),b(),k(),Yc(),F();var sf={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},Z=class extends C{constructor(...e){super(...e),this.variant=`success`,this.direction=`horizontal`,this.size=`large`,this.title=``,this.notificationCardTitle=``,this.subtitle=``,this.supportingText=``,this.open=!1,this.linkText=``,this.linkHref=`#`,this.href=``,this.showIcon=!1,this.showCloseButton=!1,this.sizing=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasHeading=!1,this.__hasSubtitle=!1,this.__hasSupportingText=!1,this.__hasFooter=!1,this.__hasIcon=!1,this._closeNotification=()=>{this.open=!1;let e=new CustomEvent(`openchange`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(e);let t=new CustomEvent(`notification-close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t);let n=new CustomEvent(`close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(n);let r=new CustomEvent(`Close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(r)},this.__syncSlots=()=>{this.__hasHeading=this.__slotHasContent(`heading`),this.__hasSubtitle=this.__slotHasContent(`subtitle`),this.__hasSupportingText=this.__slotHasContent(`supporting-text`),this.__hasFooter=this.__slotHasContent(`footer`),this.__hasIcon=this.__slotHasContent(`icon`)}}get#e(){return this.notificationCardTitle||this.title}static{this.styles=[p`
11085
+ `}};P([v()],of.prototype,`__canScrollLeft`,void 0),P([v()],of.prototype,`__canScrollRight`,void 0),P([_({type:String})],of.prototype,`label`,void 0),P([_({type:String,attribute:`active-href`})],of.prototype,`activeHref`,void 0),P([_({type:Boolean,attribute:`activate-on-click`,converter:af})],of.prototype,`activateOnClick`,void 0),P([_({type:Boolean,reflect:!0})],of.prototype,`sticky`,void 0),P([_({type:String,attribute:`sticky-top`})],of.prototype,`stickyTop`,void 0),P([_({type:Number,attribute:`sticky-z-index`})],of.prototype,`stickyZIndex`,void 0),P([_({type:String,attribute:`sticky-background`})],of.prototype,`stickyBackground`,void 0),P([_({type:String,reflect:!0})],of.prototype,`spacing`,void 0),P([_({type:String,attribute:`spacing-top`,reflect:!0})],of.prototype,`spacingTop`,void 0),P([_({type:String,attribute:`spacing-bottom`,reflect:!0})],of.prototype,`spacingBottom`,void 0),P([_({type:String,attribute:`spacing-left`,reflect:!0})],of.prototype,`spacingLeft`,void 0),P([_({type:String,attribute:`spacing-right`,reflect:!0})],of.prototype,`spacingRight`,void 0),of=P([a(`scb-nav`)],of),w(),b(),k(),Yc(),F();var sf={fromAttribute:e=>e??``,toAttribute:e=>typeof e==`string`?e.trim()===``?null:e:null},Z=class extends C{constructor(...e){super(...e),this.variant=`success`,this.direction=`horizontal`,this.size=`large`,this.title=``,this.notificationCardTitle=``,this.subtitle=``,this.supportingText=``,this.open=!1,this.linkText=``,this.linkHref=`#`,this.href=``,this.showIcon=!1,this.showCloseButton=!1,this.sizing=``,this.width=``,this.maxWidth=``,this.height=``,this.maxHeight=``,this.fullHeight=!1,this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasHeading=!1,this.__hasSubtitle=!1,this.__hasSupportingText=!1,this.__hasFooter=!1,this.__hasIcon=!1,this._closeNotification=()=>{this.open=!1;let e=new CustomEvent(`openchange`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(e);let t=new CustomEvent(`notification-close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(t);let n=new CustomEvent(`close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(n);let r=new CustomEvent(`Close`,{detail:{open:this.open},bubbles:!0,composed:!0});this.dispatchEvent(r)},this.__syncSlots=()=>{this.__hasHeading=this.__slotHasContent(`heading`),this.__hasSubtitle=this.__slotHasContent(`subtitle`),this.__hasSupportingText=this.__slotHasContent(`supporting-text`),this.__hasFooter=this.__slotHasContent(`footer`),this.__hasIcon=this.__slotHasContent(`icon`)}}get#e(){return this.notificationCardTitle||this.title}static{this.styles=[p`
10833
11086
  :host {
10834
11087
  display: block;
10835
11088
  position: relative;