@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
package/dist/styles.css
CHANGED
|
@@ -35,154 +35,242 @@
|
|
|
35
35
|
@property --un-numeric-spacing{syntax:"*";inherits:false;}
|
|
36
36
|
@property --un-ordinal{syntax:"*";inherits:false;}
|
|
37
37
|
@property --un-slashed-zero{syntax:"*";inherits:false;}
|
|
38
|
+
@property --un-divide-opacity{syntax:"<percentage>";inherits:false;initial-value:100%;}
|
|
39
|
+
@property --un-border-style{syntax:"*";inherits:false;initial-value:solid;}
|
|
40
|
+
@property --un-divide-x-reverse{syntax:"*";inherits:false;initial-value:0;}
|
|
38
41
|
}
|
|
39
42
|
/* layer: default */
|
|
40
43
|
@layer default{
|
|
41
|
-
|
|
44
|
+
.\[\&_circle\:last-child\]\:text-status-success circle:last-child,
|
|
45
|
+
.text-status-success{color:color-mix(in srgb, var(--status-success) var(--un-text-opacity), transparent);}
|
|
46
|
+
.\[\&_circle\:last-child\]\:text-status-warning circle:last-child,
|
|
47
|
+
.text-status-warning{color:color-mix(in srgb, var(--status-warning) var(--un-text-opacity), transparent);}
|
|
48
|
+
.text-border{color:color-mix(in srgb, var(--border) var(--un-text-opacity), transparent);}
|
|
42
49
|
.text-foreground{color:color-mix(in srgb, var(--foreground) var(--un-text-opacity), transparent);}
|
|
43
50
|
.text-muted-foreground{color:color-mix(in srgb, var(--muted-foreground) var(--un-text-opacity), transparent);}
|
|
44
51
|
.text-status-error{color:color-mix(in srgb, var(--status-error) var(--un-text-opacity), transparent);}
|
|
45
52
|
.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);}
|
|
53
|
+
.font-mono{font-family:var(--font-mono);}
|
|
48
54
|
.tab{-moz-tab-size:4;-o-tab-size:4;tab-size:4;}
|
|
55
|
+
.-m-1{margin:calc(var(--spacing) * -1);}
|
|
56
|
+
.-m-1\.5{margin:calc(var(--spacing) * -1.5);}
|
|
49
57
|
.m-0{margin:calc(var(--spacing) * 0);}
|
|
50
|
-
|
|
51
|
-
.-
|
|
58
|
+
.-mx-2{margin-inline:calc(var(--spacing) * -2);}
|
|
59
|
+
.-my-1{margin-block:calc(var(--spacing) * -1);}
|
|
52
60
|
.mx-auto{margin-inline:auto;}
|
|
53
|
-
|
|
61
|
+
.my-1{margin-block:calc(var(--spacing) * 1);}
|
|
62
|
+
.-ml-2{margin-left:calc(var(--spacing) * -2);}
|
|
63
|
+
.-mr-1{margin-right:calc(var(--spacing) * -1);}
|
|
64
|
+
.-mr-2{margin-right:calc(var(--spacing) * -2);}
|
|
54
65
|
.mb-0{margin-bottom:calc(var(--spacing) * 0);}
|
|
55
|
-
.
|
|
56
|
-
.
|
|
57
|
-
.
|
|
66
|
+
.mb-1{margin-bottom:calc(var(--spacing) * 1);}
|
|
67
|
+
.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5);}
|
|
68
|
+
.ml-1{margin-left:calc(var(--spacing) * 1);}
|
|
69
|
+
.ml-1\.5{margin-left:calc(var(--spacing) * 1.5);}
|
|
70
|
+
.mt-1{margin-top:calc(var(--spacing) * 1);}
|
|
71
|
+
.mt-1\.5{margin-top:calc(var(--spacing) * 1.5);}
|
|
72
|
+
.mt-2{margin-top:calc(var(--spacing) * 2);}
|
|
73
|
+
.p-1{padding:calc(var(--spacing) * 1);}
|
|
58
74
|
.p-1\.5{padding:calc(var(--spacing) * 1.5);}
|
|
59
|
-
.p-3{padding:calc(var(--spacing) * 3);}
|
|
60
75
|
.p-8{padding:calc(var(--spacing) * 8);}
|
|
76
|
+
.\[\&\>\*\]\:px-6>*,
|
|
77
|
+
.px-6{padding-inline:calc(var(--spacing) * 6);}
|
|
61
78
|
.px{padding-inline:calc(var(--spacing) * 4);}
|
|
62
|
-
.px-
|
|
63
|
-
.px-
|
|
79
|
+
.px-0\.5{padding-inline:calc(var(--spacing) * 0.5);}
|
|
80
|
+
.px-2{padding-inline:calc(var(--spacing) * 2);}
|
|
64
81
|
.px-5{padding-inline:calc(var(--spacing) * 5);}
|
|
65
82
|
.py-1{padding-block:calc(var(--spacing) * 1);}
|
|
83
|
+
.py-1\.5{padding-block:calc(var(--spacing) * 1.5);}
|
|
84
|
+
.\[\&\>\*\:first-child\]\:pl-0>*:first-child,
|
|
85
|
+
.pl-0{padding-left:calc(var(--spacing) * 0);}
|
|
86
|
+
.\[\&\>\*\:last-child\]\:pr-0>*:last-child{padding-right:calc(var(--spacing) * 0);}
|
|
87
|
+
.pb{padding-bottom:calc(var(--spacing) * 4);}
|
|
66
88
|
.pb-1{padding-bottom:calc(var(--spacing) * 1);}
|
|
89
|
+
.pb-2{padding-bottom:calc(var(--spacing) * 2);}
|
|
67
90
|
.pb-3{padding-bottom:calc(var(--spacing) * 3);}
|
|
91
|
+
.pl-17\.5{padding-left:calc(var(--spacing) * 17.5);}
|
|
92
|
+
.pl-4{padding-left:calc(var(--spacing) * 4);}
|
|
93
|
+
.pl-4\.5{padding-left:calc(var(--spacing) * 4.5);}
|
|
94
|
+
.pl-5{padding-left:calc(var(--spacing) * 5);}
|
|
95
|
+
.pr{padding-right:calc(var(--spacing) * 4);}
|
|
96
|
+
.pr-1{padding-right:calc(var(--spacing) * 1);}
|
|
68
97
|
.pr-3{padding-right:calc(var(--spacing) * 3);}
|
|
69
|
-
.
|
|
98
|
+
.pt-1{padding-top:calc(var(--spacing) * 1);}
|
|
99
|
+
.pt-1\.5{padding-top:calc(var(--spacing) * 1.5);}
|
|
100
|
+
.first\:pl-0:first-child{padding-left:calc(var(--spacing) * 0);}
|
|
101
|
+
.last\:pr-0:last-child{padding-right:calc(var(--spacing) * 0);}
|
|
102
|
+
.text-left{text-align:left;}
|
|
70
103
|
.text-right{text-align:right;}
|
|
71
104
|
.outline{outline-style:var(--un-outline-style);outline-width:1px;}
|
|
72
105
|
.outline-none{--un-outline-style:none;outline-style:none;}
|
|
73
|
-
.
|
|
74
|
-
.border{border-width:1px;}
|
|
75
|
-
.border-
|
|
76
|
-
.
|
|
106
|
+
.b{border-width:1px;}
|
|
107
|
+
.border-l{border-left-width:1px;}
|
|
108
|
+
.border-border{border-color:color-mix(in srgb, var(--border) var(--un-border-opacity), transparent);}
|
|
109
|
+
.rounded-\[inherit\]{border-radius:inherit;}
|
|
77
110
|
.rounded-2xl{border-radius:var(--radius-2xl);}
|
|
111
|
+
.rounded-3xl{border-radius:var(--radius-3xl);}
|
|
78
112
|
.rounded-full{border-radius:calc(infinity * 1px);}
|
|
79
113
|
.rounded-lg{border-radius:var(--radius-lg);}
|
|
80
114
|
.rounded-md{border-radius:var(--radius-md);}
|
|
115
|
+
.rounded-sm{border-radius:var(--radius-sm);}
|
|
81
116
|
.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
117
|
.bg-active{background-color:color-mix(in srgb, var(--active) var(--un-bg-opacity), transparent);}
|
|
118
|
+
.bg-current{background-color:currentColor;}
|
|
85
119
|
.bg-foreground{background-color:color-mix(in srgb, var(--foreground) var(--un-bg-opacity), transparent);}
|
|
86
120
|
.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)
|
|
121
|
+
.bg-status-error\/16{background-color:color-mix(in srgb, var(--status-error) 16%, transparent);}
|
|
122
|
+
.bg-status-info\/16{background-color:color-mix(in srgb, var(--status-info) 16%, transparent);}
|
|
88
123
|
.bg-status-success{background-color:color-mix(in srgb, var(--status-success) var(--un-bg-opacity), transparent);}
|
|
124
|
+
.bg-status-success\/16{background-color:color-mix(in srgb, var(--status-success) 16%, transparent);}
|
|
89
125
|
.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);}
|
|
126
|
+
.bg-status-warning\/16{background-color:color-mix(in srgb, var(--status-warning) 16%, transparent);}
|
|
92
127
|
.bg-transparent{background-color:transparent;}
|
|
128
|
+
.opacity-0,
|
|
129
|
+
.group\/scrub:focus-within .group-focus-within\/scrub\:opacity-0,
|
|
130
|
+
.group\/scrub:hover .group-hover\/scrub\:opacity-0{opacity:0%;}
|
|
131
|
+
.opacity-70{opacity:70%;}
|
|
132
|
+
.group\/scrub:focus-within .group-focus-within\/scrub\:opacity-100,
|
|
133
|
+
.group\/scrub:hover .group-hover\/scrub\:opacity-100{opacity:100%;}
|
|
134
|
+
.\@container{container-type:inline-size;}
|
|
93
135
|
.\[\&\>div\]\:flex>div,
|
|
94
136
|
.flex{display:flex;}
|
|
95
137
|
.inline-flex{display:inline-flex;}
|
|
96
138
|
.\[\&\>\*\]\:flex-1>*,
|
|
97
139
|
.flex-1{flex:1 1 0%;}
|
|
98
|
-
.shrink-\[100\]{flex-shrink:100;}
|
|
99
140
|
.shrink-0{flex-shrink:0;}
|
|
141
|
+
.last\:shrink-\[100\]:last-child{flex-shrink:100;}
|
|
100
142
|
.grow{flex-grow:1;}
|
|
143
|
+
.basis-0{flex-basis:calc(var(--spacing) * 0);}
|
|
101
144
|
.\[\&\>div\]\:flex-col>div,
|
|
102
145
|
.flex-col{flex-direction:column;}
|
|
146
|
+
.flex-wrap{flex-wrap:wrap;}
|
|
147
|
+
.gap-0{gap:calc(var(--spacing) * 0);}
|
|
103
148
|
.gap-0\.5{gap:calc(var(--spacing) * 0.5);}
|
|
104
149
|
.gap-1{gap:calc(var(--spacing) * 1);}
|
|
105
150
|
.gap-1\.5{gap:calc(var(--spacing) * 1.5);}
|
|
106
151
|
.gap-2{gap:calc(var(--spacing) * 2);}
|
|
152
|
+
.gap-2\.5{gap:calc(var(--spacing) * 2.5);}
|
|
107
153
|
.gap-3{gap:calc(var(--spacing) * 3);}
|
|
108
154
|
.gap-4{gap:calc(var(--spacing) * 4);}
|
|
109
155
|
.gap-5{gap:calc(var(--spacing) * 5);}
|
|
156
|
+
.gap-6{gap:calc(var(--spacing) * 6);}
|
|
110
157
|
.gap-8{gap:calc(var(--spacing) * 8);}
|
|
111
|
-
.gap-px{gap:1px;}
|
|
112
158
|
.gap-x-8{column-gap:calc(var(--spacing) * 8);}
|
|
113
159
|
.grid{display:grid;}
|
|
160
|
+
.auto-cols-fr{grid-auto-columns:minmax(0,1fr);}
|
|
161
|
+
.grid-flow-col{grid-auto-flow:column;}
|
|
114
162
|
.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr;}
|
|
115
163
|
.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr));}
|
|
116
164
|
.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr));}
|
|
117
|
-
.grid-cols-
|
|
118
|
-
.size-
|
|
119
|
-
.size-
|
|
120
|
-
.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16);}
|
|
165
|
+
.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr));}
|
|
166
|
+
.size-1\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5);}
|
|
167
|
+
.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);}
|
|
121
168
|
.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2);}
|
|
122
169
|
.size-2\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);}
|
|
123
|
-
.size-
|
|
124
|
-
.size-
|
|
170
|
+
.size-20{width:calc(var(--spacing) * 20);height:calc(var(--spacing) * 20);}
|
|
171
|
+
.size-24{width:calc(var(--spacing) * 24);height:calc(var(--spacing) * 24);}
|
|
172
|
+
.size-28{width:calc(var(--spacing) * 28);height:calc(var(--spacing) * 28);}
|
|
173
|
+
.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5);}
|
|
174
|
+
.size-36{width:calc(var(--spacing) * 36);height:calc(var(--spacing) * 36);}
|
|
175
|
+
.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);}
|
|
176
|
+
.size-44{width:calc(var(--spacing) * 44);height:calc(var(--spacing) * 44);}
|
|
177
|
+
.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);}
|
|
125
178
|
.size-5\.5{width:calc(var(--spacing) * 5.5);height:calc(var(--spacing) * 5.5);}
|
|
179
|
+
.size-52{width:calc(var(--spacing) * 52);height:calc(var(--spacing) * 52);}
|
|
126
180
|
.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);}
|
|
127
181
|
.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);}
|
|
182
|
+
.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);}
|
|
128
183
|
.size-full{width:100%;height:100%;}
|
|
129
|
-
.\[\&\>div\]
|
|
130
|
-
|
|
184
|
+
.\[\&\>div\]\:\!min-w-0>div{min-width:calc(var(--spacing) * 0) !important;}
|
|
185
|
+
.\[\&\>div\]\:min-h-full>div{min-height:100%;}
|
|
186
|
+
.h-1{height:calc(var(--spacing) * 1);}
|
|
131
187
|
.h-1\.5{height:calc(var(--spacing) * 1.5);}
|
|
132
|
-
.h-
|
|
133
|
-
.h-11{height:calc(var(--spacing) * 11);}
|
|
188
|
+
.h-12{height:calc(var(--spacing) * 12);}
|
|
134
189
|
.h-14{height:calc(var(--spacing) * 14);}
|
|
190
|
+
.h-24{height:calc(var(--spacing) * 24);}
|
|
191
|
+
.h-28{height:calc(var(--spacing) * 28);}
|
|
192
|
+
.h-3{height:calc(var(--spacing) * 3);}
|
|
135
193
|
.h-3\.5{height:calc(var(--spacing) * 3.5);}
|
|
194
|
+
.h-32{height:calc(var(--spacing) * 32);}
|
|
195
|
+
.h-36{height:calc(var(--spacing) * 36);}
|
|
196
|
+
.h-4{height:calc(var(--spacing) * 4);}
|
|
136
197
|
.h-5{height:calc(var(--spacing) * 5);}
|
|
137
198
|
.h-6{height:calc(var(--spacing) * 6);}
|
|
138
199
|
.h-7{height:calc(var(--spacing) * 7);}
|
|
200
|
+
.h-8{height:calc(var(--spacing) * 8);}
|
|
139
201
|
.h-9{height:calc(var(--spacing) * 9);}
|
|
140
|
-
.h-auto{height:auto;}
|
|
141
202
|
.h-full{height:100%;}
|
|
142
203
|
.h2{height:calc(var(--spacing) * 2);}
|
|
143
|
-
.
|
|
204
|
+
.h23{height:calc(var(--spacing) * 23);}
|
|
205
|
+
.max-w-120{max-width:calc(var(--spacing) * 120);}
|
|
144
206
|
.max-w-160{max-width:calc(var(--spacing) * 160);}
|
|
207
|
+
.max-w-24{max-width:calc(var(--spacing) * 24);}
|
|
145
208
|
.min-h-0{min-height:calc(var(--spacing) * 0);}
|
|
146
209
|
.min-w-0{min-width:calc(var(--spacing) * 0);}
|
|
210
|
+
.min-w-12{min-width:calc(var(--spacing) * 12);}
|
|
147
211
|
.min-w-full{min-width:100%;}
|
|
148
|
-
.w
|
|
212
|
+
.w-\[38\%\]{width:38%;}
|
|
213
|
+
.w-\[42\%\]{width:42%;}
|
|
214
|
+
.w-\[46\%\]{width:46%;}
|
|
149
215
|
.w-0\.75{width:calc(var(--spacing) * 0.75);}
|
|
150
|
-
.w-1{width:calc(var(--spacing) * 1);}
|
|
151
216
|
.w-10{width:calc(var(--spacing) * 10);}
|
|
152
|
-
.w-
|
|
217
|
+
.w-12{width:calc(var(--spacing) * 12);}
|
|
218
|
+
.w-15{width:calc(var(--spacing) * 15);}
|
|
153
219
|
.w-20{width:calc(var(--spacing) * 20);}
|
|
220
|
+
.w-24{width:calc(var(--spacing) * 24);}
|
|
221
|
+
.w-28{width:calc(var(--spacing) * 28);}
|
|
222
|
+
.w-36{width:calc(var(--spacing) * 36);}
|
|
223
|
+
.w-40{width:calc(var(--spacing) * 40);}
|
|
224
|
+
.w-42{width:calc(var(--spacing) * 42);}
|
|
225
|
+
.w-48{width:calc(var(--spacing) * 48);}
|
|
226
|
+
.w-56{width:calc(var(--spacing) * 56);}
|
|
227
|
+
.w-6{width:calc(var(--spacing) * 6);}
|
|
154
228
|
.w-7{width:calc(var(--spacing) * 7);}
|
|
155
229
|
.w-7\.5{width:calc(var(--spacing) * 7.5);}
|
|
230
|
+
.w-8{width:calc(var(--spacing) * 8);}
|
|
156
231
|
.w-9{width:calc(var(--spacing) * 9);}
|
|
157
232
|
.w-full{width:100%;}
|
|
158
233
|
.w-max{width:max-content;}
|
|
234
|
+
.aspect-\[16\/10\]{aspect-ratio:16/10;}
|
|
235
|
+
.aspect-\[4\/3\]{aspect-ratio:4/3;}
|
|
159
236
|
.block{display:block;}
|
|
160
237
|
.hidden{display:none;}
|
|
161
238
|
.collapse{visibility:collapse;}
|
|
162
239
|
.cursor-pointer{cursor:pointer;}
|
|
240
|
+
.cursor-grab{cursor:grab;}
|
|
163
241
|
.pointer-events-auto{pointer-events:auto;}
|
|
164
242
|
.pointer-events-none{pointer-events:none;}
|
|
165
243
|
.whitespace-nowrap{white-space:nowrap;}
|
|
244
|
+
.whitespace-pre-wrap{white-space:pre-wrap;}
|
|
245
|
+
.break-words{overflow-wrap:break-word;}
|
|
246
|
+
.break-all{word-break:break-all;}
|
|
247
|
+
.text-balance{text-wrap:balance;}
|
|
248
|
+
.text-pretty{text-wrap:pretty;}
|
|
166
249
|
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
167
|
-
.ring
|
|
250
|
+
.ring,
|
|
251
|
+
.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
252
|
.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);}
|
|
253
|
+
.ring-border{--un-ring-color:color-mix(in srgb, var(--border) var(--un-ring-opacity), transparent);}
|
|
169
254
|
.focus-visible\:ring-focus-ring:focus-visible{--un-ring-color:color-mix(in srgb, var(--focus-ring) var(--un-ring-opacity), transparent);}
|
|
170
|
-
.
|
|
255
|
+
.ring-inset{--un-ring-inset:inset;}
|
|
256
|
+
.-rotate-90{rotate:-90deg;}
|
|
171
257
|
.transform{transform:var(--un-rotate-x) var(--un-rotate-y) var(--un-rotate-z) var(--un-skew-x) var(--un-skew-y);}
|
|
172
258
|
.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
259
|
.transition-\[color\]{transition-property:color;transition-timing-function:var(--un-ease, var(--default-transition-timingFunction));transition-duration:var(--un-duration, var(--default-transition-duration));}
|
|
260
|
+
.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
261
|
.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
262
|
.ease{--un-ease:var(--ease-DEFAULT);transition-timing-function:var(--ease-DEFAULT);}
|
|
177
263
|
.ease-in-out{--un-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out);}
|
|
178
264
|
.\[--scroll-fade-size\:16px\]{--scroll-fade-size:16px;}
|
|
179
|
-
.content-center{align-content:center;}
|
|
180
|
-
.content-start{align-content:flex-start;}
|
|
181
265
|
.items-start{align-items:flex-start;}
|
|
182
266
|
.items-end{align-items:flex-end;}
|
|
183
267
|
.items-center{align-items:center;}
|
|
184
268
|
.items-baseline{align-items:baseline;}
|
|
269
|
+
.items-stretch{align-items:stretch;}
|
|
270
|
+
.self-stretch{align-self:stretch;}
|
|
185
271
|
.inset-0{inset:calc(var(--spacing) * 0);}
|
|
272
|
+
.-inset-x-8{inset-inline:calc(var(--spacing) * -8);}
|
|
273
|
+
.-inset-y-4{inset-block:calc(var(--spacing) * -4);}
|
|
186
274
|
.inset-x-0{inset-inline:calc(var(--spacing) * 0);}
|
|
187
275
|
.inset-y-0{inset-block:calc(var(--spacing) * 0);}
|
|
188
276
|
.bottom-0{bottom:calc(var(--spacing) * 0);}
|
|
@@ -190,33 +278,47 @@
|
|
|
190
278
|
.left-1\/2{left:50%;}
|
|
191
279
|
.right-0{right:calc(var(--spacing) * 0);}
|
|
192
280
|
.top-0{top:calc(var(--spacing) * 0);}
|
|
193
|
-
.justify-
|
|
281
|
+
.justify-end{justify-content:flex-end;}
|
|
194
282
|
.justify-center{justify-content:center;}
|
|
195
283
|
.justify-between{justify-content:space-between;}
|
|
196
284
|
.absolute{position:absolute;}
|
|
197
285
|
.relative{position:relative;}
|
|
286
|
+
.sticky{position:sticky;}
|
|
287
|
+
.-z-1{z-index:-1;}
|
|
198
288
|
.z-10{z-index:10;}
|
|
199
289
|
.overflow-hidden{overflow:hidden;}
|
|
200
290
|
.overflow-visible{overflow:visible;}
|
|
201
291
|
.overflow-x-auto{overflow-x:auto;}
|
|
202
292
|
.overflow-y-hidden{overflow-y:hidden;}
|
|
203
|
-
.fill-foreground{fill:color-mix(in srgb, var(--foreground) var(--un-fill-opacity), transparent);}
|
|
204
293
|
.fill-ink{fill:color-mix(in srgb, var(--ink) var(--un-fill-opacity), transparent);}
|
|
294
|
+
.stroke-current{stroke:currentColor;}
|
|
295
|
+
.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;}
|
|
296
|
+
.isolate{isolation:isolate;}
|
|
205
297
|
.object-cover{object-fit:cover;}
|
|
206
298
|
.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
299
|
.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,);}
|
|
300
|
+
.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;}
|
|
301
|
+
.line-clamp-8{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:8;}
|
|
208
302
|
.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
303
|
.text-display{font-size:var(--text-display);line-height:var(--leading-display);}
|
|
304
|
+
.text-display-compact{font-size:var(--text-display-compact);line-height:var(--leading-display);}
|
|
210
305
|
.text-title{font-size:var(--text-title);line-height:var(--leading-title);}
|
|
306
|
+
.text-title-compact{font-size:var(--text-title-compact);line-height:var(--leading-title);}
|
|
211
307
|
.text-subtitle{font-size:var(--text-subtitle);line-height:var(--leading-subtitle);}
|
|
212
308
|
.text-body{font-size:var(--text-body);line-height:var(--leading-body);}
|
|
309
|
+
.text-body-compact{font-size:var(--text-body-compact);line-height:var(--leading-body);}
|
|
213
310
|
.text-caption{font-size:var(--text-caption);line-height:var(--leading-caption);}
|
|
311
|
+
.text-caption-compact{font-size:var(--text-caption-compact);line-height:var(--leading-caption);}
|
|
214
312
|
.text-micro{font-size:var(--text-micro);line-height:var(--leading-micro);}
|
|
215
313
|
.weight-normal{font-variation-settings:var(--weight-normal);}
|
|
216
314
|
.weight-medium{font-variation-settings:var(--weight-medium);}
|
|
217
315
|
.weight-semibold{font-variation-settings:var(--weight-semibold);}
|
|
316
|
+
.weight-bold{font-variation-settings:var(--weight-bold);}
|
|
218
317
|
.duration-fast{--un-duration:var(--duration-fast);transition-duration:var(--duration-fast);}
|
|
219
|
-
.
|
|
220
|
-
|
|
221
|
-
|
|
318
|
+
.divide-border{
|
|
319
|
+
:where(&>:not(:last-child)){border-color:color-mix(in srgb, var(--border) var(--un-divide-opacity), transparent);}
|
|
320
|
+
}
|
|
321
|
+
.divide-x{
|
|
322
|
+
:where(&>:not(:last-child)){--un-divide-x-reverse:0;border-left-width:calc(1px * var(--un-divide-x-reverse));border-left-style:var(--un-border-style);border-right-width:calc(1px * calc(1 - var(--un-divide-x-reverse)));border-right-style:var(--un-border-style);}
|
|
323
|
+
}
|
|
222
324
|
}
|
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 }
|