macbetter 0.0.0-stage → 0.1.0-beta.1
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/LICENSE +201 -0
- package/README.md +92 -2
- package/dist/components/accessory-tile.d.ts +50 -0
- package/dist/components/accessory-tile.js +46 -0
- package/dist/components/activity-indicator.d.ts +15 -0
- package/dist/components/activity-indicator.js +15 -0
- package/dist/components/alert.d.ts +29 -0
- package/dist/components/alert.js +30 -0
- package/dist/components/artwork.d.ts +44 -0
- package/dist/components/artwork.js +935 -0
- package/dist/components/automation-row.d.ts +24 -0
- package/dist/components/automation-row.js +12 -0
- package/dist/components/avatar.d.ts +33 -0
- package/dist/components/avatar.js +45 -0
- package/dist/components/badge.d.ts +24 -0
- package/dist/components/badge.js +19 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.js +10 -0
- package/dist/components/calendar.d.ts +30 -0
- package/dist/components/calendar.js +47 -0
- package/dist/components/camera-view.d.ts +40 -0
- package/dist/components/camera-view.js +44 -0
- package/dist/components/card.d.ts +14 -0
- package/dist/components/card.js +21 -0
- package/dist/components/carousel.d.ts +18 -0
- package/dist/components/carousel.js +33 -0
- package/dist/components/checkbox.d.ts +13 -0
- package/dist/components/checkbox.js +16 -0
- package/dist/components/code-field.d.ts +16 -0
- package/dist/components/code-field.js +29 -0
- package/dist/components/color-well.d.ts +23 -0
- package/dist/components/color-well.js +27 -0
- package/dist/components/combo-box.d.ts +42 -0
- package/dist/components/combo-box.js +102 -0
- package/dist/components/command-palette.d.ts +33 -0
- package/dist/components/command-palette.js +55 -0
- package/dist/components/context-menu.d.ts +9 -0
- package/dist/components/context-menu.js +15 -0
- package/dist/components/date-picker.d.ts +53 -0
- package/dist/components/date-picker.js +86 -0
- package/dist/components/device-frame.d.ts +18 -0
- package/dist/components/device-frame.js +16 -0
- package/dist/components/dialog.d.ts +27 -0
- package/dist/components/dialog.js +35 -0
- package/dist/components/disclosure.d.ts +32 -0
- package/dist/components/disclosure.js +35 -0
- package/dist/components/dock.d.ts +28 -0
- package/dist/components/dock.js +80 -0
- package/dist/components/door-control.d.ts +20 -0
- package/dist/components/door-control.js +43 -0
- package/dist/components/energy-readout.d.ts +32 -0
- package/dist/components/energy-readout.js +27 -0
- package/dist/components/field.d.ts +28 -0
- package/dist/components/field.js +32 -0
- package/dist/components/gauge.d.ts +25 -0
- package/dist/components/gauge.js +42 -0
- package/dist/components/glass.d.ts +34 -0
- package/dist/components/glass.js +31 -0
- package/dist/components/home-backdrop.d.ts +23 -0
- package/dist/components/home-backdrop.js +12 -0
- package/dist/components/home-section.d.ts +19 -0
- package/dist/components/home-section.js +21 -0
- package/dist/components/home-status.d.ts +24 -0
- package/dist/components/home-status.js +14 -0
- package/dist/components/hover-card.d.ts +14 -0
- package/dist/components/hover-card.js +16 -0
- package/dist/components/level-control.d.ts +19 -0
- package/dist/components/level-control.js +13 -0
- package/dist/components/light-color-picker.d.ts +33 -0
- package/dist/components/light-color-picker.js +56 -0
- package/dist/components/list.d.ts +42 -0
- package/dist/components/list.js +42 -0
- package/dist/components/listbox.d.ts +16 -0
- package/dist/components/listbox.js +28 -0
- package/dist/components/lock-control.d.ts +20 -0
- package/dist/components/lock-control.js +35 -0
- package/dist/components/menu-bar.d.ts +14 -0
- package/dist/components/menu-bar.js +16 -0
- package/dist/components/menu.d.ts +40 -0
- package/dist/components/menu.js +54 -0
- package/dist/components/navigation-bar.d.ts +24 -0
- package/dist/components/navigation-bar.js +54 -0
- package/dist/components/outline.d.ts +21 -0
- package/dist/components/outline.js +40 -0
- package/dist/components/page-control.d.ts +10 -0
- package/dist/components/page-control.js +8 -0
- package/dist/components/popover.d.ts +16 -0
- package/dist/components/popover.js +24 -0
- package/dist/components/progress.d.ts +27 -0
- package/dist/components/progress.js +27 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +13 -0
- package/dist/components/rating.d.ts +10 -0
- package/dist/components/rating.js +12 -0
- package/dist/components/scene-tile.d.ts +22 -0
- package/dist/components/scene-tile.js +13 -0
- package/dist/components/scroll-view.d.ts +21 -0
- package/dist/components/scroll-view.js +13 -0
- package/dist/components/search-field.d.ts +16 -0
- package/dist/components/search-field.js +12 -0
- package/dist/components/secure-field.d.ts +23 -0
- package/dist/components/secure-field.js +21 -0
- package/dist/components/segmented-control.d.ts +12 -0
- package/dist/components/segmented-control.js +10 -0
- package/dist/components/select.d.ts +45 -0
- package/dist/components/select.js +79 -0
- package/dist/components/sensor-readout.d.ts +29 -0
- package/dist/components/sensor-readout.js +12 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +11 -0
- package/dist/components/setup-code.d.ts +29 -0
- package/dist/components/setup-code.js +47 -0
- package/dist/components/sheet.d.ts +31 -0
- package/dist/components/sheet.js +51 -0
- package/dist/components/sidebar.d.ts +30 -0
- package/dist/components/sidebar.js +26 -0
- package/dist/components/slider.d.ts +27 -0
- package/dist/components/slider.js +43 -0
- package/dist/components/split-view.d.ts +11 -0
- package/dist/components/split-view.js +13 -0
- package/dist/components/squircle.d.ts +41 -0
- package/dist/components/squircle.js +63 -0
- package/dist/components/stepper.d.ts +30 -0
- package/dist/components/stepper.js +28 -0
- package/dist/components/switch.d.ts +10 -0
- package/dist/components/switch.js +10 -0
- package/dist/components/tab-bar.d.ts +20 -0
- package/dist/components/tab-bar.js +17 -0
- package/dist/components/table.d.ts +49 -0
- package/dist/components/table.js +179 -0
- package/dist/components/tabs.d.ts +16 -0
- package/dist/components/tabs.js +19 -0
- package/dist/components/text-area.d.ts +14 -0
- package/dist/components/text-area.js +9 -0
- package/dist/components/text-field.d.ts +26 -0
- package/dist/components/text-field.js +23 -0
- package/dist/components/thermostat-control.d.ts +30 -0
- package/dist/components/thermostat-control.js +139 -0
- package/dist/components/toast.d.ts +30 -0
- package/dist/components/toast.js +114 -0
- package/dist/components/toggle.d.ts +21 -0
- package/dist/components/toggle.js +19 -0
- package/dist/components/token-field.d.ts +31 -0
- package/dist/components/token-field.js +78 -0
- package/dist/components/toolbar.d.ts +27 -0
- package/dist/components/toolbar.js +39 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/window.d.ts +56 -0
- package/dist/components/window.js +61 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +79 -0
- package/dist/lib/cx.d.ts +9 -0
- package/dist/lib/cx.js +14 -0
- package/dist/lib/derive.d.ts +53 -0
- package/dist/lib/derive.js +255 -0
- package/dist/lib/field-glyphs.d.ts +13 -0
- package/dist/lib/field-glyphs.js +28 -0
- package/dist/lib/menu-glyphs.d.ts +6 -0
- package/dist/lib/menu-glyphs.js +15 -0
- package/dist/lib/platform.d.ts +18 -0
- package/dist/lib/platform.js +17 -0
- package/dist/lib/squircle.d.ts +23 -0
- package/dist/lib/squircle.js +69 -0
- package/dist/lib/theme.d.ts +42 -0
- package/dist/lib/theme.js +62 -0
- package/dist/styles/base.css +115 -0
- package/dist/styles/components/accessory-tile.css +461 -0
- package/dist/styles/components/activity-indicator.css +63 -0
- package/dist/styles/components/alert.css +433 -0
- package/dist/styles/components/artwork.css +380 -0
- package/dist/styles/components/automation-row.css +52 -0
- package/dist/styles/components/avatar.css +230 -0
- package/dist/styles/components/badge.css +204 -0
- package/dist/styles/components/button.css +298 -0
- package/dist/styles/components/calendar.css +287 -0
- package/dist/styles/components/camera-view.css +239 -0
- package/dist/styles/components/card.css +100 -0
- package/dist/styles/components/carousel.css +210 -0
- package/dist/styles/components/checkbox.css +212 -0
- package/dist/styles/components/code-field.css +163 -0
- package/dist/styles/components/color-well.css +452 -0
- package/dist/styles/components/combo-box.css +222 -0
- package/dist/styles/components/command-palette.css +379 -0
- package/dist/styles/components/context-menu.css +43 -0
- package/dist/styles/components/date-picker.css +356 -0
- package/dist/styles/components/device-frame.css +194 -0
- package/dist/styles/components/dialog.css +366 -0
- package/dist/styles/components/disclosure.css +197 -0
- package/dist/styles/components/dock.css +404 -0
- package/dist/styles/components/door-control.css +187 -0
- package/dist/styles/components/energy-readout.css +161 -0
- package/dist/styles/components/field.css +175 -0
- package/dist/styles/components/gauge.css +239 -0
- package/dist/styles/components/glass.css +113 -0
- package/dist/styles/components/home-backdrop.css +81 -0
- package/dist/styles/components/home-section.css +100 -0
- package/dist/styles/components/home-status.css +215 -0
- package/dist/styles/components/hover-card.css +145 -0
- package/dist/styles/components/index.css +75 -0
- package/dist/styles/components/level-control.css +247 -0
- package/dist/styles/components/light-color-picker.css +94 -0
- package/dist/styles/components/list.css +411 -0
- package/dist/styles/components/listbox.css +168 -0
- package/dist/styles/components/lock-control.css +164 -0
- package/dist/styles/components/menu-bar.css +94 -0
- package/dist/styles/components/menu.css +454 -0
- package/dist/styles/components/navigation-bar.css +248 -0
- package/dist/styles/components/outline.css +248 -0
- package/dist/styles/components/page-control.css +127 -0
- package/dist/styles/components/popover.css +186 -0
- package/dist/styles/components/progress.css +228 -0
- package/dist/styles/components/radio.css +281 -0
- package/dist/styles/components/rating.css +122 -0
- package/dist/styles/components/scene-tile.css +295 -0
- package/dist/styles/components/scroll-view.css +195 -0
- package/dist/styles/components/search-field.css +128 -0
- package/dist/styles/components/secure-field.css +189 -0
- package/dist/styles/components/segmented-control.css +183 -0
- package/dist/styles/components/select.css +290 -0
- package/dist/styles/components/sensor-readout.css +231 -0
- package/dist/styles/components/separator.css +62 -0
- package/dist/styles/components/setup-code.css +138 -0
- package/dist/styles/components/sheet.css +345 -0
- package/dist/styles/components/sidebar.css +261 -0
- package/dist/styles/components/slider.css +208 -0
- package/dist/styles/components/split-view.css +75 -0
- package/dist/styles/components/squircle.css +44 -0
- package/dist/styles/components/stepper.css +278 -0
- package/dist/styles/components/switch.css +115 -0
- package/dist/styles/components/tab-bar.css +223 -0
- package/dist/styles/components/table.css +313 -0
- package/dist/styles/components/tabs.css +262 -0
- package/dist/styles/components/text-area.css +94 -0
- package/dist/styles/components/text-field.css +294 -0
- package/dist/styles/components/thermostat-control.css +214 -0
- package/dist/styles/components/toast.css +418 -0
- package/dist/styles/components/toggle.css +312 -0
- package/dist/styles/components/token-field.css +193 -0
- package/dist/styles/components/toolbar.css +370 -0
- package/dist/styles/components/tooltip.css +69 -0
- package/dist/styles/components/window.css +428 -0
- package/dist/styles/index.css +17 -0
- package/dist/styles/materials.css +263 -0
- package/dist/styles/platforms.css +214 -0
- package/dist/styles/themes/ember.css +24 -0
- package/dist/styles/themes/graphite.css +16 -0
- package/dist/styles/themes/nebula.css +16 -0
- package/dist/styles/themes/system.css +28 -0
- package/dist/styles/tokens.css +299 -0
- package/package.json +82 -3
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/* Thermostat control — a 270° dial for the target temperature, with the mode picker under it.
|
|
2
|
+
Heat fills orange from the low end, cool fills blue from the high end, auto fills between two knobs. */
|
|
3
|
+
|
|
4
|
+
:where(:root, [data-platform="macos"]) {
|
|
5
|
+
--mb-thermostat-control-size: 208px;
|
|
6
|
+
--mb-thermostat-control-target-font: 600 44px/1 var(--mb-font-rounded);
|
|
7
|
+
--mb-thermostat-control-range-font: 600 32px/1 var(--mb-font-rounded);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
11
|
+
--mb-thermostat-control-size: 280px;
|
|
12
|
+
--mb-thermostat-control-target-font: 600 64px/1 var(--mb-font-rounded);
|
|
13
|
+
--mb-thermostat-control-range-font: 600 44px/1 var(--mb-font-rounded);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.mb-thermostat-control {
|
|
17
|
+
/* Deepened in light, so the arcs hold 3:1 on the pale track. */
|
|
18
|
+
--mb-thermostat-control-heat: light-dark(oklch(from var(--mb-orange) min(l, 0.57) c h), var(--mb-orange));
|
|
19
|
+
--mb-thermostat-control-cool: light-dark(oklch(from var(--mb-cyan) min(l, 0.56) c h), var(--mb-cyan));
|
|
20
|
+
/* Readable text versions of the two state colors, 4.5:1 on a light or dark sheet. */
|
|
21
|
+
--mb-thermostat-control-heat-text: light-dark(oklch(from var(--mb-orange) 0.52 c h), oklch(from var(--mb-orange) max(l, 0.74) c h));
|
|
22
|
+
--mb-thermostat-control-cool-text: light-dark(oklch(from var(--mb-cyan) 0.5 c h), oklch(from var(--mb-cyan) max(l, 0.78) c h));
|
|
23
|
+
--mb-thermostat-control-track: light-dark(
|
|
24
|
+
color-mix(in oklch, var(--mb-ink) 14%, transparent),
|
|
25
|
+
color-mix(in oklch, var(--mb-ink) 16%, transparent)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--mb-space-4);
|
|
32
|
+
color: var(--mb-label);
|
|
33
|
+
font: var(--mb-text-body);
|
|
34
|
+
letter-spacing: var(--mb-tracking-body);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mb-thermostat-control-dial {
|
|
38
|
+
position: relative;
|
|
39
|
+
width: var(--mb-thermostat-control-size);
|
|
40
|
+
aspect-ratio: 1;
|
|
41
|
+
/* The dial's open bottom is empty: let the status line sit up in it. */
|
|
42
|
+
margin-block-end: calc(var(--mb-thermostat-control-size) * -0.16);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.mb-thermostat-control-svg {
|
|
46
|
+
display: block;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 100%;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
touch-action: none;
|
|
51
|
+
-webkit-tap-highlight-color: transparent;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.mb-thermostat-control-track,
|
|
55
|
+
.mb-thermostat-control-arc {
|
|
56
|
+
fill: none;
|
|
57
|
+
stroke-width: 22;
|
|
58
|
+
stroke-linecap: round;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.mb-thermostat-control-track {
|
|
62
|
+
stroke: var(--mb-thermostat-control-track);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mb-thermostat-control-arc[data-tone="heat"] {
|
|
66
|
+
stroke: var(--mb-thermostat-control-heat);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.mb-thermostat-control-arc[data-tone="cool"] {
|
|
70
|
+
stroke: var(--mb-thermostat-control-cool);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* The measured temperature: a short bar across the track. */
|
|
74
|
+
.mb-thermostat-control-current {
|
|
75
|
+
stroke: var(--mb-label);
|
|
76
|
+
stroke-width: 3;
|
|
77
|
+
stroke-linecap: round;
|
|
78
|
+
opacity: 0.85;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.mb-thermostat-control-knob {
|
|
82
|
+
fill: #ffffff;
|
|
83
|
+
stroke: rgb(0 0 0 / 0.08);
|
|
84
|
+
stroke-width: 0.5;
|
|
85
|
+
filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.3));
|
|
86
|
+
transition: r var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mb-thermostat-control:has(.mb-thermostat-control-thumb[data-thumb="0"] :focus-visible) .mb-thermostat-control-knob[data-thumb="0"],
|
|
90
|
+
.mb-thermostat-control:has(.mb-thermostat-control-thumb[data-thumb="1"] :focus-visible) .mb-thermostat-control-knob[data-thumb="1"] {
|
|
91
|
+
stroke: var(--mb-focus-ring);
|
|
92
|
+
stroke-width: 4;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.mb-thermostat-control-svg:active .mb-thermostat-control-knob {
|
|
96
|
+
r: 16;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.mb-thermostat-control-readout {
|
|
100
|
+
position: absolute;
|
|
101
|
+
inset: 22%;
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
gap: var(--mb-space-1);
|
|
107
|
+
text-align: center;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.mb-thermostat-control-caption {
|
|
112
|
+
color: var(--mb-label-secondary);
|
|
113
|
+
font: var(--mb-text-subheadline);
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.mb-thermostat-control[data-state="heating"] .mb-thermostat-control-caption {
|
|
118
|
+
color: var(--mb-thermostat-control-heat-text);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mb-thermostat-control[data-state="cooling"] .mb-thermostat-control-caption {
|
|
122
|
+
color: var(--mb-thermostat-control-cool-text);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.mb-thermostat-control-target {
|
|
126
|
+
font: var(--mb-thermostat-control-target-font);
|
|
127
|
+
font-variant-numeric: tabular-nums;
|
|
128
|
+
letter-spacing: -0.02em;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.mb-thermostat-control-target[data-range] {
|
|
133
|
+
font: var(--mb-thermostat-control-range-font);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.mb-thermostat-control-now {
|
|
137
|
+
color: var(--mb-label-secondary);
|
|
138
|
+
font: var(--mb-text-footnote);
|
|
139
|
+
font-variant-numeric: tabular-nums;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.mb-thermostat-control[data-mode="off"] .mb-thermostat-control-target {
|
|
143
|
+
color: var(--mb-label-secondary);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* The slider is the real control for keyboards and screen readers; it has no visible box. */
|
|
147
|
+
.mb-thermostat-control-slider {
|
|
148
|
+
position: absolute;
|
|
149
|
+
inset: 0;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
clip-path: inset(50%);
|
|
152
|
+
pointer-events: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.mb-thermostat-control-slider-control,
|
|
156
|
+
.mb-thermostat-control-slider-track {
|
|
157
|
+
width: 100%;
|
|
158
|
+
height: 4px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.mb-thermostat-control-thumb {
|
|
162
|
+
width: 4px;
|
|
163
|
+
height: 4px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.mb-thermostat-control-status {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
gap: var(--mb-space-2);
|
|
170
|
+
color: var(--mb-label-secondary);
|
|
171
|
+
font: var(--mb-text-footnote);
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.mb-thermostat-control-status-dot {
|
|
176
|
+
width: 8px;
|
|
177
|
+
height: 8px;
|
|
178
|
+
border-radius: var(--mb-radius-full);
|
|
179
|
+
background: var(--mb-label-tertiary);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.mb-thermostat-control-status[data-state="heating"] .mb-thermostat-control-status-dot {
|
|
183
|
+
background: var(--mb-thermostat-control-heat);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.mb-thermostat-control-status[data-state="cooling"] .mb-thermostat-control-status-dot {
|
|
187
|
+
background: var(--mb-thermostat-control-cool);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.mb-thermostat-control-modes {
|
|
191
|
+
width: min(100%, var(--mb-thermostat-control-size));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (prefers-contrast: more) {
|
|
195
|
+
.mb-thermostat-control {
|
|
196
|
+
--mb-thermostat-control-track: color-mix(in oklch, var(--mb-ink) 32%, transparent);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@media (forced-colors: active) {
|
|
201
|
+
.mb-thermostat-control-track {
|
|
202
|
+
stroke: GrayText;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.mb-thermostat-control-arc,
|
|
206
|
+
.mb-thermostat-control-current {
|
|
207
|
+
stroke: Highlight;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.mb-thermostat-control-knob {
|
|
211
|
+
fill: Canvas;
|
|
212
|
+
stroke: CanvasText;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Toast — Apple notifications. macOS: cards that slide in at the top right
|
|
3
|
+
* and stack. iOS and iPadOS: banners that drop from the top and swipe up.
|
|
4
|
+
* ui-sdk measures the stack (--toast-*); this file lays it out.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:where(:root, [data-platform="macos"]) {
|
|
8
|
+
--mb-toast-width: 344px;
|
|
9
|
+
--mb-toast-radius: var(--mb-popup-radius);
|
|
10
|
+
--mb-toast-padding: 12px;
|
|
11
|
+
--mb-toast-icon-size: 32px;
|
|
12
|
+
--mb-toast-title-font: 600 13px/16px var(--mb-font);
|
|
13
|
+
--mb-toast-body-font: 400 13px/16px var(--mb-font);
|
|
14
|
+
--mb-toast-time-font: 400 11px/16px var(--mb-font);
|
|
15
|
+
--mb-toast-inset: 12px;
|
|
16
|
+
--mb-toast-gap: 8px;
|
|
17
|
+
--mb-toast-peek: 8px;
|
|
18
|
+
/* Cards slide in sideways, from the edge the stack is aligned to. */
|
|
19
|
+
--mb-toast-slide: 1;
|
|
20
|
+
--mb-toast-enter-y: 0px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
24
|
+
--mb-toast-width: 400px;
|
|
25
|
+
--mb-toast-radius: var(--mb-radius-2xl);
|
|
26
|
+
--mb-toast-padding: 14px;
|
|
27
|
+
--mb-toast-icon-size: 38px;
|
|
28
|
+
--mb-toast-title-font: 600 15px/20px var(--mb-font);
|
|
29
|
+
--mb-toast-body-font: 400 15px/20px var(--mb-font);
|
|
30
|
+
--mb-toast-time-font: 400 13px/20px var(--mb-font);
|
|
31
|
+
--mb-toast-inset: 8px;
|
|
32
|
+
--mb-toast-gap: 8px;
|
|
33
|
+
--mb-toast-peek: 9px;
|
|
34
|
+
/* Banners drop from above the top edge. */
|
|
35
|
+
--mb-toast-slide: 0;
|
|
36
|
+
--mb-toast-enter-y: calc(-100% - var(--mb-toast-inset) - 40px);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/*
|
|
40
|
+
* The region is a popover in the top layer; undo the UA's centered box.
|
|
41
|
+
* --mb-toaster-* are the screen's distances from the viewport edges: zero
|
|
42
|
+
* normally, a nested preview's box when Toaster is mounted inside one.
|
|
43
|
+
*/
|
|
44
|
+
.mb-toaster {
|
|
45
|
+
position: fixed;
|
|
46
|
+
inset: auto;
|
|
47
|
+
inset-block-start: calc(var(--mb-toaster-top, 0px) + var(--mb-toast-inset) + env(safe-area-inset-top));
|
|
48
|
+
width: min(var(--mb-toast-width), calc(var(--mb-toaster-screen-width, 100vw) - var(--mb-toast-inset) * 2));
|
|
49
|
+
height: var(--toast-front-height, 0px);
|
|
50
|
+
margin: 0;
|
|
51
|
+
padding: 0;
|
|
52
|
+
overflow: visible;
|
|
53
|
+
border: 0;
|
|
54
|
+
background: transparent;
|
|
55
|
+
color: var(--mb-label);
|
|
56
|
+
transition: height var(--mb-spring-smooth-duration) var(--mb-spring-smooth);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.mb-toaster[data-side="bottom"] {
|
|
60
|
+
inset-block: auto calc(var(--mb-toaster-bottom, 0px) + var(--mb-toast-inset) + env(safe-area-inset-bottom));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.mb-toaster[data-align="end"] {
|
|
64
|
+
inset-inline-end: calc(var(--mb-toaster-inline-end, 0px) + var(--mb-toast-inset));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.mb-toaster[data-align="start"] {
|
|
68
|
+
inset-inline-start: calc(var(--mb-toaster-inline-start, 0px) + var(--mb-toast-inset));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mb-toaster[data-align="center"] {
|
|
72
|
+
inset-inline: var(--mb-toaster-inline-start, 0px) var(--mb-toaster-inline-end, 0px);
|
|
73
|
+
margin-inline: auto;
|
|
74
|
+
translate: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Which way "the edge" is: end is right in left-to-right, left in right-to-left. */
|
|
78
|
+
.mb-toaster[data-align="end"] {
|
|
79
|
+
--mb-toast-enter-dir: 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mb-toaster[data-align="start"] {
|
|
83
|
+
--mb-toast-enter-dir: -1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Not :dir(rtl): the CSS build rewrites it as a :lang() list, which misses dir="rtl". */
|
|
87
|
+
:where([dir="rtl"]) .mb-toaster[data-align="end"] {
|
|
88
|
+
--mb-toast-enter-dir: -1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:where([dir="rtl"]) .mb-toaster[data-align="start"] {
|
|
92
|
+
--mb-toast-enter-dir: 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.mb-toaster[data-expanded] {
|
|
96
|
+
height: calc(var(--toast-stack-height, 0px) + (var(--toast-count, 1) - 1) * var(--mb-toast-gap));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ui-sdk wraps the toasts in a list. */
|
|
100
|
+
.mb-toaster > :where(ol, ul) {
|
|
101
|
+
position: relative;
|
|
102
|
+
height: 100%;
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
list-style: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mb-toast {
|
|
109
|
+
--mb-toast-enter-x: calc(var(--mb-toast-slide) * var(--mb-toast-enter-dir, 0) * (100% + var(--mb-toast-inset) + 24px));
|
|
110
|
+
--mb-toast-y: calc(var(--toast-index, 0) * var(--mb-toast-peek));
|
|
111
|
+
|
|
112
|
+
position: absolute;
|
|
113
|
+
inset-inline: 0;
|
|
114
|
+
top: 0;
|
|
115
|
+
z-index: calc(100 - var(--toast-index, 0));
|
|
116
|
+
display: grid;
|
|
117
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
118
|
+
align-items: center;
|
|
119
|
+
column-gap: 10px;
|
|
120
|
+
height: var(--toast-height);
|
|
121
|
+
padding: var(--mb-toast-padding);
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
border-radius: var(--mb-toast-radius);
|
|
124
|
+
background: var(--mb-material-thick);
|
|
125
|
+
-webkit-backdrop-filter: var(--mb-material-filter);
|
|
126
|
+
backdrop-filter: var(--mb-material-filter);
|
|
127
|
+
box-shadow: var(--mb-glass-rim), 0 0 0 var(--mb-hairline) var(--mb-glass-border), var(--mb-shadow-3);
|
|
128
|
+
color: var(--mb-label);
|
|
129
|
+
user-select: none;
|
|
130
|
+
-webkit-user-select: none;
|
|
131
|
+
cursor: default;
|
|
132
|
+
transform-origin: 50% 100%;
|
|
133
|
+
translate: var(--toast-swipe-x, 0px) calc(var(--mb-toast-y) + var(--toast-swipe-y, 0px));
|
|
134
|
+
scale: calc(1 - var(--toast-index, 0) * 0.05);
|
|
135
|
+
transition:
|
|
136
|
+
translate var(--mb-spring-smooth-duration) var(--mb-spring-smooth),
|
|
137
|
+
scale var(--mb-spring-smooth-duration) var(--mb-spring-smooth),
|
|
138
|
+
height var(--mb-spring-smooth-duration) var(--mb-spring-smooth),
|
|
139
|
+
opacity var(--mb-duration-base) var(--mb-ease-out);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.mb-toast:not(:has(> .mb-toast-icon)) {
|
|
143
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Behind the front card, only its edge peeks out. */
|
|
147
|
+
.mb-toast:not([data-front], [data-expanded]) {
|
|
148
|
+
height: var(--toast-front-height);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.mb-toast:not([data-front], [data-expanded]) > * {
|
|
152
|
+
opacity: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.mb-toast > * {
|
|
156
|
+
transition: opacity var(--mb-duration-base) var(--mb-ease-out);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.mb-toast[data-expanded] {
|
|
160
|
+
--mb-toast-y: calc(var(--toast-offset, 0px) + var(--toast-index, 0) * var(--mb-toast-gap));
|
|
161
|
+
scale: 1;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.mb-toast[data-starting-style] {
|
|
165
|
+
translate: var(--mb-toast-enter-x) var(--mb-toast-enter-y);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.mb-toast[data-starting-style]:not([data-front]) {
|
|
169
|
+
opacity: 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.mb-toast[data-ending-style] {
|
|
173
|
+
opacity: 0;
|
|
174
|
+
transition-duration: var(--mb-duration-base);
|
|
175
|
+
transition-timing-function: var(--mb-ease-in-out);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Leaving the front, a notification goes back the way it came; a swipe throws it that way. */
|
|
179
|
+
.mb-toast[data-ending-style][data-front]:not([data-swipe-direction]) {
|
|
180
|
+
opacity: 1;
|
|
181
|
+
translate: var(--mb-toast-enter-x) var(--mb-toast-enter-y);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.mb-toast[data-ending-style][data-swipe-direction="up"] {
|
|
185
|
+
translate: 0 calc(-100% - 40px);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.mb-toast[data-ending-style][data-swipe-direction="down"] {
|
|
189
|
+
translate: 0 calc(100% + 40px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.mb-toast[data-ending-style][data-swipe-direction="right"] {
|
|
193
|
+
translate: calc(100% + 40px) var(--mb-toast-y);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.mb-toast[data-ending-style][data-swipe-direction="left"] {
|
|
197
|
+
translate: calc(-100% - 40px) var(--mb-toast-y);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.mb-toast[data-swiping] {
|
|
201
|
+
transition: none;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.mb-toast:focus-visible {
|
|
205
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
206
|
+
outline-offset: 2px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.mb-toast-icon {
|
|
210
|
+
display: grid;
|
|
211
|
+
place-items: center;
|
|
212
|
+
align-self: start;
|
|
213
|
+
width: var(--mb-toast-icon-size);
|
|
214
|
+
height: var(--mb-toast-icon-size);
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
border-radius: var(--mb-squircle-radius-icon);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.mb-toast-icon > :where(img, svg) {
|
|
220
|
+
width: 100%;
|
|
221
|
+
height: 100%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.mb-toast-icon[data-type] {
|
|
225
|
+
background: var(--mb-toast-icon-tone, var(--mb-fill));
|
|
226
|
+
color: #ffffff;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.mb-toast-icon[data-type] > svg {
|
|
230
|
+
width: 62%;
|
|
231
|
+
height: 62%;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.mb-toast-icon[data-type="success"] { --mb-toast-icon-tone: var(--mb-green); }
|
|
235
|
+
.mb-toast-icon[data-type="error"] { --mb-toast-icon-tone: var(--mb-red); }
|
|
236
|
+
.mb-toast-icon[data-type="warning"] { --mb-toast-icon-tone: var(--mb-yellow); color: rgb(0 0 0 / 0.85); }
|
|
237
|
+
.mb-toast-icon[data-type="info"] { --mb-toast-icon-tone: var(--mb-blue); }
|
|
238
|
+
.mb-toast-icon[data-type="loading"] { --mb-toast-icon-tone: var(--mb-fill-secondary); color: var(--mb-label); }
|
|
239
|
+
|
|
240
|
+
.mb-toast-spinner {
|
|
241
|
+
width: 50%;
|
|
242
|
+
height: 50%;
|
|
243
|
+
border: 2px solid color-mix(in oklch, currentColor 25%, transparent);
|
|
244
|
+
border-top-color: currentColor;
|
|
245
|
+
border-radius: 50%;
|
|
246
|
+
animation: mb-toast-spin 0.8s linear infinite;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@keyframes mb-toast-spin {
|
|
250
|
+
to {
|
|
251
|
+
rotate: 360deg;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.mb-toast-content {
|
|
256
|
+
display: flex;
|
|
257
|
+
flex-direction: column;
|
|
258
|
+
min-width: 0;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.mb-toast-header {
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: baseline;
|
|
264
|
+
gap: 8px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.mb-toast-title {
|
|
268
|
+
flex: 1 1 auto;
|
|
269
|
+
min-width: 0;
|
|
270
|
+
overflow: hidden;
|
|
271
|
+
text-overflow: ellipsis;
|
|
272
|
+
white-space: nowrap;
|
|
273
|
+
font: var(--mb-toast-title-font);
|
|
274
|
+
letter-spacing: var(--mb-tracking-body);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.mb-toast-time {
|
|
278
|
+
flex: none;
|
|
279
|
+
color: var(--mb-label-secondary);
|
|
280
|
+
font: var(--mb-toast-time-font);
|
|
281
|
+
letter-spacing: var(--mb-tracking-caption);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.mb-toast-description {
|
|
285
|
+
display: -webkit-box;
|
|
286
|
+
overflow: hidden;
|
|
287
|
+
-webkit-box-orient: vertical;
|
|
288
|
+
-webkit-line-clamp: 4;
|
|
289
|
+
color: var(--mb-label);
|
|
290
|
+
font: var(--mb-toast-body-font);
|
|
291
|
+
letter-spacing: var(--mb-tracking-body);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.mb-toast-action {
|
|
295
|
+
position: relative;
|
|
296
|
+
align-self: center;
|
|
297
|
+
height: var(--mb-control-height-sm);
|
|
298
|
+
margin: 0;
|
|
299
|
+
padding: 0 var(--mb-control-padding-sm);
|
|
300
|
+
border: 0;
|
|
301
|
+
border-radius: var(--mb-control-radius-sm);
|
|
302
|
+
background: var(--mb-fill-secondary);
|
|
303
|
+
color: var(--mb-label);
|
|
304
|
+
font: var(--mb-control-font-sm);
|
|
305
|
+
white-space: nowrap;
|
|
306
|
+
cursor: default;
|
|
307
|
+
transition: background-color var(--mb-duration-fast) var(--mb-ease-out);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.mb-toast-action::after {
|
|
311
|
+
content: "";
|
|
312
|
+
position: absolute;
|
|
313
|
+
inset: 50% auto auto 50%;
|
|
314
|
+
width: max(100%, var(--mb-hit-target));
|
|
315
|
+
height: max(100%, var(--mb-hit-target));
|
|
316
|
+
translate: -50% -50%;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@media (hover: hover) and (pointer: fine) {
|
|
320
|
+
.mb-toast-action:hover {
|
|
321
|
+
background: var(--mb-fill);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.mb-toast-action:active {
|
|
326
|
+
background: var(--mb-fill);
|
|
327
|
+
opacity: 0.8;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.mb-toast-action:focus-visible,
|
|
331
|
+
.mb-toast-close:focus-visible {
|
|
332
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
333
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* The Mac's close button sits on the card's top-leading corner and shows on hover. */
|
|
337
|
+
.mb-toast-close {
|
|
338
|
+
position: absolute;
|
|
339
|
+
inset-block-start: 6px;
|
|
340
|
+
inset-inline-start: 6px;
|
|
341
|
+
display: grid;
|
|
342
|
+
place-items: center;
|
|
343
|
+
width: 18px;
|
|
344
|
+
height: 18px;
|
|
345
|
+
margin: 0;
|
|
346
|
+
padding: 0;
|
|
347
|
+
border: 0;
|
|
348
|
+
border-radius: 50%;
|
|
349
|
+
background: var(--mb-bg-elevated);
|
|
350
|
+
box-shadow: 0 0 0 var(--mb-hairline) var(--mb-separator-strong), var(--mb-shadow-1);
|
|
351
|
+
color: var(--mb-label-secondary);
|
|
352
|
+
opacity: 0;
|
|
353
|
+
scale: 0.8;
|
|
354
|
+
cursor: default;
|
|
355
|
+
transition:
|
|
356
|
+
opacity var(--mb-duration-fast) var(--mb-ease-out),
|
|
357
|
+
scale var(--mb-duration-fast) var(--mb-ease-out);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.mb-toast-close > svg {
|
|
361
|
+
width: 10px;
|
|
362
|
+
height: 10px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* Kept at two classes' weight so the touch rule below, scoped closer, wins. */
|
|
366
|
+
.mb-toast:where([data-front], [data-expanded]):where(:focus-within) .mb-toast-close {
|
|
367
|
+
opacity: 1;
|
|
368
|
+
scale: 1;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@media (hover: hover) and (pointer: fine) {
|
|
372
|
+
.mb-toast:where([data-front], [data-expanded]):where(:hover) .mb-toast-close {
|
|
373
|
+
opacity: 1;
|
|
374
|
+
scale: 1;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/*
|
|
379
|
+
* Touch dismisses with a swipe; there's no close button to aim for. It stays
|
|
380
|
+
* in the tab order (hidden, not removed) so a keyboard can still reach it.
|
|
381
|
+
*/
|
|
382
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
383
|
+
.mb-toast-close:not(:focus-visible) {
|
|
384
|
+
opacity: 0;
|
|
385
|
+
pointer-events: none;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@media (prefers-reduced-motion: reduce) {
|
|
390
|
+
:where(:root:not([data-motion="full"])) {
|
|
391
|
+
/* A swipe still follows the finger; only the slides become fades. */
|
|
392
|
+
.mb-toast[data-starting-style],
|
|
393
|
+
.mb-toast[data-ending-style][data-front]:not([data-swipe-direction]) {
|
|
394
|
+
translate: 0 var(--mb-toast-y);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.mb-toast[data-starting-style] {
|
|
398
|
+
opacity: 0;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.mb-toast[data-ending-style][data-front] {
|
|
402
|
+
opacity: 0;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* Continuous corners on the banner and the app icon in it. */
|
|
408
|
+
@supports (corner-shape: squircle) {
|
|
409
|
+
.mb-toast {
|
|
410
|
+
corner-shape: var(--mb-corner-shape);
|
|
411
|
+
border-radius: calc(var(--mb-toast-radius) * var(--mb-corner-factor));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.mb-toast-icon {
|
|
415
|
+
corner-shape: var(--mb-corner-shape);
|
|
416
|
+
border-radius: calc(var(--mb-squircle-radius-icon) * var(--mb-corner-factor));
|
|
417
|
+
}
|
|
418
|
+
}
|