@designbyadrian/react-interactive-input 2.0.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.
- package/LICENSE +9 -0
- package/README.md +118 -0
- package/dist/react-interactive-input.cjs.js +30 -0
- package/dist/react-interactive-input.es.js +757 -0
- package/dist/types/InteractiveInput.d.ts +16 -0
- package/dist/types/MaskedInput.d.ts +13 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/masks.d.ts +2 -0
- package/dist/types/utils.d.ts +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Adrian von Gegerfelt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<center>
|
|
2
|
+
<img src="assets/interactive-input-icon.svg" alt="" height="64" aria-hidden="true" />
|
|
3
|
+
<h1>React Interactive Input</h1>
|
|
4
|
+
</center>
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
In Blender and similar 3D applications, users can adjust values in numeric input boxes by clicking and dragging horizontally, often referred to as **scrubbing.**
|
|
9
|
+
|
|
10
|
+
The user typically clicks and holds the mouse over the number, then drags left or right to decrease or increase the value smoothly. This provides quick, precise control over numeric adjustments without needing to type manually or rely on up/down arrows.
|
|
11
|
+
|
|
12
|
+
This component is a React implementation of that behavior, with a few additional features and customizations.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **Interactive Input**: Click and drag to adjust numeric values smoothly.
|
|
17
|
+
- **Customizable**: Control the step, min, and max values for the input.
|
|
18
|
+
- **Controlled Component**: Fully controlled input field with a callback for value changes.
|
|
19
|
+
- **Input Masking**: Custom input component for handling negative numbers.
|
|
20
|
+
- **Theming**: Easily customize styles to match your application's look and feel.
|
|
21
|
+
- **Accessibility**: Built with accessibility in mind.
|
|
22
|
+
|
|
23
|
+
## Try it out
|
|
24
|
+
|
|
25
|
+
You can try out the component in the [Storybook](https://designbyadrian.github.io/react-interactive-input).
|
|
26
|
+
|
|
27
|
+
🦄🕹️🍕
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
To install the library, use npm or yarn:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @designbyadrian/react-interactive-input
|
|
35
|
+
# or
|
|
36
|
+
yarn add @designbyadrian/react-interactive-input
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
import { InteractiveInput } from '@designbyadrian/react-interactive-input';
|
|
43
|
+
|
|
44
|
+
function MyComponent() {
|
|
45
|
+
return <InteractiveInput value={42} onChange={value => console.log(value)} />;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Attributes
|
|
50
|
+
|
|
51
|
+
The `InteractiveInput` component accepts all properties of the HTMLInputElement element, especially the following attributes:
|
|
52
|
+
|
|
53
|
+
- `value`: The initial value of the input field.
|
|
54
|
+
- `onChange`: A callback function that receives the new value when it changes.
|
|
55
|
+
- `step`: The amount to increment or decrement the value when scrubbing.
|
|
56
|
+
- `min`: The minimum value allowed.
|
|
57
|
+
- `max`: The maximum value allowed.
|
|
58
|
+
|
|
59
|
+
## Components
|
|
60
|
+
|
|
61
|
+
The library exports two components: `InteractiveInput` and `MaskedInput`.
|
|
62
|
+
|
|
63
|
+
### InteractiveInput
|
|
64
|
+
|
|
65
|
+
The main component for interactive input behavior.
|
|
66
|
+
|
|
67
|
+
### MaskedInput
|
|
68
|
+
|
|
69
|
+
A custom input component featuring input masking specifically designed to address limitations with negative numbers in standard HTML input elements. This component ensures that negative values are properly formatted and accepted by the input field, preventing unexpected behavior or errors when handling signed numbers.
|
|
70
|
+
|
|
71
|
+
You can provide your own masking function to customize the behavior of the input field.
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
import { MaskedInput } from '@designbyadrian/react-interactive-input';
|
|
77
|
+
|
|
78
|
+
function MyComponent() {
|
|
79
|
+
return (
|
|
80
|
+
<MaskedInput
|
|
81
|
+
value="-4.2"
|
|
82
|
+
onChange={e => console.log(parseFloat(e.target.value))}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Running locally
|
|
89
|
+
|
|
90
|
+
To run the project locally, follow these steps:
|
|
91
|
+
|
|
92
|
+
1. Clone the repository:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
2. Install the dependencies:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm install
|
|
102
|
+
# or
|
|
103
|
+
yarn
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. Start the development server:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npm run dev
|
|
110
|
+
# or
|
|
111
|
+
yarn dev
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The project will be available at `http://localhost:6006`.
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react");var ve={exports:{}},q={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ie;function vr(){if(Ie)return q;Ie=1;var g=E,p=Symbol.for("react.element"),j=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,O=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,D={key:!0,ref:!0,__self:!0,__source:!0};function P(h,d,x){var m,T={},c=null,R=null;x!==void 0&&(c=""+x),d.key!==void 0&&(c=""+d.key),d.ref!==void 0&&(R=d.ref);for(m in d)u.call(d,m)&&!D.hasOwnProperty(m)&&(T[m]=d[m]);if(h&&h.defaultProps)for(m in d=h.defaultProps,d)T[m]===void 0&&(T[m]=d[m]);return{$$typeof:p,type:h,key:c,ref:R,props:T,_owner:O.current}}return q.Fragment=j,q.jsx=P,q.jsxs=P,q}var B={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ve;function mr(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){var g=E,p=Symbol.for("react.element"),j=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),C=Symbol.iterator,A="@@iterator";function V(e){if(e===null||typeof e!="object")return null;var r=C&&e[C]||e[A];return typeof r=="function"?r:null}var F=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function i(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];_("error",e,t)}}function _(e,r,t){{var n=F.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var l=t.map(function(o){return String(o)});l.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,l)}}var W=!1,Y=!1,J=!1,ne=!1,X=!1,K;K=Symbol.for("react.module.reference");function z(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===D||X||e===O||e===x||e===m||ne||e===R||W||Y||J||typeof e=="object"&&e!==null&&(e.$$typeof===c||e.$$typeof===T||e.$$typeof===P||e.$$typeof===h||e.$$typeof===d||e.$$typeof===K||e.getModuleId!==void 0))}function G(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function H(e){return e.displayName||"Context"}function w(e){if(e==null)return null;if(typeof e.tag=="number"&&i("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case j:return"Portal";case D:return"Profiler";case O:return"StrictMode";case x:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h:var r=e;return H(r)+".Consumer";case P:var t=e;return H(t._context)+".Provider";case d:return G(e,e.render,"ForwardRef");case T:var n=e.displayName||null;return n!==null?n:w(e.type)||"Memo";case c:{var s=e,l=s._payload,o=s._init;try{return w(o(l))}catch{return null}}}return null}var y=Object.assign,M=0,Z,me,ye,ge,pe,he,be;function Ee(){}Ee.__reactDisabledLog=!0;function We(){{if(M===0){Z=console.log,me=console.info,ye=console.warn,ge=console.error,pe=console.group,he=console.groupCollapsed,be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Ye(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:y({},e,{value:Z}),info:y({},e,{value:me}),warn:y({},e,{value:ye}),error:y({},e,{value:ge}),group:y({},e,{value:pe}),groupCollapsed:y({},e,{value:he}),groupEnd:y({},e,{value:be})})}M<0&&i("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=F.ReactCurrentDispatcher,oe;function Q(e,r,t){{if(oe===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);oe=n&&n[1]||""}return`
|
|
18
|
+
`+oe+e}}var ie=!1,ee;{var Ke=typeof WeakMap=="function"?WeakMap:Map;ee=new Ke}function Re(e,r){if(!e||ie)return"";{var t=ee.get(e);if(t!==void 0)return t}var n;ie=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var l;l=ae.current,ae.current=null,We();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(S){n=S}Reflect.construct(e,[],o)}else{try{o.call()}catch(S){n=S}e.call(o.prototype)}}else{try{throw Error()}catch(S){n=S}e()}}catch(S){if(S&&n&&typeof S.stack=="string"){for(var a=S.stack.split(`
|
|
19
|
+
`),b=n.stack.split(`
|
|
20
|
+
`),f=a.length-1,v=b.length-1;f>=1&&v>=0&&a[f]!==b[v];)v--;for(;f>=1&&v>=0;f--,v--)if(a[f]!==b[v]){if(f!==1||v!==1)do if(f--,v--,v<0||a[f]!==b[v]){var k=`
|
|
21
|
+
`+a[f].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&ee.set(e,k),k}while(f>=1&&v>=0);break}}}finally{ie=!1,ae.current=l,Ye(),Error.prepareStackTrace=s}var $=e?e.displayName||e.name:"",I=$?Q($):"";return typeof e=="function"&&ee.set(e,I),I}function Ue(e,r,t){return Re(e,!1)}function Ne(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function re(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,Ne(e));if(typeof e=="string")return Q(e);switch(e){case x:return Q("Suspense");case m:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ue(e.render);case T:return re(e.type,r,t);case c:{var n=e,s=n._payload,l=n._init;try{return re(l(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,_e={},we=F.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function qe(e,r,t,n,s){{var l=Function.call.bind(U);for(var o in e)if(l(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var b=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw b.name="Invariant Violation",b}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(f){a=f}a&&!(a instanceof Error)&&(te(s),i("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),te(null)),a instanceof Error&&!(a.message in _e)&&(_e[a.message]=!0,te(s),i("Failed %s type: %s",t,a.message),te(null))}}}var Be=Array.isArray;function ue(e){return Be(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Te(e){if(Xe(e))return i("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),Se(e)}var N=F.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0},Ce,Oe,se;se={};function Ge(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){if(typeof e.ref=="string"&&N.current&&r&&N.current.stateNode!==r){var t=w(N.current.type);se[t]||(i('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(N.current.type),e.ref),se[t]=!0)}}function Qe(e,r){{var t=function(){Ce||(Ce=!0,i("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function er(e,r){{var t=function(){Oe||(Oe=!0,i("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var rr=function(e,r,t,n,s,l,o){var a={$$typeof:p,type:e,key:r,ref:t,props:o,_owner:l};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function tr(e,r,t,n,s){{var l,o={},a=null,b=null;t!==void 0&&(Te(t),a=""+t),He(r)&&(Te(r.key),a=""+r.key),Ge(r)&&(b=r.ref,Ze(r,s));for(l in r)U.call(r,l)&&!ze.hasOwnProperty(l)&&(o[l]=r[l]);if(e&&e.defaultProps){var f=e.defaultProps;for(l in f)o[l]===void 0&&(o[l]=f[l])}if(a||b){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Qe(o,v),b&&er(o,v)}return rr(e,a,b,s,n,N.current,o)}}var le=F.ReactCurrentOwner,Pe=F.ReactDebugCurrentFrame;function L(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var ce;ce=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function ke(){{if(le.current){var e=w(le.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function nr(e){return""}var xe={};function ar(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function je(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ar(r);if(xe[t])return;xe[t]=!0;var n="";e&&e._owner&&e._owner!==le.current&&(n=" It was passed a child from "+w(e._owner.type)+"."),L(e),i('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),L(null)}}function De(e,r){{if(typeof e!="object")return;if(ue(e))for(var t=0;t<e.length;t++){var n=e[t];fe(n)&&je(n,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var s=V(e);if(typeof s=="function"&&s!==e.entries)for(var l=s.call(e),o;!(o=l.next()).done;)fe(o.value)&&je(o.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===T))t=r.propTypes;else return;if(t){var n=w(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var s=w(r);i("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&i("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){L(e),i("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),L(null);break}}e.ref!==null&&(L(e),i("Invalid attribute `ref` supplied to `React.Fragment`."),L(null))}}var Fe={};function Ae(e,r,t,n,s,l){{var o=z(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var b=nr();b?a+=b:a+=ke();var f;e===null?f="null":ue(e)?f="array":e!==void 0&&e.$$typeof===p?(f="<"+(w(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):f=typeof e,i("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",f,a)}var v=tr(e,r,t,s,l);if(v==null)return v;if(o){var k=r.children;if(k!==void 0)if(n)if(ue(k)){for(var $=0;$<k.length;$++)De(k[$],e);Object.freeze&&Object.freeze(k)}else i("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 De(k,e)}if(U.call(r,"key")){var I=w(e),S=Object.keys(r).filter(function(dr){return dr!=="key"}),de=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Fe[I+de]){var fr=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";i(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,de,I,fr,I),Fe[I+de]=!0}}return e===u?ir(v):or(v),v}}function ur(e,r,t){return Ae(e,r,t,!0)}function sr(e,r,t){return Ae(e,r,t,!1)}var lr=sr,cr=ur;B.Fragment=u,B.jsx=lr,B.jsxs=cr}()),B}process.env.NODE_ENV==="production"?ve.exports=vr():ve.exports=mr();var Me=ve.exports;function yr(){let g="";return function(j){const u=/^-?\d*([.,]?)\d*$/,O=j.match(u);return O&&(g=O[0]),g}}const Le=g=>{const p=g.toString().split(".");return p.length>1?p[1].length:0},gr=yr(),$e=E.forwardRef(({mask:g=gr,onChange:p,step:j=1,value:u,...O},D)=>{const[P,h]=E.useState(u||""),d=D||E.useRef(null),x=c=>{const{value:R}=c.target,C=g(R);if(h(C),p){const A={...c,target:{...c.target,value:C.replace(",",".")}};p(A)}},m=(c,R)=>{const C=parseFloat(P.replace(",","."))||0,A=parseFloat(j.toString()),V=Le(+j),i=(R?C+A:C-A).toFixed(V),_=g(i);if(h(_),p){const Y={...new Event("change",{bubbles:!0}),target:{...c.target,value:_.replace(",",".")}};p(Y)}},T=c=>{c.key==="ArrowUp"?(c.preventDefault(),m(c,!0)):c.key==="ArrowDown"&&(c.preventDefault(),m(c,!1))};return E.useEffect(()=>{h(u||"")},[u]),Me.jsx("input",{...O,type:"text",ref:d,value:P,onChange:x,onKeyDown:T})});function pr({value:g,modifiers:p={altKey:1,ctrlKey:1,metaKey:1,shiftKey:.1},style:j={},...u}){const[O,D]=E.useState(String(g||0)),[P,h]=E.useState(""),[,d]=E.useState([0,0]),x=E.useRef(0),m=u.step?+u.step:1,T={cursor:"ew-resize",...j},c=i=>{var _;D(i.target.value),i.target.value!=="-"&&((_=u.onChange)==null||_.call(u,i))},R=E.useCallback(i=>{d(_=>{const{clientX:W,clientY:Y}=i,[J,ne]=_,X=J-W,K=ne-Y;let z=1;P&&(z=p[P]||1);const G=m*z,H=Le(G);let w=Math.sqrt(X*X+K*K)*G;W<J&&(w=-w);let y=x.current+w;if(u.min&&(y=Math.max(y,+u.min)),u.max&&(y=Math.min(y,+u.max)),y=+y.toFixed(H),y&&D(String(y)),y&&u.onChange){const Z={...new Event("change",{bubbles:!0}),target:{...i.target,value:y}};u.onChange(Z)}return _})},[P,u.max,u.min,m,p]),C=E.useCallback(()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",C)},[R]),A=E.useCallback(i=>{let _=+O;isNaN(_)&&(_=+(u.defaultValue||u.min||0)),x.current=_,d([i.clientX,i.clientY]),document.addEventListener("mousemove",R),document.addEventListener("mouseup",C)},[R,C,g,u.min,u.defaultValue]),V=i=>{i.metaKey?h("metaKey"):i.ctrlKey?h("ctrlKey"):i.altKey?h("altKey"):i.shiftKey&&h("shiftKey")},F=()=>{h("")};return E.useEffect(()=>{D(String(g||0))},[g]),E.useEffect(()=>(document.addEventListener("keydown",V),document.addEventListener("keyup",F),()=>{document.removeEventListener("mousemove",R),document.removeEventListener("mouseup",C),document.removeEventListener("keydown",V),document.removeEventListener("keyup",F)}),[]),Me.jsx($e,{...u,style:T,onChange:c,onMouseDown:A,value:O})}exports.InteractiveInput=pr;exports.MaskedInput=$e;
|
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
import $e, { forwardRef as gr, useState as te, useRef as We, useEffect as me, useCallback as ve } from "react";
|
|
2
|
+
var ye = { exports: {} }, N = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var Me;
|
|
13
|
+
function pr() {
|
|
14
|
+
if (Me) return N;
|
|
15
|
+
Me = 1;
|
|
16
|
+
var g = $e, p = Symbol.for("react.element"), k = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, C = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
+
function O(h, d, P) {
|
|
18
|
+
var m, T = {}, c = null, b = null;
|
|
19
|
+
P !== void 0 && (c = "" + P), d.key !== void 0 && (c = "" + d.key), d.ref !== void 0 && (b = d.ref);
|
|
20
|
+
for (m in d) u.call(d, m) && !j.hasOwnProperty(m) && (T[m] = d[m]);
|
|
21
|
+
if (h && h.defaultProps) for (m in d = h.defaultProps, d) T[m] === void 0 && (T[m] = d[m]);
|
|
22
|
+
return { $$typeof: p, type: h, key: c, ref: b, props: T, _owner: C.current };
|
|
23
|
+
}
|
|
24
|
+
return N.Fragment = k, N.jsx = O, N.jsxs = O, N;
|
|
25
|
+
}
|
|
26
|
+
var q = {};
|
|
27
|
+
/**
|
|
28
|
+
* @license React
|
|
29
|
+
* react-jsx-runtime.development.js
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license found in the
|
|
34
|
+
* LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
var Le;
|
|
37
|
+
function hr() {
|
|
38
|
+
return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
+
var g = $e, p = Symbol.for("react.element"), k = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), h = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), b = Symbol.for("react.offscreen"), S = Symbol.iterator, F = "@@iterator";
|
|
40
|
+
function V(e) {
|
|
41
|
+
if (e === null || typeof e != "object")
|
|
42
|
+
return null;
|
|
43
|
+
var r = S && e[S] || e[F];
|
|
44
|
+
return typeof r == "function" ? r : null;
|
|
45
|
+
}
|
|
46
|
+
var D = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
47
|
+
function i(e) {
|
|
48
|
+
{
|
|
49
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
50
|
+
t[n - 1] = arguments[n];
|
|
51
|
+
R("error", e, t);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function R(e, r, t) {
|
|
55
|
+
{
|
|
56
|
+
var n = D.ReactDebugCurrentFrame, s = n.getStackAddendum();
|
|
57
|
+
s !== "" && (r += "%s", t = t.concat([s]));
|
|
58
|
+
var l = t.map(function(o) {
|
|
59
|
+
return String(o);
|
|
60
|
+
});
|
|
61
|
+
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var $ = !1, W = !1, B = !1, ne = !1, J = !1, Y;
|
|
65
|
+
Y = Symbol.for("react.module.reference");
|
|
66
|
+
function X(e) {
|
|
67
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === j || J || e === C || e === P || e === m || ne || e === b || $ || W || B || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === T || e.$$typeof === O || e.$$typeof === h || e.$$typeof === d || // This needs to include all possible module reference object
|
|
68
|
+
// types supported by any Flight configuration anywhere since
|
|
69
|
+
// we don't know which Flight build this will end up being used
|
|
70
|
+
// with.
|
|
71
|
+
e.$$typeof === Y || e.getModuleId !== void 0));
|
|
72
|
+
}
|
|
73
|
+
function z(e, r, t) {
|
|
74
|
+
var n = e.displayName;
|
|
75
|
+
if (n)
|
|
76
|
+
return n;
|
|
77
|
+
var s = r.displayName || r.name || "";
|
|
78
|
+
return s !== "" ? t + "(" + s + ")" : t;
|
|
79
|
+
}
|
|
80
|
+
function G(e) {
|
|
81
|
+
return e.displayName || "Context";
|
|
82
|
+
}
|
|
83
|
+
function _(e) {
|
|
84
|
+
if (e == null)
|
|
85
|
+
return null;
|
|
86
|
+
if (typeof e.tag == "number" && i("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
87
|
+
return e.displayName || e.name || null;
|
|
88
|
+
if (typeof e == "string")
|
|
89
|
+
return e;
|
|
90
|
+
switch (e) {
|
|
91
|
+
case u:
|
|
92
|
+
return "Fragment";
|
|
93
|
+
case k:
|
|
94
|
+
return "Portal";
|
|
95
|
+
case j:
|
|
96
|
+
return "Profiler";
|
|
97
|
+
case C:
|
|
98
|
+
return "StrictMode";
|
|
99
|
+
case P:
|
|
100
|
+
return "Suspense";
|
|
101
|
+
case m:
|
|
102
|
+
return "SuspenseList";
|
|
103
|
+
}
|
|
104
|
+
if (typeof e == "object")
|
|
105
|
+
switch (e.$$typeof) {
|
|
106
|
+
case h:
|
|
107
|
+
var r = e;
|
|
108
|
+
return G(r) + ".Consumer";
|
|
109
|
+
case O:
|
|
110
|
+
var t = e;
|
|
111
|
+
return G(t._context) + ".Provider";
|
|
112
|
+
case d:
|
|
113
|
+
return z(e, e.render, "ForwardRef");
|
|
114
|
+
case T:
|
|
115
|
+
var n = e.displayName || null;
|
|
116
|
+
return n !== null ? n : _(e.type) || "Memo";
|
|
117
|
+
case c: {
|
|
118
|
+
var s = e, l = s._payload, o = s._init;
|
|
119
|
+
try {
|
|
120
|
+
return _(o(l));
|
|
121
|
+
} catch {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
var y = Object.assign, I = 0, H, ge, pe, he, Ee, be, Re;
|
|
129
|
+
function _e() {
|
|
130
|
+
}
|
|
131
|
+
_e.__reactDisabledLog = !0;
|
|
132
|
+
function Ue() {
|
|
133
|
+
{
|
|
134
|
+
if (I === 0) {
|
|
135
|
+
H = console.log, ge = console.info, pe = console.warn, he = console.error, Ee = console.group, be = console.groupCollapsed, Re = console.groupEnd;
|
|
136
|
+
var e = {
|
|
137
|
+
configurable: !0,
|
|
138
|
+
enumerable: !0,
|
|
139
|
+
value: _e,
|
|
140
|
+
writable: !0
|
|
141
|
+
};
|
|
142
|
+
Object.defineProperties(console, {
|
|
143
|
+
info: e,
|
|
144
|
+
log: e,
|
|
145
|
+
warn: e,
|
|
146
|
+
error: e,
|
|
147
|
+
group: e,
|
|
148
|
+
groupCollapsed: e,
|
|
149
|
+
groupEnd: e
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
I++;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function Ne() {
|
|
156
|
+
{
|
|
157
|
+
if (I--, I === 0) {
|
|
158
|
+
var e = {
|
|
159
|
+
configurable: !0,
|
|
160
|
+
enumerable: !0,
|
|
161
|
+
writable: !0
|
|
162
|
+
};
|
|
163
|
+
Object.defineProperties(console, {
|
|
164
|
+
log: y({}, e, {
|
|
165
|
+
value: H
|
|
166
|
+
}),
|
|
167
|
+
info: y({}, e, {
|
|
168
|
+
value: ge
|
|
169
|
+
}),
|
|
170
|
+
warn: y({}, e, {
|
|
171
|
+
value: pe
|
|
172
|
+
}),
|
|
173
|
+
error: y({}, e, {
|
|
174
|
+
value: he
|
|
175
|
+
}),
|
|
176
|
+
group: y({}, e, {
|
|
177
|
+
value: Ee
|
|
178
|
+
}),
|
|
179
|
+
groupCollapsed: y({}, e, {
|
|
180
|
+
value: be
|
|
181
|
+
}),
|
|
182
|
+
groupEnd: y({}, e, {
|
|
183
|
+
value: Re
|
|
184
|
+
})
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
I < 0 && i("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
var ae = D.ReactCurrentDispatcher, oe;
|
|
191
|
+
function Z(e, r, t) {
|
|
192
|
+
{
|
|
193
|
+
if (oe === void 0)
|
|
194
|
+
try {
|
|
195
|
+
throw Error();
|
|
196
|
+
} catch (s) {
|
|
197
|
+
var n = s.stack.trim().match(/\n( *(at )?)/);
|
|
198
|
+
oe = n && n[1] || "";
|
|
199
|
+
}
|
|
200
|
+
return `
|
|
201
|
+
` + oe + e;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
var ie = !1, Q;
|
|
205
|
+
{
|
|
206
|
+
var qe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
207
|
+
Q = new qe();
|
|
208
|
+
}
|
|
209
|
+
function we(e, r) {
|
|
210
|
+
if (!e || ie)
|
|
211
|
+
return "";
|
|
212
|
+
{
|
|
213
|
+
var t = Q.get(e);
|
|
214
|
+
if (t !== void 0)
|
|
215
|
+
return t;
|
|
216
|
+
}
|
|
217
|
+
var n;
|
|
218
|
+
ie = !0;
|
|
219
|
+
var s = Error.prepareStackTrace;
|
|
220
|
+
Error.prepareStackTrace = void 0;
|
|
221
|
+
var l;
|
|
222
|
+
l = ae.current, ae.current = null, Ue();
|
|
223
|
+
try {
|
|
224
|
+
if (r) {
|
|
225
|
+
var o = function() {
|
|
226
|
+
throw Error();
|
|
227
|
+
};
|
|
228
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
229
|
+
set: function() {
|
|
230
|
+
throw Error();
|
|
231
|
+
}
|
|
232
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
|
+
try {
|
|
234
|
+
Reflect.construct(o, []);
|
|
235
|
+
} catch (w) {
|
|
236
|
+
n = w;
|
|
237
|
+
}
|
|
238
|
+
Reflect.construct(e, [], o);
|
|
239
|
+
} else {
|
|
240
|
+
try {
|
|
241
|
+
o.call();
|
|
242
|
+
} catch (w) {
|
|
243
|
+
n = w;
|
|
244
|
+
}
|
|
245
|
+
e.call(o.prototype);
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
try {
|
|
249
|
+
throw Error();
|
|
250
|
+
} catch (w) {
|
|
251
|
+
n = w;
|
|
252
|
+
}
|
|
253
|
+
e();
|
|
254
|
+
}
|
|
255
|
+
} catch (w) {
|
|
256
|
+
if (w && n && typeof w.stack == "string") {
|
|
257
|
+
for (var a = w.stack.split(`
|
|
258
|
+
`), E = n.stack.split(`
|
|
259
|
+
`), f = a.length - 1, v = E.length - 1; f >= 1 && v >= 0 && a[f] !== E[v]; )
|
|
260
|
+
v--;
|
|
261
|
+
for (; f >= 1 && v >= 0; f--, v--)
|
|
262
|
+
if (a[f] !== E[v]) {
|
|
263
|
+
if (f !== 1 || v !== 1)
|
|
264
|
+
do
|
|
265
|
+
if (f--, v--, v < 0 || a[f] !== E[v]) {
|
|
266
|
+
var x = `
|
|
267
|
+
` + a[f].replace(" at new ", " at ");
|
|
268
|
+
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, x), x;
|
|
269
|
+
}
|
|
270
|
+
while (f >= 1 && v >= 0);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
} finally {
|
|
275
|
+
ie = !1, ae.current = l, Ne(), Error.prepareStackTrace = s;
|
|
276
|
+
}
|
|
277
|
+
var L = e ? e.displayName || e.name : "", A = L ? Z(L) : "";
|
|
278
|
+
return typeof e == "function" && Q.set(e, A), A;
|
|
279
|
+
}
|
|
280
|
+
function Be(e, r, t) {
|
|
281
|
+
return we(e, !1);
|
|
282
|
+
}
|
|
283
|
+
function Je(e) {
|
|
284
|
+
var r = e.prototype;
|
|
285
|
+
return !!(r && r.isReactComponent);
|
|
286
|
+
}
|
|
287
|
+
function ee(e, r, t) {
|
|
288
|
+
if (e == null)
|
|
289
|
+
return "";
|
|
290
|
+
if (typeof e == "function")
|
|
291
|
+
return we(e, Je(e));
|
|
292
|
+
if (typeof e == "string")
|
|
293
|
+
return Z(e);
|
|
294
|
+
switch (e) {
|
|
295
|
+
case P:
|
|
296
|
+
return Z("Suspense");
|
|
297
|
+
case m:
|
|
298
|
+
return Z("SuspenseList");
|
|
299
|
+
}
|
|
300
|
+
if (typeof e == "object")
|
|
301
|
+
switch (e.$$typeof) {
|
|
302
|
+
case d:
|
|
303
|
+
return Be(e.render);
|
|
304
|
+
case T:
|
|
305
|
+
return ee(e.type, r, t);
|
|
306
|
+
case c: {
|
|
307
|
+
var n = e, s = n._payload, l = n._init;
|
|
308
|
+
try {
|
|
309
|
+
return ee(l(s), r, t);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
var K = Object.prototype.hasOwnProperty, Te = {}, Se = D.ReactDebugCurrentFrame;
|
|
317
|
+
function re(e) {
|
|
318
|
+
if (e) {
|
|
319
|
+
var r = e._owner, t = ee(e.type, e._source, r ? r.type : null);
|
|
320
|
+
Se.setExtraStackFrame(t);
|
|
321
|
+
} else
|
|
322
|
+
Se.setExtraStackFrame(null);
|
|
323
|
+
}
|
|
324
|
+
function Xe(e, r, t, n, s) {
|
|
325
|
+
{
|
|
326
|
+
var l = Function.call.bind(K);
|
|
327
|
+
for (var o in e)
|
|
328
|
+
if (l(e, o)) {
|
|
329
|
+
var a = void 0;
|
|
330
|
+
try {
|
|
331
|
+
if (typeof e[o] != "function") {
|
|
332
|
+
var E = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
|
+
throw E.name = "Invariant Violation", E;
|
|
334
|
+
}
|
|
335
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
|
+
} catch (f) {
|
|
337
|
+
a = f;
|
|
338
|
+
}
|
|
339
|
+
a && !(a instanceof Error) && (re(s), i("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), re(null)), a instanceof Error && !(a.message in Te) && (Te[a.message] = !0, re(s), i("Failed %s type: %s", t, a.message), re(null));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
var ze = Array.isArray;
|
|
344
|
+
function ue(e) {
|
|
345
|
+
return ze(e);
|
|
346
|
+
}
|
|
347
|
+
function Ge(e) {
|
|
348
|
+
{
|
|
349
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
350
|
+
return t;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function He(e) {
|
|
354
|
+
try {
|
|
355
|
+
return Ce(e), !1;
|
|
356
|
+
} catch {
|
|
357
|
+
return !0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function Ce(e) {
|
|
361
|
+
return "" + e;
|
|
362
|
+
}
|
|
363
|
+
function Oe(e) {
|
|
364
|
+
if (He(e))
|
|
365
|
+
return i("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), Ce(e);
|
|
366
|
+
}
|
|
367
|
+
var U = D.ReactCurrentOwner, Ze = {
|
|
368
|
+
key: !0,
|
|
369
|
+
ref: !0,
|
|
370
|
+
__self: !0,
|
|
371
|
+
__source: !0
|
|
372
|
+
}, xe, Pe, se;
|
|
373
|
+
se = {};
|
|
374
|
+
function Qe(e) {
|
|
375
|
+
if (K.call(e, "ref")) {
|
|
376
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
+
if (r && r.isReactWarning)
|
|
378
|
+
return !1;
|
|
379
|
+
}
|
|
380
|
+
return e.ref !== void 0;
|
|
381
|
+
}
|
|
382
|
+
function er(e) {
|
|
383
|
+
if (K.call(e, "key")) {
|
|
384
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
+
if (r && r.isReactWarning)
|
|
386
|
+
return !1;
|
|
387
|
+
}
|
|
388
|
+
return e.key !== void 0;
|
|
389
|
+
}
|
|
390
|
+
function rr(e, r) {
|
|
391
|
+
if (typeof e.ref == "string" && U.current && r && U.current.stateNode !== r) {
|
|
392
|
+
var t = _(U.current.type);
|
|
393
|
+
se[t] || (i('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', _(U.current.type), e.ref), se[t] = !0);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
function tr(e, r) {
|
|
397
|
+
{
|
|
398
|
+
var t = function() {
|
|
399
|
+
xe || (xe = !0, i("%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://reactjs.org/link/special-props)", r));
|
|
400
|
+
};
|
|
401
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
|
+
get: t,
|
|
403
|
+
configurable: !0
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function nr(e, r) {
|
|
408
|
+
{
|
|
409
|
+
var t = function() {
|
|
410
|
+
Pe || (Pe = !0, i("%s: `ref` 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://reactjs.org/link/special-props)", r));
|
|
411
|
+
};
|
|
412
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
|
+
get: t,
|
|
414
|
+
configurable: !0
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
var ar = function(e, r, t, n, s, l, o) {
|
|
419
|
+
var a = {
|
|
420
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
+
$$typeof: p,
|
|
422
|
+
// Built-in properties that belong on the element
|
|
423
|
+
type: e,
|
|
424
|
+
key: r,
|
|
425
|
+
ref: t,
|
|
426
|
+
props: o,
|
|
427
|
+
// Record the component responsible for creating this element.
|
|
428
|
+
_owner: l
|
|
429
|
+
};
|
|
430
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
431
|
+
configurable: !1,
|
|
432
|
+
enumerable: !1,
|
|
433
|
+
writable: !0,
|
|
434
|
+
value: !1
|
|
435
|
+
}), Object.defineProperty(a, "_self", {
|
|
436
|
+
configurable: !1,
|
|
437
|
+
enumerable: !1,
|
|
438
|
+
writable: !1,
|
|
439
|
+
value: n
|
|
440
|
+
}), Object.defineProperty(a, "_source", {
|
|
441
|
+
configurable: !1,
|
|
442
|
+
enumerable: !1,
|
|
443
|
+
writable: !1,
|
|
444
|
+
value: s
|
|
445
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
446
|
+
};
|
|
447
|
+
function or(e, r, t, n, s) {
|
|
448
|
+
{
|
|
449
|
+
var l, o = {}, a = null, E = null;
|
|
450
|
+
t !== void 0 && (Oe(t), a = "" + t), er(r) && (Oe(r.key), a = "" + r.key), Qe(r) && (E = r.ref, rr(r, s));
|
|
451
|
+
for (l in r)
|
|
452
|
+
K.call(r, l) && !Ze.hasOwnProperty(l) && (o[l] = r[l]);
|
|
453
|
+
if (e && e.defaultProps) {
|
|
454
|
+
var f = e.defaultProps;
|
|
455
|
+
for (l in f)
|
|
456
|
+
o[l] === void 0 && (o[l] = f[l]);
|
|
457
|
+
}
|
|
458
|
+
if (a || E) {
|
|
459
|
+
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
+
a && tr(o, v), E && nr(o, v);
|
|
461
|
+
}
|
|
462
|
+
return ar(e, a, E, s, n, U.current, o);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
var le = D.ReactCurrentOwner, ke = D.ReactDebugCurrentFrame;
|
|
466
|
+
function M(e) {
|
|
467
|
+
if (e) {
|
|
468
|
+
var r = e._owner, t = ee(e.type, e._source, r ? r.type : null);
|
|
469
|
+
ke.setExtraStackFrame(t);
|
|
470
|
+
} else
|
|
471
|
+
ke.setExtraStackFrame(null);
|
|
472
|
+
}
|
|
473
|
+
var ce;
|
|
474
|
+
ce = !1;
|
|
475
|
+
function fe(e) {
|
|
476
|
+
return typeof e == "object" && e !== null && e.$$typeof === p;
|
|
477
|
+
}
|
|
478
|
+
function je() {
|
|
479
|
+
{
|
|
480
|
+
if (le.current) {
|
|
481
|
+
var e = _(le.current.type);
|
|
482
|
+
if (e)
|
|
483
|
+
return `
|
|
484
|
+
|
|
485
|
+
Check the render method of \`` + e + "`.";
|
|
486
|
+
}
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
function ir(e) {
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
var De = {};
|
|
494
|
+
function ur(e) {
|
|
495
|
+
{
|
|
496
|
+
var r = je();
|
|
497
|
+
if (!r) {
|
|
498
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
499
|
+
t && (r = `
|
|
500
|
+
|
|
501
|
+
Check the top-level render call using <` + t + ">.");
|
|
502
|
+
}
|
|
503
|
+
return r;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function Fe(e, r) {
|
|
507
|
+
{
|
|
508
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
509
|
+
return;
|
|
510
|
+
e._store.validated = !0;
|
|
511
|
+
var t = ur(r);
|
|
512
|
+
if (De[t])
|
|
513
|
+
return;
|
|
514
|
+
De[t] = !0;
|
|
515
|
+
var n = "";
|
|
516
|
+
e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + _(e._owner.type) + "."), M(e), i('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), M(null);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function Ae(e, r) {
|
|
520
|
+
{
|
|
521
|
+
if (typeof e != "object")
|
|
522
|
+
return;
|
|
523
|
+
if (ue(e))
|
|
524
|
+
for (var t = 0; t < e.length; t++) {
|
|
525
|
+
var n = e[t];
|
|
526
|
+
fe(n) && Fe(n, r);
|
|
527
|
+
}
|
|
528
|
+
else if (fe(e))
|
|
529
|
+
e._store && (e._store.validated = !0);
|
|
530
|
+
else if (e) {
|
|
531
|
+
var s = V(e);
|
|
532
|
+
if (typeof s == "function" && s !== e.entries)
|
|
533
|
+
for (var l = s.call(e), o; !(o = l.next()).done; )
|
|
534
|
+
fe(o.value) && Fe(o.value, r);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function sr(e) {
|
|
539
|
+
{
|
|
540
|
+
var r = e.type;
|
|
541
|
+
if (r == null || typeof r == "string")
|
|
542
|
+
return;
|
|
543
|
+
var t;
|
|
544
|
+
if (typeof r == "function")
|
|
545
|
+
t = r.propTypes;
|
|
546
|
+
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
|
547
|
+
// Inner props are checked in the reconciler.
|
|
548
|
+
r.$$typeof === T))
|
|
549
|
+
t = r.propTypes;
|
|
550
|
+
else
|
|
551
|
+
return;
|
|
552
|
+
if (t) {
|
|
553
|
+
var n = _(r);
|
|
554
|
+
Xe(t, e.props, "prop", n, e);
|
|
555
|
+
} else if (r.PropTypes !== void 0 && !ce) {
|
|
556
|
+
ce = !0;
|
|
557
|
+
var s = _(r);
|
|
558
|
+
i("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
559
|
+
}
|
|
560
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && i("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
function lr(e) {
|
|
564
|
+
{
|
|
565
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
566
|
+
var n = r[t];
|
|
567
|
+
if (n !== "children" && n !== "key") {
|
|
568
|
+
M(e), i("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), M(null);
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
e.ref !== null && (M(e), i("Invalid attribute `ref` supplied to `React.Fragment`."), M(null));
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
var Ve = {};
|
|
576
|
+
function Ie(e, r, t, n, s, l) {
|
|
577
|
+
{
|
|
578
|
+
var o = X(e);
|
|
579
|
+
if (!o) {
|
|
580
|
+
var a = "";
|
|
581
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
582
|
+
var E = ir();
|
|
583
|
+
E ? a += E : a += je();
|
|
584
|
+
var f;
|
|
585
|
+
e === null ? f = "null" : ue(e) ? f = "array" : e !== void 0 && e.$$typeof === p ? (f = "<" + (_(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, i("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a);
|
|
586
|
+
}
|
|
587
|
+
var v = or(e, r, t, s, l);
|
|
588
|
+
if (v == null)
|
|
589
|
+
return v;
|
|
590
|
+
if (o) {
|
|
591
|
+
var x = r.children;
|
|
592
|
+
if (x !== void 0)
|
|
593
|
+
if (n)
|
|
594
|
+
if (ue(x)) {
|
|
595
|
+
for (var L = 0; L < x.length; L++)
|
|
596
|
+
Ae(x[L], e);
|
|
597
|
+
Object.freeze && Object.freeze(x);
|
|
598
|
+
} else
|
|
599
|
+
i("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
|
+
else
|
|
601
|
+
Ae(x, e);
|
|
602
|
+
}
|
|
603
|
+
if (K.call(r, "key")) {
|
|
604
|
+
var A = _(e), w = Object.keys(r).filter(function(yr) {
|
|
605
|
+
return yr !== "key";
|
|
606
|
+
}), de = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
+
if (!Ve[A + de]) {
|
|
608
|
+
var mr = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
+
i(`A props object containing a "key" prop is being spread into JSX:
|
|
610
|
+
let props = %s;
|
|
611
|
+
<%s {...props} />
|
|
612
|
+
React keys must be passed directly to JSX without using spread:
|
|
613
|
+
let props = %s;
|
|
614
|
+
<%s key={someKey} {...props} />`, de, A, mr, A), Ve[A + de] = !0;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return e === u ? lr(v) : sr(v), v;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function cr(e, r, t) {
|
|
621
|
+
return Ie(e, r, t, !0);
|
|
622
|
+
}
|
|
623
|
+
function fr(e, r, t) {
|
|
624
|
+
return Ie(e, r, t, !1);
|
|
625
|
+
}
|
|
626
|
+
var dr = fr, vr = cr;
|
|
627
|
+
q.Fragment = u, q.jsx = dr, q.jsxs = vr;
|
|
628
|
+
}()), q;
|
|
629
|
+
}
|
|
630
|
+
process.env.NODE_ENV === "production" ? ye.exports = pr() : ye.exports = hr();
|
|
631
|
+
var Ye = ye.exports;
|
|
632
|
+
function Er() {
|
|
633
|
+
let g = "";
|
|
634
|
+
return function(k) {
|
|
635
|
+
const u = /^-?\d*([.,]?)\d*$/, C = k.match(u);
|
|
636
|
+
return C && (g = C[0]), g;
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
const Ke = (g) => {
|
|
640
|
+
const p = g.toString().split(".");
|
|
641
|
+
return p.length > 1 ? p[1].length : 0;
|
|
642
|
+
}, br = Er(), Rr = gr(
|
|
643
|
+
({ mask: g = br, onChange: p, step: k = 1, value: u, ...C }, j) => {
|
|
644
|
+
const [O, h] = te(u || ""), d = j || We(null), P = (c) => {
|
|
645
|
+
const { value: b } = c.target, S = g(b);
|
|
646
|
+
if (h(S), p) {
|
|
647
|
+
const F = {
|
|
648
|
+
...c,
|
|
649
|
+
target: {
|
|
650
|
+
...c.target,
|
|
651
|
+
value: S.replace(",", ".")
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
p(F);
|
|
655
|
+
}
|
|
656
|
+
}, m = (c, b) => {
|
|
657
|
+
const S = parseFloat(O.replace(",", ".")) || 0, F = parseFloat(k.toString()), V = Ke(+k), i = (b ? S + F : S - F).toFixed(V), R = g(i);
|
|
658
|
+
if (h(R), p) {
|
|
659
|
+
const W = {
|
|
660
|
+
...new Event("change", { bubbles: !0 }),
|
|
661
|
+
target: {
|
|
662
|
+
...c.target,
|
|
663
|
+
value: R.replace(",", ".")
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
p(W);
|
|
667
|
+
}
|
|
668
|
+
}, T = (c) => {
|
|
669
|
+
c.key === "ArrowUp" ? (c.preventDefault(), m(c, !0)) : c.key === "ArrowDown" && (c.preventDefault(), m(c, !1));
|
|
670
|
+
};
|
|
671
|
+
return me(() => {
|
|
672
|
+
h(u || "");
|
|
673
|
+
}, [u]), /* @__PURE__ */ Ye.jsx(
|
|
674
|
+
"input",
|
|
675
|
+
{
|
|
676
|
+
...C,
|
|
677
|
+
type: "text",
|
|
678
|
+
ref: d,
|
|
679
|
+
value: O,
|
|
680
|
+
onChange: P,
|
|
681
|
+
onKeyDown: T
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
);
|
|
686
|
+
function wr({
|
|
687
|
+
value: g,
|
|
688
|
+
modifiers: p = {
|
|
689
|
+
altKey: 1,
|
|
690
|
+
ctrlKey: 1,
|
|
691
|
+
metaKey: 1,
|
|
692
|
+
shiftKey: 0.1
|
|
693
|
+
},
|
|
694
|
+
style: k = {},
|
|
695
|
+
...u
|
|
696
|
+
}) {
|
|
697
|
+
const [C, j] = te(String(g || 0)), [O, h] = te(""), [, d] = te([0, 0]), P = We(0), m = u.step ? +u.step : 1, T = { cursor: "ew-resize", ...k }, c = (i) => {
|
|
698
|
+
var R;
|
|
699
|
+
j(i.target.value), i.target.value !== "-" && ((R = u.onChange) == null || R.call(u, i));
|
|
700
|
+
}, b = ve(
|
|
701
|
+
(i) => {
|
|
702
|
+
d((R) => {
|
|
703
|
+
const { clientX: $, clientY: W } = i, [B, ne] = R, J = B - $, Y = ne - W;
|
|
704
|
+
let X = 1;
|
|
705
|
+
O && (X = p[O] || 1);
|
|
706
|
+
const z = m * X, G = Ke(z);
|
|
707
|
+
let _ = Math.sqrt(J * J + Y * Y) * z;
|
|
708
|
+
$ < B && (_ = -_);
|
|
709
|
+
let y = P.current + _;
|
|
710
|
+
if (u.min && (y = Math.max(y, +u.min)), u.max && (y = Math.min(y, +u.max)), y = +y.toFixed(G), y && j(String(y)), y && u.onChange) {
|
|
711
|
+
const H = {
|
|
712
|
+
...new Event("change", { bubbles: !0 }),
|
|
713
|
+
target: {
|
|
714
|
+
...i.target,
|
|
715
|
+
value: y
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
u.onChange(
|
|
719
|
+
H
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
return R;
|
|
723
|
+
});
|
|
724
|
+
},
|
|
725
|
+
[O, u.max, u.min, m, p]
|
|
726
|
+
), S = ve(() => {
|
|
727
|
+
document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", S);
|
|
728
|
+
}, [b]), F = ve(
|
|
729
|
+
(i) => {
|
|
730
|
+
let R = +C;
|
|
731
|
+
isNaN(R) && (R = +(u.defaultValue || u.min || 0)), P.current = R, d([i.clientX, i.clientY]), document.addEventListener("mousemove", b), document.addEventListener("mouseup", S);
|
|
732
|
+
},
|
|
733
|
+
[b, S, g, u.min, u.defaultValue]
|
|
734
|
+
), V = (i) => {
|
|
735
|
+
i.metaKey ? h("metaKey") : i.ctrlKey ? h("ctrlKey") : i.altKey ? h("altKey") : i.shiftKey && h("shiftKey");
|
|
736
|
+
}, D = () => {
|
|
737
|
+
h("");
|
|
738
|
+
};
|
|
739
|
+
return me(() => {
|
|
740
|
+
j(String(g || 0));
|
|
741
|
+
}, [g]), me(() => (document.addEventListener("keydown", V), document.addEventListener("keyup", D), () => {
|
|
742
|
+
document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", S), document.removeEventListener("keydown", V), document.removeEventListener("keyup", D);
|
|
743
|
+
}), []), /* @__PURE__ */ Ye.jsx(
|
|
744
|
+
Rr,
|
|
745
|
+
{
|
|
746
|
+
...u,
|
|
747
|
+
style: T,
|
|
748
|
+
onChange: c,
|
|
749
|
+
onMouseDown: F,
|
|
750
|
+
value: C
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
export {
|
|
755
|
+
wr as InteractiveInput,
|
|
756
|
+
Rr as MaskedInput
|
|
757
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type InputModifier = 'shiftKey' | 'altKey' | 'ctrlKey' | 'metaKey';
|
|
2
|
+
export type Modifiers = {
|
|
3
|
+
[key in InputModifier]?: number;
|
|
4
|
+
};
|
|
5
|
+
interface InteractiveInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Modifiers to apply to the input value. Defaults to `{ shiftKey: 0.1 }`.
|
|
8
|
+
*/
|
|
9
|
+
modifiers?: Modifiers;
|
|
10
|
+
value?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Main component for the InteractiveInput
|
|
14
|
+
*/
|
|
15
|
+
export default function InteractiveInput({ value, modifiers, style: _style, ...props }: InteractiveInputProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type MaskFunction } from './masks';
|
|
2
|
+
interface MaskedInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Masking function to apply to the input value. Defaults to `numberMask` which ensures that the input value is a valid number, including negative numbers.
|
|
5
|
+
*/
|
|
6
|
+
mask?: MaskFunction;
|
|
7
|
+
value?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A React input component featuring input masking specifically designed to address limitations with negative numbers in standard HTML input elements. This component ensures that negative values are properly formatted and accepted by the input field, preventing unexpected behavior or errors when handling signed numbers.
|
|
11
|
+
*/
|
|
12
|
+
declare const MaskedInput: import("react").ForwardRefExoticComponent<MaskedInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export default MaskedInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDecimalPlaces: (step: number) => number;
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@designbyadrian/react-interactive-input",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Adjust values in numeric input boxes by clicking and dragging horizontally, just like in Blender and similar 3D applications.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"input",
|
|
8
|
+
"draggable",
|
|
9
|
+
"scrubb",
|
|
10
|
+
"click-and-drag input",
|
|
11
|
+
"interactive number field",
|
|
12
|
+
"blender"
|
|
13
|
+
],
|
|
14
|
+
"author": "Adrian von Gegerfelt <adrian@designbyadrian.com>",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "dist/react-interactive-input.cjs.js",
|
|
17
|
+
"module": "dist/react-interactive-input.es.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/react-interactive-input.es.js",
|
|
21
|
+
"require": "./dist/react-interactive-input.cjs.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/designbyadrian/react-interactive-input.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/designbyadrian/react-interactive-input/issues"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^18.2.0",
|
|
38
|
+
"react-dom": "^18.2.0"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20.0.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "storybook dev -p 6006 --no-open",
|
|
45
|
+
"build-storybook": "storybook build",
|
|
46
|
+
"build": "vite build && tsc --project tsconfig.json",
|
|
47
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
49
|
+
"deploy-storybook": "npm run build-storybook && touch ./storybook-static/.nojekyll && gh-pages -d storybook-static -t true"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@chromatic-com/storybook": "3.2.2",
|
|
53
|
+
"@storybook/addon-a11y": "^8.5.0-alpha.3",
|
|
54
|
+
"@storybook/addon-essentials": "8.5.0-alpha.3",
|
|
55
|
+
"@storybook/addon-interactions": "8.5.0-alpha.3",
|
|
56
|
+
"@storybook/addon-links": "8.5.0-alpha.3",
|
|
57
|
+
"@storybook/addon-onboarding": "8.5.0-alpha.3",
|
|
58
|
+
"@storybook/blocks": "8.5.0-alpha.3",
|
|
59
|
+
"@storybook/react": "8.5.0-alpha.3",
|
|
60
|
+
"@storybook/react-vite": "8.5.0-alpha.3",
|
|
61
|
+
"@storybook/test": "8.5.0-alpha.3",
|
|
62
|
+
"@types/react": "18.3.12",
|
|
63
|
+
"@vitejs/plugin-react": "4.3.3",
|
|
64
|
+
"eslint": "9.14.0",
|
|
65
|
+
"gh-pages": "6.2.0",
|
|
66
|
+
"storybook": "8.5.0-alpha.3",
|
|
67
|
+
"typescript": "5.6.3",
|
|
68
|
+
"vite": "5.4.10"
|
|
69
|
+
}
|
|
70
|
+
}
|