@tremolo-ui/react 0.1.5 → 0.2.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.
Files changed (40) hide show
  1. package/dist/index.cjs +325 -239
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +149 -64
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.d.cts +229 -199
  6. package/dist/index.d.cts.map +1 -1
  7. package/dist/index.d.ts +229 -199
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +314 -223
  10. package/dist/index.js.map +1 -1
  11. package/package.json +2 -2
  12. package/src/components/Knob/index.css +50 -25
  13. package/src/components/Knob/index.tsx +37 -32
  14. package/src/components/NumberInput/index.css +31 -15
  15. package/src/components/NumberInput/index.tsx +22 -14
  16. package/src/components/Piano/context.tsx +1 -1
  17. package/src/components/Piano/index.css +17 -8
  18. package/src/components/Piano/index.tsx +259 -220
  19. package/src/components/Piano/key.tsx +3 -3
  20. package/src/components/Slider/Thumb.tsx +1 -1
  21. package/src/components/Slider/Track.tsx +3 -3
  22. package/src/components/Slider/index.css +33 -8
  23. package/src/components/Slider/index.tsx +25 -25
  24. package/src/components/XYPad/Area.tsx +4 -3
  25. package/src/components/XYPad/Thumb.tsx +8 -4
  26. package/src/components/XYPad/index.css +18 -4
  27. package/src/components/XYPad/index.tsx +25 -19
  28. package/src/hooks/useAnimationFrame.ts +3 -0
  29. package/src/hooks/useCallbackRef.ts +2 -2
  30. package/src/hooks/useDrag.ts +2 -1
  31. package/src/hooks/useDragWithElement.ts +2 -1
  32. package/src/hooks/useEventListener.ts +3 -0
  33. package/src/hooks/useInterval.ts +3 -0
  34. package/src/hooks/useLongPress.ts +3 -0
  35. package/src/hooks/useMIDIAccess.ts +40 -0
  36. package/src/hooks/useMIDIInput.ts +50 -0
  37. package/src/hooks/useMIDIMessage.ts +24 -0
  38. package/src/hooks/useRefCallbackEvent.ts +4 -0
  39. package/src/index.ts +30 -35
  40. package/src/styles/global.css +0 -4
package/dist/index.d.cts CHANGED
@@ -1,20 +1,7 @@
1
1
  import * as react0 from "react";
2
- import * as react2 from "react";
3
- import * as react6 from "react";
4
- import * as react8 from "react";
5
2
  import React$1, { CSSProperties, ComponentPropsWithoutRef, DependencyList, ElementType, ReactElement, ReactNode, RefObject } from "react";
6
3
  import { InputEventOption } from "@tremolo-ui/functions";
7
- import * as react_jsx_runtime0$1 from "react/jsx-runtime";
8
- import * as react_jsx_runtime5 from "react/jsx-runtime";
9
- import * as react_jsx_runtime6 from "react/jsx-runtime";
10
- import * as react_jsx_runtime3 from "react/jsx-runtime";
11
- import * as react_jsx_runtime2 from "react/jsx-runtime";
12
4
  import * as react_jsx_runtime0 from "react/jsx-runtime";
13
- import * as react_jsx_runtime8 from "react/jsx-runtime";
14
- import * as react_jsx_runtime9 from "react/jsx-runtime";
15
- import * as react_jsx_runtime10 from "react/jsx-runtime";
16
- import * as react_jsx_runtime1 from "react/jsx-runtime";
17
- import * as react_jsx_runtime11 from "react/jsx-runtime";
18
5
 
19
6
  //#region src/components/AnimationCanvas/index.d.ts
20
7
  /** @category AnimationCanvas */
@@ -149,7 +136,7 @@ interface DragObserverProps<T extends ElementType> {
149
136
  onDragEnd?: () => void;
150
137
  }
151
138
  /** @category DragObserver */
152
- declare function DragObserver<T extends ElementType = 'div'>(props: DragObserverProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof DragObserverProps<T>>): react_jsx_runtime0$1.JSX.Element;
139
+ declare function DragObserver<T extends ElementType = 'div'>(props: DragObserverProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof DragObserverProps<T>>): react_jsx_runtime0.JSX.Element;
153
140
  //# sourceMappingURL=index.d.ts.map
154
141
  //#endregion
155
142
  //#region src/components/Knob/index.d.ts
@@ -171,7 +158,8 @@ interface KnobProps {
171
158
  * @default min
172
159
  */
173
160
  startValue?: number;
174
- size?: number;
161
+ /** width and height */
162
+ size?: number | string;
175
163
  /** Whether to apply `{use-select: none}` when dragging */
176
164
  bodyNoSelect?: boolean;
177
165
  /**
@@ -199,8 +187,10 @@ interface KnobProps {
199
187
  thumbLineWeight?: number;
200
188
  /** percent (0-100) */
201
189
  thumbLineLength?: number;
202
- /** percent (0-100) */
190
+ /** line weight [px] */
203
191
  lineWeight?: number;
192
+ /** angle range [degree] */
193
+ angleRange?: number;
204
194
  classes?: {
205
195
  activeLine?: string;
206
196
  inactiveLine?: string;
@@ -224,29 +214,20 @@ interface KnobMethods {
224
214
  declare const Knob: react0.ForwardRefExoticComponent<KnobProps & Omit<Omit<react0.SVGProps<SVGSVGElement>, "ref">, keyof KnobProps> & react0.RefAttributes<KnobMethods>>;
225
215
  //# sourceMappingURL=index.d.ts.map
226
216
  //#endregion
227
- //#region src/components/NumberInput/type.d.ts
228
- /**
229
- * [unit, scale][]
230
- * @example
231
- * [['Hz', 1], ['kHz', 1000]]
232
- */
233
- type Units = [string, number][];
234
- //#endregion
235
- //#region src/components/NumberInput/Stepper.d.ts
217
+ //#region src/components/NumberInput/DecrementStepper.d.ts
236
218
  /** @category NumberInput */
237
- interface StepperProps {
238
- /** Display only when hovering. */
239
- dynamic?: boolean;
219
+ interface DecrementStepperProps {
220
+ size?: number;
240
221
  children?: ReactNode;
241
222
  }
242
223
  /** @category NumberInput */
243
- declare function Stepper({
244
- dynamic,
224
+ declare function DecrementStepper({
225
+ size,
245
226
  children,
246
227
  className,
247
228
  ...props
248
- }: StepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof StepperProps>): react_jsx_runtime5.JSX.Element;
249
- //# sourceMappingURL=Stepper.d.ts.map
229
+ }: DecrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof DecrementStepperProps>): react_jsx_runtime0.JSX.Element;
230
+ //# sourceMappingURL=DecrementStepper.d.ts.map
250
231
  //#endregion
251
232
  //#region src/components/NumberInput/IncrementStepper.d.ts
252
233
  /** @category NumberInput */
@@ -260,34 +241,43 @@ declare function IncrementStepper({
260
241
  children,
261
242
  className,
262
243
  ...props
263
- }: IncrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof IncrementStepperProps>): react_jsx_runtime6.JSX.Element;
244
+ }: IncrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof IncrementStepperProps>): react_jsx_runtime0.JSX.Element;
264
245
  //# sourceMappingURL=IncrementStepper.d.ts.map
265
246
  //#endregion
266
- //#region src/components/NumberInput/DecrementStepper.d.ts
247
+ //#region src/components/NumberInput/Stepper.d.ts
267
248
  /** @category NumberInput */
268
- interface DecrementStepperProps {
269
- size?: number;
249
+ interface StepperProps {
250
+ /** Display only when hovering. */
251
+ dynamic?: boolean;
270
252
  children?: ReactNode;
271
253
  }
272
254
  /** @category NumberInput */
273
- declare function DecrementStepper({
274
- size,
255
+ declare function Stepper({
256
+ dynamic,
275
257
  children,
276
258
  className,
277
259
  ...props
278
- }: DecrementStepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof DecrementStepperProps>): react_jsx_runtime3.JSX.Element;
279
- //# sourceMappingURL=DecrementStepper.d.ts.map
260
+ }: StepperProps & Omit<ComponentPropsWithoutRef<'div'>, keyof StepperProps>): react_jsx_runtime0.JSX.Element;
261
+ //# sourceMappingURL=Stepper.d.ts.map
262
+ //#endregion
263
+ //#region src/components/NumberInput/type.d.ts
264
+ /**
265
+ * [unit, scale][]
266
+ * @example
267
+ * [['Hz', 1], ['kHz', 1000]]
268
+ */
269
+ type Units = [string, number][];
280
270
  //#endregion
281
271
  //#region src/components/NumberInput/index.d.ts
282
272
  /** @category NumberInput */
283
273
  interface NumberInputProps {
284
274
  value: number | string;
285
275
  /**
286
- * @default Number.MIN_SAFE_INTEGER
276
+ * Number.MIN_SAFE_INTEGER
287
277
  */
288
278
  min?: number;
289
279
  /**
290
- * @default Number.MAX_SAFE_INTEGER
280
+ * Number.MAX_SAFE_INTEGER
291
281
  */
292
282
  max?: number;
293
283
  step?: number;
@@ -340,31 +330,12 @@ interface NumberInputMethods {
340
330
  * Input with some useful functions for entering numerical values.
341
331
  * @category NumberInput
342
332
  */
343
- declare const NumberInput: react2.ForwardRefExoticComponent<NumberInputProps & Omit<Omit<react2.DetailedHTMLProps<react2.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | keyof NumberInputProps> & react2.RefAttributes<NumberInputMethods>>;
344
- //#endregion
345
- //#region src/components/Piano/context.d.ts
346
- /** @category Piano */
347
- type NoteRange = {
348
- first: number;
349
- last: number;
333
+ declare const NumberInput: react0.ForwardRefExoticComponent<NumberInputProps & Omit<Omit<react0.DetailedHTMLProps<react0.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type" | keyof NumberInputProps> & react0.RefAttributes<NumberInputMethods>> & {
334
+ Stepper: typeof Stepper;
335
+ IncrementStepper: typeof IncrementStepper;
336
+ DecrementStepper: typeof DecrementStepper;
350
337
  };
351
338
  //#endregion
352
- //#region src/components/Piano/keyboardShortcuts.d.ts
353
- /** @category Piano */
354
- type KeyboardShortcuts = {
355
- keys: string[];
356
- flags?: {
357
- naturalOnly?: boolean;
358
- };
359
- };
360
- /** @category Piano */
361
- declare const SHORTCUTS: {
362
- HOME_ROW: {
363
- keys: string[];
364
- };
365
- };
366
- //# sourceMappingURL=keyboardShortcuts.d.ts.map
367
- //#endregion
368
339
  //#region src/components/Piano/key.d.ts
369
340
  /**
370
341
  * @category Piano
@@ -389,17 +360,34 @@ interface KeyProps {
389
360
  * @category Piano
390
361
  */
391
362
  interface KeyMethods {
392
- play: () => void;
363
+ play: (velocity?: number) => void;
393
364
  stop: () => void;
394
365
  played: () => boolean;
395
366
  }
396
367
  /** @category Piano */
397
-
368
+ //#endregion
369
+ //#region src/components/Piano/context.d.ts
398
370
  /** @category Piano */
399
- declare const WhiteKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
371
+ type NoteRange = {
372
+ first: number;
373
+ last: number;
374
+ };
375
+ //#endregion
376
+ //#region src/components/Piano/keyboardShortcuts.d.ts
377
+ /** @category Piano */
378
+ type KeyboardShortcuts = {
379
+ keys: string[];
380
+ flags?: {
381
+ naturalOnly?: boolean;
382
+ };
383
+ };
400
384
  /** @category Piano */
401
- declare const BlackKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
402
- //# sourceMappingURL=key.d.ts.map
385
+ declare const SHORTCUTS: {
386
+ HOME_ROW: {
387
+ keys: string[];
388
+ };
389
+ };
390
+ //# sourceMappingURL=keyboardShortcuts.d.ts.map
403
391
  //#endregion
404
392
  //#region src/components/Piano/KeyLabel.d.ts
405
393
  /** @category Piano */
@@ -424,17 +412,14 @@ declare function KeyLabel({
424
412
  __note,
425
413
  __label,
426
414
  ...props
427
- }: KeyLabelProps & Omit<ComponentPropsWithoutRef<'div'>, keyof KeyLabelProps>): false | react_jsx_runtime2.JSX.Element;
415
+ }: KeyLabelProps & Omit<ComponentPropsWithoutRef<'div'>, keyof KeyLabelProps>): false | react_jsx_runtime0.JSX.Element;
428
416
  //# sourceMappingURL=KeyLabel.d.ts.map
429
417
  //#endregion
430
418
  //#region src/components/Piano/index.d.ts
431
419
  /**
432
- * Piano component
433
- *
434
- * TODO:
435
- * - add scale highlight
420
+ * [noteRange.first, noteRange.first + 1 ..., noteRange.last]
421
+ * @category Piano
436
422
  */
437
- /** @category Piano */
438
423
  declare function getNoteRangeArray(noteRange: NoteRange): number[];
439
424
  /** @category Piano */
440
425
  interface PianoProps {
@@ -447,105 +432,30 @@ interface PianoProps {
447
432
  blackNoteWidth?: number;
448
433
  height?: number | string;
449
434
  style?: CSSProperties;
450
- onPlayNote?: (noteNumber: number) => void;
451
- onStopNote?: (noteNumber: number) => void;
435
+ onPlayNote?: (note: number, velocity?: number) => void;
436
+ onStopNote?: (note: number) => void;
452
437
  label?: (note: number, index: number) => ReactNode;
453
438
  /**
454
439
  * \<WhiteKey /> | \<BlackKey />
455
440
  */
456
441
  children?: ReactElement | ReactElement[];
457
442
  }
443
+ /**
444
+ * @category Piano
445
+ */
446
+ interface PianoMethods {
447
+ playNote: (note: number, velocity?: number) => void;
448
+ stopNote: (note: number) => void;
449
+ }
458
450
  /**
459
451
  * Customizable piano component.
460
452
  * @category Piano
461
453
  */
462
- declare function Piano({
463
- noteRange,
464
- glissando,
465
- midiMax,
466
- keyboardShortcuts,
467
- fill,
468
- height,
469
- whiteNoteWidth: _whiteNoteWidth,
470
- style,
471
- className,
472
- onPlayNote,
473
- onStopNote,
474
- label,
475
- children,
476
- onPointerDown,
477
- ...props
478
- }: PianoProps & Omit<ComponentPropsWithoutRef<'div'>, keyof PianoProps>): react_jsx_runtime0.JSX.Element;
479
- //#endregion
480
- //#region src/components/Slider/context.d.ts
481
- type State = {
482
- min: number;
483
- max: number;
484
- step: number;
485
- skew: number;
486
- vertical: boolean;
487
- reverse: boolean;
488
- disabled: boolean;
489
- readonly: boolean;
454
+ declare const Piano: React$1.ForwardRefExoticComponent<PianoProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof PianoProps> & React$1.RefAttributes<PianoMethods>> & {
455
+ WhiteKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
456
+ BlackKey: React$1.ForwardRefExoticComponent<KeyProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof KeyProps> & React$1.RefAttributes<KeyMethods>>;
457
+ KeyLabel: typeof KeyLabel;
490
458
  };
491
- /** @category Slider */
492
- declare function useSliderContext<T>(selector: (state: State) => T): T;
493
- //#endregion
494
- //#region src/components/Slider/Thumb.d.ts
495
- /** @category Slider */
496
- interface SliderThumbProps {
497
- size?: number | string;
498
- width?: number | string;
499
- height?: number | string;
500
- color?: string;
501
- className?: string;
502
- style?: CSSProperties;
503
- children?: ReactNode;
504
- /** @internal */
505
- __percent?: number;
506
- }
507
- /** @category Slider */
508
- interface SliderThumbMethods {
509
- focus: () => void;
510
- blur: () => void;
511
- }
512
- /** @category Slider */
513
-
514
- /** @category Slider */
515
- declare const SliderThumb: react6.ForwardRefExoticComponent<SliderThumbProps & react6.RefAttributes<SliderThumbMethods>>;
516
- //# sourceMappingURL=Thumb.d.ts.map
517
- //#endregion
518
- //#region src/components/Slider/Track.d.ts
519
- /** @category Slider */
520
- interface SliderTrackProps {
521
- length?: number | string;
522
- thickness?: number | string;
523
- active?: string;
524
- inactive?: string;
525
- defaultStyle?: boolean;
526
- className?: string;
527
- style?: CSSProperties;
528
- children?: ReactElement;
529
- /** @internal */
530
- __thumb?: ReactElement;
531
- /** @internal */
532
- __percent?: number;
533
- }
534
- /** @category Slider */
535
- declare function SliderTrack({
536
- length,
537
- thickness,
538
- active,
539
- inactive,
540
- children,
541
- className,
542
- style,
543
- defaultStyle,
544
- __thumb,
545
- __percent,
546
- ...props
547
- }: SliderTrackProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SliderTrackProps>): react_jsx_runtime8.JSX.Element;
548
- //# sourceMappingURL=Track.d.ts.map
549
459
  //#endregion
550
460
  //#region src/components/Slider/type.d.ts
551
461
  type ScaleType = 'mark' | 'mark-number' | 'number';
@@ -566,7 +476,7 @@ declare function Scale({
566
476
  className,
567
477
  style,
568
478
  ...props
569
- }: ScaleProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleProps>): react_jsx_runtime9.JSX.Element;
479
+ }: ScaleProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleProps>): react_jsx_runtime0.JSX.Element;
570
480
  //# sourceMappingURL=Scale.d.ts.map
571
481
  //#endregion
572
482
  //#region src/components/Slider/ScaleOption.d.ts
@@ -606,9 +516,75 @@ declare function ScaleOption({
606
516
  className,
607
517
  style,
608
518
  ...props
609
- }: ScaleOptionProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleOptionProps>): react_jsx_runtime10.JSX.Element;
519
+ }: ScaleOptionProps & Omit<ComponentPropsWithoutRef<'div'>, keyof ScaleOptionProps>): react_jsx_runtime0.JSX.Element;
610
520
  //# sourceMappingURL=ScaleOption.d.ts.map
611
521
  //#endregion
522
+ //#region src/components/Slider/Thumb.d.ts
523
+ /** @category Slider */
524
+ interface SliderThumbProps {
525
+ size?: number | string;
526
+ width?: number | string;
527
+ height?: number | string;
528
+ color?: string;
529
+ className?: string;
530
+ style?: CSSProperties;
531
+ children?: ReactNode;
532
+ /** @internal */
533
+ __percent?: number;
534
+ }
535
+ /** @category Slider */
536
+ interface SliderThumbMethods {
537
+ focus: () => void;
538
+ blur: () => void;
539
+ }
540
+ /** @category Slider */
541
+ //#endregion
542
+ //#region src/components/Slider/Track.d.ts
543
+ /** @category Slider */
544
+ interface SliderTrackProps {
545
+ length?: number | string;
546
+ thickness?: number | string;
547
+ active?: string;
548
+ inactive?: string;
549
+ defaultStyle?: boolean;
550
+ className?: string;
551
+ style?: CSSProperties;
552
+ children?: ReactElement;
553
+ /** @internal */
554
+ __thumb?: ReactElement;
555
+ /** @internal */
556
+ __percent?: number;
557
+ }
558
+ /** @category Slider */
559
+ declare function Track({
560
+ length,
561
+ thickness,
562
+ active,
563
+ inactive,
564
+ children,
565
+ className,
566
+ style,
567
+ defaultStyle,
568
+ __thumb,
569
+ __percent,
570
+ ...props
571
+ }: SliderTrackProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SliderTrackProps>): react_jsx_runtime0.JSX.Element;
572
+ //# sourceMappingURL=Track.d.ts.map
573
+ //#endregion
574
+ //#region src/components/Slider/context.d.ts
575
+ type State = {
576
+ min: number;
577
+ max: number;
578
+ step: number;
579
+ skew: number;
580
+ vertical: boolean;
581
+ reverse: boolean;
582
+ disabled: boolean;
583
+ readonly: boolean;
584
+ };
585
+ /** @category Slider */
586
+ declare function useSliderContext<T>(selector: (state: State) => T): T;
587
+ //#endregion
612
588
  //#region src/components/Slider/index.d.ts
613
589
  /** @category Slider */
614
590
  interface SliderProps {
@@ -656,7 +632,12 @@ interface SliderMethods {
656
632
  * Customizable slider
657
633
  * @category Slider
658
634
  */
659
- declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SliderProps> & React$1.RefAttributes<SliderMethods>>;
635
+ declare const Slider: React$1.ForwardRefExoticComponent<SliderProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SliderProps> & React$1.RefAttributes<SliderMethods>> & {
636
+ Thumb: React$1.ForwardRefExoticComponent<SliderThumbProps & React$1.RefAttributes<SliderThumbMethods>>;
637
+ Track: typeof Track;
638
+ Scale: typeof Scale;
639
+ ScaleOption: typeof ScaleOption;
640
+ };
660
641
  //#endregion
661
642
  //#region src/components/WheelObserver/index.d.ts
662
643
  /**
@@ -681,36 +662,12 @@ interface WheelObserverProps<T extends ElementType> {
681
662
  onWheel?: (event: WheelEvent) => void;
682
663
  }
683
664
  /** @category WheelObserver */
684
- declare function WheelObserver<T extends ElementType = 'div'>(props: WheelObserverProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof WheelObserverProps<T>>): react_jsx_runtime1.JSX.Element;
665
+ declare function WheelObserver<T extends ElementType = 'div'>(props: WheelObserverProps<T> & Omit<ComponentPropsWithoutRef<T>, keyof WheelObserverProps<T>>): react_jsx_runtime0.JSX.Element;
685
666
  //# sourceMappingURL=index.d.ts.map
686
667
  //#endregion
687
- //#region src/components/XYPad/Thumb.d.ts
688
- /** @category XYPad */
689
- interface ThumbProps {
690
- size?: number | string;
691
- width?: number | string;
692
- height?: number | string;
693
- color?: string;
694
- wrapperClassName?: string;
695
- wrapperStyle?: CSSProperties;
696
- children?: ReactNode;
697
- /** @internal */
698
- __disabled?: boolean;
699
- /** @internal */
700
- __css?: CSSProperties;
701
- }
702
- /** @category XYPad */
703
- interface XYPadThumbMethods {
704
- focus: () => void;
705
- blur: () => void;
706
- }
707
- /** @category XYPad */
708
- declare const XYPadThumb: react8.ForwardRefExoticComponent<ThumbProps & Omit<Omit<react8.DetailedHTMLProps<react8.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof ThumbProps> & react8.RefAttributes<XYPadThumbMethods>>;
709
- //# sourceMappingURL=Thumb.d.ts.map
710
- //#endregion
711
668
  //#region src/components/XYPad/Area.d.ts
712
669
  /** @category XYPad */
713
- interface AreaProps {
670
+ interface XYPadAreaProps {
714
671
  width?: number | string;
715
672
  height?: number | string;
716
673
  color?: string;
@@ -721,7 +678,7 @@ interface AreaProps {
721
678
  __thumb?: ReactElement;
722
679
  }
723
680
  /** @category XYPad */
724
- declare function XYPadArea({
681
+ declare function Area({
725
682
  width,
726
683
  height,
727
684
  color,
@@ -730,9 +687,33 @@ declare function XYPadArea({
730
687
  style,
731
688
  __thumb,
732
689
  ...props
733
- }: AreaProps & Omit<ComponentPropsWithoutRef<'div'>, keyof AreaProps>): react_jsx_runtime11.JSX.Element;
690
+ }: XYPadAreaProps & Omit<ComponentPropsWithoutRef<'div'>, keyof XYPadAreaProps>): react_jsx_runtime0.JSX.Element;
734
691
  //# sourceMappingURL=Area.d.ts.map
735
692
  //#endregion
693
+ //#region src/components/XYPad/Thumb.d.ts
694
+ /** @category XYPad */
695
+ interface XYPadThumbProps {
696
+ size?: number | string;
697
+ width?: number | string;
698
+ height?: number | string;
699
+ color?: string;
700
+ wrapperClassName?: string;
701
+ wrapperStyle?: CSSProperties;
702
+ children?: ReactNode;
703
+ /** @internal */
704
+ __disabled?: boolean;
705
+ /** @internal */
706
+ __readonly?: boolean;
707
+ /** @internal */
708
+ __css?: CSSProperties;
709
+ }
710
+ /** @category XYPad */
711
+ interface XYPadThumbMethods {
712
+ focus: () => void;
713
+ blur: () => void;
714
+ }
715
+ /** @category XYPad */
716
+ //#endregion
736
717
  //#region src/components/XYPad/index.d.ts
737
718
  /**
738
719
  * Two-dimensional slider component.
@@ -776,9 +757,15 @@ interface XYPadMethods {
776
757
  * Simple XYPad
777
758
  * @category XYPad
778
759
  */
779
- declare const XYPad: React$1.ForwardRefExoticComponent<XYPadProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof XYPadProps> & React$1.RefAttributes<XYPadMethods>>;
760
+ declare const XYPad: React$1.ForwardRefExoticComponent<XYPadProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof XYPadProps> & React$1.RefAttributes<XYPadMethods>> & {
761
+ Thumb: React$1.ForwardRefExoticComponent<XYPadThumbProps & Omit<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof XYPadThumbProps> & React$1.RefAttributes<XYPadThumbMethods>>;
762
+ Area: typeof Area;
763
+ };
780
764
  //#endregion
781
765
  //#region src/hooks/useAnimationFrame.d.ts
766
+ /**
767
+ * @category hooks
768
+ */
782
769
  declare function useAnimationFrame(callback?: () => void, deps?: DependencyList): void;
783
770
  //# sourceMappingURL=useAnimationFrame.d.ts.map
784
771
  //#endregion
@@ -790,6 +777,7 @@ interface UseDragProps {
790
777
  onDragEnd?: () => void;
791
778
  }
792
779
  /**
780
+ * @category hooks
793
781
  * @returns [refCallback, pointerDownHandler]
794
782
  */
795
783
  declare function useDrag<T extends Element>({
@@ -798,7 +786,6 @@ declare function useDrag<T extends Element>({
798
786
  onDragStart,
799
787
  onDragEnd
800
788
  }: UseDragProps): [(div: EventTarget | null) => void, (event: React.PointerEvent<T>) => void];
801
- //# sourceMappingURL=useDrag.d.ts.map
802
789
  //#endregion
803
790
  //#region src/hooks/useDragWithElement.d.ts
804
791
  interface UseDragWithElementProps<T extends Element> {
@@ -808,6 +795,7 @@ interface UseDragWithElementProps<T extends Element> {
808
795
  onDragEnd?: (normalizedX: number, normalizedY: number) => void;
809
796
  }
810
797
  /**
798
+ * @category hooks
811
799
  * @returns [refCallback, pointerDownHandler]
812
800
  */
813
801
  declare function useDragWithElement<T extends Element>({
@@ -816,23 +804,65 @@ declare function useDragWithElement<T extends Element>({
816
804
  onDragStart,
817
805
  onDragEnd
818
806
  }: UseDragWithElementProps<T>): [(div: EventTarget | null) => void, (event: React.PointerEvent<T>) => void];
819
- //# sourceMappingURL=useDragWithElement.d.ts.map
820
807
  //#endregion
821
808
  //#region src/hooks/useEventListener.d.ts
822
809
  type Target = EventTarget | null | (() => EventTarget | null);
823
810
  type Options = boolean | AddEventListenerOptions;
811
+ /**
812
+ * @category hooks
813
+ */
824
814
  declare function useEventListener<K extends keyof DocumentEventMap>(target: Target, event: K, handler?: (event: DocumentEventMap[K]) => void, options?: Options): VoidFunction;
825
815
  declare function useEventListener<K extends keyof WindowEventMap>(target: Target, event: K, handler?: (event: WindowEventMap[K]) => void, options?: Options): VoidFunction;
826
816
  declare function useEventListener<K extends keyof GlobalEventHandlersEventMap>(target: Target, event: K, handler?: (event: GlobalEventHandlersEventMap[K]) => void, options?: Options): VoidFunction;
827
817
  //#endregion
828
818
  //#region src/hooks/useInterval.d.ts
819
+ /**
820
+ * @category hooks
821
+ */
829
822
  declare function useInterval(callback: () => void, delay: number | null): void;
830
823
  //# sourceMappingURL=useInterval.d.ts.map
831
824
  //#endregion
832
825
  //#region src/hooks/useLongPress.d.ts
826
+ /**
827
+ * @category hooks
828
+ */
833
829
  declare function useLongPress(callback: () => void, initialDelay?: number, interval?: number): () => void;
834
830
  //# sourceMappingURL=useLongPress.d.ts.map
831
+ //#endregion
832
+ //#region src/hooks/useMIDIAccess.d.ts
833
+ /** @private */
834
+ declare const PERMISSION_DENIED = "PERMISSION_DENIED";
835
+ /** @private */
836
+ declare const NOT_SUPPORTED = "NOT_SUPPORTED";
837
+ /** @private */
838
+ type MIDIAccessError = typeof PERMISSION_DENIED | typeof NOT_SUPPORTED;
839
+ /**
840
+ * Hooks for requesting MIDI access in the browser. The first argument allows you to choose whether to request access on mount.
841
+ * @category hooks
842
+ */
843
+ declare function useMIDIAccess(requestOnMount?: boolean): {
844
+ request: () => void;
845
+ midiAccess: MIDIAccess | null;
846
+ error: MIDIAccessError | null;
847
+ };
848
+ //# sourceMappingURL=useMIDIAccess.d.ts.map
849
+ //#endregion
850
+ //#region src/hooks/useMIDIInput.d.ts
851
+ /**
852
+ * Hooks for handling note on/off events. To be used with useMIDIAccess. Internally uses useMIDIMessage.
853
+ * @category hooks
854
+ */
855
+ declare function useMIDIInput(midiAccess: MIDIAccess | null, onNoteOnEvent?: (note: number, velocity: number) => void, onNoteOffEvent?: (note: number) => void, onPitchBendEvent?: (msb: number, lsb: number) => void): void;
856
+ //# sourceMappingURL=useMIDIInput.d.ts.map
857
+ //#endregion
858
+ //#region src/hooks/useMIDIMessage.d.ts
859
+ /**
860
+ * Hooks for when you want to process MIDI events in more detail than useMIDIInput.
861
+ * @category hooks
862
+ */
863
+ declare function useMIDIMessage(midiAccess: MIDIAccess | null, onMIDIMessage: (event: MIDIMessageEvent) => void): void;
864
+ //# sourceMappingURL=useMIDIMessage.d.ts.map
835
865
 
836
866
  //#endregion
837
- export { type AbsoluteSizingProps, AnimationCanvas, type AnimationCanvasProps, AnimationKnob, type AnimationKnobMethods, type AnimationKnobProps, type AreaProps, BlackKey, type CommonProps, DecrementStepper, type DecrementStepperProps, DragObserver, type DragObserverProps, type DrawFunction, IncrementStepper, type IncrementStepperProps, type InitFunction, KeyLabel, type KeyLabelProps, type KeyMethods, type KeyProps, type KeyboardShortcuts, Knob, type KnobMethods, type KnobProps, NumberInput, type NumberInputMethods, type NumberInputProps, Piano, type PianoProps, type RelativeSizingProps, SHORTCUTS, Scale, ScaleOption, type ScaleOptionProps, type ScaleProps, Slider, type SliderMethods, type SliderProps, SliderThumb, type SliderThumbMethods, type SliderThumbProps, SliderTrack, type SliderTrackProps, Stepper, type StepperProps, type ThumbProps, type UseDragProps, type UseDragWithElementProps, type ValueOptions, WheelObserver, type WheelObserverProps, WhiteKey, XYPad, XYPadArea, type XYPadMethods, type XYPadProps, XYPadThumb, type XYPadThumbMethods, getNoteRangeArray, useAnimationFrame, useDrag, useDragWithElement, useEventListener, useInterval, useLongPress, useSliderContext };
867
+ export { type AbsoluteSizingProps, AnimationCanvas, type AnimationCanvasProps, AnimationKnob, type AnimationKnobMethods, type AnimationKnobProps, type CommonProps, type DecrementStepperProps, DragObserver, type DragObserverProps, type DrawFunction, type IncrementStepperProps, type InitFunction, type KeyLabelProps, type KeyMethods, type KeyProps, type KeyboardShortcuts, Knob, type KnobMethods, type KnobProps, type MIDIAccessError, NOT_SUPPORTED, NumberInput, type NumberInputMethods, type NumberInputProps, PERMISSION_DENIED, Piano, type PianoMethods, type PianoProps, type RelativeSizingProps, SHORTCUTS, type ScaleOptionProps, type ScaleProps, Slider, type SliderMethods, type SliderProps, type SliderThumbMethods, type SliderThumbProps, type SliderTrackProps, type StepperProps, type ValueOptions, WheelObserver, type WheelObserverProps, XYPad, type XYPadAreaProps, type XYPadMethods, type XYPadProps, type XYPadThumbMethods, type XYPadThumbProps, getNoteRangeArray, useAnimationFrame, useDrag, useDragWithElement, useEventListener, useInterval, useLongPress, useMIDIAccess, useMIDIInput, useMIDIMessage, useSliderContext };
838
868
  //# sourceMappingURL=index.d.cts.map