@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
@@ -1,17 +1,18 @@
1
1
  import ExpandedIsland from './index'
2
2
  import Island from '../../../components/island/island'
3
3
  import NowPlaying from '../../activities/now-playing'
4
- import Timer from '../../activities/timer'
4
+ import Weather from '../../activities/weather'
5
5
  import Agenda from '../../activities/agenda'
6
6
  import { ExpandedPanel, PLAYING, ScreenEdge } from '../../../mock/island-content'
7
7
  import { AGENDA_NOW, EVENTS } from '../../../mock/data'
8
- import { CalendarDays, Music, Timer as TimerIcon } from 'lucide-react'
8
+ import { FORECAST } from '../../../mock/weather'
9
+ import { CalendarDays, CloudSun, Music } from 'lucide-react'
9
10
 
10
11
  # Every widget
11
12
 
12
13
  Tabs in the wings around the notch, settings at the far right; hover a tab to preview its title.
13
14
 
14
- <ScreenEdge height={340}>
15
+ <ScreenEdge height={260}>
15
16
  <Island defaultState="expanded" collapsedState="idle" expanded={<ExpandedPanel />} />
16
17
  </ScreenEdge>
17
18
 
@@ -19,7 +20,7 @@ Tabs in the wings around the notch, settings at the far right; hover a tab to pr
19
20
 
20
21
  `tabs` takes each tab's icon, label and view.
21
22
 
22
- <ScreenEdge height={340}>
23
+ <ScreenEdge height={260}>
23
24
  <Island
24
25
  defaultState="expanded"
25
26
  collapsedState="idle"
@@ -28,8 +29,8 @@ Tabs in the wings around the notch, settings at the far right; hover a tab to pr
28
29
  defaultValue="calendar"
29
30
  tabs={[
30
31
  { value: 'music', label: 'Now Playing', icon: Music, content: <NowPlaying track={PLAYING} /> },
31
- { value: 'timer', label: 'Timer', icon: TimerIcon, content: <Timer /> },
32
32
  { value: 'calendar', label: 'Calendar', icon: CalendarDays, content: <Agenda events={EVENTS} now={AGENDA_NOW} /> },
33
+ { value: 'weather', label: 'Weather', icon: CloudSun, content: <Weather {...FORECAST} /> },
33
34
  ]}
34
35
  />
35
36
  }
@@ -40,6 +41,6 @@ Tabs in the wings around the notch, settings at the far right; hover a tab to pr
40
41
 
41
42
  The content area keeps its height and scrolls a taller view, its edges fading.
42
43
 
43
- <ScreenEdge height={260}>
44
- <Island defaultState="expanded" collapsedState="idle" panelHeight={240} expanded={<ExpandedPanel defaultTab="calendar" />} />
44
+ <ScreenEdge height={220}>
45
+ <Island defaultState="expanded" collapsedState="idle" panelHeight={196} expanded={<ExpandedPanel defaultTab="calendar" />} />
45
46
  </ScreenEdge>
@@ -8,15 +8,18 @@
8
8
  'use client'
9
9
 
10
10
  import Button from '@justanarthur/modo-ui/components/actions/button'
11
+ import { useReduceMotion } from '@justanarthur/modo-ui/lib/reduced-motion'
11
12
  import { useControllableState } from '@justanarthur/modo-ui/lib/use-controllable-state'
12
13
  import { cn } from '@justanarthur/modo-ui/lib/utils'
13
14
  import ScrollArea from '@justanarthur/modo-ui/primitives/layout/scroll-area'
14
15
  import { SizeProvider } from '@justanarthur/modo-ui/primitives/systems/sizes'
15
16
  import { Settings } from 'lucide-react'
17
+ import { motion } from 'motion/react'
16
18
  import { type ReactNode, useState } from 'react'
17
19
  import IslandTabs, { type IslandTab } from '../../../components/island/island-tabs'
18
20
  import { DEFAULT_NOTCH, INSET } from '../../../lib/geometry'
19
21
  import { useIsland } from '../../../lib/island-context'
22
+ import { contentEnter, contentHidden, contentShown } from '../../../lib/motion'
20
23
 
21
24
  interface ExpandedIslandTab extends IslandTab {
22
25
  /** The tab's view, in the content area. */
@@ -52,9 +55,17 @@ interface ExpandedIslandProps {
52
55
  * the selected tab's title, or the hovered tab's as a preview. The view
53
56
  * fills the rest: the area keeps its height whatever the view holds, and a
54
57
  * taller view scrolls inside it, its edges fading with `scroll-fade` (a
55
- * modo-ui ScrollArea), back at the top on each new tab. Every part starts at
58
+ * modo-ui ScrollArea), back at the top on each new tab, where the new view
59
+ * sharpens in the way the island swaps its content. Every part starts at
56
60
  * the island's one inset, clear of its rounded bottom corners.
57
61
  *
62
+ * The views are made for the area the default panel leaves (about 680 × 165
63
+ * at 720 × 240): build each one on the kit's Widget frame, so every tab has
64
+ * one hero set large, a muted line, its facts and quiet actions in the same
65
+ * places.
66
+ * Pulled down to a 560 px sheet the area is about 692 × 476: pass each
67
+ * block `layout="tall"` there, for its fuller view.
68
+ *
58
69
  * Pass it as the Island's `expanded`; it reads the notch from the Island.
59
70
  * Selection runs through `value` / `onValueChange`, or is kept here from
60
71
  * `defaultValue`.
@@ -77,6 +88,7 @@ export default function ExpandedIsland({
77
88
  const tab = tabs.find(t => t.value === value) ?? tabs[0]
78
89
  const title = tabs.find(t => t.value === hovered)?.label ?? tab?.label
79
90
  const notch = island?.geometry.notch.height ?? DEFAULT_NOTCH.height
91
+ const reduced = useReduceMotion()
80
92
 
81
93
  return (
82
94
  <div className={cn('flex size-full flex-col', className)}>
@@ -108,15 +120,21 @@ export default function ExpandedIsland({
108
120
  <ScrollArea
109
121
  key={tab?.value}
110
122
  className="min-h-0 flex-1"
111
- viewportClassName="scroll-fade [&>div]:flex [&>div]:min-h-full [&>div]:flex-col"
123
+ viewportClassName="scroll-fade [&>div]:flex [&>div]:min-h-full [&>div]:flex-col [&>div]:!min-w-0"
112
124
  >
113
- <div className="flex flex-1 flex-col py-1 [&>*]:flex-1" style={{ paddingInline: INSET }}>
125
+ <motion.div
126
+ className="flex flex-1 flex-col py-1 [&>*]:flex-1"
127
+ style={{ paddingInline: INSET }}
128
+ initial={reduced ? { opacity: 0 } : contentHidden}
129
+ animate={reduced ? { opacity: 1 } : contentShown}
130
+ transition={contentEnter}
131
+ >
114
132
  {tab ? (
115
133
  tab.content
116
134
  ) : (
117
135
  <div className="flex items-center justify-center text-caption text-muted-foreground">{empty}</div>
118
136
  )}
119
- </div>
137
+ </motion.div>
120
138
  </ScrollArea>
121
139
  </div>
122
140
  </div>
@@ -11,8 +11,10 @@ General, Plugins, Permissions and About, then a page per plugin's settings.
11
11
 
12
12
  # Plugins
13
13
 
14
+ A switch per plugin, and a chevron to the page of one that brings settings.
15
+
14
16
  <MockWindow title="Settings">
15
- <SettingsWindow name="Just Notch" defaultValue="plugins" plugins={PLUGINS} defaultEnabled={{ stats: false, devices: false }} permissions={PERMISSIONS} about={ABOUT} />
17
+ <SettingsWindow name="Just Notch" defaultValue="plugins" plugins={PLUGINS} defaultEnabled={{ system: false }} permissions={PERMISSIONS} about={ABOUT} />
16
18
  </MockWindow>
17
19
 
18
20
  # Permissions
@@ -25,6 +27,16 @@ A spinner while one is read; Open Settings beside one that isn't granted.
25
27
 
26
28
  # A plugin's settings
27
29
 
30
+ Grouped rows: a label, what it does, the control at the end.
31
+
32
+ <MockWindow title="Settings">
33
+ <SettingsWindow name="Just Notch" defaultValue="plugin:clock" plugins={PLUGINS} permissions={PERMISSIONS} about={ABOUT} />
34
+ </MockWindow>
35
+
36
+ # Flush
37
+
38
+ `flush` drops the sidebar's left inset, for a host frame that sets its own edge, such as the open island.
39
+
28
40
  <MockWindow title="Settings">
29
- <SettingsWindow name="Just Notch" defaultValue="plugin:calendar" plugins={PLUGINS} permissions={PERMISSIONS} about={ABOUT} />
41
+ <SettingsWindow name="Just Notch" flush plugins={PLUGINS} permissions={PERMISSIONS} about={ABOUT} />
30
42
  </MockWindow>
@@ -16,7 +16,7 @@ import type { IconComponent } from '@justanarthur/modo-ui/lib/icon-context'
16
16
  import { useControllableState } from '@justanarthur/modo-ui/lib/use-controllable-state'
17
17
  import { cn } from '@justanarthur/modo-ui/lib/utils'
18
18
  import ScrollArea from '@justanarthur/modo-ui/primitives/layout/scroll-area'
19
- import { Info, Puzzle, Settings2, ShieldCheck } from 'lucide-react'
19
+ import { ChevronRight, Info, Puzzle, Settings2, ShieldCheck } from 'lucide-react'
20
20
  import type { ReactNode } from 'react'
21
21
 
22
22
  type ScreensPreference = 'notched' | 'all'
@@ -82,6 +82,8 @@ interface SettingsWindowProps {
82
82
  onOpenPermission?: (id: string) => void
83
83
  /** The About page's rows: version, mode, screen. Defaults to `[]`. */
84
84
  about?: AboutRow[]
85
+ /** 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`. */
86
+ flush?: boolean
85
87
  /** Classes for the window's content, which fills its container. */
86
88
  className?: string
87
89
  }
@@ -149,9 +151,10 @@ interface PluginsProps {
149
151
  plugins: SettingsPlugin[]
150
152
  enabled: Record<string, boolean>
151
153
  onChange: (enabled: Record<string, boolean>) => void
154
+ onOpen: (id: string) => void
152
155
  }
153
156
 
154
- function Plugins({ plugins, enabled, onChange }: PluginsProps) {
157
+ function Plugins({ plugins, enabled, onChange, onOpen }: PluginsProps) {
155
158
  return (
156
159
  <Page title="Plugins" lead="Each plugin adds activities and widgets to the island.">
157
160
  {plugins.length === 0 ? (
@@ -172,6 +175,16 @@ function Plugins({ plugins, enabled, onChange }: PluginsProps) {
172
175
  }
173
176
  description={plugin.description}
174
177
  >
178
+ {plugin.settings !== undefined && (
179
+ <Button
180
+ variant="ghost"
181
+ size="icon"
182
+ aria-label={`${plugin.name} settings`}
183
+ onClick={() => onOpen(plugin.id)}
184
+ >
185
+ <ChevronRight />
186
+ </Button>
187
+ )}
175
188
  <Switch
176
189
  aria-label={plugin.name}
177
190
  className={LIST_SWITCH}
@@ -260,16 +273,18 @@ const PAGES: { value: string; label: string; icon: IconComponent }[] = [
260
273
  * it never folds into a drawer) lists the pages under the app's `name`, then
261
274
  * the plugins that bring settings. General holds the launch at login Switch
262
275
  * and a ChoiceList of the screens the island shows on. Plugins lists each
263
- * installed plugin with its glyph, its line and a Switch that turns it on or
264
- * off. Permissions shows what macOS granted as a StatusDot per row, with
265
- * Open Settings beside one that isn't granted, and a spinner while it's
266
- * being read. About lists the `about` rows. A plugin's page shows its
276
+ * installed plugin with its glyph, its line, a Switch that turns it on or
277
+ * off and, for one that brings settings, a chevron to its page. Permissions
278
+ * shows what macOS granted as a StatusDot per row, with Open Settings beside
279
+ * one that isn't granted, and a spinner while it's being read. About lists the `about` rows. A plugin's page shows its
267
280
  * `settings` node under its name.
268
281
  *
269
282
  * The page, the preferences and the plugins' states each run both ways
270
283
  * (`value`, `preferences`, `enabled` with their `default*` and `on*Change`),
271
284
  * so the window works on its own or on a host's store. It fills its
272
- * container; the window's frame and title bar are the host's.
285
+ * container; the window's frame and title bar are the host's. In a frame
286
+ * of the host's own, such as the open island, `flush` drops the sidebar's
287
+ * left inset, so the rows' text sits just the row's padding from the edge.
273
288
  *
274
289
  * @example {@include ./examples.mdx}
275
290
  */
@@ -288,6 +303,7 @@ export default function SettingsWindow({
288
303
  permissions = [],
289
304
  onOpenPermission,
290
305
  about = [],
306
+ flush = false,
291
307
  className,
292
308
  }: SettingsWindowProps) {
293
309
  const [page, setPage] = useControllableState(value, defaultValue, onValueChange)
@@ -306,7 +322,7 @@ export default function SettingsWindow({
306
322
  >
307
323
  <Sidebar className="h-full" collapsible="none" value={page} onValueChange={setPage}>
308
324
  <Sidebar.Content>
309
- <Sidebar.Group>
325
+ <Sidebar.Group className={cn(flush && 'pl-0')}>
310
326
  <Sidebar.GroupLabel>{name}</Sidebar.GroupLabel>
311
327
  <Sidebar.Menu>
312
328
  {PAGES.map(item => (
@@ -319,7 +335,7 @@ export default function SettingsWindow({
319
335
  </Sidebar.Menu>
320
336
  </Sidebar.Group>
321
337
  {withSettings.length > 0 && (
322
- <Sidebar.Group>
338
+ <Sidebar.Group className={cn(flush && 'pl-0')}>
323
339
  <Sidebar.GroupLabel>Plugin settings</Sidebar.GroupLabel>
324
340
  <Sidebar.Menu>
325
341
  {withSettings.map(p => (
@@ -338,7 +354,14 @@ export default function SettingsWindow({
338
354
  <ScrollArea key={page} className="h-full" viewportClassName="scroll-fade">
339
355
  <div className="mx-auto flex w-full max-w-160 flex-col gap-8 p-8">
340
356
  {page === 'general' && <General preferences={preferences} onChange={setPreferences} />}
341
- {page === 'plugins' && <Plugins plugins={plugins} enabled={enabled} onChange={setEnabled} />}
357
+ {page === 'plugins' && (
358
+ <Plugins
359
+ plugins={plugins}
360
+ enabled={enabled}
361
+ onChange={setEnabled}
362
+ onOpen={id => setPage(`plugin:${id}`)}
363
+ />
364
+ )}
342
365
  {page === 'permissions' && <Permissions permissions={permissions} onOpen={onOpenPermission} />}
343
366
  {page === 'about' && <About rows={about} />}
344
367
  {plugin && (
@@ -0,0 +1,91 @@
1
+ import ClipboardHistory from './index'
2
+ import { FlashIsland, WidgetIsland, WingsIsland } from '../../../mock/island-content'
3
+ import { CLIP_NOW, CLIPS, PINNED } from '../../../mock/clipboard'
4
+
5
+ # Latest clip
6
+
7
+ The newest clip as the hero, with where it came from and Copy; the history beside it, pinned clips on top. Arrow keys move the selection, Enter copies.
8
+
9
+ <WidgetIsland tab="clipboard">
10
+ <ClipboardHistory clips={CLIPS} defaultPinned={PINNED} now={CLIP_NOW} onDelete={() => {}} />
11
+ </WidgetIsland>
12
+
13
+ # Kinds
14
+
15
+ Each kind previews as what it is.
16
+
17
+ ## Link
18
+
19
+ The domain with its favicon, the page's title, the path.
20
+
21
+ <WidgetIsland tab="clipboard">
22
+ <ClipboardHistory clips={CLIPS} defaultValue="docs" now={CLIP_NOW} onDelete={() => {}} />
23
+ </WidgetIsland>
24
+
25
+ ## Image
26
+
27
+ <WidgetIsland tab="clipboard">
28
+ <ClipboardHistory clips={CLIPS} defaultValue="shot" now={CLIP_NOW} onDelete={() => {}} />
29
+ </WidgetIsland>
30
+
31
+ ## Color
32
+
33
+ <WidgetIsland tab="clipboard">
34
+ <ClipboardHistory clips={CLIPS} defaultValue="brand" defaultPinned={PINNED} now={CLIP_NOW} onDelete={() => {}} />
35
+ </WidgetIsland>
36
+
37
+ ## File
38
+
39
+ <WidgetIsland tab="clipboard">
40
+ <ClipboardHistory clips={CLIPS} defaultValue="brief" now={CLIP_NOW} onDelete={() => {}} />
41
+ </WidgetIsland>
42
+
43
+ # Searching
44
+
45
+ `defaultQuery` (or `query`) narrows the list; the hero follows the first match.
46
+
47
+ <WidgetIsland tab="clipboard">
48
+ <ClipboardHistory clips={CLIPS} defaultQuery="main" now={CLIP_NOW} />
49
+ </WidgetIsland>
50
+
51
+ # Paused, an app ignored
52
+
53
+ `paused` stops recording, with a chip and Resume on the context line; `ignoredApp` says whose copies are never kept.
54
+
55
+ <WidgetIsland tab="clipboard">
56
+ <ClipboardHistory clips={CLIPS} defaultPaused ignoredApp="1Password" now={CLIP_NOW} />
57
+ </WidgetIsland>
58
+
59
+ # Empty
60
+
61
+ <WidgetIsland tab="clipboard">
62
+ <ClipboardHistory clips={[]} />
63
+ </WidgetIsland>
64
+
65
+ # Empty and paused
66
+
67
+ <WidgetIsland tab="clipboard">
68
+ <ClipboardHistory clips={[]} defaultPaused />
69
+ </WidgetIsland>
70
+
71
+ # Compact
72
+
73
+ `ClipboardHistory.Leading` and `ClipboardHistory.Trailing`: the glyph and the clips that came in since the island was open.
74
+
75
+ <WingsIsland leading={<ClipboardHistory.Leading />} trailing={<ClipboardHistory.Trailing count={3} />} />
76
+
77
+ # Copied
78
+
79
+ `ClipboardHistory.Copied`, the flash when something is copied, with Pin.
80
+
81
+ <FlashIsland>
82
+ <ClipboardHistory.Copied clip={CLIPS[3]} onPin={() => {}} />
83
+ </FlashIsland>
84
+
85
+ # Tall
86
+
87
+ `layout="tall"` at the island's tall snap: the search across the top, every clip as a row with its picture, and the selected clip in full beside them, held in view as the list scrolls.
88
+
89
+ <WidgetIsland tab="clipboard" tall>
90
+ <ClipboardHistory clips={CLIPS} defaultPinned={PINNED} now={CLIP_NOW} onDelete={() => {}} layout="tall" />
91
+ </WidgetIsland>