@justanarthur/modo-ui-notch 0.2.0 → 0.4.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.
Files changed (148) hide show
  1. package/README.md +11 -11
  2. package/blocks/activities/agenda/examples.mdx +29 -5
  3. package/blocks/activities/agenda/index.tsx +438 -181
  4. package/blocks/activities/clock/examples.mdx +89 -0
  5. package/blocks/activities/clock/index.tsx +917 -0
  6. package/blocks/activities/now-playing/examples.mdx +40 -13
  7. package/blocks/activities/now-playing/index.tsx +399 -120
  8. package/blocks/activities/weather/examples.mdx +123 -0
  9. package/blocks/activities/weather/index.tsx +863 -0
  10. package/blocks/app/expanded-island/examples.mdx +8 -7
  11. package/blocks/app/expanded-island/index.tsx +22 -4
  12. package/blocks/app/settings-window/examples.mdx +14 -2
  13. package/blocks/app/settings-window/index.tsx +33 -10
  14. package/blocks/system/clipboard/examples.mdx +91 -0
  15. package/blocks/system/clipboard/index.tsx +773 -0
  16. package/blocks/system/recent-files/examples.mdx +80 -0
  17. package/blocks/system/recent-files/index.tsx +627 -0
  18. package/blocks/system/system-stats/examples.mdx +46 -9
  19. package/blocks/system/system-stats/index.tsx +445 -104
  20. package/components/indicators/media-scrubber/examples.mdx +8 -0
  21. package/components/indicators/media-scrubber/index.tsx +37 -13
  22. package/components/island/island/examples.mdx +4 -4
  23. package/components/island/island/index.tsx +2 -2
  24. package/components/island/island-flash/examples.mdx +15 -18
  25. package/components/island/island-flash/index.tsx +4 -4
  26. package/components/island/island-tabs/examples.mdx +5 -5
  27. package/components/island/widget/examples.mdx +76 -0
  28. package/components/island/widget/index.tsx +465 -0
  29. package/dist/blocks/activities/agenda/index.d.ts +2 -1
  30. package/dist/blocks/activities/agenda/index.js +3 -3
  31. package/dist/blocks/activities/clock/index.d.ts +3 -0
  32. package/dist/blocks/activities/clock/index.js +25 -0
  33. package/dist/blocks/activities/now-playing/index.d.ts +4 -2
  34. package/dist/blocks/activities/now-playing/index.js +5 -3
  35. package/dist/blocks/activities/weather/index.d.ts +3 -0
  36. package/dist/blocks/activities/weather/index.js +21 -0
  37. package/dist/blocks/app/expanded-island/index.d.ts +1 -1
  38. package/dist/blocks/app/expanded-island/index.js +4 -3
  39. package/dist/blocks/app/settings-window/index.d.ts +1 -1
  40. package/dist/blocks/app/settings-window/index.js +1 -1
  41. package/dist/blocks/system/clipboard/index.d.ts +3 -0
  42. package/dist/blocks/system/clipboard/index.js +17 -0
  43. package/dist/blocks/system/recent-files/index.d.ts +3 -0
  44. package/dist/blocks/system/recent-files/index.js +19 -0
  45. package/dist/blocks/system/system-stats/index.d.ts +3 -2
  46. package/dist/blocks/system/system-stats/index.js +4 -1
  47. package/dist/components/indicators/media-scrubber/index.d.ts +1 -1
  48. package/dist/components/indicators/media-scrubber/index.js +1 -1
  49. package/dist/components/island/island/index.d.ts +1 -1
  50. package/dist/components/island/island/index.js +2 -2
  51. package/dist/components/island/island-flash/index.d.ts +1 -1
  52. package/dist/components/island/island-flash/index.js +1 -1
  53. package/dist/components/island/island-tabs/index.js +2 -2
  54. package/dist/components/island/widget/index.d.ts +2 -0
  55. package/dist/components/island/widget/index.js +32 -0
  56. package/dist/index.d.ts +15 -15
  57. package/dist/index.js +104 -58
  58. package/dist/lib/artwork.d.ts +2 -0
  59. package/dist/lib/artwork.js +8 -0
  60. package/dist/lib/geometry.js +1 -1
  61. package/dist/shared/{chunk-yngkkxz2.d.ts → chunk-0ym9mcqc.d.ts} +10 -6
  62. package/dist/shared/chunk-2b6gpn8k.js +444 -0
  63. package/dist/shared/chunk-3hcnf4yx.js +481 -0
  64. package/dist/shared/chunk-42wab62s.d.ts +197 -0
  65. package/dist/shared/{chunk-zvh0d3qb.js → chunk-61t2dfte.js} +1 -1
  66. package/dist/shared/{chunk-9nhpg9t8.d.ts → chunk-6tnq6p89.d.ts} +9 -1
  67. package/dist/shared/{chunk-hpsabfsd.d.ts → chunk-81fpptwp.d.ts} +1 -1
  68. package/dist/shared/chunk-93dtpjz7.js +789 -0
  69. package/dist/shared/{chunk-wwjxs75m.js → chunk-9xtcv3sy.js} +26 -12
  70. package/dist/shared/chunk-a6njb8db.d.ts +129 -0
  71. package/dist/shared/chunk-ab8mdg0n.d.ts +149 -0
  72. package/dist/shared/chunk-evqpf92s.d.ts +168 -0
  73. package/dist/shared/{chunk-6c1jbefs.d.ts → chunk-fexwzycv.d.ts} +3 -3
  74. package/dist/shared/chunk-gcyspvgr.js +582 -0
  75. package/dist/shared/chunk-gejenfap.d.ts +25 -0
  76. package/dist/shared/chunk-gkj0hjrn.d.ts +136 -0
  77. package/dist/shared/{chunk-rr5e0g15.d.ts → chunk-j755a1a5.d.ts} +7 -1
  78. package/dist/shared/chunk-n739am8j.d.ts +112 -0
  79. package/dist/shared/{chunk-78w7qwp0.js → chunk-ndf79pv5.js} +1 -1
  80. package/dist/shared/chunk-nwzpekvy.js +774 -0
  81. package/dist/shared/{chunk-rpfwv3pz.js → chunk-r471sknr.js} +1 -1
  82. package/dist/shared/chunk-sbrtesdg.d.ts +138 -0
  83. package/dist/shared/chunk-swc7dqpw.d.ts +115 -0
  84. package/dist/shared/chunk-t9wqhgzt.js +765 -0
  85. package/dist/shared/chunk-w5h6ay93.js +72 -0
  86. package/dist/shared/{chunk-mp1nx0ez.js → chunk-wayv5rhr.js} +15 -4
  87. package/dist/shared/chunk-wf0jtzhs.js +295 -0
  88. package/dist/shared/{chunk-sbnrhy5m.js → chunk-y0188bbn.js} +2 -2
  89. package/dist/shared/chunk-yq5svpk7.js +524 -0
  90. package/dist/shared/{chunk-s33y1pcq.js → chunk-z3tj1ydg.js} +23 -10
  91. package/dist/styles.css +151 -49
  92. package/index.ts +7 -6
  93. package/lib/artwork.ts +112 -0
  94. package/lib/geometry.ts +1 -1
  95. package/mock/activities.tsx +9 -32
  96. package/mock/artwork.tsx +13 -1
  97. package/mock/clipboard.tsx +113 -0
  98. package/mock/clock.tsx +77 -0
  99. package/mock/data.ts +78 -44
  100. package/mock/files.tsx +83 -0
  101. package/mock/island-content.tsx +79 -122
  102. package/mock/screen.tsx +76 -0
  103. package/mock/settings.tsx +370 -91
  104. package/mock/system.ts +49 -0
  105. package/mock/weather.tsx +135 -0
  106. package/package.json +7 -2
  107. package/blocks/activities/shelf/examples.mdx +0 -33
  108. package/blocks/activities/shelf/index.tsx +0 -289
  109. package/blocks/activities/timer/examples.mdx +0 -52
  110. package/blocks/activities/timer/index.tsx +0 -292
  111. package/blocks/system/controls/examples.mdx +0 -34
  112. package/blocks/system/controls/index.tsx +0 -167
  113. package/blocks/system/devices/examples.mdx +0 -25
  114. package/blocks/system/devices/index.tsx +0 -172
  115. package/blocks/system/power-alert/examples.mdx +0 -32
  116. package/blocks/system/power-alert/index.tsx +0 -89
  117. package/components/indicators/battery-glyph/examples.mdx +0 -22
  118. package/components/indicators/battery-glyph/index.tsx +0 -91
  119. package/dist/blocks/activities/shelf/index.d.ts +0 -2
  120. package/dist/blocks/activities/shelf/index.js +0 -14
  121. package/dist/blocks/activities/timer/index.d.ts +0 -2
  122. package/dist/blocks/activities/timer/index.js +0 -19
  123. package/dist/blocks/system/controls/index.d.ts +0 -2
  124. package/dist/blocks/system/controls/index.js +0 -10
  125. package/dist/blocks/system/devices/index.d.ts +0 -2
  126. package/dist/blocks/system/devices/index.js +0 -12
  127. package/dist/blocks/system/power-alert/index.d.ts +0 -2
  128. package/dist/blocks/system/power-alert/index.js +0 -9
  129. package/dist/components/indicators/battery-glyph/index.d.ts +0 -2
  130. package/dist/components/indicators/battery-glyph/index.js +0 -9
  131. package/dist/shared/chunk-2qpcsv5h.d.ts +0 -45
  132. package/dist/shared/chunk-45gytfr1.d.ts +0 -84
  133. package/dist/shared/chunk-50ffk4r7.d.ts +0 -69
  134. package/dist/shared/chunk-5w0yck07.d.ts +0 -32
  135. package/dist/shared/chunk-7hr53mby.js +0 -116
  136. package/dist/shared/chunk-b8jb1w72.js +0 -145
  137. package/dist/shared/chunk-cpewy6yg.js +0 -178
  138. package/dist/shared/chunk-e3e4s4ds.d.ts +0 -77
  139. package/dist/shared/chunk-enm6td0p.js +0 -280
  140. package/dist/shared/chunk-fvedaas2.d.ts +0 -33
  141. package/dist/shared/chunk-gex38j8x.d.ts +0 -82
  142. package/dist/shared/chunk-hwtxpzg0.js +0 -69
  143. package/dist/shared/chunk-phb53x1f.js +0 -252
  144. package/dist/shared/chunk-r8esmjfs.d.ts +0 -42
  145. package/dist/shared/chunk-rcp1g9ca.js +0 -70
  146. package/dist/shared/chunk-rx9sphz2.js +0 -266
  147. package/dist/shared/chunk-xdeek16r.d.ts +0 -58
  148. package/dist/shared/chunk-xkzjk1tq.js +0 -206
@@ -0,0 +1,444 @@
1
+ "use client";
2
+
3
+ import {
4
+ Equalizer2
5
+ } from "./chunk-2f7zxrbk.js";
6
+ import {
7
+ MediaScrubber2
8
+ } from "./chunk-9xtcv3sy.js";
9
+ import {
10
+ IslandFlash2
11
+ } from "./chunk-ndf79pv5.js";
12
+ import {
13
+ widget_default
14
+ } from "./chunk-wf0jtzhs.js";
15
+ import {
16
+ useStableArtwork2,
17
+ useArtworkTint2
18
+ } from "./chunk-w5h6ay93.js";
19
+
20
+ // blocks/activities/now-playing/index.tsx
21
+ import { useReduceMotion } from "@justanarthur/modo-ui/lib/reduced-motion";
22
+ import { useSize } from "@justanarthur/modo-ui/lib/size-context";
23
+ import { spring } from "@justanarthur/modo-ui/lib/springs";
24
+ import { SURFACE_BG } from "@justanarthur/modo-ui/lib/surface-classes";
25
+ import { useLift } from "@justanarthur/modo-ui/lib/surface-context";
26
+ import { useControllableState } from "@justanarthur/modo-ui/lib/use-controllable-state";
27
+ import { cn } from "@justanarthur/modo-ui/lib/utils";
28
+ import {
29
+ Airplay,
30
+ Disc3,
31
+ Headphones,
32
+ Heart,
33
+ Laptop,
34
+ Music,
35
+ Pause,
36
+ Play,
37
+ Repeat,
38
+ Repeat1,
39
+ Shuffle,
40
+ SkipBack,
41
+ SkipForward,
42
+ Speaker
43
+ } from "lucide-react";
44
+ import { motion } from "motion/react";
45
+ import { useState } from "react";
46
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
47
+ /*!
48
+ * Local addition: what's playing, in every form a notch app shows it.
49
+ * Rebuilt from Just Notch's now-playing plugin (`Player`, `Artwork`,
50
+ * `TrackFlash`) as presentational parts: the track and the commands come in
51
+ * as props.
52
+ */
53
+ var OUTPUT_LABEL = {
54
+ "built-in": "Built-in speakers",
55
+ headphones: "Headphones",
56
+ speaker: "Speaker",
57
+ airplay: "AirPlay"
58
+ };
59
+ var OUTPUT_ICON = { "built-in": Laptop, headphones: Headphones, speaker: Speaker, airplay: Airplay };
60
+ var NEXT_REPEAT = { off: "all", all: "one", one: "off" };
61
+ var REPEAT_LABEL = {
62
+ off: "Repeat",
63
+ all: "Repeat all",
64
+ one: "Repeat one"
65
+ };
66
+ var keyOf = (track) => track ? track.id ?? [track.title, track.artist, track.album].join("\x00") : "";
67
+ function useTint(track) {
68
+ const read = useArtworkTint2(track?.tint || typeof track?.artwork !== "string" ? undefined : track.artwork);
69
+ return track?.tint ?? read;
70
+ }
71
+ function Picture({ art, glyph }) {
72
+ const level = useLift(1);
73
+ if (typeof art === "string")
74
+ return /* @__PURE__ */ jsx("img", {
75
+ alt: "",
76
+ src: art,
77
+ draggable: false,
78
+ className: "size-full object-cover"
79
+ });
80
+ if (art != null)
81
+ return art;
82
+ return /* @__PURE__ */ jsx("span", {
83
+ className: cn("flex size-full items-center justify-center text-muted-foreground", SURFACE_BG[level]),
84
+ children: /* @__PURE__ */ jsx(Music, {
85
+ size: glyph,
86
+ strokeWidth: 1.5
87
+ })
88
+ });
89
+ }
90
+ function NowPlayingArtwork2({ track, glyph = 14, className }) {
91
+ const shown = useStableArtwork2(track?.artwork, keyOf(track));
92
+ const reduced = useReduceMotion();
93
+ const [top, setTop] = useState(shown);
94
+ const [under, setUnder] = useState(null);
95
+ if (top.id !== shown.id) {
96
+ setUnder(top);
97
+ setTop(shown);
98
+ }
99
+ return /* @__PURE__ */ jsxs("span", {
100
+ className: cn("relative isolate block shrink-0 overflow-hidden", className),
101
+ children: [
102
+ under && /* @__PURE__ */ jsx("span", {
103
+ className: "absolute inset-0",
104
+ children: /* @__PURE__ */ jsx(Picture, {
105
+ art: under.art,
106
+ glyph
107
+ })
108
+ }, under.id),
109
+ /* @__PURE__ */ jsx(motion.span, {
110
+ className: "absolute inset-0",
111
+ initial: under ? { opacity: 0 } : false,
112
+ animate: { opacity: 1 },
113
+ transition: reduced ? spring.fast : spring.slow,
114
+ onAnimationComplete: () => setUnder(null),
115
+ children: /* @__PURE__ */ jsx(Picture, {
116
+ art: shown.art,
117
+ glyph
118
+ })
119
+ }, shown.id),
120
+ /* @__PURE__ */ jsx("span", {
121
+ "aria-hidden": true,
122
+ className: "pointer-events-none absolute inset-0 rounded-[inherit] ring-1 ring-border ring-inset"
123
+ })
124
+ ]
125
+ });
126
+ }
127
+ function TintedBars({ track, playing = true, className }) {
128
+ const tint = useTint(track);
129
+ return /* @__PURE__ */ jsx("span", {
130
+ className: cn("inline-flex text-foreground", className),
131
+ style: tint ? { color: tint } : undefined,
132
+ children: /* @__PURE__ */ jsx(Equalizer2, {
133
+ playing,
134
+ label: playing ? "Playing" : "Paused",
135
+ barClassName: "bg-current"
136
+ })
137
+ });
138
+ }
139
+ function NowPlayingLeading2({ track }) {
140
+ return /* @__PURE__ */ jsx(NowPlayingArtwork2, {
141
+ track,
142
+ glyph: 12,
143
+ className: "size-5.5 rounded-md"
144
+ });
145
+ }
146
+ function NowPlayingTrailing2(props) {
147
+ return /* @__PURE__ */ jsx(TintedBars, {
148
+ ...props
149
+ });
150
+ }
151
+ function NowPlayingMinimal2({ track }) {
152
+ return /* @__PURE__ */ jsx(NowPlayingArtwork2, {
153
+ track,
154
+ glyph: 12,
155
+ className: "size-6 rounded-full"
156
+ });
157
+ }
158
+ function NowPlayingFlash2({ track, playing = true }) {
159
+ return /* @__PURE__ */ jsx(IslandFlash2, {
160
+ icon: /* @__PURE__ */ jsx(NowPlayingArtwork2, {
161
+ track,
162
+ className: "size-9 rounded-lg"
163
+ }),
164
+ title: track.title || "Unknown title",
165
+ caption: [track.artist, track.album].filter(Boolean).join(" — ") || track.source,
166
+ trailing: /* @__PURE__ */ jsx(TintedBars, {
167
+ track,
168
+ playing
169
+ })
170
+ });
171
+ }
172
+ var ART = { default: "size-36 rounded-2xl", compact: "size-28 rounded-xl" };
173
+ var SHEET_ART = { default: "size-52 rounded-3xl", compact: "size-44 rounded-2xl" };
174
+ var SHEET_TITLE = { default: "text-display", compact: "text-display-compact" };
175
+ function Glow({ tint, children }) {
176
+ return /* @__PURE__ */ jsxs("span", {
177
+ className: "relative flex",
178
+ children: [
179
+ tint && /* @__PURE__ */ jsx("span", {
180
+ "aria-hidden": true,
181
+ className: "absolute -inset-x-8 -inset-y-4 -z-1 opacity-70",
182
+ style: { backgroundImage: `radial-gradient(closest-side, ${tint}, transparent)` }
183
+ }),
184
+ children
185
+ ]
186
+ });
187
+ }
188
+ var NowPlaying2 = Object.assign(function NowPlaying({
189
+ track,
190
+ playing: playingProp,
191
+ defaultPlaying = true,
192
+ onPlayingChange,
193
+ onPrevious,
194
+ onNext,
195
+ onSeek,
196
+ shuffle: shuffleProp,
197
+ defaultShuffle,
198
+ onShuffleChange,
199
+ repeat: repeatProp,
200
+ defaultRepeat,
201
+ onRepeatChange,
202
+ liked: likedProp,
203
+ defaultLiked,
204
+ onLikedChange,
205
+ emptyDescription = "Play something in Music, Spotify or a browser and it shows up here.",
206
+ emptyActions,
207
+ layout = "fit",
208
+ className
209
+ }) {
210
+ const size = useSize();
211
+ const [playing, setPlaying] = useControllableState(playingProp, defaultPlaying, onPlayingChange);
212
+ const [shuffle, setShuffle] = useControllableState(shuffleProp, defaultShuffle ?? false, onShuffleChange);
213
+ const [repeat, setRepeat] = useControllableState(repeatProp, defaultRepeat ?? "off", onRepeatChange);
214
+ const [liked, setLiked] = useControllableState(likedProp, defaultLiked ?? false, onLikedChange);
215
+ const tint = useTint(track);
216
+ if (!track)
217
+ return /* @__PURE__ */ jsx(widget_default.Message, {
218
+ icon: Music,
219
+ title: "Nothing playing",
220
+ description: emptyDescription,
221
+ actions: emptyActions,
222
+ className
223
+ });
224
+ const showShuffle = shuffleProp !== undefined || defaultShuffle !== undefined || onShuffleChange !== undefined;
225
+ const showRepeat = repeatProp !== undefined || defaultRepeat !== undefined || onRepeatChange !== undefined;
226
+ const showLiked = likedProp !== undefined || defaultLiked !== undefined || onLikedChange !== undefined;
227
+ const byline = [track.artist, track.album].filter(Boolean).join(" — ");
228
+ const toggles = /* @__PURE__ */ jsxs(Fragment, {
229
+ children: [
230
+ showShuffle && /* @__PURE__ */ jsx(widget_default.Action, {
231
+ icon: Shuffle,
232
+ label: "Shuffle",
233
+ pressed: shuffle,
234
+ color: tint,
235
+ onClick: () => setShuffle(!shuffle)
236
+ }),
237
+ showRepeat && /* @__PURE__ */ jsx(widget_default.Action, {
238
+ icon: repeat === "one" ? Repeat1 : Repeat,
239
+ label: REPEAT_LABEL[repeat],
240
+ pressed: repeat !== "off",
241
+ color: tint,
242
+ onClick: () => setRepeat(NEXT_REPEAT[repeat])
243
+ }),
244
+ showLiked && /* @__PURE__ */ jsx(widget_default.Action, {
245
+ icon: Heart,
246
+ label: liked ? "Remove from library" : "Add to library",
247
+ pressed: liked,
248
+ filled: liked,
249
+ color: tint,
250
+ onClick: () => setLiked(!liked)
251
+ })
252
+ ]
253
+ });
254
+ const transport = /* @__PURE__ */ jsxs("div", {
255
+ className: "flex items-center gap-1",
256
+ children: [
257
+ /* @__PURE__ */ jsx(widget_default.Action, {
258
+ icon: SkipBack,
259
+ label: "Previous",
260
+ filled: true,
261
+ onClick: onPrevious
262
+ }),
263
+ /* @__PURE__ */ jsx(widget_default.Action, {
264
+ icon: playing ? Pause : Play,
265
+ label: playing ? "Pause" : "Play",
266
+ emphasis: "primary",
267
+ filled: true,
268
+ onClick: () => setPlaying(!playing)
269
+ }),
270
+ /* @__PURE__ */ jsx(widget_default.Action, {
271
+ icon: SkipForward,
272
+ label: "Next",
273
+ filled: true,
274
+ onClick: onNext
275
+ })
276
+ ]
277
+ });
278
+ const OutputIcon = OUTPUT_ICON[track.outputKind ?? "built-in"];
279
+ if (layout === "tall")
280
+ return /* @__PURE__ */ jsxs(widget_default.Sheet, {
281
+ className: cn("relative isolate", className),
282
+ children: [
283
+ /* @__PURE__ */ jsxs("div", {
284
+ className: "flex min-w-0 items-center gap-6",
285
+ children: [
286
+ /* @__PURE__ */ jsx(Glow, {
287
+ tint,
288
+ children: /* @__PURE__ */ jsx(NowPlayingArtwork2, {
289
+ track,
290
+ glyph: 40,
291
+ className: SHEET_ART[size.variant]
292
+ })
293
+ }),
294
+ /* @__PURE__ */ jsxs("div", {
295
+ className: "flex min-w-0 flex-1 flex-col gap-1",
296
+ children: [
297
+ /* @__PURE__ */ jsx(widget_default.Header, {
298
+ icon: Disc3,
299
+ trailing: /* @__PURE__ */ jsx(TintedBars, {
300
+ track,
301
+ playing
302
+ }),
303
+ children: track.source ?? "Now playing"
304
+ }),
305
+ /* @__PURE__ */ jsx("span", {
306
+ className: cn("line-clamp-2 weight-bold text-foreground text-balance", SHEET_TITLE[size.variant]),
307
+ children: track.title || "Unknown title"
308
+ }),
309
+ track.artist && /* @__PURE__ */ jsx("span", {
310
+ className: "truncate text-title text-foreground",
311
+ children: track.artist
312
+ }),
313
+ track.album && /* @__PURE__ */ jsx(widget_default.Subtitle, {
314
+ children: track.album
315
+ })
316
+ ]
317
+ })
318
+ ]
319
+ }),
320
+ /* @__PURE__ */ jsxs("div", {
321
+ className: "flex flex-col gap-2",
322
+ children: [
323
+ track.duration > 0 && /* @__PURE__ */ jsx(MediaScrubber2, {
324
+ position: track.position,
325
+ duration: track.duration,
326
+ playing,
327
+ onSeek
328
+ }),
329
+ /* @__PURE__ */ jsxs("div", {
330
+ className: "grid grid-cols-[1fr_auto_1fr] items-center gap-2",
331
+ children: [
332
+ /* @__PURE__ */ jsx("span", {}),
333
+ transport,
334
+ /* @__PURE__ */ jsx("div", {
335
+ className: "flex items-center justify-end",
336
+ children: toggles
337
+ })
338
+ ]
339
+ })
340
+ ]
341
+ }),
342
+ (track.source || track.output) && /* @__PURE__ */ jsxs(widget_default.Section, {
343
+ label: "Playing",
344
+ children: [
345
+ track.source && /* @__PURE__ */ jsx(widget_default.Row, {
346
+ trailing: /* @__PURE__ */ jsx(Disc3, {
347
+ size: 14,
348
+ strokeWidth: 1.5
349
+ }),
350
+ leading: "From",
351
+ children: track.source
352
+ }),
353
+ track.output && /* @__PURE__ */ jsx(widget_default.Row, {
354
+ leading: "On",
355
+ trailing: /* @__PURE__ */ jsxs(Fragment, {
356
+ children: [
357
+ /* @__PURE__ */ jsx(OutputIcon, {
358
+ size: 14,
359
+ strokeWidth: 1.5
360
+ }),
361
+ OUTPUT_LABEL[track.outputKind ?? "built-in"]
362
+ ]
363
+ }),
364
+ children: track.output
365
+ })
366
+ ]
367
+ })
368
+ ]
369
+ });
370
+ return /* @__PURE__ */ jsx("div", {
371
+ className: cn("relative isolate flex w-full flex-col justify-center", className),
372
+ children: /* @__PURE__ */ jsxs(widget_default, {
373
+ media: /* @__PURE__ */ jsx(Glow, {
374
+ tint,
375
+ children: /* @__PURE__ */ jsx(NowPlayingArtwork2, {
376
+ track,
377
+ glyph: 28,
378
+ className: ART[size.variant]
379
+ })
380
+ }),
381
+ children: [
382
+ /* @__PURE__ */ jsxs("div", {
383
+ className: "flex min-w-0 items-start gap-3",
384
+ children: [
385
+ /* @__PURE__ */ jsxs("div", {
386
+ className: "flex min-w-0 flex-1 flex-col",
387
+ children: [
388
+ /* @__PURE__ */ jsx(widget_default.Title, {
389
+ children: track.title || "Unknown title"
390
+ }),
391
+ byline && /* @__PURE__ */ jsx(widget_default.Subtitle, {
392
+ children: byline
393
+ })
394
+ ]
395
+ }),
396
+ /* @__PURE__ */ jsx(TintedBars, {
397
+ track,
398
+ playing,
399
+ className: "mt-1.5"
400
+ })
401
+ ]
402
+ }),
403
+ track.duration > 0 && /* @__PURE__ */ jsx(MediaScrubber2, {
404
+ className: "mt-2",
405
+ quiet: true,
406
+ position: track.position,
407
+ duration: track.duration,
408
+ playing,
409
+ onSeek
410
+ }),
411
+ /* @__PURE__ */ jsxs("div", {
412
+ className: "grid grid-cols-[1fr_auto_1fr] items-center gap-2",
413
+ children: [
414
+ /* @__PURE__ */ jsxs(widget_default.Meta, {
415
+ children: [
416
+ track.source && /* @__PURE__ */ jsx(widget_default.MetaItem, {
417
+ icon: Disc3,
418
+ children: track.source
419
+ }),
420
+ track.output && /* @__PURE__ */ jsx(widget_default.MetaItem, {
421
+ icon: OutputIcon,
422
+ children: track.output
423
+ })
424
+ ]
425
+ }),
426
+ transport,
427
+ /* @__PURE__ */ jsx("div", {
428
+ className: "flex items-center justify-end",
429
+ children: toggles
430
+ })
431
+ ]
432
+ })
433
+ ]
434
+ })
435
+ });
436
+ }, {
437
+ Artwork: NowPlayingArtwork2,
438
+ Leading: NowPlayingLeading2,
439
+ Trailing: NowPlayingTrailing2,
440
+ Minimal: NowPlayingMinimal2,
441
+ Flash: NowPlayingFlash2
442
+ });
443
+ var now_playing_default = NowPlaying2;
444
+ export { NowPlayingArtwork2, NowPlayingLeading2, NowPlayingTrailing2, NowPlayingMinimal2, NowPlayingFlash2, NowPlaying2, now_playing_default };