@justanarthur/modo-ui-notch 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/blocks/activities/agenda/examples.mdx +21 -5
- package/blocks/activities/agenda/index.tsx +291 -182
- package/blocks/activities/clock/examples.mdx +73 -0
- package/blocks/activities/clock/index.tsx +619 -0
- package/blocks/activities/now-playing/examples.mdx +32 -13
- package/blocks/activities/now-playing/index.tsx +319 -126
- package/blocks/activities/weather/examples.mdx +115 -0
- package/blocks/activities/weather/index.tsx +634 -0
- package/blocks/app/expanded-island/examples.mdx +8 -7
- package/blocks/app/expanded-island/index.tsx +19 -3
- package/blocks/app/settings-window/examples.mdx +6 -2
- package/blocks/app/settings-window/index.tsx +25 -7
- package/blocks/system/clipboard/examples.mdx +83 -0
- package/blocks/system/clipboard/index.tsx +563 -0
- package/blocks/system/recent-files/examples.mdx +66 -0
- package/blocks/system/recent-files/index.tsx +542 -0
- package/blocks/system/system-stats/examples.mdx +38 -9
- package/blocks/system/system-stats/index.tsx +241 -107
- package/components/indicators/media-scrubber/examples.mdx +8 -0
- package/components/indicators/media-scrubber/index.tsx +37 -13
- package/components/island/island/examples.mdx +4 -4
- package/components/island/island/index.tsx +2 -2
- package/components/island/island-flash/examples.mdx +15 -18
- package/components/island/island-flash/index.tsx +4 -4
- package/components/island/island-tabs/examples.mdx +5 -5
- package/components/island/widget/examples.mdx +76 -0
- package/components/island/widget/index.tsx +431 -0
- package/dist/blocks/activities/agenda/index.d.ts +1 -1
- package/dist/blocks/activities/agenda/index.js +3 -3
- package/dist/blocks/activities/clock/index.d.ts +2 -0
- package/dist/blocks/activities/clock/index.js +25 -0
- package/dist/blocks/activities/now-playing/index.d.ts +3 -2
- package/dist/blocks/activities/now-playing/index.js +5 -3
- package/dist/blocks/activities/weather/index.d.ts +2 -0
- package/dist/blocks/activities/weather/index.js +21 -0
- package/dist/blocks/app/expanded-island/index.d.ts +1 -1
- package/dist/blocks/app/expanded-island/index.js +4 -3
- package/dist/blocks/app/settings-window/index.d.ts +1 -1
- package/dist/blocks/app/settings-window/index.js +1 -1
- package/dist/blocks/system/clipboard/index.d.ts +2 -0
- package/dist/blocks/system/clipboard/index.js +17 -0
- package/dist/blocks/system/recent-files/index.d.ts +2 -0
- package/dist/blocks/system/recent-files/index.js +19 -0
- package/dist/blocks/system/system-stats/index.d.ts +2 -2
- package/dist/blocks/system/system-stats/index.js +4 -1
- package/dist/components/indicators/media-scrubber/index.d.ts +1 -1
- package/dist/components/indicators/media-scrubber/index.js +1 -1
- package/dist/components/island/island/index.d.ts +1 -1
- package/dist/components/island/island/index.js +2 -2
- package/dist/components/island/island-flash/index.d.ts +1 -1
- package/dist/components/island/island-flash/index.js +1 -1
- package/dist/components/island/island-tabs/index.js +2 -2
- package/dist/components/island/widget/index.d.ts +2 -0
- package/dist/components/island/widget/index.js +30 -0
- package/dist/index.d.ts +15 -15
- package/dist/index.js +102 -58
- package/dist/lib/artwork.d.ts +2 -0
- package/dist/lib/artwork.js +8 -0
- package/dist/lib/geometry.js +1 -1
- package/dist/shared/chunk-2818esrq.d.ts +140 -0
- package/dist/shared/{chunk-yngkkxz2.d.ts → chunk-2m5dz8nf.d.ts} +4 -4
- package/dist/shared/chunk-3thgcfcq.d.ts +151 -0
- package/dist/shared/chunk-416tsgbc.d.ts +175 -0
- package/dist/shared/{chunk-zvh0d3qb.js → chunk-61t2dfte.js} +1 -1
- package/dist/shared/chunk-7fvnrtz4.d.ts +105 -0
- package/dist/shared/{chunk-hpsabfsd.d.ts → chunk-81fpptwp.d.ts} +1 -1
- package/dist/shared/chunk-9c7ewvkk.js +381 -0
- package/dist/shared/{chunk-mp1nx0ez.js → chunk-9m0xbg5v.js} +14 -3
- package/dist/shared/{chunk-wwjxs75m.js → chunk-9xtcv3sy.js} +26 -12
- package/dist/shared/chunk-bvtyjcce.d.ts +123 -0
- package/dist/shared/{chunk-s33y1pcq.js → chunk-cc9nwbtf.js} +20 -10
- package/dist/shared/chunk-da177e8r.d.ts +114 -0
- package/dist/shared/{chunk-6c1jbefs.d.ts → chunk-fexwzycv.d.ts} +3 -3
- package/dist/shared/chunk-gejenfap.d.ts +25 -0
- package/dist/shared/{chunk-rr5e0g15.d.ts → chunk-j755a1a5.d.ts} +7 -1
- package/dist/shared/chunk-j77cx8dp.js +498 -0
- package/dist/shared/chunk-mt0k6v8x.js +474 -0
- package/dist/shared/{chunk-78w7qwp0.js → chunk-ndf79pv5.js} +1 -1
- package/dist/shared/{chunk-9nhpg9t8.d.ts → chunk-pfhy5e4q.d.ts} +7 -1
- package/dist/shared/chunk-qdzemt2v.js +477 -0
- package/dist/shared/{chunk-rpfwv3pz.js → chunk-r471sknr.js} +1 -1
- package/dist/shared/chunk-s2jeqqan.js +243 -0
- package/dist/shared/chunk-t0hcxh89.d.ts +124 -0
- package/dist/shared/chunk-w5h6ay93.js +72 -0
- package/dist/shared/chunk-wkg17nxs.d.ts +101 -0
- package/dist/shared/chunk-x7f3g82r.js +285 -0
- package/dist/shared/chunk-xq5hc5gv.js +333 -0
- package/dist/shared/{chunk-sbnrhy5m.js → chunk-y0188bbn.js} +2 -2
- package/dist/shared/chunk-ym0xbses.js +518 -0
- package/dist/styles.css +97 -55
- package/index.ts +7 -6
- package/lib/artwork.ts +112 -0
- package/lib/geometry.ts +1 -1
- package/mock/activities.tsx +9 -32
- package/mock/artwork.tsx +13 -1
- package/mock/clipboard.tsx +79 -0
- package/mock/clock.tsx +77 -0
- package/mock/data.ts +30 -44
- package/mock/files.tsx +70 -0
- package/mock/island-content.tsx +43 -118
- package/mock/screen.tsx +76 -0
- package/mock/settings.tsx +370 -91
- package/mock/system.ts +46 -0
- package/mock/weather.tsx +105 -0
- package/package.json +7 -2
- package/blocks/activities/shelf/examples.mdx +0 -33
- package/blocks/activities/shelf/index.tsx +0 -289
- package/blocks/activities/timer/examples.mdx +0 -52
- package/blocks/activities/timer/index.tsx +0 -292
- package/blocks/system/controls/examples.mdx +0 -34
- package/blocks/system/controls/index.tsx +0 -167
- package/blocks/system/devices/examples.mdx +0 -25
- package/blocks/system/devices/index.tsx +0 -172
- package/blocks/system/power-alert/examples.mdx +0 -32
- package/blocks/system/power-alert/index.tsx +0 -89
- package/components/indicators/battery-glyph/examples.mdx +0 -22
- package/components/indicators/battery-glyph/index.tsx +0 -91
- package/dist/blocks/activities/shelf/index.d.ts +0 -2
- package/dist/blocks/activities/shelf/index.js +0 -14
- package/dist/blocks/activities/timer/index.d.ts +0 -2
- package/dist/blocks/activities/timer/index.js +0 -19
- package/dist/blocks/system/controls/index.d.ts +0 -2
- package/dist/blocks/system/controls/index.js +0 -10
- package/dist/blocks/system/devices/index.d.ts +0 -2
- package/dist/blocks/system/devices/index.js +0 -12
- package/dist/blocks/system/power-alert/index.d.ts +0 -2
- package/dist/blocks/system/power-alert/index.js +0 -9
- package/dist/components/indicators/battery-glyph/index.d.ts +0 -2
- package/dist/components/indicators/battery-glyph/index.js +0 -9
- package/dist/shared/chunk-2qpcsv5h.d.ts +0 -45
- package/dist/shared/chunk-45gytfr1.d.ts +0 -84
- package/dist/shared/chunk-50ffk4r7.d.ts +0 -69
- package/dist/shared/chunk-5w0yck07.d.ts +0 -32
- package/dist/shared/chunk-7hr53mby.js +0 -116
- package/dist/shared/chunk-b8jb1w72.js +0 -145
- package/dist/shared/chunk-cpewy6yg.js +0 -178
- package/dist/shared/chunk-e3e4s4ds.d.ts +0 -77
- package/dist/shared/chunk-enm6td0p.js +0 -280
- package/dist/shared/chunk-fvedaas2.d.ts +0 -33
- package/dist/shared/chunk-gex38j8x.d.ts +0 -82
- package/dist/shared/chunk-hwtxpzg0.js +0 -69
- package/dist/shared/chunk-phb53x1f.js +0 -252
- package/dist/shared/chunk-r8esmjfs.d.ts +0 -42
- package/dist/shared/chunk-rcp1g9ca.js +0 -70
- package/dist/shared/chunk-rx9sphz2.js +0 -266
- package/dist/shared/chunk-xdeek16r.d.ts +0 -58
- package/dist/shared/chunk-xkzjk1tq.js +0 -206
package/dist/styles.css
CHANGED
|
@@ -38,151 +38,188 @@
|
|
|
38
38
|
}
|
|
39
39
|
/* layer: default */
|
|
40
40
|
@layer default{
|
|
41
|
-
|
|
41
|
+
.\[\&_circle\:last-child\]\:text-status-success circle:last-child,
|
|
42
|
+
.text-status-success{color:color-mix(in srgb, var(--status-success) var(--un-text-opacity), transparent);}
|
|
43
|
+
.\[\&_circle\:last-child\]\:text-status-warning circle:last-child,
|
|
44
|
+
.text-status-warning{color:color-mix(in srgb, var(--status-warning) var(--un-text-opacity), transparent);}
|
|
45
|
+
.text-border{color:color-mix(in srgb, var(--border) var(--un-text-opacity), transparent);}
|
|
42
46
|
.text-foreground{color:color-mix(in srgb, var(--foreground) var(--un-text-opacity), transparent);}
|
|
43
47
|
.text-muted-foreground{color:color-mix(in srgb, var(--muted-foreground) var(--un-text-opacity), transparent);}
|
|
44
48
|
.text-status-error{color:color-mix(in srgb, var(--status-error) var(--un-text-opacity), transparent);}
|
|
45
49
|
.text-status-info{color:color-mix(in srgb, var(--status-info) var(--un-text-opacity), transparent);}
|
|
46
|
-
.
|
|
47
|
-
.text-status-warning{color:color-mix(in srgb, var(--status-warning) var(--un-text-opacity), transparent);}
|
|
50
|
+
.font-mono{font-family:var(--font-mono);}
|
|
48
51
|
.tab{-moz-tab-size:4;-o-tab-size:4;tab-size:4;}
|
|
52
|
+
.-m-1{margin:calc(var(--spacing) * -1);}
|
|
49
53
|
.m-0{margin:calc(var(--spacing) * 0);}
|
|
50
|
-
|
|
51
|
-
.-
|
|
54
|
+
.-mx-2{margin-inline:calc(var(--spacing) * -2);}
|
|
55
|
+
.-my-1{margin-block:calc(var(--spacing) * -1);}
|
|
52
56
|
.mx-auto{margin-inline:auto;}
|
|
53
|
-
.-
|
|
57
|
+
.-ml-2{margin-left:calc(var(--spacing) * -2);}
|
|
58
|
+
.-mr-1{margin-right:calc(var(--spacing) * -1);}
|
|
59
|
+
.-mr-2{margin-right:calc(var(--spacing) * -2);}
|
|
54
60
|
.mb-0{margin-bottom:calc(var(--spacing) * 0);}
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
.
|
|
58
|
-
.
|
|
59
|
-
.
|
|
61
|
+
.mb-1{margin-bottom:calc(var(--spacing) * 1);}
|
|
62
|
+
.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5);}
|
|
63
|
+
.ml-1{margin-left:calc(var(--spacing) * 1);}
|
|
64
|
+
.ml-1\.5{margin-left:calc(var(--spacing) * 1.5);}
|
|
65
|
+
.mt-1{margin-top:calc(var(--spacing) * 1);}
|
|
66
|
+
.mt-1\.5{margin-top:calc(var(--spacing) * 1.5);}
|
|
67
|
+
.mt-2{margin-top:calc(var(--spacing) * 2);}
|
|
68
|
+
.p-1{padding:calc(var(--spacing) * 1);}
|
|
60
69
|
.p-8{padding:calc(var(--spacing) * 8);}
|
|
61
70
|
.px{padding-inline:calc(var(--spacing) * 4);}
|
|
62
|
-
.px-
|
|
63
|
-
.px-3{padding-inline:calc(var(--spacing) * 3);}
|
|
71
|
+
.px-2{padding-inline:calc(var(--spacing) * 2);}
|
|
64
72
|
.px-5{padding-inline:calc(var(--spacing) * 5);}
|
|
65
73
|
.py-1{padding-block:calc(var(--spacing) * 1);}
|
|
74
|
+
.pb{padding-bottom:calc(var(--spacing) * 4);}
|
|
66
75
|
.pb-1{padding-bottom:calc(var(--spacing) * 1);}
|
|
67
76
|
.pb-3{padding-bottom:calc(var(--spacing) * 3);}
|
|
77
|
+
.pl-17\.5{padding-left:calc(var(--spacing) * 17.5);}
|
|
78
|
+
.pl-4{padding-left:calc(var(--spacing) * 4);}
|
|
79
|
+
.pl-4\.5{padding-left:calc(var(--spacing) * 4.5);}
|
|
80
|
+
.pl-5{padding-left:calc(var(--spacing) * 5);}
|
|
81
|
+
.pr{padding-right:calc(var(--spacing) * 4);}
|
|
82
|
+
.pr-1{padding-right:calc(var(--spacing) * 1);}
|
|
68
83
|
.pr-3{padding-right:calc(var(--spacing) * 3);}
|
|
69
|
-
.text-center{text-align:center;}
|
|
70
84
|
.text-right{text-align:right;}
|
|
71
85
|
.outline{outline-style:var(--un-outline-style);outline-width:1px;}
|
|
72
86
|
.outline-none{--un-outline-style:none;outline-style:none;}
|
|
73
|
-
.
|
|
74
|
-
.border{border-width:1px;}
|
|
75
|
-
.border-
|
|
76
|
-
.
|
|
87
|
+
.b{border-width:1px;}
|
|
88
|
+
.border-l{border-left-width:1px;}
|
|
89
|
+
.border-border{border-color:color-mix(in srgb, var(--border) var(--un-border-opacity), transparent);}
|
|
90
|
+
.rounded-\[inherit\]{border-radius:inherit;}
|
|
77
91
|
.rounded-2xl{border-radius:var(--radius-2xl);}
|
|
78
92
|
.rounded-full{border-radius:calc(infinity * 1px);}
|
|
79
93
|
.rounded-lg{border-radius:var(--radius-lg);}
|
|
80
94
|
.rounded-md{border-radius:var(--radius-md);}
|
|
95
|
+
.rounded-sm{border-radius:var(--radius-sm);}
|
|
81
96
|
.rounded-xl{border-radius:var(--radius-xl);}
|
|
82
|
-
.rounded-r-full{border-top-right-radius:calc(infinity * 1px);border-bottom-right-radius:calc(infinity * 1px);}
|
|
83
|
-
.border-dashed{--un-border-style:dashed;border-style:dashed;}
|
|
84
97
|
.bg-active{background-color:color-mix(in srgb, var(--active) var(--un-bg-opacity), transparent);}
|
|
98
|
+
.bg-current{background-color:currentColor;}
|
|
85
99
|
.bg-foreground{background-color:color-mix(in srgb, var(--foreground) var(--un-bg-opacity), transparent);}
|
|
86
100
|
.bg-ink{background-color:color-mix(in srgb, var(--ink) var(--un-bg-opacity), transparent);}
|
|
87
|
-
.bg-status-error{background-color:color-mix(in srgb, var(--status-error)
|
|
101
|
+
.bg-status-error\/16{background-color:color-mix(in srgb, var(--status-error) 16%, transparent);}
|
|
102
|
+
.bg-status-info\/16{background-color:color-mix(in srgb, var(--status-info) 16%, transparent);}
|
|
88
103
|
.bg-status-success{background-color:color-mix(in srgb, var(--status-success) var(--un-bg-opacity), transparent);}
|
|
104
|
+
.bg-status-success\/16{background-color:color-mix(in srgb, var(--status-success) 16%, transparent);}
|
|
89
105
|
.bg-status-warning{background-color:color-mix(in srgb, var(--status-warning) var(--un-bg-opacity), transparent);}
|
|
90
|
-
.bg-
|
|
91
|
-
.bg-surface-3{background-color:color-mix(in srgb, var(--surface-3) var(--un-bg-opacity), transparent);}
|
|
106
|
+
.bg-status-warning\/16{background-color:color-mix(in srgb, var(--status-warning) 16%, transparent);}
|
|
92
107
|
.bg-transparent{background-color:transparent;}
|
|
108
|
+
.opacity-0,
|
|
109
|
+
.group\/scrub:focus-within .group-focus-within\/scrub\:opacity-0,
|
|
110
|
+
.group\/scrub:hover .group-hover\/scrub\:opacity-0{opacity:0%;}
|
|
111
|
+
.opacity-70{opacity:70%;}
|
|
112
|
+
.group\/scrub:focus-within .group-focus-within\/scrub\:opacity-100,
|
|
113
|
+
.group\/scrub:hover .group-hover\/scrub\:opacity-100{opacity:100%;}
|
|
114
|
+
.\@container{container-type:inline-size;}
|
|
93
115
|
.\[\&\>div\]\:flex>div,
|
|
94
116
|
.flex{display:flex;}
|
|
95
117
|
.inline-flex{display:inline-flex;}
|
|
96
118
|
.\[\&\>\*\]\:flex-1>*,
|
|
97
119
|
.flex-1{flex:1 1 0%;}
|
|
98
|
-
.shrink-\[100\]{flex-shrink:100;}
|
|
99
120
|
.shrink-0{flex-shrink:0;}
|
|
121
|
+
.last\:shrink-\[100\]:last-child{flex-shrink:100;}
|
|
100
122
|
.grow{flex-grow:1;}
|
|
101
123
|
.\[\&\>div\]\:flex-col>div,
|
|
102
124
|
.flex-col{flex-direction:column;}
|
|
125
|
+
.gap-0{gap:calc(var(--spacing) * 0);}
|
|
103
126
|
.gap-0\.5{gap:calc(var(--spacing) * 0.5);}
|
|
104
127
|
.gap-1{gap:calc(var(--spacing) * 1);}
|
|
105
128
|
.gap-1\.5{gap:calc(var(--spacing) * 1.5);}
|
|
106
129
|
.gap-2{gap:calc(var(--spacing) * 2);}
|
|
130
|
+
.gap-2\.5{gap:calc(var(--spacing) * 2.5);}
|
|
107
131
|
.gap-3{gap:calc(var(--spacing) * 3);}
|
|
108
132
|
.gap-4{gap:calc(var(--spacing) * 4);}
|
|
109
133
|
.gap-5{gap:calc(var(--spacing) * 5);}
|
|
110
134
|
.gap-8{gap:calc(var(--spacing) * 8);}
|
|
111
|
-
.gap-px{gap:1px;}
|
|
112
|
-
.gap-x-8{column-gap:calc(var(--spacing) * 8);}
|
|
113
135
|
.grid{display:grid;}
|
|
114
136
|
.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr;}
|
|
115
|
-
.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr));}
|
|
116
137
|
.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr));}
|
|
117
|
-
.
|
|
118
|
-
.size-
|
|
119
|
-
.size-14{width:calc(var(--spacing) * 14);height:calc(var(--spacing) * 14);}
|
|
120
|
-
.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16);}
|
|
121
|
-
.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2);}
|
|
138
|
+
.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5);}
|
|
139
|
+
.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);}
|
|
122
140
|
.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);}
|
|
123
|
-
.size-
|
|
124
|
-
.size-
|
|
141
|
+
.size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20);}
|
|
142
|
+
.size-24{width:calc(var(--spacing) * 24);height:calc(var(--spacing) * 24);}
|
|
143
|
+
.size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28);}
|
|
144
|
+
.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5);}
|
|
145
|
+
.size-36{width:calc(var(--spacing) * 36);height:calc(var(--spacing) * 36);}
|
|
146
|
+
.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);}
|
|
125
147
|
.size-5\.5{width:calc(var(--spacing) * 5.5);height:calc(var(--spacing) * 5.5);}
|
|
126
148
|
.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);}
|
|
127
149
|
.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);}
|
|
150
|
+
.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);}
|
|
128
151
|
.size-full{width:100%;height:100%;}
|
|
129
|
-
.\[\&\>div\]\:min-h-full>div
|
|
130
|
-
.
|
|
131
|
-
.h-1\.5{height:calc(var(--spacing) * 1.5);}
|
|
132
|
-
.h-10{height:calc(var(--spacing) * 10);}
|
|
133
|
-
.h-11{height:calc(var(--spacing) * 11);}
|
|
152
|
+
.\[\&\>div\]\:min-h-full>div{min-height:100%;}
|
|
153
|
+
.h-1{height:calc(var(--spacing) * 1);}
|
|
134
154
|
.h-14{height:calc(var(--spacing) * 14);}
|
|
155
|
+
.h-24{height:calc(var(--spacing) * 24);}
|
|
156
|
+
.h-3{height:calc(var(--spacing) * 3);}
|
|
135
157
|
.h-3\.5{height:calc(var(--spacing) * 3.5);}
|
|
158
|
+
.h-4{height:calc(var(--spacing) * 4);}
|
|
136
159
|
.h-5{height:calc(var(--spacing) * 5);}
|
|
137
160
|
.h-6{height:calc(var(--spacing) * 6);}
|
|
138
161
|
.h-7{height:calc(var(--spacing) * 7);}
|
|
162
|
+
.h-8{height:calc(var(--spacing) * 8);}
|
|
139
163
|
.h-9{height:calc(var(--spacing) * 9);}
|
|
140
|
-
.h-auto{height:auto;}
|
|
141
164
|
.h-full{height:100%;}
|
|
142
165
|
.h2{height:calc(var(--spacing) * 2);}
|
|
143
|
-
.
|
|
166
|
+
.h23{height:calc(var(--spacing) * 23);}
|
|
167
|
+
.max-w-120{max-width:calc(var(--spacing) * 120);}
|
|
144
168
|
.max-w-160{max-width:calc(var(--spacing) * 160);}
|
|
169
|
+
.max-w-24{max-width:calc(var(--spacing) * 24);}
|
|
145
170
|
.min-h-0{min-height:calc(var(--spacing) * 0);}
|
|
146
171
|
.min-w-0{min-width:calc(var(--spacing) * 0);}
|
|
147
172
|
.min-w-full{min-width:100%;}
|
|
148
|
-
.w
|
|
173
|
+
.w-\[42\%\]{width:42%;}
|
|
149
174
|
.w-0\.75{width:calc(var(--spacing) * 0.75);}
|
|
150
|
-
.w-1{width:calc(var(--spacing) * 1);}
|
|
151
175
|
.w-10{width:calc(var(--spacing) * 10);}
|
|
152
|
-
.w-
|
|
176
|
+
.w-15{width:calc(var(--spacing) * 15);}
|
|
153
177
|
.w-20{width:calc(var(--spacing) * 20);}
|
|
178
|
+
.w-28{width:calc(var(--spacing) * 28);}
|
|
179
|
+
.w-36{width:calc(var(--spacing) * 36);}
|
|
180
|
+
.w-40{width:calc(var(--spacing) * 40);}
|
|
181
|
+
.w-56{width:calc(var(--spacing) * 56);}
|
|
182
|
+
.w-6{width:calc(var(--spacing) * 6);}
|
|
154
183
|
.w-7{width:calc(var(--spacing) * 7);}
|
|
155
184
|
.w-7\.5{width:calc(var(--spacing) * 7.5);}
|
|
156
185
|
.w-9{width:calc(var(--spacing) * 9);}
|
|
157
186
|
.w-full{width:100%;}
|
|
158
187
|
.w-max{width:max-content;}
|
|
188
|
+
.aspect-\[16\/10\]{aspect-ratio:16/10;}
|
|
159
189
|
.block{display:block;}
|
|
160
190
|
.hidden{display:none;}
|
|
161
191
|
.collapse{visibility:collapse;}
|
|
162
192
|
.cursor-pointer{cursor:pointer;}
|
|
193
|
+
.cursor-grab{cursor:grab;}
|
|
163
194
|
.pointer-events-auto{pointer-events:auto;}
|
|
164
195
|
.pointer-events-none{pointer-events:none;}
|
|
165
196
|
.whitespace-nowrap{white-space:nowrap;}
|
|
197
|
+
.break-words{overflow-wrap:break-word;}
|
|
198
|
+
.text-pretty{text-wrap:pretty;}
|
|
166
199
|
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
167
|
-
.ring
|
|
200
|
+
.ring,
|
|
201
|
+
.ring-1{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(1px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
|
|
168
202
|
.focus-visible\:ring-1:focus-visible{--un-ring-shadow:var(--un-ring-inset,) 0 0 0 calc(1px + var(--un-ring-offset-width)) var(--un-ring-color, currentColor);box-shadow:var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}
|
|
203
|
+
.ring-border{--un-ring-color:color-mix(in srgb, var(--border) var(--un-ring-opacity), transparent);}
|
|
169
204
|
.focus-visible\:ring-focus-ring:focus-visible{--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent);}
|
|
170
|
-
.
|
|
205
|
+
.ring-inset{--un-ring-inset:inset;}
|
|
206
|
+
.-rotate-90{rotate:-90deg;}
|
|
171
207
|
.transform{transform:var(--un-rotate-x) var(--un-rotate-y) var(--un-rotate-z) var(--un-skew-x) var(--un-skew-y);}
|
|
172
208
|
.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,--un-gradient-from,--un-gradient-via,--un-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
173
|
-
.transition-\[border-color\]{transition-property:border-color;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
174
209
|
.transition-\[color\]{transition-property:color;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
210
|
+
.transition-\[opacity\]{transition-property:opacity;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
175
211
|
.transition-\[stroke-width\]{transition-property:stroke-width;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
176
212
|
.ease{--un-ease:var(--ease-DEFAULT);transition-timing-function:var(--ease-DEFAULT);}
|
|
177
213
|
.ease-in-out{--un-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out);}
|
|
178
214
|
.\[--scroll-fade-size\:16px\]{--scroll-fade-size:16px;}
|
|
179
|
-
.content-center{align-content:center;}
|
|
180
|
-
.content-start{align-content:flex-start;}
|
|
181
215
|
.items-start{align-items:flex-start;}
|
|
182
216
|
.items-end{align-items:flex-end;}
|
|
183
217
|
.items-center{align-items:center;}
|
|
184
218
|
.items-baseline{align-items:baseline;}
|
|
219
|
+
.items-stretch{align-items:stretch;}
|
|
185
220
|
.inset-0{inset:calc(var(--spacing) * 0);}
|
|
221
|
+
.-inset-x-8{inset-inline:calc(var(--spacing) * -8);}
|
|
222
|
+
.-inset-y-4{inset-block:calc(var(--spacing) * -4);}
|
|
186
223
|
.inset-x-0{inset-inline:calc(var(--spacing) * 0);}
|
|
187
224
|
.inset-y-0{inset-block:calc(var(--spacing) * 0);}
|
|
188
225
|
.bottom-0{bottom:calc(var(--spacing) * 0);}
|
|
@@ -190,33 +227,38 @@
|
|
|
190
227
|
.left-1\/2{left:50%;}
|
|
191
228
|
.right-0{right:calc(var(--spacing) * 0);}
|
|
192
229
|
.top-0{top:calc(var(--spacing) * 0);}
|
|
193
|
-
.justify-
|
|
230
|
+
.justify-end{justify-content:flex-end;}
|
|
194
231
|
.justify-center{justify-content:center;}
|
|
195
232
|
.justify-between{justify-content:space-between;}
|
|
196
233
|
.absolute{position:absolute;}
|
|
197
234
|
.relative{position:relative;}
|
|
235
|
+
.-z-1{z-index:-1;}
|
|
198
236
|
.z-10{z-index:10;}
|
|
199
237
|
.overflow-hidden{overflow:hidden;}
|
|
200
238
|
.overflow-visible{overflow:visible;}
|
|
201
239
|
.overflow-x-auto{overflow-x:auto;}
|
|
202
240
|
.overflow-y-hidden{overflow-y:hidden;}
|
|
203
|
-
.fill-foreground{fill:color-mix(in srgb, var(--foreground) var(--un-fill-opacity), transparent);}
|
|
204
241
|
.fill-ink{fill:color-mix(in srgb, var(--ink) var(--un-fill-opacity), transparent);}
|
|
242
|
+
.stroke-current{stroke:currentColor;}
|
|
243
|
+
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}
|
|
244
|
+
.isolate{isolation:isolate;}
|
|
205
245
|
.object-cover{object-fit:cover;}
|
|
206
246
|
.blur{--un-blur:blur(8px);filter:var(--un-blur,) var(--un-brightness,) var(--un-contrast,) var(--un-grayscale,) var(--un-hue-rotate,) var(--un-invert,) var(--un-saturate,) var(--un-sepia,) var(--un-drop-shadow,);}
|
|
207
247
|
.filter{filter:var(--un-blur,) var(--un-brightness,) var(--un-contrast,) var(--un-grayscale,) var(--un-hue-rotate,) var(--un-invert,) var(--un-saturate,) var(--un-sepia,) var(--un-drop-shadow,);}
|
|
248
|
+
.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;}
|
|
208
249
|
.tabular-nums{--un-numeric-spacing:tabular-nums;font-variant-numeric:var(--un-ordinal,) var(--un-slashed-zero,) var(--un-numeric-figure,) var(--un-numeric-spacing,) var(--un-numeric-fraction,);}
|
|
209
250
|
.text-display{font-size:var(--text-display);line-height:var(--leading-display);}
|
|
251
|
+
.text-display-compact{font-size:var(--text-display-compact);line-height:var(--leading-display);}
|
|
210
252
|
.text-title{font-size:var(--text-title);line-height:var(--leading-title);}
|
|
253
|
+
.text-title-compact{font-size:var(--text-title-compact);line-height:var(--leading-title);}
|
|
211
254
|
.text-subtitle{font-size:var(--text-subtitle);line-height:var(--leading-subtitle);}
|
|
212
255
|
.text-body{font-size:var(--text-body);line-height:var(--leading-body);}
|
|
256
|
+
.text-body-compact{font-size:var(--text-body-compact);line-height:var(--leading-body);}
|
|
213
257
|
.text-caption{font-size:var(--text-caption);line-height:var(--leading-caption);}
|
|
258
|
+
.text-caption-compact{font-size:var(--text-caption-compact);line-height:var(--leading-caption);}
|
|
214
259
|
.text-micro{font-size:var(--text-micro);line-height:var(--leading-micro);}
|
|
215
|
-
.weight-normal{font-variation-settings:var(--weight-normal);}
|
|
216
260
|
.weight-medium{font-variation-settings:var(--weight-medium);}
|
|
217
261
|
.weight-semibold{font-variation-settings:var(--weight-semibold);}
|
|
262
|
+
.weight-bold{font-variation-settings:var(--weight-bold);}
|
|
218
263
|
.duration-fast{--un-duration:var(--duration-fast);transition-duration:var(--duration-fast);}
|
|
219
|
-
.duration-moderate{--un-duration:var(--duration-moderate);transition-duration:var(--duration-moderate);}
|
|
220
|
-
.rounded-box{border-radius:var(--radius-box);}
|
|
221
|
-
.rounded-glyph{border-radius:var(--radius-glyph);}
|
|
222
264
|
}
|
package/index.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
export * from './blocks/activities/agenda'
|
|
2
|
+
export * from './blocks/activities/clock'
|
|
2
3
|
export * from './blocks/activities/now-playing'
|
|
3
|
-
export * from './blocks/activities/
|
|
4
|
-
export * from './blocks/activities/timer'
|
|
4
|
+
export * from './blocks/activities/weather'
|
|
5
5
|
export * from './blocks/app/expanded-island'
|
|
6
6
|
export * from './blocks/app/settings-window'
|
|
7
|
-
export * from './blocks/system/
|
|
8
|
-
export * from './blocks/system/
|
|
9
|
-
export * from './blocks/system/power-alert'
|
|
7
|
+
export * from './blocks/system/clipboard'
|
|
8
|
+
export * from './blocks/system/recent-files'
|
|
10
9
|
export * from './blocks/system/system-stats'
|
|
11
|
-
export * from './components/indicators/battery-glyph'
|
|
12
10
|
export * from './components/indicators/countdown'
|
|
13
11
|
export * from './components/indicators/equalizer'
|
|
14
12
|
export * from './components/indicators/media-scrubber'
|
|
15
13
|
export * from './components/island/island'
|
|
16
14
|
export * from './components/island/island-flash'
|
|
17
15
|
export * from './components/island/island-tabs'
|
|
16
|
+
export * from './components/island/widget'
|
|
17
|
+
export type { Artwork, ShownArtwork } from './lib/artwork'
|
|
18
|
+
export { useArtworkTint, useStableArtwork } from './lib/artwork'
|
|
18
19
|
export { formatClock, formatShort, useEdgeClock } from './lib/clock'
|
|
19
20
|
export * from './lib/geometry'
|
|
20
21
|
export type { IslandContextValue } from './lib/island-context'
|
package/lib/artwork.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Artwork that never blinks: the last good picture stays up while the next
|
|
3
|
+
* one loads, or while an update arrives without one for the same track, and
|
|
4
|
+
* only a track that truly has none falls back to the placeholder. Plus the
|
|
5
|
+
* tint a picture lends the widget around it.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use client'
|
|
9
|
+
|
|
10
|
+
import { type ReactNode, useEffect, useState } from 'react'
|
|
11
|
+
|
|
12
|
+
/** A track's picture: an image URL or any element; `null` when the track has none, `undefined` while it isn't known yet. */
|
|
13
|
+
export type Artwork = string | ReactNode
|
|
14
|
+
|
|
15
|
+
/** What the artwork tile shows: a picture, or the placeholder (`art: null`), under an `id` that changes only when the picture does. */
|
|
16
|
+
export interface ShownArtwork {
|
|
17
|
+
id: string
|
|
18
|
+
art: Artwork | null
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const NONE = 'none'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The artwork to show for the track `trackKey` names, held across updates.
|
|
25
|
+
*
|
|
26
|
+
* A URL is decoded before it replaces what's shown, so the swap is never to
|
|
27
|
+
* a blank. An update without artwork (`undefined`, or `null` for the same
|
|
28
|
+
* track) keeps the last good picture. A new track with `null`, or a URL that
|
|
29
|
+
* fails to load for a new track, shows the placeholder.
|
|
30
|
+
*/
|
|
31
|
+
export function useStableArtwork(artwork: Artwork | null | undefined, trackKey: string): ShownArtwork {
|
|
32
|
+
const id = typeof artwork === 'string' ? artwork : `node:${trackKey}`
|
|
33
|
+
const [shown, setShown] = useState<ShownArtwork & { track: string }>(() =>
|
|
34
|
+
artwork == null ? { id: NONE, art: null, track: trackKey } : { id, art: artwork, track: trackKey },
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (artwork === undefined) return
|
|
39
|
+
if (artwork === null) {
|
|
40
|
+
setShown(prev => (prev.track === trackKey ? prev : { id: NONE, art: null, track: trackKey }))
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
if (typeof artwork !== 'string') {
|
|
44
|
+
setShown(prev => (prev.id === id ? prev : { id, art: artwork, track: trackKey }))
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
let live = true
|
|
48
|
+
const image = new Image()
|
|
49
|
+
image.src = artwork
|
|
50
|
+
image.decode().then(
|
|
51
|
+
() => live && setShown(prev => (prev.id === id ? prev : { id, art: artwork, track: trackKey })),
|
|
52
|
+
() => live && setShown(prev => (prev.track === trackKey ? prev : { id: NONE, art: null, track: trackKey })),
|
|
53
|
+
)
|
|
54
|
+
return () => {
|
|
55
|
+
live = false
|
|
56
|
+
}
|
|
57
|
+
// `artwork` is read through `id`: an element is a new object on every render.
|
|
58
|
+
}, [id, trackKey, artwork === null, artwork === undefined])
|
|
59
|
+
|
|
60
|
+
// The same picture as an element: render the current one, so its props stay fresh.
|
|
61
|
+
if (shown.id === id && artwork != null && typeof artwork !== 'string') return { id, art: artwork }
|
|
62
|
+
return shown
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const SAMPLE = 12
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The color an image URL leans to, as `rgb(…)`: its pixels averaged, the
|
|
69
|
+
* vivid ones weighted up, so a mostly grey cover still lends its accent.
|
|
70
|
+
* Read once per URL; `undefined` until then, or when the image can't be
|
|
71
|
+
* read (a cross-origin image without CORS).
|
|
72
|
+
*/
|
|
73
|
+
export function useArtworkTint(src?: string) {
|
|
74
|
+
const [tint, setTint] = useState<{ src: string; color?: string }>()
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!src) return
|
|
78
|
+
let live = true
|
|
79
|
+
const image = new Image()
|
|
80
|
+
image.crossOrigin = 'anonymous'
|
|
81
|
+
image.src = src
|
|
82
|
+
image
|
|
83
|
+
.decode()
|
|
84
|
+
.then(() => {
|
|
85
|
+
const canvas = document.createElement('canvas')
|
|
86
|
+
canvas.width = canvas.height = SAMPLE
|
|
87
|
+
const context = canvas.getContext('2d', { willReadFrequently: true })
|
|
88
|
+
if (!context) return
|
|
89
|
+
context.drawImage(image, 0, 0, SAMPLE, SAMPLE)
|
|
90
|
+
const { data } = context.getImageData(0, 0, SAMPLE, SAMPLE)
|
|
91
|
+
let r = 0
|
|
92
|
+
let g = 0
|
|
93
|
+
let b = 0
|
|
94
|
+
let total = 0
|
|
95
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
96
|
+
const [pr = 0, pg = 0, pb = 0] = [data[i], data[i + 1], data[i + 2]]
|
|
97
|
+
const weight = 0.1 + (Math.max(pr, pg, pb) - Math.min(pr, pg, pb)) / 255
|
|
98
|
+
r += pr * weight
|
|
99
|
+
g += pg * weight
|
|
100
|
+
b += pb * weight
|
|
101
|
+
total += weight
|
|
102
|
+
}
|
|
103
|
+
if (live) setTint({ src, color: `rgb(${r / total} ${g / total} ${b / total})` })
|
|
104
|
+
})
|
|
105
|
+
.catch(() => live && setTint({ src }))
|
|
106
|
+
return () => {
|
|
107
|
+
live = false
|
|
108
|
+
}
|
|
109
|
+
}, [src])
|
|
110
|
+
|
|
111
|
+
return tint && tint.src === src ? tint.color : undefined
|
|
112
|
+
}
|
package/lib/geometry.ts
CHANGED
|
@@ -31,7 +31,7 @@ export interface Shape {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export const DEFAULT_NOTCH: Size = { width: 185, height: 32 }
|
|
34
|
-
export const DEFAULT_PANEL: Size = { width: 720, height:
|
|
34
|
+
export const DEFAULT_PANEL: Size = { width: 720, height: 240 }
|
|
35
35
|
|
|
36
36
|
/** The open island's one content inset: header, title and content all start here, clear of the bottom corners. */
|
|
37
37
|
export const INSET = 20
|
package/mock/activities.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Mock: activities that count down for real in the docs,
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Mock: activities that count down for real in the docs, an event a few
|
|
3
|
+
* minutes out, made once on mount so a re-render never resets it. Nothing
|
|
4
|
+
* here ships in the barrel.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
'use client'
|
|
@@ -9,35 +9,12 @@
|
|
|
9
9
|
import { CalendarDays } from 'lucide-react'
|
|
10
10
|
import { useState } from 'react'
|
|
11
11
|
import Agenda from '../blocks/activities/agenda'
|
|
12
|
-
import
|
|
13
|
-
import Timer from '../blocks/activities/timer'
|
|
12
|
+
import Clock from '../blocks/activities/clock'
|
|
14
13
|
import ExpandedIsland from '../blocks/app/expanded-island'
|
|
15
14
|
import Island from '../components/island/island'
|
|
15
|
+
import { useRun } from './clock'
|
|
16
16
|
import { soonEvent } from './data'
|
|
17
|
-
import { FlashIsland,
|
|
18
|
-
|
|
19
|
-
/** The timer, running from a focus run with 62% to go. */
|
|
20
|
-
export function RunningTimer() {
|
|
21
|
-
return <Timer defaultValue={useRun()} pomodoro />
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** The timer in the compact island's wings. */
|
|
25
|
-
export function TimerWings() {
|
|
26
|
-
const run = useRun()
|
|
27
|
-
return <WingsIsland leading={<Timer.Leading />} trailing={<Timer.Trailing run={run} />} />
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Music in the wings, the timer's ring in the bubble. */
|
|
31
|
-
export function TimerSplit() {
|
|
32
|
-
const run = useRun()
|
|
33
|
-
return (
|
|
34
|
-
<WingsIsland
|
|
35
|
-
leading={<NowPlaying.Leading track={PLAYING} />}
|
|
36
|
-
trailing={<NowPlaying.Trailing />}
|
|
37
|
-
minimal={<Timer.Minimal run={run} />}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
17
|
+
import { FlashIsland, ScreenEdge, WingsIsland } from './screen'
|
|
41
18
|
|
|
42
19
|
/** An event `minutes` out, made once. */
|
|
43
20
|
export function useSoon(minutes = 4) {
|
|
@@ -50,14 +27,14 @@ export function AgendaWings() {
|
|
|
50
27
|
return <WingsIsland leading={<Agenda.Leading event={event} />} trailing={<Agenda.Trailing event={event} />} />
|
|
51
28
|
}
|
|
52
29
|
|
|
53
|
-
/**
|
|
30
|
+
/** A focus round in the wings, the next event's ring in the bubble. */
|
|
54
31
|
export function AgendaSplit() {
|
|
55
32
|
const run = useRun()
|
|
56
33
|
const event = useSoon()
|
|
57
34
|
return (
|
|
58
35
|
<WingsIsland
|
|
59
|
-
leading={<
|
|
60
|
-
trailing={<
|
|
36
|
+
leading={<Clock.Leading run={run} />}
|
|
37
|
+
trailing={<Clock.Trailing run={run} />}
|
|
61
38
|
minimal={<Agenda.Minimal event={event} />}
|
|
62
39
|
/>
|
|
63
40
|
)
|
package/mock/artwork.tsx
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { cn } from '@justanarthur/modo-ui/lib/utils'
|
|
7
|
+
import type { NowPlayingTrack } from '../blocks/activities/now-playing'
|
|
8
|
+
import { TRACK } from './data'
|
|
7
9
|
|
|
8
|
-
type ArtworkVariant = 'aurora' | 'dusk' | 'night'
|
|
10
|
+
export type ArtworkVariant = 'aurora' | 'dusk' | 'night'
|
|
9
11
|
|
|
10
12
|
// Literal table: UnoCSS only generates the classes it can read whole.
|
|
11
13
|
const FILL: Record<ArtworkVariant, string> = {
|
|
@@ -14,6 +16,13 @@ const FILL: Record<ArtworkVariant, string> = {
|
|
|
14
16
|
night: 'bg-linear-to-tr from-ink via-brand to-status-info',
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
/** The color each variant leans to: the artwork's tint, data a player would read from the image. */
|
|
20
|
+
export const ARTWORK_TINT: Record<ArtworkVariant, string> = {
|
|
21
|
+
aurora: 'var(--badge-cyan)',
|
|
22
|
+
dusk: 'var(--badge-orange)',
|
|
23
|
+
night: 'var(--badge-violet)',
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
/** A square of generated art that fills its tile. */
|
|
18
27
|
export function MockArtwork({ variant = 'aurora', className }: { variant?: ArtworkVariant; className?: string }) {
|
|
19
28
|
return (
|
|
@@ -23,3 +32,6 @@ export function MockArtwork({ variant = 'aurora', className }: { variant?: Artwo
|
|
|
23
32
|
</span>
|
|
24
33
|
)
|
|
25
34
|
}
|
|
35
|
+
|
|
36
|
+
/** The mock track, with generated artwork. */
|
|
37
|
+
export const PLAYING: NowPlayingTrack = { ...TRACK, artwork: <MockArtwork />, tint: ARTWORK_TINT.aurora }
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Mock: an afternoon of copying for the clipboard widget, one clip of each
|
|
3
|
+
* kind, read at a pinned moment so the times hold. Nothing here ships in the
|
|
4
|
+
* barrel.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ClipboardClip } from '../blocks/system/clipboard'
|
|
8
|
+
import { MockArtwork } from './artwork'
|
|
9
|
+
|
|
10
|
+
const MINUTE = 60_000
|
|
11
|
+
|
|
12
|
+
/** The moment the history is read at. */
|
|
13
|
+
export const CLIP_NOW = new Date(2026, 10, 17, 15, 42).getTime()
|
|
14
|
+
|
|
15
|
+
const ago = (minutes: number) => CLIP_NOW - minutes * MINUTE
|
|
16
|
+
|
|
17
|
+
export const CLIPS: ClipboardClip[] = [
|
|
18
|
+
{
|
|
19
|
+
id: 'quote',
|
|
20
|
+
kind: 'text',
|
|
21
|
+
content:
|
|
22
|
+
'The island grows out of the notch and melts back into it; nothing on screen should feel like it came from nowhere.',
|
|
23
|
+
app: 'Notes',
|
|
24
|
+
copiedAt: ago(2),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'docs',
|
|
28
|
+
kind: 'link',
|
|
29
|
+
content: 'https://justanarthur.github.io/modo/notch/docs/blocks/agenda',
|
|
30
|
+
detail: 'Agenda · modo ui notch',
|
|
31
|
+
preview: <MockArtwork variant="night" />,
|
|
32
|
+
app: 'Safari',
|
|
33
|
+
copiedAt: ago(9),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'shot',
|
|
37
|
+
kind: 'image',
|
|
38
|
+
content: 'Screenshot 2026-11-17 at 15.21',
|
|
39
|
+
detail: '1440 × 900 · PNG',
|
|
40
|
+
preview: <MockArtwork variant="dusk" />,
|
|
41
|
+
app: 'Screenshot',
|
|
42
|
+
copiedAt: ago(21),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'brand',
|
|
46
|
+
kind: 'color',
|
|
47
|
+
// A theme token as copied from code; the swatch paints it, so it follows the scheme and no literal color sits in the docs.
|
|
48
|
+
content: '--badge-blue',
|
|
49
|
+
color: 'var(--badge-blue)',
|
|
50
|
+
detail: 'modo-ui badge blue',
|
|
51
|
+
app: 'Zed',
|
|
52
|
+
copiedAt: ago(48),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'brief',
|
|
56
|
+
kind: 'file',
|
|
57
|
+
content: 'Island brief.pdf',
|
|
58
|
+
detail: '2.4 MB',
|
|
59
|
+
app: 'Finder',
|
|
60
|
+
copiedAt: ago(95),
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'cmd',
|
|
64
|
+
kind: 'text',
|
|
65
|
+
content: 'bun run build && bun run check',
|
|
66
|
+
app: 'Terminal',
|
|
67
|
+
copiedAt: ago(130),
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'address',
|
|
71
|
+
kind: 'text',
|
|
72
|
+
content: 'Main St 12, 2nd floor',
|
|
73
|
+
app: 'Messages',
|
|
74
|
+
copiedAt: ago(26 * 60),
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
/** Kept on top: the build command and the color. */
|
|
79
|
+
export const PINNED = ['cmd', 'brand']
|