panelui-web 0.9.1 → 0.10.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/dist/components/choice-cards/index.d.ts +167 -0
- package/dist/components/choice-cards/index.js +132 -0
- package/dist/components/inspector/index.d.ts +242 -0
- package/dist/components/inspector/index.js +230 -0
- package/dist/components/sheet/index.d.ts +16 -5
- package/dist/components/sheet/index.js +72 -15
- package/dist/components/slider/index.d.ts +293 -0
- package/dist/components/slider/index.js +342 -0
- package/dist/components/timeline/index.d.ts +328 -0
- package/dist/components/timeline/index.js +613 -0
- package/dist/components/toolbar/index.d.ts +185 -0
- package/dist/components/toolbar/index.js +270 -0
- package/dist/components/workbench/index.d.ts +224 -0
- package/dist/components/workbench/index.js +306 -0
- package/dist/components/xy-pad/index.d.ts +180 -0
- package/dist/components/xy-pad/index.js +278 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
export type TimelineColor = 'primary' | 'info' | 'success' | 'warning' | 'destructive' | 'chart-1' | 'chart-2' | 'chart-3' | 'chart-4' | 'chart-5';
|
|
3
|
+
export type TimelineClipVariant = 'bar' | 'block' | 'media';
|
|
4
|
+
export type TimelineTrackSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
/**
|
|
6
|
+
* A time as a reader expects it. On a timeline under a minute long, seconds
|
|
7
|
+
* with a unit: `0.5s`, `12s`. Longer, `m:ss`, and `h:mm:ss` past an hour.
|
|
8
|
+
* `tenths` adds a tenth of a second either way.
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatTime(seconds: number, tenths?: boolean, short?: boolean): string;
|
|
11
|
+
/** The ruler's step at a zoom: the smallest that keeps labels `LABEL_GAP` apart. */
|
|
12
|
+
export declare function rulerStep(zoom: number): number;
|
|
13
|
+
declare const timelineVariants: import("tailwind-variants").TVReturnType<{
|
|
14
|
+
variant: {
|
|
15
|
+
bar: {
|
|
16
|
+
clip: string;
|
|
17
|
+
};
|
|
18
|
+
block: {
|
|
19
|
+
clip: string;
|
|
20
|
+
};
|
|
21
|
+
media: {
|
|
22
|
+
clip: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
size: {
|
|
26
|
+
sm: {
|
|
27
|
+
track: string;
|
|
28
|
+
};
|
|
29
|
+
md: {
|
|
30
|
+
track: string;
|
|
31
|
+
};
|
|
32
|
+
lg: {
|
|
33
|
+
track: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
root: string[];
|
|
38
|
+
header: string;
|
|
39
|
+
time: string;
|
|
40
|
+
zoom: string;
|
|
41
|
+
viewport: string;
|
|
42
|
+
content: string;
|
|
43
|
+
scrollbar: string;
|
|
44
|
+
thumb: string;
|
|
45
|
+
end: string[];
|
|
46
|
+
ruler: string;
|
|
47
|
+
tick: string;
|
|
48
|
+
label: string;
|
|
49
|
+
track: string;
|
|
50
|
+
clip: string[];
|
|
51
|
+
handle: string[];
|
|
52
|
+
grip: string;
|
|
53
|
+
clipLabel: string[];
|
|
54
|
+
waveform: string;
|
|
55
|
+
guide: string;
|
|
56
|
+
playhead: string;
|
|
57
|
+
playheadLine: string;
|
|
58
|
+
playheadHead: string[];
|
|
59
|
+
}, undefined, {
|
|
60
|
+
variant: {
|
|
61
|
+
bar: {
|
|
62
|
+
clip: string;
|
|
63
|
+
};
|
|
64
|
+
block: {
|
|
65
|
+
clip: string;
|
|
66
|
+
};
|
|
67
|
+
media: {
|
|
68
|
+
clip: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
size: {
|
|
72
|
+
sm: {
|
|
73
|
+
track: string;
|
|
74
|
+
};
|
|
75
|
+
md: {
|
|
76
|
+
track: string;
|
|
77
|
+
};
|
|
78
|
+
lg: {
|
|
79
|
+
track: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
root: string[];
|
|
84
|
+
header: string;
|
|
85
|
+
time: string;
|
|
86
|
+
zoom: string;
|
|
87
|
+
viewport: string;
|
|
88
|
+
content: string;
|
|
89
|
+
scrollbar: string;
|
|
90
|
+
thumb: string;
|
|
91
|
+
end: string[];
|
|
92
|
+
ruler: string;
|
|
93
|
+
tick: string;
|
|
94
|
+
label: string;
|
|
95
|
+
track: string;
|
|
96
|
+
clip: string[];
|
|
97
|
+
handle: string[];
|
|
98
|
+
grip: string;
|
|
99
|
+
clipLabel: string[];
|
|
100
|
+
waveform: string;
|
|
101
|
+
guide: string;
|
|
102
|
+
playhead: string;
|
|
103
|
+
playheadLine: string;
|
|
104
|
+
playheadHead: string[];
|
|
105
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
106
|
+
variant: {
|
|
107
|
+
bar: {
|
|
108
|
+
clip: string;
|
|
109
|
+
};
|
|
110
|
+
block: {
|
|
111
|
+
clip: string;
|
|
112
|
+
};
|
|
113
|
+
media: {
|
|
114
|
+
clip: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
size: {
|
|
118
|
+
sm: {
|
|
119
|
+
track: string;
|
|
120
|
+
};
|
|
121
|
+
md: {
|
|
122
|
+
track: string;
|
|
123
|
+
};
|
|
124
|
+
lg: {
|
|
125
|
+
track: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
}, {
|
|
129
|
+
root: string[];
|
|
130
|
+
header: string;
|
|
131
|
+
time: string;
|
|
132
|
+
zoom: string;
|
|
133
|
+
viewport: string;
|
|
134
|
+
content: string;
|
|
135
|
+
scrollbar: string;
|
|
136
|
+
thumb: string;
|
|
137
|
+
end: string[];
|
|
138
|
+
ruler: string;
|
|
139
|
+
tick: string;
|
|
140
|
+
label: string;
|
|
141
|
+
track: string;
|
|
142
|
+
clip: string[];
|
|
143
|
+
handle: string[];
|
|
144
|
+
grip: string;
|
|
145
|
+
clipLabel: string[];
|
|
146
|
+
waveform: string;
|
|
147
|
+
guide: string;
|
|
148
|
+
playhead: string;
|
|
149
|
+
playheadLine: string;
|
|
150
|
+
playheadHead: string[];
|
|
151
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
152
|
+
/**
|
|
153
|
+
* The timeline's state, for controls of your own: a play button in a
|
|
154
|
+
* toolbar, a readout, a button that zooms to fit. Use it inside `<Timeline>`.
|
|
155
|
+
*/
|
|
156
|
+
export declare function useTimeline(): {
|
|
157
|
+
duration: number;
|
|
158
|
+
time: number;
|
|
159
|
+
setTime: (time: number) => void;
|
|
160
|
+
playing: boolean;
|
|
161
|
+
setPlaying: (playing: boolean) => void;
|
|
162
|
+
zoom: number;
|
|
163
|
+
setZoom: (zoom: number, anchor?: {
|
|
164
|
+
time: number;
|
|
165
|
+
x: number;
|
|
166
|
+
}) => void;
|
|
167
|
+
minZoom: number;
|
|
168
|
+
maxZoom: number;
|
|
169
|
+
};
|
|
170
|
+
export interface TimelineProps extends Omit<ComponentProps<'div'>, 'onChange'> {
|
|
171
|
+
/** How long the timeline is, in seconds. */
|
|
172
|
+
duration: number;
|
|
173
|
+
/** Where the playhead is, in seconds, when the caller holds it. */
|
|
174
|
+
time?: number;
|
|
175
|
+
/** Where the playhead starts, when the caller does not hold it. Default 0. */
|
|
176
|
+
defaultTime?: number;
|
|
177
|
+
/** Called with the new time when the playhead moves: scrubbed, stepped or playing. */
|
|
178
|
+
onTimeChange?: (time: number) => void;
|
|
179
|
+
/** Pixels per second, when the caller holds it. */
|
|
180
|
+
zoom?: number;
|
|
181
|
+
/** Pixels per second to start at. Default 12. */
|
|
182
|
+
defaultZoom?: number;
|
|
183
|
+
/** Called with the new zoom. */
|
|
184
|
+
onZoomChange?: (zoom: number) => void;
|
|
185
|
+
/** The furthest out it zooms, in pixels per second. Default 2. */
|
|
186
|
+
minZoom?: number;
|
|
187
|
+
/** The furthest in it zooms, in pixels per second. Default 120. */
|
|
188
|
+
maxZoom?: number;
|
|
189
|
+
/** Whether time is running, when the caller holds it. */
|
|
190
|
+
playing?: boolean;
|
|
191
|
+
/** Called when playback starts or stops, including when it reaches the end. */
|
|
192
|
+
onPlayingChange?: (playing: boolean) => void;
|
|
193
|
+
/** Start again from the beginning on reaching the end, instead of stopping. */
|
|
194
|
+
loop?: boolean;
|
|
195
|
+
/** Snap clip edges to other edges, the playhead and the ends. Default true. */
|
|
196
|
+
snap?: boolean;
|
|
197
|
+
/** Show it without letting clips be moved or trimmed. The playhead still moves. */
|
|
198
|
+
readOnly?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/** Holds the time, the zoom and playback for the parts inside it. */
|
|
201
|
+
declare function TimelineRoot({ duration, time: timeProp, defaultTime, onTimeChange, zoom: zoomProp, defaultZoom, onZoomChange, minZoom, maxZoom, playing: playingProp, onPlayingChange, loop, snap, readOnly, className, children, ...props }: TimelineProps): import("react").JSX.Element;
|
|
202
|
+
declare namespace TimelineRoot {
|
|
203
|
+
var displayName: string;
|
|
204
|
+
}
|
|
205
|
+
export interface TimelineHeaderProps extends ComponentProps<'div'> {
|
|
206
|
+
}
|
|
207
|
+
/** A row above the tracks, for a toolbar, the time and the zoom. */
|
|
208
|
+
declare function TimelineHeader({ className, ...props }: TimelineHeaderProps): import("react").JSX.Element;
|
|
209
|
+
declare namespace TimelineHeader {
|
|
210
|
+
var displayName: string;
|
|
211
|
+
}
|
|
212
|
+
export interface TimelineTimeProps extends ComponentProps<'span'> {
|
|
213
|
+
/** Show the length after the time, as `1:32 / 2:30`. Default true. */
|
|
214
|
+
showDuration?: boolean;
|
|
215
|
+
}
|
|
216
|
+
/** Where the playhead is, written out, and how long the whole is. */
|
|
217
|
+
declare function TimelineTime({ showDuration, className, ...props }: TimelineTimeProps): import("react").JSX.Element;
|
|
218
|
+
declare namespace TimelineTime {
|
|
219
|
+
var displayName: string;
|
|
220
|
+
}
|
|
221
|
+
export interface TimelineZoomProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
222
|
+
}
|
|
223
|
+
/** A line slider that zooms the timeline, with zoom out and zoom in either side. */
|
|
224
|
+
declare function TimelineZoom({ className, ...props }: TimelineZoomProps): import("react").JSX.Element;
|
|
225
|
+
declare namespace TimelineZoom {
|
|
226
|
+
var displayName: string;
|
|
227
|
+
}
|
|
228
|
+
export interface TimelineViewportProps extends ComponentProps<'div'> {
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The part that scrolls sideways: the ruler, the tracks and the playhead go
|
|
232
|
+
* in here. Pinch, or ⌘ or Ctrl with the wheel, zooms about the pointer.
|
|
233
|
+
*/
|
|
234
|
+
declare function TimelineViewport({ className, style, children, ...props }: TimelineViewportProps): import("react").JSX.Element;
|
|
235
|
+
declare namespace TimelineViewport {
|
|
236
|
+
var displayName: string;
|
|
237
|
+
}
|
|
238
|
+
export interface TimelineRulerProps extends ComponentProps<'div'> {
|
|
239
|
+
}
|
|
240
|
+
/** Ticks and times along the top. Pressing or dragging on it moves the playhead there. */
|
|
241
|
+
declare function TimelineRuler({ className, ...props }: TimelineRulerProps): import("react").JSX.Element;
|
|
242
|
+
declare namespace TimelineRuler {
|
|
243
|
+
var displayName: string;
|
|
244
|
+
}
|
|
245
|
+
export interface TimelineTrackProps extends ComponentProps<'div'> {
|
|
246
|
+
/** The height of the row: `sm` for bars, `md` for blocks, `lg` for media. Default `md`. */
|
|
247
|
+
size?: TimelineTrackSize;
|
|
248
|
+
/** What the track holds, for a screen reader: "Zooms", "Voice". */
|
|
249
|
+
label?: string;
|
|
250
|
+
}
|
|
251
|
+
/** A row of clips. Clips on one track cannot overlap. */
|
|
252
|
+
declare function TimelineTrack({ size, label, className, ...props }: TimelineTrackProps): import("react").JSX.Element;
|
|
253
|
+
declare namespace TimelineTrack {
|
|
254
|
+
var displayName: string;
|
|
255
|
+
}
|
|
256
|
+
export interface TimelineClipProps extends Omit<ComponentProps<'div'>, 'onChange'> {
|
|
257
|
+
/** Where it starts, in seconds. */
|
|
258
|
+
start: number;
|
|
259
|
+
/** Where it ends, in seconds. */
|
|
260
|
+
end: number;
|
|
261
|
+
/** Called with the new span while it is moved or trimmed. Without it the clip stays put. */
|
|
262
|
+
onChange?: (span: {
|
|
263
|
+
start: number;
|
|
264
|
+
end: number;
|
|
265
|
+
}) => void;
|
|
266
|
+
/** Called once a move or a trim ends. */
|
|
267
|
+
onChangeEnd?: (span: {
|
|
268
|
+
start: number;
|
|
269
|
+
end: number;
|
|
270
|
+
}) => void;
|
|
271
|
+
/** Called on Delete or Backspace while the clip has focus. */
|
|
272
|
+
onRemove?: () => void;
|
|
273
|
+
/** `bar`, `block` or `media`. Default: `bar` on a small track, `media` on a large one, `block` otherwise. */
|
|
274
|
+
variant?: TimelineClipVariant;
|
|
275
|
+
/** Its colour, from the theme. Default `primary`. */
|
|
276
|
+
color?: TimelineColor;
|
|
277
|
+
/** What a screen reader calls it, before its times. */
|
|
278
|
+
label?: string;
|
|
279
|
+
}
|
|
280
|
+
/** One clip. With `onChange` it moves by its middle and trims by its ends. */
|
|
281
|
+
declare function TimelineClip({ start, end, onChange, onChangeEnd, onRemove, variant: variantProp, color, label, className, style, children, onKeyDown, ...props }: TimelineClipProps): import("react").JSX.Element;
|
|
282
|
+
declare namespace TimelineClip {
|
|
283
|
+
var displayName: string;
|
|
284
|
+
}
|
|
285
|
+
export interface TimelineClipLabelProps extends ComponentProps<'span'> {
|
|
286
|
+
}
|
|
287
|
+
/** Words on a clip, with an icon: its length, its speed, what it is. */
|
|
288
|
+
declare function TimelineClipLabel({ className, ...props }: TimelineClipLabelProps): import("react").JSX.Element;
|
|
289
|
+
declare namespace TimelineClipLabel {
|
|
290
|
+
var displayName: string;
|
|
291
|
+
}
|
|
292
|
+
export interface TimelineWaveformProps extends Omit<ComponentProps<'svg'>, 'children'> {
|
|
293
|
+
/** Loudness along the clip, each from 0 to 1. Drawn mirrored about the middle. */
|
|
294
|
+
peaks: number[];
|
|
295
|
+
}
|
|
296
|
+
/** The sound of a media clip, drawn as bars across it. */
|
|
297
|
+
declare function TimelineWaveform({ peaks, className, ...props }: TimelineWaveformProps): import("react").JSX.Element;
|
|
298
|
+
declare namespace TimelineWaveform {
|
|
299
|
+
var displayName: string;
|
|
300
|
+
}
|
|
301
|
+
export interface TimelinePlayheadProps extends Omit<ComponentProps<'div'>, 'color'> {
|
|
302
|
+
/** The colour of the line and its head. Default `primary`. */
|
|
303
|
+
color?: TimelineColor;
|
|
304
|
+
/** Write the time in the head. Default true. */
|
|
305
|
+
showTime?: boolean;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The line at the current time, from the ruler to the bottom. Its head can
|
|
309
|
+
* be dragged, and with focus the arrow keys step it: a tenth of a second,
|
|
310
|
+
* or a second with Shift.
|
|
311
|
+
*/
|
|
312
|
+
declare function TimelinePlayhead({ color, showTime, className, style, ...props }: TimelinePlayheadProps): import("react").JSX.Element;
|
|
313
|
+
declare namespace TimelinePlayhead {
|
|
314
|
+
var displayName: string;
|
|
315
|
+
}
|
|
316
|
+
export declare const Timeline: typeof TimelineRoot & {
|
|
317
|
+
Header: typeof TimelineHeader;
|
|
318
|
+
Time: typeof TimelineTime;
|
|
319
|
+
Zoom: typeof TimelineZoom;
|
|
320
|
+
Viewport: typeof TimelineViewport;
|
|
321
|
+
Ruler: typeof TimelineRuler;
|
|
322
|
+
Track: typeof TimelineTrack;
|
|
323
|
+
Clip: typeof TimelineClip;
|
|
324
|
+
ClipLabel: typeof TimelineClipLabel;
|
|
325
|
+
Waveform: typeof TimelineWaveform;
|
|
326
|
+
Playhead: typeof TimelinePlayhead;
|
|
327
|
+
};
|
|
328
|
+
export { TimelineHeader, TimelineTime, TimelineZoom, TimelineViewport, TimelineRuler, TimelineTrack, TimelineClip, TimelineClipLabel, TimelineWaveform, TimelinePlayhead, timelineVariants, };
|