@justanarthur/modo-ui-notch 0.3.0 → 0.4.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/blocks/activities/agenda/examples.mdx +8 -0
- package/blocks/activities/agenda/index.tsx +164 -16
- package/blocks/activities/clock/examples.mdx +16 -0
- package/blocks/activities/clock/index.tsx +357 -59
- package/blocks/activities/now-playing/examples.mdx +8 -0
- package/blocks/activities/now-playing/index.tsx +140 -54
- package/blocks/activities/weather/examples.mdx +9 -1
- package/blocks/activities/weather/index.tsx +241 -12
- package/blocks/app/expanded-island/index.tsx +3 -1
- package/blocks/app/settings-window/examples.mdx +8 -0
- package/blocks/app/settings-window/index.tsx +8 -3
- package/blocks/system/clipboard/examples.mdx +8 -0
- package/blocks/system/clipboard/index.tsx +262 -52
- package/blocks/system/recent-files/examples.mdx +14 -0
- package/blocks/system/recent-files/index.tsx +110 -25
- package/blocks/system/system-stats/examples.mdx +8 -0
- package/blocks/system/system-stats/index.tsx +211 -4
- package/components/island/widget/index.tsx +38 -4
- package/dist/blocks/activities/agenda/index.d.ts +2 -1
- package/dist/blocks/activities/agenda/index.js +2 -2
- package/dist/blocks/activities/clock/index.d.ts +2 -1
- package/dist/blocks/activities/clock/index.js +2 -2
- package/dist/blocks/activities/now-playing/index.d.ts +2 -1
- package/dist/blocks/activities/now-playing/index.js +2 -2
- package/dist/blocks/activities/weather/index.d.ts +2 -1
- package/dist/blocks/activities/weather/index.js +2 -2
- package/dist/blocks/app/expanded-island/index.d.ts +1 -1
- package/dist/blocks/app/expanded-island/index.js +1 -1
- 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 -1
- package/dist/blocks/system/clipboard/index.js +2 -2
- package/dist/blocks/system/recent-files/index.d.ts +2 -1
- package/dist/blocks/system/recent-files/index.js +2 -2
- package/dist/blocks/system/system-stats/index.d.ts +2 -1
- package/dist/blocks/system/system-stats/index.js +2 -2
- package/dist/components/island/widget/index.d.ts +2 -2
- package/dist/components/island/widget/index.js +3 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +12 -10
- package/dist/shared/{chunk-2m5dz8nf.d.ts → chunk-0ym9mcqc.d.ts} +6 -2
- package/dist/shared/{chunk-7fvnrtz4.d.ts → chunk-1v35ck2y.d.ts} +12 -2
- package/dist/shared/{chunk-wkg17nxs.d.ts → chunk-2bqmmfg9.d.ts} +13 -2
- package/dist/shared/{chunk-mt0k6v8x.js → chunk-2nxwdn5s.js} +147 -39
- package/dist/shared/{chunk-pfhy5e4q.d.ts → chunk-6tnq6p89.d.ts} +2 -0
- package/dist/shared/{chunk-bvtyjcce.d.ts → chunk-72s4sqwh.d.ts} +16 -1
- package/dist/shared/{chunk-t0hcxh89.d.ts → chunk-9b8b7fw6.d.ts} +12 -0
- package/dist/shared/{chunk-xq5hc5gv.js → chunk-a059ccj0.js} +177 -66
- package/dist/shared/{chunk-qdzemt2v.js → chunk-cry81asr.js} +401 -89
- package/dist/shared/{chunk-da177e8r.d.ts → chunk-fr9jf804.d.ts} +16 -1
- package/dist/shared/{chunk-9c7ewvkk.js → chunk-kbk4bp6p.js} +162 -19
- package/dist/shared/{chunk-3thgcfcq.d.ts → chunk-kv0w8vhq.d.ts} +18 -1
- package/dist/shared/{chunk-416tsgbc.d.ts → chunk-nqjermbr.d.ts} +25 -3
- package/dist/shared/chunk-p3nezxvx.js +481 -0
- package/dist/shared/{chunk-2818esrq.d.ts → chunk-sen170mz.d.ts} +10 -1
- package/dist/shared/{chunk-9m0xbg5v.js → chunk-wayv5rhr.js} +1 -1
- package/dist/shared/{chunk-ym0xbses.js → chunk-ygnrrqta.js} +274 -18
- package/dist/shared/{chunk-j77cx8dp.js → chunk-yw478nmj.js} +325 -58
- package/dist/shared/{chunk-cc9nwbtf.js → chunk-z3tj1ydg.js} +3 -0
- package/dist/shared/{chunk-x7f3g82r.js → chunk-zxsw11dr.js} +14 -4
- package/dist/styles.css +61 -1
- package/mock/clipboard.tsx +34 -0
- package/mock/clock.tsx +3 -3
- package/mock/data.ts +48 -0
- package/mock/files.tsx +14 -1
- package/mock/island-content.tsx +47 -15
- package/mock/system.ts +3 -0
- package/mock/weather.tsx +42 -12
- package/package.json +2 -2
- package/dist/shared/chunk-s2jeqqan.js +0 -243
package/dist/index.js
CHANGED
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
WidgetSection2,
|
|
14
14
|
WidgetRow2,
|
|
15
15
|
WidgetChip2,
|
|
16
|
+
WidgetSheet2,
|
|
16
17
|
Widget2
|
|
17
|
-
} from "./shared/chunk-
|
|
18
|
+
} from "./shared/chunk-zxsw11dr.js";
|
|
18
19
|
import {
|
|
19
20
|
formatClock2,
|
|
20
21
|
formatShort2,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
AgendaUpNext2,
|
|
28
29
|
AgendaStarting2,
|
|
29
30
|
Agenda2
|
|
30
|
-
} from "./shared/chunk-
|
|
31
|
+
} from "./shared/chunk-kbk4bp6p.js";
|
|
31
32
|
import {
|
|
32
33
|
startPomodoro2,
|
|
33
34
|
advancePomodoro2,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
ClockMinimal2,
|
|
38
39
|
ClockPhaseDone2,
|
|
39
40
|
Clock2
|
|
40
|
-
} from "./shared/chunk-
|
|
41
|
+
} from "./shared/chunk-cry81asr.js";
|
|
41
42
|
import {
|
|
42
43
|
Equalizer2
|
|
43
44
|
} from "./shared/chunk-2f7zxrbk.js";
|
|
@@ -55,7 +56,7 @@ import {
|
|
|
55
56
|
NowPlayingMinimal2,
|
|
56
57
|
NowPlayingFlash2,
|
|
57
58
|
NowPlaying2
|
|
58
|
-
} from "./shared/chunk-
|
|
59
|
+
} from "./shared/chunk-a059ccj0.js";
|
|
59
60
|
import {
|
|
60
61
|
conditionFromCode2,
|
|
61
62
|
WeatherLeading2,
|
|
@@ -63,7 +64,7 @@ import {
|
|
|
63
64
|
WeatherMinimal2,
|
|
64
65
|
WeatherAlert2,
|
|
65
66
|
Weather2
|
|
66
|
-
} from "./shared/chunk-
|
|
67
|
+
} from "./shared/chunk-ygnrrqta.js";
|
|
67
68
|
import {
|
|
68
69
|
ISLAND_STATES2,
|
|
69
70
|
DEFAULT_NOTCH2,
|
|
@@ -86,29 +87,29 @@ import {
|
|
|
86
87
|
import"./shared/chunk-2s4q6mt0.js";
|
|
87
88
|
import {
|
|
88
89
|
ExpandedIsland2
|
|
89
|
-
} from "./shared/chunk-
|
|
90
|
+
} from "./shared/chunk-wayv5rhr.js";
|
|
90
91
|
import {
|
|
91
92
|
SettingsWindow2
|
|
92
|
-
} from "./shared/chunk-
|
|
93
|
+
} from "./shared/chunk-z3tj1ydg.js";
|
|
93
94
|
import {
|
|
94
95
|
ClipboardHistoryLeading2,
|
|
95
96
|
ClipboardHistoryTrailing2,
|
|
96
97
|
ClipboardHistoryCopied2,
|
|
97
98
|
ClipboardHistory2
|
|
98
|
-
} from "./shared/chunk-
|
|
99
|
+
} from "./shared/chunk-yw478nmj.js";
|
|
99
100
|
import {
|
|
100
101
|
RecentFilesLeading2,
|
|
101
102
|
RecentFilesTrailing2,
|
|
102
103
|
RecentFilesMinimal2,
|
|
103
104
|
RecentFilesSaved2,
|
|
104
105
|
RecentFiles2
|
|
105
|
-
} from "./shared/chunk-
|
|
106
|
+
} from "./shared/chunk-2nxwdn5s.js";
|
|
106
107
|
import {
|
|
107
108
|
SystemStatsLeading2,
|
|
108
109
|
SystemStatsTrailing2,
|
|
109
110
|
SystemStatsMinimal2,
|
|
110
111
|
SystemStats2
|
|
111
|
-
} from "./shared/chunk-
|
|
112
|
+
} from "./shared/chunk-p3nezxvx.js";
|
|
112
113
|
import {
|
|
113
114
|
Countdown2
|
|
114
115
|
} from "./shared/chunk-502rmtap.js";
|
|
@@ -175,6 +176,7 @@ export {
|
|
|
175
176
|
WidgetMetaItem2 as WidgetMetaItem,
|
|
176
177
|
WidgetRow2 as WidgetRow,
|
|
177
178
|
WidgetSection2 as WidgetSection,
|
|
179
|
+
WidgetSheet2 as WidgetSheet,
|
|
178
180
|
WidgetSubtitle2 as WidgetSubtitle,
|
|
179
181
|
WidgetTitle2 as WidgetTitle,
|
|
180
182
|
advancePomodoro2 as advancePomodoro,
|
|
@@ -59,6 +59,8 @@ interface SettingsWindowProps2 {
|
|
|
59
59
|
onOpenPermission?: (id: string) => void;
|
|
60
60
|
/** The About page's rows: version, mode, screen. Defaults to `[]`. */
|
|
61
61
|
about?: AboutRow2[];
|
|
62
|
+
/** Drops the sidebar's inset on the left: its rows run to the window's edge and their text sits only the row's own padding in, so a host can line it up with an edge of its own (the open island's inset). Defaults to `false`. */
|
|
63
|
+
flush?: boolean;
|
|
62
64
|
/** Classes for the window's content, which fills its container. */
|
|
63
65
|
className?: string;
|
|
64
66
|
}
|
|
@@ -80,9 +82,11 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
80
82
|
* The page, the preferences and the plugins' states each run both ways
|
|
81
83
|
* (`value`, `preferences`, `enabled` with their `default*` and `on*Change`),
|
|
82
84
|
* so the window works on its own or on a host's store. It fills its
|
|
83
|
-
* container; the window's frame and title bar are the host's.
|
|
85
|
+
* container; the window's frame and title bar are the host's. In a frame
|
|
86
|
+
* of the host's own, such as the open island, `flush` drops the sidebar's
|
|
87
|
+
* left inset, so the rows' text sits just the row's padding from the edge.
|
|
84
88
|
*
|
|
85
89
|
* @example {@include ./examples.mdx}
|
|
86
90
|
*/
|
|
87
|
-
declare function SettingsWindow2({ name, value, defaultValue, onValueChange, preferences: preferencesProp, defaultPreferences, onPreferencesChange, plugins, enabled: enabledProp, defaultEnabled, onEnabledChange, permissions, onOpenPermission, about, className }: SettingsWindowProps2): Element_12xgc;
|
|
91
|
+
declare function SettingsWindow2({ name, value, defaultValue, onValueChange, preferences: preferencesProp, defaultPreferences, onPreferencesChange, plugins, enabled: enabledProp, defaultEnabled, onEnabledChange, permissions, onOpenPermission, about, flush, className }: SettingsWindowProps2): Element_12xgc;
|
|
88
92
|
export { ScreensPreference2, AppPreferences2, SettingsPlugin2, SettingsPermission2, AboutRow2, SettingsWindowProps2, SettingsWindow2 };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetLayout2 } from "./chunk-nqjermbr.js";
|
|
1
2
|
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
2
3
|
import { JSX as JSX_1kxb } from "react";
|
|
3
4
|
/** One reading of the system. */
|
|
@@ -51,10 +52,12 @@ interface SystemStatsProps2 {
|
|
|
51
52
|
disk?: StatsDisk2;
|
|
52
53
|
/** Seconds since the last boot. */
|
|
53
54
|
uptime?: number;
|
|
54
|
-
/** The busiest processes, in any order: the top three list beside the hero, by CPU. */
|
|
55
|
+
/** The busiest processes, in any order: the top three list beside the hero, by CPU; the top eight at the tall snap. */
|
|
55
56
|
processes?: StatsProcess2[];
|
|
56
57
|
/** Step on the size ladder. Omitted, it follows the surrounding SizeProvider. */
|
|
57
58
|
size?: SizeVariant;
|
|
59
|
+
/** `tall` is the open island's tall snap: CPU and memory side by side, each with its trend; the network's in and out as one graph beside the battery and the disk as gauges; and the top eight processes as a table. Defaults to `'fit'`. */
|
|
60
|
+
layout?: WidgetLayout2;
|
|
58
61
|
/** Classes for the root, which fills its container. */
|
|
59
62
|
className?: string;
|
|
60
63
|
}
|
|
@@ -91,13 +94,20 @@ declare function SystemStatsMinimal2({ sample }: {
|
|
|
91
94
|
* lands (about a second after opening) the figures are dashes over the
|
|
92
95
|
* Sparkline's baseline.
|
|
93
96
|
*
|
|
97
|
+
* At the open island's tall snap (`layout="tall"`) it becomes a sheet: CPU
|
|
98
|
+
* and memory pressure side by side, each its figure large over its trend
|
|
99
|
+
* and a line on what it means (the hero's column first); then the
|
|
100
|
+
* network's in and out as one graph, its rates over it, beside the battery
|
|
101
|
+
* and the startup disk as Meter bars; then the top eight processes as a
|
|
102
|
+
* table, each with its share of the CPU as a line and the memory it holds.
|
|
103
|
+
*
|
|
94
104
|
* `SystemStats.Leading` and `SystemStats.Trailing` show the CPU load in the
|
|
95
105
|
* compact island's wings, `SystemStats.Minimal` as a ring in the split
|
|
96
106
|
* island's bubble.
|
|
97
107
|
*
|
|
98
108
|
* @example {@include ./examples.mdx}
|
|
99
109
|
*/
|
|
100
|
-
declare const SystemStats2: (({ samples, hero, battery, disk, uptime, processes, size, className }: SystemStatsProps2) => Element_12xgc) & {
|
|
110
|
+
declare const SystemStats2: (({ samples, hero, battery, disk, uptime, processes, size, layout, className }: SystemStatsProps2) => Element_12xgc) & {
|
|
101
111
|
Leading: typeof SystemStatsLeading2;
|
|
102
112
|
Trailing: typeof SystemStatsTrailing2;
|
|
103
113
|
Minimal: typeof SystemStatsMinimal2;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetLayout2 } from "./chunk-nqjermbr.js";
|
|
1
2
|
import { JSX as JSX_1kxb } from "react";
|
|
2
3
|
type AgendaAccess2 = "granted" | "undetermined" | "denied";
|
|
3
4
|
interface AgendaEvent2 {
|
|
@@ -33,8 +34,10 @@ interface AgendaProps2 {
|
|
|
33
34
|
onRequestAccess?: () => void;
|
|
34
35
|
/** Called by Open System Settings while access is denied. */
|
|
35
36
|
onOpenSettings?: () => void;
|
|
36
|
-
/** Called by the next event's Join button. */
|
|
37
|
+
/** Called by the next event's Join button, and at the tall snap by every call's. */
|
|
37
38
|
onJoin?: (event: AgendaEvent2) => void;
|
|
39
|
+
/** `tall` is the open island's tall snap: the next event as the hero, then today and tomorrow listed in full, each event with its times, place or call and Join, then the rest of the week by day. Defaults to `'fit'`. */
|
|
40
|
+
layout?: WidgetLayout2;
|
|
38
41
|
/** Classes for the root, which fills its container. */
|
|
39
42
|
className?: string;
|
|
40
43
|
}
|
|
@@ -77,6 +80,14 @@ declare function AgendaStarting2({ event, onJoin }: Omit<ActivityProps, "locale"
|
|
|
77
80
|
* (`tomorrowOpen` / `onTomorrowOpenChange`, or kept here). Ended events drop
|
|
78
81
|
* off; `now` follows the clock on each minute unless you pin it.
|
|
79
82
|
*
|
|
83
|
+
* At the open island's tall snap (`layout="tall"`) it becomes a sheet: the
|
|
84
|
+
* date and the hero as above, then the rest of today and all of tomorrow
|
|
85
|
+
* listed in full, each event with its start over its end, its calendar's
|
|
86
|
+
* mark, the title over how long it runs and where (or that it's a call),
|
|
87
|
+
* and Join for every call; then the rest of the week, a section per day
|
|
88
|
+
* with events, named by its weekday and date, its all-day events as chips
|
|
89
|
+
* on the name's line.
|
|
90
|
+
*
|
|
80
91
|
* Before the calendar may be read it asks to connect
|
|
81
92
|
* (`access="undetermined"`), and when access is off it says where to turn it
|
|
82
93
|
* on (`"denied"`).
|
|
@@ -91,7 +102,7 @@ declare function AgendaStarting2({ event, onJoin }: Omit<ActivityProps, "locale"
|
|
|
91
102
|
*
|
|
92
103
|
* @example {@include ./examples.mdx}
|
|
93
104
|
*/
|
|
94
|
-
declare const Agenda2: (({ events, access, now: nowProp, locale, tomorrowOpen: tomorrowOpenProp, defaultTomorrowOpen, onTomorrowOpenChange, onRequestAccess, onOpenSettings, onJoin, className }: AgendaProps2) => Element_12xgc) & {
|
|
105
|
+
declare const Agenda2: (({ events, access, now: nowProp, locale, tomorrowOpen: tomorrowOpenProp, defaultTomorrowOpen, onTomorrowOpenChange, onRequestAccess, onOpenSettings, onJoin, layout, className }: AgendaProps2) => Element_12xgc) & {
|
|
95
106
|
Leading: typeof AgendaLeading2;
|
|
96
107
|
Trailing: typeof AgendaTrailing2;
|
|
97
108
|
Minimal: typeof AgendaMinimal2;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-ndf79pv5.js";
|
|
6
6
|
import {
|
|
7
7
|
widget_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-zxsw11dr.js";
|
|
9
9
|
import {
|
|
10
10
|
MINUTE2,
|
|
11
11
|
useEdgeClock2
|
|
@@ -97,6 +97,7 @@ function left(seconds) {
|
|
|
97
97
|
}
|
|
98
98
|
var dragOf = (file, onDragStart) => onDragStart ? { draggable: true, onDragStart: (event) => onDragStart(file, event) } : {};
|
|
99
99
|
var TILE = { default: "size-24 rounded-xl", compact: "size-20 rounded-xl" };
|
|
100
|
+
var SHEET_TILE = { default: "h-32 w-48 rounded-2xl", compact: "h-28 w-42 rounded-2xl" };
|
|
100
101
|
function Thumbnail({
|
|
101
102
|
file,
|
|
102
103
|
className,
|
|
@@ -292,6 +293,44 @@ function Tiles({ files, onOpen, onDragStart }) {
|
|
|
292
293
|
}, file.id))
|
|
293
294
|
});
|
|
294
295
|
}
|
|
296
|
+
function Grid({ files, now, onOpen, onDragStart }) {
|
|
297
|
+
return /* @__PURE__ */ jsx(FluidHover, {
|
|
298
|
+
columns: 5,
|
|
299
|
+
className: "-m-1.5 grid-cols-5 gap-0",
|
|
300
|
+
highlightClassName: "rounded-xl",
|
|
301
|
+
children: files.map((file, index) => /* @__PURE__ */ jsxs(FluidHover.Item, {
|
|
302
|
+
index,
|
|
303
|
+
title: file.name,
|
|
304
|
+
className: "min-h-0 flex-col items-stretch gap-1.5 p-1.5 text-left",
|
|
305
|
+
onClick: () => onOpen?.(file),
|
|
306
|
+
...dragOf(file, onDragStart),
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ jsx(Thumbnail, {
|
|
309
|
+
file,
|
|
310
|
+
glyph: 24,
|
|
311
|
+
className: "aspect-[4/3] w-full rounded-lg"
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ jsxs("span", {
|
|
314
|
+
className: "flex min-w-0 flex-col px-0.5",
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsx("span", {
|
|
317
|
+
className: "truncate text-caption text-foreground",
|
|
318
|
+
children: file.name
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ jsxs("span", {
|
|
321
|
+
className: "truncate text-micro tabular-nums text-muted-foreground",
|
|
322
|
+
children: [
|
|
323
|
+
bytes(file.size),
|
|
324
|
+
" · ",
|
|
325
|
+
short(now - file.addedAt)
|
|
326
|
+
]
|
|
327
|
+
})
|
|
328
|
+
]
|
|
329
|
+
})
|
|
330
|
+
]
|
|
331
|
+
}, file.id))
|
|
332
|
+
});
|
|
333
|
+
}
|
|
295
334
|
function RecentFilesLeading2({ source = "downloads" }) {
|
|
296
335
|
const Icon = SOURCE_ICON[source];
|
|
297
336
|
return /* @__PURE__ */ jsx(Icon, {
|
|
@@ -346,6 +385,7 @@ var RecentFiles2 = Object.assign(function RecentFiles(props) {
|
|
|
346
385
|
onClear,
|
|
347
386
|
onCancelDownload,
|
|
348
387
|
now: nowProp,
|
|
388
|
+
layout = "fit",
|
|
349
389
|
size,
|
|
350
390
|
className
|
|
351
391
|
} = props;
|
|
@@ -377,6 +417,109 @@ var RecentFiles2 = Object.assign(function RecentFiles(props) {
|
|
|
377
417
|
source,
|
|
378
418
|
className: TILE[step]
|
|
379
419
|
});
|
|
420
|
+
const tabs = /* @__PURE__ */ jsx(Tabs, {
|
|
421
|
+
variant: "subtle",
|
|
422
|
+
size: "compact",
|
|
423
|
+
value: source,
|
|
424
|
+
onValueChange: (v) => setSource(v),
|
|
425
|
+
children: /* @__PURE__ */ jsxs(Tabs.List, {
|
|
426
|
+
className: "-ml-2",
|
|
427
|
+
children: [
|
|
428
|
+
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
429
|
+
value: "downloads",
|
|
430
|
+
label: "Downloads"
|
|
431
|
+
}),
|
|
432
|
+
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
433
|
+
value: "screenshots",
|
|
434
|
+
label: "Screenshots"
|
|
435
|
+
})
|
|
436
|
+
]
|
|
437
|
+
})
|
|
438
|
+
});
|
|
439
|
+
const clear = onClear && !empty && /* @__PURE__ */ jsx(Button, {
|
|
440
|
+
variant: "ghost",
|
|
441
|
+
size: "compact",
|
|
442
|
+
className: "-mr-2 h-6 px-2",
|
|
443
|
+
onClick: () => onClear(source),
|
|
444
|
+
children: "Clear"
|
|
445
|
+
});
|
|
446
|
+
const nothing = /* @__PURE__ */ jsxs("div", {
|
|
447
|
+
className: "flex min-w-0 flex-col gap-0.5",
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ jsx(widget_default.Title, {
|
|
450
|
+
children: source === "downloads" ? "No downloads yet" : "No screenshots yet"
|
|
451
|
+
}),
|
|
452
|
+
/* @__PURE__ */ jsx("span", {
|
|
453
|
+
className: "text-pretty text-caption text-muted-foreground",
|
|
454
|
+
children: source === "downloads" ? "Files you download land here, ready to open or drag out." : "Take one with ⇧⌘4 and it shows up here, ready to drag into a message."
|
|
455
|
+
})
|
|
456
|
+
]
|
|
457
|
+
});
|
|
458
|
+
if (layout === "tall")
|
|
459
|
+
return /* @__PURE__ */ jsxs(widget_default.Sheet, {
|
|
460
|
+
size,
|
|
461
|
+
className,
|
|
462
|
+
children: [
|
|
463
|
+
/* @__PURE__ */ jsxs("div", {
|
|
464
|
+
className: "flex min-w-0 items-center justify-between gap-2",
|
|
465
|
+
children: [
|
|
466
|
+
tabs,
|
|
467
|
+
clear
|
|
468
|
+
]
|
|
469
|
+
}),
|
|
470
|
+
/* @__PURE__ */ jsxs("div", {
|
|
471
|
+
className: "flex min-w-0 items-center gap-6",
|
|
472
|
+
children: [
|
|
473
|
+
active ? /* @__PURE__ */ jsx(Thumbnail, {
|
|
474
|
+
file: active,
|
|
475
|
+
glyph: 40,
|
|
476
|
+
className: SHEET_TILE[step]
|
|
477
|
+
}) : newest ? /* @__PURE__ */ jsx("span", {
|
|
478
|
+
...dragOf(newest, onDragStart),
|
|
479
|
+
className: cn("shrink-0", onDragStart && "cursor-grab"),
|
|
480
|
+
children: /* @__PURE__ */ jsx(Thumbnail, {
|
|
481
|
+
file: newest,
|
|
482
|
+
glyph: 40,
|
|
483
|
+
className: SHEET_TILE[step]
|
|
484
|
+
})
|
|
485
|
+
}) : /* @__PURE__ */ jsx(Empty, {
|
|
486
|
+
source,
|
|
487
|
+
className: SHEET_TILE[step]
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ jsxs("div", {
|
|
490
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
491
|
+
children: [
|
|
492
|
+
header,
|
|
493
|
+
active ? /* @__PURE__ */ jsx(Downloading, {
|
|
494
|
+
download: active,
|
|
495
|
+
onCancel: onCancelDownload
|
|
496
|
+
}) : newest ? /* @__PURE__ */ jsx(Hero, {
|
|
497
|
+
file: newest,
|
|
498
|
+
now,
|
|
499
|
+
props
|
|
500
|
+
}) : nothing
|
|
501
|
+
]
|
|
502
|
+
})
|
|
503
|
+
]
|
|
504
|
+
}),
|
|
505
|
+
earlier.length > 0 && /* @__PURE__ */ jsx(widget_default.Section, {
|
|
506
|
+
label: active ? "Latest" : "Earlier",
|
|
507
|
+
trailing: /* @__PURE__ */ jsx("span", {
|
|
508
|
+
className: "tabular-nums",
|
|
509
|
+
children: earlier.length
|
|
510
|
+
}),
|
|
511
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
512
|
+
className: "pt-1.5",
|
|
513
|
+
children: /* @__PURE__ */ jsx(Grid, {
|
|
514
|
+
files: earlier,
|
|
515
|
+
now,
|
|
516
|
+
onOpen,
|
|
517
|
+
onDragStart
|
|
518
|
+
})
|
|
519
|
+
})
|
|
520
|
+
})
|
|
521
|
+
]
|
|
522
|
+
});
|
|
380
523
|
return /* @__PURE__ */ jsxs(widget_default, {
|
|
381
524
|
size,
|
|
382
525
|
className: cn("h-full", className),
|
|
@@ -387,25 +530,7 @@ var RecentFiles2 = Object.assign(function RecentFiles(props) {
|
|
|
387
530
|
/* @__PURE__ */ jsxs("div", {
|
|
388
531
|
className: "flex min-w-0 items-center justify-between gap-2",
|
|
389
532
|
children: [
|
|
390
|
-
|
|
391
|
-
variant: "subtle",
|
|
392
|
-
size: "compact",
|
|
393
|
-
value: source,
|
|
394
|
-
onValueChange: (v) => setSource(v),
|
|
395
|
-
children: /* @__PURE__ */ jsxs(Tabs.List, {
|
|
396
|
-
className: "-ml-2",
|
|
397
|
-
children: [
|
|
398
|
-
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
399
|
-
value: "downloads",
|
|
400
|
-
label: "Downloads"
|
|
401
|
-
}),
|
|
402
|
-
/* @__PURE__ */ jsx(Tabs.Item, {
|
|
403
|
-
value: "screenshots",
|
|
404
|
-
label: "Screenshots"
|
|
405
|
-
})
|
|
406
|
-
]
|
|
407
|
-
})
|
|
408
|
-
}),
|
|
533
|
+
tabs,
|
|
409
534
|
/* @__PURE__ */ jsxs("span", {
|
|
410
535
|
className: "flex shrink-0 items-center gap-1.5 text-caption tabular-nums text-muted-foreground",
|
|
411
536
|
children: [
|
|
@@ -415,13 +540,7 @@ var RecentFiles2 = Object.assign(function RecentFiles(props) {
|
|
|
415
540
|
" more"
|
|
416
541
|
]
|
|
417
542
|
}),
|
|
418
|
-
|
|
419
|
-
variant: "ghost",
|
|
420
|
-
size: "compact",
|
|
421
|
-
className: "-mr-2 h-6 px-2",
|
|
422
|
-
onClick: () => onClear(source),
|
|
423
|
-
children: "Clear"
|
|
424
|
-
})
|
|
543
|
+
clear
|
|
425
544
|
]
|
|
426
545
|
})
|
|
427
546
|
]
|
|
@@ -450,18 +569,7 @@ var RecentFiles2 = Object.assign(function RecentFiles(props) {
|
|
|
450
569
|
file: newest,
|
|
451
570
|
now,
|
|
452
571
|
props
|
|
453
|
-
}) :
|
|
454
|
-
className: "flex min-w-0 flex-col gap-0.5",
|
|
455
|
-
children: [
|
|
456
|
-
/* @__PURE__ */ jsx(widget_default.Title, {
|
|
457
|
-
children: source === "downloads" ? "No downloads yet" : "No screenshots yet"
|
|
458
|
-
}),
|
|
459
|
-
/* @__PURE__ */ jsx("span", {
|
|
460
|
-
className: "text-pretty text-caption text-muted-foreground",
|
|
461
|
-
children: source === "downloads" ? "Files you download land here, ready to open or drag out." : "Take one with ⇧⌘4 and it shows up here, ready to drag into a message."
|
|
462
|
-
})
|
|
463
|
-
]
|
|
464
|
-
})
|
|
572
|
+
}) : nothing
|
|
465
573
|
]
|
|
466
574
|
});
|
|
467
575
|
}, {
|
|
@@ -42,6 +42,8 @@ type Element_12xgc = JSX_1kxb["Element"];
|
|
|
42
42
|
* at 720 × 240): build each one on the kit's Widget frame, so every tab has
|
|
43
43
|
* one hero set large, a muted line, its facts and quiet actions in the same
|
|
44
44
|
* places.
|
|
45
|
+
* Pulled down to a 560 px sheet the area is about 692 × 476: pass each
|
|
46
|
+
* block `layout="tall"` there, for its fuller view.
|
|
45
47
|
*
|
|
46
48
|
* Pass it as the Island's `expanded`; it reads the notch from the Island.
|
|
47
49
|
* Selection runs through `value` / `onValueChange`, or is kept here from
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetLayout2 } from "./chunk-nqjermbr.js";
|
|
1
2
|
import { JSX as JSX_1kxb } from "react";
|
|
2
3
|
type PomodoroPhase2 = "focus" | "short-break" | "long-break";
|
|
3
4
|
/** A Pomodoro cycle's lengths, in minutes, and how many focus rounds come before the long break. */
|
|
@@ -48,6 +49,10 @@ interface ClockProps2 {
|
|
|
48
49
|
onValueChange?: (run: PomodoroRun2 | null) => void;
|
|
49
50
|
/** Called when a phase reaches zero, with the next one, which waits paused to be started: show `Clock.PhaseDone`. */
|
|
50
51
|
onPhaseEnd?: (ended: PomodoroRun2, next: PomodoroRun2) => void;
|
|
52
|
+
/** The focus rounds finished today, shown at the tall snap as a row of dots and the time focused. Left out, the tall view leaves the line out. */
|
|
53
|
+
completedToday?: number;
|
|
54
|
+
/** `tall` is the open island's tall snap: the time larger, every world clock as a column, the Pomodoro's whole cycle as a strip and its lengths, today's finished rounds; a run lists every phase of its cycle. Defaults to `'fit'`. */
|
|
55
|
+
layout?: WidgetLayout2;
|
|
51
56
|
/** Classes for the root, which fills its container. */
|
|
52
57
|
className?: string;
|
|
53
58
|
}
|
|
@@ -106,6 +111,16 @@ declare function ClockPhaseDone2({ ended, pomodoro, onStart }: ClockPhaseDonePro
|
|
|
106
111
|
* `advancePomodoro` and `resumePomodoro` build the same runs for a host
|
|
107
112
|
* that keeps time itself.
|
|
108
113
|
*
|
|
114
|
+
* At the open island's tall snap (`layout="tall"`) it becomes a sheet: the
|
|
115
|
+
* time and the date as the hero with Start focus beside them; every world
|
|
116
|
+
* clock as a column, the city, the time large, and its day, offset and
|
|
117
|
+
* whether it's day or night there; the Pomodoro's whole cycle as a strip, each phase
|
|
118
|
+
* as long as its minutes in its hue, over its three lengths in columns;
|
|
119
|
+
* and today's finished rounds (`completedToday`) as dots with the time
|
|
120
|
+
* focused. A run puts its ring large beside the time left and the
|
|
121
|
+
* controls, then lists every phase of its cycle, done, now and when each
|
|
122
|
+
* starts, under the strip filling as it goes.
|
|
123
|
+
*
|
|
109
124
|
* The other forms are parts: `Clock.Leading` and `Clock.Trailing` for the
|
|
110
125
|
* compact island's wings (the ring and `mm:ss`, nothing without a run),
|
|
111
126
|
* `Clock.Minimal`, the ring, for the split island's bubble, and
|
|
@@ -114,7 +129,7 @@ declare function ClockPhaseDone2({ ended, pomodoro, onStart }: ClockPhaseDonePro
|
|
|
114
129
|
*
|
|
115
130
|
* @example {@include ./examples.mdx}
|
|
116
131
|
*/
|
|
117
|
-
declare const Clock2: (({ zones, seconds, hour12, timeZone, locale, now: nowProp, pomodoro, value, defaultValue, onValueChange, onPhaseEnd, className }: ClockProps2) => Element_12xgc) & {
|
|
132
|
+
declare const Clock2: (({ zones, seconds, hour12, timeZone, locale, now: nowProp, pomodoro, value, defaultValue, onValueChange, onPhaseEnd, completedToday, layout, className }: ClockProps2) => Element_12xgc) & {
|
|
118
133
|
Leading: typeof ClockLeading2;
|
|
119
134
|
Trailing: typeof ClockTrailing2;
|
|
120
135
|
Minimal: typeof ClockMinimal2;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetLayout2 } from "./chunk-nqjermbr.js";
|
|
1
2
|
import { SizeVariant } from "@justanarthur/modo-ui/lib/size-context";
|
|
2
3
|
import { DragEvent, ReactNode } from "react";
|
|
3
4
|
import { JSX as JSX_1kxb } from "react";
|
|
@@ -59,6 +60,8 @@ interface RecentFilesProps2 {
|
|
|
59
60
|
onCancelDownload?: (download: RecentDownload2) => void;
|
|
60
61
|
/** The moment the times are read at, in epoch ms. Defaults to now, re-read on each minute. */
|
|
61
62
|
now?: number;
|
|
63
|
+
/** `tall` is the open island's tall snap: the switch across the top, the newest file large with its actions, and every earlier file of the folder as a grid of named tiles. Defaults to `'fit'`. */
|
|
64
|
+
layout?: WidgetLayout2;
|
|
62
65
|
/** Step on the size ladder. Omitted, it follows the surrounding SizeProvider. */
|
|
63
66
|
size?: SizeVariant;
|
|
64
67
|
/** Classes for the root, which fills its container. */
|
|
@@ -108,6 +111,15 @@ declare function RecentFilesSaved2({ file, onOpen }: SavedProps): Element_12xgc;
|
|
|
108
111
|
* in, the speed and the time left, and Cancel. An empty folder says what
|
|
109
112
|
* will land in it, the switch still beside it.
|
|
110
113
|
*
|
|
114
|
+
* At the open island's tall snap (`layout="tall"`) it becomes a sheet:
|
|
115
|
+
* the switch and Clear across the top; the newest file (or the download
|
|
116
|
+
* under way) large beside its name, its facts and its actions; then every
|
|
117
|
+
* earlier file of the folder, not three, as a grid five across, each tile
|
|
118
|
+
* its thumbnail or its type's glyph over its name, its size and how long
|
|
119
|
+
* ago it landed. Downloads and screenshots read alike there, since a tile
|
|
120
|
+
* has room for both the look and the name; the grid scrolls with the
|
|
121
|
+
* island, and every tile opens on a press and drags out like the rows.
|
|
122
|
+
*
|
|
111
123
|
* `RecentFiles.Leading` and `RecentFiles.Trailing` show the glyph and the
|
|
112
124
|
* download's progress (or the count of new files) in the compact island's
|
|
113
125
|
* wings, `RecentFiles.Minimal` the progress as a ring in the split
|