@designbyadrian/react-interactive-input 3.0.0 → 3.1.0

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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react");var J={exports:{}},L={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");var q={exports:{}},D={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ee;function ue(){if(ee)return L;ee=1;var a=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function R(v,u,m){var N=null;if(m!==void 0&&(N=""+m),u.key!==void 0&&(N=""+u.key),"key"in u){m={};for(var E in u)E!=="key"&&(m[E]=u[E])}else m=u;return u=m.ref,{$$typeof:a,type:v,key:N,ref:u!==void 0?u:null,props:m}}return L.Fragment=d,L.jsx=R,L.jsxs=R,L}var V={};/**
9
+ */var ee;function ue(){if(ee)return D;ee=1;var a=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function R(v,u,d){var N=null;if(d!==void 0&&(N=""+d),u.key!==void 0&&(N=""+u.key),"key"in u){d={};for(var E in u)E!=="key"&&(d[E]=u[E])}else d=u;return u=d.ref,{$$typeof:a,type:v,key:N,ref:u!==void 0?u:null,props:d}}return D.Fragment=f,D.jsx=R,D.jsxs=R,D}var L={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var te;function ie(){return te||(te=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===S?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case M:return"Profiler";case j:return"StrictMode";case o:return"Suspense";case p:return"SuspenseList";case y:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case C:return"Portal";case X:return e.displayName||"Context";case F:return(e._context.displayName||"Context")+".Consumer";case s:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case i:return n=e.displayName||null,n!==null?n:a(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return a(e(n))}catch{}}return null}function d(e){return""+e}function R(e){try{d(e);var n=!1}catch{n=!0}if(n){n=console;var c=n.error,l=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",l),d(e)}}function v(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===k)return"<...>";try{var n=a(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function u(){var e=w.A;return e===null?null:e.getOwner()}function m(){return Error("react-stack-top-frame")}function N(e){if(z.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function E(e,n){function c(){h||(h=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function x(){var e=a(this.type);return $[e]||($[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function I(e,n,c,l,q,B){var f=c.ref;return e={$$typeof:A,type:e,key:n,props:c,_owner:l},(f!==void 0?f:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function b(e,n,c,l,q,B){var f=n.children;if(f!==void 0)if(l)if(t(f)){for(l=0;l<f.length;l++)_(f[l]);Object.freeze&&Object.freeze(f)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(f);if(z.call(n,"key")){f=a(e);var Y=Object.keys(n).filter(function(oe){return oe!=="key"});l=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",D[f+l]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var te;function ie(){return te||(te=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case C:return"Profiler";case I:return"StrictMode";case s:return"Suspense";case p:return"SuspenseList";case T:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case F:return"Portal";case X:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case o:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case b:return n=e.displayName||null,n!==null?n:a(e.type)||"Memo";case S:n=e._payload,e=e._init;try{return a(e(n))}catch{}}return null}function f(e){return""+e}function R(e){try{f(e);var n=!1}catch{n=!0}if(n){n=console;var c=n.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),f(e)}}function v(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===S)return"<...>";try{var n=a(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function u(){var e=w.A;return e===null?null:e.getOwner()}function d(){return Error("react-stack-top-frame")}function N(e){if(V.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function E(e,n){function c(){r||(r=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function x(){var e=a(this.type);return g[e]||(g[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function j(e,n,c,i,U,B){var l=c.ref;return e={$$typeof:O,type:e,key:n,props:c,_owner:i},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e,n,c,i,U,B){var l=n.children;if(l!==void 0)if(i)if(H(l)){for(i=0;i<l.length;i++)A(l[i]);Object.freeze&&Object.freeze(l)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else A(l);if(V.call(n,"key")){l=a(e);var Y=Object.keys(n).filter(function(oe){return oe!=="key"});i=0<Y.length?"{key: someKey, "+Y.join(": ..., ")+": ...}":"{key: someKey}",W[l+i]||(Y=0<Y.length?"{"+Y.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,l,f,Y,f),D[f+l]=!0)}if(f=null,c!==void 0&&(R(c),f=""+c),N(n)&&(R(n.key),f=""+n.key),"key"in n){c={};for(var K in n)K!=="key"&&(c[K]=n[K])}else c=n;return f&&E(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),I(e,f,c,u(),q,B)}function _(e){O(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===k&&(e._payload.status==="fulfilled"?O(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function O(e){return typeof e=="object"&&e!==null&&e.$$typeof===A}var T=g,A=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),X=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),i=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),w=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=Object.prototype.hasOwnProperty,t=Array.isArray,r=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(e){return e()}};var h,$={},W=T.react_stack_bottom_frame.bind(T,m)(),U=r(v(m)),D={};V.Fragment=P,V.jsx=function(e,n,c){var l=1e4>w.recentlyCreatedOwnerStacks++;return b(e,n,c,!1,l?Error("react-stack-top-frame"):W,l?r(v(e)):U)},V.jsxs=function(e,n,c){var l=1e4>w.recentlyCreatedOwnerStacks++;return b(e,n,c,!0,l?Error("react-stack-top-frame"):W,l?r(v(e)):U)}})()),V}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?J.exports=ue():J.exports=ie()),J.exports}var ae=le();const fe=/^-?\d*[.,]?\d*$/,ne=(a,d)=>fe.test(a)?a:d,Z=a=>{const d=a.toString().split(".");return d.length>1?d[1].length:0},se=a=>a.replace(",","."),Q=a=>parseFloat(se(a)),G=a=>Number.isFinite(a)?String(a):"",de=a=>G(Q(a)),H=(a,d)=>{var v;if(a.value===d)return;const R=(v=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:v.set;R?R.call(a,d):a.value=d,a.dispatchEvent(new Event("input",{bubbles:!0})),R&&(a.value=a.value)},ce=g.forwardRef(({defaultValue:a,mask:d=ne,onBlur:R,onChange:v,onFocus:u,onKeyDown:m,step:N=1,value:E,...x},I)=>{const b=g.useRef(null);g.useImperativeHandle(I,()=>b.current);const[_,O]=g.useState(E??(a!=null?String(a):"")),T=g.useRef(_);T.current=_;const A=g.useRef(!1),C=d===ne;g.useEffect(()=>{E===void 0||A.current||O(E)},[E]);const P=s=>{const o=s.target,p=o.value,i=d(p,T.current);if(i!==p){const y=o.selectionStart??p.length,S=Math.min(i.length,Math.max(0,y-(p.length-i.length)));o.value=i,o.setSelectionRange(S,S);return}if(T.current=i,O(i),!v)return;const k=se(i);if(k!==i){const y=o.selectionStart??i.length,S=o.selectionEnd??i.length;o.value=k,v(s),o.value=i,o.setSelectionRange(y,S)}else v(s)},j=s=>{const o=b.current;if(!o)return;const p=Q(T.current),i=Number(N)||1,k=Z(i);let y=(Number.isFinite(p)?p:0)+s*i;const S=x.min!==void 0?Number(x.min):NaN,w=x.max!==void 0?Number(x.max):NaN;Number.isNaN(S)||(y=Math.max(y,S)),Number.isNaN(w)||(y=Math.min(y,w)),H(o,y.toFixed(k))},M=s=>{m==null||m(s),!s.defaultPrevented&&(s.key==="ArrowUp"?(s.preventDefault(),j(1)):s.key==="ArrowDown"&&(s.preventDefault(),j(-1)))},F=s=>{A.current=!0,u==null||u(s)},X=s=>{A.current=!1;const o=T.current,p=C?de(o):o;p!==o?H(s.target,p):E!==void 0&&E!==o&&O(E),R==null||R(s)};return ae.jsx("input",{inputMode:"decimal",...x,type:"text",ref:b,value:_,onBlur:X,onChange:P,onFocus:F,onKeyDown:M})}),me=["metaKey","ctrlKey","altKey","shiftKey"],be=3;function Ee({value:a,modifiers:d={altKey:1,ctrlKey:1,metaKey:1,shiftKey:.1},style:R={},onBlur:v,onFocus:u,onKeyDown:m,onPointerCancel:N,onPointerDown:E,onPointerMove:x,onPointerUp:I,...b}){const _=g.useRef(null),[O,T]=g.useState(!1),[A,C]=g.useState(!1),P=b.step?+b.step:1,j=b.min!==void 0?+b.min:void 0,M=b.max!==void 0?+b.max:void 0,F={cursor:O&&!A?void 0:"ew-resize",touchAction:"none",...R};g.useEffect(()=>()=>{const t=_.current;t!=null&&t.scrubbing&&(document.body.style.cursor=t.previousBodyCursor)},[]);const X=t=>{for(const r of me)if(t[r])return d[r]??1;return 1},s=(t,r,h)=>{if(_.current=null,!!r.scrubbing){C(!1),document.body.style.cursor=r.previousBodyCursor;try{t.releasePointerCapture(r.pointerId)}catch{}h&&H(t,G(r.startValue)),t.blur()}},o=t=>{if(E==null||E(t),t.defaultPrevented||t.button!==0||b.disabled||b.readOnly)return;const r=t.currentTarget;if(document.activeElement===r)return;let h=Q(r.value);Number.isFinite(h)||(h=Number(b.defaultValue??j??0)||0),_.current={pointerId:t.pointerId,startX:t.clientX,lastX:t.clientX,startValue:h,accumulated:h,scrubbing:!1,previousBodyCursor:""}},p=t=>{x==null||x(t);const r=_.current;if(!r||r.pointerId!==t.pointerId)return;const h=t.currentTarget;if(t.buttons===0){_.current=null;return}if(!r.scrubbing){if(Math.abs(t.clientX-r.startX)<be)return;r.scrubbing=!0,r.lastX=t.clientX,C(!0),r.previousBodyCursor=document.body.style.cursor,document.body.style.cursor="ew-resize";try{h.setPointerCapture(t.pointerId)}catch{}}const $=X(t),W=P*$,U=Z(P)+Z($);r.accumulated+=(t.clientX-r.lastX)*W,r.lastX=t.clientX,j!==void 0&&(r.accumulated=Math.max(r.accumulated,j)),M!==void 0&&(r.accumulated=Math.min(r.accumulated,M));const D=+r.accumulated.toFixed(U);Number.isNaN(D)||H(h,G(D))},i=t=>{const r=_.current;!r||r.pointerId!==t.pointerId||s(t.currentTarget,r,!1)},k=t=>{I==null||I(t),i(t)},y=t=>{N==null||N(t),i(t)},S=t=>{const r=_.current;if(t.key==="Escape"&&(r!=null&&r.scrubbing)){t.preventDefault(),s(t.currentTarget,r,!0);return}m==null||m(t)},w=t=>{T(!0),u==null||u(t)},z=t=>{T(!1),v==null||v(t)};return ae.jsx(ce,{...b,defaultValue:b.defaultValue??0,style:F,value:a!==void 0?G(a):void 0,onBlur:z,onFocus:w,onKeyDown:S,onPointerCancel:y,onPointerDown:o,onPointerMove:p,onPointerUp:k})}exports.InteractiveInput=Ee;exports.MaskedInput=ce;
22
+ <%s key={someKey} {...props} />`,i,l,Y,l),W[l+i]=!0)}if(l=null,c!==void 0&&(R(c),l=""+c),N(n)&&(R(n.key),l=""+n.key),"key"in n){c={};for(var K in n)K!=="key"&&(c[K]=n[K])}else c=n;return l&&E(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),j(e,l,c,u(),U,B)}function A(e){_(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===S&&(e._payload.status==="fulfilled"?_(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function _(e){return typeof e=="object"&&e!==null&&e.$$typeof===O}var h=y,O=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),X=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),w=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,H=Array.isArray,t=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var r,g={},$=h.react_stack_bottom_frame.bind(h,d)(),z=t(v(d)),W={};L.Fragment=P,L.jsx=function(e,n,c){var i=1e4>w.recentlyCreatedOwnerStacks++;return m(e,n,c,!1,i?Error("react-stack-top-frame"):$,i?t(v(e)):z)},L.jsxs=function(e,n,c){var i=1e4>w.recentlyCreatedOwnerStacks++;return m(e,n,c,!0,i?Error("react-stack-top-frame"):$,i?t(v(e)):z)}})()),L}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?q.exports=ue():q.exports=ie()),q.exports}var ae=le();const fe=/^-?\d*[.,]?\d*$/,ne=(a,f)=>fe.test(a)?a:f,Z=a=>{const f=a.toString().split(".");return f.length>1?f[1].length:0},se=a=>a.replace(",","."),Q=a=>parseFloat(se(a)),J=a=>Number.isFinite(a)?String(a):"",de=a=>J(Q(a)),G=(a,f)=>{var v;if(a.value===f)return;const R=(v=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:v.set;R?R.call(a,f):a.value=f,a.dispatchEvent(new Event("input",{bubbles:!0})),R&&(a.value=a.value)},ce=y.forwardRef(({defaultValue:a,mask:f=ne,onBlur:R,onChange:v,onFocus:u,onKeyDown:d,step:N=1,value:E,...x},j)=>{const m=y.useRef(null);y.useImperativeHandle(j,()=>m.current);const[A,_]=y.useState(E??(a!=null?String(a):"")),h=y.useRef(A);h.current=A;const O=y.useRef(!1),F=f===ne;y.useEffect(()=>{E===void 0||O.current||_(E)},[E]);const P=o=>{const s=o.target,p=s.value,b=f(p,h.current);if(b!==p){const T=s.selectionStart??p.length,k=Math.min(b.length,Math.max(0,T-(p.length-b.length)));s.value=b,s.setSelectionRange(k,k);return}if(h.current=b,_(b),!v)return;const S=se(b);if(S!==b){const T=s.selectionStart??b.length,k=s.selectionEnd??b.length;s.value=S,v(o),s.value=b,s.setSelectionRange(T,k)}else v(o)},I=o=>{const s=m.current;if(!s)return;const p=Q(h.current),b=Number(N)||1,S=Z(b);let T=(Number.isFinite(p)?p:0)+o*b;const k=x.min!==void 0?Number(x.min):NaN,w=x.max!==void 0?Number(x.max):NaN;Number.isNaN(k)||(T=Math.max(T,k)),Number.isNaN(w)||(T=Math.min(T,w)),G(s,T.toFixed(S))},C=o=>{d==null||d(o),!o.defaultPrevented&&(o.key==="ArrowUp"?(o.preventDefault(),I(1)):o.key==="ArrowDown"&&(o.preventDefault(),I(-1)))},M=o=>{O.current=!0,u==null||u(o)},X=o=>{O.current=!1;const s=h.current,p=F?de(s):s;p!==s?G(o.target,p):E!==void 0&&E!==s&&_(E),R==null||R(o)};return ae.jsx("input",{inputMode:"decimal",...x,type:"text",ref:m,value:A,onBlur:X,onChange:P,onFocus:M,onKeyDown:C})}),me=["metaKey","ctrlKey","altKey","shiftKey"],be=3,Ee=y.forwardRef(({value:a,modifiers:f={altKey:1,ctrlKey:1,metaKey:1,shiftKey:.1},style:R={},onBlur:v,onFocus:u,onKeyDown:d,onPointerCancel:N,onPointerDown:E,onPointerMove:x,onPointerUp:j,...m},A)=>{const _=y.useRef(null),[h,O]=y.useState(!1),[F,P]=y.useState(!1),I=m.step?+m.step:1,C=m.min!==void 0?+m.min:void 0,M=m.max!==void 0?+m.max:void 0,X={cursor:h&&!F?void 0:"ew-resize",touchAction:"none",...R};y.useEffect(()=>()=>{const t=_.current;t!=null&&t.scrubbing&&(document.body.style.cursor=t.previousBodyCursor)},[]);const o=t=>{for(const r of me)if(t[r])return f[r]??1;return 1},s=(t,r,g)=>{if(_.current=null,!!r.scrubbing){P(!1),document.body.style.cursor=r.previousBodyCursor;try{t.releasePointerCapture(r.pointerId)}catch{}g&&G(t,J(r.startValue)),t.blur()}},p=t=>{if(E==null||E(t),t.defaultPrevented||t.button!==0||m.disabled||m.readOnly)return;const r=t.currentTarget;if(document.activeElement===r)return;let g=Q(r.value);Number.isFinite(g)||(g=Number(m.defaultValue??C??0)||0),_.current={pointerId:t.pointerId,startX:t.clientX,lastX:t.clientX,startValue:g,accumulated:g,scrubbing:!1,previousBodyCursor:""}},b=t=>{x==null||x(t);const r=_.current;if(!r||r.pointerId!==t.pointerId)return;const g=t.currentTarget;if(t.buttons===0){_.current=null;return}if(!r.scrubbing){if(Math.abs(t.clientX-r.startX)<be)return;r.scrubbing=!0,r.lastX=t.clientX,P(!0),r.previousBodyCursor=document.body.style.cursor,document.body.style.cursor="ew-resize";try{g.setPointerCapture(t.pointerId)}catch{}}const $=o(t),z=I*$,W=Z(I)+Z($);r.accumulated+=(t.clientX-r.lastX)*z,r.lastX=t.clientX,C!==void 0&&(r.accumulated=Math.max(r.accumulated,C)),M!==void 0&&(r.accumulated=Math.min(r.accumulated,M));const e=+r.accumulated.toFixed(W);Number.isNaN(e)||G(g,J(e))},S=t=>{const r=_.current;!r||r.pointerId!==t.pointerId||s(t.currentTarget,r,!1)},T=t=>{j==null||j(t),S(t)},k=t=>{N==null||N(t),S(t)},w=t=>{const r=_.current;if(t.key==="Escape"&&(r!=null&&r.scrubbing)){t.preventDefault(),s(t.currentTarget,r,!0);return}d==null||d(t)},V=t=>{O(!0),u==null||u(t)},H=t=>{O(!1),v==null||v(t)};return ae.jsx(ce,{...m,ref:A,defaultValue:m.defaultValue??0,style:X,value:a!==void 0?J(a):void 0,onBlur:H,onFocus:V,onKeyDown:w,onPointerCancel:k,onPointerDown:p,onPointerMove:b,onPointerUp:T})});exports.InteractiveInput=Ee;exports.MaskedInput=ce;
@@ -1,5 +1,5 @@
1
- import ie, { forwardRef as le, useRef as J, useImperativeHandle as fe, useState as Z, useEffect as se } from "react";
2
- var q = { exports: {} }, D = {};
1
+ import le, { forwardRef as se, useRef as q, useImperativeHandle as fe, useState as Z, useEffect as oe } from "react";
2
+ var U = { exports: {} }, $ = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -11,27 +11,27 @@ var q = { exports: {} }, D = {};
11
11
  */
12
12
  var te;
13
13
  function de() {
14
- if (te) return D;
14
+ if (te) return $;
15
15
  te = 1;
16
- var a = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
17
- function R(v, u, m) {
16
+ var a = Symbol.for("react.transitional.element"), f = Symbol.for("react.fragment");
17
+ function R(v, u, d) {
18
18
  var g = null;
19
- if (m !== void 0 && (g = "" + m), u.key !== void 0 && (g = "" + u.key), "key" in u) {
20
- m = {};
19
+ if (d !== void 0 && (g = "" + d), u.key !== void 0 && (g = "" + u.key), "key" in u) {
20
+ d = {};
21
21
  for (var E in u)
22
- E !== "key" && (m[E] = u[E]);
23
- } else m = u;
24
- return u = m.ref, {
22
+ E !== "key" && (d[E] = u[E]);
23
+ } else d = u;
24
+ return u = d.ref, {
25
25
  $$typeof: a,
26
26
  type: v,
27
27
  key: g,
28
28
  ref: u !== void 0 ? u : null,
29
- props: m
29
+ props: d
30
30
  };
31
31
  }
32
- return D.Fragment = d, D.jsx = R, D.jsxs = R, D;
32
+ return $.Fragment = f, $.jsx = R, $.jsxs = R, $;
33
33
  }
34
- var L = {};
34
+ var D = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -47,38 +47,38 @@ function me() {
47
47
  function a(e) {
48
48
  if (e == null) return null;
49
49
  if (typeof e == "function")
50
- return e.$$typeof === x ? null : e.displayName || e.name || null;
50
+ return e.$$typeof === k ? null : e.displayName || e.name || null;
51
51
  if (typeof e == "string") return e;
52
52
  switch (e) {
53
53
  case A:
54
54
  return "Fragment";
55
- case C:
55
+ case I:
56
56
  return "Profiler";
57
- case P:
57
+ case j:
58
58
  return "StrictMode";
59
- case c:
59
+ case s:
60
60
  return "Suspense";
61
61
  case p:
62
62
  return "SuspenseList";
63
- case h:
63
+ case T:
64
64
  return "Activity";
65
65
  }
66
66
  if (typeof e == "object")
67
67
  switch (typeof e.tag == "number" && console.error(
68
68
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
69
69
  ), e.$$typeof) {
70
- case I:
70
+ case Y:
71
71
  return "Portal";
72
72
  case F:
73
73
  return e.displayName || "Context";
74
- case Y:
74
+ case C:
75
75
  return (e._context.displayName || "Context") + ".Consumer";
76
- case s:
76
+ case c:
77
77
  var n = e.render;
78
78
  return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
79
- case i:
79
+ case b:
80
80
  return n = e.displayName || null, n !== null ? n : a(e.type) || "Memo";
81
- case k:
81
+ case x:
82
82
  n = e._payload, e = e._init;
83
83
  try {
84
84
  return a(e(n));
@@ -87,29 +87,29 @@ function me() {
87
87
  }
88
88
  return null;
89
89
  }
90
- function d(e) {
90
+ function f(e) {
91
91
  return "" + e;
92
92
  }
93
93
  function R(e) {
94
94
  try {
95
- d(e);
95
+ f(e);
96
96
  var n = !1;
97
97
  } catch {
98
98
  n = !0;
99
99
  }
100
100
  if (n) {
101
101
  n = console;
102
- var o = n.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
102
+ var o = n.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
103
103
  return o.call(
104
104
  n,
105
105
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
106
- l
107
- ), d(e);
106
+ i
107
+ ), f(e);
108
108
  }
109
109
  }
110
110
  function v(e) {
111
111
  if (e === A) return "<>";
112
- if (typeof e == "object" && e !== null && e.$$typeof === k)
112
+ if (typeof e == "object" && e !== null && e.$$typeof === x)
113
113
  return "<...>";
114
114
  try {
115
115
  var n = a(e);
@@ -119,14 +119,14 @@ function me() {
119
119
  }
120
120
  }
121
121
  function u() {
122
- var e = w.A;
122
+ var e = P.A;
123
123
  return e === null ? null : e.getOwner();
124
124
  }
125
- function m() {
125
+ function d() {
126
126
  return Error("react-stack-top-frame");
127
127
  }
128
128
  function g(e) {
129
- if (V.call(e, "key")) {
129
+ if (L.call(e, "key")) {
130
130
  var n = Object.getOwnPropertyDescriptor(e, "key").get;
131
131
  if (n && n.isReactWarning) return !1;
132
132
  }
@@ -134,7 +134,7 @@ function me() {
134
134
  }
135
135
  function E(e, n) {
136
136
  function o() {
137
- y || (y = !0, console.error(
137
+ r || (r = !0, console.error(
138
138
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
139
139
  n
140
140
  ));
@@ -146,19 +146,19 @@ function me() {
146
146
  }
147
147
  function N() {
148
148
  var e = a(this.type);
149
- return X[e] || (X[e] = !0, console.error(
149
+ return y[e] || (y[e] = !0, console.error(
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), e = this.props.ref, e !== void 0 ? e : null;
152
152
  }
153
- function j(e, n, o, l, U, B) {
154
- var f = o.ref;
153
+ function w(e, n, o, i, W, B) {
154
+ var l = o.ref;
155
155
  return e = {
156
- $$typeof: O,
156
+ $$typeof: S,
157
157
  type: e,
158
158
  key: n,
159
159
  props: o,
160
- _owner: l
161
- }, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
160
+ _owner: i
161
+ }, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
162
162
  enumerable: !1,
163
163
  get: N
164
164
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
@@ -175,7 +175,7 @@ function me() {
175
175
  configurable: !1,
176
176
  enumerable: !1,
177
177
  writable: !0,
178
- value: U
178
+ value: W
179
179
  }), Object.defineProperty(e, "_debugTask", {
180
180
  configurable: !1,
181
181
  enumerable: !1,
@@ -183,181 +183,181 @@ function me() {
183
183
  value: B
184
184
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
185
  }
186
- function b(e, n, o, l, U, B) {
187
- var f = n.children;
188
- if (f !== void 0)
189
- if (l)
190
- if (t(f)) {
191
- for (l = 0; l < f.length; l++)
192
- _(f[l]);
193
- Object.freeze && Object.freeze(f);
186
+ function m(e, n, o, i, W, B) {
187
+ var l = n.children;
188
+ if (l !== void 0)
189
+ if (i)
190
+ if (H(l)) {
191
+ for (i = 0; i < l.length; i++)
192
+ O(l[i]);
193
+ Object.freeze && Object.freeze(l);
194
194
  } else
195
195
  console.error(
196
196
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
197
197
  );
198
- else _(f);
199
- if (V.call(n, "key")) {
200
- f = a(e);
201
- var M = Object.keys(n).filter(function(ue) {
202
- return ue !== "key";
198
+ else O(l);
199
+ if (L.call(n, "key")) {
200
+ l = a(e);
201
+ var M = Object.keys(n).filter(function(ie) {
202
+ return ie !== "key";
203
203
  });
204
- l = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", $[f + l] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
204
+ i = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", z[l + i] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
205
205
  `A props object containing a "key" prop is being spread into JSX:
206
206
  let props = %s;
207
207
  <%s {...props} />
208
208
  React keys must be passed directly to JSX without using spread:
209
209
  let props = %s;
210
210
  <%s key={someKey} {...props} />`,
211
+ i,
211
212
  l,
212
- f,
213
213
  M,
214
- f
215
- ), $[f + l] = !0);
214
+ l
215
+ ), z[l + i] = !0);
216
216
  }
217
- if (f = null, o !== void 0 && (R(o), f = "" + o), g(n) && (R(n.key), f = "" + n.key), "key" in n) {
217
+ if (l = null, o !== void 0 && (R(o), l = "" + o), g(n) && (R(n.key), l = "" + n.key), "key" in n) {
218
218
  o = {};
219
219
  for (var K in n)
220
220
  K !== "key" && (o[K] = n[K]);
221
221
  } else o = n;
222
- return f && E(
222
+ return l && E(
223
223
  o,
224
224
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
225
- ), j(
225
+ ), w(
226
226
  e,
227
- f,
227
+ l,
228
228
  o,
229
229
  u(),
230
- U,
230
+ W,
231
231
  B
232
232
  );
233
233
  }
234
- function _(e) {
235
- S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
234
+ function O(e) {
235
+ _(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === x && (e._payload.status === "fulfilled" ? _(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
236
236
  }
237
- function S(e) {
238
- return typeof e == "object" && e !== null && e.$$typeof === O;
237
+ function _(e) {
238
+ return typeof e == "object" && e !== null && e.$$typeof === S;
239
239
  }
240
- var T = ie, O = Symbol.for("react.transitional.element"), I = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), F = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), i = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), h = Symbol.for("react.activity"), x = Symbol.for("react.client.reference"), w = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, t = Array.isArray, r = console.createTask ? console.createTask : function() {
240
+ var h = le, S = Symbol.for("react.transitional.element"), Y = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), I = Symbol.for("react.profiler"), C = Symbol.for("react.consumer"), F = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), T = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), P = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, H = Array.isArray, t = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
- T = {
243
+ h = {
244
244
  react_stack_bottom_frame: function(e) {
245
245
  return e();
246
246
  }
247
247
  };
248
- var y, X = {}, z = T.react_stack_bottom_frame.bind(
249
- T,
250
- m
251
- )(), W = r(v(m)), $ = {};
252
- L.Fragment = A, L.jsx = function(e, n, o) {
253
- var l = 1e4 > w.recentlyCreatedOwnerStacks++;
254
- return b(
248
+ var r, y = {}, X = h.react_stack_bottom_frame.bind(
249
+ h,
250
+ d
251
+ )(), V = t(v(d)), z = {};
252
+ D.Fragment = A, D.jsx = function(e, n, o) {
253
+ var i = 1e4 > P.recentlyCreatedOwnerStacks++;
254
+ return m(
255
255
  e,
256
256
  n,
257
257
  o,
258
258
  !1,
259
- l ? Error("react-stack-top-frame") : z,
260
- l ? r(v(e)) : W
259
+ i ? Error("react-stack-top-frame") : X,
260
+ i ? t(v(e)) : V
261
261
  );
262
- }, L.jsxs = function(e, n, o) {
263
- var l = 1e4 > w.recentlyCreatedOwnerStacks++;
264
- return b(
262
+ }, D.jsxs = function(e, n, o) {
263
+ var i = 1e4 > P.recentlyCreatedOwnerStacks++;
264
+ return m(
265
265
  e,
266
266
  n,
267
267
  o,
268
268
  !0,
269
- l ? Error("react-stack-top-frame") : z,
270
- l ? r(v(e)) : W
269
+ i ? Error("react-stack-top-frame") : X,
270
+ i ? t(v(e)) : V
271
271
  );
272
272
  };
273
- })()), L;
273
+ })()), D;
274
274
  }
275
275
  var ne;
276
276
  function be() {
277
- return ne || (ne = 1, process.env.NODE_ENV === "production" ? q.exports = de() : q.exports = me()), q.exports;
277
+ return ne || (ne = 1, process.env.NODE_ENV === "production" ? U.exports = de() : U.exports = me()), U.exports;
278
278
  }
279
- var oe = be();
280
- const Ee = /^-?\d*[.,]?\d*$/, ae = (a, d) => Ee.test(a) ? a : d, Q = (a) => {
281
- const d = a.toString().split(".");
282
- return d.length > 1 ? d[1].length : 0;
283
- }, ce = (a) => a.replace(",", "."), ee = (a) => parseFloat(ce(a)), G = (a) => Number.isFinite(a) ? String(a) : "", ve = (a) => G(ee(a)), H = (a, d) => {
279
+ var ce = be();
280
+ const Ee = /^-?\d*[.,]?\d*$/, ae = (a, f) => Ee.test(a) ? a : f, Q = (a) => {
281
+ const f = a.toString().split(".");
282
+ return f.length > 1 ? f[1].length : 0;
283
+ }, ue = (a) => a.replace(",", "."), ee = (a) => parseFloat(ue(a)), J = (a) => Number.isFinite(a) ? String(a) : "", ve = (a) => J(ee(a)), G = (a, f) => {
284
284
  var v;
285
- if (a.value === d) return;
285
+ if (a.value === f) return;
286
286
  const R = (v = Object.getOwnPropertyDescriptor(
287
287
  HTMLInputElement.prototype,
288
288
  "value"
289
289
  )) == null ? void 0 : v.set;
290
- R ? R.call(a, d) : a.value = d, a.dispatchEvent(new Event("input", { bubbles: !0 })), R && (a.value = a.value);
291
- }, Re = le(
290
+ R ? R.call(a, f) : a.value = f, a.dispatchEvent(new Event("input", { bubbles: !0 })), R && (a.value = a.value);
291
+ }, Re = se(
292
292
  ({
293
293
  defaultValue: a,
294
- mask: d = ae,
294
+ mask: f = ae,
295
295
  onBlur: R,
296
296
  onChange: v,
297
297
  onFocus: u,
298
- onKeyDown: m,
298
+ onKeyDown: d,
299
299
  step: g = 1,
300
300
  value: E,
301
301
  ...N
302
- }, j) => {
303
- const b = J(null);
302
+ }, w) => {
303
+ const m = q(null);
304
304
  fe(
305
- j,
306
- () => b.current
305
+ w,
306
+ () => m.current
307
307
  );
308
- const [_, S] = Z(
308
+ const [O, _] = Z(
309
309
  E ?? (a != null ? String(a) : "")
310
- ), T = J(_);
311
- T.current = _;
312
- const O = J(!1), I = d === ae;
313
- se(() => {
314
- E === void 0 || O.current || S(E);
310
+ ), h = q(O);
311
+ h.current = O;
312
+ const S = q(!1), Y = f === ae;
313
+ oe(() => {
314
+ E === void 0 || S.current || _(E);
315
315
  }, [E]);
316
- const A = (s) => {
317
- const c = s.target, p = c.value, i = d(p, T.current);
318
- if (i !== p) {
319
- const h = c.selectionStart ?? p.length, x = Math.min(
320
- i.length,
321
- Math.max(0, h - (p.length - i.length))
316
+ const A = (c) => {
317
+ const s = c.target, p = s.value, b = f(p, h.current);
318
+ if (b !== p) {
319
+ const T = s.selectionStart ?? p.length, k = Math.min(
320
+ b.length,
321
+ Math.max(0, T - (p.length - b.length))
322
322
  );
323
- c.value = i, c.setSelectionRange(x, x);
323
+ s.value = b, s.setSelectionRange(k, k);
324
324
  return;
325
325
  }
326
- if (T.current = i, S(i), !v) return;
327
- const k = ce(i);
328
- if (k !== i) {
329
- const h = c.selectionStart ?? i.length, x = c.selectionEnd ?? i.length;
330
- c.value = k, v(s), c.value = i, c.setSelectionRange(h, x);
326
+ if (h.current = b, _(b), !v) return;
327
+ const x = ue(b);
328
+ if (x !== b) {
329
+ const T = s.selectionStart ?? b.length, k = s.selectionEnd ?? b.length;
330
+ s.value = x, v(c), s.value = b, s.setSelectionRange(T, k);
331
331
  } else
332
- v(s);
333
- }, P = (s) => {
334
- const c = b.current;
335
- if (!c) return;
336
- const p = ee(T.current), i = Number(g) || 1, k = Q(i);
337
- let h = (Number.isFinite(p) ? p : 0) + s * i;
338
- const x = N.min !== void 0 ? Number(N.min) : NaN, w = N.max !== void 0 ? Number(N.max) : NaN;
339
- Number.isNaN(x) || (h = Math.max(h, x)), Number.isNaN(w) || (h = Math.min(h, w)), H(c, h.toFixed(k));
340
- }, C = (s) => {
341
- m == null || m(s), !s.defaultPrevented && (s.key === "ArrowUp" ? (s.preventDefault(), P(1)) : s.key === "ArrowDown" && (s.preventDefault(), P(-1)));
342
- }, Y = (s) => {
343
- O.current = !0, u == null || u(s);
344
- }, F = (s) => {
345
- O.current = !1;
346
- const c = T.current, p = I ? ve(c) : c;
347
- p !== c ? H(s.target, p) : E !== void 0 && E !== c && S(E), R == null || R(s);
332
+ v(c);
333
+ }, j = (c) => {
334
+ const s = m.current;
335
+ if (!s) return;
336
+ const p = ee(h.current), b = Number(g) || 1, x = Q(b);
337
+ let T = (Number.isFinite(p) ? p : 0) + c * b;
338
+ const k = N.min !== void 0 ? Number(N.min) : NaN, P = N.max !== void 0 ? Number(N.max) : NaN;
339
+ Number.isNaN(k) || (T = Math.max(T, k)), Number.isNaN(P) || (T = Math.min(T, P)), G(s, T.toFixed(x));
340
+ }, I = (c) => {
341
+ d == null || d(c), !c.defaultPrevented && (c.key === "ArrowUp" ? (c.preventDefault(), j(1)) : c.key === "ArrowDown" && (c.preventDefault(), j(-1)));
342
+ }, C = (c) => {
343
+ S.current = !0, u == null || u(c);
344
+ }, F = (c) => {
345
+ S.current = !1;
346
+ const s = h.current, p = Y ? ve(s) : s;
347
+ p !== s ? G(c.target, p) : E !== void 0 && E !== s && _(E), R == null || R(c);
348
348
  };
349
- return /* @__PURE__ */ oe.jsx(
349
+ return /* @__PURE__ */ ce.jsx(
350
350
  "input",
351
351
  {
352
352
  inputMode: "decimal",
353
353
  ...N,
354
354
  type: "text",
355
- ref: b,
356
- value: _,
355
+ ref: m,
356
+ value: O,
357
357
  onBlur: F,
358
358
  onChange: A,
359
- onFocus: Y,
360
- onKeyDown: C
359
+ onFocus: C,
360
+ onKeyDown: I
361
361
  }
362
362
  );
363
363
  }
@@ -366,121 +366,123 @@ const Ee = /^-?\d*[.,]?\d*$/, ae = (a, d) => Ee.test(a) ? a : d, Q = (a) => {
366
366
  "ctrlKey",
367
367
  "altKey",
368
368
  "shiftKey"
369
- ], pe = 3;
370
- function he({
371
- value: a,
372
- modifiers: d = {
373
- altKey: 1,
374
- ctrlKey: 1,
375
- metaKey: 1,
376
- shiftKey: 0.1
377
- },
378
- style: R = {},
379
- onBlur: v,
380
- onFocus: u,
381
- onKeyDown: m,
382
- onPointerCancel: g,
383
- onPointerDown: E,
384
- onPointerMove: N,
385
- onPointerUp: j,
386
- ...b
387
- }) {
388
- const _ = J(null), [S, T] = Z(!1), [O, I] = Z(!1), A = b.step ? +b.step : 1, P = b.min !== void 0 ? +b.min : void 0, C = b.max !== void 0 ? +b.max : void 0, Y = {
389
- cursor: S && !O ? void 0 : "ew-resize",
390
- touchAction: "none",
391
- ...R
392
- };
393
- se(
394
- () => () => {
395
- const t = _.current;
396
- t != null && t.scrubbing && (document.body.style.cursor = t.previousBodyCursor);
369
+ ], pe = 3, he = se(
370
+ ({
371
+ value: a,
372
+ modifiers: f = {
373
+ altKey: 1,
374
+ ctrlKey: 1,
375
+ metaKey: 1,
376
+ shiftKey: 0.1
397
377
  },
398
- []
399
- );
400
- const F = (t) => {
401
- for (const r of _e)
402
- if (t[r]) return d[r] ?? 1;
403
- return 1;
404
- }, s = (t, r, y) => {
405
- if (_.current = null, !!r.scrubbing) {
406
- I(!1), document.body.style.cursor = r.previousBodyCursor;
407
- try {
408
- t.releasePointerCapture(r.pointerId);
409
- } catch {
378
+ style: R = {},
379
+ onBlur: v,
380
+ onFocus: u,
381
+ onKeyDown: d,
382
+ onPointerCancel: g,
383
+ onPointerDown: E,
384
+ onPointerMove: N,
385
+ onPointerUp: w,
386
+ ...m
387
+ }, O) => {
388
+ const _ = q(null), [h, S] = Z(!1), [Y, A] = Z(!1), j = m.step ? +m.step : 1, I = m.min !== void 0 ? +m.min : void 0, C = m.max !== void 0 ? +m.max : void 0, F = {
389
+ cursor: h && !Y ? void 0 : "ew-resize",
390
+ touchAction: "none",
391
+ ...R
392
+ };
393
+ oe(
394
+ () => () => {
395
+ const t = _.current;
396
+ t != null && t.scrubbing && (document.body.style.cursor = t.previousBodyCursor);
397
+ },
398
+ []
399
+ );
400
+ const c = (t) => {
401
+ for (const r of _e)
402
+ if (t[r]) return f[r] ?? 1;
403
+ return 1;
404
+ }, s = (t, r, y) => {
405
+ if (_.current = null, !!r.scrubbing) {
406
+ A(!1), document.body.style.cursor = r.previousBodyCursor;
407
+ try {
408
+ t.releasePointerCapture(r.pointerId);
409
+ } catch {
410
+ }
411
+ y && G(t, J(r.startValue)), t.blur();
410
412
  }
411
- y && H(t, G(r.startValue)), t.blur();
412
- }
413
- }, c = (t) => {
414
- if (E == null || E(t), t.defaultPrevented || t.button !== 0 || b.disabled || b.readOnly) return;
415
- const r = t.currentTarget;
416
- if (document.activeElement === r) return;
417
- let y = ee(r.value);
418
- Number.isFinite(y) || (y = Number(b.defaultValue ?? P ?? 0) || 0), _.current = {
419
- pointerId: t.pointerId,
420
- startX: t.clientX,
421
- lastX: t.clientX,
422
- startValue: y,
423
- accumulated: y,
424
- scrubbing: !1,
425
- previousBodyCursor: ""
413
+ }, p = (t) => {
414
+ if (E == null || E(t), t.defaultPrevented || t.button !== 0 || m.disabled || m.readOnly) return;
415
+ const r = t.currentTarget;
416
+ if (document.activeElement === r) return;
417
+ let y = ee(r.value);
418
+ Number.isFinite(y) || (y = Number(m.defaultValue ?? I ?? 0) || 0), _.current = {
419
+ pointerId: t.pointerId,
420
+ startX: t.clientX,
421
+ lastX: t.clientX,
422
+ startValue: y,
423
+ accumulated: y,
424
+ scrubbing: !1,
425
+ previousBodyCursor: ""
426
+ };
427
+ }, b = (t) => {
428
+ N == null || N(t);
429
+ const r = _.current;
430
+ if (!r || r.pointerId !== t.pointerId) return;
431
+ const y = t.currentTarget;
432
+ if (t.buttons === 0) {
433
+ _.current = null;
434
+ return;
435
+ }
436
+ if (!r.scrubbing) {
437
+ if (Math.abs(t.clientX - r.startX) < pe) return;
438
+ r.scrubbing = !0, r.lastX = t.clientX, A(!0), r.previousBodyCursor = document.body.style.cursor, document.body.style.cursor = "ew-resize";
439
+ try {
440
+ y.setPointerCapture(t.pointerId);
441
+ } catch {
442
+ }
443
+ }
444
+ const X = c(t), V = j * X, z = Q(j) + Q(X);
445
+ r.accumulated += (t.clientX - r.lastX) * V, r.lastX = t.clientX, I !== void 0 && (r.accumulated = Math.max(r.accumulated, I)), C !== void 0 && (r.accumulated = Math.min(r.accumulated, C));
446
+ const e = +r.accumulated.toFixed(z);
447
+ Number.isNaN(e) || G(y, J(e));
448
+ }, x = (t) => {
449
+ const r = _.current;
450
+ !r || r.pointerId !== t.pointerId || s(t.currentTarget, r, !1);
451
+ }, T = (t) => {
452
+ w == null || w(t), x(t);
453
+ }, k = (t) => {
454
+ g == null || g(t), x(t);
455
+ }, P = (t) => {
456
+ const r = _.current;
457
+ if (t.key === "Escape" && (r != null && r.scrubbing)) {
458
+ t.preventDefault(), s(t.currentTarget, r, !0);
459
+ return;
460
+ }
461
+ d == null || d(t);
462
+ }, L = (t) => {
463
+ S(!0), u == null || u(t);
464
+ }, H = (t) => {
465
+ S(!1), v == null || v(t);
426
466
  };
427
- }, p = (t) => {
428
- N == null || N(t);
429
- const r = _.current;
430
- if (!r || r.pointerId !== t.pointerId) return;
431
- const y = t.currentTarget;
432
- if (t.buttons === 0) {
433
- _.current = null;
434
- return;
435
- }
436
- if (!r.scrubbing) {
437
- if (Math.abs(t.clientX - r.startX) < pe) return;
438
- r.scrubbing = !0, r.lastX = t.clientX, I(!0), r.previousBodyCursor = document.body.style.cursor, document.body.style.cursor = "ew-resize";
439
- try {
440
- y.setPointerCapture(t.pointerId);
441
- } catch {
467
+ return /* @__PURE__ */ ce.jsx(
468
+ Re,
469
+ {
470
+ ...m,
471
+ ref: O,
472
+ defaultValue: m.defaultValue ?? 0,
473
+ style: F,
474
+ value: a !== void 0 ? J(a) : void 0,
475
+ onBlur: H,
476
+ onFocus: L,
477
+ onKeyDown: P,
478
+ onPointerCancel: k,
479
+ onPointerDown: p,
480
+ onPointerMove: b,
481
+ onPointerUp: T
442
482
  }
443
- }
444
- const X = F(t), z = A * X, W = Q(A) + Q(X);
445
- r.accumulated += (t.clientX - r.lastX) * z, r.lastX = t.clientX, P !== void 0 && (r.accumulated = Math.max(r.accumulated, P)), C !== void 0 && (r.accumulated = Math.min(r.accumulated, C));
446
- const $ = +r.accumulated.toFixed(W);
447
- Number.isNaN($) || H(y, G($));
448
- }, i = (t) => {
449
- const r = _.current;
450
- !r || r.pointerId !== t.pointerId || s(t.currentTarget, r, !1);
451
- }, k = (t) => {
452
- j == null || j(t), i(t);
453
- }, h = (t) => {
454
- g == null || g(t), i(t);
455
- }, x = (t) => {
456
- const r = _.current;
457
- if (t.key === "Escape" && (r != null && r.scrubbing)) {
458
- t.preventDefault(), s(t.currentTarget, r, !0);
459
- return;
460
- }
461
- m == null || m(t);
462
- }, w = (t) => {
463
- T(!0), u == null || u(t);
464
- }, V = (t) => {
465
- T(!1), v == null || v(t);
466
- };
467
- return /* @__PURE__ */ oe.jsx(
468
- Re,
469
- {
470
- ...b,
471
- defaultValue: b.defaultValue ?? 0,
472
- style: Y,
473
- value: a !== void 0 ? G(a) : void 0,
474
- onBlur: V,
475
- onFocus: w,
476
- onKeyDown: x,
477
- onPointerCancel: h,
478
- onPointerDown: c,
479
- onPointerMove: p,
480
- onPointerUp: k
481
- }
482
- );
483
- }
483
+ );
484
+ }
485
+ );
484
486
  export {
485
487
  he as InteractiveInput,
486
488
  Re as MaskedInput
@@ -19,5 +19,5 @@ interface InteractiveInputProps extends React.InputHTMLAttributes<HTMLInputEleme
19
19
  * modifier keys (read live from each pointer event) and can be cancelled with
20
20
  * Escape, restoring the value from before the drag.
21
21
  */
22
- export default function InteractiveInput({ value, modifiers, style: _style, onBlur, onFocus, onKeyDown, onPointerCancel, onPointerDown, onPointerMove, onPointerUp, ...props }: InteractiveInputProps): import("react").JSX.Element;
23
- export {};
22
+ declare const InteractiveInput: import("react").ForwardRefExoticComponent<InteractiveInputProps & import("react").RefAttributes<HTMLInputElement>>;
23
+ export default InteractiveInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designbyadrian/react-interactive-input",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Adjust values in numeric input boxes by clicking and dragging horizontally, just like in Blender and similar 3D applications.",
5
5
  "keywords": [
6
6
  "react",
@@ -46,8 +46,8 @@
46
46
  "dist/types"
47
47
  ],
48
48
  "peerDependencies": {
49
- "react": "^19.0.0",
50
- "react-dom": "^19.0.0"
49
+ "react": ">=18.0.0",
50
+ "react-dom": ">=18.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@chromatic-com/storybook": "^3.2.6",