@oiz/stzh-components 3.3.0-beta4 → 3.3.0-beta5
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/dist/cjs/{app-globals-add1c2c1.js → app-globals-95815145.js} +2 -2
- package/dist/cjs/{app-globals-add1c2c1.js.map → app-globals-95815145.js.map} +1 -1
- package/dist/cjs/{arrow-16638ece.js → arrow-6135123b.js} +116 -49
- package/dist/cjs/arrow-6135123b.js.map +1 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-app-nav.cjs.entry.js +9 -1
- package/dist/cjs/stzh-app-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-popover_2.cjs.entry.js +21 -9
- package/dist/cjs/stzh-popover_2.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-row.cjs.entry.js +1 -1
- package/dist/cjs/stzh-row.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-tooltip.cjs.entry.js +20 -8
- package/dist/cjs/stzh-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
- package/dist/collection/components/stzh-app-nav/stzh-app-nav.js +32 -1
- package/dist/collection/components/stzh-app-nav/stzh-app-nav.js.map +1 -1
- package/dist/collection/components/stzh-app-nav/stzh-app-nav.stories.js +1 -1
- package/dist/collection/components/stzh-header/stzh-header.stories.js +2 -2
- package/dist/collection/components/stzh-popover/stzh-popover.js +20 -8
- package/dist/collection/components/stzh-popover/stzh-popover.js.map +1 -1
- package/dist/collection/components/stzh-row/stzh-row.css +240 -184
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +19 -7
- package/dist/collection/components/stzh-tooltip/stzh-tooltip.js.map +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js +1 -1
- package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/components/arrow.js +115 -48
- package/dist/components/arrow.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js.map +1 -1
- package/dist/components/stzh-app-nav2.js +10 -2
- package/dist/components/stzh-app-nav2.js.map +1 -1
- package/dist/components/stzh-popover2.js +20 -8
- package/dist/components/stzh-popover2.js.map +1 -1
- package/dist/components/stzh-row.js +1 -1
- package/dist/components/stzh-row.js.map +1 -1
- package/dist/components/stzh-tooltip2.js +19 -7
- package/dist/components/stzh-tooltip2.js.map +1 -1
- package/dist/components/stzh-upload.js +1 -1
- package/dist/components/stzh-upload.js.map +1 -1
- package/dist/esm/{app-globals-7f5414ca.js → app-globals-10ef946d.js} +2 -2
- package/dist/esm/{app-globals-7f5414ca.js.map → app-globals-10ef946d.js.map} +1 -1
- package/dist/esm/{arrow-fc956b24.js → arrow-8f47d7ea.js} +116 -49
- package/dist/esm/arrow-8f47d7ea.js.map +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stzh-app-nav.entry.js +10 -2
- package/dist/esm/stzh-app-nav.entry.js.map +1 -1
- package/dist/esm/stzh-components.js +1 -1
- package/dist/esm/stzh-popover_2.entry.js +21 -9
- package/dist/esm/stzh-popover_2.entry.js.map +1 -1
- package/dist/esm/stzh-row.entry.js +1 -1
- package/dist/esm/stzh-row.entry.js.map +1 -1
- package/dist/esm/stzh-tooltip.entry.js +20 -8
- package/dist/esm/stzh-tooltip.entry.js.map +1 -1
- package/dist/esm/stzh-upload.entry.js +1 -1
- package/dist/esm/stzh-upload.entry.js.map +1 -1
- package/dist/stzh-components/index.esm.js.map +1 -1
- package/dist/stzh-components/{p-6009632f.js → p-45be0b3e.js} +2 -2
- package/dist/stzh-components/p-7423c6c2.js +2 -0
- package/dist/stzh-components/p-7423c6c2.js.map +1 -0
- package/dist/stzh-components/{p-d1aa8602.entry.js → p-8202e541.entry.js} +2 -2
- package/dist/stzh-components/p-8202e541.entry.js.map +1 -0
- package/dist/stzh-components/p-ab6cc68f.entry.js +2 -0
- package/dist/stzh-components/p-ab6cc68f.entry.js.map +1 -0
- package/dist/stzh-components/p-b047262a.entry.js +2 -0
- package/dist/stzh-components/p-b047262a.entry.js.map +1 -0
- package/dist/stzh-components/{p-288fd6f7.entry.js → p-bb4dea97.entry.js} +2 -2
- package/dist/stzh-components/{p-288fd6f7.entry.js.map → p-bb4dea97.entry.js.map} +1 -1
- package/dist/stzh-components/p-dc4f385d.entry.js +2 -0
- package/dist/stzh-components/p-dc4f385d.entry.js.map +1 -0
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/dist/types/components/stzh-app-nav/stzh-app-nav.d.ts +5 -1
- package/dist/types/components/stzh-popover/stzh-popover.d.ts +3 -0
- package/dist/types/components/stzh-tooltip/stzh-tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +10 -2
- package/dist/types/index.d.ts +5 -0
- package/package.json +2 -2
- package/dist/cjs/arrow-16638ece.js.map +0 -1
- package/dist/esm/arrow-fc956b24.js.map +0 -1
- package/dist/stzh-components/p-6a1d65ce.entry.js +0 -2
- package/dist/stzh-components/p-6a1d65ce.entry.js.map +0 -1
- package/dist/stzh-components/p-a2da1df4.js +0 -2
- package/dist/stzh-components/p-a2da1df4.js.map +0 -1
- package/dist/stzh-components/p-d1aa8602.entry.js.map +0 -1
- package/dist/stzh-components/p-e9933daa.entry.js +0 -2
- package/dist/stzh-components/p-e9933daa.entry.js.map +0 -1
- package/dist/stzh-components/p-f42f6787.entry.js +0 -2
- package/dist/stzh-components/p-f42f6787.entry.js.map +0 -1
- /package/dist/stzh-components/{p-6009632f.js.map → p-45be0b3e.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as s,h as o,a as i,g as h}from"./p-c7bfac7a.js";import{c as e,a as r,A as l,o as a,f as n,s as c,b as p}from"./p-a2da1df4.js";import{c as d}from"./p-ed63ed76.js";import{i as z}from"./p-d789f265.js";import{w as f}from"./p-54bd842e.js";import{s as u,a as m}from"./p-7e2354d0.js";import"./p-9b063923.js";const b=".sc-stzh-tooltip-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-tooltip-h{display:none}.sc-stzh-tooltip-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-tooltip-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-tooltip-h *.sc-stzh-tooltip,.sc-stzh-tooltip-h *.sc-stzh-tooltip::before,.sc-stzh-tooltip-h *.sc-stzh-tooltip::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-tooltip-h .has-focus.sc-stzh-tooltip{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-tooltip-h .stzh-fylingfocus-focused.sc-stzh-tooltip{outline-style:none !important}.sc-stzh-tooltip-h .stzh-fylingfocus-focused.sc-stzh-tooltip::-moz-focus-inner{border:0 !important}.sc-stzh-tooltip-h{display:contents;--color:var(--stzh-tooltip-color, var(--stzh-color-white));--background-color:var(--stzh-tooltip-background-color, var(--stzh-color-coolgrey60));--width:var(--stzh-tooltip-width);--min-width:var(--stzh-tooltip-min-width);--max-width:var(--stzh-tooltip-max-width);--padding:var(--stzh-tooltip-padding);--border-radius:var(--stzh-tooltip-border-radius);--link-color:var(--stzh-tooltip-link-color, var(--stzh-color-white));--hover-link-color:var(--stzh-tooltip-hover-link-color, var(--stzh-color-white70op))}[size=small].sc-stzh-tooltip-h{--padding:var(--stzh-tooltip-small-padding)}[type=button].sc-stzh-tooltip-h{--color:var(--stzh-color-midnightblue70);--background-color:var(--stzh-color-coolgrey10);--link-color:var(--stzh-color-midnightblue70);--hover-link-color:var(--stzh-color-midnightblue80)}.stzh-tooltip.sc-stzh-tooltip{display:contents}.stzh-tooltip__arrow.sc-stzh-tooltip{position:absolute;display:flex;color:var(--background-color)}.stzh-tooltip--placement-bottom.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{top:0;transform:translateY(-0.5rem)}.stzh-tooltip--placement-top.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{bottom:0;transform:translateY(0.5rem) rotate(180deg)}.stzh-tooltip--placement-left.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{right:0;transform:translateX(0.75rem) rotate(90deg)}.stzh-tooltip--placement-right.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{left:0;transform:translateX(-0.75rem) rotate(-90deg)}.stzh-tooltip__trigger.sc-stzh-tooltip{display:contents}.stzh-tooltip__content.sc-stzh-tooltip{font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;z-index:var(--stzh-z-index-popover);border-radius:var(--border-radius);background-color:var(--background-color);color:var(--color);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);display:flex;flex-direction:row-reverse;--stzh-base-color:var(--color);--stzh-link-color:var(--link-color);--stzh-link-hover-color:var(--hover-link-color)}@supports (filter: var(--stzh-tooltip-drop-shadow)){.stzh-tooltip__content.sc-stzh-tooltip{box-shadow:none;filter:var(--stzh-tooltip-drop-shadow)}}.stzh-tooltip__content-slot.sc-stzh-tooltip{padding:var(--padding)}.stzh-tooltip__close.sc-stzh-tooltip{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;display:flex;width:2.75rem;height:2.75rem;flex-shrink:0;justify-content:center;align-items:center;color:var(--stzh-color-white);border-radius:var(--stzh-button-border-radius)}.stzh-tooltip__icon.sc-stzh-tooltip{--size:var(--stzh-icon-size-small)}.stzh-tooltip__vhidden.sc-stzh-tooltip{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}";const v={keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:100,easing:"linear"}};const g={keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:200,easing:"linear"}};const y={ESC:27};let w=0;const _=class{constructor(o){t(this,o);this.stzhOpen=s(this,"stzhOpen",7);this.stzhOpened=s(this,"stzhOpened",7);this.stzhClose=s(this,"stzhClose",7);this.stzhClosed=s(this,"stzhClosed",7);this.toggledByMethod=false;this.isHovering=false;this.onEscKey=t=>{if(t.keyCode===y.ESC){this.hide()}};this.computePosition=async()=>{if(!this.open){return}const{x:t=0,y:s=0,strategy:o="absolute",placement:i,middlewareData:h}=await e(this.triggerFirstElement,this.contentElement,{strategy:this.strategy,placement:this.placement,middleware:[a({mainAxis:this.distance,crossAxis:this.skidding}),n({padding:5}),c({padding:5}),p({element:this.arrowElement,padding:5})]});this.middlewareData=h;this.computedPlacement=i;Object.assign(this.contentElement.style,{position:o,left:`${t}px`,top:`${s}px`});Object.assign(this.arrowElement.style,{left:t!=null?`${h.arrow.x}px`:"",top:s!=null?`${h.arrow.y}px`:""})};this.onClickTrigger=()=>{if(this.hasTrigger("click")){this.toggle()}};this.onMouseEnterTrigger=()=>{if(this.hasTrigger("hover")){this.isHovering=true;this.show()}};this.onMouseLeaveTrigger=()=>{if(this.hasTrigger("hover")){this.isHovering=false;document.addEventListener("mousemove",this.onMouseMoveDocument)}};this.onFocusTrigger=()=>{if(this.hasTrigger("focus")){this.show()}};this.onBlurTrigger=()=>{if(this.hasTrigger("focus")){this.hide()}};this.onMouseMoveDocument=t=>{const{clientX:s,clientY:o}=t;if(!this.computedPlacement){return true}const i=this.computedPlacement.split("-")[0];const h=this.middlewareData.offset;const e=this.contentElement.getBoundingClientRect();if(!h){return true}const r=i==="bottom"?h.y:0;const l=i==="top"?h.y:0;const a=i==="right"?h.x:0;const n=i==="left"?h.x:0;const c=e.top-o>r;const p=o-e.bottom>l;const d=e.left-s>a;const z=s-e.right>n;if(c||p||d||z){document.removeEventListener("mousemove",this.onMouseMoveDocument);if(!this.isHovering){this.hide()}}};this.init=()=>{var t;let s=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!s){const t=Array.from(this.element.children).find((t=>!t.hasAttribute("slot")));s=t}if(s){this.triggerFirstElement=s;s.addEventListener("click",this.onClickTrigger);s.addEventListener("mouseenter",this.onMouseEnterTrigger);s.addEventListener("mouseleave",this.onMouseLeaveTrigger);s.addEventListener("focusin",this.onFocusTrigger);s.addEventListener("focusout",this.onBlurTrigger)}};this.open=false;this.label="";this.content="";this.placement="bottom";this.strategy="absolute";this.type="overlay";this.size="default";this.skidding=0;this.distance=12;this.interactive=false;this.trigger="hover focus";this.localization=undefined;this.computedPlacement=undefined}async show(){if(this.open){return}this.toggledByMethod=true;this.open=true;return f(this.element,"stzhOpened")}async hide(){if(!this.open){return}this.toggledByMethod=true;this.open=false;return f(this.element,"stzhClosed")}async toggle(){if(this.open){return await this.hide()}else{return await this.show()}}async update(){return await this.computePosition()}async openWatcher(t){if(!this.contentElement){return}if(t){if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-tooltip"})}await u(this.contentElement);this.contentElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentElement.hidden=false;await m(this.contentElement,v.keyframes,v.options);if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-tooltip"})}}else{if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-tooltip"})}await u(this.contentElement);await m(this.contentElement,g.keyframes,g.options);this.contentElement.hidden=true;this.contentElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-tooltip"})}}this.toggledByMethod=false}triggerWatcher(t){this._trigger=t.split(" ")}handleDocumentClick(t){if(!this.open){return}const s=t.target!==this.contentElement&&this.contentElement.contains(t.target)===false;const o=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(s&&!o&&this.hasTrigger("click")){this.hide()}}hasTrigger(t){return this._trigger.indexOf(t)>-1}async componentWillLoad(){this.id=`stzh-tooltip-${w++}`;this.triggerWatcher(this.trigger);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"tooltip")}}componentDidRender(){this.computePosition();const t=z(this.triggerFirstElement);if(this.hasTrigger("click")){this.triggerFirstElement.setAttribute(t?"a11y-expanded":"aria-expanded",this.open?"true":"false");if(t&&!this.triggerFirstElement.getAttribute("a11y-describedby")||!t&&!this.triggerFirstElement.getAttribute("aria-describedby")){this.triggerFirstElement.setAttribute(t?"a11y-describedby":"aria-describedby",`${this.id}-trigger-description`)}if(t&&!this.triggerFirstElement.getAttribute("a11y-label")||!t&&!this.triggerFirstElement.getAttribute("aria-label")){this.triggerFirstElement.setAttribute(t?"a11y-label":"aria-label",this.label)}if(t&&!this.triggerFirstElement.getAttribute("analytics-id")||!t&&!this.triggerFirstElement.getAttribute("s-object-id")){this.triggerFirstElement.setAttribute(t?"analytics-id":"s-object-id",this.label)}}else{if(t&&!this.triggerFirstElement.getAttribute("a11y-describedby")||!t&&!this.triggerFirstElement.getAttribute("aria-describedby")){this.triggerFirstElement.setAttribute(t?"a11y-describedby":"aria-describedby",`${this.id}-content`)}}if(this.trap){this.open?this.trap.activate():this.trap.deactivate()}}componentDidUpdate(){if(this.trap){this.trap.updateContainerElements(this.contentElement)}}componentDidLoad(){this.autoUpdateCleanup=r(this.element,this.contentElement,this.computePosition);if(this.interactive){this.trap=d(this.contentElement,{fallbackFocus:this.contentElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true});if(this.open){this.trap.activate()}}this.contentElement.hidden=!this.open}connectedCallback(){this.init();this.observer=new MutationObserver(this.init);this.observer.observe(this.element,{childList:true,subtree:true})}disconnectedCallback(){if(this.observer){this.observer.disconnect()}if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerFirstElement){this.triggerFirstElement.removeEventListener("click",this.onClickTrigger);this.triggerFirstElement.removeEventListener("mouseenter",this.onMouseEnterTrigger);this.triggerFirstElement.removeEventListener("mouseleave",this.onMouseLeaveTrigger);this.triggerFirstElement.removeEventListener("focusin",this.onFocusTrigger);this.triggerFirstElement.removeEventListener("focusout",this.onBlurTrigger)}}render(){const t={"stzh-tooltip":true,[`stzh-tooltip--type-${this.type}`]:true,[`stzh-tooltip--open`]:this.open,[`stzh-tooltip--placement-${this.computedPlacement}`]:!!this.computedPlacement};return o(i,null,o("div",{class:t},o("div",{class:"stzh-tooltip__trigger",ref:t=>this.triggerElement=t},o("slot",null)),this.hasTrigger("click")&&o("div",{class:"stzh-tooltip__vhidden",id:`${this.id}-trigger-description`},this.localization.open),o("div",{class:"stzh-tooltip__content",id:`${this.id}-content`,ref:t=>this.contentElement=t,tabindex:"-1","aria-labelledby":this.label?`${this.id}-label`:null,"aria-hidden":this.open?"false":"true",onKeyDown:this.onEscKey,onMouseEnter:this.onMouseEnterTrigger,onMouseLeave:this.onMouseLeaveTrigger,onFocusin:this.onFocusTrigger,onFocusout:this.onBlurTrigger},o("div",{class:"stzh-tooltip__arrow",ref:t=>this.arrowElement=t,innerHTML:l}),this.label&&o("h2",{id:`${this.id}-label`,class:"stzh-tooltip__vhidden"},this.label),this.hasTrigger("click")&&o("button",{class:"stzh-tooltip__close",onClick:()=>this.hide(),type:"button"},o("stzh-icon",{name:"close",class:"stzh-tooltip__icon"}),o("span",{class:"stzh-tooltip__vhidden"},this.localization.close)),o("stzh-text",Object.assign({curve:this.type==="overlay"?"none":"caption"},this.type==="button"?{font:"heavy"}:{},{class:"stzh-tooltip__content-slot"}),this.content?this.content:o("slot",{name:"content"})))))}get element(){return h(this)}static get watchers(){return{open:["openWatcher"],trigger:["triggerWatcher"]}}};_.style=b;export{_ as stzh_tooltip};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as s,h as i,a as o,g as h}from"./p-c7bfac7a.js";import{c as e,a as r,A as l,o as a,f as n,s as c,b as p}from"./p-7423c6c2.js";import{c as d}from"./p-ed63ed76.js";import{i as z}from"./p-d789f265.js";import{w as f}from"./p-54bd842e.js";import{s as u,a as m}from"./p-7e2354d0.js";import"./p-9b063923.js";const b=".sc-stzh-tooltip-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-tooltip-h{display:none}.sc-stzh-tooltip-h::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-tooltip-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-tooltip-h *.sc-stzh-tooltip,.sc-stzh-tooltip-h *.sc-stzh-tooltip::before,.sc-stzh-tooltip-h *.sc-stzh-tooltip::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-tooltip-h .has-focus.sc-stzh-tooltip{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-tooltip-h .stzh-fylingfocus-focused.sc-stzh-tooltip{outline-style:none !important}.sc-stzh-tooltip-h .stzh-fylingfocus-focused.sc-stzh-tooltip::-moz-focus-inner{border:0 !important}.sc-stzh-tooltip-h{display:contents;--color:var(--stzh-tooltip-color, var(--stzh-color-white));--background-color:var(--stzh-tooltip-background-color, var(--stzh-color-coolgrey60));--width:var(--stzh-tooltip-width);--min-width:var(--stzh-tooltip-min-width);--max-width:var(--stzh-tooltip-max-width);--padding:var(--stzh-tooltip-padding);--border-radius:var(--stzh-tooltip-border-radius);--link-color:var(--stzh-tooltip-link-color, var(--stzh-color-white));--hover-link-color:var(--stzh-tooltip-hover-link-color, var(--stzh-color-white70op))}[size=small].sc-stzh-tooltip-h{--padding:var(--stzh-tooltip-small-padding)}[type=button].sc-stzh-tooltip-h{--color:var(--stzh-color-midnightblue70);--background-color:var(--stzh-color-coolgrey10);--link-color:var(--stzh-color-midnightblue70);--hover-link-color:var(--stzh-color-midnightblue80)}.stzh-tooltip.sc-stzh-tooltip{display:contents}.stzh-tooltip__arrow.sc-stzh-tooltip{position:absolute;display:flex;color:var(--background-color)}.stzh-tooltip--placement-bottom.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-bottom-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{top:0;transform:translateY(-0.5rem)}.stzh-tooltip--placement-top.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-top-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{bottom:0;transform:translateY(0.5rem) rotate(180deg)}.stzh-tooltip--placement-left.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-left-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{right:0;transform:translateX(0.75rem) rotate(90deg)}.stzh-tooltip--placement-right.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-start.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip,.stzh-tooltip--placement-right-end.sc-stzh-tooltip .stzh-tooltip__arrow.sc-stzh-tooltip{left:0;transform:translateX(-0.75rem) rotate(-90deg)}.stzh-tooltip__trigger.sc-stzh-tooltip{display:contents}.stzh-tooltip__content.sc-stzh-tooltip{font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;z-index:var(--stzh-z-index-popover);border-radius:var(--border-radius);background-color:var(--background-color);color:var(--color);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);display:flex;flex-direction:row-reverse;--stzh-base-color:var(--color);--stzh-link-color:var(--link-color);--stzh-link-hover-color:var(--hover-link-color)}@supports (filter: var(--stzh-tooltip-drop-shadow)){.stzh-tooltip__content.sc-stzh-tooltip{box-shadow:none;filter:var(--stzh-tooltip-drop-shadow)}}.stzh-tooltip__content-slot.sc-stzh-tooltip{padding:var(--padding)}.stzh-tooltip__close.sc-stzh-tooltip{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-family:inherit;border:none;background-color:transparent;display:flex;width:2.75rem;height:2.75rem;flex-shrink:0;justify-content:center;align-items:center;color:var(--stzh-color-white);border-radius:var(--stzh-button-border-radius)}.stzh-tooltip__icon.sc-stzh-tooltip{--size:var(--stzh-icon-size-small)}.stzh-tooltip__vhidden.sc-stzh-tooltip{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}";const v={keyframes:[{opacity:"0"},{opacity:"1"}],options:{duration:100,easing:"linear"}};const g={keyframes:[{opacity:"1"},{opacity:"0"}],options:{duration:200,easing:"linear"}};const y={ESC:27};let w=0;const _=class{constructor(i){t(this,i);this.stzhOpen=s(this,"stzhOpen",7);this.stzhOpened=s(this,"stzhOpened",7);this.stzhClose=s(this,"stzhClose",7);this.stzhClosed=s(this,"stzhClosed",7);this.toggledByMethod=false;this.isHovering=false;this.onEscKey=t=>{if(t.keyCode===y.ESC){this.hide()}};this.computePosition=async()=>{if(!this.open){return}const{x:t=0,y:s=0,strategy:i="absolute",placement:o,middlewareData:h}=await e(this.triggerFirstElement,this.contentElement,{strategy:this.strategy,placement:this.placement,middleware:[a({mainAxis:this.distance,crossAxis:this.skidding}),n({padding:5}),c({padding:5}),p({element:this.arrowElement,padding:5})]});this.middlewareData=h;this.computedPlacement=o;Object.assign(this.contentElement.style,{position:i,left:`${t}px`,top:`${s}px`});Object.assign(this.arrowElement.style,{left:t!=null?`${h.arrow.x}px`:"",top:s!=null?`${h.arrow.y}px`:""})};this.onClickTrigger=()=>{if(this.hasTrigger("click")){this.toggle()}};this.onMouseEnterTrigger=()=>{if(this.hasTrigger("hover")){this.isHovering=true;this.show()}};this.onMouseLeaveTrigger=()=>{if(this.hasTrigger("hover")){this.isHovering=false;document.addEventListener("mousemove",this.onMouseMoveDocument)}};this.onFocusTrigger=()=>{if(this.hasTrigger("focus")){this.show()}};this.onBlurTrigger=()=>{if(this.hasTrigger("focus")){this.hide()}};this.onMouseMoveDocument=t=>{const{clientX:s,clientY:i}=t;if(!this.computedPlacement){return true}const o=this.computedPlacement.split("-")[0];const h=this.middlewareData.offset;const e=this.contentElement.getBoundingClientRect();if(!h){return true}const r=o==="bottom"?h.y:0;const l=o==="top"?h.y:0;const a=o==="right"?h.x:0;const n=o==="left"?h.x:0;const c=e.top-i>r;const p=i-e.bottom>l;const d=e.left-s>a;const z=s-e.right>n;if(c||p||d||z){document.removeEventListener("mousemove",this.onMouseMoveDocument);if(!this.isHovering){this.hide()}}};this.init=()=>{var t;let s=(t=this.triggerElement)===null||t===void 0?void 0:t.firstElementChild;if(!s){const t=Array.from(this.element.children).find((t=>!t.hasAttribute("slot")));s=t}if(s){this.triggerFirstElement=s;s.addEventListener("click",this.onClickTrigger);s.addEventListener("mouseenter",this.onMouseEnterTrigger);s.addEventListener("mouseleave",this.onMouseLeaveTrigger);s.addEventListener("focusin",this.onFocusTrigger);s.addEventListener("focusout",this.onBlurTrigger)}};this.initializedTooltip=false;this.open=false;this.label="";this.content="";this.placement="bottom";this.strategy="absolute";this.type="overlay";this.size="default";this.skidding=0;this.distance=12;this.interactive=false;this.trigger="hover focus";this.localization=undefined;this.computedPlacement=undefined}async show(){if(this.open){return}this.toggledByMethod=true;this.open=true;return f(this.element,"stzhOpened")}async hide(){if(!this.open){return}this.toggledByMethod=true;this.open=false;return f(this.element,"stzhClosed")}async toggle(){if(this.open){return await this.hide()}else{return await this.show()}}async update(){return await this.computePosition()}async openWatcher(t){if(!this.contentElement){return}if(t){if(this.toggledByMethod){this.stzhOpen.emit({component:"stzh-tooltip"})}await u(this.contentElement);this.contentElement.style.willChange="transform, opacity, position, top, left, bottom, right";this.contentElement.hidden=false;await m(this.contentElement,v.keyframes,v.options);if(this.toggledByMethod){this.stzhOpened.emit({component:"stzh-tooltip"})}}else{if(this.toggledByMethod){this.stzhClose.emit({component:"stzh-tooltip"})}await u(this.contentElement);await m(this.contentElement,g.keyframes,g.options);this.contentElement.hidden=true;this.contentElement.style.willChange="auto";if(this.toggledByMethod){this.stzhClosed.emit({component:"stzh-tooltip"})}}this.toggledByMethod=false}triggerWatcher(t){this._trigger=t.split(" ")}handleDocumentClick(t){if(!this.open){return}const s=t.target!==this.contentElement&&this.contentElement.contains(t.target)===false;const i=t.target===this.triggerElement||this.triggerElement.contains(t.target);if(s&&!i&&this.hasTrigger("click")){this.hide()}}hasTrigger(t){return this._trigger.indexOf(t)>-1}async componentWillLoad(){this.id=`stzh-tooltip-${w++}`;this.triggerWatcher(this.trigger);if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"tooltip")}}componentDidRender(){const t=z(this.triggerFirstElement);if(this.hasTrigger("click")){this.triggerFirstElement.setAttribute(t?"a11y-expanded":"aria-expanded",this.open?"true":"false");if(t&&!this.triggerFirstElement.getAttribute("a11y-describedby")||!t&&!this.triggerFirstElement.getAttribute("aria-describedby")){this.triggerFirstElement.setAttribute(t?"a11y-describedby":"aria-describedby",`${this.id}-trigger-description`)}if(t&&!this.triggerFirstElement.getAttribute("a11y-label")||!t&&!this.triggerFirstElement.getAttribute("aria-label")){this.triggerFirstElement.setAttribute(t?"a11y-label":"aria-label",this.label)}if(t&&!this.triggerFirstElement.getAttribute("analytics-id")||!t&&!this.triggerFirstElement.getAttribute("s-object-id")){this.triggerFirstElement.setAttribute(t?"analytics-id":"s-object-id",this.label)}}else{if(t&&!this.triggerFirstElement.getAttribute("a11y-describedby")||!t&&!this.triggerFirstElement.getAttribute("aria-describedby")){this.triggerFirstElement.setAttribute(t?"a11y-describedby":"aria-describedby",`${this.id}-content`)}}if(this.trap){this.open?this.trap.activate():this.trap.deactivate()}}componentDidUpdate(){if(this.open&&!this.initializedTooltip){this.initializeAutoUpdate();this.initializeFocusTrap();this.initializedTooltip=true}if(this.initializedTooltip){this.computePosition();if(this.trap){this.trap.updateContainerElements(this.contentElement)}}}initializeAutoUpdate(){this.autoUpdateCleanup=r(this.element,this.contentElement,this.computePosition)}initializeFocusTrap(){if(this.interactive){this.trap=d(this.contentElement,{fallbackFocus:this.contentElement,clickOutsideDeactivates:true,returnFocusOnDeactivate:true})}}componentDidLoad(){this.contentElement.hidden=!this.open;if(this.open&&this.trap){this.trap.activate()}}connectedCallback(){this.init();this.observer=new MutationObserver(this.init);this.observer.observe(this.element,{childList:true,subtree:true})}disconnectedCallback(){if(this.observer){this.observer.disconnect()}if(this.autoUpdateCleanup){this.autoUpdateCleanup()}if(this.triggerFirstElement){this.triggerFirstElement.removeEventListener("click",this.onClickTrigger);this.triggerFirstElement.removeEventListener("mouseenter",this.onMouseEnterTrigger);this.triggerFirstElement.removeEventListener("mouseleave",this.onMouseLeaveTrigger);this.triggerFirstElement.removeEventListener("focusin",this.onFocusTrigger);this.triggerFirstElement.removeEventListener("focusout",this.onBlurTrigger)}}render(){const t={"stzh-tooltip":true,[`stzh-tooltip--type-${this.type}`]:true,[`stzh-tooltip--open`]:this.open,[`stzh-tooltip--placement-${this.computedPlacement}`]:!!this.computedPlacement};return i(o,null,i("div",{class:t},i("div",{class:"stzh-tooltip__trigger",ref:t=>this.triggerElement=t},i("slot",null)),this.hasTrigger("click")&&i("div",{class:"stzh-tooltip__vhidden",id:`${this.id}-trigger-description`},this.localization.open),i("div",{class:"stzh-tooltip__content",id:`${this.id}-content`,ref:t=>this.contentElement=t,tabindex:"-1","aria-labelledby":this.label?`${this.id}-label`:null,"aria-hidden":this.open?"false":"true",onKeyDown:this.onEscKey,onMouseEnter:this.onMouseEnterTrigger,onMouseLeave:this.onMouseLeaveTrigger,onFocusin:this.onFocusTrigger,onFocusout:this.onBlurTrigger},i("div",{class:"stzh-tooltip__arrow",ref:t=>this.arrowElement=t,innerHTML:l}),this.label&&i("h2",{id:`${this.id}-label`,class:"stzh-tooltip__vhidden"},this.label),this.hasTrigger("click")&&i("button",{class:"stzh-tooltip__close",onClick:()=>this.hide(),type:"button"},i("stzh-icon",{name:"close",class:"stzh-tooltip__icon"}),i("span",{class:"stzh-tooltip__vhidden"},this.localization.close)),i("stzh-text",Object.assign({curve:this.type==="overlay"?"none":"caption"},this.type==="button"?{font:"heavy"}:{},{class:"stzh-tooltip__content-slot"}),this.content?this.content:i("slot",{name:"content"})))))}get element(){return h(this)}static get watchers(){return{open:["openWatcher"],trigger:["triggerWatcher"]}}};_.style=b;export{_ as stzh_tooltip};
|
|
2
|
+
//# sourceMappingURL=p-8202e541.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stzhTooltipCss","ANIMATION_SHOW","keyframes","opacity","options","duration","easing","ANIMATION_HIDE","keyCode","ESC","tooltipCounter","StzhTooltip","this","toggledByMethod","isHovering","onEscKey","event","hide","computePosition","async","open","x","y","strategy","placement","middlewareData","triggerFirstElement","contentElement","middleware","offset","mainAxis","distance","crossAxis","skidding","flip","padding","shift","arrow","element","arrowElement","computedPlacement","Object","assign","style","position","left","top","onClickTrigger","hasTrigger","toggle","onMouseEnterTrigger","show","onMouseLeaveTrigger","document","addEventListener","onMouseMoveDocument","onFocusTrigger","onBlurTrigger","clientX","clientY","basePlacement","split","offsetData","popperRect","getBoundingClientRect","topDistance","bottomDistance","leftDistance","rightDistance","exceedsTop","exceedsBottom","bottom","exceedsLeft","exceedsRight","right","removeEventListener","init","trigger","_a","triggerElement","firstElementChild","defaultSlot","Array","from","children","find","child","hasAttribute","initializedTooltip","waitForEvent","update","openWatcher","newValue","stzhOpen","emit","component","stopAnimations","willChange","hidden","animateTo","stzhOpened","stzhClose","stzhClosed","triggerWatcher","_trigger","handleDocumentClick","isClickOutside","target","contains","isClickTrigger","indexOf","componentWillLoad","id","localization","window","stzhComponents","utils","fetchTranslations","componentDidRender","isStzh","isStzhElement","setAttribute","getAttribute","label","trap","activate","deactivate","componentDidUpdate","initializeAutoUpdate","initializeFocusTrap","updateContainerElements","autoUpdateCleanup","autoUpdate","interactive","createFocusTrap","fallbackFocus","clickOutsideDeactivates","returnFocusOnDeactivate","componentDidLoad","connectedCallback","observer","MutationObserver","observe","childList","subtree","disconnectedCallback","disconnect","render","classes","type","h","Host","class","ref","el","tabindex","onKeyDown","onMouseEnter","onMouseLeave","onFocusin","onFocusout","innerHTML","Arrow","onClick","name","close","curve","font","content"],"sources":["src/components/stzh-tooltip/stzh-tooltip.scss?tag=stzh-tooltip&encapsulation=scoped","src/components/stzh-tooltip/stzh-tooltip.tsx"],"sourcesContent":["/**\n * @prop --width: Width of tooltip\n * @prop --min-width: Minimum width of tooltip\n * @prop --max-width: Maximum width of tooltip\n * @prop --padding: Padding of tooltip\n * @prop --border-radius: Border radius of tooltip\n *\n * @prop --stzh-tooltip-width: **Global**: Width of tooltip (default `auto`)\n * @prop --stzh-tooltip-min-width: **Global**: Minimum width of tooltip (default `initial`)\n * @prop --stzh-tooltip-max-width: **Global**: Maximum width of tooltip (default `334px`)\n * @prop --stzh-tooltip-padding: **Global**: Padding of tooltip (default `var(--stzh-space-small)`)\n * @prop --stzh-tooltip-border-radius: **Global**: Border radius of tooltip (default `3px`)\n * @prop --stzh-tooltip-drop-shadow: **Global**: Border radius of tooltip (default `drop-shadow(0px 2px 10px rgba(0, 0, 0, 0.16))`)\n * @prop --stzh-tooltip-color: **Global**: Color of tooltip text\n * @prop --stzh-tooltip-background-color: **Global**: Background color of tooltip\n * @prop --stzh-tooltip-link-color: **Global**: Color for link within tooltip\n * @prop --stzh-tooltip-hover-link-color: **Global**: Hover color for link within tooltip\n */\n\n:host {\n display: contents;\n\n --color: var(--stzh-tooltip-color, #{$colorWhite});\n --background-color: var(--stzh-tooltip-background-color, #{$colorCoolgrey60});\n --width: #{$tooltipWidth};\n --min-width: #{$tooltipMinWidth};\n --max-width: #{$tooltipMaxWidth};\n --padding: #{$tooltipPadding};\n --border-radius: #{$tooltipBorderRadius};\n --link-color: var(--stzh-tooltip-link-color, #{$colorWhite});\n --hover-link-color: var(--stzh-tooltip-hover-link-color, #{$colorWhite70op});\n\n &[size=\"small\"] {\n --padding: #{$tooltipSmallPadding};\n }\n\n &[type=\"button\"] {\n --color: #{$colorMidnightblue70};\n --background-color: #{$colorCoolgrey10};\n --link-color: #{$colorMidnightblue70};\n --hover-link-color: #{$colorMidnightblue80};\n }\n}\n\n.stzh-tooltip {\n @include tooltip-arrow;\n display: contents;\n\n &__trigger {\n display: contents;\n }\n\n &__content {\n @include tooltip-fontsize;\n @include tooltip-dropshadow;\n position: absolute;\n z-index: $zIndexPopover;\n border-radius: var(--border-radius);\n background-color: var(--background-color);\n color: var(--color);\n width: var(--width);\n min-width: var(--min-width);\n max-width: var(--max-width);\n display: flex;\n flex-direction: row-reverse;\n\n --stzh-base-color: var(--color);\n --stzh-link-color: var(--link-color);\n --stzh-link-hover-color: var(--hover-link-color);\n }\n\n &__content-slot {\n padding: var(--padding);\n }\n\n &__close {\n @include tooltip__close;\n }\n\n &__icon {\n @include tooltip__icon;\n }\n\n &__vhidden {\n @include visuallyhidden;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Listen, Method, Prop, State, Watch } from \"@stencil/core\";\n\nimport {\n StzhTooltipClosedEvent,\n StzhTooltipCloseEvent,\n StzhTooltipOpenedEvent,\n StzhTooltipOpenEvent,\n} from \"../../index\";\n\nimport { arrow, autoUpdate, computePosition, flip, MiddlewareData, offset, Placement, shift } from \"@floating-ui/dom\";\n\nimport { createFocusTrap, FocusTrap } from \"focus-trap\";\nimport { isStzhElement } from \"../../utils/utils\";\nimport { waitForEvent } from \"../../utils/event-utils\";\nimport { animateTo, stopAnimations } from \"../../utils/animation-utils\";\n\nimport { StzhTooltipLocalizedText } from \"./stzh-tooltip.localization\";\n\nimport Arrow from \"./assets/arrow.svg\";\n\nconst ANIMATION_SHOW = {\n keyframes: [{ opacity: \"0\" }, { opacity: \"1\" }],\n options: { duration: 100, easing: \"linear\" },\n};\n\nconst ANIMATION_HIDE = {\n keyframes: [{ opacity: \"1\" }, { opacity: \"0\" }],\n options: { duration: 200, easing: \"linear\" },\n};\n\nconst keyCode = {\n ESC: 27,\n};\n\nlet tooltipCounter = 0;\n\n/**\n * @slot Trigger element inside\n * @slot content - Content of tooltip\n */\n@Component({\n tag: \"stzh-tooltip\",\n styleUrl: \"stzh-tooltip.scss\",\n scoped: true,\n})\nexport class StzhTooltip {\n /** Whether tooltip should be open */\n @Prop({ mutable: true }) open: boolean = false;\n\n /** Label of tooltip (used for screenreaders) */\n @Prop() label: string = \"\";\n\n /** Content of tooltip (use instead of content slot) */\n @Prop() content: string = \"\";\n\n /** Default placement of tooltip relative to trigger element */\n @Prop() placement: Placement = \"bottom\";\n\n /** Position strategy */\n @Prop() strategy: \"absolute\" | \"fixed\" = \"absolute\";\n\n /** Visual type */\n @Prop({ reflect: true }) type: \"overlay\" | \"button\" = \"overlay\";\n\n /** Shifting of tooltip content */\n @Prop({ reflect: true }) size: \"default\" | \"small\" = \"default\";\n\n /** Shifting of tooltip content */\n @Prop() skidding: number = 0;\n\n /** Distance from tooltip content to trigger (default: arrow height (8px) + spacing (4px) = 12) */\n @Prop() distance: number = 12;\n\n /** Whether tooltip is interactive */\n @Prop() interactive: boolean = false;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @Prop() trigger: string = \"hover focus\";\n private _trigger: string[];\n\n /** Translation strings */\n @Prop() localization: StzhTooltipLocalizedText;\n\n @Element() element: HTMLStzhTooltipElement;\n\n /** Tooltip open event */\n @Event() stzhOpen: EventEmitter<StzhTooltipOpenEvent>;\n\n /** Tooltip opened event (after animation) */\n @Event() stzhOpened: EventEmitter<StzhTooltipOpenedEvent>;\n\n /** Tooltip close event */\n @Event() stzhClose: EventEmitter<StzhTooltipCloseEvent>;\n\n /** Tooltip closed event (after animation) */\n @Event() stzhClosed: EventEmitter<StzhTooltipClosedEvent>;\n\n /** Show tooltip content */\n @Method()\n async show() {\n if (this.open) {\n return;\n }\n\n this.toggledByMethod = true;\n this.open = true;\n return waitForEvent(this.element, \"stzhOpened\");\n }\n\n /** Hide tooltip content */\n @Method()\n async hide() {\n if (!this.open) {\n return;\n }\n\n this.toggledByMethod = true;\n this.open = false;\n return waitForEvent(this.element, \"stzhClosed\");\n }\n\n /** Toggle tooltip content */\n @Method()\n async toggle() {\n if (this.open) {\n return await this.hide();\n } else {\n return await this.show();\n }\n }\n\n @Method()\n async update() {\n return await this.computePosition();\n }\n\n @Watch(\"open\")\n async openWatcher(newValue: boolean) {\n if (!this.contentElement) {\n return;\n }\n\n if (newValue) {\n if (this.toggledByMethod) {\n this.stzhOpen.emit({\n component: \"stzh-tooltip\",\n });\n }\n\n await stopAnimations(this.contentElement);\n\n // safari seems to need will-change,\n // otherwise it has problems animating the element with the drop shadow\n this.contentElement.style.willChange = \"transform, opacity, position, top, left, bottom, right\";\n this.contentElement.hidden = false;\n\n await animateTo(this.contentElement, ANIMATION_SHOW.keyframes, ANIMATION_SHOW.options);\n\n if (this.toggledByMethod) {\n this.stzhOpened.emit({\n component: \"stzh-tooltip\",\n });\n }\n } else {\n if (this.toggledByMethod) {\n this.stzhClose.emit({\n component: \"stzh-tooltip\",\n });\n }\n\n await stopAnimations(this.contentElement);\n await animateTo(this.contentElement, ANIMATION_HIDE.keyframes, ANIMATION_HIDE.options);\n\n this.contentElement.hidden = true;\n this.contentElement.style.willChange = \"auto\";\n\n if (this.toggledByMethod) {\n this.stzhClosed.emit({\n component: \"stzh-tooltip\",\n });\n }\n }\n\n this.toggledByMethod = false;\n }\n\n @Watch(\"trigger\")\n triggerWatcher(newValue: string) {\n this._trigger = newValue.split(\" \");\n }\n\n @Listen(\"click\", { target: \"document\", capture: true })\n handleDocumentClick(event: MouseEvent) {\n if (!this.open) {\n return;\n }\n\n const isClickOutside =\n event.target !== this.contentElement && this.contentElement.contains(event.target as HTMLElement) === false;\n\n const isClickTrigger =\n event.target === this.triggerElement || this.triggerElement.contains(event.target as HTMLElement);\n\n if (isClickOutside && !isClickTrigger && this.hasTrigger(\"click\")) {\n this.hide();\n }\n }\n\n @State() computedPlacement: Placement;\n\n private observer: MutationObserver;\n\n private toggledByMethod: boolean = false;\n private middlewareData: MiddlewareData;\n private triggerElement: HTMLElement;\n private triggerFirstElement: HTMLElement;\n private contentElement: HTMLElement;\n private arrowElement: HTMLElement;\n private autoUpdateCleanup: Function;\n private id: string;\n private trap: FocusTrap;\n private isHovering: boolean = false;\n\n private hasTrigger(trigger: string) {\n return this._trigger.indexOf(trigger) > -1;\n }\n\n private onEscKey = (event: KeyboardEvent) => {\n if (event.keyCode === keyCode.ESC) {\n this.hide();\n }\n };\n\n private computePosition = async () => {\n if (!this.open) {\n return;\n }\n\n const {\n x = 0,\n y = 0,\n strategy = \"absolute\",\n placement,\n middlewareData,\n } = await computePosition(this.triggerFirstElement, this.contentElement, {\n strategy: this.strategy,\n placement: this.placement,\n middleware: [\n offset({\n mainAxis: this.distance,\n crossAxis: this.skidding,\n }),\n flip({\n padding: 5,\n }),\n shift({\n padding: 5,\n }),\n arrow({\n element: this.arrowElement,\n padding: 5,\n }),\n ],\n });\n\n this.middlewareData = middlewareData;\n this.computedPlacement = placement;\n\n Object.assign(this.contentElement.style, {\n position: strategy,\n left: `${x}px`,\n top: `${y}px`,\n });\n\n Object.assign(this.arrowElement.style, {\n left: x != null ? `${middlewareData.arrow.x}px` : \"\",\n top: y != null ? `${middlewareData.arrow.y}px` : \"\",\n });\n };\n\n private onClickTrigger = () => {\n if (this.hasTrigger(\"click\")) {\n this.toggle();\n }\n };\n\n private onMouseEnterTrigger = () => {\n if (this.hasTrigger(\"hover\")) {\n this.isHovering = true;\n this.show();\n }\n };\n\n private onMouseLeaveTrigger = () => {\n if (this.hasTrigger(\"hover\")) {\n this.isHovering = false;\n document.addEventListener(\"mousemove\", this.onMouseMoveDocument);\n }\n };\n\n private onFocusTrigger = () => {\n if (this.hasTrigger(\"focus\")) {\n this.show();\n }\n };\n\n private onBlurTrigger = () => {\n if (this.hasTrigger(\"focus\")) {\n this.hide();\n }\n };\n\n private onMouseMoveDocument = (event: MouseEvent) => {\n const { clientX, clientY } = event;\n\n if (!this.computedPlacement) {\n return true;\n }\n\n const basePlacement = this.computedPlacement.split(\"-\")[0];\n const offsetData = this.middlewareData.offset;\n const popperRect = this.contentElement.getBoundingClientRect();\n\n if (!offsetData) {\n return true;\n }\n\n const topDistance = basePlacement === \"bottom\" ? offsetData.y : 0;\n const bottomDistance = basePlacement === \"top\" ? offsetData.y : 0;\n const leftDistance = basePlacement === \"right\" ? offsetData.x : 0;\n const rightDistance = basePlacement === \"left\" ? offsetData.x : 0;\n\n const exceedsTop = popperRect.top - clientY > topDistance;\n const exceedsBottom = clientY - popperRect.bottom > bottomDistance;\n const exceedsLeft = popperRect.left - clientX > leftDistance;\n const exceedsRight = clientX - popperRect.right > rightDistance;\n\n if (exceedsTop || exceedsBottom || exceedsLeft || exceedsRight) {\n document.removeEventListener(\"mousemove\", this.onMouseMoveDocument);\n\n if (!this.isHovering) {\n this.hide();\n }\n }\n };\n\n private init = () => {\n let trigger = this.triggerElement?.firstElementChild as HTMLElement;\n\n if (!trigger) {\n const defaultSlot = Array.from(this.element.children).find(child => !child.hasAttribute(\"slot\")) as HTMLElement;\n\n trigger = defaultSlot;\n }\n\n if (trigger) {\n this.triggerFirstElement = trigger;\n trigger.addEventListener(\"click\", this.onClickTrigger);\n trigger.addEventListener(\"mouseenter\", this.onMouseEnterTrigger);\n trigger.addEventListener(\"mouseleave\", this.onMouseLeaveTrigger);\n trigger.addEventListener(\"focusin\", this.onFocusTrigger);\n trigger.addEventListener(\"focusout\", this.onBlurTrigger);\n }\n };\n\n async componentWillLoad() {\n this.id = `stzh-tooltip-${tooltipCounter++}`;\n\n this.triggerWatcher(this.trigger);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"tooltip\");\n }\n }\n\n componentDidRender() {\n const isStzh = isStzhElement(this.triggerFirstElement);\n\n if (this.hasTrigger(\"click\")) {\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-expanded\" : \"aria-expanded\", this.open ? \"true\" : \"false\");\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"a11y-describedby\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"aria-describedby\"))\n ) {\n this.triggerFirstElement.setAttribute(\n isStzh ? \"a11y-describedby\" : \"aria-describedby\",\n `${this.id}-trigger-description`\n );\n }\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"a11y-label\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"aria-label\"))\n ) {\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-label\" : \"aria-label\", this.label);\n }\n\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"analytics-id\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"s-object-id\"))\n ) {\n this.triggerFirstElement.setAttribute(isStzh ? \"analytics-id\" : \"s-object-id\", this.label);\n }\n } else {\n if (\n (isStzh && !this.triggerFirstElement.getAttribute(\"a11y-describedby\")) ||\n (!isStzh && !this.triggerFirstElement.getAttribute(\"aria-describedby\"))\n ) {\n this.triggerFirstElement.setAttribute(isStzh ? \"a11y-describedby\" : \"aria-describedby\", `${this.id}-content`);\n }\n }\n\n if (this.trap) {\n this.open ? this.trap.activate() : this.trap.deactivate();\n }\n }\n\n private initializedTooltip = false\n\n componentDidUpdate() {\n if (this.open && !this.initializedTooltip) {\n this.initializeAutoUpdate();\n this.initializeFocusTrap();\n this.initializedTooltip = true\n }\n\n if (this.initializedTooltip) {\n this.computePosition();\n if (this.trap) {\n this.trap.updateContainerElements(this.contentElement);\n }\n }\n }\n\n initializeAutoUpdate() {\n this.autoUpdateCleanup = autoUpdate(this.element, this.contentElement, this.computePosition);\n }\n\n initializeFocusTrap() {\n if (this.interactive) {\n this.trap = createFocusTrap(this.contentElement, {\n fallbackFocus: this.contentElement,\n clickOutsideDeactivates: true,\n returnFocusOnDeactivate: true,\n });\n }\n }\n\n componentDidLoad() {\n this.contentElement.hidden = !this.open;\n if (this.open && this.trap) {\n this.trap.activate();\n }\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true,\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n if (this.autoUpdateCleanup) {\n this.autoUpdateCleanup();\n }\n\n if (this.triggerFirstElement) {\n this.triggerFirstElement.removeEventListener(\"click\", this.onClickTrigger);\n this.triggerFirstElement.removeEventListener(\"mouseenter\", this.onMouseEnterTrigger);\n this.triggerFirstElement.removeEventListener(\"mouseleave\", this.onMouseLeaveTrigger);\n this.triggerFirstElement.removeEventListener(\"focusin\", this.onFocusTrigger);\n this.triggerFirstElement.removeEventListener(\"focusout\", this.onBlurTrigger);\n }\n }\n\n render() {\n const classes = {\n \"stzh-tooltip\": true,\n [`stzh-tooltip--type-${this.type}`]: true,\n [`stzh-tooltip--open`]: this.open,\n [`stzh-tooltip--placement-${this.computedPlacement}`]: !!this.computedPlacement,\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-tooltip__trigger\" ref={el => (this.triggerElement = el as HTMLDivElement)}>\n <slot></slot>\n </div>\n {this.hasTrigger(\"click\") && (\n <div class=\"stzh-tooltip__vhidden\" id={`${this.id}-trigger-description`}>\n {this.localization.open}\n </div>\n )}\n <div\n class=\"stzh-tooltip__content\"\n id={`${this.id}-content`}\n ref={el => (this.contentElement = el as HTMLDivElement)}\n tabindex=\"-1\"\n aria-labelledby={this.label ? `${this.id}-label` : null}\n aria-hidden={this.open ? \"false\" : \"true\"}\n onKeyDown={this.onEscKey}\n onMouseEnter={this.onMouseEnterTrigger}\n onMouseLeave={this.onMouseLeaveTrigger}\n onFocusin={this.onFocusTrigger}\n onFocusout={this.onBlurTrigger}\n >\n <div\n class=\"stzh-tooltip__arrow\"\n ref={el => (this.arrowElement = el as HTMLDivElement)}\n innerHTML={Arrow}\n ></div>\n {this.label && (\n <h2 id={`${this.id}-label`} class=\"stzh-tooltip__vhidden\">\n {this.label}\n </h2>\n )}\n {this.hasTrigger(\"click\") && (\n <button class=\"stzh-tooltip__close\" onClick={() => this.hide()} type=\"button\">\n <stzh-icon name=\"close\" class=\"stzh-tooltip__icon\"></stzh-icon>\n <span class=\"stzh-tooltip__vhidden\">{this.localization.close}</span>\n </button>\n )}\n <stzh-text\n curve={this.type === \"overlay\" ? \"none\" : \"caption\"}\n {...(this.type === \"button\" ? { font: \"heavy\" } : {})}\n class=\"stzh-tooltip__content-slot\"\n >\n {this.content ? this.content : <slot name=\"content\"></slot>}\n </stzh-text>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6TAAA,MAAMA,EAAiB,2uJCoBvB,MAAMC,EAAiB,CACrBC,UAAW,CAAC,CAAEC,QAAS,KAAO,CAAEA,QAAS,MACzCC,QAAS,CAAEC,SAAU,IAAKC,OAAQ,WAGpC,MAAMC,EAAiB,CACrBL,UAAW,CAAC,CAAEC,QAAS,KAAO,CAAEA,QAAS,MACzCC,QAAS,CAAEC,SAAU,IAAKC,OAAQ,WAGpC,MAAME,EAAU,CACdC,IAAK,IAGP,IAAIC,EAAiB,E,MAWRC,EAAW,M,+KA2KdC,KAAAC,gBAA2B,MAS3BD,KAAAE,WAAsB,MAMtBF,KAAAG,SAAYC,IAClB,GAAIA,EAAMR,UAAYA,EAAQC,IAAK,CACjCG,KAAKK,M,GAIDL,KAAAM,gBAAkBC,UACxB,IAAKP,KAAKQ,KAAM,CACd,M,CAGF,MAAMC,EACJA,EAAI,EAACC,EACLA,EAAI,EAACC,SACLA,EAAW,WAAUC,UACrBA,EAASC,eACTA,SACQP,EAAgBN,KAAKc,oBAAqBd,KAAKe,eAAgB,CACvEJ,SAAUX,KAAKW,SACfC,UAAWZ,KAAKY,UAChBI,WAAY,CACVC,EAAO,CACLC,SAAUlB,KAAKmB,SACfC,UAAWpB,KAAKqB,WAElBC,EAAK,CACHC,QAAS,IAEXC,EAAM,CACJD,QAAS,IAEXE,EAAM,CACJC,QAAS1B,KAAK2B,aACdJ,QAAS,OAKfvB,KAAKa,eAAiBA,EACtBb,KAAK4B,kBAAoBhB,EAEzBiB,OAAOC,OAAO9B,KAAKe,eAAegB,MAAO,CACvCC,SAAUrB,EACVsB,KAAM,GAAGxB,MACTyB,IAAK,GAAGxB,QAGVmB,OAAOC,OAAO9B,KAAK2B,aAAaI,MAAO,CACrCE,KAAMxB,GAAK,KAAO,GAA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G,EAAA,OAAKE,MAAM,wBAAwBxC,GAAI,GAAGpG,KAAKoG,0BAC5CpG,KAAKqG,aAAa7F,MAGvBkI,EAAA,OACEE,MAAM,wBACNxC,GAAI,GAAGpG,KAAKoG,aACZyC,IAAKC,GAAO9I,KAAKe,eAAiB+H,EAClCC,SAAS,KAAI,kBACI/I,KAAK+G,MAAQ,GAAG/G,KAAKoG,WAAa,KAAI,cAC1CpG,KAAKQ,KAAO,QAAU,OACnCwI,UAAWhJ,KAAKG,SAChB8I,aAAcjJ,KAAKsC,oBACnB4G,aAAclJ,KAAKwC,oBACnB2G,UAAWnJ,KAAK4C,eAChBwG,WAAYpJ,KAAK6C,eAEjB6F,EAAA,OACEE,MAAM,sBACNC,IAAKC,GAAO9I,KAAK2B,aAAemH,EAChCO,UAAWC,IAEZtJ,KAAK+G,OACJ2B,EAAA,MAAItC,GAAI,GAAGpG,KAAKoG,WAAYwC,MAAM,yBAC/B5I,KAAK+G,OAGT/G,KAAKoC,WAAW,UACfsG,EAAA,UAAQE,MAAM,sBAAsBW,QAAS,IAAMvJ,KAAKK,OAAQoI,KAAK,UACnEC,EAAA,aAAWc,KAAK,QAAQZ,MAAM,uBAC9BF,EAAA,QAAME,MAAM,yBAAyB5I,KAAKqG,aAAaoD,QAG3Df,EAAA,YAAA7G,OAAAC,OAAA,CACE4H,MAAO1J,KAAKyI,OAAS,UAAY,OAAS,WACrCzI,KAAKyI,OAAS,SAAW,CAAEkB,KAAM,SAAY,GAAE,CACpDf,MAAM,+BAEL5I,KAAK4J,QAAU5J,KAAK4J,QAAUlB,EAAA,QAAMc,KAAK,e"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as n,h as e,a as i,g as s}from"./p-c7bfac7a.js";const a=":host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden]{display:none}:host::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}:host{--stzh-app-nav-background-color:var(--stzh-color-coolgrey10);--stzh-app-nav-color:var(--stzh-color-coolgrey90);--stzh-app-nav-color-active:var(--stzh-color-primary70)}.stzh-app-nav{background-color:var(--stzh-app-nav-background-color)}.stzh-app-nav__links{display:flex;flex-direction:row;justify-content:space-between;padding:var(--stzh-space-medium) var(--stzh-space-large) var(--stzh-space-xlarge)}@media screen and (min-width: 900px){.stzh-app-nav__links{padding:0;align-items:center}}.stzh-app-nav__link{--text-decoration-line:none;--hover-text-decoration-line:none;--color:var(--stzh-app-nav-color)}@media screen and (min-width: 900px){.stzh-app-nav__link{margin-right:var(--stzh-space-xlarge)}}.stzh-app-nav__link::last-child{margin-right:0}.stzh-app-nav .stzh-link--is-active{text-decoration:none;--color:var(--stzh-app-nav-color-active)}@media screen and (min-width: 900px){.stzh-app-nav .stzh-link--is-active{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}}.stzh-app-nav .stzh-link__inner{flex-direction:column}@media screen and (min-width: 900px){.stzh-app-nav .stzh-link__inner{flex-direction:row}}.stzh-app-nav .stzh-link__text{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height)}@media screen and (min-width: 900px){.stzh-app-nav .stzh-link__text{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);font-weight:var(--stzh-font-weight-medium)}}.stzh-app-nav .stzh-link__icon-wrapper.sc-stzh-link:not(:empty)+.stzh-link__text.sc-stzh-link:not(:empty),.stzh-app-nav .stzh-link__text.sc-stzh-link:not(:empty)+.stzh-link__icon-wrapper.sc-stzh-link:not(:empty){margin-top:var(--stzh-space-xxsmall);margin-left:0}@media screen and (min-width: 900px){.stzh-app-nav .stzh-link__icon-wrapper.sc-stzh-link:not(:empty)+.stzh-link__text.sc-stzh-link:not(:empty),.stzh-app-nav .stzh-link__text.sc-stzh-link:not(:empty)+.stzh-link__icon-wrapper.sc-stzh-link:not(:empty){margin-left:var(--stzh-space-xsmall);margin-top:0}}";const o=class{constructor(e){t(this,e);this.stzhAppNavItemClick=n(this,"stzhAppNavItemClick",7);this.handleAppNavItemClick=(t,n)=>{this.stzhAppNavItemClick.emit({component:"stzh-app-nav",item:n,originalEvent:t})};this.localization=undefined;this.items=[]}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"appnav")}}render(){const t={"stzh-app-nav":true};return e(i,null,e("nav",{role:"navigation",class:t,"aria-label":this.localization.title},e("div",{class:"stzh-app-nav__links",role:"list"},this.items.map((t=>e("stzh-link",{class:"stzh-app-nav__link",active:t.active,role:"listitem","a11y-current":t.a11yCurrent,href:t.href,badge:t.badge,badgeType:t.badgeType,icon:t.icon,onClick:n=>{this.handleAppNavItemClick(n,t)}},t.text))))))}get element(){return s(this)}};o.style=a;export{o as stzh_app_nav};
|
|
2
|
+
//# sourceMappingURL=p-ab6cc68f.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stzhAppNavCss","StzhAppNav","this","handleAppNavItemClick","event","item","stzhAppNavItemClick","emit","component","originalEvent","componentWillLoad","localization","window","stzhComponents","utils","fetchTranslations","element","render","classes","h","Host","role","class","title","items","map","active","a11yCurrent","href","badge","badgeType","icon","onClick","e","text"],"sources":["src/components/stzh-app-nav/stzh-app-nav.scss?tag=stzh-app-nav&encapsulation=shadow","src/components/stzh-app-nav/stzh-app-nav.tsx"],"sourcesContent":["/**\n * @prop --stzh-app-nav-background-color: Background color of app nav links.\n * @prop --stzh-app-nav-color: Text and icon color of app nav links.\n * @prop --stzh-app-nav-color-active: Text and icon color of active app nav links.\n */\n\n:host {\n --stzh-app-nav-background-color: var(--stzh-color-coolgrey10);\n --stzh-app-nav-color: var(--stzh-color-coolgrey90);\n --stzh-app-nav-color-active: var(--stzh-color-primary70);\n}\n\n.stzh-app-nav {\n background-color: var(--stzh-app-nav-background-color);\n\n &__links {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: space('medium') space('large') space('xlarge');\n\n @include mq($from: medium) {\n padding: 0;\n align-items: center;\n }\n }\n\n &__link {\n --text-decoration-line: none;\n --hover-text-decoration-line: none;\n --color: var(--stzh-app-nav-color);\n\n @include mq($from: medium) {\n margin-right: space('xlarge');\n }\n\n &::last-child {\n margin-right: 0;\n }\n }\n\n .stzh-link--is-active {\n text-decoration: none;\n --color: var(--stzh-app-nav-color-active);\n\n @include mq($from: medium) {\n @include font('heavy');\n }\n }\n\n .stzh-link__inner {\n flex-direction: column;\n\n @include mq($from: medium) {\n flex-direction: row;\n }\n }\n\n .stzh-link__text {\n @include font('medium');\n @include fontSize('pico');\n\n @include mq($from: medium) {\n @include fontSize('milli');\n font-weight: var(--stzh-font-weight-medium);\n }\n }\n\n .stzh-link__icon-wrapper.sc-stzh-link:not(:empty) + .stzh-link__text.sc-stzh-link:not(:empty), .stzh-link__text.sc-stzh-link:not(:empty) + .stzh-link__icon-wrapper.sc-stzh-link:not(:empty) {\n margin-top: space('xxsmall');\n margin-left: 0;\n\n @include mq($from: medium) {\n margin-left: space('xsmall');\n margin-top: 0;\n }\n }\n}\n","import {Component, Prop, h, Host, Element, Event, EventEmitter} from \"@stencil/core\";\n\nimport { StzhAppNavLocalizedText } from \"./stzh-app-nav.localization\";\n\nimport {StzhAppNavItem, StzhAppNavItemClickEvent} from \"../../index\";\n\n@Component({\n tag: \"stzh-app-nav\",\n styleUrl: \"stzh-app-nav.scss\",\n shadow: true,\n})\n\nexport class StzhAppNav {\n /** Translation strings */\n @Prop() localization: StzhAppNavLocalizedText;\n\n /** App-nav items */\n @Prop() items: StzhAppNavItem[] = [];\n\n @Element() element: HTMLStzhAppNavElement;\n\n /** AppNav item click event */\n @Event() stzhAppNavItemClick: EventEmitter<StzhAppNavItemClickEvent>;\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"appnav\");\n }\n }\n\n private handleAppNavItemClick = (event: MouseEvent, item: StzhAppNavItem) => {\n this.stzhAppNavItemClick.emit({\n component: \"stzh-app-nav\",\n item,\n originalEvent: event,\n });\n };\n\n render() {\n const classes = {\n \"stzh-app-nav\": true,\n };\n\n return (\n <Host>\n <nav role=\"navigation\" class={classes} aria-label={this.localization.title}>\n <div class=\"stzh-app-nav__links\" role=\"list\">\n {this.items.map((item) => (\n <stzh-link\n class=\"stzh-app-nav__link\"\n active={item.active}\n role=\"listitem\"\n a11y-current={item.a11yCurrent}\n href={item.href}\n badge={item.badge}\n badgeType={item.badgeType}\n icon={item.icon}\n onClick={(e: MouseEvent) => { this.handleAppNavItemClick(e, item) }}\n >{item.text}\n </stzh-link>\n ))}\n </div>\n </nav>\n </Host>\n );\n }\n}\n"],"mappings":"gEAAA,MAAMA,EAAgB,gtG,MCYTC,EAAU,M,kFAkBbC,KAAAC,sBAAwB,CAACC,EAAmBC,KAClDH,KAAKI,oBAAoBC,KAAK,CAC5BC,UAAW,eACXH,OACAI,cAAeL,GACf,E,uCAlB8B,E,CAOlC,uBAAMM,GACJ,IAAKR,KAAKS,aAAc,CACtBT,KAAKS,mBAAqBC,OAAOC,eAAeC,MAAMC,kBAAkBb,KAAKc,QAAS,S,EAY1F,MAAAC,GACE,MAAMC,EAAU,CACd,eAAgB,MAGlB,OACEC,EAACC,EAAI,KACHD,EAAA,OAAKE,KAAK,aAAaC,MAAOJ,EAAO,aAAchB,KAAKS,aAAaY,OACnEJ,EAAA,OAAKG,MAAM,sBAAsBD,KAAK,QACrCnB,KAAKsB,MAAMC,KAAKpB,GACfc,EAAA,aACEG,MAAM,qBACNI,OAAQrB,EAAKqB,OACbL,KAAK,WAAU,eACDhB,EAAKsB,YACnBC,KAAMvB,EAAKuB,KACXC,MAAOxB,EAAKwB,MACZC,UAAWzB,EAAKyB,UAChBC,KAAM1B,EAAK0B,KACXC,QAAUC,IAAoB/B,KAAKC,sBAAsB8B,EAAG5B,EAAK,GAC/DA,EAAK6B,U"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as e,a as s}from"./p-c7bfac7a.js";const l=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden]{display:none}:host::-moz-selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}:host{width:100%;--row-gap:var(--stzh-row-row-gap, 0px)}:host([span="1"]) ::slotted(stzh-cell:not([span])){--cell-width:8.3333333333%}:host([span="2"]) ::slotted(stzh-cell:not([span])){--cell-width:16.6666666667%}:host([span="3"]) ::slotted(stzh-cell:not([span])){--cell-width:25%}:host([span="4"]) ::slotted(stzh-cell:not([span])){--cell-width:33.3333333333%}:host([span="5"]) ::slotted(stzh-cell:not([span])){--cell-width:41.6666666667%}:host([span="6"]) ::slotted(stzh-cell:not([span])){--cell-width:50%}:host([span="7"]) ::slotted(stzh-cell:not([span])){--cell-width:58.3333333333%}:host([span="8"]) ::slotted(stzh-cell:not([span])){--cell-width:66.6666666667%}:host([span="9"]) ::slotted(stzh-cell:not([span])){--cell-width:75%}:host([span="10"]) ::slotted(stzh-cell:not([span])){--cell-width:83.3333333333%}:host([span="11"]) ::slotted(stzh-cell:not([span])){--cell-width:91.6666666667%}:host([span="12"]) ::slotted(stzh-cell:not([span])){--cell-width:100%}@media screen and (min-width: 600px){:host([span-small="1"]) ::slotted(stzh-cell:not([span-small])){--cell-width:8.3333333333%}}@media screen and (min-width: 600px){:host([span-small="2"]) ::slotted(stzh-cell:not([span-small])){--cell-width:16.6666666667%}}@media screen and (min-width: 600px){:host([span-small="3"]) ::slotted(stzh-cell:not([span-small])){--cell-width:25%}}@media screen and (min-width: 600px){:host([span-small="4"]) ::slotted(stzh-cell:not([span-small])){--cell-width:33.3333333333%}}@media screen and (min-width: 600px){:host([span-small="5"]) ::slotted(stzh-cell:not([span-small])){--cell-width:41.6666666667%}}@media screen and (min-width: 600px){:host([span-small="6"]) ::slotted(stzh-cell:not([span-small])){--cell-width:50%}}@media screen and (min-width: 600px){:host([span-small="7"]) ::slotted(stzh-cell:not([span-small])){--cell-width:58.3333333333%}}@media screen and (min-width: 600px){:host([span-small="8"]) ::slotted(stzh-cell:not([span-small])){--cell-width:66.6666666667%}}@media screen and (min-width: 600px){:host([span-small="9"]) ::slotted(stzh-cell:not([span-small])){--cell-width:75%}}@media screen and (min-width: 600px){:host([span-small="10"]) ::slotted(stzh-cell:not([span-small])){--cell-width:83.3333333333%}}@media screen and (min-width: 600px){:host([span-small="11"]) ::slotted(stzh-cell:not([span-small])){--cell-width:91.6666666667%}}@media screen and (min-width: 600px){:host([span-small="12"]) ::slotted(stzh-cell:not([span-small])){--cell-width:100%}}@media screen and (min-width: 900px){:host([span-medium="1"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:8.3333333333%}}@media screen and (min-width: 900px){:host([span-medium="2"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:16.6666666667%}}@media screen and (min-width: 900px){:host([span-medium="3"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:25%}}@media screen and (min-width: 900px){:host([span-medium="4"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:33.3333333333%}}@media screen and (min-width: 900px){:host([span-medium="5"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:41.6666666667%}}@media screen and (min-width: 900px){:host([span-medium="6"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:50%}}@media screen and (min-width: 900px){:host([span-medium="7"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:58.3333333333%}}@media screen and (min-width: 900px){:host([span-medium="8"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:66.6666666667%}}@media screen and (min-width: 900px){:host([span-medium="9"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:75%}}@media screen and (min-width: 900px){:host([span-medium="10"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:83.3333333333%}}@media screen and (min-width: 900px){:host([span-medium="11"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:91.6666666667%}}@media screen and (min-width: 900px){:host([span-medium="12"]) ::slotted(stzh-cell:not([span-medium])){--cell-width:100%}}@media screen and (min-width: 1260px){:host([span-large="1"]) ::slotted(stzh-cell:not([span-large])){--cell-width:8.3333333333%}}@media screen and (min-width: 1260px){:host([span-large="2"]) ::slotted(stzh-cell:not([span-large])){--cell-width:16.6666666667%}}@media screen and (min-width: 1260px){:host([span-large="3"]) ::slotted(stzh-cell:not([span-large])){--cell-width:25%}}@media screen and (min-width: 1260px){:host([span-large="4"]) ::slotted(stzh-cell:not([span-large])){--cell-width:33.3333333333%}}@media screen and (min-width: 1260px){:host([span-large="5"]) ::slotted(stzh-cell:not([span-large])){--cell-width:41.6666666667%}}@media screen and (min-width: 1260px){:host([span-large="6"]) ::slotted(stzh-cell:not([span-large])){--cell-width:50%}}@media screen and (min-width: 1260px){:host([span-large="7"]) ::slotted(stzh-cell:not([span-large])){--cell-width:58.3333333333%}}@media screen and (min-width: 1260px){:host([span-large="8"]) ::slotted(stzh-cell:not([span-large])){--cell-width:66.6666666667%}}@media screen and (min-width: 1260px){:host([span-large="9"]) ::slotted(stzh-cell:not([span-large])){--cell-width:75%}}@media screen and (min-width: 1260px){:host([span-large="10"]) ::slotted(stzh-cell:not([span-large])){--cell-width:83.3333333333%}}@media screen and (min-width: 1260px){:host([span-large="11"]) ::slotted(stzh-cell:not([span-large])){--cell-width:91.6666666667%}}@media screen and (min-width: 1260px){:host([span-large="12"]) ::slotted(stzh-cell:not([span-large])){--cell-width:100%}}@media screen and (min-width: 1600px){:host([span-ultra="1"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:8.3333333333%}}@media screen and (min-width: 1600px){:host([span-ultra="2"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:16.6666666667%}}@media screen and (min-width: 1600px){:host([span-ultra="3"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:25%}}@media screen and (min-width: 1600px){:host([span-ultra="4"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:33.3333333333%}}@media screen and (min-width: 1600px){:host([span-ultra="5"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:41.6666666667%}}@media screen and (min-width: 1600px){:host([span-ultra="6"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:50%}}@media screen and (min-width: 1600px){:host([span-ultra="7"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:58.3333333333%}}@media screen and (min-width: 1600px){:host([span-ultra="8"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:66.6666666667%}}@media screen and (min-width: 1600px){:host([span-ultra="9"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:75%}}@media screen and (min-width: 1600px){:host([span-ultra="10"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:83.3333333333%}}@media screen and (min-width: 1600px){:host([span-ultra="11"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:91.6666666667%}}@media screen and (min-width: 1600px){:host([span-ultra="12"]) ::slotted(stzh-cell:not([span-ultra])){--cell-width:100%}}.stzh-row{display:flex;flex-wrap:wrap;justify-content:flex-start;row-gap:var(--row-gap);margin-left:calc(var(--stzh-grid-gutter) / -2);margin-right:calc(var(--stzh-grid-gutter) / -2);}@media screen and (min-width: 600px){.stzh-row{margin-left:calc(var(--stzh-grid-gutter-small) / -2);margin-right:calc(var(--stzh-grid-gutter-small) / -2)}}@media screen and (min-width: 900px){.stzh-row{margin-left:calc(var(--stzh-grid-gutter-medium) / -2);margin-right:calc(var(--stzh-grid-gutter-medium) / -2)}}@media screen and (min-width: 1260px){.stzh-row{margin-left:calc(var(--stzh-grid-gutter-large) / -2);margin-right:calc(var(--stzh-grid-gutter-large) / -2)}}@media screen and (min-width: 1600px){.stzh-row{margin-left:calc(var(--stzh-grid-gutter-ultra) / -2);margin-right:calc(var(--stzh-grid-gutter-ultra) / -2)}}.stzh-row--justify-end{justify-content:flex-end}.stzh-row--justify-center{justify-content:center}.stzh-row--justify-between{justify-content:space-between}.stzh-row--justify-around{justify-content:space-around}.stzh-row--justify-evenly{justify-content:space-evenly}.stzh-row--items-end{align-items:flex-end}.stzh-row--items-center{align-items:center}.stzh-row--items-baseline{align-items:baseline}.stzh-row--items-stretch{align-items:stretch}.stzh-row--content-end{align-content:flex-end}.stzh-row--content-center{align-content:center}.stzh-row--content-between{align-content:space-between}.stzh-row--content-around{align-content:space-around}.stzh-row--content-evenly{align-content:space-evenly}';const n=class{constructor(e){t(this,e);this.span=12;this.spanSmall=undefined;this.spanMedium=undefined;this.spanLarge=undefined;this.spanUltra=undefined;this.justify="start";this.items="start";this.content="start"}render(){return e(s,null,e("div",{class:{"stzh-row":true,[`stzh-row--justify-${this.justify}`]:!!this.justify,[`stzh-row--items-${this.items}`]:!!this.items,[`stzh-row--content-${this.content}`]:!!this.content}},e("slot",null)))}};n.style=l;export{n as stzh_row};
|
|
2
|
+
//# sourceMappingURL=p-b047262a.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["stzhRowCss","StzhRow","render","h","Host","class","this","justify","items","content"],"sources":["src/components/stzh-row/stzh-row.scss?tag=stzh-row&encapsulation=shadow","src/components/stzh-row/stzh-row.tsx"],"sourcesContent":[":host {\n width: 100%;\n\n --row-gap: var(--stzh-row-row-gap, 0px);\n}\n\n@mixin cellProps($breakpoint: null) {\n @for $i from 1 through $gridCells {\n @if $breakpoint {\n :host([span-#{$breakpoint}=\"#{$i}\"])\n ::slotted(stzh-cell:not([span-#{$breakpoint}])) {\n @include mq($from: $breakpoint) {\n --cell-width: #{100% / ($gridCells / $i)};\n }\n }\n } @else {\n :host([span=\"#{$i}\"])\n ::slotted(stzh-cell:not([span])) {\n --cell-width: #{100% / ($gridCells / $i)};\n }\n }\n }\n}\n\n@include cellProps();\n\n@each $breakpoint, $size in $breakpoints {\n @include cellProps($breakpoint);\n}\n\n.stzh-row {\n display: flex;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n row-gap: var(--row-gap);\n margin-left: calc(#{$gridGutter} / -2);\n margin-right: calc(#{$gridGutter} / -2);\n\n @include mq($from: small) {\n margin-left: calc(#{$gridGutterSmall} / -2);\n margin-right: calc(#{$gridGutterSmall} / -2);\n }\n\n @include mq($from: medium) {\n margin-left: calc(#{$gridGutterMedium} / -2);\n margin-right: calc(#{$gridGutterMedium} / -2);\n }\n\n @include mq($from: large) {\n margin-left: calc(#{$gridGutterLarge} / -2);\n margin-right: calc(#{$gridGutterLarge} / -2);\n }\n\n @include mq($from: ultra) {\n margin-left: calc(#{$gridGutterUltra} / -2);\n margin-right: calc(#{$gridGutterUltra} / -2);\n }\n\n /* Justify content variants */\n\n &--justify-end {\n justify-content: flex-end;\n }\n\n &--justify-center {\n justify-content: center;\n }\n\n &--justify-between {\n justify-content: space-between;\n }\n\n &--justify-around {\n justify-content: space-around;\n }\n\n &--justify-evenly {\n justify-content: space-evenly;\n }\n\n /* Align items variants */\n\n &--items-end {\n align-items: flex-end;\n }\n\n &--items-center {\n align-items: center;\n }\n\n &--items-baseline {\n align-items: baseline;\n }\n\n &--items-stretch {\n align-items: stretch;\n }\n\n /* Align content variants */\n\n &--content-end {\n align-content: flex-end;\n }\n\n &--content-center {\n align-content: center;\n }\n\n &--content-between {\n align-content: space-between;\n }\n\n &--content-around {\n align-content: space-around;\n }\n\n &--content-evenly {\n align-content: space-evenly;\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n} from \"@stencil/core\";\n\nimport { Layout } from \"../../index\";\n\n/**\n * @slot - Slot for `stzh-cell` elements\n */\n@Component({\n tag: \"stzh-row\",\n styleUrl: \"stzh-row.scss\",\n shadow: true\n})\nexport class StzhRow {\n /** Default span of each cell */\n @Prop({ reflect: true }) span: number = 12;\n /** Default span of each cell above small breakpoint */\n @Prop({ reflect: true }) spanSmall: number;\n /** Default span of each cell above medium breakpoint */\n @Prop({ reflect: true }) spanMedium: number;\n /** Default span of each cell above large breakpoint */\n @Prop({ reflect: true }) spanLarge: number;\n /** Default span of each cell above ultra breakpoint */\n @Prop({ reflect: true }) spanUltra: number;\n\n /** Controlling how cells are positioned along a container's main axis */\n @Prop({ reflect: true }) justify: Layout.Justify = \"start\";\n\n /** Control how cells items are positioned along a container's cross axis */\n @Prop({ reflect: true }) items: Layout.Items = \"start\";\n\n /** Utilities for controlling how rows are positioned in multi-row flex containers. */\n @Prop({ reflect: true }) content: Layout.Justify = \"start\";\n\n render() {\n return (\n <Host>\n <div\n class={{\n \"stzh-row\": true,\n [`stzh-row--justify-${this.justify}`]: !!this.justify,\n [`stzh-row--items-${this.items}`]: !!this.items,\n [`stzh-row--content-${this.content}`]: !!this.content\n }}\n >\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"kDAAA,MAAMA,EAAa,60S,MCiBNC,EAAO,M,mCAEsB,G,kHAWW,Q,WAGJ,Q,aAGI,O,CAEnD,MAAAC,GACE,OACEC,EAACC,EAAI,KACHD,EAAA,OACEE,MAAO,CACL,WAAY,KACZ,CAAC,qBAAqBC,KAAKC,aAAcD,KAAKC,QAC9C,CAAC,mBAAmBD,KAAKE,WAAYF,KAAKE,MAC1C,CAAC,qBAAqBF,KAAKG,aAAcH,KAAKG,UAGhDN,EAAA,c"}
|