@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.
- package/README.md +11 -11
- package/blocks/activities/agenda/examples.mdx +29 -5
- package/blocks/activities/agenda/index.tsx +438 -181
- package/blocks/activities/clock/examples.mdx +89 -0
- package/blocks/activities/clock/index.tsx +917 -0
- package/blocks/activities/now-playing/examples.mdx +40 -13
- package/blocks/activities/now-playing/index.tsx +399 -120
- package/blocks/activities/weather/examples.mdx +123 -0
- package/blocks/activities/weather/index.tsx +863 -0
- package/blocks/app/expanded-island/examples.mdx +8 -7
- package/blocks/app/expanded-island/index.tsx +22 -4
- package/blocks/app/settings-window/examples.mdx +14 -2
- package/blocks/app/settings-window/index.tsx +33 -10
- package/blocks/system/clipboard/examples.mdx +91 -0
- package/blocks/system/clipboard/index.tsx +773 -0
- package/blocks/system/recent-files/examples.mdx +80 -0
- package/blocks/system/recent-files/index.tsx +627 -0
- package/blocks/system/system-stats/examples.mdx +46 -9
- package/blocks/system/system-stats/index.tsx +445 -104
- 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 +465 -0
- package/dist/blocks/activities/agenda/index.d.ts +2 -1
- package/dist/blocks/activities/agenda/index.js +3 -3
- package/dist/blocks/activities/clock/index.d.ts +3 -0
- package/dist/blocks/activities/clock/index.js +25 -0
- package/dist/blocks/activities/now-playing/index.d.ts +4 -2
- package/dist/blocks/activities/now-playing/index.js +5 -3
- package/dist/blocks/activities/weather/index.d.ts +3 -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 +3 -0
- package/dist/blocks/system/clipboard/index.js +17 -0
- package/dist/blocks/system/recent-files/index.d.ts +3 -0
- package/dist/blocks/system/recent-files/index.js +19 -0
- package/dist/blocks/system/system-stats/index.d.ts +3 -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 +32 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +104 -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-yngkkxz2.d.ts → chunk-0ym9mcqc.d.ts} +10 -6
- package/dist/shared/chunk-2b6gpn8k.js +444 -0
- package/dist/shared/chunk-3hcnf4yx.js +481 -0
- package/dist/shared/chunk-42wab62s.d.ts +197 -0
- package/dist/shared/{chunk-zvh0d3qb.js → chunk-61t2dfte.js} +1 -1
- package/dist/shared/{chunk-9nhpg9t8.d.ts → chunk-6tnq6p89.d.ts} +9 -1
- package/dist/shared/{chunk-hpsabfsd.d.ts → chunk-81fpptwp.d.ts} +1 -1
- package/dist/shared/chunk-93dtpjz7.js +789 -0
- package/dist/shared/{chunk-wwjxs75m.js → chunk-9xtcv3sy.js} +26 -12
- package/dist/shared/chunk-a6njb8db.d.ts +129 -0
- package/dist/shared/chunk-ab8mdg0n.d.ts +149 -0
- package/dist/shared/chunk-evqpf92s.d.ts +168 -0
- package/dist/shared/{chunk-6c1jbefs.d.ts → chunk-fexwzycv.d.ts} +3 -3
- package/dist/shared/chunk-gcyspvgr.js +582 -0
- package/dist/shared/chunk-gejenfap.d.ts +25 -0
- package/dist/shared/chunk-gkj0hjrn.d.ts +136 -0
- package/dist/shared/{chunk-rr5e0g15.d.ts → chunk-j755a1a5.d.ts} +7 -1
- package/dist/shared/chunk-n739am8j.d.ts +112 -0
- package/dist/shared/{chunk-78w7qwp0.js → chunk-ndf79pv5.js} +1 -1
- package/dist/shared/chunk-nwzpekvy.js +774 -0
- package/dist/shared/{chunk-rpfwv3pz.js → chunk-r471sknr.js} +1 -1
- package/dist/shared/chunk-sbrtesdg.d.ts +138 -0
- package/dist/shared/chunk-swc7dqpw.d.ts +115 -0
- package/dist/shared/chunk-t9wqhgzt.js +765 -0
- package/dist/shared/chunk-w5h6ay93.js +72 -0
- package/dist/shared/{chunk-mp1nx0ez.js → chunk-wayv5rhr.js} +15 -4
- package/dist/shared/chunk-wf0jtzhs.js +295 -0
- package/dist/shared/{chunk-sbnrhy5m.js → chunk-y0188bbn.js} +2 -2
- package/dist/shared/chunk-yq5svpk7.js +524 -0
- package/dist/shared/{chunk-s33y1pcq.js → chunk-z3tj1ydg.js} +23 -10
- package/dist/styles.css +151 -49
- 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 +113 -0
- package/mock/clock.tsx +77 -0
- package/mock/data.ts +78 -44
- package/mock/files.tsx +83 -0
- package/mock/island-content.tsx +79 -122
- package/mock/screen.tsx +76 -0
- package/mock/settings.tsx +370 -91
- package/mock/system.ts +49 -0
- package/mock/weather.tsx +135 -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
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import PowerAlert from './index'
|
|
2
|
-
import { FlashIsland } from '../../../mock/island-content'
|
|
3
|
-
|
|
4
|
-
# Charging
|
|
5
|
-
|
|
6
|
-
A charger plugs in: the figure and the battery in the success hue, and how long until full.
|
|
7
|
-
|
|
8
|
-
<FlashIsland>
|
|
9
|
-
<PowerAlert kind="charging" level={82} minutes={38} />
|
|
10
|
-
</FlashIsland>
|
|
11
|
-
|
|
12
|
-
# On battery
|
|
13
|
-
|
|
14
|
-
<FlashIsland>
|
|
15
|
-
<PowerAlert kind="unplugged" level={82} minutes={252} />
|
|
16
|
-
</FlashIsland>
|
|
17
|
-
|
|
18
|
-
# Low
|
|
19
|
-
|
|
20
|
-
Once on the way down through 20%.
|
|
21
|
-
|
|
22
|
-
<FlashIsland>
|
|
23
|
-
<PowerAlert kind="low" level={19} />
|
|
24
|
-
</FlashIsland>
|
|
25
|
-
|
|
26
|
-
# Critical
|
|
27
|
-
|
|
28
|
-
Once on the way down through 10%.
|
|
29
|
-
|
|
30
|
-
<FlashIsland>
|
|
31
|
-
<PowerAlert kind="critical" level={8} />
|
|
32
|
-
</FlashIsland>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Local addition: a notch app's power alerts. Rebuilt from Just Notch's
|
|
3
|
-
* power plugin (`Charging`, `Unplugged`, `Low`, `Critical`) as one
|
|
4
|
-
* presentational flash: the battery comes in as props.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use client'
|
|
8
|
-
|
|
9
|
-
import { BatteryLow, BatteryWarning, Unplug, Zap } from 'lucide-react'
|
|
10
|
-
import type { ReactNode } from 'react'
|
|
11
|
-
import BatteryGlyph, { type BatteryTone } from '../../../components/indicators/battery-glyph'
|
|
12
|
-
import IslandFlash, { type IslandFlashTone } from '../../../components/island/island-flash'
|
|
13
|
-
|
|
14
|
-
type PowerAlertKind = 'charging' | 'unplugged' | 'low' | 'critical'
|
|
15
|
-
|
|
16
|
-
interface PowerAlertProps {
|
|
17
|
-
/** What happened: a charger plugged in or out, or the battery crossing 20% or 10%. */
|
|
18
|
-
kind: PowerAlertKind
|
|
19
|
-
/** The charge, in percent (0 to 100). */
|
|
20
|
-
level: number
|
|
21
|
-
/** Minutes until full while charging, or of battery left on battery: the caption says it. */
|
|
22
|
-
minutes?: number
|
|
23
|
-
/** Replaces the caption the kind and `minutes` give. */
|
|
24
|
-
caption?: ReactNode
|
|
25
|
-
/** Classes for the row. */
|
|
26
|
-
className?: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const ALERT: Record<
|
|
30
|
-
PowerAlertKind,
|
|
31
|
-
{ title: string; tone: IslandFlashTone & BatteryTone; icon: ReactNode; verb?: string; caption?: string }
|
|
32
|
-
> = {
|
|
33
|
-
charging: {
|
|
34
|
-
title: 'Charging',
|
|
35
|
-
tone: 'success',
|
|
36
|
-
icon: <Zap size={18} strokeWidth={1.5} fill="currentColor" />,
|
|
37
|
-
verb: 'until full',
|
|
38
|
-
},
|
|
39
|
-
unplugged: { title: 'On battery', tone: 'default', icon: <Unplug size={18} strokeWidth={1.5} />, verb: 'remaining' },
|
|
40
|
-
low: {
|
|
41
|
-
title: 'Low battery',
|
|
42
|
-
tone: 'warning',
|
|
43
|
-
icon: <BatteryLow size={18} strokeWidth={1.5} />,
|
|
44
|
-
caption: 'Plug in soon',
|
|
45
|
-
},
|
|
46
|
-
critical: {
|
|
47
|
-
title: 'Battery critically low',
|
|
48
|
-
tone: 'error',
|
|
49
|
-
icon: <BatteryWarning size={18} strokeWidth={1.5} />,
|
|
50
|
-
caption: 'Plug in now',
|
|
51
|
-
},
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Minutes as `38 min` or `4 h 12 min`. */
|
|
55
|
-
const span = (minutes: number) =>
|
|
56
|
-
minutes >= 60 ? `${Math.floor(minutes / 60)} h ${Math.round(minutes % 60)} min` : `${Math.round(minutes)} min`
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* A notch app's power alert: a charger plugged in or out, or the battery
|
|
60
|
-
* running low, as the island's flash.
|
|
61
|
-
*
|
|
62
|
-
* Each kind brings its icon, title and status hue: charging in success,
|
|
63
|
-
* unplugged in the text color, low in warning (at 20%), critical in error
|
|
64
|
-
* (at 10%). The level shows as a figure in that hue and as a BatteryGlyph
|
|
65
|
-
* that fills up from empty as the flash opens. With `minutes`, the caption
|
|
66
|
-
* says how long until full or how much is left; low and critical say to plug
|
|
67
|
-
* in. Pass it as the Island's `flash`, keyed by kind, so one alert replacing
|
|
68
|
-
* another swaps instead of updating in place.
|
|
69
|
-
*
|
|
70
|
-
* @example {@include ./examples.mdx}
|
|
71
|
-
*/
|
|
72
|
-
export default function PowerAlert({ kind, level, minutes, caption, className }: PowerAlertProps) {
|
|
73
|
-
const alert = ALERT[kind]
|
|
74
|
-
const detail = minutes !== undefined && alert.verb ? `${span(minutes)} ${alert.verb}` : alert.caption
|
|
75
|
-
return (
|
|
76
|
-
<IslandFlash
|
|
77
|
-
className={className}
|
|
78
|
-
icon={alert.icon}
|
|
79
|
-
tone={alert.tone}
|
|
80
|
-
title={alert.title}
|
|
81
|
-
caption={caption ?? detail}
|
|
82
|
-
value={`${Math.round(level)}%`}
|
|
83
|
-
trailing={<BatteryGlyph level={level} charging={kind === 'charging'} tone={alert.tone} />}
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export type { PowerAlertKind, PowerAlertProps }
|
|
89
|
-
export { PowerAlert }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import BatteryGlyph from './index'
|
|
2
|
-
|
|
3
|
-
# Levels
|
|
4
|
-
|
|
5
|
-
The fill takes the warning hue from 20% down and the error hue from 10%.
|
|
6
|
-
|
|
7
|
-
<div className="flex items-center gap-6">
|
|
8
|
-
<BatteryGlyph level={82} />
|
|
9
|
-
<BatteryGlyph level={46} />
|
|
10
|
-
<BatteryGlyph level={18} />
|
|
11
|
-
<BatteryGlyph level={6} />
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
# Charging
|
|
15
|
-
|
|
16
|
-
A bolt, and the success hue.
|
|
17
|
-
|
|
18
|
-
<div className="dark flex items-center gap-6 rounded-box bg-ink px-5 py-3 text-foreground">
|
|
19
|
-
<BatteryGlyph level={82} charging />
|
|
20
|
-
<BatteryGlyph level={12} charging />
|
|
21
|
-
<BatteryGlyph level={100} tone="default" />
|
|
22
|
-
</div>
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Local addition: a battery that fills to its level, for a notch app's power
|
|
3
|
-
* alerts. Rebuilt from Just Notch's power plugin (`Battery`).
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
'use client'
|
|
7
|
-
|
|
8
|
-
import { useReduceMotion } from '@justanarthur/modo-ui/lib/reduced-motion'
|
|
9
|
-
import { spring } from '@justanarthur/modo-ui/lib/springs'
|
|
10
|
-
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
11
|
-
import { motion } from 'motion/react'
|
|
12
|
-
|
|
13
|
-
type BatteryTone = 'default' | 'success' | 'warning' | 'error'
|
|
14
|
-
|
|
15
|
-
// Literal table: UnoCSS only generates the classes it can read whole.
|
|
16
|
-
const FILL: Record<BatteryTone, string> = {
|
|
17
|
-
default: 'bg-foreground',
|
|
18
|
-
success: 'bg-status-success',
|
|
19
|
-
warning: 'bg-status-warning',
|
|
20
|
-
error: 'bg-status-error',
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface BatteryGlyphProps {
|
|
24
|
-
/** The charge, in percent (0 to 100). */
|
|
25
|
-
level: number
|
|
26
|
-
/** A charger is connected: the bolt shows and the tone turns to success. Defaults to `false`. */
|
|
27
|
-
charging?: boolean
|
|
28
|
-
/** The fill's hue. Defaults to success while charging, error at 10% and below, warning at 20% and below, else the text color. */
|
|
29
|
-
tone?: BatteryTone
|
|
30
|
-
/** Fill up from empty when it first shows, as a flash opens. Defaults to `true`. */
|
|
31
|
-
fillIn?: boolean
|
|
32
|
-
/** What screen readers hear. Defaults to the level, and "charging" while it charges. */
|
|
33
|
-
label?: string
|
|
34
|
-
/** Classes for the glyph. */
|
|
35
|
-
className?: string
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** The tone a battery at `level` takes on its own. */
|
|
39
|
-
function batteryTone(level: number, charging: boolean): BatteryTone {
|
|
40
|
-
if (charging) return 'success'
|
|
41
|
-
if (level <= 10) return 'error'
|
|
42
|
-
if (level <= 20) return 'warning'
|
|
43
|
-
return 'default'
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* A battery at a glance: a case that fills to the charge, a bolt while it
|
|
48
|
-
* charges.
|
|
49
|
-
*
|
|
50
|
-
* The fill turns to the success hue while charging and to the warning and
|
|
51
|
-
* error hues as the charge runs low, unless `tone` pins one. It fills up from
|
|
52
|
-
* empty when it first shows, on the slow spring, the way a power alert opens;
|
|
53
|
-
* a later change of level springs from where it was. A sliver always shows,
|
|
54
|
-
* so an empty battery still reads as one.
|
|
55
|
-
*
|
|
56
|
-
* @example {@include ./examples.mdx}
|
|
57
|
-
*/
|
|
58
|
-
export default function BatteryGlyph({
|
|
59
|
-
level,
|
|
60
|
-
charging = false,
|
|
61
|
-
tone,
|
|
62
|
-
fillIn = true,
|
|
63
|
-
label,
|
|
64
|
-
className,
|
|
65
|
-
}: BatteryGlyphProps) {
|
|
66
|
-
const reduced = useReduceMotion()
|
|
67
|
-
const share = Math.max(0.06, Math.min(1, level / 100))
|
|
68
|
-
const name = label ?? `${Math.round(level)}%${charging ? ', charging' : ''}`
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<span role="img" aria-label={name} className={cn('inline-flex shrink-0 items-center gap-px', className)}>
|
|
72
|
-
<span className="relative h-3.5 w-7 overflow-hidden rounded-box bg-active p-0.5">
|
|
73
|
-
<motion.span
|
|
74
|
-
className={cn('block h-full w-full origin-left rounded-glyph', FILL[tone ?? batteryTone(level, charging)])}
|
|
75
|
-
initial={fillIn && !reduced ? { scaleX: 0 } : false}
|
|
76
|
-
animate={{ scaleX: share }}
|
|
77
|
-
transition={reduced ? { duration: 0 } : spring.slow}
|
|
78
|
-
/>
|
|
79
|
-
{charging && (
|
|
80
|
-
<svg aria-hidden viewBox="0 0 24 24" className="absolute inset-0 m-auto size-3 fill-foreground">
|
|
81
|
-
<path d="M13 2 4.5 13.5H11L10 22l8.5-11.5H12z" />
|
|
82
|
-
</svg>
|
|
83
|
-
)}
|
|
84
|
-
</span>
|
|
85
|
-
<span className="h-1.5 w-0.5 rounded-r-full bg-active" />
|
|
86
|
-
</span>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export type { BatteryGlyphProps, BatteryTone }
|
|
91
|
-
export { BatteryGlyph, batteryTone }
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { ShelfFile2, ShelfProps2, ShelfLeading2, ShelfTrailing2, ShelfDropProps2, ShelfDrop2, Shelf2 } from "../../../shared/chunk-50ffk4r7.js";
|
|
2
|
-
export { Shelf2 as Shelf, ShelfDrop2 as ShelfDrop, ShelfDropProps2 as ShelfDropProps, ShelfFile2 as ShelfFile, ShelfLeading2 as ShelfLeading, ShelfProps2 as ShelfProps, ShelfTrailing2 as ShelfTrailing, Shelf2 as default };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ShelfLeading2,
|
|
3
|
-
ShelfTrailing2,
|
|
4
|
-
ShelfDrop2,
|
|
5
|
-
Shelf2,
|
|
6
|
-
shelf_default
|
|
7
|
-
} from "../../../shared/chunk-phb53x1f.js";
|
|
8
|
-
export {
|
|
9
|
-
Shelf2 as Shelf,
|
|
10
|
-
ShelfDrop2 as ShelfDrop,
|
|
11
|
-
ShelfLeading2 as ShelfLeading,
|
|
12
|
-
ShelfTrailing2 as ShelfTrailing,
|
|
13
|
-
shelf_default as default
|
|
14
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { TimerKind2, TimerRun2, TimerProps2, TimerLeading2, TimerTrailing2, TimerMinimal2, TimerDoneProps2, TimerDone2, Timer2 } from "../../../shared/chunk-e3e4s4ds.js";
|
|
2
|
-
export { Timer2 as Timer, TimerDone2 as TimerDone, TimerDoneProps2 as TimerDoneProps, TimerKind2 as TimerKind, TimerLeading2 as TimerLeading, TimerMinimal2 as TimerMinimal, TimerProps2 as TimerProps, TimerRun2 as TimerRun, TimerTrailing2 as TimerTrailing, Timer2 as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TimerLeading2,
|
|
3
|
-
TimerTrailing2,
|
|
4
|
-
TimerMinimal2,
|
|
5
|
-
TimerDone2,
|
|
6
|
-
Timer2,
|
|
7
|
-
timer_default
|
|
8
|
-
} from "../../../shared/chunk-rx9sphz2.js";
|
|
9
|
-
import"../../../shared/chunk-502rmtap.js";
|
|
10
|
-
import"../../../shared/chunk-gb56m10p.js";
|
|
11
|
-
import"../../../shared/chunk-78w7qwp0.js";
|
|
12
|
-
export {
|
|
13
|
-
Timer2 as Timer,
|
|
14
|
-
TimerDone2 as TimerDone,
|
|
15
|
-
TimerLeading2 as TimerLeading,
|
|
16
|
-
TimerMinimal2 as TimerMinimal,
|
|
17
|
-
TimerTrailing2 as TimerTrailing,
|
|
18
|
-
timer_default as default
|
|
19
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { ControlKind2, ControlLevels2, ControlsProps2, ControlsLevelProps2, ControlsLevel2, Controls2 } from "../../../shared/chunk-xdeek16r.js";
|
|
2
|
-
export { ControlKind2 as ControlKind, ControlLevels2 as ControlLevels, Controls2 as Controls, ControlsLevel2 as ControlsLevel, ControlsLevelProps2 as ControlsLevelProps, ControlsProps2 as ControlsProps, Controls2 as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { DeviceKind2, DeviceInfo2, DevicesProps2, DevicesConnected2, Devices2 } from "../../../shared/chunk-r8esmjfs.js";
|
|
2
|
-
export { DeviceInfo2 as DeviceInfo, DeviceKind2 as DeviceKind, Devices2 as Devices, DevicesConnected2 as DevicesConnected, DevicesProps2 as DevicesProps, Devices2 as default };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DevicesConnected2,
|
|
3
|
-
Devices2,
|
|
4
|
-
devices_default
|
|
5
|
-
} from "../../../shared/chunk-b8jb1w72.js";
|
|
6
|
-
import"../../../shared/chunk-hwtxpzg0.js";
|
|
7
|
-
import"../../../shared/chunk-78w7qwp0.js";
|
|
8
|
-
export {
|
|
9
|
-
Devices2 as Devices,
|
|
10
|
-
DevicesConnected2 as DevicesConnected,
|
|
11
|
-
devices_default as default
|
|
12
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { BatteryTone2, BatteryGlyphProps2, batteryTone2, BatteryGlyph2 } from "../../../shared/chunk-fvedaas2.js";
|
|
2
|
-
export { BatteryGlyph2 as BatteryGlyph, BatteryGlyphProps2 as BatteryGlyphProps, BatteryTone2 as BatteryTone, batteryTone2 as batteryTone, BatteryGlyph2 as default };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { JSX as JSX_1kxb } from "react";
|
|
2
|
-
/** One reading of the system. */
|
|
3
|
-
interface StatsSample2 {
|
|
4
|
-
/** CPU load, from 0 to 1. */
|
|
5
|
-
cpu: number;
|
|
6
|
-
/** Memory in use, in bytes. */
|
|
7
|
-
memoryUsed: number;
|
|
8
|
-
/** All the memory, in bytes. */
|
|
9
|
-
memoryTotal: number;
|
|
10
|
-
/** Network in, in bytes per second. */
|
|
11
|
-
netIn: number;
|
|
12
|
-
/** Network out, in bytes per second. */
|
|
13
|
-
netOut: number;
|
|
14
|
-
}
|
|
15
|
-
interface SystemStatsProps2 {
|
|
16
|
-
/** The readings so far, oldest first; the latest is the figure, all of them the trend. Without any, it is still measuring. */
|
|
17
|
-
samples: StatsSample2[];
|
|
18
|
-
/** Classes for the root, which fills its container. */
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
type Element_12xgc = JSX_1kxb["Element"];
|
|
22
|
-
/** The compact island's left wing: the CPU glyph. */
|
|
23
|
-
declare function SystemStatsLeading2(): Element_12xgc;
|
|
24
|
-
/** The compact island's right wing: the CPU load, a dash until the first reading. */
|
|
25
|
-
declare function SystemStatsTrailing2({ sample }: {
|
|
26
|
-
sample?: StatsSample2;
|
|
27
|
-
}): Element_12xgc;
|
|
28
|
-
/**
|
|
29
|
-
* A notch app's system load: CPU, memory and network, each a tile with its
|
|
30
|
-
* figure and its trend.
|
|
31
|
-
*
|
|
32
|
-
* The latest reading is the figure: the CPU load, the memory in use of all
|
|
33
|
-
* of it, and the network's in and out rates. Every reading so far is the
|
|
34
|
-
* trend, a modo-ui Sparkline that spans the tile however many readings there
|
|
35
|
-
* are, since the island stays open for seconds, too short to fill a fixed
|
|
36
|
-
* window; network out runs muted under network in, on one scale. Before the
|
|
37
|
-
* first reading the tiles show a dash over the Sparkline's baseline.
|
|
38
|
-
*
|
|
39
|
-
* `SystemStats.Leading` and `SystemStats.Trailing` show the CPU load in the
|
|
40
|
-
* compact island's wings.
|
|
41
|
-
*
|
|
42
|
-
* @example {@include ./examples.mdx}
|
|
43
|
-
*/
|
|
44
|
-
declare function SystemStats2({ samples, className }: SystemStatsProps2): Element_12xgc;
|
|
45
|
-
export { StatsSample2, SystemStatsProps2, SystemStatsLeading2, SystemStatsTrailing2, SystemStats2 };
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { JSX as JSX_1kxb } from "react";
|
|
3
|
-
interface NowPlayingTrack2 {
|
|
4
|
-
title: string;
|
|
5
|
-
artist?: string;
|
|
6
|
-
album?: string;
|
|
7
|
-
/** The artwork: an image URL, or any element (an `<img>`, a generated tile). */
|
|
8
|
-
artwork?: string | ReactNode;
|
|
9
|
-
/** The app it plays in, shown under the controls. */
|
|
10
|
-
source?: string;
|
|
11
|
-
/** The track's length, in seconds; `0` for a stream, which hides the scrubber. */
|
|
12
|
-
duration: number;
|
|
13
|
-
/** Where playback is, in seconds. */
|
|
14
|
-
position: number;
|
|
15
|
-
}
|
|
16
|
-
interface NowPlayingProps2 {
|
|
17
|
-
/** What plays; without one the player says nothing is playing. */
|
|
18
|
-
track?: NowPlayingTrack2 | null;
|
|
19
|
-
/** It plays (controlled). */
|
|
20
|
-
playing?: boolean;
|
|
21
|
-
/** It plays at first (uncontrolled). Defaults to `true`. */
|
|
22
|
-
defaultPlaying?: boolean;
|
|
23
|
-
/** Called with the new state when play / pause is pressed. */
|
|
24
|
-
onPlayingChange?: (playing: boolean) => void;
|
|
25
|
-
/** Called when the previous button is pressed. */
|
|
26
|
-
onPrevious?: () => void;
|
|
27
|
-
/** Called when the next button is pressed. */
|
|
28
|
-
onNext?: () => void;
|
|
29
|
-
/** Called with the position to seek to, once, when a drag on the scrubber ends. */
|
|
30
|
-
onSeek?: (seconds: number) => void;
|
|
31
|
-
/** The empty state's line. Defaults to `'Play something in Music, Spotify or a browser.'`. */
|
|
32
|
-
emptyDescription?: ReactNode;
|
|
33
|
-
/** Classes for the root, which fills its container. */
|
|
34
|
-
className?: string;
|
|
35
|
-
}
|
|
36
|
-
interface ArtworkProps {
|
|
37
|
-
/** The track's artwork; without one, a note on a tile one surface up. */
|
|
38
|
-
artwork?: string | ReactNode;
|
|
39
|
-
/** The note's size in px when there is no artwork. Defaults to `14`. */
|
|
40
|
-
glyph?: number;
|
|
41
|
-
/** Classes for the tile: its size and radius. */
|
|
42
|
-
className?: string;
|
|
43
|
-
}
|
|
44
|
-
type Element_12xgc = JSX_1kxb["Element"];
|
|
45
|
-
/** A track's artwork in a tile, or a note on a raised tile when it has none. */
|
|
46
|
-
declare function NowPlayingArtwork2({ artwork, glyph, className }: ArtworkProps): Element_12xgc;
|
|
47
|
-
/** The compact island's left wing: the artwork, small. */
|
|
48
|
-
declare function NowPlayingLeading2({ track }: {
|
|
49
|
-
track?: Pick<NowPlayingTrack2, "artwork"> | null;
|
|
50
|
-
}): Element_12xgc;
|
|
51
|
-
/** The compact island's right wing: the level bars, low while paused. */
|
|
52
|
-
declare function NowPlayingTrailing2({ playing }: {
|
|
53
|
-
playing?: boolean;
|
|
54
|
-
}): Element_12xgc;
|
|
55
|
-
/** The split island's bubble: the artwork as a disc. */
|
|
56
|
-
declare function NowPlayingMinimal2({ track }: {
|
|
57
|
-
track?: Pick<NowPlayingTrack2, "artwork"> | null;
|
|
58
|
-
}): Element_12xgc;
|
|
59
|
-
/** The island's flash when the track changes: its artwork, title and artist, and the bars. */
|
|
60
|
-
declare function NowPlayingFlash2({ track, playing }: {
|
|
61
|
-
track: NowPlayingTrack2;
|
|
62
|
-
playing?: boolean;
|
|
63
|
-
}): Element_12xgc;
|
|
64
|
-
/**
|
|
65
|
-
* What's playing, as a notch app's open island shows it: the artwork, the
|
|
66
|
-
* title and artist, where the track is, and the transport.
|
|
67
|
-
*
|
|
68
|
-
* The scrubber is the kit's MediaScrubber: it runs on by itself while
|
|
69
|
-
* playing and seeks once when a drag ends (`onSeek`). Play / pause is
|
|
70
|
-
* controlled through `playing` / `onPlayingChange`, or kept here from
|
|
71
|
-
* `defaultPlaying`; previous and next report their press. Without artwork a
|
|
72
|
-
* big square would be an empty box, so a small note tile leads the title row
|
|
73
|
-
* instead. Without a track it says nothing is playing.
|
|
74
|
-
*
|
|
75
|
-
* The other forms are parts: `NowPlaying.Leading` and `NowPlaying.Trailing`
|
|
76
|
-
* for the compact island's wings (the artwork, and an Equalizer that settles
|
|
77
|
-
* when paused), `NowPlaying.Minimal` for the split island's bubble (the
|
|
78
|
-
* artwork as a disc), `NowPlaying.Flash` for the flash on a track change and
|
|
79
|
-
* `NowPlaying.Artwork` for the tile on its own.
|
|
80
|
-
*
|
|
81
|
-
* @example {@include ./examples.mdx}
|
|
82
|
-
*/
|
|
83
|
-
declare function NowPlaying2({ track, playing: playingProp, defaultPlaying, onPlayingChange, onPrevious, onNext, onSeek, emptyDescription, className }: NowPlayingProps2): Element_12xgc;
|
|
84
|
-
export { NowPlayingTrack2, NowPlayingProps2, NowPlayingArtwork2, NowPlayingLeading2, NowPlayingTrailing2, NowPlayingMinimal2, NowPlayingFlash2, NowPlaying2 };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { JSX as JSX_1kxb } from "react";
|
|
3
|
-
interface ShelfFile2 {
|
|
4
|
-
/** What tells it apart: its path. */
|
|
5
|
-
id: string;
|
|
6
|
-
/** Its name, shown under the tile. */
|
|
7
|
-
name: string;
|
|
8
|
-
/** A preview: an image URL, or any element. Without one, an icon for the file's type. */
|
|
9
|
-
thumbnail?: string | ReactNode;
|
|
10
|
-
}
|
|
11
|
-
interface ShelfProps2 {
|
|
12
|
-
/** The files on the shelf, in order (controlled). */
|
|
13
|
-
value?: ShelfFile2[];
|
|
14
|
-
/** The files at first (uncontrolled). Defaults to `[]`. */
|
|
15
|
-
defaultValue?: ShelfFile2[];
|
|
16
|
-
/** Called with the files left after Remove or Clear. */
|
|
17
|
-
onValueChange?: (files: ShelfFile2[]) => void;
|
|
18
|
-
/** Called on a double-click or the menu's Open. */
|
|
19
|
-
onOpen?: (file: ShelfFile2) => void;
|
|
20
|
-
/** Called on the menu's Show in Finder. */
|
|
21
|
-
onReveal?: (file: ShelfFile2) => void;
|
|
22
|
-
/** Called with every file on AirDrop; without it the button hides. */
|
|
23
|
-
onAirDrop?: (files: ShelfFile2[]) => void;
|
|
24
|
-
/** Called when a tile starts to be dragged out, for the host to start a native drag. */
|
|
25
|
-
onDragOut?: (file: ShelfFile2) => void;
|
|
26
|
-
/** Classes for the root, which fills its container. */
|
|
27
|
-
className?: string;
|
|
28
|
-
}
|
|
29
|
-
type Element_12xgc = JSX_1kxb["Element"];
|
|
30
|
-
/** The compact island's left wing: the shelf's glyph. */
|
|
31
|
-
declare function ShelfLeading2(): Element_12xgc;
|
|
32
|
-
/** The compact island's right wing: how many files are on the shelf. */
|
|
33
|
-
declare function ShelfTrailing2({ count: n }: {
|
|
34
|
-
count: number;
|
|
35
|
-
}): Element_12xgc;
|
|
36
|
-
interface ShelfDropProps2 {
|
|
37
|
-
/** `dragging` while files hover over the notch, `added` once they dropped. */
|
|
38
|
-
phase: "dragging" | "added";
|
|
39
|
-
/** How many files are being dragged, or were added. */
|
|
40
|
-
count: number;
|
|
41
|
-
/** How many files the shelf holds once they dropped. Defaults to `count`. */
|
|
42
|
-
total?: number;
|
|
43
|
-
/** Classes for the target. */
|
|
44
|
-
className?: string;
|
|
45
|
-
}
|
|
46
|
-
/** The island's flash while files are dragged over the notch: a dashed drop target, then a check once they land. */
|
|
47
|
-
declare function ShelfDrop2({ phase, count: n, total, className }: ShelfDropProps2): Element_12xgc;
|
|
48
|
-
/**
|
|
49
|
-
* A notch app's shelf: files dragged onto the notch, kept in a strip to drag
|
|
50
|
-
* out again, open, AirDrop or clear.
|
|
51
|
-
*
|
|
52
|
-
* Each file is a tile with its thumbnail, or an icon for its type, and its
|
|
53
|
-
* name. A double-click opens it; a right-click (a long press on touch) opens
|
|
54
|
-
* a ContextMenu with Open, Show in Finder and Remove from shelf, grown from
|
|
55
|
-
* the press point; one fluid hover highlight runs along the strip, which
|
|
56
|
-
* scrolls sideways when it holds more than fits. Moving a pressed tile calls
|
|
57
|
-
* `onDragOut`, for the host to start a native drag. A header counts the
|
|
58
|
-
* files and holds AirDrop and Clear. Removing and clearing change the files
|
|
59
|
-
* through `value` / `onValueChange`, or here from `defaultValue`; tiles fade
|
|
60
|
-
* in and out as the strip closes up. An empty shelf says how to fill it.
|
|
61
|
-
*
|
|
62
|
-
* The other forms are parts: `Shelf.Drop`, the flash while files hover over
|
|
63
|
-
* the notch (a dashed drop target in the brand hue) and once they land;
|
|
64
|
-
* `Shelf.Leading` and `Shelf.Trailing` for the compact island's wings.
|
|
65
|
-
*
|
|
66
|
-
* @example {@include ./examples.mdx}
|
|
67
|
-
*/
|
|
68
|
-
declare function Shelf2({ value, defaultValue, onValueChange, onOpen, onReveal, onAirDrop, onDragOut, className }: ShelfProps2): Element_12xgc;
|
|
69
|
-
export { ShelfFile2, ShelfProps2, ShelfLeading2, ShelfTrailing2, ShelfDropProps2, ShelfDrop2, Shelf2 };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import { JSX as JSX_1kxb } from "react";
|
|
3
|
-
type PowerAlertKind2 = "charging" | "unplugged" | "low" | "critical";
|
|
4
|
-
interface PowerAlertProps2 {
|
|
5
|
-
/** What happened: a charger plugged in or out, or the battery crossing 20% or 10%. */
|
|
6
|
-
kind: PowerAlertKind2;
|
|
7
|
-
/** The charge, in percent (0 to 100). */
|
|
8
|
-
level: number;
|
|
9
|
-
/** Minutes until full while charging, or of battery left on battery: the caption says it. */
|
|
10
|
-
minutes?: number;
|
|
11
|
-
/** Replaces the caption the kind and `minutes` give. */
|
|
12
|
-
caption?: ReactNode;
|
|
13
|
-
/** Classes for the row. */
|
|
14
|
-
className?: string;
|
|
15
|
-
}
|
|
16
|
-
type Element_12xgc = JSX_1kxb["Element"];
|
|
17
|
-
/**
|
|
18
|
-
* A notch app's power alert: a charger plugged in or out, or the battery
|
|
19
|
-
* running low, as the island's flash.
|
|
20
|
-
*
|
|
21
|
-
* Each kind brings its icon, title and status hue: charging in success,
|
|
22
|
-
* unplugged in the text color, low in warning (at 20%), critical in error
|
|
23
|
-
* (at 10%). The level shows as a figure in that hue and as a BatteryGlyph
|
|
24
|
-
* that fills up from empty as the flash opens. With `minutes`, the caption
|
|
25
|
-
* says how long until full or how much is left; low and critical say to plug
|
|
26
|
-
* in. Pass it as the Island's `flash`, keyed by kind, so one alert replacing
|
|
27
|
-
* another swaps instead of updating in place.
|
|
28
|
-
*
|
|
29
|
-
* @example {@include ./examples.mdx}
|
|
30
|
-
*/
|
|
31
|
-
declare function PowerAlert2({ kind, level, minutes, caption, className }: PowerAlertProps2): Element_12xgc;
|
|
32
|
-
export { PowerAlertKind2, PowerAlertProps2, PowerAlert2 };
|