@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.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -0
  3. package/dist/cjs/index.d.ts +79 -0
  4. package/dist/cjs/index.js +397 -0
  5. package/dist/cjs/index.js.map +1 -0
  6. package/dist/cjs/types/src/components/Knob/index.d.ts +23 -0
  7. package/dist/cjs/types/src/components/Knob/index.d.ts.map +1 -0
  8. package/dist/cjs/types/src/components/Slider/index.d.ts +27 -0
  9. package/dist/cjs/types/src/components/Slider/index.d.ts.map +1 -0
  10. package/dist/cjs/types/src/components/Slider/type.d.ts +26 -0
  11. package/dist/cjs/types/src/components/Slider/type.d.ts.map +1 -0
  12. package/dist/cjs/types/src/hooks/useCallbackRef.d.ts +6 -0
  13. package/dist/cjs/types/src/hooks/useCallbackRef.d.ts.map +1 -0
  14. package/dist/cjs/types/src/hooks/useEventListener.d.ts +7 -0
  15. package/dist/cjs/types/src/hooks/useEventListener.d.ts.map +1 -0
  16. package/dist/cjs/types/src/index.d.ts +5 -0
  17. package/dist/cjs/types/src/index.d.ts.map +1 -0
  18. package/dist/cjs/types/src/math.d.ts +8 -0
  19. package/dist/cjs/types/src/math.d.ts.map +1 -0
  20. package/dist/cjs/types/src/types.d.ts +2 -0
  21. package/dist/cjs/types/src/types.d.ts.map +1 -0
  22. package/dist/cjs/types/src/util.d.ts +2 -0
  23. package/dist/cjs/types/src/util.d.ts.map +1 -0
  24. package/dist/esm/index.d.ts +79 -0
  25. package/dist/esm/index.js +387 -0
  26. package/dist/esm/index.js.map +1 -0
  27. package/dist/esm/types/src/components/Knob/index.d.ts +23 -0
  28. package/dist/esm/types/src/components/Knob/index.d.ts.map +1 -0
  29. package/dist/esm/types/src/components/Slider/index.d.ts +27 -0
  30. package/dist/esm/types/src/components/Slider/index.d.ts.map +1 -0
  31. package/dist/esm/types/src/components/Slider/type.d.ts +26 -0
  32. package/dist/esm/types/src/components/Slider/type.d.ts.map +1 -0
  33. package/dist/esm/types/src/hooks/useCallbackRef.d.ts +6 -0
  34. package/dist/esm/types/src/hooks/useCallbackRef.d.ts.map +1 -0
  35. package/dist/esm/types/src/hooks/useEventListener.d.ts +7 -0
  36. package/dist/esm/types/src/hooks/useEventListener.d.ts.map +1 -0
  37. package/dist/esm/types/src/index.d.ts +5 -0
  38. package/dist/esm/types/src/index.d.ts.map +1 -0
  39. package/dist/esm/types/src/math.d.ts +8 -0
  40. package/dist/esm/types/src/math.d.ts.map +1 -0
  41. package/dist/esm/types/src/types.d.ts +2 -0
  42. package/dist/esm/types/src/types.d.ts.map +1 -0
  43. package/dist/esm/types/src/util.d.ts +2 -0
  44. package/dist/esm/types/src/util.d.ts.map +1 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -0
  46. package/package.json +90 -0
@@ -0,0 +1,26 @@
1
+ export type Horizontal = 'right' | 'left';
2
+ export type Vertical = 'up' | 'down';
3
+ export type Direction = Horizontal | Vertical;
4
+ export declare function isHorizontal(d: Direction): d is "left" | "right";
5
+ export declare function isVertical(d: Direction): d is "up" | "down";
6
+ export declare function isReversed(d: Direction): d is "left" | "up";
7
+ export declare function gradientDirection(d: Direction): "left" | "right" | "bottom" | "top" | undefined;
8
+ export type ScaleType = 'mark' | 'mark-number' | 'number';
9
+ export type ScaleOrderList = {
10
+ at: number;
11
+ type: ScaleType;
12
+ style?: {
13
+ markColor?: string;
14
+ labelColor?: string;
15
+ length?: number | string;
16
+ thickness?: number | string;
17
+ };
18
+ };
19
+ export declare function parseScaleOrderList(scale: ['step', ScaleType] | [number, ScaleType] | ScaleOrderList[] | undefined, min: number, max: number, step: number): ScaleOrderList[];
20
+ export type ScaleOption = {
21
+ markColor?: string;
22
+ labelColor?: string;
23
+ gap?: number | string;
24
+ style?: React.CSSProperties;
25
+ };
26
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRo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@
1
+ /**
2
+ * This hook is user-land implementation of the experimental `useEffectEvent` hook.
3
+ * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
4
+ */
5
+ export declare function useCallbackRef<Args extends unknown[], Return>(callback: ((...args: Args) => Return) | undefined, deps?: React.DependencyList): (...args: Args) => Return | undefined;
6
+ //# sourceMappingURL=useCallbackRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCallbackRef.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCallbackRef.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,EAC3D,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,GAAG,SAAS,EACjD,IAAI,GAAE,KAAK,CAAC,cAAmB,aAUF,IAAI,wBAClC"}
@@ -0,0 +1,7 @@
1
+ type Target = EventTarget | null | (() => EventTarget | null);
2
+ type Options = boolean | AddEventListenerOptions;
3
+ export declare function useEventListener<K extends keyof DocumentEventMap>(target: Target, event: K, handler?: (event: DocumentEventMap[K]) => void, options?: Options): VoidFunction;
4
+ export declare function useEventListener<K extends keyof WindowEventMap>(target: Target, event: K, handler?: (event: WindowEventMap[K]) => void, options?: Options): VoidFunction;
5
+ export declare function useEventListener<K extends keyof GlobalEventHandlersEventMap>(target: Target, event: K, handler?: (event: GlobalEventHandlersEventMap[K]) => void, options?: Options): VoidFunction;
6
+ export {};
7
+ //# sourceMappingURL=useEventListener.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEventListener.d.ts","sourceRoot":"","sources":["../../../src/hooks/useEventListener.ts"],"names":[],"mappings":"AAIA,KAAK,MAAM,GAAG,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,CAAA;AAC7D,KAAK,OAAO,GAAG,OAAO,GAAG,uBAAuB,CAAA;AAEhD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,gBAAgB,EAC/D,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC9C,OAAO,CAAC,EAAE,OAAO,GAChB,YAAY,CAAA;AACf,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,cAAc,EAC7D,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,OAAO,CAAC,EAAE,OAAO,GAChB,YAAY,CAAA;AACf,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,2BAA2B,EAC1E,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC,CAAC,KAAK,IAAI,EACzD,OAAO,CAAC,EAAE,OAAO,GAChB,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './math';
2
+ export type * from './types';
3
+ export { Knob } from './components/Knob';
4
+ export { Slider } from './components/Slider';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,mBAAmB,SAAS,CAAA;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,8 @@
1
+ export declare function clamp(value: number, min: number, max: number): number;
2
+ export declare function normalizeValue(rawValue: number, min: number, max: number, skew?: number): number;
3
+ export declare function rawValue(normalizedValue: number, min: number, max: number, skew?: number): number;
4
+ export declare function skewWithCenterValue(centerValue: number, min: number, max: number): number;
5
+ export declare function stepValue(value: number, step: number): number;
6
+ export declare function toFixed(x: number, fractionDigits?: number): number;
7
+ export declare function decimalPart(x: number | string): string | undefined;
8
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/math.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAE5D;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,SAAI,UAKT;AAED,wBAAgB,QAAQ,CACtB,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,SAAI,UAQT;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,UAKZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAOpD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,UAEzD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAElE"}
@@ -0,0 +1,2 @@
1
+ export type WheelOption = ['normalized' | 'raw', number];
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,CAAC,YAAY,GAAG,KAAK,EAAE,MAAM,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function styleHelper(property: string | number): string;
2
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,UAMpD"}
@@ -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,387 @@
1
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
+ import { css, Global } from '@emotion/react';
3
+ import { useRef, useInsertionEffect, useCallback, useEffect, useMemo, Children, isValidElement } from 'react';
4
+
5
+ function clamp(value, min, max) {
6
+ return Math.max(min, Math.min(value, max));
7
+ }
8
+ function normalizeValue(rawValue, min, max, skew = 1) {
9
+ if (min >= max)
10
+ throw new RangeError('requirements: min < max');
11
+ const v = clamp((rawValue - min) / (max - min), 0, 1);
12
+ return Math.pow(v, skew);
13
+ }
14
+ function rawValue(normalizedValue, min, max, skew = 1) {
15
+ if (min >= max)
16
+ throw new RangeError('requirements: min < max');
17
+ const v = skew == 1
18
+ ? clamp(normalizedValue, 0, 1)
19
+ : Math.exp(Math.log(clamp(normalizedValue, 0, 1)) / skew);
20
+ return min + v * (max - min);
21
+ }
22
+ function skewWithCenterValue(centerValue, min, max) {
23
+ if (!(min <= centerValue && centerValue <= max))
24
+ throw new RangeError('requirements: min <= centerValue <= max');
25
+ return Math.log(0.5) / Math.log((centerValue - min) / (max - min));
26
+ }
27
+ function stepValue(value, step) {
28
+ var _a;
29
+ if (step <= 0)
30
+ throw new RangeError('requirements: step > 0');
31
+ const quotient = Math.floor(value / step);
32
+ const decimalDigits = (_a = decimalPart(step)) === null || _a === void 0 ? void 0 : _a.length;
33
+ const v = toFixed(quotient * step, decimalDigits);
34
+ const next = toFixed((quotient + 1) * step, decimalDigits);
35
+ return Math.abs(value - v) < Math.abs(value - next) ? v : next;
36
+ }
37
+ function toFixed(x, fractionDigits) {
38
+ return Number(x.toFixed(fractionDigits));
39
+ }
40
+ function decimalPart(x) {
41
+ return String(x).split('.')[1];
42
+ }
43
+
44
+ /**
45
+ * This hook is user-land implementation of the experimental `useEffectEvent` hook.
46
+ * React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
47
+ */
48
+ function useCallbackRef(callback, deps = []) {
49
+ const callbackRef = useRef(() => {
50
+ throw new Error('Cannot call an event handler while rendering.');
51
+ });
52
+ useInsertionEffect(() => {
53
+ callbackRef.current = callback;
54
+ });
55
+ return useCallback((...args) => { var _a; return (_a = callbackRef.current) === null || _a === void 0 ? void 0 : _a.call(callbackRef, ...args); }, deps);
56
+ }
57
+
58
+ function useEventListener(target, event, handler, options) {
59
+ const listener = useCallbackRef(handler);
60
+ useEffect(() => {
61
+ const node = typeof target === 'function' ? target() : (target !== null && target !== void 0 ? target : document);
62
+ if (!handler || !node)
63
+ return;
64
+ node.addEventListener(event, listener, options);
65
+ return () => {
66
+ node.removeEventListener(event, listener, options);
67
+ };
68
+ }, [event, target, options, listener, handler]);
69
+ return () => {
70
+ const node = typeof target === 'function' ? target() : (target !== null && target !== void 0 ? target : document);
71
+ node === null || node === void 0 ? void 0 : node.removeEventListener(event, listener, options);
72
+ };
73
+ }
74
+
75
+ function styleHelper(property) {
76
+ if (typeof property == 'number') {
77
+ return `${property}px`;
78
+ }
79
+ else {
80
+ return property;
81
+ }
82
+ }
83
+
84
+ 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, }) {
85
+ // -- state and ref ---
86
+ // const [privateValue, setPrivateValue] = useState(value);
87
+ const dragOffsetY = useRef(undefined);
88
+ // --- interpret props ---
89
+ const percent = normalizeValue(value, min, max, skew);
90
+ const handleValue = (event) => {
91
+ if (dragOffsetY.current) {
92
+ if (bodyNoSelect)
93
+ document.body.classList.add('no-select');
94
+ const delta = dragOffsetY.current - event.screenY;
95
+ dragOffsetY.current = event.screenY;
96
+ const n = normalizeValue(value, min, max, skew);
97
+ const v = rawValue(n + delta / 100, min, max, skew);
98
+ const v2 = clamp(stepValue(v, step), min, max);
99
+ if (onChange)
100
+ onChange(v2);
101
+ }
102
+ };
103
+ // --- hooks ---
104
+ const wrapperRef = useMemo(() => {
105
+ let cleanup;
106
+ return (div) => {
107
+ if (!div) {
108
+ cleanup === null || cleanup === void 0 ? void 0 : cleanup();
109
+ return;
110
+ }
111
+ const controller = new AbortController();
112
+ div.addEventListener('wheel', (event) => {
113
+ if (!enableWheel)
114
+ return;
115
+ event.preventDefault();
116
+ const x = event.deltaY > 0 ? -enableWheel[1] : enableWheel[1];
117
+ let v;
118
+ if (enableWheel[0] == 'normalized') {
119
+ const n = normalizeValue(value, min, max, skew);
120
+ v = rawValue(n + x, min, max, skew);
121
+ }
122
+ else {
123
+ v = value + x;
124
+ }
125
+ if (onChange)
126
+ onChange(clamp(stepValue(v, step), min, max));
127
+ }, {
128
+ signal: controller.signal,
129
+ passive: false,
130
+ });
131
+ cleanup = () => {
132
+ // console.log("cleanup")
133
+ controller.abort();
134
+ };
135
+ };
136
+ }, [value]);
137
+ useEventListener(window, 'mousemove', (event) => {
138
+ handleValue(event);
139
+ });
140
+ useEventListener(window, 'mouseup', () => {
141
+ dragOffsetY.current = undefined;
142
+ if (bodyNoSelect)
143
+ document.body.classList.remove('no-select');
144
+ });
145
+ return (jsx("div", { className: "tremolo-knob", ref: wrapperRef, onMouseDown: (event) => {
146
+ dragOffsetY.current = event.screenY;
147
+ handleValue(event);
148
+ }, style: Object.assign({ display: 'inline-block', width: size, height: size }, style), children: jsx("div", { css: css({
149
+ display: 'inline-block',
150
+ width: size,
151
+ height: size,
152
+ background: `conic-gradient(${active} ${percent * 270}deg, ${inactive} ${percent * 270}deg, ${inactive} ${270}deg, ${bg} 90deg)`,
153
+ borderRadius: '50%',
154
+ position: 'relative',
155
+ cursor: cursor,
156
+ rotate: '-135deg',
157
+ '&::before': {
158
+ display: 'block',
159
+ position: 'absolute',
160
+ right: 0,
161
+ left: 0,
162
+ top: 0,
163
+ bottom: 0,
164
+ margin: 'auto',
165
+ content: '""',
166
+ width: `calc(${styleHelper(size)} - ${styleHelper(lineWeight)})`,
167
+ height: `calc(${styleHelper(size)} - ${styleHelper(lineWeight)})`,
168
+ backgroundColor: bg,
169
+ borderRadius: '50%',
170
+ },
171
+ '&::after': {
172
+ display: 'block',
173
+ position: 'absolute',
174
+ top: 0,
175
+ bottom: 0,
176
+ // left: lineWeight,
177
+ margin: 'auto 0',
178
+ content: '""',
179
+ width: `calc(0.5 * ${styleHelper(size)})`,
180
+ height: thumbWeight,
181
+ borderRadius: thumbWeight,
182
+ backgroundColor: thumb,
183
+ rotate: `${90 + percent * 270}deg`,
184
+ transformOrigin: '100% 50%',
185
+ },
186
+ }), children: jsx(Global, { styles: {
187
+ '.no-select': {
188
+ userSelect: 'none',
189
+ },
190
+ } }) }) }));
191
+ }
192
+
193
+ function isHorizontal(d) {
194
+ return d == 'right' || d == 'left';
195
+ }
196
+ function isVertical(d) {
197
+ return d == 'up' || d == 'down';
198
+ }
199
+ function isReversed(d) {
200
+ return d == 'left' || d == 'up';
201
+ }
202
+ function gradientDirection(d) {
203
+ if (d == 'left' || d == 'right')
204
+ return d;
205
+ if (d == 'up')
206
+ return 'top';
207
+ if (d == 'down')
208
+ return 'bottom';
209
+ }
210
+ function parseScaleOrderList(scale, min, max, step) {
211
+ var _a;
212
+ let scalesList = [];
213
+ if (!scale) ;
214
+ else if (typeof scale[0] == 'object') {
215
+ scalesList = scale;
216
+ }
217
+ else {
218
+ const per = scale[0] == 'step' ? step : scale[0];
219
+ const count = Math.floor(max / per) - Math.ceil(min / per) + 1;
220
+ for (let i = 0; i < count; i++) {
221
+ const at = toFixed(per * (Math.ceil(min / per) + i), (_a = decimalPart(per)) === null || _a === void 0 ? void 0 : _a.length);
222
+ scalesList.push({ at: at, type: scale[1] });
223
+ }
224
+ }
225
+ return scalesList;
226
+ }
227
+
228
+ // interface SliderThumbProps {}
229
+ function SliderThumb( /* {}: SliderThumbProps */) {
230
+ return jsx("div", {});
231
+ }
232
+ 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, }) {
233
+ var _a, _b;
234
+ // -- state and ref ---
235
+ const baseWrapperElement = useRef(null);
236
+ // --- interpret props ---
237
+ const percent = normalizeValue(value, min, max, skew) * 100;
238
+ const percentRev = isReversed(direction) ? 100 - percent : percent;
239
+ const scalesList = parseScaleOrderList(scale, min, max, step);
240
+ if (isReversed(direction))
241
+ scalesList.reverse();
242
+ // let defaultThumb = true
243
+ if (children != undefined) {
244
+ const childElements = Children.toArray(children);
245
+ const lastElement = childElements[childElements.length - 1];
246
+ if (isValidElement(lastElement)) {
247
+ // defaultThumb = false
248
+ if (lastElement.type == SliderThumb) ;
249
+ }
250
+ else {
251
+ throw new Error('children is an invalid element.');
252
+ }
253
+ }
254
+ const thumbDragged = useRef(false);
255
+ const handleValue = (event) => {
256
+ if (baseWrapperElement.current && thumbDragged.current) {
257
+ if (bodyNoSelect)
258
+ document.body.classList.add('no-select');
259
+ const { left: x1, top: y1, right: x2, bottom: y2, } = baseWrapperElement.current.getBoundingClientRect();
260
+ const mouseX = event.clientX;
261
+ const mouseY = event.clientY;
262
+ const n = isHorizontal(direction)
263
+ ? normalizeValue(mouseX, x1, x2)
264
+ : normalizeValue(mouseY, y1, y2);
265
+ const v = rawValue(isReversed(direction) ? 1 - n : n, min, max, skew);
266
+ const v2 = clamp(stepValue(v, step), min, max);
267
+ if (onChange)
268
+ onChange(v2);
269
+ }
270
+ };
271
+ // --- hooks ---
272
+ const wrapperRef = useMemo(() => {
273
+ let cleanup;
274
+ return (div) => {
275
+ if (!div) {
276
+ cleanup === null || cleanup === void 0 ? void 0 : cleanup();
277
+ return;
278
+ }
279
+ const controller = new AbortController();
280
+ div.addEventListener('wheel', (event) => {
281
+ if (!enableWheel)
282
+ return;
283
+ event.preventDefault();
284
+ let x = event.deltaY > 0 ? enableWheel[1] : -enableWheel[1];
285
+ if (isReversed(direction))
286
+ x *= -1;
287
+ let v;
288
+ if (enableWheel[0] == 'normalized') {
289
+ const n = normalizeValue(value, min, max, skew);
290
+ v = rawValue(n + x, min, max, skew);
291
+ }
292
+ else {
293
+ v = value + x;
294
+ }
295
+ if (onChange)
296
+ onChange(clamp(stepValue(v, step), min, max));
297
+ }, {
298
+ signal: controller.signal,
299
+ passive: false,
300
+ });
301
+ cleanup = () => {
302
+ // console.log("cleanup")
303
+ controller.abort();
304
+ };
305
+ };
306
+ }, [value]);
307
+ useEventListener(window, 'mousemove', (event) => {
308
+ handleValue(event);
309
+ });
310
+ useEventListener(window, 'mouseup', () => {
311
+ thumbDragged.current = false;
312
+ if (bodyNoSelect)
313
+ document.body.classList.remove('no-select');
314
+ });
315
+ return (jsxs("div", { ref: wrapperRef, className: "tremolo-slider", style: {
316
+ display: 'inline-block',
317
+ boxSizing: 'border-box',
318
+ margin: '0.7rem',
319
+ padding: 0,
320
+ cursor: cursor,
321
+ }, onMouseDown: (event) => {
322
+ thumbDragged.current = true;
323
+ handleValue(event);
324
+ }, children: [jsx(Global, { styles: {
325
+ '.no-select': {
326
+ userSelect: 'none',
327
+ },
328
+ } }), jsxs("div", { style: {
329
+ display: 'flex',
330
+ flexDirection: isHorizontal(direction) ? 'column' : 'row',
331
+ }, children: [jsx("div", { ref: baseWrapperElement, css: css(Object.assign({ background: `linear-gradient(to ${gradientDirection(direction)}, ${color} ${percent}%, ${bg} ${percent}%)`, borderRadius: typeof thickness == 'number'
332
+ ? thickness / 2
333
+ : `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: jsx("div", { className: "tremolo-slider-thumb-wrapper", style: {
334
+ width: 'fix-content',
335
+ height: 'fix-content',
336
+ position: 'absolute',
337
+ top: isHorizontal(direction) ? '50%' : `${percentRev}%`,
338
+ left: isHorizontal(direction) ? `${percentRev}%` : '50%',
339
+ translate: '-50% -50%',
340
+ zIndex: 100,
341
+ }, children: children ? (children) : (jsx("div", { className: "tremolo-slider-thumb", style: {
342
+ background: color,
343
+ width: '1.4rem',
344
+ height: '1.4rem',
345
+ borderRadius: '50%',
346
+ } })) }) }), scale && (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)
347
+ ? 2
348
+ : ((_a = scaleOption === null || scaleOption === void 0 ? void 0 : scaleOption.gap) !== null && _a !== void 0 ? _a : `calc((1.4rem - ${styleHelper(thickness)}) / 2)`), marginTop: isVertical(direction)
349
+ ? 2
350
+ : ((_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) => {
351
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
352
+ return (jsxs("div", { style: {
353
+ display: 'flex',
354
+ flexDirection: isHorizontal(direction) ? 'column' : 'row',
355
+ justifyContent: 'center',
356
+ alignItems: 'center',
357
+ position: 'absolute',
358
+ left: isHorizontal(direction)
359
+ ? `${isReversed(direction)
360
+ ? 100 - normalizeValue(item.at, min, max, skew) * 100
361
+ : normalizeValue(item.at, min, max, skew) * 100}%`
362
+ : undefined,
363
+ top: isVertical(direction)
364
+ ? `${isReversed(direction)
365
+ ? 100 - normalizeValue(item.at, min, max, skew) * 100
366
+ : normalizeValue(item.at, min, max, skew) * 100}%`
367
+ : undefined,
368
+ translate: isHorizontal(direction) ? '-50% 0' : '0 -50%',
369
+ zIndex: 10,
370
+ }, children: [item.type != 'number' && (jsx("div", { className: "tremolo-slider-scale-mark", style: {
371
+ width: isHorizontal(direction)
372
+ ? ((_b = (_a = item.style) === null || _a === void 0 ? void 0 : _a.thickness) !== null && _b !== void 0 ? _b : 1)
373
+ : ((_d = (_c = item.style) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : '0.5rem'),
374
+ height: isVertical(direction)
375
+ ? ((_f = (_e = item.style) === null || _e === void 0 ? void 0 : _e.thickness) !== null && _f !== void 0 ? _f : 1)
376
+ : ((_h = (_g = item.style) === null || _g === void 0 ? void 0 : _g.length) !== null && _h !== void 0 ? _h : '0.5rem'),
377
+ 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',
378
+ marginBottom: isHorizontal(direction) ? 2 : undefined,
379
+ marginRight: isVertical(direction) ? 2 : undefined,
380
+ } })), item.type != 'mark' && (jsx("div", { className: "tremolo-slider-scale-number", style: {
381
+ 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,
382
+ }, children: item.at }))] }, index));
383
+ }) }))] })] }));
384
+ }
385
+
386
+ export { Knob, Slider, clamp, decimalPart, normalizeValue, rawValue, skewWithCenterValue, stepValue, toFixed };
387
+ //# 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":["_jsx","_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,IAAA,MAAM,CAAC,GACL,IAAI,IAAI,CAAC;UACL,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC;UAC5B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,E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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,aACE,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"}