@storefront-ui/shared
Advanced tools
Comparing version 2.0.0-rc.3-3 to 2.0.0
@@ -1,2 +0,1 @@ | ||
export * from './progress'; | ||
export * from './scrollable'; | ||
@@ -3,0 +2,0 @@ export * from './utils'; |
@@ -1,1 +0,1 @@ | ||
(function(i,c){typeof exports=="object"&&typeof module<"u"?c(exports):typeof define=="function"&&define.amd?define(["exports"],c):(i=typeof globalThis<"u"?globalThis:i||self,c(i["storefront-ui-shared"]={}))})(this,function(i){"use strict";var k=Object.defineProperty;var J=(i,c,a)=>c in i?k(i,c,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[c]=a;var o=(i,c,a)=>(J(i,typeof c!="symbol"?c+"":c,a),a);const c={xs:{icon:16,r:7.2,dash:45.216},sm:{icon:20,r:9,dash:56.52},base:{icon:24,r:11,dash:69.08},lg:{icon:32,r:14.67,dash:92.127},xl:{icon:40,r:19,dash:119.32},"2xl":{icon:56,r:26,dash:163.28},"3xl":{icon:96,r:44,dash:276.32},"4xl":{icon:192,r:88,dash:552.64}},a={reduceMotion:!1,snap:!1,drag:void 0,vertical:!1},L="vsf-scrollable__container--dragging";class F{constructor(t,n){o(this,"container");o(this,"options");o(this,"debounceId");o(this,"isDragged");o(this,"dragScrollX");o(this,"dragScrollLeft");o(this,"dragScrollY");o(this,"dragScrollTop");o(this,"scrollListenerInstance",()=>{});o(this,"resizeListenerInstance",()=>{});o(this,"mouseDownListenerInstance",()=>{});o(this,"mouseUpListenerInstance",()=>{});o(this,"mouseMoveListenerInstance",()=>{});o(this,"mouseLeaveListenerInstance",()=>{});if(!(t instanceof HTMLElement))throw new Error(`VsfScrollable: Container is not a HTMLElement! Received: ${t}`);this.container=t,this.options={...a,...n},this.dragScrollX=0,this.dragScrollLeft=0,this.dragScrollY=0,this.dragScrollTop=0,this.init()}init(){this.addListeners(),this.onScrollHandler()}update(t){this.options={...a,...t},this.removeListeners(),this.init()}destroy(){this.removeListeners()}prev(){const{container:t,options:n}=this;n.vertical?this.scrollTo({top:t.scrollTop-t.clientHeight}):this.scrollTo({left:t.scrollLeft-t.clientWidth})}next(){const{container:t,options:n}=this;n.vertical?this.scrollTo({top:t.scrollTop+t.clientHeight}):this.scrollTo({left:t.scrollLeft+t.clientWidth})}scrollToIndex(t){const n=this.children();if(n[t]){const{container:s}=this,r=n[t].getBoundingClientRect(),l=r.left-s.getBoundingClientRect().left,u=r.top-s.getBoundingClientRect().top,d=s.clientWidth/2-r.width/2,K=s.clientHeight/2-r.height/2;this.options.vertical?this.scrollTo({top:s.scrollTop+u-K}):this.scrollTo({left:s.scrollLeft+l-d})}}refresh(t){requestAnimationFrame(()=>{const n=this.calculate();t==null||t(n)})}onMouseUp(){this.isDragged=!1,setTimeout(()=>{this.container.classList.remove(L)},50)}onMouseLeave(){this.isDragged=!1,this.container.classList.remove(L)}onMouseDown(t){t.preventDefault();const{container:n,options:s}=this;this.isDragged=!0,n.classList.add(L),s.vertical?(this.dragScrollY=t.pageY-n.offsetTop,this.dragScrollTop=n.scrollTop):(this.dragScrollX=t.pageX-n.offsetLeft,this.dragScrollLeft=n.scrollLeft)}onMouseMove(t){var l;if(!this.isDragged)return;t.preventDefault();const n=((l=this.options.drag)==null?void 0:l.sensitivity)??4,{container:s,options:r}=this;if(r.vertical){const d=(t.pageY-s.offsetTop-this.dragScrollY)*n;s.scrollTop=this.dragScrollTop-d}else{const d=(t.pageX-s.offsetLeft-this.dragScrollX)*n;s.scrollLeft=this.dragScrollLeft-d}}addListeners(){this.scrollListenerInstance=this.onScroll.bind(this),this.resizeListenerInstance=this.onResize.bind(this),this.container.addEventListener("scroll",this.scrollListenerInstance,{passive:!0}),window.addEventListener("resize",this.resizeListenerInstance),this.options.drag&&(this.mouseDownListenerInstance=this.onMouseDown.bind(this),this.mouseUpListenerInstance=this.onMouseUp.bind(this),this.mouseMoveListenerInstance=this.onMouseMove.bind(this),this.mouseLeaveListenerInstance=this.onMouseLeave.bind(this),this.container.addEventListener("mousedown",this.mouseDownListenerInstance,{passive:!1}),this.container.addEventListener("mouseup",this.mouseUpListenerInstance,{passive:!0}),this.container.addEventListener("mousemove",this.mouseMoveListenerInstance,{passive:!1}),this.container.addEventListener("mouseleave",this.mouseLeaveListenerInstance,{passive:!0}))}removeListeners(){this.container.removeEventListener("scroll",this.scrollListenerInstance),window.removeEventListener("resize",this.resizeListenerInstance),this.options.drag||(this.container.removeEventListener("mousedown",this.mouseDownListenerInstance),this.container.removeEventListener("mouseup",this.mouseUpListenerInstance),this.container.removeEventListener("mousemove",this.mouseMoveListenerInstance),this.container.removeEventListener("mouseleave",this.mouseLeaveListenerInstance))}children(){return this.container.children}scrollTo({left:t,top:n}){const s=this.options.reduceMotion?"auto":"smooth";this.container.scrollTo({left:t,top:n,behavior:s})}onScroll(){this.container&&(clearTimeout(this.debounceId),this.debounceId=setTimeout(this.onScrollHandler.bind(this),50))}onResize(){this.container&&this.refresh(n=>{var s,r;return(r=(s=this.options).onScroll)==null?void 0:r.call(s,n)})}onScrollHandler(){this.refresh(t=>{var n,s;return(s=(n=this.options).onScroll)==null?void 0:s.call(n,t)})}calculate(){const{container:t,options:n}=this;function s(){return n.vertical?t.scrollHeight>Math.ceil(t.scrollTop)+t.clientHeight:t.scrollWidth>Math.ceil(t.scrollLeft)+t.clientWidth}function r(){return n.vertical?!!t.scrollTop:!!t.scrollLeft}return{left:t.scrollLeft,width:t.clientWidth,scrollWidth:t.scrollWidth,hasPrev:r(),hasNext:s()}}}const v=typeof window<"u",H=v&&(window==null?void 0:window.matchMedia("(prefers-reduced-motion: reduce)").matches),f=v&&/^((?!chrome|android).)*safari/i.test(navigator==null?void 0:navigator.userAgent);let R=-1;const W=e=>`vsf-${e}--${++R}`,U=e=>e.key==="Tab"&&e.shiftKey,X=e=>e.key==="Tab"&&!e.shiftKey,Y=()=>{};function j(e,t,n){return Math.min(Math.max(e,t),n)}function z(e,t){return Math.round(e/t)*t}function p(e,t){if(e===t)return!0;const n=typeof e;if(n!==typeof t)return!1;if(n==="object"&&e!==null&&t!==null){if(e.length!==t.length||Object.getOwnPropertyNames(e).length!==Object.getOwnPropertyNames(t).length)return!1;for(const r in e)if(!p(e[r],t[r]))return!1}else return n==="function"?e.toString()===t.toString():!1;return!0}var I=(e=>(e.gray="gray",e.secondary="secondary",e.positive="positive",e.warning="warning",e.error="error",e))(I||{}),T=(e=>(e.temporary="temporary",e.persistent="persistent",e))(T||{}),M=(e=>(e.top="top",e.middle="middle",e))(M||{}),S=(e=>(e.top="top",e.middle="middle",e.bottom="bottom",e))(S||{}),w=(e=>(e.category="category",e.subcategory="subcategory",e.contact="contact",e.contactDescription="contact-description",e.socialMedia="social-media",e.bottomLinks="bottom-links",e.companyName="company-name",e))(w||{}),y=(e=>(e.xs="xs",e.sm="sm",e.base="base",e.lg="lg",e.xl="xl",e["2xl"]="2xl",e["3xl"]="3xl",e["4xl"]="4xl",e))(y||{});const m=(e,t)=>t.findIndex(n=>n===e),E=(e,t)=>{const n=m(e,t);return t[n+1]},D=(e,t)=>{const n=m(e,t);return t[n-1]},h=({focusables:e,event:t})=>{t==null||t.preventDefault();const n=e[0];return n==null||n.focus(),n},g=({focusables:e,event:t})=>{t==null||t.preventDefault();const n=e[e.length-1];return n==null||n.focus(),n},N=(e,t)=>{const n=E(e,t);return n==null||n.focus(),n},b=(e,t)=>{const n=D(e,t);return n==null||n.focus(),n},P=(e,t)=>m(e,t)===0,x=(e,t)=>m(e,t)===t.length-1,B=(e,t,n)=>{const s=[...n].reverse(),r=s.findIndex(l=>l===e);return s.find((l,u)=>{var d;if(u>r&&l.closest(t)&&e.closest(t)!==l.closest(t)&&((d=s[u+1])==null?void 0:d.closest(t))!==l.closest(t))return l})},G=(e,t,n)=>{const s=n.findIndex(r=>r===e);return n.find((r,l)=>{if(l>s&&r.closest(t)&&e.closest(t)!==r.closest(t))return r})},q=({current:e,focusables:t,arrowFocusGroupSelector:n})=>{if(!e)return h({focusables:t});const s=G(e,n,t);return e&&s?(s==null||s.focus(),s):h({focusables:t})},A=({current:e,focusables:t,arrowFocusGroupSelector:n})=>{if(!e)return h({focusables:t});const s=B(e,n,t);return e&&s?(s==null||s.focus(),s):g({focusables:t})},O=({current:e,focusables:t,event:n})=>{if(f&&(n==null||n.preventDefault()),e){if(x(e,t))return h({focusables:t,event:n});if(f||!n)return N(e,t)}else return h({focusables:t,event:n})},C=({current:e,focusables:t,event:n})=>{if(f&&(n==null||n.preventDefault()),e){if(P(e,t))return g({focusables:t,event:n});if(f||!n)return b(e,t)}else return g({focusables:t,event:n})},_=({current:e,event:t,focusables:n,arrowFocusGroupSelector:s})=>s?q({current:e,focusables:n,arrowFocusGroupSelector:s}):O({current:e,focusables:n,event:t}),$=({current:e,focusables:t,event:n,arrowFocusGroupSelector:s})=>s?A({current:e,focusables:t,arrowFocusGroupSelector:s}):C({current:e,focusables:t,event:n});i.VSFScrollable=F,i.VsfAlertType=T,i.VsfAlertVariant=I,i.VsfFooterColumnType=M,i.VsfFooterLabelType=w,i.VsfFooterSectionType=S,i.VsfLoaderSize=y,i.clamp=j,i.equal=p,i.findCurrentFocusableIndex=m,i.findNextFocusable=E,i.findPrevFocusable=D,i.focusFirstElement=h,i.focusLastElement=g,i.focusNext=_,i.focusNextElement=N,i.focusNextOrFirst=O,i.focusPrev=$,i.focusPrevElement=b,i.focusPrevOrLast=C,i.generateId=W,i.isBrowser=v,i.isCurrentFirstElement=P,i.isCurrentLastElement=x,i.isReduceMotionEnabled=H,i.isSafari=f,i.isTab=X,i.isTabAndShift=U,i.noop=Y,i.progressSvgSizes=c,i.roundToNearest=z,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); | ||
(function(n,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(n=typeof globalThis<"u"?globalThis:n||self,l(n["storefront-ui-shared"]={}))})(this,function(n){"use strict";var ot=Object.defineProperty;var lt=(n,l,a)=>l in n?ot(n,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[l]=a;var o=(n,l,a)=>(lt(n,typeof l!="symbol"?l+"":l,a),a);const l={reduceMotion:!1,snap:!1,drag:void 0,vertical:!1},a="sf-scrollable__container--dragging";class ${constructor(e,s){o(this,"container");o(this,"options");o(this,"debounceId");o(this,"isDragged");o(this,"dragScrollX");o(this,"dragScrollLeft");o(this,"dragScrollY");o(this,"dragScrollTop");o(this,"scrollListenerInstance",()=>{});o(this,"resizeListenerInstance",()=>{});o(this,"mouseDownListenerInstance",()=>{});o(this,"mouseUpListenerInstance",()=>{});o(this,"mouseMoveListenerInstance",()=>{});o(this,"mouseLeaveListenerInstance",()=>{});if(!(e instanceof HTMLElement))throw new Error(`SfScrollable: Container is not a HTMLElement! Received: ${e}`);this.container=e,this.options={...l,...s},this.dragScrollX=0,this.dragScrollLeft=0,this.dragScrollY=0,this.dragScrollTop=0,this.init()}init(){this.addListeners(),this.onScrollHandler()}update(e){this.options={...l,...e},this.removeListeners(),this.init()}destroy(){this.removeListeners()}prev(){const{container:e,options:s}=this;s.vertical?this.scrollTo({top:e.scrollTop-e.clientHeight}):this.scrollTo({left:e.scrollLeft-e.clientWidth})}next(){const{container:e,options:s}=this;s.vertical?this.scrollTo({top:e.scrollTop+e.clientHeight}):this.scrollTo({left:e.scrollLeft+e.clientWidth})}scrollToIndex(e){const s=this.children();if(s[e]){const{container:r}=this,i=s[e].getBoundingClientRect(),c=i.left-r.getBoundingClientRect().left,h=i.top-r.getBoundingClientRect().top,d=r.clientWidth/2-i.width/2,it=r.clientHeight/2-i.height/2;this.options.vertical?this.scrollTo({top:r.scrollTop+h-it}):this.scrollTo({left:r.scrollLeft+c-d})}}refresh(e){requestAnimationFrame(()=>{const s=this.calculate();e==null||e(s)})}onMouseUp(){this.isDragged=!1,setTimeout(()=>{this.container.classList.remove(a)},50)}onMouseLeave(){this.isDragged=!1,this.container.classList.remove(a)}onMouseDown(e){e.preventDefault();const{container:s,options:r}=this;this.isDragged=!0,s.classList.add(a),r.vertical?(this.dragScrollY=e.pageY-s.offsetTop,this.dragScrollTop=s.scrollTop):(this.dragScrollX=e.pageX-s.offsetLeft,this.dragScrollLeft=s.scrollLeft)}onMouseMove(e){var c;if(!this.isDragged)return;e.preventDefault();const s=((c=this.options.drag)==null?void 0:c.sensitivity)??4,{container:r,options:i}=this;if(i.vertical){const d=(e.pageY-r.offsetTop-this.dragScrollY)*s;r.scrollTop=this.dragScrollTop-d}else{const d=(e.pageX-r.offsetLeft-this.dragScrollX)*s;r.scrollLeft=this.dragScrollLeft-d}}addListeners(){this.scrollListenerInstance=this.onScroll.bind(this),this.resizeListenerInstance=this.onResize.bind(this),this.container.addEventListener("scroll",this.scrollListenerInstance,{passive:!0}),window.addEventListener("resize",this.resizeListenerInstance),this.options.drag&&(this.mouseDownListenerInstance=this.onMouseDown.bind(this),this.mouseUpListenerInstance=this.onMouseUp.bind(this),this.mouseMoveListenerInstance=this.onMouseMove.bind(this),this.mouseLeaveListenerInstance=this.onMouseLeave.bind(this),this.container.addEventListener("mousedown",this.mouseDownListenerInstance,{passive:!1}),this.container.addEventListener("mouseup",this.mouseUpListenerInstance,{passive:!0}),this.container.addEventListener("mousemove",this.mouseMoveListenerInstance,{passive:!1}),this.container.addEventListener("mouseleave",this.mouseLeaveListenerInstance,{passive:!0}))}removeListeners(){this.container.removeEventListener("scroll",this.scrollListenerInstance),window.removeEventListener("resize",this.resizeListenerInstance),this.options.drag||(this.container.removeEventListener("mousedown",this.mouseDownListenerInstance),this.container.removeEventListener("mouseup",this.mouseUpListenerInstance),this.container.removeEventListener("mousemove",this.mouseMoveListenerInstance),this.container.removeEventListener("mouseleave",this.mouseLeaveListenerInstance))}children(){return this.container.children}scrollTo({left:e,top:s}){const r=this.options.reduceMotion?"auto":"smooth";this.container.scrollTo({left:e,top:s,behavior:r})}onScroll(){this.container&&(clearTimeout(this.debounceId),this.debounceId=setTimeout(this.onScrollHandler.bind(this),50))}onResize(){this.container&&this.refresh(s=>{var r,i;return(i=(r=this.options).onScroll)==null?void 0:i.call(r,s)})}onScrollHandler(){this.refresh(e=>{var s,r;return(r=(s=this.options).onScroll)==null?void 0:r.call(s,e)})}calculate(){const{container:e,options:s}=this;function r(){return s.vertical?e.scrollHeight>Math.ceil(e.scrollTop)+e.clientHeight:e.scrollWidth>Math.ceil(e.scrollLeft)+e.clientWidth}function i(){return s.vertical?!!e.scrollTop:!!e.scrollLeft}return{left:e.scrollLeft,width:e.clientWidth,scrollWidth:e.scrollWidth,hasPrev:i(),hasNext:r()}}}const L=typeof window<"u",K=L&&(window==null?void 0:window.matchMedia("(prefers-reduced-motion: reduce)").matches),f=L&&/^((?!chrome|android).)*safari/i.test(navigator==null?void 0:navigator.userAgent);let J=-1;const Q=t=>`sf-${t}--${++J}`,Z=t=>t.key==="Tab"&&t.shiftKey,k=t=>t.key==="Tab"&&!t.shiftKey,V=()=>{};function P(t,e,s){return Math.min(Math.max(t,e),s)}function z(t,e){return Math.round(t/e)*e}function v(t,e){if(t===e)return!0;const s=typeof t;if(s!==typeof e)return!1;if(s==="object"&&t!==null&&e!==null){if(t.length!==e.length||Object.getOwnPropertyNames(t).length!==Object.getOwnPropertyNames(e).length)return!1;for(const i in t)if(!v(t[i],e[i]))return!1}else return s==="function"?t.toString()===e.toString():!1;return!0}var b=(t=>(t.neutral="neutral",t.secondary="secondary",t.positive="positive",t.warning="warning",t.error="error",t))(b||{}),p=(t=>(t.temporary="temporary",t.persistent="persistent",t))(p||{}),I=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(I||{}),T=(t=>(t.primary="primary",t.secondary="secondary",t.tertiary="tertiary",t))(T||{}),x=(t=>(t.sm="sm",t.base="base",t))(x||{}),y=(t=>(t["3xs"]="3xs",t["2xs"]="2xs",t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t))(y||{}),M=(t=>(t.top="top",t.bottom="bottom",t.left="left",t.right="right",t))(M||{}),w=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(w||{}),E=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(E||{}),F=(t=>(t.primary="primary",t.secondary="secondary",t))(F||{}),N=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(N||{}),D=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(D||{}),O=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t["2xl"]="2xl",t["3xl"]="3xl",t["4xl"]="4xl",t))(O||{}),H=(t=>(t.xs="xs",t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t))(H||{}),W=(t=>(t.sm="sm",t.base="base",t.lg="lg",t))(W||{}),C=(t=>(t.sm="sm",t.base="base",t.lg="lg",t.xl="xl",t))(C||{}),R=(t=>(t["top-start"]="top-start",t.top="top",t["top-end"]="top-end",t["bottom-start"]="bottom-start",t.bottom="bottom",t["bottom-end"]="bottom-end",t["left-start"]="left-start",t.left="left",t["left-end"]="left-end",t["right-start"]="right-start",t.right="right",t["right-end"]="right-end",t))(R||{}),U=(t=>(t.fixed="fixed",t.absolute="absolute",t))(U||{});const m=(t,e)=>e.findIndex(s=>s===t),X=(t,e)=>{const s=m(t,e);return e[s+1]},Y=(t,e)=>{const s=m(t,e);return e[s-1]},u=({focusables:t,event:e})=>{e==null||e.preventDefault();const s=t[0];return s==null||s.focus(),s},g=({focusables:t,event:e})=>{e==null||e.preventDefault();const s=t[t.length-1];return s==null||s.focus(),s},j=(t,e)=>{const s=X(t,e);return s==null||s.focus(),s},G=(t,e)=>{const s=Y(t,e);return s==null||s.focus(),s},q=(t,e)=>m(t,e)===0,A=(t,e)=>m(t,e)===e.length-1,S=(t,e,s)=>{const r=[...s].reverse(),i=r.findIndex(c=>c===t);return r.find((c,h)=>{var d;if(h>i&&c.closest(e)&&t.closest(e)!==c.closest(e)&&((d=r[h+1])==null?void 0:d.closest(e))!==c.closest(e))return c})},tt=(t,e,s)=>{const r=s.findIndex(i=>i===t);return s.find((i,c)=>{if(c>r&&i.closest(e)&&t.closest(e)!==i.closest(e))return i})},et=({current:t,focusables:e,arrowFocusGroupSelector:s})=>{if(!t)return u({focusables:e});const r=tt(t,s,e);return t&&r?(r==null||r.focus(),r):u({focusables:e})},st=({current:t,focusables:e,arrowFocusGroupSelector:s})=>{if(!t)return u({focusables:e});const r=S(t,s,e);return t&&r?(r==null||r.focus(),r):g({focusables:e})},B=({current:t,focusables:e,event:s})=>{if(f&&(s==null||s.preventDefault()),t){if(A(t,e))return u({focusables:e,event:s});if(f||!s)return j(t,e)}else return u({focusables:e,event:s})},_=({current:t,focusables:e,event:s})=>{if(f&&(s==null||s.preventDefault()),t){if(q(t,e))return g({focusables:e,event:s});if(f||!s)return G(t,e)}else return g({focusables:e,event:s})},nt=({current:t,event:e,focusables:s,arrowFocusGroupSelector:r})=>r?et({current:t,focusables:s,arrowFocusGroupSelector:r}):B({current:t,focusables:s,event:e}),rt=({current:t,focusables:e,event:s,arrowFocusGroupSelector:r})=>r?st({current:t,focusables:e,arrowFocusGroupSelector:r}):_({current:t,focusables:e,event:s});n.SFScrollable=$,n.SfAlertType=p,n.SfAlertVariant=b,n.SfButtonSize=I,n.SfButtonVariant=T,n.SfChipSize=x,n.SfCounterSize=y,n.SfDrawerPlacement=M,n.SfIconSize=E,n.SfInputSize=w,n.SfLinkVariant=F,n.SfListItemSize=N,n.SfLoaderSize=D,n.SfPopoverPlacement=R,n.SfPopoverStrategy=U,n.SfProgressSize=O,n.SfRatingSize=H,n.SfSelectSize=W,n.SfThumbnailSize=C,n.clamp=P,n.equal=v,n.findCurrentFocusableIndex=m,n.findNextFocusable=X,n.findPrevFocusable=Y,n.focusFirstElement=u,n.focusLastElement=g,n.focusNext=nt,n.focusNextElement=j,n.focusNextOrFirst=B,n.focusPrev=rt,n.focusPrevElement=G,n.focusPrevOrLast=_,n.generateId=Q,n.isBrowser=L,n.isCurrentFirstElement=q,n.isCurrentLastElement=A,n.isReduceMotionEnabled=K,n.isSafari=f,n.isTab=k,n.isTabAndShift=Z,n.noop=V,n.roundToNearest=z,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}); |
@@ -1,4 +0,4 @@ | ||
import VSFScrollable from './scrollable'; | ||
import SFScrollable from './scrollable'; | ||
export * from './types'; | ||
export { VSFScrollable }; | ||
export { SFScrollable }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import type { VsfScrollableOptions, VsfScrollableCallbackData } from './types'; | ||
export default class VSFScrollable { | ||
import type { SfScrollableOptions, SfScrollableCallbackData } from './types'; | ||
export default class SFScrollable { | ||
container: HTMLElement; | ||
@@ -17,5 +17,5 @@ private options; | ||
private mouseLeaveListenerInstance; | ||
constructor(container: Element, VsfScrollableOptions?: Partial<VsfScrollableOptions>); | ||
constructor(container: Element, SfScrollableOptions?: Partial<SfScrollableOptions>); | ||
init(): void; | ||
update(VsfScrollableOptions?: Partial<VsfScrollableOptions>): void; | ||
update(SfScrollableOptions?: Partial<SfScrollableOptions>): void; | ||
destroy(): void; | ||
@@ -25,3 +25,3 @@ prev(): void; | ||
scrollToIndex(index: number): void; | ||
refresh(callback?: (data: VsfScrollableCallbackData) => void): void; | ||
refresh(callback?: (data: SfScrollableCallbackData) => void): void; | ||
private onMouseUp; | ||
@@ -28,0 +28,0 @@ private onMouseLeave; |
@@ -1,2 +0,2 @@ | ||
export type VsfScrollableOptions = { | ||
export type SfScrollableOptions = { | ||
reduceMotion?: boolean; | ||
@@ -8,5 +8,5 @@ snap?: boolean; | ||
vertical?: boolean; | ||
onScroll?: (data: VsfScrollableCallbackData) => void; | ||
onScroll?: (data: SfScrollableCallbackData) => void; | ||
}; | ||
export type VsfScrollableCallbackData = { | ||
export type SfScrollableCallbackData = { | ||
left: number; | ||
@@ -13,0 +13,0 @@ width: number; |
@@ -1,4 +0,17 @@ | ||
export * from './VsfAlert'; | ||
export * from './VsfFooter'; | ||
export * from './VsfLoader'; | ||
export * from './SfAlert'; | ||
export * from './SfButton'; | ||
export * from './SfChip'; | ||
export * from './SfCounter'; | ||
export * from './SfDrawer'; | ||
export * from './SfInput'; | ||
export * from './SfIconBase'; | ||
export * from './SfLink'; | ||
export * from './SfListItem'; | ||
export * from './SfLoader'; | ||
export * from './SfProgress'; | ||
export * from './SfRating'; | ||
export * from './SfSelect'; | ||
export * from './SfThumbnail'; | ||
export * from './usePopover'; | ||
export * from './utils'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@storefront-ui/shared", | ||
"description": "Shared set of utils and typings used by `@storefront-ui/*` packages", | ||
"version": "2.0.0-rc.3-3", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.es.js", | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.umd.js" | ||
@@ -14,3 +16,3 @@ }, | ||
"source": "index.ts", | ||
"main": "dist/index.es.js", | ||
"main": "dist/index.mjs", | ||
"unpkg": "dist/index.umd.js", | ||
@@ -20,12 +22,5 @@ "types": "dist/index.d.ts", | ||
"dev": "vite build --watch", | ||
"dev:shared": "vite build --watch", | ||
"build:shared": "vite build" | ||
}, | ||
"homepage": "https://docs.storefrontui.io/v2/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vuestorefront/sfui2.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vuestorefront/sfui2/issues" | ||
}, | ||
"devDependencies": { | ||
@@ -42,5 +37,13 @@ "tabbable": "^6.1.1", | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
] | ||
"dist" | ||
], | ||
"homepage": "https://docs.storefrontui.io/v2/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/vuestorefront/storefront-ui.git", | ||
"directory": "packages/sfui/shared" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/vuestorefront/storefront-ui/issues" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
44341
63
0
612
1
0
1