@planningcenter/tapestry-react 4.3.1-rc.0 → 4.3.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.
@@ -8,6 +8,7 @@ type TimeFieldProps = ComponentProps<typeof Input> & ComponentProps<typeof Input
8
8
  interval?: number;
9
9
  isIOS?: boolean;
10
10
  max?: number;
11
+ meridiemOffset?: number;
11
12
  min?: number;
12
13
  onChange: (hoursAndMinutes: [number, number]) => void;
13
14
  twelveHourClock?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../src/TimeField/TimeField.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,cAAc,EAKf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAIxC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,GAChD,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IAKhC,UAAU,CAAC,EAAE,OAAO,CAAA;IAMpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IAEtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAKjB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,GAAG,CAAC,EAAE,MAAM,CAAA;IAKZ,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAA;IAKrD,eAAe,CAAC,EAAE,OAAO,CAAA;IAMzB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxB,CAAA;AASH,QAAA,MAAM,SAAS;oDAIZ,cAAc;;;;;CAKd,CAAA;AAOH,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"TimeField.d.ts","sourceRoot":"","sources":["../../src/TimeField/TimeField.tsx"],"names":[],"mappings":"AAAA,OAAc,EACZ,cAAc,EAKf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,MAAM,gBAAgB,CAAA;AAClC,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AAIxC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,GAChD,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IAKhC,UAAU,CAAC,EAAE,OAAO,CAAA;IAMpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IAEtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAKjB,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf,GAAG,CAAC,EAAE,MAAM,CAAA;IAKZ,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,GAAG,CAAC,EAAE,MAAM,CAAA;IAKZ,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAA;IAKrD,eAAe,CAAC,EAAE,OAAO,CAAA;IAMzB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACxB,CAAA;AASH,QAAA,MAAM,SAAS;oDAIZ,cAAc;;;;;CAKd,CAAA;AAOH,eAAe,SAAS,CAAA"}
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as n}from'./../ext/tslib/tslib.es6.js';import t,{useState as r,useRef as o,useMemo as i}from"react";import{Box as a}from"../Box/Box.js";import u from"../Input/Input.js";import c from"../Input/InputBox.js";import l from"../Input/InputField.js";import d from"../NumberField/NumberField.js";import{padNumber as f,noop as m}from"../utils.js";import{addHoursToTime as s,addMinutesToTime as v,addTimeToDate as p,getTimeFromDate as w}from"./utils.js";var y="undefined"!=typeof window&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),g=function(r){var o=r.twelveHourClock,i=void 0===o||o,a=r.controlled,u=void 0!==a&&a,c=e(r,["twelveHourClock","controlled"]);return u?t.createElement(k,n({twelveHourClock:i},c)):t.createElement(h,n({twelveHourClock:i},c))};g.addHoursToTime=s,g.addMinutesToTime=v,g.addTimeToDate=p,g.getTimeFromDate=w;var h=function(o){var i=o.value,a=e(o,["value"]),u=r(i),c=u[0],l=u[1];return t.createElement(k,n({},a,{onChange:l,value:c}))},k=function(r){var s=r.ignoredKeys;r.interval;var v=r.isIOS,p=void 0!==v&&v;r.max,r.min;var w=r.onChange,g=r.twelveHourClock,h=r.value,k=e(r,["ignoredKeys","interval","isIOS","max","min","onChange","twelveHourClock","value"]),A=o(null),C=h[0],I=h[1],x=i((function(){return C<12?"AM":"PM"}),[C]),M=g&&"PM"===x?12:0,b=i((function(){return g?0===C?12:C>12?C-12:C:C}),[C]),D=function(e){var n=C-e;w(n<0?function(e){return[23,e[1]]}:function(e){return[n,e[1]]})},E=function(e){var n=C+e;w((function(e){return[n%24,e[1]]}))};return y||p?t.createElement(u,n({},k,{type:"time",autoWidth:"".concat(C,":").concat(f(I,2)," ").concat(x),value:"".concat(f(C,2),":").concat(f(I,2)),onChange:function(e){var n=e.target.value.split(":"),t=n[0],r=n[1];w(t||r?[parseInt(t,10),parseInt(r,10)]:[0,0])}})):t.createElement(c,n({ref:A,inline:!0},k),t.createElement(d,{"aria-label":"Hours",autoWidth:!1,fontVariantNumeric:"tabular-nums",grow:0,max:g?12:23,min:0,moveFocusOnMax:!0,onBlur:function(e){var n=parseInt(e.target.value,10);w((function(e){return[n+M,e[1]]}))},onChange:function(e){var n="string"==typeof e?parseInt(e,10):e;w((function(e){return[n+M,e[1]]}))},onKeyDown:function(e){var n;s&&s.includes(e.key)||("Backspace"===e.key&&e.preventDefault(),"ArrowRight"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[2]).focus(),"ArrowUp"===e.key&&E(1),"ArrowDown"===e.key&&D(1))},pad:2,textAlign:"center",value:b,width:"2ch",ignoredKeys:s}),t.createElement(a,{as:"span",width:.5,textAlign:"center",userSelect:"none"},":"),t.createElement(d,{"aria-label":"Minutes",autoWidth:!1,fontVariantNumeric:"tabular-nums",grow:0,max:59,min:0,moveFocusOnMax:!0,onChange:function(e){return w((function(n){return[n[0],"string"==typeof e?parseInt(e,10):e]}))},onKeyDown:function(e){var n,t,r;"ArrowLeft"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[0]).focus(),"ArrowRight"===e.key&&(null===(t=A.current)||void 0===t?void 0:t.node.children[3]).focus(),"ArrowUp"===e.key&&((r=I+1)<=59?w((function(e){return[e[0],r]})):(w((function(e){return[e[0],0]})),E(1))),"ArrowDown"===e.key&&function(e){var n=I-e;n>=0?w((function(e){return[e[0],n]})):(w((function(e){return[e[0],59]})),D(1))}(1)},pad:2,textAlign:"center",value:I,width:"2ch",ignoredKeys:s}),g&&t.createElement(l,{"aria-label":"AM/PM",grow:0,highlightOnInteraction:!0,onChange:m,onKeyDown:function(e){var n;s&&s.includes(e.key)||("Tab"===e.key||e.metaKey&&"r"===e.key||e.preventDefault(),"ArrowLeft"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[2]).focus(),("a"===e.key.toLowerCase()&&"PM"===x||"p"===e.key.toLowerCase()&&"AM"===x||"ArrowUp"===e.key||"ArrowDown"===e.key)&&w("AM"===x?function(e){return[e[0]+12,e[1]]}:function(e){return[e[0]-12,e[1]]}))},textAlign:"center",value:x,width:"2em"}))};export{g as default};
1
+ import{__rest as e,__assign as n}from'./../ext/tslib/tslib.es6.js';import r,{useState as t,useRef as o,useMemo as i}from"react";import{Box as u}from"../Box/Box.js";import a from"../Input/Input.js";import l from"../Input/InputBox.js";import c from"../Input/InputField.js";import d from"../NumberField/NumberField.js";import{padNumber as v,noop as f}from"../utils.js";import{addHoursToTime as s,addMinutesToTime as m,addTimeToDate as p,getTimeFromDate as w}from"./utils.js";var y="undefined"!=typeof window&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),g=function(t){var o=t.twelveHourClock,i=void 0===o||o,u=t.controlled,a=void 0!==u&&u,l=e(t,["twelveHourClock","controlled"]);return a?r.createElement(k,n({twelveHourClock:i},l)):r.createElement(h,n({twelveHourClock:i},l))};g.addHoursToTime=s,g.addMinutesToTime=m,g.addTimeToDate=p,g.getTimeFromDate=w;var h=function(o){var i=o.value,u=e(o,["value"]),a=t(i),l=a[0],c=a[1];return r.createElement(k,n({},u,{onChange:c,value:l}))},k=function(t){var s=t.ignoredKeys;t.interval;var m=t.isIOS,p=void 0!==m&&m;t.max,t.min;var w=t.onChange,g=t.twelveHourClock,h=t.value,k=e(t,["ignoredKeys","interval","isIOS","max","min","onChange","twelveHourClock","value"]),A=o(null),C=h[0],I=h[1],x=i((function(){return C<12?"AM":"PM"}),[C]),M=function(e){var n=e.hours;return e.twelveHourClock&&12!==n?0===n?-12:n>12?12:0:0}({hours:C,twelveHourClock:g}),b=i((function(){return g?0===C?12:C>12?C-12:C:C}),[C]),D=function(e){var n=C-e;w(n<0?function(e){return[23,e[1]]}:function(e){return[n,e[1]]})},E=function(e){var n=C+e;w((function(e){return[n%24,e[1]]}))};return y||p?r.createElement(a,n({},k,{type:"time",autoWidth:"".concat(C,":").concat(v(I,2)," ").concat(x),value:"".concat(v(C,2),":").concat(v(I,2)),onChange:function(e){var n=e.target.value.split(":"),r=n[0],t=n[1];w(r||t?[parseInt(r,10),parseInt(t,10)]:[0,0])}})):r.createElement(l,n({ref:A,inline:!0},k),r.createElement(d,{"aria-label":"Hours",autoWidth:!1,fontVariantNumeric:"tabular-nums",grow:0,max:g?12:23,min:0,moveFocusOnMax:!0,onBlur:function(e){var n=parseInt(e.target.value,10);w((function(e){return[n+M,e[1]]}))},onChange:function(e){var n="string"==typeof e?parseInt(e,10):e;w((function(e){return[n+M,e[1]]}))},onKeyDown:function(e){var n;s&&s.includes(e.key)||("Backspace"===e.key&&e.preventDefault(),"ArrowRight"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[2]).focus(),"ArrowUp"===e.key&&E(1),"ArrowDown"===e.key&&D(1))},pad:2,textAlign:"center",value:b,width:"2ch",ignoredKeys:s}),r.createElement(u,{as:"span",width:.5,textAlign:"center",userSelect:"none"},":"),r.createElement(d,{"aria-label":"Minutes",autoWidth:!1,fontVariantNumeric:"tabular-nums",grow:0,max:59,min:0,moveFocusOnMax:!0,onChange:function(e){return w((function(n){return[n[0],"string"==typeof e?parseInt(e,10):e]}))},onKeyDown:function(e){var n,r,t;"ArrowLeft"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[0]).focus(),"ArrowRight"===e.key&&(null===(r=A.current)||void 0===r?void 0:r.node.children[3]).focus(),"ArrowUp"===e.key&&((t=I+1)<=59?w((function(e){return[e[0],t]})):(w((function(e){return[e[0],0]})),E(1))),"ArrowDown"===e.key&&function(e){var n=I-e;n>=0?w((function(e){return[e[0],n]})):(w((function(e){return[e[0],59]})),D(1))}(1)},pad:2,textAlign:"center",value:I,width:"2ch",ignoredKeys:s}),g&&r.createElement(c,{"aria-label":"AM/PM",grow:0,highlightOnInteraction:!0,onChange:f,onKeyDown:function(e){var n;s&&s.includes(e.key)||("Tab"===e.key||e.metaKey&&"r"===e.key||e.preventDefault(),"ArrowLeft"===e.key&&(null===(n=A.current)||void 0===n?void 0:n.node.children[2]).focus(),("a"===e.key.toLowerCase()&&"PM"===x||"p"===e.key.toLowerCase()&&"AM"===x||"ArrowUp"===e.key||"ArrowDown"===e.key)&&w("AM"===x?function(e){return[e[0]+12,e[1]]}:function(e){return[e[0]-12,e[1]]}))},textAlign:"center",value:x,width:"2em"}))};export{g as default};
2
2
  //# sourceMappingURL=TimeField.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/tapestry-react",
3
- "version": "4.3.1-rc.0",
3
+ "version": "4.3.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",