@setsquare/ui 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +3 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/cn.d.ts.map +1 -1
- package/dist/lib/cn.js +1 -0
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/english.d.ts.map +1 -1
- package/dist/lib/english.js +2 -0
- package/dist/lib/english.js.map +1 -1
- package/dist/lib/locale.d.ts +3 -0
- package/dist/lib/locale.d.ts.map +1 -1
- package/dist/lib/locale.js.map +1 -1
- package/dist/lib/timeline-scale.d.ts +106 -0
- package/dist/lib/timeline-scale.d.ts.map +1 -0
- package/dist/lib/timeline-scale.js +221 -0
- package/dist/lib/timeline-scale.js.map +1 -0
- package/dist/shell/right-panel.d.ts +9 -1
- package/dist/shell/right-panel.d.ts.map +1 -1
- package/dist/shell/right-panel.js +3 -2
- package/dist/shell/right-panel.js.map +1 -1
- package/dist/styles/theme.css +2 -0
- package/dist/styles/tokens.css +5 -0
- package/dist/tokens.json +15 -0
- package/dist/ui/timeline.d.ts +231 -0
- package/dist/ui/timeline.d.ts.map +1 -0
- package/dist/ui/timeline.js +543 -0
- package/dist/ui/timeline.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time on a timeline: formats for the ruler and for screen readers, the ruler's tick steps at a zoom, snapping, and
|
|
3
|
+
* stacking flags that would overlap. Plain functions, so they are tested without a browser and a server can use them.
|
|
4
|
+
*
|
|
5
|
+
* Every time is a number of seconds. For `date`, it is seconds since the Unix epoch.
|
|
6
|
+
*/
|
|
7
|
+
const pad = (n, width = 2) => String(Math.floor(n)).padStart(width, '0');
|
|
8
|
+
const fpsOf = (o) => o.fps ?? 25;
|
|
9
|
+
/** The frame a time falls in, counting from 0. */
|
|
10
|
+
export const frameAt = (t, fps) => Math.round(t * fps + 1e-9);
|
|
11
|
+
/**
|
|
12
|
+
* A time as the ruler and a tooltip show it. `step` is the ruler's step, so a label says no more than the step can
|
|
13
|
+
* tell apart: 0:04 for whole seconds, 0:04.5 for tenths. For `date`, the step picks the parts (time of day, day,
|
|
14
|
+
* month).
|
|
15
|
+
*/
|
|
16
|
+
export function formatTime(t, options, step = 1) {
|
|
17
|
+
const fps = fpsOf(options);
|
|
18
|
+
switch (options.format) {
|
|
19
|
+
case 'frames':
|
|
20
|
+
return new Intl.NumberFormat(options.locale).format(frameAt(t, fps));
|
|
21
|
+
case 'timecode': {
|
|
22
|
+
const frames = frameAt(t, fps);
|
|
23
|
+
const whole = Math.floor(frames / fps);
|
|
24
|
+
return `${pad(whole / 3600)}:${pad((whole % 3600) / 60)}:${pad(whole % 60)}:${pad(frames % fps)}`;
|
|
25
|
+
}
|
|
26
|
+
case 'date': {
|
|
27
|
+
const date = new Date(t * 1000);
|
|
28
|
+
const zone = options.timeZone ? { timeZone: options.timeZone } : {};
|
|
29
|
+
const parts = step < 60
|
|
30
|
+
? { hour: 'numeric', minute: '2-digit', second: '2-digit' }
|
|
31
|
+
: step < 86400
|
|
32
|
+
? { hour: 'numeric', minute: '2-digit' }
|
|
33
|
+
: step < 28 * 86400
|
|
34
|
+
? { day: 'numeric', month: 'short' }
|
|
35
|
+
: { month: 'short', year: 'numeric' };
|
|
36
|
+
return new Intl.DateTimeFormat(options.locale, { ...parts, ...zone }).format(date);
|
|
37
|
+
}
|
|
38
|
+
default: {
|
|
39
|
+
const decimals = step >= 1 ? 0 : step >= 0.1 ? 1 : 2;
|
|
40
|
+
const sign = t < 0 ? '-' : '';
|
|
41
|
+
const abs = Math.abs(t);
|
|
42
|
+
const hours = Math.floor(abs / 3600);
|
|
43
|
+
const minutes = Math.floor((abs % 3600) / 60);
|
|
44
|
+
const seconds = abs % 60;
|
|
45
|
+
const secondsText = new Intl.NumberFormat(options.locale, {
|
|
46
|
+
minimumIntegerDigits: 2,
|
|
47
|
+
minimumFractionDigits: decimals,
|
|
48
|
+
maximumFractionDigits: decimals,
|
|
49
|
+
useGrouping: false,
|
|
50
|
+
}).format(Math.floor(seconds * 10 ** decimals + 1e-9) / 10 ** decimals);
|
|
51
|
+
return hours
|
|
52
|
+
? `${sign}${hours}:${pad(minutes)}:${secondsText}`
|
|
53
|
+
: `${sign}${minutes}:${secondsText}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A time in words, for a screen reader (a slider's aria-valuetext): "1 minute, 4.5 seconds", from the locale's own
|
|
59
|
+
* unit names and list pattern. `words.frames` names a count of frames, which Intl has no unit for ("12 frames"), and
|
|
60
|
+
* `words.frame` a frame number ("Frame 96"); both come from the component's labels.
|
|
61
|
+
*/
|
|
62
|
+
export function speakTime(t, options, words) {
|
|
63
|
+
const locale = options.locale;
|
|
64
|
+
const fps = fpsOf(options);
|
|
65
|
+
if (options.format === 'date') {
|
|
66
|
+
const zone = options.timeZone ? { timeZone: options.timeZone } : {};
|
|
67
|
+
return new Intl.DateTimeFormat(locale, {
|
|
68
|
+
dateStyle: 'medium',
|
|
69
|
+
timeStyle: 'short',
|
|
70
|
+
...zone,
|
|
71
|
+
}).format(new Date(t * 1000));
|
|
72
|
+
}
|
|
73
|
+
if (options.format === 'frames')
|
|
74
|
+
return words.frame(frameAt(t, fps));
|
|
75
|
+
const unit = (value, name, digits = 0) => new Intl.NumberFormat(locale, {
|
|
76
|
+
style: 'unit',
|
|
77
|
+
unit: name,
|
|
78
|
+
unitDisplay: 'long',
|
|
79
|
+
maximumFractionDigits: digits,
|
|
80
|
+
}).format(value);
|
|
81
|
+
const list = new Intl.ListFormat(locale, { style: 'long', type: 'unit' });
|
|
82
|
+
if (options.format === 'timecode') {
|
|
83
|
+
const frames = frameAt(t, fps);
|
|
84
|
+
const whole = Math.floor(frames / fps);
|
|
85
|
+
const parts = [
|
|
86
|
+
whole >= 3600 ? unit(Math.floor(whole / 3600), 'hour') : '',
|
|
87
|
+
whole >= 60 ? unit(Math.floor((whole % 3600) / 60), 'minute') : '',
|
|
88
|
+
unit(whole % 60, 'second'),
|
|
89
|
+
words.frames(frames % fps),
|
|
90
|
+
].filter(Boolean);
|
|
91
|
+
return list.format(parts);
|
|
92
|
+
}
|
|
93
|
+
const abs = Math.abs(t);
|
|
94
|
+
const hours = Math.floor(abs / 3600);
|
|
95
|
+
const minutes = Math.floor((abs % 3600) / 60);
|
|
96
|
+
const seconds = Math.round((abs % 60) * 100) / 100;
|
|
97
|
+
const parts = [
|
|
98
|
+
hours ? unit(hours, 'hour') : '',
|
|
99
|
+
minutes ? unit(minutes, 'minute') : '',
|
|
100
|
+
seconds || (!hours && !minutes) ? unit(seconds, 'second', 2) : '',
|
|
101
|
+
].filter(Boolean);
|
|
102
|
+
return list.format(parts);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The steps a ruler may label, in seconds, smallest first. Dates stop at a fortnight: months and years aren't a
|
|
106
|
+
* whole number of seconds, so a ruler that long needs calendar ticks, which this doesn't draw.
|
|
107
|
+
*/
|
|
108
|
+
function ladder(options) {
|
|
109
|
+
const fps = fpsOf(options);
|
|
110
|
+
const seconds = [
|
|
111
|
+
1, 2, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200,
|
|
112
|
+
];
|
|
113
|
+
switch (options.format) {
|
|
114
|
+
case 'frames':
|
|
115
|
+
case 'timecode':
|
|
116
|
+
return [...[1, 2, 5, 10].filter((f) => f < fps).map((f) => f / fps), ...seconds];
|
|
117
|
+
case 'date':
|
|
118
|
+
return [...seconds, 86400, 2 * 86400, 7 * 86400, 14 * 86400];
|
|
119
|
+
default:
|
|
120
|
+
return [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, ...seconds];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The ruler's steps at a zoom. `major` is the smallest labelled step whose labels are at least `minLabelPx` apart:
|
|
125
|
+
* a number, or a function of the step, since a label's width depends on what it shows (0:04 or 0:04.5, a time or a
|
|
126
|
+
* day). `minor` is the smallest step on the same ladder that divides `major` into at most ten, with ticks at least
|
|
127
|
+
* `minTickPx` apart, or null when there's no room for one.
|
|
128
|
+
*/
|
|
129
|
+
export function tickSteps(pxPerSecond, options, minLabelPx = 72, minTickPx = 8) {
|
|
130
|
+
const steps = ladder(options);
|
|
131
|
+
const need = typeof minLabelPx === 'number' ? () => minLabelPx : minLabelPx;
|
|
132
|
+
const major = steps.find((s) => s * pxPerSecond >= need(s)) ?? steps[steps.length - 1];
|
|
133
|
+
const divides = (s) => Math.abs(major / s - Math.round(major / s)) < 1e-6;
|
|
134
|
+
const minor = steps.find((s) => s < major && divides(s) && major / s <= 10 && s * pxPerSecond >= minTickPx) ??
|
|
135
|
+
null;
|
|
136
|
+
return { major, minor };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The ticks from `start` to `end`: every `step` counted from `origin`, each marked major when it is also a whole
|
|
140
|
+
* number of `major` steps from there. A date ruler counts from its own start (local midnight, say), not from the
|
|
141
|
+
* epoch, so its hours and days fall where the reader's do.
|
|
142
|
+
*/
|
|
143
|
+
export function ticks(start, end, step, major = step, origin = 0) {
|
|
144
|
+
const out = [];
|
|
145
|
+
const first = Math.ceil((start - origin) / step - 1e-9);
|
|
146
|
+
for (let i = first; i < first + 5000; i++) {
|
|
147
|
+
const t = Math.round((origin + i * step) * 1e6) / 1e6;
|
|
148
|
+
if (t > end + 1e-9)
|
|
149
|
+
break;
|
|
150
|
+
const n = (t - origin) / major;
|
|
151
|
+
out.push({ t, major: Math.abs(n - Math.round(n)) < 1e-6 });
|
|
152
|
+
}
|
|
153
|
+
return out;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The nearest snap point within `thresholdPx` of `t` at this zoom, and the time to use: the point's, or `t` itself
|
|
157
|
+
* when none is close enough.
|
|
158
|
+
*/
|
|
159
|
+
export function snap(t, points, pxPerSecond, thresholdPx = 8) {
|
|
160
|
+
let best = null;
|
|
161
|
+
let distance = Infinity;
|
|
162
|
+
for (const point of points) {
|
|
163
|
+
const d = Math.abs(point.time - t) * pxPerSecond;
|
|
164
|
+
if (d <= thresholdPx && d < distance) {
|
|
165
|
+
best = point;
|
|
166
|
+
distance = d;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return { time: best ? best.time : t, point: best };
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Where a pointer puts something: `raw` rounded to the nearest `step` from `origin` (a frame, say), then pulled to
|
|
173
|
+
* a snap point within `thresholdPx`, which wins over the step. `free` (Alt held) skips both.
|
|
174
|
+
*/
|
|
175
|
+
export function place(raw, options, thresholdPx = 8) {
|
|
176
|
+
if (options.free)
|
|
177
|
+
return { time: raw, point: null };
|
|
178
|
+
const origin = options.origin ?? 0;
|
|
179
|
+
const stepped = origin + Math.round((raw - origin) / options.step) * options.step;
|
|
180
|
+
const near = snap(raw, options.points ?? [], options.pxPerSecond, thresholdPx);
|
|
181
|
+
return near.point ? near : { time: Math.round(stepped * 1e6) / 1e6, point: null };
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Where a key press moves something: `delta` from `t`, caught by the first snap point it would cross or come
|
|
185
|
+
* within `thresholdPx` of. Only points beyond `t` count, so the next press moves on from a point rather than
|
|
186
|
+
* sticking to it. `free` (Alt held) moves by `delta` alone.
|
|
187
|
+
*/
|
|
188
|
+
export function nudge(t, delta, options, thresholdPx = 8) {
|
|
189
|
+
const next = Math.round((t + delta) * 1e6) / 1e6;
|
|
190
|
+
if (options.free || !options.points?.length)
|
|
191
|
+
return { time: next, point: null };
|
|
192
|
+
const reach = thresholdPx / options.pxPerSecond;
|
|
193
|
+
const ahead = options.points.filter((p) => delta > 0
|
|
194
|
+
? p.time > t + 1e-9 && p.time <= next + reach
|
|
195
|
+
: p.time < t - 1e-9 && p.time >= next - reach);
|
|
196
|
+
if (!ahead.length)
|
|
197
|
+
return { time: next, point: null };
|
|
198
|
+
const point = ahead.reduce((a, b) => (Math.abs(b.time - t) < Math.abs(a.time - t) ? b : a));
|
|
199
|
+
return { time: point.time, point };
|
|
200
|
+
}
|
|
201
|
+
/** `t` kept between `min` and `max`. */
|
|
202
|
+
export const clampTime = (t, min, max) => Math.min(max, Math.max(min, t));
|
|
203
|
+
/**
|
|
204
|
+
* Stacks flags whose labels would overlap into tiers: each takes the lowest tier where nothing already there reaches
|
|
205
|
+
* its start (with `gap` px between). Given each flag's left and right edge in px; returns each one's tier, in the
|
|
206
|
+
* order given, and how many tiers there are.
|
|
207
|
+
*/
|
|
208
|
+
export function stackTiers(flags, gap = 4) {
|
|
209
|
+
const order = flags.map((f, i) => ({ ...f, i })).sort((a, b) => a.left - b.left || a.i - b.i);
|
|
210
|
+
const ends = [];
|
|
211
|
+
const tiers = new Array(flags.length).fill(0);
|
|
212
|
+
for (const flag of order) {
|
|
213
|
+
let tier = ends.findIndex((end) => end + gap <= flag.left);
|
|
214
|
+
if (tier === -1)
|
|
215
|
+
tier = ends.length;
|
|
216
|
+
ends[tier] = flag.right;
|
|
217
|
+
tiers[flag.i] = tier;
|
|
218
|
+
}
|
|
219
|
+
return { tiers, count: Math.max(1, ends.length) };
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=timeline-scale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-scale.js","sourceRoot":"","sources":["../../src/lib/timeline-scale.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjF,MAAM,KAAK,GAAG,CAAC,CAAoB,E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|
|
16
|
+
/**
|
|
17
|
+
* How the content sits in the panel. `"sections"`, the default: padded, `PanelSection`s stacked 20px apart, and
|
|
18
|
+
* the body scrolls. `"fill"`: for content that lays itself out (a chat with its own header, a scrolling list
|
|
19
|
+
* and a composer), the body is a flex column with no padding or gap that doesn't scroll; the content fills it,
|
|
20
|
+
* and its own scrollers work, since the body is `min-h-0`. The same beside main and in the Sheet. The content's
|
|
21
|
+
* scrollers are the product's to make reachable by keyboard: a tab stop on any that holds nothing focusable.
|
|
22
|
+
*/
|
|
23
|
+
body?: 'sections' | 'fill';
|
|
16
24
|
/**
|
|
17
25
|
* Its width beside main: `"default"`, `--panel-width` (320px; 360px at AAA); `"wide"`, `--panel-width-wide` (512px;
|
|
18
26
|
* 560px at AAA), for a panel that is a working surface such as a chat; or a number of px, kept between
|
|
@@ -40,7 +48,7 @@ export interface RightPanelProps {
|
|
|
40
48
|
* Extra information about the current selection. An <aside> beside main on wide shells,
|
|
41
49
|
* a Sheet (modal dialog) on narrow ones. Closing returns focus to the PanelToggle.
|
|
42
50
|
*/
|
|
43
|
-
export declare function RightPanel({ title, children, footer, width, hideTitleBar, 'aria-labelledby': labelledBy, isDismissable, labels: given, className, }: RightPanelProps): import("react").JSX.Element | null;
|
|
51
|
+
export declare function RightPanel({ title, children, footer, body: layout, width, hideTitleBar, 'aria-labelledby': labelledBy, isDismissable, labels: given, className, }: RightPanelProps): import("react").JSX.Element | null;
|
|
44
52
|
/** Shows and hides the right panel. Put it in the page actions. */
|
|
45
53
|
export declare function PanelToggle({ label, labels, }: {
|
|
46
54
|
/** @deprecated Use `labels.toggle`. Kept for one release. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"right-panel.d.ts","sourceRoot":"","sources":["../../src/shell/right-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,SAAS,EAAkB,MAAM,OAAO,CAAC;AAS9D,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACp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oC;IACpC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACpC;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EAAE,MAAmB,EACzB,KAAiB,EACjB,YAAY,EACZ,iBAAiB,EAAE,UAAU,EAC7B,aAAoB,EACpB,MAAM,EAAE,KAAK,EACb,SAAS,GACV,EAAE,eAAe,sCAiFjB;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,MAAM,GACP,EAAE;IACD,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpC,+BAcA;AAED,uCAAuC;AACvC,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,SAAS,GACV,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAOA"}
|
|
@@ -17,13 +17,14 @@ const panelWidths = { default: 'w-panel', wide: 'w-(--panel-width-wide)' };
|
|
|
17
17
|
* Extra information about the current selection. An <aside> beside main on wide shells,
|
|
18
18
|
* a Sheet (modal dialog) on narrow ones. Closing returns focus to the PanelToggle.
|
|
19
19
|
*/
|
|
20
|
-
export function RightPanel({ title, children, footer, width = 'default', hideTitleBar, 'aria-labelledby': labelledBy, isDismissable = true, labels: given, className, }) {
|
|
20
|
+
export function RightPanel({ title, children, footer, body: layout = 'sections', width = 'default', hideTitleBar, 'aria-labelledby': labelledBy, isDismissable = true, labels: given, className, }) {
|
|
21
21
|
const t = useLabels('rightPanel', rightPanelLabels, given);
|
|
22
22
|
const close = t('close', { title });
|
|
23
23
|
const { panelOpen, setPanelOpen, panelMode, panelToggleRef, isSizeForced } = useShell();
|
|
24
24
|
const headingId = useId();
|
|
25
25
|
const foot = footer ? (_jsx("div", { className: "flex gap-(--control-gap) border-t border-border px-4 py-3 *:flex-1", children: footer })) : null;
|
|
26
|
-
|
|
26
|
+
// Positioned either way, so hidden inputs and text inside are placed against it (positioned-scroll-container).
|
|
27
|
+
const body = (_jsx("div", { "data-panel-body": layout, className: cn('relative flex min-h-0 flex-1 flex-col', layout === 'sections' && 'gap-5 overflow-y-auto p-4'), children: children }));
|
|
27
28
|
if (panelMode === 'sheet') {
|
|
28
29
|
return (_jsx(Sheet, { side: "right", title: title, labels: { close: literal(close) }, isOpen: panelOpen, onOpenChange: setPanelOpen, footer: foot, children: body }));
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"right-panel.js","sourceRoot":"","sources":["../../src/shell/right-panel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAkC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,E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,CAAC,CAAC,CAAC,SAAS,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,GACvC,CACH,CAAC;AACJ,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,SAAS,GAKV;IACC,OAAO,CACL,mBAAS,SAAS,EAAE,SAAS,aAC1B,KAAK,IAAI,aAAI,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAM,EAC5D,QAAQ,IACD,CACX,CAAC;AACJ,CAAC"}
|
package/dist/styles/theme.css
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
--container-site: var(--site-max);
|
|
72
72
|
--container-site-narrow: var(--site-max-narrow);
|
|
73
73
|
--spacing-nav-item: var(--nav-item-height);
|
|
74
|
+
--spacing-lane: var(--lane-height);
|
|
74
75
|
--spacing-header: var(--header-height);
|
|
75
76
|
--spacing-sidebar: var(--sidebar-width);
|
|
76
77
|
--spacing-sidebar-collapsed: var(--sidebar-width-collapsed);
|
|
@@ -1333,6 +1334,7 @@
|
|
|
1333
1334
|
--control-pad-x: var(--control-pad-x-compact);
|
|
1334
1335
|
--control-gap: var(--control-gap-compact);
|
|
1335
1336
|
--nav-item-height: var(--nav-item-height-compact);
|
|
1337
|
+
--lane-height: var(--lane-height-compact);
|
|
1336
1338
|
--field-gap: var(--field-gap-compact);
|
|
1337
1339
|
--text-sm: var(--text-sm-compact);
|
|
1338
1340
|
}
|
package/dist/styles/tokens.css
CHANGED
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
--control-gap-aaa: 12px;
|
|
32
32
|
--nav-item-height-aa: 36px;
|
|
33
33
|
--nav-item-height-aaa: 36px;
|
|
34
|
+
--lane-height-aa: 32px;
|
|
35
|
+
--lane-height-aaa: 44px;
|
|
34
36
|
--nav-item-gap-aa: 2px;
|
|
35
37
|
--nav-item-gap-aaa: 4px;
|
|
36
38
|
--choice-size-aa: 20px;
|
|
@@ -54,6 +56,7 @@
|
|
|
54
56
|
--control-pad-x-compact: 8px;
|
|
55
57
|
--control-gap-compact: 4px;
|
|
56
58
|
--nav-item-height-compact: 28px;
|
|
59
|
+
--lane-height-compact: 24px;
|
|
57
60
|
--field-gap-compact: 12px;
|
|
58
61
|
--text-sm-compact: 13px;
|
|
59
62
|
--header-height-aa: 56px;
|
|
@@ -108,6 +111,7 @@
|
|
|
108
111
|
--control-pad-x: var(--control-pad-x-aa);
|
|
109
112
|
--control-gap: var(--control-gap-aa);
|
|
110
113
|
--nav-item-height: var(--nav-item-height-aa);
|
|
114
|
+
--lane-height: var(--lane-height-aa);
|
|
111
115
|
--nav-item-gap: var(--nav-item-gap-aa);
|
|
112
116
|
--choice-size: var(--choice-size-aa);
|
|
113
117
|
--field-gap: var(--field-gap-aa);
|
|
@@ -132,6 +136,7 @@
|
|
|
132
136
|
--control-pad-x: var(--control-pad-x-aaa);
|
|
133
137
|
--control-gap: var(--control-gap-aaa);
|
|
134
138
|
--nav-item-height: var(--nav-item-height-aaa);
|
|
139
|
+
--lane-height: var(--lane-height-aaa);
|
|
135
140
|
--nav-item-gap: var(--nav-item-gap-aaa);
|
|
136
141
|
--choice-size: var(--choice-size-aaa);
|
|
137
142
|
--field-gap: var(--field-gap-aaa);
|
package/dist/tokens.json
CHANGED
|
@@ -753,6 +753,16 @@
|
|
|
753
753
|
"value": "36px",
|
|
754
754
|
"usage": "Equal to AA by default: at AAA the 36px highlight sits in a 44px row."
|
|
755
755
|
},
|
|
756
|
+
{
|
|
757
|
+
"name": "lane-height-aa",
|
|
758
|
+
"value": "32px",
|
|
759
|
+
"usage": "A timeline lane's height, and its ruler's and marker bands' tiers (resolved as --lane-height). An item on a lane is the lane's height, so it is a target at least --target-min tall."
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "lane-height-aaa",
|
|
763
|
+
"value": "44px",
|
|
764
|
+
"usage": "At AAA a lane is the 44px target size (2.5.5), so seven lanes are 308px."
|
|
765
|
+
},
|
|
756
766
|
{
|
|
757
767
|
"name": "nav-item-gap-aa",
|
|
758
768
|
"value": "2px",
|
|
@@ -868,6 +878,11 @@
|
|
|
868
878
|
"value": "28px",
|
|
869
879
|
"usage": "Compact density's menu and list rows."
|
|
870
880
|
},
|
|
881
|
+
{
|
|
882
|
+
"name": "lane-height-compact",
|
|
883
|
+
"value": "24px",
|
|
884
|
+
"usage": "Compact density's timeline lanes: the AA target floor (2.5.8), the smallest lane whose items are targets without leaning on the spacing exception. Holds 13px text at a line height of 1.5."
|
|
885
|
+
},
|
|
871
886
|
{
|
|
872
887
|
"name": "field-gap-compact",
|
|
873
888
|
"value": "12px",
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type Key, type TreeProps as RACTreeProps } from 'react-aria-components';
|
|
3
|
+
import { type SnapPoint, type TimeFormat } from '../lib/timeline-scale.js';
|
|
4
|
+
import type { StatusTone } from './badge.js';
|
|
5
|
+
export type { SnapPoint, TimeFormat } from '../lib/timeline-scale.js';
|
|
6
|
+
/** A timeline's words, for the `labels` prop. Times inside them are said in words already ("1 minute, 4 seconds"). */
|
|
7
|
+
export interface TimelineLabels {
|
|
8
|
+
/** The playhead's name. */
|
|
9
|
+
playhead: string;
|
|
10
|
+
/** A count of frames, said after the seconds of a timecode. */
|
|
11
|
+
frames: string;
|
|
12
|
+
/** A frame number, said for a `frames` timeline. */
|
|
13
|
+
frame: string;
|
|
14
|
+
/** A span's times: "{start} to {end}". */
|
|
15
|
+
span: string;
|
|
16
|
+
/** An item's name, its label and its time: "{label}, {time}". */
|
|
17
|
+
item: string;
|
|
18
|
+
/** Said when something being moved snaps to a point: "Snapped to {point}". */
|
|
19
|
+
snapped: string;
|
|
20
|
+
/** Said and shown when a marker is pressed without being dragged. */
|
|
21
|
+
picked: string;
|
|
22
|
+
/** Said and shown when a picked-up marker is put down. */
|
|
23
|
+
placed: string;
|
|
24
|
+
/** Said and shown when Escape puts a picked-up marker back. */
|
|
25
|
+
cancelled: string;
|
|
26
|
+
/** Every marker's description: the ways to move it. */
|
|
27
|
+
markerHint: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const timelineLabels: TimelineLabels;
|
|
30
|
+
/** The part of the timeline in view, for a slot to draw: times, and the scale between time and px. */
|
|
31
|
+
export interface TimelineView {
|
|
32
|
+
/** The timeline's first and last time. */
|
|
33
|
+
start: number;
|
|
34
|
+
end: number;
|
|
35
|
+
/** The first and last time in view (the slot's own band of it). */
|
|
36
|
+
visibleStart: number;
|
|
37
|
+
visibleEnd: number;
|
|
38
|
+
pxPerSecond: number;
|
|
39
|
+
/** The track's whole width in px: draw `width` wide, or only the visible part. */
|
|
40
|
+
width: number;
|
|
41
|
+
/** A time's x in the track, in px. */
|
|
42
|
+
toX: (time: number) => number;
|
|
43
|
+
}
|
|
44
|
+
type TimelineName = {
|
|
45
|
+
'aria-label': string;
|
|
46
|
+
} | {
|
|
47
|
+
'aria-labelledby': string;
|
|
48
|
+
};
|
|
49
|
+
export type TimelineProps = TimelineName & {
|
|
50
|
+
/** How long the timeline runs, in seconds. */
|
|
51
|
+
duration: number;
|
|
52
|
+
/** Its first time, in seconds: 0 for media, the first moment of a schedule (seconds since the epoch) for dates. */
|
|
53
|
+
start?: number;
|
|
54
|
+
/** How times are shown and said. Default `seconds`. */
|
|
55
|
+
format?: TimeFormat;
|
|
56
|
+
/** Frames per second, for `frames` and `timecode`. Default 25. */
|
|
57
|
+
fps?: number;
|
|
58
|
+
/** For `date`: the time zone the schedule is in. Default the reader's. */
|
|
59
|
+
timeZone?: string;
|
|
60
|
+
/** The zoom: px per second. Default 100. The ruler's labels and ticks adapt to it. */
|
|
61
|
+
pxPerSecond?: number;
|
|
62
|
+
/**
|
|
63
|
+
* What an arrow key moves the playhead and markers by, and what a pointer rounds to: one frame by default for
|
|
64
|
+
* `frames` and `timecode`, a tenth of a second for `seconds`, 15 minutes for `date`. Shift moves ten steps.
|
|
65
|
+
*/
|
|
66
|
+
step?: number;
|
|
67
|
+
/** The playhead's time. Leave both out for a timeline without one. */
|
|
68
|
+
time?: number;
|
|
69
|
+
defaultTime?: number;
|
|
70
|
+
onTimeChange?: (time: number) => void;
|
|
71
|
+
/** Points markers snap to: frames are the step, so these are beats, downbeats, cuts. Each says its own name. */
|
|
72
|
+
snapPoints?: readonly SnapPoint[];
|
|
73
|
+
/** The id of the selected span or point. */
|
|
74
|
+
selectedItem?: string | null;
|
|
75
|
+
defaultSelectedItem?: string | null;
|
|
76
|
+
onSelectedItemChange?: (id: string | null) => void;
|
|
77
|
+
/** The label column's width in px. Default 160. Lane labels that don't fit are cut short. */
|
|
78
|
+
labelWidth?: number;
|
|
79
|
+
/** The most the timeline is tall, in px or any CSS length: past it, its rows scroll under the ruler. */
|
|
80
|
+
maxHeight?: number | string;
|
|
81
|
+
/** Scroll to keep the playhead in view as its time changes. Default true. Instant under reduced motion and at AAA. */
|
|
82
|
+
followPlayhead?: boolean;
|
|
83
|
+
labels?: Partial<TimelineLabels>;
|
|
84
|
+
className?: string;
|
|
85
|
+
children?: ReactNode;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Things over time, and the work on them: a ruler whose ticks and labels adapt to the zoom, a playhead to scrub,
|
|
89
|
+
* lanes of spans and points, markers people move, and slots for a product's own drawing (a waveform, thumbnails).
|
|
90
|
+
* One scroll container: the ruler stays at the top and the label column at the start while the rest scrolls both
|
|
91
|
+
* ways, and focus scrolls clear of both. Put `TimeRuler`, `TimelineSlot`, `TimelineMarkers` and `TimelineLanes`
|
|
92
|
+
* inside, in the order they stack.
|
|
93
|
+
*
|
|
94
|
+
* The playhead's line crosses every row. Times are seconds throughout; for `date`, seconds since the epoch. The
|
|
95
|
+
* axis runs left to right; right-to-left layouts aren't supported yet. Under it, a line says what moving a marker
|
|
96
|
+
* did (snapped, picked up, put down), and is read out as it changes.
|
|
97
|
+
*/
|
|
98
|
+
export declare function Timeline({ duration, start, format, fps, timeZone, pxPerSecond: pps, step: givenStep, time: givenTime, defaultTime, onTimeChange, snapPoints, selectedItem: givenItem, defaultSelectedItem, onSelectedItemChange, labelWidth, maxHeight, followPlayhead, labels, className, children, ...name }: TimelineProps): import("react").JSX.Element;
|
|
99
|
+
export interface TimeRulerProps {
|
|
100
|
+
/** What the corner over the label column shows. Default the playhead's time, or nothing. */
|
|
101
|
+
corner?: ReactNode;
|
|
102
|
+
className?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Ticks and labels along the top, which stay as the rows scroll. They adapt to the zoom: labels as close as they
|
|
106
|
+
* fit and no closer, at steps a reader expects (1, 2, 5, 10, 15, 30 seconds; frames; hours; days), with unlabelled
|
|
107
|
+
* ticks between. It is where the playhead lives: press anywhere on it to seek, drag to scrub.
|
|
108
|
+
*
|
|
109
|
+
* The playhead is a slider named "Playhead", its value said as a time ("1 minute, 4 seconds"), not a number. ← →
|
|
110
|
+
* move it a step (a frame), Shift ten, Page Up and Page Down a tenth of the timeline, Home and End to the ends.
|
|
111
|
+
* While a marker is picked up, pressing the ruler puts the marker there instead, and the playhead stays.
|
|
112
|
+
*/
|
|
113
|
+
export declare function TimeRuler({ corner, className }: TimeRulerProps): import("react").JSX.Element;
|
|
114
|
+
export interface TimelineSlotProps {
|
|
115
|
+
/** Shown in the label column. */
|
|
116
|
+
label?: ReactNode;
|
|
117
|
+
/** The band's height in px. Default 48. */
|
|
118
|
+
height?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Names the drawing for a screen reader (`role="img"`). Without it the drawing is hidden from them: a picture
|
|
121
|
+
* of the signal, which the lanes and the playhead's time already say.
|
|
122
|
+
*/
|
|
123
|
+
'aria-label'?: string;
|
|
124
|
+
/** Draws the band, given the part in view. Draw `view.width` wide, or only `visibleStart` to `visibleEnd`. */
|
|
125
|
+
children: (view: TimelineView) => ReactNode;
|
|
126
|
+
className?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A band across the timeline for the product's own drawing: a waveform canvas, a strip of thumbnails, a grid. It
|
|
130
|
+
* scrolls with the track; the playhead's line crosses it. Not a target: pointers pass through to nothing.
|
|
131
|
+
*/
|
|
132
|
+
export declare function TimelineSlot({ label, height, 'aria-label': named, children, className, }: TimelineSlotProps): import("react").JSX.Element;
|
|
133
|
+
type LanesName = {
|
|
134
|
+
'aria-label': string;
|
|
135
|
+
} | {
|
|
136
|
+
'aria-labelledby': string;
|
|
137
|
+
};
|
|
138
|
+
export type TimelineLanesProps = Omit<RACTreeProps<object>, 'className' | 'aria-label' | 'aria-labelledby' | 'children' | 'style'> & LanesName & {
|
|
139
|
+
className?: string;
|
|
140
|
+
children?: ReactNode;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The rows: React Aria's Tree, a `treegrid` and one tab stop. ↑ ↓ move between lanes, → opens a group and ← closes
|
|
144
|
+
* it, and typing jumps to a lane by name. → on a lane moves into its items, in time order; ← → move between them
|
|
145
|
+
* and back to the lane. Pressing a lane selects it (one at a time by default). Each lane is `--lane-height` tall:
|
|
146
|
+
* 32px, 24px in compact density, 44px at AAA, so its items are targets at least `--target-min` tall.
|
|
147
|
+
*/
|
|
148
|
+
export declare function TimelineLanes({ className, children, ...props }: TimelineLanesProps): import("react").JSX.Element;
|
|
149
|
+
export interface TimelineLaneProps {
|
|
150
|
+
id: Key;
|
|
151
|
+
/** The lane's name, in the label column. Also how typing finds it and what a screen reader says. */
|
|
152
|
+
label: string;
|
|
153
|
+
/** Its spans and points, in any order: they're laid out, and reached by keyboard, in time order. */
|
|
154
|
+
items?: ReactNode;
|
|
155
|
+
/** The lanes inside this one, for a group that opens. */
|
|
156
|
+
children?: ReactNode;
|
|
157
|
+
className?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* One lane: its name in the label column, its items on the track. A lane with lanes inside it is a group, with a
|
|
161
|
+
* chevron to open it. Selected, it takes the `brand-subtle` ground and, in forced colours, a Highlight bar.
|
|
162
|
+
*/
|
|
163
|
+
export declare function TimelineLane({ id, label, items, children, className }: TimelineLaneProps): import("react").JSX.Element;
|
|
164
|
+
export type TimelineTone = StatusTone;
|
|
165
|
+
interface ItemBase {
|
|
166
|
+
id: string;
|
|
167
|
+
/** What it is: shown on a span when it fits, and always in its tooltip and its name. */
|
|
168
|
+
label: string;
|
|
169
|
+
tone?: TimelineTone;
|
|
170
|
+
/** More in its tooltip, under the label and time. */
|
|
171
|
+
details?: ReactNode;
|
|
172
|
+
className?: string;
|
|
173
|
+
}
|
|
174
|
+
export interface TimelineSpanProps extends ItemBase {
|
|
175
|
+
start: number;
|
|
176
|
+
end: number;
|
|
177
|
+
}
|
|
178
|
+
export interface TimelinePointProps extends ItemBase {
|
|
179
|
+
at: number;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Something that lasts, from `start` to `end`: a tween, a booking, a deploy. A bar in its tone; its target is the
|
|
183
|
+
* whole bar, as tall as the lane. Selecting it (pressing it, or Enter or Space on it) marks it with a ring; its
|
|
184
|
+
* label, times and `details` show on hover and focus.
|
|
185
|
+
*
|
|
186
|
+
* A bar is as wide as its time, however narrow that is: two moments close in time are close on screen. That rests
|
|
187
|
+
* on 2.5.8's Essential exception for the time axis; keyboard focus reaches every item, in time order, whatever its
|
|
188
|
+
* width. Items in a lane shouldn't overlap in time: put overlapping things in lanes of their own.
|
|
189
|
+
*/
|
|
190
|
+
export declare function TimelineSpan({ id, label, start, end, tone, details, className, }: TimelineSpanProps): import("react").JSX.Element;
|
|
191
|
+
/**
|
|
192
|
+
* Something that happens at an instant, `at`: a cue, an error, a release. A diamond in its tone. Its target is
|
|
193
|
+
* `--target-min` wide, centred on its time, or narrower where a neighbour is closer than that, so targets never
|
|
194
|
+
* overlap; the narrow case rests on 2.5.8's Essential exception, as a span's does.
|
|
195
|
+
*/
|
|
196
|
+
export declare function TimelinePoint({ id, label, at, tone, details, className, }: TimelinePointProps): import("react").JSX.Element;
|
|
197
|
+
export interface TimelineMarker {
|
|
198
|
+
id: string;
|
|
199
|
+
time: number;
|
|
200
|
+
/** A short name, shown on its flag: "Beat 3", "Chorus", "Cut". */
|
|
201
|
+
label: string;
|
|
202
|
+
}
|
|
203
|
+
export interface TimelineMarkersProps {
|
|
204
|
+
/** Shown in the label column, and names the group of markers. */
|
|
205
|
+
label: string;
|
|
206
|
+
markers: readonly TimelineMarker[];
|
|
207
|
+
/**
|
|
208
|
+
* Called as a marker moves, with where it is now (snapped, unless Alt or Option is held). Leave it out for
|
|
209
|
+
* markers that can't move: they are still focusable, and say their time.
|
|
210
|
+
*/
|
|
211
|
+
onMove?: (id: string, time: number) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Points to snap to, instead of the Timeline's `snapPoints`. A marker never snaps to a point with its own label
|
|
214
|
+
* at its own time, so a band's markers can be among its snap points.
|
|
215
|
+
*/
|
|
216
|
+
snapPoints?: readonly SnapPoint[];
|
|
217
|
+
className?: string;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Flags at times, each with a short label, on a band of their own: under the ruler for markers and cue points, or
|
|
221
|
+
* beside the lanes for beats. Flags that would overlap stack into tiers, each a `--lane-height` row.
|
|
222
|
+
*
|
|
223
|
+
* Each flag is a slider (its value said as a time) and its own tab stop. People move one by:
|
|
224
|
+
* - dragging it, snapping to the snap points within 8px and otherwise to the step (a frame); Alt or Option moves it
|
|
225
|
+
* freely. The point it snaps to is said, once each time it snaps.
|
|
226
|
+
* - the arrow keys: a step, Shift ten, caught by any snap point on the way; Alt or Option without snapping.
|
|
227
|
+
* - without dragging (2.5.7): click it to pick it up, then click the ruler or this band where it should go. Escape
|
|
228
|
+
* puts it back. What happened shows, and is said, in the line under the timeline.
|
|
229
|
+
*/
|
|
230
|
+
export declare function TimelineMarkers({ label, markers, onMove, snapPoints, className, }: TimelineMarkersProps): import("react").JSX.Element;
|
|
231
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../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