@justanarthur/modo-ui-notch 0.0.0-stage → 0.3.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 +21 -0
- package/README.md +75 -2
- package/blocks/activities/agenda/examples.mdx +74 -0
- package/blocks/activities/agenda/index.tsx +441 -0
- package/blocks/activities/clock/examples.mdx +73 -0
- package/blocks/activities/clock/index.tsx +619 -0
- package/blocks/activities/now-playing/examples.mdx +68 -0
- package/blocks/activities/now-playing/index.tsx +411 -0
- package/blocks/activities/weather/examples.mdx +115 -0
- package/blocks/activities/weather/index.tsx +634 -0
- package/blocks/app/expanded-island/examples.mdx +46 -0
- package/blocks/app/expanded-island/index.tsx +143 -0
- package/blocks/app/settings-window/examples.mdx +34 -0
- package/blocks/app/settings-window/index.tsx +375 -0
- package/blocks/system/clipboard/examples.mdx +83 -0
- package/blocks/system/clipboard/index.tsx +563 -0
- package/blocks/system/recent-files/examples.mdx +66 -0
- package/blocks/system/recent-files/index.tsx +542 -0
- package/blocks/system/system-stats/examples.mdx +52 -0
- package/blocks/system/system-stats/index.tsx +312 -0
- package/components/indicators/countdown/examples.mdx +25 -0
- package/components/indicators/countdown/index.tsx +83 -0
- package/components/indicators/equalizer/examples.mdx +20 -0
- package/components/indicators/equalizer/index.tsx +116 -0
- package/components/indicators/media-scrubber/examples.mdx +29 -0
- package/components/indicators/media-scrubber/index.tsx +122 -0
- package/components/island/island/examples.mdx +57 -0
- package/components/island/island/index.tsx +415 -0
- package/components/island/island-flash/examples.mdx +52 -0
- package/components/island/island-flash/index.tsx +79 -0
- package/components/island/island-tabs/examples.mdx +53 -0
- package/components/island/island-tabs/index.tsx +285 -0
- package/components/island/widget/examples.mdx +76 -0
- package/components/island/widget/index.tsx +431 -0
- package/dist/blocks/activities/agenda/index.d.ts +2 -0
- package/dist/blocks/activities/agenda/index.js +21 -0
- package/dist/blocks/activities/clock/index.d.ts +2 -0
- package/dist/blocks/activities/clock/index.js +25 -0
- package/dist/blocks/activities/now-playing/index.d.ts +3 -0
- package/dist/blocks/activities/now-playing/index.js +24 -0
- package/dist/blocks/activities/weather/index.d.ts +2 -0
- package/dist/blocks/activities/weather/index.js +21 -0
- package/dist/blocks/app/expanded-island/index.d.ts +3 -0
- package/dist/blocks/app/expanded-island/index.js +11 -0
- package/dist/blocks/app/settings-window/index.d.ts +2 -0
- package/dist/blocks/app/settings-window/index.js +7 -0
- package/dist/blocks/system/clipboard/index.d.ts +2 -0
- package/dist/blocks/system/clipboard/index.js +17 -0
- package/dist/blocks/system/recent-files/index.d.ts +2 -0
- package/dist/blocks/system/recent-files/index.js +19 -0
- package/dist/blocks/system/system-stats/index.d.ts +2 -0
- package/dist/blocks/system/system-stats/index.js +15 -0
- package/dist/components/indicators/countdown/index.d.ts +2 -0
- package/dist/components/indicators/countdown/index.js +8 -0
- package/dist/components/indicators/equalizer/index.d.ts +2 -0
- package/dist/components/indicators/equalizer/index.js +7 -0
- package/dist/components/indicators/media-scrubber/index.d.ts +2 -0
- package/dist/components/indicators/media-scrubber/index.js +8 -0
- package/dist/components/island/island/index.d.ts +3 -0
- package/dist/components/island/island/index.js +10 -0
- package/dist/components/island/island-flash/index.d.ts +2 -0
- package/dist/components/island/island-flash/index.js +7 -0
- package/dist/components/island/island-tabs/index.d.ts +2 -0
- package/dist/components/island/island-tabs/index.js +9 -0
- package/dist/components/island/widget/index.d.ts +2 -0
- package/dist/components/island/widget/index.js +30 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +195 -0
- package/dist/lib/artwork.d.ts +2 -0
- package/dist/lib/artwork.js +8 -0
- package/dist/lib/clock.d.ts +2 -0
- package/dist/lib/clock.js +14 -0
- package/dist/lib/geometry.d.ts +2 -0
- package/dist/lib/geometry.js +24 -0
- package/dist/lib/island-context.d.ts +3 -0
- package/dist/lib/island-context.js +8 -0
- package/dist/lib/motion.d.ts +21 -0
- package/dist/lib/motion.js +16 -0
- package/dist/shared/chunk-152gpyq3.d.ts +13 -0
- package/dist/shared/chunk-2818esrq.d.ts +140 -0
- package/dist/shared/chunk-2f7zxrbk.js +65 -0
- package/dist/shared/chunk-2m5dz8nf.d.ts +88 -0
- package/dist/shared/chunk-2s4q6mt0.js +27 -0
- package/dist/shared/chunk-3thgcfcq.d.ts +151 -0
- package/dist/shared/chunk-416tsgbc.d.ts +175 -0
- package/dist/shared/chunk-502rmtap.js +54 -0
- package/dist/shared/chunk-52gb3g6r.d.ts +12 -0
- package/dist/shared/chunk-5en5aaj1.d.ts +33 -0
- package/dist/shared/chunk-61t2dfte.js +63 -0
- package/dist/shared/chunk-7fvnrtz4.d.ts +105 -0
- package/dist/shared/chunk-81fpptwp.d.ts +75 -0
- package/dist/shared/chunk-9c7ewvkk.js +381 -0
- package/dist/shared/chunk-9m0xbg5v.js +112 -0
- package/dist/shared/chunk-9xtcv3sy.js +88 -0
- package/dist/shared/chunk-bvtyjcce.d.ts +123 -0
- package/dist/shared/chunk-cc9nwbtf.js +315 -0
- package/dist/shared/chunk-cfzmfnyh.d.ts +63 -0
- package/dist/shared/chunk-d5qm9cps.js +10 -0
- package/dist/shared/chunk-da177e8r.d.ts +114 -0
- package/dist/shared/chunk-fexwzycv.d.ts +36 -0
- package/dist/shared/chunk-gb56m10p.js +39 -0
- package/dist/shared/chunk-gejenfap.d.ts +25 -0
- package/dist/shared/chunk-hrpxbqmx.d.ts +28 -0
- package/dist/shared/chunk-j755a1a5.d.ts +41 -0
- package/dist/shared/chunk-j77cx8dp.js +498 -0
- package/dist/shared/chunk-mt0k6v8x.js +474 -0
- package/dist/shared/chunk-ndf79pv5.js +58 -0
- package/dist/shared/chunk-pfhy5e4q.d.ts +53 -0
- package/dist/shared/chunk-qdzemt2v.js +477 -0
- package/dist/shared/chunk-r471sknr.js +209 -0
- package/dist/shared/chunk-s2jeqqan.js +243 -0
- package/dist/shared/chunk-t0hcxh89.d.ts +124 -0
- package/dist/shared/chunk-w48eyvfr.d.ts +56 -0
- package/dist/shared/chunk-w5h6ay93.js +72 -0
- package/dist/shared/chunk-wkg17nxs.d.ts +101 -0
- package/dist/shared/chunk-x7f3g82r.js +285 -0
- package/dist/shared/chunk-xq5hc5gv.js +333 -0
- package/dist/shared/chunk-y0188bbn.js +331 -0
- package/dist/shared/chunk-ym0xbses.js +518 -0
- package/dist/styles.css +264 -0
- package/index.ts +22 -0
- package/lib/artwork.ts +112 -0
- package/lib/clock.ts +53 -0
- package/lib/geometry.ts +130 -0
- package/lib/island-context.tsx +24 -0
- package/lib/motion.ts +42 -0
- package/mock/activities.tsx +77 -0
- package/mock/artwork.tsx +37 -0
- package/mock/clipboard.tsx +79 -0
- package/mock/clock.tsx +77 -0
- package/mock/data.ts +139 -0
- package/mock/desktop.tsx +83 -0
- package/mock/files.tsx +70 -0
- package/mock/fit.ts +26 -0
- package/mock/island-content.tsx +142 -0
- package/mock/scene.tsx +52 -0
- package/mock/screen.tsx +76 -0
- package/mock/settings.tsx +489 -0
- package/mock/system.ts +46 -0
- package/mock/weather.tsx +105 -0
- package/package.json +122 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { JSX as JSX_1kxb } from "react";
|
|
4
|
+
type ClipboardClipKind2 = "text" | "link" | "image" | "color" | "file";
|
|
5
|
+
interface ClipboardClip2 {
|
|
6
|
+
/** What tells it apart. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** What was copied: it picks the glyph and how the clip previews. */
|
|
9
|
+
kind: ClipboardClipKind2;
|
|
10
|
+
/** The clip as text: the text, the URL, the color as copied (`#5B8DEF`), the file's or image's name. */
|
|
11
|
+
content: string;
|
|
12
|
+
/** One line more: a link's page title, an image's size, a color in another notation, a file's size. */
|
|
13
|
+
detail?: string;
|
|
14
|
+
/** A picture: an image's thumbnail or a link's favicon, as a URL or any element. */
|
|
15
|
+
preview?: string | ReactNode;
|
|
16
|
+
/** A color clip's paint, any CSS color; defaults to `content`. */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** The app it was copied from. */
|
|
19
|
+
app?: string;
|
|
20
|
+
/** When it was copied, in epoch ms. */
|
|
21
|
+
copiedAt: number;
|
|
22
|
+
}
|
|
23
|
+
interface ClipboardHistoryProps2 {
|
|
24
|
+
/** The clips, in any order: pinned ones list first, the rest newest first. */
|
|
25
|
+
clips: ClipboardClip2[];
|
|
26
|
+
/** The selected clip's id, shown as the hero (controlled). */
|
|
27
|
+
value?: string;
|
|
28
|
+
/** The selected clip at first (uncontrolled). Defaults to the first in the list. */
|
|
29
|
+
defaultValue?: string;
|
|
30
|
+
/** Called with a clip's id when it is picked, by a press or the arrow keys. */
|
|
31
|
+
onValueChange?: (id: string) => void;
|
|
32
|
+
/** The pinned clips' ids (controlled). */
|
|
33
|
+
pinned?: string[];
|
|
34
|
+
/** The pinned clips at first (uncontrolled). Defaults to `[]`. */
|
|
35
|
+
defaultPinned?: string[];
|
|
36
|
+
/** Called with the new ids when a clip is pinned or unpinned. */
|
|
37
|
+
onPinnedChange?: (pinned: string[]) => void;
|
|
38
|
+
/** The search (controlled): clips whose text, detail or app hold it stay. */
|
|
39
|
+
query?: string;
|
|
40
|
+
/** The search at first (uncontrolled). Defaults to `''`. */
|
|
41
|
+
defaultQuery?: string;
|
|
42
|
+
/** Called with the search as it is typed. */
|
|
43
|
+
onQueryChange?: (query: string) => void;
|
|
44
|
+
/** Copying is not recorded (controlled). */
|
|
45
|
+
paused?: boolean;
|
|
46
|
+
/** Copying is not recorded at first (uncontrolled). Defaults to `false`. */
|
|
47
|
+
defaultPaused?: boolean;
|
|
48
|
+
/** Called with the new state when pause or resume is pressed. */
|
|
49
|
+
onPausedChange?: (paused: boolean) => void;
|
|
50
|
+
/** The frontmost app, when it is one whose copies are never kept (a password manager): a chip says so. */
|
|
51
|
+
ignoredApp?: string;
|
|
52
|
+
/** Called by Copy, a row's double-click or Enter, with the clip to put back on the clipboard. */
|
|
53
|
+
onCopy?: (clip: ClipboardClip2) => void;
|
|
54
|
+
/** Called by Delete with the clip to drop from the history. */
|
|
55
|
+
onDelete?: (clip: ClipboardClip2) => void;
|
|
56
|
+
/** The moment the times are read at, in epoch ms. Defaults to now, re-read on each minute. */
|
|
57
|
+
now?: number;
|
|
58
|
+
/** Step on the size ladder. Omitted, it follows the surrounding SizeProvider. */
|
|
59
|
+
size?: SizeVariant;
|
|
60
|
+
/** Classes for the root, which fills its container. */
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
64
|
+
/** The compact island's left wing: the clipboard glyph. */
|
|
65
|
+
declare function ClipboardHistoryLeading2(): Element_12xgc;
|
|
66
|
+
/** The compact island's right wing: how many clips came in since the island was last open. */
|
|
67
|
+
declare function ClipboardHistoryTrailing2({ count }: {
|
|
68
|
+
count: number;
|
|
69
|
+
}): Element_12xgc;
|
|
70
|
+
interface CopiedProps {
|
|
71
|
+
/** The clip that was copied. */
|
|
72
|
+
clip: ClipboardClip2;
|
|
73
|
+
/** Called by Pin; without it the button hides. */
|
|
74
|
+
onPin?: (clip: ClipboardClip2) => void;
|
|
75
|
+
}
|
|
76
|
+
/** The island's flash when something is copied: the clip's picture or glyph, `Copied`, its preview and Pin. */
|
|
77
|
+
declare function ClipboardHistoryCopied2({ clip, onPin }: CopiedProps): Element_12xgc;
|
|
78
|
+
/**
|
|
79
|
+
* A notch app's clipboard history: the latest clip as the hero, the ones
|
|
80
|
+
* before it beside it, pinned ones on top.
|
|
81
|
+
*
|
|
82
|
+
* The hero is the selected clip, the newest until another is picked, shown
|
|
83
|
+
* as what it is: text over two lines, a link as its domain with the page's
|
|
84
|
+
* title, an image as its thumbnail, a color as a swatch with its value, a
|
|
85
|
+
* file as a tile with its name and size. The context line says where it was
|
|
86
|
+
* copied and how long ago; under the hero, its length or a link's path,
|
|
87
|
+
* Pin, Delete and Copy.
|
|
88
|
+
*
|
|
89
|
+
* Beside it, past a hairline, a search over the history and the clips
|
|
90
|
+
* themselves: pinned ones first, then the rest newest first, each a row of
|
|
91
|
+
* its swatch, thumbnail or glyph, its text and how long ago. Three show at
|
|
92
|
+
* a time, around the selected one, with a count of the rest. The arrow keys
|
|
93
|
+
* move the selection from anywhere in the widget (the search included),
|
|
94
|
+
* Enter copies it, and a double-click copies a row. The selection, the pins
|
|
95
|
+
* and the search each work both ways (`value`, `pinned`, `query`, with
|
|
96
|
+
* their `default…` and `on…Change`).
|
|
97
|
+
*
|
|
98
|
+
* Recording pauses from the context line (`paused`), and an app whose
|
|
99
|
+
* copies are never kept, such as a password manager, shows as a chip
|
|
100
|
+
* (`ignoredApp`). With no clips it says what will show up here, or that
|
|
101
|
+
* the history is paused.
|
|
102
|
+
*
|
|
103
|
+
* `ClipboardHistory.Leading` and `ClipboardHistory.Trailing` show the
|
|
104
|
+
* glyph and the count of new clips in the compact island's wings, and
|
|
105
|
+
* `ClipboardHistory.Copied` is the flash when something is copied.
|
|
106
|
+
*
|
|
107
|
+
* @example {@include ./examples.mdx}
|
|
108
|
+
*/
|
|
109
|
+
declare const ClipboardHistory2: (({ clips, value: valueProp, defaultValue, onValueChange, pinned: pinnedProp, defaultPinned, onPinnedChange, query: queryProp, defaultQuery, onQueryChange, paused: pausedProp, defaultPaused, onPausedChange, ignoredApp, onCopy, onDelete, now: nowProp, size, className }: ClipboardHistoryProps2) => Element_12xgc) & {
|
|
110
|
+
Leading: typeof ClipboardHistoryLeading2;
|
|
111
|
+
Trailing: typeof ClipboardHistoryTrailing2;
|
|
112
|
+
Copied: typeof ClipboardHistoryCopied2;
|
|
113
|
+
};
|
|
114
|
+
export { ClipboardClipKind2, ClipboardClip2, ClipboardHistoryProps2, ClipboardHistoryLeading2, ClipboardHistoryTrailing2, ClipboardHistoryCopied2, ClipboardHistory2 };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
type IslandFlashTone2 = "default" | "success" | "warning" | "error" | "info";
|
|
4
|
+
interface IslandFlashProps2 {
|
|
5
|
+
/** What happened, in a few words. */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/** One line more: how long, what to do. */
|
|
8
|
+
caption?: ReactNode;
|
|
9
|
+
/** The glyph at the start: an icon, an artwork tile. It takes the tone's hue. */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** The hue of the icon and the `value`. Defaults to `'default'`. */
|
|
12
|
+
tone?: IslandFlashTone2;
|
|
13
|
+
/** A figure at the end, in the tone's hue: `15 min`, a level. */
|
|
14
|
+
value?: ReactNode;
|
|
15
|
+
/** Content after it, such as an Equalizer. */
|
|
16
|
+
trailing?: ReactNode;
|
|
17
|
+
/** One control at the far end, such as a ghost Button. */
|
|
18
|
+
action?: ReactNode;
|
|
19
|
+
/** Classes for the row. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
23
|
+
/**
|
|
24
|
+
* A moment's alert in the island: an icon, what happened, a line more, and
|
|
25
|
+
* the figure or control it's about.
|
|
26
|
+
*
|
|
27
|
+
* It lays out one row the height of the island's flash: the icon in a fixed
|
|
28
|
+
* square, the title and caption truncating beside it, then the `value`, any
|
|
29
|
+
* `trailing` glyph and an `action`. The icon and the value take the tone's
|
|
30
|
+
* status hue (a focus round done in success, rain coming in warning); everything else
|
|
31
|
+
* keeps the two text colors. Pass it as the Island's `flash`.
|
|
32
|
+
*
|
|
33
|
+
* @example {@include ./examples.mdx}
|
|
34
|
+
*/
|
|
35
|
+
declare function IslandFlash2({ title, caption, icon, tone, value, trailing, action, className }: IslandFlashProps2): Element_12xgc;
|
|
36
|
+
export { IslandFlashTone2, IslandFlashProps2, IslandFlash2 };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// lib/clock.ts
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
var SECOND2 = 1000;
|
|
6
|
+
var MINUTE2 = 60 * SECOND2;
|
|
7
|
+
function formatClock2(seconds) {
|
|
8
|
+
const s = Math.max(0, Math.floor(seconds));
|
|
9
|
+
const ss = String(s % 60).padStart(2, "0");
|
|
10
|
+
if (s < 3600)
|
|
11
|
+
return `${Math.floor(s / 60)}:${ss}`;
|
|
12
|
+
return `${Math.floor(s / 3600)}:${String(Math.floor(s / 60) % 60).padStart(2, "0")}:${ss}`;
|
|
13
|
+
}
|
|
14
|
+
function formatShort2(seconds) {
|
|
15
|
+
const s = Math.max(0, Math.ceil(seconds));
|
|
16
|
+
if (s < 60)
|
|
17
|
+
return `${s}s`;
|
|
18
|
+
if (s < 3600)
|
|
19
|
+
return `${Math.ceil(s / 60)}m`;
|
|
20
|
+
return `${Math.ceil(s / 3600)}h`;
|
|
21
|
+
}
|
|
22
|
+
function useEdgeClock2(anchor, running, unit = SECOND2) {
|
|
23
|
+
const [now, setNow] = useState(Date.now);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!running)
|
|
26
|
+
return;
|
|
27
|
+
let timer;
|
|
28
|
+
const tick = () => {
|
|
29
|
+
const t = Date.now();
|
|
30
|
+
setNow(t);
|
|
31
|
+
const offset = ((anchor - t) % unit + unit) % unit;
|
|
32
|
+
timer = setTimeout(tick, offset || unit);
|
|
33
|
+
};
|
|
34
|
+
tick();
|
|
35
|
+
return () => clearTimeout(timer);
|
|
36
|
+
}, [anchor, running, unit]);
|
|
37
|
+
return running ? now : Date.now();
|
|
38
|
+
}
|
|
39
|
+
export { SECOND2, MINUTE2, formatClock2, formatShort2, useEdgeClock2 };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/** A track's picture: an image URL or any element; `null` when the track has none, `undefined` while it isn't known yet. */
|
|
3
|
+
type Artwork2 = string | ReactNode;
|
|
4
|
+
/** What the artwork tile shows: a picture, or the placeholder (`art: null`), under an `id` that changes only when the picture does. */
|
|
5
|
+
interface ShownArtwork2 {
|
|
6
|
+
id: string;
|
|
7
|
+
art: Artwork2 | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The artwork to show for the track `trackKey` names, held across updates.
|
|
11
|
+
*
|
|
12
|
+
* A URL is decoded before it replaces what's shown, so the swap is never to
|
|
13
|
+
* a blank. An update without artwork (`undefined`, or `null` for the same
|
|
14
|
+
* track) keeps the last good picture. A new track with `null`, or a URL that
|
|
15
|
+
* fails to load for a new track, shows the placeholder.
|
|
16
|
+
*/
|
|
17
|
+
declare function useStableArtwork2(artwork: Artwork2 | null | undefined, trackKey: string): ShownArtwork2;
|
|
18
|
+
/**
|
|
19
|
+
* The color an image URL leans to, as `rgb(…)`: its pixels averaged, the
|
|
20
|
+
* vivid ones weighted up, so a mostly grey cover still lends its accent.
|
|
21
|
+
* Read once per URL; `undefined` until then, or when the image can't be
|
|
22
|
+
* read (a cross-origin image without CORS).
|
|
23
|
+
*/
|
|
24
|
+
declare function useArtworkTint2(src?: string): string | undefined;
|
|
25
|
+
export { Artwork2, ShownArtwork2, useStableArtwork2, useArtworkTint2 };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
interface EqualizerProps2 {
|
|
3
|
+
/** Music is playing: the bars move. Paused, they settle low. Defaults to `true`. */
|
|
4
|
+
playing?: boolean;
|
|
5
|
+
/** How many bars, from 1 to 5. Defaults to `4`. */
|
|
6
|
+
bars?: number;
|
|
7
|
+
/** What screen readers hear. Without one the bars are hidden from them. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Classes for the bars' fill. Defaults to `'bg-foreground'`. */
|
|
10
|
+
barClassName?: string;
|
|
11
|
+
/** Classes for the row, such as its height. Defaults to `'h-3.5'`. */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
15
|
+
/**
|
|
16
|
+
* Level bars for what's playing: they dance while music plays and settle low
|
|
17
|
+
* when it pauses.
|
|
18
|
+
*
|
|
19
|
+
* Each bar loops its own levels at its own pace on the Web Animations API, a
|
|
20
|
+
* `transform` loop the compositor runs, so playing music costs no JavaScript
|
|
21
|
+
* per frame. Pausing springs the bars down to rest; under reduced motion they
|
|
22
|
+
* hold still at a level instead of dancing. They take the text color, or any
|
|
23
|
+
* fill through `barClassName` (an artwork's tint).
|
|
24
|
+
*
|
|
25
|
+
* @example {@include ./examples.mdx}
|
|
26
|
+
*/
|
|
27
|
+
declare function Equalizer2({ playing, bars, label, barClassName, className }: EqualizerProps2): Element_12xgc;
|
|
28
|
+
export { EqualizerProps2, Equalizer2 };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
interface MediaScrubberProps2 {
|
|
4
|
+
/** Where playback is, in seconds. */
|
|
5
|
+
position: number;
|
|
6
|
+
/** The track's length, in seconds. */
|
|
7
|
+
duration: number;
|
|
8
|
+
/** It plays: the position runs on from `position`, a second at a time. Defaults to `false`. */
|
|
9
|
+
playing?: boolean;
|
|
10
|
+
/** Called with the position to seek to, once, when a drag or a key press ends. */
|
|
11
|
+
onSeek?: (seconds: number) => void;
|
|
12
|
+
/** Step on the size ladder. Defaults to `'compact'`. */
|
|
13
|
+
size?: SizeVariant;
|
|
14
|
+
/** The slider's accessible name. Defaults to `'Position'`. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** No seeking. Defaults to `false`. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** At rest a thin line of progress; the scrubber fades in on hover and focus, and always shows on touch. Defaults to `false`. */
|
|
19
|
+
quiet?: boolean;
|
|
20
|
+
/** Classes for the row. */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
24
|
+
/**
|
|
25
|
+
* Where a track is: elapsed time, a scrubber, and the time remaining.
|
|
26
|
+
*
|
|
27
|
+
* The scrubber is modo-ui's Slider at the compact step. While playing, the
|
|
28
|
+
* position runs on by itself a second at a time, on the second's edge, from
|
|
29
|
+
* the last `position` it got. Dragging shows the dragged value, and the
|
|
30
|
+
* remaining time follows it; `onSeek` fires once, when the drag or the key
|
|
31
|
+
* press ends, and playback runs on from the seek until the player reports
|
|
32
|
+
* its next `position`, so the thumb never jumps back to the stale one.
|
|
33
|
+
*
|
|
34
|
+
* `quiet` is the player's form: at rest a thin line of progress, so the
|
|
35
|
+
* track reads before the control; the scrubber fades in on hover or focus,
|
|
36
|
+
* and always shows on touch.
|
|
37
|
+
*
|
|
38
|
+
* @example {@include ./examples.mdx}
|
|
39
|
+
*/
|
|
40
|
+
declare function MediaScrubber2({ position, duration, playing, onSeek, size, label, disabled, quiet, className }: MediaScrubberProps2): Element_12xgc;
|
|
41
|
+
export { MediaScrubberProps2, MediaScrubber2 };
|