@planningcenter/tapestry-react 4.4.0 → 4.4.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"InputBox.d.ts","sourceRoot":"","sources":["../../src/Input/InputBox.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEZ,SAAS,EAET,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,gBAAgB,EAAY,MAAM,UAAU,CAAA;AAOrD,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAKxD,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAI3C,eAAe,CAAC,EAAE,MAAM,CAAA;IAKxB,QAAQ,CAAC,EAAE,SAAS,CAAA;IAMpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAMlB,WAAW,CAAC,EAAE,OAAO,CAAA;IAKrB,eAAe,CAAC,EAAE,MAAM,CAAA;IAOxB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAK9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAMpB,cAAc,CAAC,EAAE,OAAO,CAAA;IAKxB,QAAQ,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAA;IAKxC,SAAS,CAAC,EAAE,OAAO,CAAA;IAKnB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAEzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAKlB,UAAU,CAAC,EACP,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,KAAK,YAAY,CAAC,GAC3D,YAAY,CAAA;IAKhB,WAAW,CAAC,EACR,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,G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W,SAAmB;IAErC,IAAI,EAAE,gBAAgB,CAAA;gBAEV,KAAK,KAAA;IAWjB,oBAAoB;IAMpB,OAAO,SAAU,gBAAgB,UAKhC;IAED,YAAY,YAGX;IAED,KAAK,2BAWJ;IAED,IAAI,aAMH;IAED,WAAW,mBAUV;IAED,UAAU,mBAKT;IAED,WAAW,mBAKV;IAED,eAAe,mBAKd;IAED,cAAc,mBAKb;IAED,oBAAoB,aAEnB;IAED,MAAM;CAgNP;AAED,eAAe,QAAQ,CAAA"}
@@ -1,2 +1,2 @@
1
- import{__extends as e,__rest as o,__assign as r}from'./../ext/tslib/tslib.es6.js';import n,{cloneElement as t,Component as i}from"react";import{tabbable as s}from"tabbable";import{Box as a}from"../Box/Box.js";import{Button as l}from"../Button/Button.js";import{designTokens as u}from"../designTokens/index.js";import{useDocumentEvent as d}from"../hooks/use-document-event.js";import"mousetrap";import"../hooks/use-measure.js";import{Spinner as c}from"../Spinner/Spinner.js";import{StackView as p}from"../StackView/StackView.js";import{getBoxSize as f}from"../system/box-sizes.js";import"../system/colors/colors.js";import"polished";import"../utils.js";import"lodash/includes";import"@emotion/react";import"lodash/get";import"@planningcenter/icons/paths/general";import"@planningcenter/icons/paths/tapestry";import"../system/style-names.js";import"../system/cxs.js";import b from"./InputContext.js";import{isTabbable as m,inputs as g}from"./utils.js";function h(e){var o=e.onEscape;return d("keydown",(function(e){27===e.keyCode&&o()})),null}var v=function(i){function d(e){var o=i.call(this,e)||this;return Object.defineProperty(o,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"setNode",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.node=e,o.props.innerRef&&o.props.innerRef(e)}}),Object.defineProperty(o,"getBoxStyles",{enumerable:!0,configurable:!0,writable:!0,value:function(){return f(o.props.size)}}),Object.defineProperty(o,"focus",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=o.props.focusChildIndex);var r=o.node;if(r&&void 0!==e){var n=s(r);n.length>0&&(r=n[e])}r&&r.focus&&r.focus()}}),Object.defineProperty(o,"blur",{enumerable:!0,configurable:!0,writable:!0,value:function(){m(o.node)?o.node.blur():o.setState({isFocused:!1})}}),Object.defineProperty(o,"handleFocus",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.focusChildrenOnFocus&&e.target===o.node&&o.focus(),o.props.onFocus&&o.props.onFocus(e),o.setState({isFocused:!0})}}),Object.defineProperty(o,"handleBlur",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onBlur&&o.props.onBlur(e),o.setState({isFocused:!1})}}),Object.defineProperty(o,"handleClear",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onClear&&o.props.onClear(e),o.focus()}}),Object.defineProperty(o,"handleMouseOver",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onMouseOver&&o.props.onMouseOver(e),o.setState({isHovered:!0})}}),Object.defineProperty(o,"handleMouseOut",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onMouseOut&&o.props.onMouseOut(e),o.setState({isHovered:!1})}}),Object.defineProperty(o,"handleDocumentEscape",{enumerable:!0,configurable:!0,writable:!0,value:function(){o.props.onClear()}}),e.id&&(g[e.id]=o),o.state={isFocused:!1,isHovered:!1},o}return e(d,i),Object.defineProperty(d.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.id&&delete g[this.props.id]}}),Object.defineProperty(d.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,i=e.backgroundColor,s=void 0===i?"surface":i,d=e.children,f=e.disabled,m=e.evenPadding;e.focusChildIndex,e.focusChildrenOnFocus;var g=e.id;e.innerRef;var v=e.includeSpacing,y=e.isLoading,O=e.naked,j=e.onClear;e.onBlur,e.onFocus;var x=e.readOnly,k=void 0!==x&&x,C=e.renderLeft,w=e.renderRight,S=e.secondaryStroke,P=void 0===S||S,F=e.size,z=e.state,B=e.subdued,I=e.tabIndex,R=void 0===I?-1:I,E=o(e,["backgroundColor","children","disabled","evenPadding","focusChildIndex","focusChildrenOnFocus","id","innerRef","includeSpacing","isLoading","naked","onClear","onBlur","onFocus","readOnly","renderLeft","renderRight","secondaryStroke","size","state","subdued","tabIndex"]),H=this.state,M=H.isFocused,L=H.isHovered,V=this.getBoxStyles(),N=V.boxSize,A=V.fontSize,T=V.lineHeight,W=V.paddingHorizontal,D={backgroundColor:s,fontSize:A,lineHeight:T,paddingVertical:V.paddingVertical,tabIndex:R,zIndex:M||L?2:1},U={},Z={alignItems:"center",display:"flex",height:"100%",justifyContent:"center",position:"absolute",top:0,width:N},_=C?N:W,q=w?N:W;return"pill"===E.radius||"pill-left"===E.radius?(D.paddingLeft=_,D.paddingRight=q):(E.radius,D.paddingLeft=_,D.paddingRight=q),(y||j)&&(D.paddingRight=N),k?D.backgroundColor=u.input.readOnlyBackgroundColor:B?D.backgroundColor=!f&&M?"highlightSecondary":!f&&L?z?"".concat(z,"-1"):"highlight":z?"".concat(z,"-0"):"surfaceTertiary":O||(P&&(D.boxShadow=!f&&M?"0px 0px 0px 2px var(--colors-separator-focus-secondary)":void 0),D.strokeAlign="inside",D.strokeWeight=1,D.stroke=!f&&M?z||"separatorFocus":z||(!f&&L?"separatorHover":"separatorSecondary")),g&&(D["aria-labelledby"]="".concat(g,"-label")),m&&(D.paddingLeft=D.paddingVertical,D.paddingRight=D.paddingVertical),v&&(D.spacing=m?D.paddingVertical:W),f?(U.cursor="not-allowed",D.tabIndex=void 0,U.opacity=.64):O||(L&&E.hover&&Object.assign(E,E.hover),M&&E.focus&&Object.assign(E,E.focus),E=r(r({},E),{focus:r({strokeAlign:"inside",strokeWeight:1},E.focus),hover:r({strokeAlign:"inside",strokeWeight:1},E.hover)})),n.createElement(b.Provider,{value:this},n.createElement(p,r({innerRef:this.setNode,id:g,axis:p.HORIZONTAL,alignment:p.CENTER,shrink:0,minHeight:N,radius:u.input.borderRadius,position:"relative",cursor:"text",outline:0,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut},D,E,U),C&&n.createElement(a,r({},Z,{left:0}),"function"==typeof C?C(F):t(C,{size:C.props&&C.props.size||F})),d,(y||j||w)&&n.createElement(a,r({},Z,{right:0}),y?n.createElement(c,{size:F}):j?n.createElement(l,{icon:{name:"general.x"},title:"clear input value",size:F,theme:!1,onClick:this.handleClear}):"function"==typeof w?w(F):w?t(w,{size:w.props&&w.props.size||F}):null),j&&n.createElement(h,{onEscape:this.handleDocumentEscape})))}}),Object.defineProperty(d,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{focusChildIndex:0,focusChildrenOnFocus:!0,size:"md"}}),Object.defineProperty(d,"displayName",{enumerable:!0,configurable:!0,writable:!0,value:"Input.InputBox"}),d}(i);export{v as default};
1
+ import{__extends as e,__rest as o,__assign as r}from'./../ext/tslib/tslib.es6.js';import n,{cloneElement as t,Component as i}from"react";import{tabbable as a}from"tabbable";import{Box as s}from"../Box/Box.js";import{Button as l}from"../Button/Button.js";import{designTokens as u}from"../designTokens/index.js";import{useDocumentEvent as d}from"../hooks/use-document-event.js";import"mousetrap";import"../hooks/use-measure.js";import{Spinner as c}from"../Spinner/Spinner.js";import{StackView as p}from"../StackView/StackView.js";import{getBoxSize as f}from"../system/box-sizes.js";import"../system/colors/colors.js";import"polished";import"../utils.js";import"lodash/includes";import"@emotion/react";import"lodash/get";import"@planningcenter/icons/paths/general";import"@planningcenter/icons/paths/tapestry";import"../system/style-names.js";import"../system/cxs.js";import b from"./InputContext.js";import{isTabbable as m,inputs as g}from"./utils.js";function h(e){var o=e.onEscape;return d("keydown",(function(e){27===e.keyCode&&o()})),null}var v=function(i){function d(e){var o=i.call(this,e)||this;return Object.defineProperty(o,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"setNode",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.node=e,o.props.innerRef&&o.props.innerRef(e)}}),Object.defineProperty(o,"getBoxStyles",{enumerable:!0,configurable:!0,writable:!0,value:function(){return f(o.props.size)}}),Object.defineProperty(o,"focus",{enumerable:!0,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=o.props.focusChildIndex);var r=o.node;if(r&&void 0!==e){var n=a(r);n.length>0&&(r=n[e])}r&&r.focus&&r.focus()}}),Object.defineProperty(o,"blur",{enumerable:!0,configurable:!0,writable:!0,value:function(){m(o.node)?o.node.blur():o.setState({isFocused:!1})}}),Object.defineProperty(o,"handleFocus",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.focusChildrenOnFocus&&e.target===o.node&&o.focus(),o.props.onFocus&&o.props.onFocus(e),o.setState({isFocused:!0})}}),Object.defineProperty(o,"handleBlur",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onBlur&&o.props.onBlur(e),o.setState({isFocused:!1})}}),Object.defineProperty(o,"handleClear",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onClear&&o.props.onClear(e),o.focus()}}),Object.defineProperty(o,"handleMouseOver",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onMouseOver&&o.props.onMouseOver(e),o.setState({isHovered:!0})}}),Object.defineProperty(o,"handleMouseOut",{enumerable:!0,configurable:!0,writable:!0,value:function(e){o.props.onMouseOut&&o.props.onMouseOut(e),o.setState({isHovered:!1})}}),Object.defineProperty(o,"handleDocumentEscape",{enumerable:!0,configurable:!0,writable:!0,value:function(){o.props.onClear()}}),e.id&&(g[e.id]=o),o.state={isFocused:!1,isHovered:!1},o}return e(d,i),Object.defineProperty(d.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.props.id&&delete g[this.props.id]}}),Object.defineProperty(d.prototype,"render",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,i=e.backgroundColor,a=void 0===i?"surface":i,d=e.children,f=e.disabled,m=e.evenPadding;e.focusChildIndex,e.focusChildrenOnFocus;var g=e.id;e.innerRef;var v=e.includeSpacing,y=e.isLoading,O=e.naked,j=e.onClear;e.onBlur,e.onFocus;var x=e.readOnly,k=void 0!==x&&x,C=e.renderLeft,w=e.renderRight,S=e.secondaryStroke,P=void 0===S||S,F=e.size,z=e.state,B=e.subdued,I=e.tabIndex,R=void 0===I?-1:I,E=o(e,["backgroundColor","children","disabled","evenPadding","focusChildIndex","focusChildrenOnFocus","id","innerRef","includeSpacing","isLoading","naked","onClear","onBlur","onFocus","readOnly","renderLeft","renderRight","secondaryStroke","size","state","subdued","tabIndex"]),H=this.state,M=H.isFocused,L=H.isHovered,V=this.getBoxStyles(),N=V.boxSize,A=V.fontSize,T=V.lineHeight,W=V.paddingHorizontal,D={backgroundColor:a,fontSize:A,lineHeight:T,paddingVertical:V.paddingVertical,tabIndex:R,zIndex:M||L?2:1},U={},Z={alignItems:"center",display:"flex",height:"100%",justifyContent:"center",position:"absolute",top:0,width:N},_=C?N:W,q=w?N:W;return"pill"===E.radius||"pill-left"===E.radius?(D.paddingLeft=_,D.paddingRight=q):(E.radius,D.paddingLeft=_,D.paddingRight=q),(y||j)&&(D.paddingRight=N),k?D.backgroundColor=u.input.readOnlyBackgroundColor:B?D.backgroundColor=!f&&M?"highlightSecondary":!f&&L?z?"".concat(z,"-1"):"highlight":z?"".concat(z,"-0"):"surfaceTertiary":O||(P&&(D.boxShadow=!f&&M?"0px 0px 0px 2px var(--colors-separator-focus-secondary)":void 0),D.strokeAlign="inside",D.strokeWeight=1,D.stroke=!f&&M?z||"separatorFocus":z||(!f&&L?"separatorHover":"separatorSecondary")),g&&(D["aria-labelledby"]="".concat(g,"-label")),m&&(D.paddingLeft=D.paddingVertical,D.paddingRight=D.paddingVertical),v&&(D.spacing=m?D.paddingVertical:W),f?(U.cursor="not-allowed",D.tabIndex=void 0,U.opacity=.64):O||(L&&E.hover&&Object.assign(E,E.hover),M&&E.focus&&Object.assign(E,E.focus),E=r(r({},E),{focus:r({strokeAlign:"inside",strokeWeight:1},E.focus),hover:r({strokeAlign:"inside",strokeWeight:1},E.hover)})),n.createElement(b.Provider,{value:this},n.createElement(p,r({innerRef:this.setNode,id:g,axis:p.HORIZONTAL,alignment:p.CENTER,shrink:0,minHeight:N,radius:u.input.borderRadius,readOnly:k,position:"relative",cursor:"text",outline:0,onFocus:this.handleFocus,onBlur:this.handleBlur,onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut},D,E,U),C&&n.createElement(s,r({},Z,{left:0}),"function"==typeof C?C(F):t(C,{size:C.props&&C.props.size||F})),d,(y||j||w)&&n.createElement(s,r({},Z,{right:0}),y?n.createElement(c,{size:F}):j?n.createElement(l,{icon:{name:"general.x"},title:"clear input value",size:F,theme:!1,onClick:this.handleClear}):"function"==typeof w?w(F):w?t(w,{size:w.props&&w.props.size||F}):null),j&&n.createElement(h,{onEscape:this.handleDocumentEscape})))}}),Object.defineProperty(d,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{focusChildIndex:0,focusChildrenOnFocus:!0,size:"md"}}),Object.defineProperty(d,"displayName",{enumerable:!0,configurable:!0,writable:!0,value:"Input.InputBox"}),d}(i);export{v as default};
2
2
  //# sourceMappingURL=InputBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PagerView.d.ts","sourceRoot":"","sources":["../../src/PagerView/PagerView.tsx"],"names":[],"mappings":"AAcA,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAoCxD,KAAK,KAAK,GAAG;IAIX,eAAe,CAAC,EAAE,MAAM,CAAA;IAIxB,SAAS,CAAC,EAAE,OAAO,CAAA;IAInB,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAIhC,OAAO,CAAC,EAAE,MAAM,CAAA;IAIhB,WAAW,CAAC,EAAE,MAAM,CAAA;IAIpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AACD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,KAAK,CAAC,CAAA;AAEvD,KAAK,cAAc,GAAG,KAAK,GAAG,cAAc,CAAA;AAE5C,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,eA2IvC;kBA3IQ,SAAS;;;;UAmJqC,OAAO,UAAU,IAAI;;AAA5E,wBAA8E"}
1
+ {"version":3,"file":"PagerView.d.ts","sourceRoot":"","sources":["../../src/PagerView/PagerView.tsx"],"names":[],"mappings":"AAeA,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAoCxD,KAAK,KAAK,GAAG;IAIX,eAAe,CAAC,EAAE,MAAM,CAAA;IAIxB,SAAS,CAAC,EAAE,OAAO,CAAA;IAInB,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAIhC,OAAO,CAAC,EAAE,MAAM,CAAA;IAIhB,WAAW,CAAC,EAAE,MAAM,CAAA;IAIpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AACD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,KAAK,CAAC,CAAA;AAEvD,KAAK,cAAc,GAAG,KAAK,GAAG,cAAc,CAAA;AAE5C,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,eA+IvC;kBA/IQ,SAAS;;;;UAuJqC,OAAO,UAAU,IAAI;;AAA5E,wBAA8E"}
@@ -1,2 +1,2 @@
1
- import{__rest as r,__assign as e,__spreadArray as n}from'./../ext/tslib/tslib.es6.js';import{clamp as t}from"@popmotion/popcorn";import i,{createContext as o,Children as c,useRef as u,useLayoutEffect as a,useContext as s}from"react";import f from"stylefire";import{tabbable as l}from"tabbable";import p from"tiny-spring";import{GridView as v}from"../GridView/GridView.js";import{useMeasure as d}from"../hooks/use-measure.js";import{StackView as m}from"../StackView/StackView.js";import{range as w}from"../utils.js";function g(r){var e=r.direction,n=void 0===e?1:e,t=r.multiplier,i=void 0===t?null:t,o=r.spacing,c=void 0===o?0:o,u=r.viewsToShow,a=void 0===u?1:u,s=100/a*n,f=((c*=8)-c/a)*n;return null!==i&&(s*=i,f=f*i-c*n*i),1===a&&0===c&&(f=0),{spacingSize:f,viewSize:s}}function h(r){var e=r.viewSize,n=r.spacingSize;return"calc(".concat(e,"% - ").concat(n,"px)")}var S=o((function(){}));function z(o){var s,z=o.axis,x=void 0===z?"horizontal":z,T=o.activeViewIndex,b=o.viewsToShow,V=void 0===b?1:b,y=o.viewsToMove,E=void 0===y?1:y,j=o.spacing,R=void 0===j?0:j,F=o.autoFocus,I=void 0!==F&&F,M=o.children,k=r(o,["axis","activeViewIndex","viewsToShow","viewsToMove","spacing","autoFocus","children"]),A="horizontal"===x,C=c.count(M),G=t(0,C-V,T*E),U=w(0,V).map((function(r){return G+r})),B="horizontal"===x?"height":"width",P=u(),_=u(),q=e({innerRef:P,overflow:"hidden"},k),D=u(),H=u(),J=d(),K=J[0];(0,J[1])((function(r){var e=r.map((function(r){return r.getBoundingClientRect()})),n=Math.max.apply(Math,U.map((function(r){var n=e[r];return n?n[B]:-1})));if(_.current){var t=p(_.current.get(B),{damping:50,stiffness:500});return t.onUpdate((function(r){return _.current.set(B,r)})),t.transitionTo(n),function(){return t.destroy()}}_.current=f(P.current),_.current.set(B,n),_.current.render()}),[T,V]),a((function(){var r,e=A?"x":"y",n=g({direction:-1,multiplier:G,spacing:R,viewsToShow:V});if(H.current){var t=(r=H.current.get(e),parseFloat(r.includes("calc")?r.split("(")[1].split("%")[0]:r)),i=p(t,{damping:50,stiffness:500});return i.onUpdate((function(r){H.current.set(e,h({spacingSize:n.spacingSize,viewSize:r}))})),i.transitionTo(n.viewSize),function(){return i.destroy()}}H.current=f(D.current),H.current.set(e,h(n)),H.current.render()}),[G,R,V]);var L=u([]);return a((function(){L.current.forEach((function(r){return r.tabIndex=0})),L.current=[];for(var r=0;r<C;r++){var e=l(D.current.children[r]);if(I&&r===G){var t=e[0];t&&t.focus({preventScroll:!0})}U.includes(r)||e.forEach((function(r){return r.tabIndex=-1})),L.current=n(n([],L.current,!0),e,!0)}}),[G,V]),i.createElement(m,e({},q),i.createElement(v,((s={alignment:A?"start":"stretch",autoFlow:A?"column":"row",innerRef:D,spacing:R})[A?"gridAutoColumns":"gridAutoRows"]=h(g({spacing:R,viewsToShow:V})),s),i.createElement(S.Provider,{value:K},M)))}z.View=function(r){var n=s(S)();return i.createElement(m,e({innerRef:n},r))};export{z as default};
1
+ import{__rest as r,__assign as e,__spreadArray as n}from'./../ext/tslib/tslib.es6.js';import{clamp as t}from"@popmotion/popcorn";import i,{createContext as o,Children as c,useRef as u,useCallback as a,useLayoutEffect as s,useContext as f}from"react";import l from"stylefire";import{tabbable as v}from"tabbable";import p from"tiny-spring";import{GridView as d}from"../GridView/GridView.js";import{useMeasure as m}from"../hooks/use-measure.js";import{StackView as w}from"../StackView/StackView.js";import{range as h}from"../utils.js";function g(r){var e=r.direction,n=void 0===e?1:e,t=r.multiplier,i=void 0===t?null:t,o=r.spacing,c=void 0===o?0:o,u=r.viewsToShow,a=void 0===u?1:u,s=100/a*n,f=((c*=8)-c/a)*n;return null!==i&&(s*=i,f=f*i-c*n*i),1===a&&0===c&&(f=0),{spacingSize:f,viewSize:s}}function S(r){var e=r.viewSize,n=r.spacingSize;return"calc(".concat(e,"% - ").concat(n,"px)")}var z=o((function(){}));function x(o){var f,x=o.axis,T=void 0===x?"horizontal":x,b=o.activeViewIndex,V=o.viewsToShow,y=void 0===V?1:V,E=o.viewsToMove,R=void 0===E?1:E,j=o.spacing,F=void 0===j?0:j,I=o.autoFocus,M=void 0!==I&&I,k=o.children,A=r(o,["axis","activeViewIndex","viewsToShow","viewsToMove","spacing","autoFocus","children"]),C="horizontal"===T,G=c.count(k),U=t(0,G-y,b*R),B=h(0,y).map((function(r){return U+r})),P="horizontal"===T?"height":"width",_=u(),q=u(),D=e({innerRef:_,overflow:"hidden"},A),H=u(),J=u(),K=m(),L=K[0];(0,K[1])((function(r){var e=r.map((function(r){return r.getBoundingClientRect()})),n=Math.max.apply(Math,B.map((function(r){var n=e[r];return n?n[P]:-1})));if(q.current){var t=p(q.current.get(P),{damping:50,stiffness:500});return t.onUpdate((function(r){return q.current.set(P,r)})),t.transitionTo(n),function(){return t.destroy()}}q.current=l(_.current),q.current.set(P,n),q.current.render()}),[b,y]);var N=a((function(){var r=v(H.current.children[U])[0];null==r||r.focus({preventScroll:!0})}),[U]);s((function(){M&&N()}),[]),s((function(){var r,e=C?"x":"y",n=g({direction:-1,multiplier:U,spacing:F,viewsToShow:y});if(J.current){var t=(r=J.current.get(e),parseFloat(r.includes("calc")?r.split("(")[1].split("%")[0]:r)),i=p(t,{damping:50,stiffness:500});return i.onUpdate((function(r){J.current.set(e,S({spacingSize:n.spacingSize,viewSize:r}))})),i.transitionTo(n.viewSize),i.onRest((function(){return M&&N()})),function(){return i.destroy()}}J.current=l(H.current),J.current.set(e,S(n)),J.current.render()}),[U,F,y]);var O=u([]);return s((function(){O.current.forEach((function(r){return r.tabIndex=0})),O.current=[];for(var r=0;r<G;r++){var e=v(H.current.children[r]);B.includes(r)||e.forEach((function(r){return r.tabIndex=-1})),O.current=n(n([],O.current,!0),e,!0)}}),[U,y]),i.createElement(w,e({},D),i.createElement(d,((f={alignment:C?"start":"stretch",autoFlow:C?"column":"row",innerRef:H,spacing:F})[C?"gridAutoColumns":"gridAutoRows"]=S(g({spacing:F,viewsToShow:y})),f),i.createElement(z.Provider,{value:L},k)))}x.View=function(r){var n=f(z)();return i.createElement(w,e({innerRef:n},r))};export{x as default};
2
2
  //# sourceMappingURL=PagerView.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/tapestry-react",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "A collection of flexible React components to help you build resilient, accessible user interfaces quickly and effectively.",
5
5
  "author": "Front End Systems Engineering <frontend@pco.bz>",
6
6
  "main": "./dist/index.js",