@tremolo-ui/react 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +59 -0
- package/dist/cjs/index.d.ts +79 -0
- package/dist/cjs/index.js +397 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/types/src/components/Knob/index.d.ts +23 -0
- package/dist/cjs/types/src/components/Knob/index.d.ts.map +1 -0
- package/dist/cjs/types/src/components/Slider/index.d.ts +27 -0
- package/dist/cjs/types/src/components/Slider/index.d.ts.map +1 -0
- package/dist/cjs/types/src/components/Slider/type.d.ts +26 -0
- package/dist/cjs/types/src/components/Slider/type.d.ts.map +1 -0
- package/dist/cjs/types/src/hooks/useCallbackRef.d.ts +6 -0
- package/dist/cjs/types/src/hooks/useCallbackRef.d.ts.map +1 -0
- package/dist/cjs/types/src/hooks/useEventListener.d.ts +7 -0
- package/dist/cjs/types/src/hooks/useEventListener.d.ts.map +1 -0
- package/dist/cjs/types/src/index.d.ts +5 -0
- package/dist/cjs/types/src/index.d.ts.map +1 -0
- package/dist/cjs/types/src/math.d.ts +8 -0
- package/dist/cjs/types/src/math.d.ts.map +1 -0
- package/dist/cjs/types/src/types.d.ts +2 -0
- package/dist/cjs/types/src/types.d.ts.map +1 -0
- package/dist/cjs/types/src/util.d.ts +2 -0
- package/dist/cjs/types/src/util.d.ts.map +1 -0
- package/dist/esm/index.d.ts +79 -0
- package/dist/esm/index.js +387 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types/src/components/Knob/index.d.ts +23 -0
- package/dist/esm/types/src/components/Knob/index.d.ts.map +1 -0
- package/dist/esm/types/src/components/Slider/index.d.ts +27 -0
- package/dist/esm/types/src/components/Slider/index.d.ts.map +1 -0
- package/dist/esm/types/src/components/Slider/type.d.ts +26 -0
- package/dist/esm/types/src/components/Slider/type.d.ts.map +1 -0
- package/dist/esm/types/src/hooks/useCallbackRef.d.ts +6 -0
- package/dist/esm/types/src/hooks/useCallbackRef.d.ts.map +1 -0
- package/dist/esm/types/src/hooks/useEventListener.d.ts +7 -0
- package/dist/esm/types/src/hooks/useEventListener.d.ts.map +1 -0
- package/dist/esm/types/src/index.d.ts +5 -0
- package/dist/esm/types/src/index.d.ts.map +1 -0
- package/dist/esm/types/src/math.d.ts +8 -0
- package/dist/esm/types/src/math.d.ts.map +1 -0
- package/dist/esm/types/src/types.d.ts +2 -0
- package/dist/esm/types/src/types.d.ts.map +1 -0
- package/dist/esm/types/src/util.d.ts +2 -0
- package/dist/esm/types/src/util.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +90 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 mimoz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
<!-- TODO: set cover image URL, and image size.
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://live.staticflickr.com/635/21189618838_b1a1e7f12e_b.jpg" alt="cover image" width="70%" />
|
|
5
|
+
</div> -->
|
|
6
|
+
|
|
7
|
+
*tremolo-ui is now WIP*
|
|
8
|
+
|
|
9
|
+
# 🚩 Goals
|
|
10
|
+
|
|
11
|
+
- Components with usability and flexibility
|
|
12
|
+
- Mobile Support
|
|
13
|
+
- Distribute package
|
|
14
|
+
- React
|
|
15
|
+
- Web Components
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# [tremolo-ui](https://github.io/m1m0zzz/tremolo-ui)
|
|
20
|
+
|
|
21
|
+
UI library for Web Audio App
|
|
22
|
+
|
|
23
|
+
## 🧬 Installation
|
|
24
|
+
|
|
25
|
+
### React
|
|
26
|
+
|
|
27
|
+
Install tremolo-ui
|
|
28
|
+
```bash
|
|
29
|
+
npm install --save-dev @tremolo-ui/react
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
And install dependencies
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install --save-dev react react-dom @emotion/react
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Web Components
|
|
39
|
+
|
|
40
|
+
Install tremolo-ui
|
|
41
|
+
```bash
|
|
42
|
+
npm install --save-dev @tremolo-ui/web-components
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 📚 Docs
|
|
47
|
+
|
|
48
|
+
documentation w/ Storybook
|
|
49
|
+
|
|
50
|
+
[Docs](https://main--66c84646f5ab3514847ae4d5.chromatic.com/)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## 🦝 Contributing
|
|
54
|
+
Please see [contribution guide](./CONTRIBUTING.md)
|
|
55
|
+
|
|
56
|
+
日本語版は [コントリビューション ガイド](./CONTRIBUTING.ja.md) を参照してください。
|
|
57
|
+
|
|
58
|
+
## 📜 LICENSE
|
|
59
|
+
tremolo-ui is [MIT License](./LICENSE)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { WheelOption as WheelOption$1 } from '@/types';
|
|
3
|
+
import React$1, { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
declare function clamp(value: number, min: number, max: number): number;
|
|
6
|
+
declare function normalizeValue(rawValue: number, min: number, max: number, skew?: number): number;
|
|
7
|
+
declare function rawValue(normalizedValue: number, min: number, max: number, skew?: number): number;
|
|
8
|
+
declare function skewWithCenterValue(centerValue: number, min: number, max: number): number;
|
|
9
|
+
declare function stepValue(value: number, step: number): number;
|
|
10
|
+
declare function toFixed(x: number, fractionDigits?: number): number;
|
|
11
|
+
declare function decimalPart(x: number | string): string | undefined;
|
|
12
|
+
|
|
13
|
+
type WheelOption = ['normalized' | 'raw', number];
|
|
14
|
+
|
|
15
|
+
interface KnobProps {
|
|
16
|
+
value: number;
|
|
17
|
+
min: number;
|
|
18
|
+
max: number;
|
|
19
|
+
step?: number;
|
|
20
|
+
skew?: number;
|
|
21
|
+
size?: number | string;
|
|
22
|
+
active?: string;
|
|
23
|
+
inactive?: string;
|
|
24
|
+
bg?: string;
|
|
25
|
+
thumb?: string;
|
|
26
|
+
lineWeight?: number | string;
|
|
27
|
+
thumbWeight?: number | string;
|
|
28
|
+
cursor?: string;
|
|
29
|
+
style?: React.CSSProperties;
|
|
30
|
+
bodyNoSelect?: boolean;
|
|
31
|
+
enableWheel?: WheelOption$1;
|
|
32
|
+
onChange?: (value: number) => void;
|
|
33
|
+
}
|
|
34
|
+
declare function Knob({ value, min, max, step, skew, size, active, inactive, bg, thumb, lineWeight, thumbWeight, cursor, style, bodyNoSelect, enableWheel, onChange, }: KnobProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
35
|
+
|
|
36
|
+
type Horizontal = 'right' | 'left';
|
|
37
|
+
type Vertical = 'up' | 'down';
|
|
38
|
+
type Direction = Horizontal | Vertical;
|
|
39
|
+
type ScaleType = 'mark' | 'mark-number' | 'number';
|
|
40
|
+
type ScaleOrderList = {
|
|
41
|
+
at: number;
|
|
42
|
+
type: ScaleType;
|
|
43
|
+
style?: {
|
|
44
|
+
markColor?: string;
|
|
45
|
+
labelColor?: string;
|
|
46
|
+
length?: number | string;
|
|
47
|
+
thickness?: number | string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type ScaleOption = {
|
|
51
|
+
markColor?: string;
|
|
52
|
+
labelColor?: string;
|
|
53
|
+
gap?: number | string;
|
|
54
|
+
style?: React.CSSProperties;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
interface SliderProps {
|
|
58
|
+
value: number;
|
|
59
|
+
min: number;
|
|
60
|
+
max: number;
|
|
61
|
+
step?: number;
|
|
62
|
+
length?: number | string;
|
|
63
|
+
thickness?: number | string;
|
|
64
|
+
direction?: Direction;
|
|
65
|
+
skew?: number;
|
|
66
|
+
scale?: ['step', ScaleType] | [number, ScaleType] | ScaleOrderList[];
|
|
67
|
+
scaleOption?: ScaleOption;
|
|
68
|
+
color?: string;
|
|
69
|
+
bg?: string;
|
|
70
|
+
cursor?: string;
|
|
71
|
+
style?: React$1.CSSProperties;
|
|
72
|
+
bodyNoSelect?: boolean;
|
|
73
|
+
enableWheel?: WheelOption$1;
|
|
74
|
+
onChange?: (value: number) => void;
|
|
75
|
+
children?: ReactNode;
|
|
76
|
+
}
|
|
77
|
+
declare function Slider({ value, min, max, step, length, thickness, direction, skew, scale, scaleOption, color, bg, cursor, style, bodyNoSelect, enableWheel, onChange, children, }: SliderProps): _emotion_react_jsx_runtime.JSX.Element;
|
|
78
|
+
|
|
79
|
+
export { Knob, Slider, type WheelOption, clamp, decimalPart, normalizeValue, rawValue, skewWithCenterValue, stepValue, toFixed };
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
4
|
+
var react$1 = require('@emotion/react');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
7
|
+
function clamp(value, min, max) {
|
|
8
|
+
return Math.max(min, Math.min(value, max));
|
|
9
|
+
}
|
|
10
|
+
function normalizeValue(rawValue, min, max, skew = 1) {
|
|
11
|
+
if (min >= max)
|
|
12
|
+
throw new RangeError('requirements: min < max');
|
|
13
|
+
const v = clamp((rawValue - min) / (max - min), 0, 1);
|
|
14
|
+
return Math.pow(v, skew);
|
|
15
|
+
}
|
|
16
|
+
function rawValue(normalizedValue, min, max, skew = 1) {
|
|
17
|
+
if (min >= max)
|
|
18
|
+
throw new RangeError('requirements: min < max');
|
|
19
|
+
const v = skew == 1
|
|
20
|
+
? clamp(normalizedValue, 0, 1)
|
|
21
|
+
: Math.exp(Math.log(clamp(normalizedValue, 0, 1)) / skew);
|
|
22
|
+
return min + v * (max - min);
|
|
23
|
+
}
|
|
24
|
+
function skewWithCenterValue(centerValue, min, max) {
|
|
25
|
+
if (!(min <= centerValue && centerValue <= max))
|
|
26
|
+
throw new RangeError('requirements: min <= centerValue <= max');
|
|
27
|
+
return Math.log(0.5) / Math.log((centerValue - min) / (max - min));
|
|
28
|
+
}
|
|
29
|
+
function stepValue(value, step) {
|
|
30
|
+
var _a;
|
|
31
|
+
if (step <= 0)
|
|
32
|
+
throw new RangeError('requirements: step > 0');
|
|
33
|
+
const quotient = Math.floor(value / step);
|
|
34
|
+
const decimalDigits = (_a = decimalPart(step)) === null || _a === void 0 ? void 0 : _a.length;
|
|
35
|
+
const v = toFixed(quotient * step, decimalDigits);
|
|
36
|
+
const next = toFixed((quotient + 1) * step, decimalDigits);
|
|
37
|
+
return Math.abs(value - v) < Math.abs(value - next) ? v : next;
|
|
38
|
+
}
|
|
39
|
+
function toFixed(x, fractionDigits) {
|
|
40
|
+
return Number(x.toFixed(fractionDigits));
|
|
41
|
+
}
|
|
42
|
+
function decimalPart(x) {
|
|
43
|
+
return String(x).split('.')[1];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* This hook is user-land implementation of the experimental `useEffectEvent` hook.
|
|
48
|
+
* React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
|
|
49
|
+
*/
|
|
50
|
+
function useCallbackRef(callback, deps = []) {
|
|
51
|
+
const callbackRef = react.useRef(() => {
|
|
52
|
+
throw new Error('Cannot call an event handler while rendering.');
|
|
53
|
+
});
|
|
54
|
+
react.useInsertionEffect(() => {
|
|
55
|
+
callbackRef.current = callback;
|
|
56
|
+
});
|
|
57
|
+
return react.useCallback((...args) => { var _a; return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args); }, deps);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function useEventListener(target, event, handler, options) {
|
|
61
|
+
const listener = useCallbackRef(handler);
|
|
62
|
+
react.useEffect(() => {
|
|
63
|
+
const node = typeof target === 'function' ? target() : (target !== null && target !== void 0 ? target : document);
|
|
64
|
+
if (!handler || !node)
|
|
65
|
+
return;
|
|
66
|
+
node.addEventListener(event, listener, options);
|
|
67
|
+
return () => {
|
|
68
|
+
node.removeEventListener(event, listener, options);
|
|
69
|
+
};
|
|
70
|
+
}, [event, target, options, listener, handler]);
|
|
71
|
+
return () => {
|
|
72
|
+
const node = typeof target === 'function' ? target() : (target !== null && target !== void 0 ? target : document);
|
|
73
|
+
node === null || node === void 0 ? void 0 : node.removeEventListener(event, listener, options);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function styleHelper(property) {
|
|
78
|
+
if (typeof property == 'number') {
|
|
79
|
+
return `${property}px`;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return property;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function Knob({ value, min, max, step = 1, skew = 1, size = 50, active = '#7998ec', inactive = '#eee', bg = '#ccc', thumb = '#4e76e6', lineWeight = 12, thumbWeight = 4, cursor = 'pointer', style, bodyNoSelect = true, enableWheel, onChange, }) {
|
|
87
|
+
// -- state and ref ---
|
|
88
|
+
// const [privateValue, setPrivateValue] = useState(value);
|
|
89
|
+
const dragOffsetY = react.useRef(undefined);
|
|
90
|
+
// --- interpret props ---
|
|
91
|
+
const percent = normalizeValue(value, min, max, skew);
|
|
92
|
+
const handleValue = (event) => {
|
|
93
|
+
if (dragOffsetY.current) {
|
|
94
|
+
if (bodyNoSelect)
|
|
95
|
+
document.body.classList.add('no-select');
|
|
96
|
+
const delta = dragOffsetY.current - event.screenY;
|
|
97
|
+
dragOffsetY.current = event.screenY;
|
|
98
|
+
const n = normalizeValue(value, min, max, skew);
|
|
99
|
+
const v = rawValue(n + delta / 100, min, max, skew);
|
|
100
|
+
const v2 = clamp(stepValue(v, step), min, max);
|
|
101
|
+
if (onChange)
|
|
102
|
+
onChange(v2);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
// --- hooks ---
|
|
106
|
+
const wrapperRef = react.useMemo(() => {
|
|
107
|
+
let cleanup;
|
|
108
|
+
return (div) => {
|
|
109
|
+
if (!div) {
|
|
110
|
+
cleanup === null || cleanup === void 0 ? void 0 : cleanup();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const controller = new AbortController();
|
|
114
|
+
div.addEventListener('wheel', (event) => {
|
|
115
|
+
if (!enableWheel)
|
|
116
|
+
return;
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
const x = event.deltaY > 0 ? -enableWheel[1] : enableWheel[1];
|
|
119
|
+
let v;
|
|
120
|
+
if (enableWheel[0] == 'normalized') {
|
|
121
|
+
const n = normalizeValue(value, min, max, skew);
|
|
122
|
+
v = rawValue(n + x, min, max, skew);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
v = value + x;
|
|
126
|
+
}
|
|
127
|
+
if (onChange)
|
|
128
|
+
onChange(clamp(stepValue(v, step), min, max));
|
|
129
|
+
}, {
|
|
130
|
+
signal: controller.signal,
|
|
131
|
+
passive: false,
|
|
132
|
+
});
|
|
133
|
+
cleanup = () => {
|
|
134
|
+
// console.log("cleanup")
|
|
135
|
+
controller.abort();
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
}, [value]);
|
|
139
|
+
useEventListener(window, 'mousemove', (event) => {
|
|
140
|
+
handleValue(event);
|
|
141
|
+
});
|
|
142
|
+
useEventListener(window, 'mouseup', () => {
|
|
143
|
+
dragOffsetY.current = undefined;
|
|
144
|
+
if (bodyNoSelect)
|
|
145
|
+
document.body.classList.remove('no-select');
|
|
146
|
+
});
|
|
147
|
+
return (jsxRuntime.jsx("div", { className: "tremolo-knob", ref: wrapperRef, onMouseDown: (event) => {
|
|
148
|
+
dragOffsetY.current = event.screenY;
|
|
149
|
+
handleValue(event);
|
|
150
|
+
}, style: Object.assign({ display: 'inline-block', width: size, height: size }, style), children: jsxRuntime.jsx("div", { css: react$1.css({
|
|
151
|
+
display: 'inline-block',
|
|
152
|
+
width: size,
|
|
153
|
+
height: size,
|
|
154
|
+
background: `conic-gradient(${active} ${percent * 270}deg, ${inactive} ${percent * 270}deg, ${inactive} ${270}deg, ${bg} 90deg)`,
|
|
155
|
+
borderRadius: '50%',
|
|
156
|
+
position: 'relative',
|
|
157
|
+
cursor: cursor,
|
|
158
|
+
rotate: '-135deg',
|
|
159
|
+
'&::before': {
|
|
160
|
+
display: 'block',
|
|
161
|
+
position: 'absolute',
|
|
162
|
+
right: 0,
|
|
163
|
+
left: 0,
|
|
164
|
+
top: 0,
|
|
165
|
+
bottom: 0,
|
|
166
|
+
margin: 'auto',
|
|
167
|
+
content: '""',
|
|
168
|
+
width: `calc(${styleHelper(size)} - ${styleHelper(lineWeight)})`,
|
|
169
|
+
height: `calc(${styleHelper(size)} - ${styleHelper(lineWeight)})`,
|
|
170
|
+
backgroundColor: bg,
|
|
171
|
+
borderRadius: '50%',
|
|
172
|
+
},
|
|
173
|
+
'&::after': {
|
|
174
|
+
display: 'block',
|
|
175
|
+
position: 'absolute',
|
|
176
|
+
top: 0,
|
|
177
|
+
bottom: 0,
|
|
178
|
+
// left: lineWeight,
|
|
179
|
+
margin: 'auto 0',
|
|
180
|
+
content: '""',
|
|
181
|
+
width: `calc(0.5 * ${styleHelper(size)})`,
|
|
182
|
+
height: thumbWeight,
|
|
183
|
+
borderRadius: thumbWeight,
|
|
184
|
+
backgroundColor: thumb,
|
|
185
|
+
rotate: `${90 + percent * 270}deg`,
|
|
186
|
+
transformOrigin: '100% 50%',
|
|
187
|
+
},
|
|
188
|
+
}), children: jsxRuntime.jsx(react$1.Global, { styles: {
|
|
189
|
+
'.no-select': {
|
|
190
|
+
userSelect: 'none',
|
|
191
|
+
},
|
|
192
|
+
} }) }) }));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function isHorizontal(d) {
|
|
196
|
+
return d == 'right' || d == 'left';
|
|
197
|
+
}
|
|
198
|
+
function isVertical(d) {
|
|
199
|
+
return d == 'up' || d == 'down';
|
|
200
|
+
}
|
|
201
|
+
function isReversed(d) {
|
|
202
|
+
return d == 'left' || d == 'up';
|
|
203
|
+
}
|
|
204
|
+
function gradientDirection(d) {
|
|
205
|
+
if (d == 'left' || d == 'right')
|
|
206
|
+
return d;
|
|
207
|
+
if (d == 'up')
|
|
208
|
+
return 'top';
|
|
209
|
+
if (d == 'down')
|
|
210
|
+
return 'bottom';
|
|
211
|
+
}
|
|
212
|
+
function parseScaleOrderList(scale, min, max, step) {
|
|
213
|
+
var _a;
|
|
214
|
+
let scalesList = [];
|
|
215
|
+
if (!scale) ;
|
|
216
|
+
else if (typeof scale[0] == 'object') {
|
|
217
|
+
scalesList = scale;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
const per = scale[0] == 'step' ? step : scale[0];
|
|
221
|
+
const count = Math.floor(max / per) - Math.ceil(min / per) + 1;
|
|
222
|
+
for (let i = 0; i < count; i++) {
|
|
223
|
+
const at = toFixed(per * (Math.ceil(min / per) + i), (_a = decimalPart(per)) === null || _a === void 0 ? void 0 : _a.length);
|
|
224
|
+
scalesList.push({ at: at, type: scale[1] });
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return scalesList;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// interface SliderThumbProps {}
|
|
231
|
+
function SliderThumb( /* {}: SliderThumbProps */) {
|
|
232
|
+
return jsxRuntime.jsx("div", {});
|
|
233
|
+
}
|
|
234
|
+
function Slider({ value, min, max, step = 1, length = 140, thickness = 10, direction = 'right', skew = 1, scale, scaleOption, color = '#4e76e6', bg = '#eee', cursor = 'pointer', style, bodyNoSelect = true, enableWheel, onChange, children, }) {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
// -- state and ref ---
|
|
237
|
+
const baseWrapperElement = react.useRef(null);
|
|
238
|
+
// --- interpret props ---
|
|
239
|
+
const percent = normalizeValue(value, min, max, skew) * 100;
|
|
240
|
+
const percentRev = isReversed(direction) ? 100 - percent : percent;
|
|
241
|
+
const scalesList = parseScaleOrderList(scale, min, max, step);
|
|
242
|
+
if (isReversed(direction))
|
|
243
|
+
scalesList.reverse();
|
|
244
|
+
// let defaultThumb = true
|
|
245
|
+
if (children != undefined) {
|
|
246
|
+
const childElements = react.Children.toArray(children);
|
|
247
|
+
const lastElement = childElements[childElements.length - 1];
|
|
248
|
+
if (react.isValidElement(lastElement)) {
|
|
249
|
+
// defaultThumb = false
|
|
250
|
+
if (lastElement.type == SliderThumb) ;
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
throw new Error('children is an invalid element.');
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const thumbDragged = react.useRef(false);
|
|
257
|
+
const handleValue = (event) => {
|
|
258
|
+
if (baseWrapperElement.current && thumbDragged.current) {
|
|
259
|
+
if (bodyNoSelect)
|
|
260
|
+
document.body.classList.add('no-select');
|
|
261
|
+
const { left: x1, top: y1, right: x2, bottom: y2, } = baseWrapperElement.current.getBoundingClientRect();
|
|
262
|
+
const mouseX = event.clientX;
|
|
263
|
+
const mouseY = event.clientY;
|
|
264
|
+
const n = isHorizontal(direction)
|
|
265
|
+
? normalizeValue(mouseX, x1, x2)
|
|
266
|
+
: normalizeValue(mouseY, y1, y2);
|
|
267
|
+
const v = rawValue(isReversed(direction) ? 1 - n : n, min, max, skew);
|
|
268
|
+
const v2 = clamp(stepValue(v, step), min, max);
|
|
269
|
+
if (onChange)
|
|
270
|
+
onChange(v2);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
// --- hooks ---
|
|
274
|
+
const wrapperRef = react.useMemo(() => {
|
|
275
|
+
let cleanup;
|
|
276
|
+
return (div) => {
|
|
277
|
+
if (!div) {
|
|
278
|
+
cleanup === null || cleanup === void 0 ? void 0 : cleanup();
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const controller = new AbortController();
|
|
282
|
+
div.addEventListener('wheel', (event) => {
|
|
283
|
+
if (!enableWheel)
|
|
284
|
+
return;
|
|
285
|
+
event.preventDefault();
|
|
286
|
+
let x = event.deltaY > 0 ? enableWheel[1] : -enableWheel[1];
|
|
287
|
+
if (isReversed(direction))
|
|
288
|
+
x *= -1;
|
|
289
|
+
let v;
|
|
290
|
+
if (enableWheel[0] == 'normalized') {
|
|
291
|
+
const n = normalizeValue(value, min, max, skew);
|
|
292
|
+
v = rawValue(n + x, min, max, skew);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
v = value + x;
|
|
296
|
+
}
|
|
297
|
+
if (onChange)
|
|
298
|
+
onChange(clamp(stepValue(v, step), min, max));
|
|
299
|
+
}, {
|
|
300
|
+
signal: controller.signal,
|
|
301
|
+
passive: false,
|
|
302
|
+
});
|
|
303
|
+
cleanup = () => {
|
|
304
|
+
// console.log("cleanup")
|
|
305
|
+
controller.abort();
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
}, [value]);
|
|
309
|
+
useEventListener(window, 'mousemove', (event) => {
|
|
310
|
+
handleValue(event);
|
|
311
|
+
});
|
|
312
|
+
useEventListener(window, 'mouseup', () => {
|
|
313
|
+
thumbDragged.current = false;
|
|
314
|
+
if (bodyNoSelect)
|
|
315
|
+
document.body.classList.remove('no-select');
|
|
316
|
+
});
|
|
317
|
+
return (jsxRuntime.jsxs("div", { ref: wrapperRef, className: "tremolo-slider", style: {
|
|
318
|
+
display: 'inline-block',
|
|
319
|
+
boxSizing: 'border-box',
|
|
320
|
+
margin: '0.7rem',
|
|
321
|
+
padding: 0,
|
|
322
|
+
cursor: cursor,
|
|
323
|
+
}, onMouseDown: (event) => {
|
|
324
|
+
thumbDragged.current = true;
|
|
325
|
+
handleValue(event);
|
|
326
|
+
}, children: [jsxRuntime.jsx(react$1.Global, { styles: {
|
|
327
|
+
'.no-select': {
|
|
328
|
+
userSelect: 'none',
|
|
329
|
+
},
|
|
330
|
+
} }), jsxRuntime.jsxs("div", { style: {
|
|
331
|
+
display: 'flex',
|
|
332
|
+
flexDirection: isHorizontal(direction) ? 'column' : 'row',
|
|
333
|
+
}, children: [jsxRuntime.jsx("div", { ref: baseWrapperElement, css: react$1.css(Object.assign({ background: `linear-gradient(to ${gradientDirection(direction)}, ${color} ${percent}%, ${bg} ${percent}%)`, borderRadius: typeof thickness == 'number'
|
|
334
|
+
? thickness / 2
|
|
335
|
+
: `calc(${thickness} / 2)`, borderStyle: 'solid', borderColor: '#ccc', borderWidth: 2, width: isHorizontal(direction) ? length : thickness, height: isHorizontal(direction) ? thickness : length, position: 'relative', zIndex: 1 }, style)), children: jsxRuntime.jsx("div", { className: "tremolo-slider-thumb-wrapper", style: {
|
|
336
|
+
width: 'fix-content',
|
|
337
|
+
height: 'fix-content',
|
|
338
|
+
position: 'absolute',
|
|
339
|
+
top: isHorizontal(direction) ? '50%' : `${percentRev}%`,
|
|
340
|
+
left: isHorizontal(direction) ? `${percentRev}%` : '50%',
|
|
341
|
+
translate: '-50% -50%',
|
|
342
|
+
zIndex: 100,
|
|
343
|
+
}, children: children ? (children) : (jsxRuntime.jsx("div", { className: "tremolo-slider-thumb", style: {
|
|
344
|
+
background: color,
|
|
345
|
+
width: '1.4rem',
|
|
346
|
+
height: '1.4rem',
|
|
347
|
+
borderRadius: '50%',
|
|
348
|
+
} })) }) }), scale && (jsxRuntime.jsx("div", { className: "tremolo-slider-scale-wrapper", style: Object.assign({ position: 'relative', width: isHorizontal(direction) ? length : undefined, height: isVertical(direction) ? length : undefined, marginLeft: isHorizontal(direction)
|
|
349
|
+
? 2
|
|
350
|
+
: ((_a = scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.gap) !== null && _a !== void 0 ? _a : `calc((1.4rem - ${styleHelper(thickness)}) / 2)`), marginTop: isVertical(direction)
|
|
351
|
+
? 2
|
|
352
|
+
: ((_b = scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.gap) !== null && _b !== void 0 ? _b : `calc((1.4rem - ${styleHelper(thickness)}) / 2)`) }, scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.style), children: scalesList.map((item, index) => {
|
|
353
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
354
|
+
return (jsxRuntime.jsxs("div", { style: {
|
|
355
|
+
display: 'flex',
|
|
356
|
+
flexDirection: isHorizontal(direction) ? 'column' : 'row',
|
|
357
|
+
justifyContent: 'center',
|
|
358
|
+
alignItems: 'center',
|
|
359
|
+
position: 'absolute',
|
|
360
|
+
left: isHorizontal(direction)
|
|
361
|
+
? `${isReversed(direction)
|
|
362
|
+
? 100 - normalizeValue(item.at, min, max, skew) * 100
|
|
363
|
+
: normalizeValue(item.at, min, max, skew) * 100}%`
|
|
364
|
+
: undefined,
|
|
365
|
+
top: isVertical(direction)
|
|
366
|
+
? `${isReversed(direction)
|
|
367
|
+
? 100 - normalizeValue(item.at, min, max, skew) * 100
|
|
368
|
+
: normalizeValue(item.at, min, max, skew) * 100}%`
|
|
369
|
+
: undefined,
|
|
370
|
+
translate: isHorizontal(direction) ? '-50% 0' : '0 -50%',
|
|
371
|
+
zIndex: 10,
|
|
372
|
+
}, children: [item.type != 'number' && (jsxRuntime.jsx("div", { className: "tremolo-slider-scale-mark", style: {
|
|
373
|
+
width: isHorizontal(direction)
|
|
374
|
+
? ((_b = (_a = item.style) === null || _a === void 0 ? void 0 : _a.thickness) !== null && _b !== void 0 ? _b : 1)
|
|
375
|
+
: ((_d = (_c = item.style) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : '0.5rem'),
|
|
376
|
+
height: isVertical(direction)
|
|
377
|
+
? ((_f = (_e = item.style) === null || _e === void 0 ? void 0 : _e.thickness) !== null && _f !== void 0 ? _f : 1)
|
|
378
|
+
: ((_h = (_g = item.style) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : '0.5rem'),
|
|
379
|
+
backgroundColor: (_l = (_k = (_j = item.style) === null || _j === void 0 ? void 0 : _j.markColor) !== null && _k !== void 0 ? _k : scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.markColor) !== null && _l !== void 0 ? _l : '#222',
|
|
380
|
+
marginBottom: isHorizontal(direction) ? 2 : undefined,
|
|
381
|
+
marginRight: isVertical(direction) ? 2 : undefined,
|
|
382
|
+
} })), item.type != 'mark' && (jsxRuntime.jsx("div", { className: "tremolo-slider-scale-number", style: {
|
|
383
|
+
color: (_o = (_m = item.style) === null || _m === void 0 ? void 0 : _m.labelColor) !== null && _o !== void 0 ? _o : scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.labelColor,
|
|
384
|
+
}, children: item.at }))] }, index));
|
|
385
|
+
}) }))] })] }));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
exports.Knob = Knob;
|
|
389
|
+
exports.Slider = Slider;
|
|
390
|
+
exports.clamp = clamp;
|
|
391
|
+
exports.decimalPart = decimalPart;
|
|
392
|
+
exports.normalizeValue = normalizeValue;
|
|
393
|
+
exports.rawValue = rawValue;
|
|
394
|
+
exports.skewWithCenterValue = skewWithCenterValue;
|
|
395
|
+
exports.stepValue = stepValue;
|
|
396
|
+
exports.toFixed = toFixed;
|
|
397
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/math.ts","../../../src/hooks/useCallbackRef.ts","../../../src/hooks/useEventListener.ts","../../../src/util.ts","../../../src/components/Knob/index.tsx","../../../src/components/Slider/type.ts","../../../src/components/Slider/index.tsx"],"sourcesContent":[null,null,null,null,null,null,null],"names":["useRef","useInsertionEffect","useCallback","useEffect","useMemo","_jsx","css","Global","Children","isValidElement","_jsxs"],"mappings":";;;;;;SAAgB,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAA;AAC3D,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAA;AAC5C,CAAC;AAEK,SAAU,cAAc,CAC5B,QAAgB,EAChB,GAAW,EACX,GAAW,EACX,IAAI,GAAG,CAAC,EAAA;IAER,IAAI,GAAG,IAAI,GAAG;AAAE,QAAA,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,CAAA;IAC/D,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,QAAQ,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACrD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AAC1B,CAAC;AAEK,SAAU,QAAQ,CACtB,eAAuB,EACvB,GAAW,EACX,GAAW,EACX,IAAI,GAAG,CAAC,EAAA;IAER,IAAI,GAAG,IAAI,GAAG;AAAE,QAAA,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,CAAA;AAC/D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A,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,SAAS,MACrB,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,WAAW,aAAX,WAAW,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAX,WAAW,CAAE,SAAS,mCACtB,MAAM;AACR,4CAAA,YAAY,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS;AACrD,4CAAA,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,SAAS;AACnD,yCAAA,EAAA,CACI,CACR,EACA,IAAI,CAAC,IAAI,IAAI,MAAM,KAClBA,wBACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE;AACL,4CAAA,KAAK,EAAE,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,KAAK,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,UAAU,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,WAAW,KAAX,IAAA,IAAA,WAAW,KAAX,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,WAAW,CAAE,UAAU;yCACzD,EAEA,QAAA,EAAA,IAAI,CAAC,EAAE,EAAA,CACJ,CACP,CArDI,EAAA,EAAA,KAAK,CAsDN,EACP;AAAA,yBAAA,CAAC,EACE,CAAA,CACP,CACG,EAAA,CAAA,CAAA,EAAA,CACF,EACP;AACH;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WheelOption } from '@/types';
|
|
2
|
+
interface KnobProps {
|
|
3
|
+
value: number;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
skew?: number;
|
|
8
|
+
size?: number | string;
|
|
9
|
+
active?: string;
|
|
10
|
+
inactive?: string;
|
|
11
|
+
bg?: string;
|
|
12
|
+
thumb?: string;
|
|
13
|
+
lineWeight?: number | string;
|
|
14
|
+
thumbWeight?: number | string;
|
|
15
|
+
cursor?: string;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
bodyNoSelect?: boolean;
|
|
18
|
+
enableWheel?: WheelOption;
|
|
19
|
+
onChange?: (value: number) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function Knob({ value, min, max, step, skew, size, active, inactive, bg, thumb, lineWeight, thumbWeight, cursor, style, bodyNoSelect, enableWheel, onChange, }: KnobProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Knob/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAGrC,UAAU,SAAS;IAEjB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IAGX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAQ,EACR,IAAQ,EACR,IAAS,EACT,MAAkB,EAClB,QAAiB,EACjB,EAAW,EACX,KAAiB,EACjB,UAAe,EACf,WAAe,EACf,MAAkB,EAClB,KAAK,EACL,YAAmB,EACnB,WAAW,EACX,QAAQ,GACT,EAAE,SAAS,oDAuIX"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Direction, ScaleOption, ScaleOrderList, ScaleType } from './type';
|
|
3
|
+
import { WheelOption } from '@/types';
|
|
4
|
+
export declare function SliderThumb(): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
5
|
+
interface SliderProps {
|
|
6
|
+
value: number;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
length?: number | string;
|
|
11
|
+
thickness?: number | string;
|
|
12
|
+
direction?: Direction;
|
|
13
|
+
skew?: number;
|
|
14
|
+
scale?: ['step', ScaleType] | [number, ScaleType] | ScaleOrderList[];
|
|
15
|
+
scaleOption?: ScaleOption;
|
|
16
|
+
color?: string;
|
|
17
|
+
bg?: string;
|
|
18
|
+
cursor?: string;
|
|
19
|
+
style?: React.CSSProperties;
|
|
20
|
+
bodyNoSelect?: boolean;
|
|
21
|
+
enableWheel?: WheelOption;
|
|
22
|
+
onChange?: (value: number) => void;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function Slider({ value, min, max, step, length, thickness, direction, skew, scale, scaleOption, color, bg, cursor, style, bodyNoSelect, enableWheel, onChange, children, }: SliderProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
26
|
+
export * from './type';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../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