@justanarthur/modo-ui-notch 0.2.0 → 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/README.md +11 -11
- package/blocks/activities/agenda/examples.mdx +21 -5
- package/blocks/activities/agenda/index.tsx +291 -182
- package/blocks/activities/clock/examples.mdx +73 -0
- package/blocks/activities/clock/index.tsx +619 -0
- package/blocks/activities/now-playing/examples.mdx +32 -13
- package/blocks/activities/now-playing/index.tsx +319 -126
- package/blocks/activities/weather/examples.mdx +115 -0
- package/blocks/activities/weather/index.tsx +634 -0
- package/blocks/app/expanded-island/examples.mdx +8 -7
- package/blocks/app/expanded-island/index.tsx +19 -3
- package/blocks/app/settings-window/examples.mdx +6 -2
- package/blocks/app/settings-window/index.tsx +25 -7
- 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 +38 -9
- package/blocks/system/system-stats/index.tsx +241 -107
- package/components/indicators/media-scrubber/examples.mdx +8 -0
- package/components/indicators/media-scrubber/index.tsx +37 -13
- package/components/island/island/examples.mdx +4 -4
- package/components/island/island/index.tsx +2 -2
- package/components/island/island-flash/examples.mdx +15 -18
- package/components/island/island-flash/index.tsx +4 -4
- package/components/island/island-tabs/examples.mdx +5 -5
- package/components/island/widget/examples.mdx +76 -0
- package/components/island/widget/index.tsx +431 -0
- package/dist/blocks/activities/agenda/index.d.ts +1 -1
- package/dist/blocks/activities/agenda/index.js +3 -3
- 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 -2
- package/dist/blocks/activities/now-playing/index.js +5 -3
- 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 +1 -1
- package/dist/blocks/app/expanded-island/index.js +4 -3
- package/dist/blocks/app/settings-window/index.d.ts +1 -1
- package/dist/blocks/app/settings-window/index.js +1 -1
- 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 -2
- package/dist/blocks/system/system-stats/index.js +4 -1
- package/dist/components/indicators/media-scrubber/index.d.ts +1 -1
- package/dist/components/indicators/media-scrubber/index.js +1 -1
- package/dist/components/island/island/index.d.ts +1 -1
- package/dist/components/island/island/index.js +2 -2
- package/dist/components/island/island-flash/index.d.ts +1 -1
- package/dist/components/island/island-flash/index.js +1 -1
- package/dist/components/island/island-tabs/index.js +2 -2
- package/dist/components/island/widget/index.d.ts +2 -0
- package/dist/components/island/widget/index.js +30 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +102 -58
- package/dist/lib/artwork.d.ts +2 -0
- package/dist/lib/artwork.js +8 -0
- package/dist/lib/geometry.js +1 -1
- package/dist/shared/chunk-2818esrq.d.ts +140 -0
- package/dist/shared/{chunk-yngkkxz2.d.ts → chunk-2m5dz8nf.d.ts} +4 -4
- package/dist/shared/chunk-3thgcfcq.d.ts +151 -0
- package/dist/shared/chunk-416tsgbc.d.ts +175 -0
- package/dist/shared/{chunk-zvh0d3qb.js → chunk-61t2dfte.js} +1 -1
- package/dist/shared/chunk-7fvnrtz4.d.ts +105 -0
- package/dist/shared/{chunk-hpsabfsd.d.ts → chunk-81fpptwp.d.ts} +1 -1
- package/dist/shared/chunk-9c7ewvkk.js +381 -0
- package/dist/shared/{chunk-mp1nx0ez.js → chunk-9m0xbg5v.js} +14 -3
- package/dist/shared/{chunk-wwjxs75m.js → chunk-9xtcv3sy.js} +26 -12
- package/dist/shared/chunk-bvtyjcce.d.ts +123 -0
- package/dist/shared/{chunk-s33y1pcq.js → chunk-cc9nwbtf.js} +20 -10
- package/dist/shared/chunk-da177e8r.d.ts +114 -0
- package/dist/shared/{chunk-6c1jbefs.d.ts → chunk-fexwzycv.d.ts} +3 -3
- package/dist/shared/chunk-gejenfap.d.ts +25 -0
- package/dist/shared/{chunk-rr5e0g15.d.ts → chunk-j755a1a5.d.ts} +7 -1
- package/dist/shared/chunk-j77cx8dp.js +498 -0
- package/dist/shared/chunk-mt0k6v8x.js +474 -0
- package/dist/shared/{chunk-78w7qwp0.js → chunk-ndf79pv5.js} +1 -1
- package/dist/shared/{chunk-9nhpg9t8.d.ts → chunk-pfhy5e4q.d.ts} +7 -1
- package/dist/shared/chunk-qdzemt2v.js +477 -0
- package/dist/shared/{chunk-rpfwv3pz.js → chunk-r471sknr.js} +1 -1
- package/dist/shared/chunk-s2jeqqan.js +243 -0
- package/dist/shared/chunk-t0hcxh89.d.ts +124 -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-sbnrhy5m.js → chunk-y0188bbn.js} +2 -2
- package/dist/shared/chunk-ym0xbses.js +518 -0
- package/dist/styles.css +97 -55
- package/index.ts +7 -6
- package/lib/artwork.ts +112 -0
- package/lib/geometry.ts +1 -1
- package/mock/activities.tsx +9 -32
- package/mock/artwork.tsx +13 -1
- package/mock/clipboard.tsx +79 -0
- package/mock/clock.tsx +77 -0
- package/mock/data.ts +30 -44
- package/mock/files.tsx +70 -0
- package/mock/island-content.tsx +43 -118
- package/mock/screen.tsx +76 -0
- package/mock/settings.tsx +370 -91
- package/mock/system.ts +46 -0
- package/mock/weather.tsx +105 -0
- package/package.json +7 -2
- package/blocks/activities/shelf/examples.mdx +0 -33
- package/blocks/activities/shelf/index.tsx +0 -289
- package/blocks/activities/timer/examples.mdx +0 -52
- package/blocks/activities/timer/index.tsx +0 -292
- package/blocks/system/controls/examples.mdx +0 -34
- package/blocks/system/controls/index.tsx +0 -167
- package/blocks/system/devices/examples.mdx +0 -25
- package/blocks/system/devices/index.tsx +0 -172
- package/blocks/system/power-alert/examples.mdx +0 -32
- package/blocks/system/power-alert/index.tsx +0 -89
- package/components/indicators/battery-glyph/examples.mdx +0 -22
- package/components/indicators/battery-glyph/index.tsx +0 -91
- package/dist/blocks/activities/shelf/index.d.ts +0 -2
- package/dist/blocks/activities/shelf/index.js +0 -14
- package/dist/blocks/activities/timer/index.d.ts +0 -2
- package/dist/blocks/activities/timer/index.js +0 -19
- package/dist/blocks/system/controls/index.d.ts +0 -2
- package/dist/blocks/system/controls/index.js +0 -10
- package/dist/blocks/system/devices/index.d.ts +0 -2
- package/dist/blocks/system/devices/index.js +0 -12
- package/dist/blocks/system/power-alert/index.d.ts +0 -2
- package/dist/blocks/system/power-alert/index.js +0 -9
- package/dist/components/indicators/battery-glyph/index.d.ts +0 -2
- package/dist/components/indicators/battery-glyph/index.js +0 -9
- package/dist/shared/chunk-2qpcsv5h.d.ts +0 -45
- package/dist/shared/chunk-45gytfr1.d.ts +0 -84
- package/dist/shared/chunk-50ffk4r7.d.ts +0 -69
- package/dist/shared/chunk-5w0yck07.d.ts +0 -32
- package/dist/shared/chunk-7hr53mby.js +0 -116
- package/dist/shared/chunk-b8jb1w72.js +0 -145
- package/dist/shared/chunk-cpewy6yg.js +0 -178
- package/dist/shared/chunk-e3e4s4ds.d.ts +0 -77
- package/dist/shared/chunk-enm6td0p.js +0 -280
- package/dist/shared/chunk-fvedaas2.d.ts +0 -33
- package/dist/shared/chunk-gex38j8x.d.ts +0 -82
- package/dist/shared/chunk-hwtxpzg0.js +0 -69
- package/dist/shared/chunk-phb53x1f.js +0 -252
- package/dist/shared/chunk-r8esmjfs.d.ts +0 -42
- package/dist/shared/chunk-rcp1g9ca.js +0 -70
- package/dist/shared/chunk-rx9sphz2.js +0 -266
- package/dist/shared/chunk-xdeek16r.d.ts +0 -58
- package/dist/shared/chunk-xkzjk1tq.js +0 -206
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Artwork2 } from "./chunk-gejenfap.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { JSX as JSX_1kxb } from "react";
|
|
4
|
+
type NowPlayingOutput2 = "built-in" | "headphones" | "speaker" | "airplay";
|
|
5
|
+
type NowPlayingRepeat2 = "off" | "all" | "one";
|
|
6
|
+
interface NowPlayingTrack2 {
|
|
7
|
+
/** What tells two tracks apart; defaults to the title, artist and album. */
|
|
8
|
+
id?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
artist?: string;
|
|
11
|
+
album?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The artwork: an image URL, or any element. `null` when the track has
|
|
14
|
+
* none (the placeholder shows); left out while it isn't known yet, which
|
|
15
|
+
* keeps the last picture up.
|
|
16
|
+
*/
|
|
17
|
+
artwork?: Artwork2 | null;
|
|
18
|
+
/** The color the artwork leans to, any CSS color: it tints the glow, the bars and the toggles. Read from an image URL when left out. */
|
|
19
|
+
tint?: string;
|
|
20
|
+
/** The app it plays in. */
|
|
21
|
+
source?: string;
|
|
22
|
+
/** Where it plays: a device's name. */
|
|
23
|
+
output?: string;
|
|
24
|
+
/** What kind of device `output` is, for its glyph. Defaults to `'built-in'`. */
|
|
25
|
+
outputKind?: NowPlayingOutput2;
|
|
26
|
+
/** The track's length, in seconds; `0` for a stream, which hides the scrubber. */
|
|
27
|
+
duration: number;
|
|
28
|
+
/** Where playback is, in seconds. */
|
|
29
|
+
position: number;
|
|
30
|
+
}
|
|
31
|
+
interface NowPlayingProps2 {
|
|
32
|
+
/** What plays; without one the player says nothing is playing. */
|
|
33
|
+
track?: NowPlayingTrack2 | null;
|
|
34
|
+
/** It plays (controlled). */
|
|
35
|
+
playing?: boolean;
|
|
36
|
+
/** It plays at first (uncontrolled). Defaults to `true`. */
|
|
37
|
+
defaultPlaying?: boolean;
|
|
38
|
+
/** Called with the new state when play / pause is pressed. */
|
|
39
|
+
onPlayingChange?: (playing: boolean) => void;
|
|
40
|
+
/** Called when the previous button is pressed. */
|
|
41
|
+
onPrevious?: () => void;
|
|
42
|
+
/** Called when the next button is pressed. */
|
|
43
|
+
onNext?: () => void;
|
|
44
|
+
/** Called with the position to seek to, once, when a drag on the scrubber ends. */
|
|
45
|
+
onSeek?: (seconds: number) => void;
|
|
46
|
+
/** Shuffle is on (controlled). The toggle shows when this, `defaultShuffle` or `onShuffleChange` is given. */
|
|
47
|
+
shuffle?: boolean;
|
|
48
|
+
/** Shuffle is on at first (uncontrolled). */
|
|
49
|
+
defaultShuffle?: boolean;
|
|
50
|
+
/** Called with the new state when shuffle is pressed. */
|
|
51
|
+
onShuffleChange?: (shuffle: boolean) => void;
|
|
52
|
+
/** The repeat mode (controlled): a press steps off → all → one. Shows like `shuffle`. */
|
|
53
|
+
repeat?: NowPlayingRepeat2;
|
|
54
|
+
/** The repeat mode at first (uncontrolled). */
|
|
55
|
+
defaultRepeat?: NowPlayingRepeat2;
|
|
56
|
+
/** Called with the next mode when repeat is pressed. */
|
|
57
|
+
onRepeatChange?: (repeat: NowPlayingRepeat2) => void;
|
|
58
|
+
/** The track is in the library (controlled). Shows like `shuffle`. */
|
|
59
|
+
liked?: boolean;
|
|
60
|
+
/** The track is in the library at first (uncontrolled). */
|
|
61
|
+
defaultLiked?: boolean;
|
|
62
|
+
/** Called with the new state when the heart is pressed. */
|
|
63
|
+
onLikedChange?: (liked: boolean) => void;
|
|
64
|
+
/** The empty state's line. Defaults to `'Play something in Music, Spotify or a browser and it shows up here.'`. */
|
|
65
|
+
emptyDescription?: ReactNode;
|
|
66
|
+
/** The empty state's way forward, such as a Button that opens a player. */
|
|
67
|
+
emptyActions?: ReactNode;
|
|
68
|
+
/** Classes for the root, which fills its container. */
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
71
|
+
type TrackIdentity = Pick<NowPlayingTrack2, "id" | "title" | "artist" | "album" | "artwork" | "tint">;
|
|
72
|
+
interface ArtworkProps {
|
|
73
|
+
/** The track whose artwork it shows; without one, the placeholder. */
|
|
74
|
+
track?: TrackIdentity | null;
|
|
75
|
+
/** The placeholder note's size in px. Defaults to `14`. */
|
|
76
|
+
glyph?: number;
|
|
77
|
+
/** Classes for the tile: its size and radius. */
|
|
78
|
+
className?: string;
|
|
79
|
+
}
|
|
80
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
81
|
+
/**
|
|
82
|
+
* A track's artwork in a tile that never blinks: the last good picture stays
|
|
83
|
+
* while the next one loads or an update comes without one, the next
|
|
84
|
+
* crossfades in over it, and only a track without artwork shows the note.
|
|
85
|
+
*/
|
|
86
|
+
declare function NowPlayingArtwork2({ track, glyph, className }: ArtworkProps): Element_12xgc;
|
|
87
|
+
interface PartProps {
|
|
88
|
+
/** What plays. */
|
|
89
|
+
track?: TrackIdentity | null;
|
|
90
|
+
/** It plays: the bars dance. Defaults to `true`. */
|
|
91
|
+
playing?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/** The compact island's left wing: the artwork, small. */
|
|
94
|
+
declare function NowPlayingLeading2({ track }: Pick<PartProps, "track">): Element_12xgc;
|
|
95
|
+
/** The compact island's right wing: the level bars in the artwork's tint, low while paused. */
|
|
96
|
+
declare function NowPlayingTrailing2(props: PartProps): Element_12xgc;
|
|
97
|
+
/** The split island's bubble: the artwork as a disc. */
|
|
98
|
+
declare function NowPlayingMinimal2({ track }: Pick<PartProps, "track">): Element_12xgc;
|
|
99
|
+
/** The island's flash when the track changes: its artwork, title and artist, and the tinted bars. */
|
|
100
|
+
declare function NowPlayingFlash2({ track, playing }: {
|
|
101
|
+
track: NowPlayingTrack2;
|
|
102
|
+
playing?: boolean;
|
|
103
|
+
}): Element_12xgc;
|
|
104
|
+
/**
|
|
105
|
+
* What's playing, as a notch app's open island shows it: the artwork, the
|
|
106
|
+
* title and artist, where the track is, the transport, and where it plays.
|
|
107
|
+
*
|
|
108
|
+
* The artwork is the hero's picture, as tall as the widget, with a soft glow
|
|
109
|
+
* of its tint behind it (`track.tint`, else read from an image URL); the
|
|
110
|
+
* equalizer and any toggle that is on take the same tint, so the color
|
|
111
|
+
* comes from the music. The artwork never blinks: the last good picture
|
|
112
|
+
* stays up while a new one loads or an update arrives without one, the next
|
|
113
|
+
* crossfades in over it, and only a track whose `artwork` is `null` shows
|
|
114
|
+
* the placeholder note.
|
|
115
|
+
*
|
|
116
|
+
* Under the title and artist (with the album) runs the kit's MediaScrubber,
|
|
117
|
+
* which ticks on by itself while playing and seeks once when a drag ends
|
|
118
|
+
* (`onSeek`). The transport sits in the middle of the last row, the source
|
|
119
|
+
* app and the output device on its left, and shuffle, repeat and the heart
|
|
120
|
+
* on its right, each shown when its value or handler is given. Play / pause
|
|
121
|
+
* runs through `playing` / `onPlayingChange`, or is kept here from
|
|
122
|
+
* `defaultPlaying`; the toggles are the same. Without a track it says
|
|
123
|
+
* nothing is playing and how to change that.
|
|
124
|
+
*
|
|
125
|
+
* The other forms are parts: `NowPlaying.Leading` and `NowPlaying.Trailing`
|
|
126
|
+
* for the compact island's wings (the artwork, and the tinted Equalizer that
|
|
127
|
+
* settles when paused), `NowPlaying.Minimal` for the split island's bubble
|
|
128
|
+
* (the artwork as a disc), `NowPlaying.Flash` for the flash on a track
|
|
129
|
+
* change and `NowPlaying.Artwork` for the tile on its own.
|
|
130
|
+
*
|
|
131
|
+
* @example {@include ./examples.mdx}
|
|
132
|
+
*/
|
|
133
|
+
declare const NowPlaying2: (({ track, playing: playingProp, defaultPlaying, onPlayingChange, onPrevious, onNext, onSeek, shuffle: shuffleProp, defaultShuffle, onShuffleChange, repeat: repeatProp, defaultRepeat, onRepeatChange, liked: likedProp, defaultLiked, onLikedChange, emptyDescription, emptyActions, className }: NowPlayingProps2) => Element_12xgc) & {
|
|
134
|
+
Artwork2: typeof NowPlayingArtwork2;
|
|
135
|
+
Leading: typeof NowPlayingLeading2;
|
|
136
|
+
Trailing: typeof NowPlayingTrailing2;
|
|
137
|
+
Minimal: typeof NowPlayingMinimal2;
|
|
138
|
+
Flash: typeof NowPlayingFlash2;
|
|
139
|
+
};
|
|
140
|
+
export { NowPlayingOutput2, NowPlayingRepeat2, NowPlayingTrack2, NowPlayingProps2, NowPlayingArtwork2, NowPlayingLeading2, NowPlayingTrailing2, NowPlayingMinimal2, NowPlayingFlash2, NowPlaying2 };
|
|
@@ -71,10 +71,10 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
71
71
|
* it never folds into a drawer) lists the pages under the app's `name`, then
|
|
72
72
|
* the plugins that bring settings. General holds the launch at login Switch
|
|
73
73
|
* and a ChoiceList of the screens the island shows on. Plugins lists each
|
|
74
|
-
* installed plugin with its glyph, its line
|
|
75
|
-
* off
|
|
76
|
-
*
|
|
77
|
-
* being read. About lists the `about` rows. A plugin's page shows its
|
|
74
|
+
* installed plugin with its glyph, its line, a Switch that turns it on or
|
|
75
|
+
* off and, for one that brings settings, a chevron to its page. Permissions
|
|
76
|
+
* shows what macOS granted as a StatusDot per row, with Open Settings beside
|
|
77
|
+
* one that isn't granted, and a spinner while it's being read. About lists the `about` rows. A plugin's page shows its
|
|
78
78
|
* `settings` node under its name.
|
|
79
79
|
*
|
|
80
80
|
* The page, the preferences and the plugins' states each run both ways
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { JSX as JSX_1kxb } from "react";
|
|
2
|
+
type WeatherCondition2 = "clear" | "partly-cloudy" | "cloudy" | "fog" | "drizzle" | "rain" | "heavy-rain" | "sleet" | "snow" | "thunderstorm";
|
|
3
|
+
type WeatherUnit2 = "celsius" | "fahrenheit";
|
|
4
|
+
type WeatherAccess2 = "granted" | "undetermined" | "denied";
|
|
5
|
+
type WeatherStatus2 = "ready" | "loading" | "error" | "offline";
|
|
6
|
+
/** The weather now: Open-Meteo's `current` block. Temperatures in °C, wind in km/h. */
|
|
7
|
+
interface WeatherNow2 {
|
|
8
|
+
/** When it was read, in epoch ms: the "updated" line counts from it. */
|
|
9
|
+
time: number;
|
|
10
|
+
temperature: number;
|
|
11
|
+
/** How warm it feels, in °C: `apparent_temperature`. */
|
|
12
|
+
apparent?: number;
|
|
13
|
+
condition: WeatherCondition2;
|
|
14
|
+
/** Daylight, for the sun or the moon in the glyph: `is_day`. Defaults to `true`. */
|
|
15
|
+
isDay?: boolean;
|
|
16
|
+
/** Wind speed in km/h. */
|
|
17
|
+
wind?: number;
|
|
18
|
+
/** Relative humidity, 0–100. */
|
|
19
|
+
humidity?: number;
|
|
20
|
+
/** The UV index. */
|
|
21
|
+
uv?: number;
|
|
22
|
+
}
|
|
23
|
+
/** One hour of the forecast: Open-Meteo's `hourly` arrays, zipped. */
|
|
24
|
+
interface WeatherHour2 {
|
|
25
|
+
/** The hour's start, in epoch ms. */
|
|
26
|
+
time: number;
|
|
27
|
+
temperature: number;
|
|
28
|
+
condition: WeatherCondition2;
|
|
29
|
+
/** Defaults to `true`. */
|
|
30
|
+
isDay?: boolean;
|
|
31
|
+
/** The chance of rain or snow, 0–100: `precipitation_probability`. */
|
|
32
|
+
precipitation?: number;
|
|
33
|
+
}
|
|
34
|
+
/** One day of the forecast: Open-Meteo's `daily` arrays, zipped. */
|
|
35
|
+
interface WeatherDay2 {
|
|
36
|
+
/** The day's start, in epoch ms. */
|
|
37
|
+
date: number;
|
|
38
|
+
condition: WeatherCondition2;
|
|
39
|
+
high: number;
|
|
40
|
+
low: number;
|
|
41
|
+
/** The day's highest chance of rain or snow, 0–100: `precipitation_probability_max`. */
|
|
42
|
+
precipitation?: number;
|
|
43
|
+
}
|
|
44
|
+
interface WeatherProps2 {
|
|
45
|
+
/** Where the forecast is for: a city's name. */
|
|
46
|
+
location?: string;
|
|
47
|
+
/** The weather now; without it the widget shows its state (`status`, `access`) or loads. */
|
|
48
|
+
current?: WeatherNow2 | null;
|
|
49
|
+
/** The hourly forecast, in any order: the hours from now on fill the strip. */
|
|
50
|
+
hours?: WeatherHour2[];
|
|
51
|
+
/** The daily forecast, today first: today gives the high and low, the next day the Tomorrow row. */
|
|
52
|
+
days?: WeatherDay2[];
|
|
53
|
+
/** Shows temperatures in this unit (and wind in mph for `'fahrenheit'`); the data stays in °C and km/h. Defaults to `'celsius'`. */
|
|
54
|
+
unit?: WeatherUnit2;
|
|
55
|
+
/** Whether the location may be read: undetermined asks, denied points to the system's settings. Defaults to `'granted'`. */
|
|
56
|
+
access?: WeatherAccess2;
|
|
57
|
+
/** How the last fetch went. `loading` shows placeholders until there is a `current`; `error` and `offline` keep the last forecast up and say so, or explain without one. Defaults to `'ready'`. */
|
|
58
|
+
status?: WeatherStatus2;
|
|
59
|
+
/** The moment the forecast is read at, in epoch ms. Defaults to now, re-read on each minute. */
|
|
60
|
+
now?: number;
|
|
61
|
+
/** Formats the hours. Defaults to the browser's locale. */
|
|
62
|
+
locale?: Intl.LocalesArgument;
|
|
63
|
+
/** Called by the refresh button, and by Try again after an error; without it neither shows. */
|
|
64
|
+
onRefresh?: () => void;
|
|
65
|
+
/** Called by Allow location while access is undetermined. */
|
|
66
|
+
onRequestAccess?: () => void;
|
|
67
|
+
/** Called by Open System Settings while access is denied. */
|
|
68
|
+
onOpenSettings?: () => void;
|
|
69
|
+
/** Classes for the root, which fills its container. */
|
|
70
|
+
className?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Open-Meteo's `weather_code` (WMO 4677) as a condition.
|
|
74
|
+
*
|
|
75
|
+
* @example conditionFromCode(61) // 'rain'
|
|
76
|
+
*/
|
|
77
|
+
declare function conditionFromCode2(code: number): WeatherCondition2;
|
|
78
|
+
interface PartProps {
|
|
79
|
+
/** The weather now. */
|
|
80
|
+
current: WeatherNow2;
|
|
81
|
+
}
|
|
82
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
83
|
+
/** The compact island's left wing: the condition's glyph in its hue. */
|
|
84
|
+
declare function WeatherLeading2({ current }: PartProps): Element_12xgc;
|
|
85
|
+
/** The compact island's right wing: the temperature. */
|
|
86
|
+
declare function WeatherTrailing2({ current, unit }: PartProps & {
|
|
87
|
+
unit?: WeatherUnit2;
|
|
88
|
+
}): Element_12xgc;
|
|
89
|
+
/** The split island's bubble: the condition's glyph on a disc. */
|
|
90
|
+
declare function WeatherMinimal2({ current }: PartProps): Element_12xgc;
|
|
91
|
+
type WeatherAlertSeverity2 = "notice" | "warning" | "severe";
|
|
92
|
+
interface WeatherAlertProps2 {
|
|
93
|
+
/** What is coming: its glyph, and the title's noun. */
|
|
94
|
+
condition: WeatherCondition2;
|
|
95
|
+
/** When it starts, in epoch ms: the title counts down to it, `Rain in 15 min`, on each minute. */
|
|
96
|
+
startsAt?: number;
|
|
97
|
+
/** The title in place of the countdown, for a warning: `Thunderstorm warning`. */
|
|
98
|
+
title?: string;
|
|
99
|
+
/** One line more: how long, how much. */
|
|
100
|
+
caption?: string;
|
|
101
|
+
/** How serious: the tile's hue, info, warning or error. Defaults to `'notice'`. */
|
|
102
|
+
severity?: WeatherAlertSeverity2;
|
|
103
|
+
/** The button's label. Defaults to `'Details'`. */
|
|
104
|
+
actionLabel?: string;
|
|
105
|
+
/** Called by the button; without it the button hides. */
|
|
106
|
+
onAction?: () => void;
|
|
107
|
+
}
|
|
108
|
+
/** The island's flash before the weather turns: `Rain in 15 min`, or a warning, with one action. */
|
|
109
|
+
declare function WeatherAlert2({ condition, startsAt, title, caption, severity, actionLabel, onAction }: WeatherAlertProps2): Element_12xgc;
|
|
110
|
+
/**
|
|
111
|
+
* A notch app's weather: the temperature now as the hero, the next hours
|
|
112
|
+
* and tomorrow beside it.
|
|
113
|
+
*
|
|
114
|
+
* The hero is the temperature in display type after the condition's glyph,
|
|
115
|
+
* in its hue (the sun's amber, rain's blue, the rest plain); under it the
|
|
116
|
+
* condition, how warm it feels and, when the next hours turn wet, around
|
|
117
|
+
* when. The meta line carries today's high and low, the chance of rain,
|
|
118
|
+
* the wind, and the humidity and UV index when given, the last giving way
|
|
119
|
+
* first. The header names the place and how long ago the forecast was
|
|
120
|
+
* read, with a refresh button when `onRefresh` is given. Beside it, past a
|
|
121
|
+
* hairline, the next six hours as a strip of hour, glyph and temperature,
|
|
122
|
+
* with the chance of rain under each once any hour is wet, then tomorrow as
|
|
123
|
+
* a row.
|
|
124
|
+
*
|
|
125
|
+
* The data is Open-Meteo's shape, zipped into objects: `current`, `hours`
|
|
126
|
+
* and `days` (today first), in °C and km/h; `unit="fahrenheit"` converts
|
|
127
|
+
* what it shows, wind in mph. `conditionFromCode` turns a WMO weather code
|
|
128
|
+
* into a condition.
|
|
129
|
+
*
|
|
130
|
+
* Before the location may be read it asks for it (`access="undetermined"`),
|
|
131
|
+
* and when access is off it says where to turn it on (`"denied"`). The
|
|
132
|
+
* first fetch shows placeholders (`status="loading"`); a failed one says so
|
|
133
|
+
* with Try again (`"error"`), and offline it says it will update when back
|
|
134
|
+
* (`"offline"`). Once there is a forecast, those keep it up and say so in
|
|
135
|
+
* the header instead.
|
|
136
|
+
*
|
|
137
|
+
* The other forms are parts: `Weather.Leading` and `Weather.Trailing` for
|
|
138
|
+
* the compact island's wings (the glyph and the temperature),
|
|
139
|
+
* `Weather.Minimal`, the glyph on a disc, for the split island's bubble,
|
|
140
|
+
* and `Weather.Alert`, the flash before rain or a warning. Nothing ticks but
|
|
141
|
+
* the minute of the "updated" line.
|
|
142
|
+
*
|
|
143
|
+
* @example {@include ./examples.mdx}
|
|
144
|
+
*/
|
|
145
|
+
declare const Weather2: (({ location, current, hours, days, unit, access, status, now: nowProp, locale, onRefresh, onRequestAccess, onOpenSettings, className }: WeatherProps2) => Element_12xgc) & {
|
|
146
|
+
Leading: typeof WeatherLeading2;
|
|
147
|
+
Trailing: typeof WeatherTrailing2;
|
|
148
|
+
Minimal: typeof WeatherMinimal2;
|
|
149
|
+
Alert: typeof WeatherAlert2;
|
|
150
|
+
};
|
|
151
|
+
export { WeatherCondition2, WeatherUnit2, WeatherAccess2, WeatherStatus2, WeatherNow2, WeatherHour2, WeatherDay2, WeatherProps2, conditionFromCode2, WeatherLeading2, WeatherTrailing2, WeatherMinimal2, WeatherAlertSeverity2, WeatherAlertProps2, WeatherAlert2, Weather2 };
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { IconComponent } from "@justanarthur/modo-ui/lib/icon-context";
|
|
2
|
+
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
3
|
+
import { LucideIcon } from "lucide-react";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import { JSX as JSX_1kxb } from "react";
|
|
6
|
+
interface WidgetHeaderProps2 {
|
|
7
|
+
/** The glyph before the label: the source app, the widget's kind. */
|
|
8
|
+
icon?: IconComponent;
|
|
9
|
+
/** The context: where it comes from, which day it is. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Quiet actions at the end of the line, such as `Widget.Action`s. */
|
|
12
|
+
trailing?: ReactNode;
|
|
13
|
+
/** Classes for the row. */
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
17
|
+
/** The context line at the top of a widget: a glyph, where it comes from, and quiet actions at the end. */
|
|
18
|
+
declare function WidgetHeader2({ icon: Icon, children, trailing, className }: WidgetHeaderProps2): Element_12xgc;
|
|
19
|
+
interface WidgetTitleProps2 {
|
|
20
|
+
/** The hero's name: a track, an event. */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** A mark before it, such as a calendar's color dot. */
|
|
23
|
+
leading?: ReactNode;
|
|
24
|
+
/** Classes for the row. */
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/** The hero's name, on the title role: one line, truncating. */
|
|
28
|
+
declare function WidgetTitle2({ children, leading, className }: WidgetTitleProps2): Element_12xgc;
|
|
29
|
+
/** The line under the title: who, where, what else; muted, one line. */
|
|
30
|
+
declare function WidgetSubtitle2({ children, className }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}): Element_12xgc;
|
|
34
|
+
interface WidgetFigureProps2 {
|
|
35
|
+
/** The number, or the one word that stands for it (`Now`). */
|
|
36
|
+
value: ReactNode;
|
|
37
|
+
/** The unit after it, set smaller and muted: `min`, `%`. */
|
|
38
|
+
unit?: ReactNode;
|
|
39
|
+
/** A word before it, set like the unit: `in`. */
|
|
40
|
+
prefix?: ReactNode;
|
|
41
|
+
/** A data color for the value (a calendar's, an artwork's); without one it is the text color. */
|
|
42
|
+
color?: string;
|
|
43
|
+
/** Classes for the row. */
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/** A widget's hero number on the display role, its unit beside it on the title role, digits tabular. */
|
|
47
|
+
declare function WidgetFigure2({ value, unit, prefix, color, className }: WidgetFigureProps2): Element_12xgc;
|
|
48
|
+
interface WidgetMetaItemProps2 {
|
|
49
|
+
/** The glyph before it: a clock, a pin, a speaker. */
|
|
50
|
+
icon?: IconComponent;
|
|
51
|
+
/** The fact. */
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/** One fact of a meta row: a glyph and a few words. */
|
|
55
|
+
declare function WidgetMetaItem2({ icon: Icon, children }: WidgetMetaItemProps2): Element_12xgc;
|
|
56
|
+
/** Supporting facts in a row, each a glyph and a few words, muted; the last one gives way first. */
|
|
57
|
+
declare function WidgetMeta2({ children, className }: {
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
className?: string;
|
|
60
|
+
}): Element_12xgc;
|
|
61
|
+
interface WidgetActionProps2 {
|
|
62
|
+
/** The glyph: a Lucide icon, or any component taking its props. */
|
|
63
|
+
icon: LucideIcon;
|
|
64
|
+
/** What it does: the accessible name and the tooltip. */
|
|
65
|
+
label: string;
|
|
66
|
+
/** Called on press. */
|
|
67
|
+
onClick?: () => void;
|
|
68
|
+
/** A toggle that is on (shuffle, a like): the glyph in the text color, `aria-pressed`. Leave it out for a plain action. */
|
|
69
|
+
pressed?: boolean;
|
|
70
|
+
/** `primary` is the widget's main action (play / pause): a larger glyph in the text color. Defaults to `'default'`. */
|
|
71
|
+
emphasis?: "default" | "primary";
|
|
72
|
+
/** Fills the glyph, for solid transport glyphs. Defaults to `false`. */
|
|
73
|
+
filled?: boolean;
|
|
74
|
+
/** A data color for the glyph while pressed (the artwork's tint). */
|
|
75
|
+
color?: string;
|
|
76
|
+
/** No press. Defaults to `false`. */
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** A quiet icon button with a tooltip: muted at rest, the text color on hover and while pressed. */
|
|
80
|
+
declare function WidgetAction2({ icon: Icon, label, onClick, pressed, emphasis, filled, color, disabled }: WidgetActionProps2): Element_12xgc;
|
|
81
|
+
interface WidgetMessageProps2 {
|
|
82
|
+
/** The glyph in the tile. */
|
|
83
|
+
icon: IconComponent;
|
|
84
|
+
/** What's going on, in a few words. */
|
|
85
|
+
title: ReactNode;
|
|
86
|
+
/** What to do about it. */
|
|
87
|
+
description?: ReactNode;
|
|
88
|
+
/** The way forward: a Button or two. */
|
|
89
|
+
actions?: ReactNode;
|
|
90
|
+
/** Classes for the root, which fills the widget. */
|
|
91
|
+
className?: string;
|
|
92
|
+
}
|
|
93
|
+
/** A widget's empty, permission or error state, laid out across the wide, short island: tile, text, then the action. */
|
|
94
|
+
declare function WidgetMessage2({ icon: Icon, title, description, actions, className }: WidgetMessageProps2): Element_12xgc;
|
|
95
|
+
interface WidgetSectionProps2 {
|
|
96
|
+
/** The group's name: `Later today`, `Tomorrow`. */
|
|
97
|
+
label: ReactNode;
|
|
98
|
+
/** Content at the end of the label's line: chips, a count, a fold toggle. */
|
|
99
|
+
trailing?: ReactNode;
|
|
100
|
+
/** The rows. */
|
|
101
|
+
children?: ReactNode;
|
|
102
|
+
/** Classes for the section. */
|
|
103
|
+
className?: string;
|
|
104
|
+
}
|
|
105
|
+
/** A group of rows under a muted caption, the way a list's section reads. */
|
|
106
|
+
declare function WidgetSection2({ label, trailing, children, className }: WidgetSectionProps2): Element_12xgc;
|
|
107
|
+
interface WidgetRowProps2 {
|
|
108
|
+
/** The figure at the start, muted and tabular: a time. */
|
|
109
|
+
leading?: ReactNode;
|
|
110
|
+
/** A data color for the mark between the figure and the title: a calendar's. */
|
|
111
|
+
color?: string;
|
|
112
|
+
/** The row's text. */
|
|
113
|
+
children: ReactNode;
|
|
114
|
+
/** Muted content at the end: a glyph, a place. */
|
|
115
|
+
trailing?: ReactNode;
|
|
116
|
+
/** Classes for the row. */
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
/** A list row for the island: a muted figure, a color mark, the title, and a muted end; the compact control height. */
|
|
120
|
+
declare function WidgetRow2({ leading, color, children, trailing, className }: WidgetRowProps2): Element_12xgc;
|
|
121
|
+
interface WidgetChipProps2 {
|
|
122
|
+
/** A data color for its dot. */
|
|
123
|
+
color?: string;
|
|
124
|
+
/** The chip's text. */
|
|
125
|
+
children: ReactNode;
|
|
126
|
+
}
|
|
127
|
+
/** A small label on a wash one surface up: an all-day event, a state. */
|
|
128
|
+
declare function WidgetChip2({ color, children }: WidgetChipProps2): Element_12xgc;
|
|
129
|
+
interface WidgetProps2 {
|
|
130
|
+
/** The hero's picture at the start, as tall as the widget: artwork, a ring. */
|
|
131
|
+
media?: ReactNode;
|
|
132
|
+
/** The supporting column at the end, past a hairline: a list, a timeline. It folds away when the widget is narrow. */
|
|
133
|
+
aside?: ReactNode;
|
|
134
|
+
/** The main column: header, hero, meta, actions. */
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
/** Step on the size ladder for every part inside. Omitted, the widget follows the surrounding SizeProvider. */
|
|
137
|
+
size?: SizeVariant;
|
|
138
|
+
/** Classes for the root, which fills the island's content area. */
|
|
139
|
+
className?: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The frame every open-island widget is built in: the hero's picture, the
|
|
143
|
+
* main column, and a supporting column past a hairline.
|
|
144
|
+
*
|
|
145
|
+
* One hero per widget, set large: a name on the title role
|
|
146
|
+
* (`Widget.Title`) or a number on the display role (`Widget.Figure`), then
|
|
147
|
+
* one muted line (`Widget.Subtitle`), then the supporting facts as glyph and
|
|
148
|
+
* words (`Widget.Meta`). Context goes on the line above (`Widget.Header`),
|
|
149
|
+
* actions are quiet icon buttons with tooltips (`Widget.Action`), and lists
|
|
150
|
+
* are rows of a muted figure, a color mark and a title (`Widget.Row` under
|
|
151
|
+
* a `Widget.Section`). Color comes from the content (an artwork's tint, a
|
|
152
|
+
* calendar's color, a status hue), never from decoration; depth from one
|
|
153
|
+
* surface step (`Widget.Chip`, `Widget.Message`'s tile), never from boxes.
|
|
154
|
+
* Empty and permission states are a `Widget.Message`, laid out across the
|
|
155
|
+
* wide, short island.
|
|
156
|
+
*
|
|
157
|
+
* The frame fills the island's content area. The aside folds away under
|
|
158
|
+
* 30rem of width, so a narrower panel keeps the hero.
|
|
159
|
+
*
|
|
160
|
+
* @example {@include ./examples.mdx}
|
|
161
|
+
*/
|
|
162
|
+
declare const Widget2: (({ media, aside, children, size, className }: WidgetProps2) => Element_12xgc) & {
|
|
163
|
+
Header: typeof WidgetHeader2;
|
|
164
|
+
Title: typeof WidgetTitle2;
|
|
165
|
+
Subtitle: typeof WidgetSubtitle2;
|
|
166
|
+
Figure: typeof WidgetFigure2;
|
|
167
|
+
Meta: typeof WidgetMeta2;
|
|
168
|
+
MetaItem: typeof WidgetMetaItem2;
|
|
169
|
+
Action: typeof WidgetAction2;
|
|
170
|
+
Message: typeof WidgetMessage2;
|
|
171
|
+
Section: typeof WidgetSection2;
|
|
172
|
+
Row: typeof WidgetRow2;
|
|
173
|
+
Chip: typeof WidgetChip2;
|
|
174
|
+
};
|
|
175
|
+
export { WidgetHeaderProps2, WidgetHeader2, WidgetTitleProps2, WidgetTitle2, WidgetSubtitle2, WidgetFigureProps2, WidgetFigure2, WidgetMetaItemProps2, WidgetMetaItem2, WidgetMeta2, WidgetActionProps2, WidgetAction2, WidgetMessageProps2, WidgetMessage2, WidgetSectionProps2, WidgetSection2, WidgetRowProps2, WidgetRow2, WidgetChipProps2, WidgetChip2, WidgetProps2, Widget2 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// lib/geometry.ts
|
|
2
2
|
var ISLAND_STATES2 = ["idle", "compact", "split", "expanded", "flash"];
|
|
3
3
|
var DEFAULT_NOTCH2 = { width: 185, height: 32 };
|
|
4
|
-
var DEFAULT_PANEL2 = { width: 720, height:
|
|
4
|
+
var DEFAULT_PANEL2 = { width: 720, height: 240 };
|
|
5
5
|
var INSET2 = 20;
|
|
6
6
|
var NOTCH_GAP2 = 8;
|
|
7
7
|
var FLASH_REACH = 64;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
2
|
+
import { JSX as JSX_1kxb } from "react";
|
|
3
|
+
/** One reading of the system. */
|
|
4
|
+
interface StatsSample2 {
|
|
5
|
+
/** CPU load, from 0 to 1. */
|
|
6
|
+
cpu: number;
|
|
7
|
+
/** Memory in use, in bytes. */
|
|
8
|
+
memoryUsed: number;
|
|
9
|
+
/** All the memory, in bytes. */
|
|
10
|
+
memoryTotal: number;
|
|
11
|
+
/** Memory pressure, from 0 to 1, as the system judges it; without it the share in use stands in. */
|
|
12
|
+
memoryPressure?: number;
|
|
13
|
+
/** Network in, in bytes per second. */
|
|
14
|
+
netIn: number;
|
|
15
|
+
/** Network out, in bytes per second. */
|
|
16
|
+
netOut: number;
|
|
17
|
+
}
|
|
18
|
+
interface StatsBattery2 {
|
|
19
|
+
/** The charge, in percent (0 to 100). */
|
|
20
|
+
level: number;
|
|
21
|
+
/** A charger is connected. */
|
|
22
|
+
charging?: boolean;
|
|
23
|
+
/** Minutes until full while charging, else until empty. */
|
|
24
|
+
minutesLeft?: number;
|
|
25
|
+
}
|
|
26
|
+
interface StatsDisk2 {
|
|
27
|
+
/** Free space on the startup disk, in bytes. */
|
|
28
|
+
free: number;
|
|
29
|
+
/** The disk's size, in bytes. */
|
|
30
|
+
total: number;
|
|
31
|
+
}
|
|
32
|
+
interface StatsProcess2 {
|
|
33
|
+
/** What tells it apart: its pid. */
|
|
34
|
+
id: string;
|
|
35
|
+
/** The app or process name. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Its share of the CPU, from 0 to 1. */
|
|
38
|
+
cpu: number;
|
|
39
|
+
/** The memory it holds, in bytes. */
|
|
40
|
+
memory?: number;
|
|
41
|
+
}
|
|
42
|
+
type StatsHero2 = "cpu" | "memory";
|
|
43
|
+
interface SystemStatsProps2 {
|
|
44
|
+
/** The readings so far, oldest first; the latest is the figure, all of them the trend. Without any, it is still measuring. */
|
|
45
|
+
samples: StatsSample2[];
|
|
46
|
+
/** Which figure is the hero: the CPU load, or memory pressure when memory is what's tight. Defaults to `'cpu'`. */
|
|
47
|
+
hero?: StatsHero2;
|
|
48
|
+
/** The battery, on a laptop. */
|
|
49
|
+
battery?: StatsBattery2;
|
|
50
|
+
/** The startup disk's free space. */
|
|
51
|
+
disk?: StatsDisk2;
|
|
52
|
+
/** Seconds since the last boot. */
|
|
53
|
+
uptime?: number;
|
|
54
|
+
/** The busiest processes, in any order: the top three list beside the hero, by CPU. */
|
|
55
|
+
processes?: StatsProcess2[];
|
|
56
|
+
/** Step on the size ladder. Omitted, it follows the surrounding SizeProvider. */
|
|
57
|
+
size?: SizeVariant;
|
|
58
|
+
/** Classes for the root, which fills its container. */
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
type Element_12xgc = JSX_1kxb["Element"];
|
|
62
|
+
/** The compact island's left wing: the CPU glyph. */
|
|
63
|
+
declare function SystemStatsLeading2(): Element_12xgc;
|
|
64
|
+
/** The compact island's right wing: the CPU load, a dash until the first reading. */
|
|
65
|
+
declare function SystemStatsTrailing2({ sample }: {
|
|
66
|
+
sample?: StatsSample2;
|
|
67
|
+
}): Element_12xgc;
|
|
68
|
+
/** The split island's bubble: the CPU load as a ring, in the warning hue from 75% and the error hue from 90%. */
|
|
69
|
+
declare function SystemStatsMinimal2({ sample }: {
|
|
70
|
+
sample?: StatsSample2;
|
|
71
|
+
}): Element_12xgc;
|
|
72
|
+
/**
|
|
73
|
+
* A notch app's system load: the busiest figure as the hero with its trend,
|
|
74
|
+
* the rest as facts, and the processes behind it.
|
|
75
|
+
*
|
|
76
|
+
* The hero is the CPU load, set large, with every reading so far as a
|
|
77
|
+
* modo-ui Sparkline beside it (it spans the width however many readings
|
|
78
|
+
* there are: the island stays open for seconds, too short to fill a fixed
|
|
79
|
+
* window). The line turns to the warning hue from 75% and the error hue
|
|
80
|
+
* from 90%, so the color comes from the load. When memory is what's tight,
|
|
81
|
+
* `hero="memory"` makes memory pressure the figure and its trend instead.
|
|
82
|
+
* Under it one word for how the machine is doing and who's busiest, then
|
|
83
|
+
* the facts: memory in use of all of it (or the CPU), the network's in and
|
|
84
|
+
* out rates, and, when given, the battery with its time left and the
|
|
85
|
+
* startup disk's free space. The uptime sits on the context line.
|
|
86
|
+
*
|
|
87
|
+
* Beside it, past a hairline, the busiest processes by CPU with the memory
|
|
88
|
+
* they hold, three at most and a count of the rest.
|
|
89
|
+
*
|
|
90
|
+
* CPU and network are rates between two readings, so before the first one
|
|
91
|
+
* lands (about a second after opening) the figures are dashes over the
|
|
92
|
+
* Sparkline's baseline.
|
|
93
|
+
*
|
|
94
|
+
* `SystemStats.Leading` and `SystemStats.Trailing` show the CPU load in the
|
|
95
|
+
* compact island's wings, `SystemStats.Minimal` as a ring in the split
|
|
96
|
+
* island's bubble.
|
|
97
|
+
*
|
|
98
|
+
* @example {@include ./examples.mdx}
|
|
99
|
+
*/
|
|
100
|
+
declare const SystemStats2: (({ samples, hero, battery, disk, uptime, processes, size, className }: SystemStatsProps2) => Element_12xgc) & {
|
|
101
|
+
Leading: typeof SystemStatsLeading2;
|
|
102
|
+
Trailing: typeof SystemStatsTrailing2;
|
|
103
|
+
Minimal: typeof SystemStatsMinimal2;
|
|
104
|
+
};
|
|
105
|
+
export { StatsSample2, StatsBattery2, StatsDisk2, StatsProcess2, StatsHero2, SystemStatsProps2, SystemStatsLeading2, SystemStatsTrailing2, SystemStatsMinimal2, SystemStats2 };
|
|
@@ -19,7 +19,7 @@ interface IslandProps2 {
|
|
|
19
19
|
notchHeight?: number;
|
|
20
20
|
/** The open island's width in px; it shrinks to the room it has. Defaults to `720`. */
|
|
21
21
|
panelWidth?: number;
|
|
22
|
-
/** The open island's height in px. Defaults to `
|
|
22
|
+
/** The open island's height in px. Defaults to `240`. */
|
|
23
23
|
panelHeight?: number;
|
|
24
24
|
/** The compact left wing: the activity's glyph (`compact` and `split`). */
|
|
25
25
|
leading?: ReactNode;
|