@waveform-playlist/ui-components 5.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Naomi
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.
@@ -0,0 +1,642 @@
1
+ import * as react from 'react';
2
+ import react__default, { FunctionComponent, ReactNode, Dispatch, SetStateAction } from 'react';
3
+ import { Peaks, Bits } from '@waveform-playlist/webaudio-peaks';
4
+ import { Fade, FadeType } from '@waveform-playlist/core';
5
+ import { DraggableAttributes } from '@dnd-kit/core';
6
+ import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
7
+ import * as styled_components_dist_utils_hoist from 'styled-components/dist/utils/hoist';
8
+ import * as styled_components from 'styled-components';
9
+ import { DefaultTheme } from 'styled-components';
10
+ import * as styled_components_dist_types from 'styled-components/dist/types';
11
+ import { IconProps } from '@phosphor-icons/react';
12
+ import * as react_jsx_runtime from 'react/jsx-runtime';
13
+
14
+ interface AudioPositionProps {
15
+ formattedTime: string;
16
+ className?: string;
17
+ }
18
+ /**
19
+ * Displays the current audio playback position
20
+ */
21
+ declare const AudioPosition: react__default.FC<AudioPositionProps>;
22
+
23
+ interface AutomaticScrollCheckboxProps {
24
+ checked: boolean;
25
+ onChange: (checked: boolean) => void;
26
+ disabled?: boolean;
27
+ className?: string;
28
+ }
29
+ /**
30
+ * Checkbox control for enabling/disabling automatic scroll during playback
31
+ */
32
+ declare const AutomaticScrollCheckbox: react__default.FC<AutomaticScrollCheckboxProps>;
33
+
34
+ /**
35
+ * Waveform Playlist Theme
36
+ *
37
+ * This file defines the theme interface and default values for the waveform playlist components.
38
+ */
39
+ /**
40
+ * Gradient color stop for waveform gradients
41
+ */
42
+ interface GradientStop {
43
+ offset: number;
44
+ color: string;
45
+ }
46
+ /**
47
+ * Gradient configuration for waveforms
48
+ * Can be applied vertically (top to bottom) or horizontally (left to right)
49
+ */
50
+ interface WaveformGradient {
51
+ type: 'linear';
52
+ direction: 'vertical' | 'horizontal';
53
+ stops: GradientStop[];
54
+ }
55
+ /**
56
+ * Waveform color can be a simple string or a gradient configuration
57
+ */
58
+ type WaveformColor = string | WaveformGradient;
59
+ /**
60
+ * Type guard to check if a WaveformColor is a gradient
61
+ */
62
+ declare function isWaveformGradient(color: WaveformColor): color is WaveformGradient;
63
+ /**
64
+ * Converts WaveformColor to a CSS background value
65
+ */
66
+ declare function waveformColorToCss(color: WaveformColor): string;
67
+ /**
68
+ * Waveform drawing mode determines how colors are applied:
69
+ * - 'inverted': Canvas draws waveOutlineColor in areas WITHOUT audio (current default).
70
+ * waveFillColor shows through where audio peaks are. Good for gradient bars.
71
+ * - 'normal': Canvas draws waveFillColor bars where audio peaks ARE.
72
+ * waveOutlineColor is used as background. Good for gradient backgrounds.
73
+ */
74
+ type WaveformDrawMode = 'inverted' | 'normal';
75
+ interface WaveformPlaylistTheme {
76
+ waveformDrawMode?: WaveformDrawMode;
77
+ waveOutlineColor: WaveformColor;
78
+ waveFillColor: WaveformColor;
79
+ waveProgressColor: string;
80
+ selectedWaveOutlineColor: WaveformColor;
81
+ selectedWaveFillColor: WaveformColor;
82
+ selectedTrackControlsBackground: string;
83
+ timeColor: string;
84
+ timescaleBackgroundColor: string;
85
+ playheadColor: string;
86
+ selectionColor: string;
87
+ clipHeaderBackgroundColor: string;
88
+ clipHeaderBorderColor: string;
89
+ clipHeaderTextColor: string;
90
+ clipHeaderFontFamily: string;
91
+ selectedClipHeaderBackgroundColor: string;
92
+ fadeOverlayColor: string;
93
+ backgroundColor: string;
94
+ surfaceColor: string;
95
+ borderColor: string;
96
+ textColor: string;
97
+ textColorMuted: string;
98
+ inputBackground: string;
99
+ inputBorder: string;
100
+ inputText: string;
101
+ inputPlaceholder: string;
102
+ inputFocusBorder: string;
103
+ buttonBackground: string;
104
+ buttonText: string;
105
+ buttonBorder: string;
106
+ buttonHoverBackground: string;
107
+ sliderTrackColor: string;
108
+ sliderThumbColor: string;
109
+ annotationBoxBackground: string;
110
+ annotationBoxActiveBackground: string;
111
+ annotationBoxHoverBackground: string;
112
+ annotationBoxBorder: string;
113
+ annotationBoxActiveBorder: string;
114
+ annotationLabelColor: string;
115
+ annotationResizeHandleColor: string;
116
+ annotationResizeHandleActiveColor: string;
117
+ annotationTextItemHoverBackground: string;
118
+ borderRadius: string;
119
+ fontFamily: string;
120
+ fontSize: string;
121
+ fontSizeSmall: string;
122
+ }
123
+ declare const defaultTheme: WaveformPlaylistTheme;
124
+ declare const darkTheme: WaveformPlaylistTheme;
125
+
126
+ interface ChannelProps {
127
+ className?: string;
128
+ index: number;
129
+ data: Peaks;
130
+ bits: Bits;
131
+ length: number;
132
+ devicePixelRatio?: number;
133
+ waveHeight?: number;
134
+ /** Waveform bar color - can be a solid color string or gradient config */
135
+ waveOutlineColor?: WaveformColor;
136
+ /** Waveform background color - can be a solid color string or gradient config */
137
+ waveFillColor?: WaveformColor;
138
+ /** Width in pixels of waveform bars. Default: 1 */
139
+ barWidth?: number;
140
+ /** Spacing in pixels between waveform bars. Default: 0 */
141
+ barGap?: number;
142
+ /** If true, background is transparent (for use with external progress overlay) */
143
+ transparentBackground?: boolean;
144
+ /**
145
+ * Drawing mode:
146
+ * - 'inverted': Draw waveOutlineColor where there's NO audio (current default). Good for gradient bars.
147
+ * - 'normal': Draw waveFillColor where there IS audio. Good for gradient backgrounds.
148
+ */
149
+ drawMode?: WaveformDrawMode;
150
+ }
151
+ declare const Channel: FunctionComponent<ChannelProps>;
152
+
153
+ interface ClipProps {
154
+ className?: string;
155
+ children?: ReactNode;
156
+ clipId: string;
157
+ trackIndex: number;
158
+ clipIndex: number;
159
+ trackName: string;
160
+ startSample: number;
161
+ durationSamples: number;
162
+ samplesPerPixel: number;
163
+ showHeader?: boolean;
164
+ disableHeaderDrag?: boolean;
165
+ isOverlay?: boolean;
166
+ isSelected?: boolean;
167
+ onMouseDown?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
168
+ trackId?: string;
169
+ fadeIn?: Fade;
170
+ fadeOut?: Fade;
171
+ sampleRate?: number;
172
+ showFades?: boolean;
173
+ }
174
+ /**
175
+ * Clip component for rendering individual audio clips within a track
176
+ *
177
+ * Each clip is positioned based on its startTime and has a width based on its duration.
178
+ * This allows multiple clips to be arranged on a single track with gaps or overlaps.
179
+ *
180
+ * Includes a draggable ClipHeader at the top for repositioning clips on the timeline.
181
+ */
182
+ declare const Clip: FunctionComponent<ClipProps>;
183
+
184
+ declare const CLIP_HEADER_HEIGHT = 22;
185
+ interface ClipHeaderPresentationalProps {
186
+ trackName: string;
187
+ isSelected?: boolean;
188
+ }
189
+ declare const ClipHeaderPresentational: FunctionComponent<ClipHeaderPresentationalProps>;
190
+ interface DragHandleProps$1 {
191
+ attributes: DraggableAttributes;
192
+ listeners: SyntheticListenerMap | undefined;
193
+ setActivatorNodeRef: (element: HTMLElement | null) => void;
194
+ }
195
+ interface ClipHeaderProps {
196
+ clipId: string;
197
+ trackIndex: number;
198
+ clipIndex: number;
199
+ trackName: string;
200
+ isSelected?: boolean;
201
+ disableDrag?: boolean;
202
+ dragHandleProps?: DragHandleProps$1;
203
+ }
204
+ /**
205
+ * ClipHeader component - Draggable title bar for audio clips
206
+ *
207
+ * Renders at the top of each clip (above all channels).
208
+ * Drag the header to move the clip along the timeline.
209
+ * Shows the track name (not clip-specific info).
210
+ *
211
+ * Theme colors (from useTheme):
212
+ * - clipHeaderBackgroundColor / selectedClipHeaderBackgroundColor
213
+ * - clipHeaderBorderColor
214
+ * - clipHeaderTextColor
215
+ */
216
+ declare const ClipHeader: FunctionComponent<ClipHeaderProps>;
217
+
218
+ declare const CLIP_BOUNDARY_WIDTH = 8;
219
+ type BoundaryEdge = 'left' | 'right';
220
+ interface DragHandleProps extends DragHandleProps$1 {
221
+ isDragging?: boolean;
222
+ }
223
+ interface ClipBoundaryProps {
224
+ clipId: string;
225
+ trackIndex: number;
226
+ clipIndex: number;
227
+ edge: BoundaryEdge;
228
+ dragHandleProps?: DragHandleProps;
229
+ }
230
+ /**
231
+ * ClipBoundary component - Draggable edge for trimming clips
232
+ *
233
+ * Renders at the left or right edge of a clip.
234
+ * Drag to trim the clip (adjust offset and duration).
235
+ * Supports bidirectional trimming (trim in and out).
236
+ */
237
+ declare const ClipBoundary: FunctionComponent<ClipBoundaryProps>;
238
+
239
+ interface FadeOverlayProps {
240
+ /** Position in pixels from the start of the clip */
241
+ left: number;
242
+ /** Width of the fade region in pixels */
243
+ width: number;
244
+ /** Type of fade: fadeIn or fadeOut */
245
+ type: 'fadeIn' | 'fadeOut';
246
+ /** Fade curve type */
247
+ curveType?: FadeType;
248
+ /** Custom fill color (defaults to theme.fadeOverlayColor) */
249
+ color?: string;
250
+ }
251
+ /**
252
+ * FadeOverlay component - Visual indicator for fade in/out regions on clips
253
+ *
254
+ * Renders a semi-transparent overlay with a curved shape indicating
255
+ * the fade envelope. The shape follows the selected fade curve type.
256
+ */
257
+ declare const FadeOverlay: FunctionComponent<FadeOverlayProps>;
258
+
259
+ interface MasterVolumeControlProps {
260
+ volume: number;
261
+ onChange: (volume: number) => void;
262
+ disabled?: boolean;
263
+ className?: string;
264
+ }
265
+ /**
266
+ * Master volume control slider component
267
+ * Accepts volume as 0-1.0 range (linear gain) and displays as percentage
268
+ */
269
+ declare const MasterVolumeControl: react__default.FC<MasterVolumeControlProps>;
270
+
271
+ /**
272
+ * Props passed to the default playhead component or custom render function.
273
+ */
274
+ interface PlayheadProps {
275
+ /** Position in pixels from left edge (only valid when not playing) */
276
+ position: number;
277
+ /** Playhead color (default: #ff0000) */
278
+ color?: string;
279
+ /** Whether audio is currently playing */
280
+ isPlaying: boolean;
281
+ /** Ref to current time in seconds - use for smooth animation during playback */
282
+ currentTimeRef: react__default.RefObject<number>;
283
+ /** Audio context start time when playback began - for calculating elapsed time */
284
+ playbackStartTimeRef: react__default.RefObject<number>;
285
+ /** Audio position when playback started - for calculating current position */
286
+ audioStartPositionRef: react__default.RefObject<number>;
287
+ /** Samples per pixel - for converting time to pixels */
288
+ samplesPerPixel: number;
289
+ /** Sample rate - for converting time to pixels */
290
+ sampleRate: number;
291
+ /** Controls offset in pixels */
292
+ controlsOffset: number;
293
+ /** Function to get current audio context time - required for smooth animation */
294
+ getAudioContextTime?: () => number;
295
+ }
296
+ /**
297
+ * Type for custom playhead render functions.
298
+ * Receives position, color, and animation refs for smooth 60fps animation.
299
+ * Custom playheads should use requestAnimationFrame with the refs during playback.
300
+ */
301
+ type RenderPlayheadFunction = (props: PlayheadProps) => react__default.ReactNode;
302
+ /**
303
+ * Default playhead component - a simple vertical line.
304
+ * Uses GPU-accelerated transform for smooth animation.
305
+ */
306
+ declare const Playhead: react__default.FC<PlayheadProps>;
307
+ /**
308
+ * Playhead with a triangle marker at the top.
309
+ * Provides better visual indication of the current position.
310
+ * Uses requestAnimationFrame for smooth 60fps animation during playback.
311
+ */
312
+ declare const PlayheadWithMarker: react__default.FC<PlayheadProps>;
313
+
314
+ interface PlaylistProps {
315
+ readonly theme: DefaultTheme;
316
+ readonly children?: JSX.Element | JSX.Element[];
317
+ readonly backgroundColor?: string;
318
+ readonly timescaleBackgroundColor?: string;
319
+ readonly timescale?: JSX.Element;
320
+ readonly timescaleWidth?: number;
321
+ readonly tracksWidth?: number;
322
+ readonly scrollContainerWidth?: number;
323
+ readonly controlsWidth?: number;
324
+ readonly onTracksClick?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
325
+ readonly onTracksMouseDown?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
326
+ readonly onTracksMouseMove?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
327
+ readonly onTracksMouseUp?: (e: react__default.MouseEvent<HTMLDivElement>) => void;
328
+ readonly scrollContainerRef?: (el: HTMLDivElement | null) => void;
329
+ }
330
+ declare const Playlist: FunctionComponent<PlaylistProps>;
331
+ declare const StyledPlaylist: react__default.ForwardRefExoticComponent<styled_components.ExecutionProps & react__default.RefAttributes<react__default.FunctionComponent<PlaylistProps>>> & styled_components_dist_utils_hoist.NonReactStatics<react__default.FunctionComponent<PlaylistProps>>;
332
+
333
+ interface SelectionProps {
334
+ startPosition: number;
335
+ endPosition: number;
336
+ color?: string;
337
+ }
338
+ declare const Selection: react__default.FC<SelectionProps>;
339
+
340
+ interface SelectionTimeInputsProps {
341
+ selectionStart: number;
342
+ selectionEnd: number;
343
+ onSelectionChange?: (start: number, end: number) => void;
344
+ className?: string;
345
+ }
346
+ declare const SelectionTimeInputs: react__default.FC<SelectionTimeInputsProps>;
347
+
348
+ interface SmartChannelProps {
349
+ className?: string;
350
+ index: number;
351
+ data: Int8Array | Int16Array;
352
+ bits: 8 | 16;
353
+ length: number;
354
+ isSelected?: boolean;
355
+ /** If true, background is transparent (for use with external progress overlay) */
356
+ transparentBackground?: boolean;
357
+ }
358
+ declare const SmartChannel: FunctionComponent<SmartChannelProps>;
359
+
360
+ declare const SmartScale: FunctionComponent;
361
+
362
+ /**
363
+ * Time format utilities for displaying and parsing audio timestamps
364
+ */
365
+ type TimeFormat = 'seconds' | 'thousandths' | 'hh:mm:ss' | 'hh:mm:ss.u' | 'hh:mm:ss.uu' | 'hh:mm:ss.uuu';
366
+ /**
367
+ * Format seconds according to the specified format
368
+ */
369
+ declare function formatTime(seconds: number, format: TimeFormat): string;
370
+ /**
371
+ * Parse a formatted time string back to seconds
372
+ */
373
+ declare function parseTime(timeStr: string, format: TimeFormat): number;
374
+
375
+ interface TimeFormatSelectProps {
376
+ value: TimeFormat;
377
+ onChange: (format: TimeFormat) => void;
378
+ disabled?: boolean;
379
+ className?: string;
380
+ }
381
+ /**
382
+ * Dropdown select for choosing time display format
383
+ */
384
+ declare const TimeFormatSelect: react__default.FC<TimeFormatSelectProps>;
385
+
386
+ interface TimeInputProps {
387
+ id: string;
388
+ label: string;
389
+ value: number;
390
+ format: TimeFormat;
391
+ className?: string;
392
+ onChange?: (value: number) => void;
393
+ readOnly?: boolean;
394
+ }
395
+ /**
396
+ * TimeInput - A styled input for time values with format support
397
+ *
398
+ * Uses BaseInput for consistent theming. Displays time in the specified
399
+ * format and parses user input on blur.
400
+ */
401
+ declare const TimeInput: react__default.FC<TimeInputProps>;
402
+
403
+ interface TimeScaleProps {
404
+ readonly theme?: DefaultTheme;
405
+ readonly duration: number;
406
+ readonly marker: number;
407
+ readonly bigStep: number;
408
+ readonly secondStep: number;
409
+ readonly renderTimestamp?: (timeMs: number, pixelPosition: number) => react__default.ReactNode;
410
+ }
411
+ interface TimeScalePropsWithTheme extends TimeScaleProps {
412
+ readonly theme: DefaultTheme;
413
+ }
414
+ declare const TimeScale: FunctionComponent<TimeScalePropsWithTheme>;
415
+ declare const StyledTimeScale: FunctionComponent<TimeScaleProps>;
416
+
417
+ interface ControlsWrapperProps {
418
+ readonly $controlWidth: number;
419
+ readonly $isSelected?: boolean;
420
+ }
421
+ interface TrackProps {
422
+ className?: string;
423
+ children?: ReactNode;
424
+ numChannels: number;
425
+ backgroundColor?: string;
426
+ offset?: number;
427
+ width?: number;
428
+ hasClipHeaders?: boolean;
429
+ onClick?: () => void;
430
+ trackId?: string;
431
+ isSelected?: boolean;
432
+ }
433
+ declare const Track: FunctionComponent<TrackProps>;
434
+
435
+ /**
436
+ * TrackControls Button - Small button for track controls (Mute, Solo, etc.)
437
+ *
438
+ * Supports variants: outline (default), danger, info
439
+ * Uses theme values for consistent styling.
440
+ */
441
+ declare const Button: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<styled_components.FastOmit<styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
442
+ ref?: ((instance: HTMLButtonElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLButtonElement> | null | undefined;
443
+ }>, never>, {
444
+ $variant?: "outline" | "danger" | "info";
445
+ }>> & string;
446
+
447
+ declare const ButtonGroup: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
448
+
449
+ declare const Controls$1: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
450
+
451
+ declare const Header: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
452
+
453
+ declare const VolumeDownIcon: react__default.FC<IconProps>;
454
+
455
+ declare const VolumeUpIcon: react__default.FC<IconProps>;
456
+
457
+ declare const TrashIcon: react__default.FC<IconProps>;
458
+
459
+ /**
460
+ * TrackControls Slider - Compact slider for volume/pan controls
461
+ *
462
+ * Extends BaseSlider with track-specific styling:
463
+ * - Smaller thumb and track for compact layout
464
+ * - Uses theme's sliderThumbColor (goldenrod by default)
465
+ */
466
+ declare const Slider: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<styled_components.FastOmit<styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
467
+ ref?: ((instance: HTMLInputElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLInputElement> | null | undefined;
468
+ }>, never>, never>, never>> & string;
469
+
470
+ declare const SliderWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
471
+
472
+ /**
473
+ * Track Controls with Delete Button
474
+ *
475
+ * Reusable track controls component that includes standard controls
476
+ * (mute, solo, volume, pan) plus a delete button
477
+ */
478
+
479
+ interface TrackControlsWithDeleteProps {
480
+ trackIndex: number;
481
+ trackName: string;
482
+ muted: boolean;
483
+ soloed: boolean;
484
+ volume: number;
485
+ pan: number;
486
+ onMuteChange: (muted: boolean) => void;
487
+ onSoloChange: (soloed: boolean) => void;
488
+ onVolumeChange: (volume: number) => void;
489
+ onPanChange: (pan: number) => void;
490
+ onDelete: () => void;
491
+ }
492
+ /**
493
+ * Track controls with delete button
494
+ *
495
+ * @example
496
+ * ```tsx
497
+ * <TrackControlsWithDelete
498
+ * trackIndex={0}
499
+ * trackName="Track 1"
500
+ * muted={false}
501
+ * soloed={false}
502
+ * volume={1.0}
503
+ * pan={0}
504
+ * onMuteChange={(muted) => console.log('mute:', muted)}
505
+ * onSoloChange={(soloed) => console.log('solo:', soloed)}
506
+ * onVolumeChange={(volume) => console.log('volume:', volume)}
507
+ * onPanChange={(pan) => console.log('pan:', pan)}
508
+ * onDelete={() => console.log('delete')}
509
+ * />
510
+ * ```
511
+ */
512
+ declare const TrackControlsWithDelete: react__default.FC<TrackControlsWithDeleteProps>;
513
+
514
+ type Props$1 = {
515
+ children: ReactNode;
516
+ };
517
+ declare const DevicePixelRatioProvider: ({ children }: Props$1) => react_jsx_runtime.JSX.Element;
518
+ declare const useDevicePixelRatio: () => number;
519
+
520
+ type Controls = {
521
+ show: boolean;
522
+ width: number;
523
+ };
524
+ type PlaylistInfo = {
525
+ sampleRate: number;
526
+ samplesPerPixel: number;
527
+ zoomLevels: Array<number>;
528
+ waveHeight: number;
529
+ timeScaleHeight: number;
530
+ duration: number;
531
+ controls: Controls;
532
+ /** Width in pixels of waveform bars. Default: 1 */
533
+ barWidth: number;
534
+ /** Spacing in pixels between waveform bars. Default: 0 */
535
+ barGap: number;
536
+ /** Width in pixels of progress bars. Default: barWidth + barGap (fills gaps). Set to barWidth for no gap fill. */
537
+ progressBarWidth?: number;
538
+ };
539
+ declare const PlaylistInfoContext: react.Context<PlaylistInfo>;
540
+ declare const usePlaylistInfo: () => PlaylistInfo;
541
+
542
+ declare const useTheme: () => styled_components.DefaultTheme | undefined;
543
+
544
+ declare const TrackControlsContext: react__default.Context<react__default.ReactNode>;
545
+ declare const useTrackControls: () => react__default.ReactNode;
546
+
547
+ type PlayoutStatusUpdate = {
548
+ setIsPlaying: Dispatch<SetStateAction<boolean>>;
549
+ setProgress: Dispatch<SetStateAction<number>>;
550
+ setSelection: (start: number, end: number) => void;
551
+ };
552
+ type Props = {
553
+ children: ReactNode;
554
+ };
555
+ declare const PlayoutProvider: ({ children }: Props) => react_jsx_runtime.JSX.Element;
556
+ declare const usePlayoutStatus: () => {
557
+ progress: number;
558
+ isPlaying: boolean;
559
+ selectionStart: number;
560
+ selectionEnd: number;
561
+ };
562
+ declare const usePlayoutStatusUpdate: () => PlayoutStatusUpdate;
563
+
564
+ declare function samplesToSeconds(samples: number, sampleRate: number): number;
565
+ declare function secondsToSamples(seconds: number, sampleRate: number): number;
566
+ declare function samplesToPixels(samples: number, samplesPerPixel: number): number;
567
+ declare function pixelsToSamples(pixels: number, samplesPerPixel: number): number;
568
+ declare function pixelsToSeconds(pixels: number, samplesPerPixel: number, sampleRate: number): number;
569
+ declare function secondsToPixels(seconds: number, samplesPerPixel: number, sampleRate: number): number;
570
+
571
+ /**
572
+ * BaseButton - A styled button component that uses theme values
573
+ *
574
+ * This provides consistent styling across all button elements in the waveform playlist.
575
+ */
576
+ declare const BaseButton: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
577
+
578
+ /**
579
+ * BaseCheckboxWrapper - Container for checkbox + label
580
+ */
581
+ declare const BaseCheckboxWrapper: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
582
+ /**
583
+ * BaseCheckbox - A styled checkbox input
584
+ */
585
+ declare const BaseCheckbox: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
586
+ /**
587
+ * BaseCheckboxLabel - Label for checkboxes
588
+ */
589
+ declare const BaseCheckboxLabel: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
590
+
591
+ interface ControlButtonProps {
592
+ variant?: 'primary' | 'success' | 'info';
593
+ }
594
+ /**
595
+ * ControlButton - A colored action button (primary/success/info variants)
596
+ *
597
+ * This is used for prominent actions like Play, Pause, Record.
598
+ * For neutral buttons, use BaseButton from the styled primitives.
599
+ *
600
+ * Uses theme colors when available, with fallbacks for standalone use.
601
+ */
602
+ declare const BaseControlButton: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ControlButtonProps>> & string;
603
+
604
+ /**
605
+ * BaseInput - A styled input component that uses theme values
606
+ *
607
+ * This provides consistent styling across all input elements in the waveform playlist.
608
+ * Styling is controlled via the theme, making it easy to adapt to different environments.
609
+ */
610
+ declare const BaseInput: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
611
+
612
+ /**
613
+ * BaseLabel - A styled label component that uses theme values
614
+ */
615
+ declare const BaseLabel: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
616
+ /**
617
+ * InlineLabel - A label that displays inline with its input
618
+ */
619
+ declare const InlineLabel: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
620
+ /**
621
+ * ScreenReaderOnly - Visually hidden but accessible to screen readers
622
+ */
623
+ declare const ScreenReaderOnly: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
624
+
625
+ /**
626
+ * BaseSelect - A styled select component that uses theme values
627
+ *
628
+ * This provides consistent styling across all select elements in the waveform playlist.
629
+ */
630
+ declare const BaseSelect: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, never>> & string;
631
+
632
+ /**
633
+ * BaseSlider - Themed range input for volume controls, etc.
634
+ *
635
+ * Uses theme values for consistent styling across light/dark modes.
636
+ * Provides custom styling for the track and thumb.
637
+ */
638
+ declare const BaseSlider: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<styled_components.FastOmit<styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
639
+ ref?: ((instance: HTMLInputElement | null) => void | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | react.RefObject<HTMLInputElement> | null | undefined;
640
+ }>, never>, never>> & string;
641
+
642
+ export { AudioPosition, type AudioPositionProps, AutomaticScrollCheckbox, type AutomaticScrollCheckboxProps, BaseButton, BaseCheckbox, BaseCheckboxLabel, BaseCheckboxWrapper, BaseControlButton, BaseInput, BaseLabel, BaseSelect, BaseSlider, Button, ButtonGroup, CLIP_BOUNDARY_WIDTH, CLIP_HEADER_HEIGHT, Channel, type ChannelProps, Clip, ClipBoundary, type ClipBoundaryProps, ClipHeader, ClipHeaderPresentational, type ClipHeaderPresentationalProps, type ClipHeaderProps, type ClipProps, Controls$1 as Controls, type ControlsWrapperProps, DevicePixelRatioProvider, type DragHandleProps$1 as DragHandleProps, FadeOverlay, type FadeOverlayProps, type GradientStop, Header, InlineLabel, MasterVolumeControl, type MasterVolumeControlProps, Playhead, type PlayheadProps, PlayheadWithMarker, Playlist, PlaylistInfoContext, type PlaylistProps, PlayoutProvider, type RenderPlayheadFunction, ScreenReaderOnly, Selection, type SelectionProps, SelectionTimeInputs, type SelectionTimeInputsProps, Slider, SliderWrapper, SmartChannel, type SmartChannelProps, SmartScale, StyledPlaylist, StyledTimeScale, type TimeFormat, TimeFormatSelect, type TimeFormatSelectProps, TimeInput, type TimeInputProps, TimeScale, type TimeScaleProps, Track, TrackControlsContext, TrackControlsWithDelete, type TrackControlsWithDeleteProps, type TrackProps, TrashIcon, VolumeDownIcon, VolumeUpIcon, type WaveformColor, type WaveformDrawMode, type WaveformGradient, type WaveformPlaylistTheme, darkTheme, defaultTheme, formatTime, isWaveformGradient, parseTime, pixelsToSamples, pixelsToSeconds, samplesToPixels, samplesToSeconds, secondsToPixels, secondsToSamples, useDevicePixelRatio, usePlaylistInfo, usePlayoutStatus, usePlayoutStatusUpdate, useTheme, useTrackControls, waveformColorToCss };