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,122 @@
|
|
|
1
|
+
/* Rating — a row of stars, filled with the accent up to the score. A pointer previews the score
|
|
2
|
+
it's over; touch picks at once. Half stars fill halfway. */
|
|
3
|
+
|
|
4
|
+
:where(:root, [data-platform="macos"]) {
|
|
5
|
+
--mb-rating-size: 16px;
|
|
6
|
+
--mb-rating-size-sm: 12px;
|
|
7
|
+
--mb-rating-size-lg: 22px;
|
|
8
|
+
--mb-rating-gap: 2px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
12
|
+
--mb-rating-size: 24px;
|
|
13
|
+
--mb-rating-size-sm: 14px;
|
|
14
|
+
--mb-rating-size-lg: 32px;
|
|
15
|
+
--mb-rating-gap: 4px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.mb-rating {
|
|
19
|
+
--mb-rating-s: var(--mb-rating-size);
|
|
20
|
+
--mb-rating-color: var(--mb-accent);
|
|
21
|
+
--mb-rating-empty: var(--mb-label-tertiary);
|
|
22
|
+
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
flex: none;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: var(--mb-rating-gap);
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mb-rating[data-size="sm"] {
|
|
31
|
+
--mb-rating-s: var(--mb-rating-size-sm);
|
|
32
|
+
--mb-rating-gap: 1px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mb-rating[data-size="lg"] {
|
|
36
|
+
--mb-rating-s: var(--mb-rating-size-lg);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* A read-only score is a picture of a number; it doesn't need to look pressable. */
|
|
40
|
+
.mb-rating[data-readonly] {
|
|
41
|
+
--mb-rating-empty: var(--mb-label-quaternary);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.mb-rating-item {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
width: var(--mb-rating-s);
|
|
48
|
+
height: var(--mb-rating-s);
|
|
49
|
+
border-radius: var(--mb-radius-xs);
|
|
50
|
+
transition: scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mb-rating-symbol {
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.mb-rating-symbol[data-part="empty"] {
|
|
62
|
+
fill: none;
|
|
63
|
+
stroke: var(--mb-rating-empty);
|
|
64
|
+
stroke-width: 1.6;
|
|
65
|
+
stroke-linejoin: round;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mb-rating[data-readonly] .mb-rating-symbol[data-part="empty"] {
|
|
69
|
+
fill: var(--mb-rating-empty);
|
|
70
|
+
stroke: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.mb-rating-symbol[data-part="fill"] {
|
|
74
|
+
fill: var(--mb-rating-color);
|
|
75
|
+
clip-path: inset(0 calc((1 - var(--rating-fill, 0)) * 100%) 0 0);
|
|
76
|
+
transition: clip-path var(--mb-duration-fast) var(--mb-ease-out);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where([dir="rtl"]) .mb-rating-symbol[data-part="fill"] {
|
|
80
|
+
clip-path: inset(0 0 0 calc((1 - var(--rating-fill, 0)) * 100%));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* The radios sit over the star; the ring goes around the star they belong to. */
|
|
84
|
+
.mb-rating-item :where([data-slot="rating-radio"]) {
|
|
85
|
+
cursor: default;
|
|
86
|
+
outline: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Stars are smaller than a fingertip: each radio reaches the hit target vertically and
|
|
90
|
+
meets its neighbour across the gap. */
|
|
91
|
+
.mb-rating-item :where([data-slot="rating-radio"])::after {
|
|
92
|
+
content: "";
|
|
93
|
+
position: absolute;
|
|
94
|
+
inset-block: min(0px, calc((var(--mb-rating-s) - var(--mb-hit-target)) / 2));
|
|
95
|
+
inset-inline: calc(var(--mb-rating-gap) / -2);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mb-rating-item:has([data-slot="rating-radio"]:focus-visible) {
|
|
99
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
100
|
+
outline-offset: 1px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* A previewed score is a little lighter than a chosen one, so the difference reads. */
|
|
104
|
+
.mb-rating:has(.mb-rating-item[data-highlighted]) .mb-rating-symbol[data-part="fill"] {
|
|
105
|
+
fill: color-mix(in oklch, var(--mb-rating-color) 72%, transparent);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mb-rating-item:active:not([data-disabled], [data-readonly]) {
|
|
109
|
+
scale: 0.88;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.mb-rating[data-disabled] {
|
|
113
|
+
opacity: 0.4;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (prefers-reduced-motion: reduce) {
|
|
117
|
+
:where(:root:not([data-motion="full"])) {
|
|
118
|
+
.mb-rating-item:active {
|
|
119
|
+
scale: 1 !important;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/* Scene tile — runs a scene. It shares the accessory tile's off and on looks: dim when the home doesn't match the
|
|
2
|
+
scene, bright with dark text when every accessory in it is set the way the scene sets it. */
|
|
3
|
+
|
|
4
|
+
:where(:root, [data-platform="macos"]) {
|
|
5
|
+
--mb-scene-tile-height: 44px;
|
|
6
|
+
--mb-scene-tile-height-sm: 36px;
|
|
7
|
+
--mb-scene-tile-radius: 12px;
|
|
8
|
+
--mb-scene-tile-icon-size: 26px;
|
|
9
|
+
--mb-scene-tile-glyph-size: 15px;
|
|
10
|
+
--mb-scene-tile-font: 600 13px/16px var(--mb-font);
|
|
11
|
+
--mb-scene-row-gap: 8px;
|
|
12
|
+
--mb-scene-tile-min-width: 150px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
16
|
+
--mb-scene-tile-height: 56px;
|
|
17
|
+
--mb-scene-tile-height-sm: 44px;
|
|
18
|
+
--mb-scene-tile-radius: 16px;
|
|
19
|
+
--mb-scene-tile-icon-size: 32px;
|
|
20
|
+
--mb-scene-tile-glyph-size: 18px;
|
|
21
|
+
--mb-scene-tile-font: 600 15px/18px var(--mb-font);
|
|
22
|
+
--mb-scene-row-gap: 10px;
|
|
23
|
+
--mb-scene-tile-min-width: 150px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mb-scene-tile {
|
|
27
|
+
--mb-scene-tile-bg: light-dark(
|
|
28
|
+
color-mix(in oklch, var(--mb-ink) 7%, rgb(255 255 255 / 0.3)),
|
|
29
|
+
color-mix(in oklch, var(--mb-bg-elevated) 58%, transparent)
|
|
30
|
+
);
|
|
31
|
+
--mb-scene-tile-fg: var(--mb-label);
|
|
32
|
+
--mb-scene-tile-icon-bg: var(--mb-fill-secondary);
|
|
33
|
+
--mb-scene-tile-icon-fg: var(--mb-label-secondary);
|
|
34
|
+
--mb-scene-tile-edge: light-dark(rgb(0 0 0 / 0.06), rgb(255 255 255 / 0.08));
|
|
35
|
+
|
|
36
|
+
position: relative;
|
|
37
|
+
display: inline-flex;
|
|
38
|
+
flex: none;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 10px;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
min-width: var(--mb-scene-tile-min-width);
|
|
43
|
+
height: var(--mb-scene-tile-height);
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding-block: 0;
|
|
46
|
+
padding-inline: calc((var(--mb-scene-tile-height) - var(--mb-scene-tile-icon-size)) / 2) 14px;
|
|
47
|
+
border: 0;
|
|
48
|
+
border-radius: var(--mb-scene-tile-radius);
|
|
49
|
+
background: var(--mb-scene-tile-bg);
|
|
50
|
+
box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-scene-tile-edge);
|
|
51
|
+
color: var(--mb-scene-tile-fg);
|
|
52
|
+
font: var(--mb-scene-tile-font);
|
|
53
|
+
letter-spacing: var(--mb-tracking-body);
|
|
54
|
+
text-align: start;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
cursor: default;
|
|
57
|
+
user-select: none;
|
|
58
|
+
-webkit-user-select: none;
|
|
59
|
+
-webkit-tap-highlight-color: transparent;
|
|
60
|
+
transition:
|
|
61
|
+
background-color var(--mb-duration-base) var(--mb-ease-out),
|
|
62
|
+
color var(--mb-duration-base) var(--mb-ease-out),
|
|
63
|
+
scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mb-scene-tile[data-size="sm"] {
|
|
67
|
+
--mb-scene-tile-height: var(--mb-scene-tile-height-sm);
|
|
68
|
+
--mb-scene-tile-icon-size: calc(var(--mb-scene-tile-height-sm) - 12px);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mb-scene-tile[data-active] {
|
|
72
|
+
--mb-scene-tile-bg: light-dark(rgb(255 255 255 / 0.97), color-mix(in oklch, var(--mb-tint) 8%, rgb(246 246 248)));
|
|
73
|
+
--mb-scene-tile-fg: rgb(0 0 0 / 0.88);
|
|
74
|
+
--mb-scene-tile-icon-bg: oklch(from var(--mb-accent) min(l, 0.62) c h);
|
|
75
|
+
--mb-scene-tile-icon-fg: white;
|
|
76
|
+
--mb-scene-tile-edge: rgb(0 0 0 / 0.04);
|
|
77
|
+
box-shadow:
|
|
78
|
+
inset 0 0 0 var(--mb-hairline) var(--mb-scene-tile-edge),
|
|
79
|
+
0 1px 3px rgb(0 0 0 / 0.12);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Art behind the tile. The tile's own fill becomes a veil over it, so the name reads as it does on a plain tile. */
|
|
83
|
+
.mb-scene-tile[data-background] {
|
|
84
|
+
isolation: isolate;
|
|
85
|
+
background: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.mb-scene-tile-background {
|
|
89
|
+
position: absolute;
|
|
90
|
+
z-index: -1;
|
|
91
|
+
inset: 0;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
border-radius: inherit;
|
|
94
|
+
pointer-events: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.mb-scene-tile-background > .mb-artwork {
|
|
98
|
+
position: absolute;
|
|
99
|
+
inset: 0;
|
|
100
|
+
inline-size: 100%;
|
|
101
|
+
block-size: 100%;
|
|
102
|
+
aspect-ratio: auto;
|
|
103
|
+
border-radius: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.mb-scene-tile-background > .mb-artwork::after {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.mb-scene-tile-background::after {
|
|
111
|
+
content: "";
|
|
112
|
+
position: absolute;
|
|
113
|
+
inset: 0;
|
|
114
|
+
background: var(--mb-scene-tile-veil, var(--mb-scene-tile-bg));
|
|
115
|
+
transition: background-color var(--mb-duration-base) var(--mb-ease-out);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.mb-scene-tile[data-background]:not([data-active]) {
|
|
119
|
+
--mb-scene-tile-veil: light-dark(rgb(255 255 255 / 0.32), rgb(0 0 0 / 0.3));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* On, the art shows as a tint under the bright fill. */
|
|
123
|
+
.mb-scene-tile[data-background][data-active] {
|
|
124
|
+
--mb-scene-tile-veil: light-dark(rgb(255 255 255 / 0.8), rgb(246 246 248 / 0.84));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.mb-scene-tile-icon {
|
|
128
|
+
display: grid;
|
|
129
|
+
flex: none;
|
|
130
|
+
place-items: center;
|
|
131
|
+
width: var(--mb-scene-tile-icon-size);
|
|
132
|
+
height: var(--mb-scene-tile-icon-size);
|
|
133
|
+
border-radius: var(--mb-radius-full);
|
|
134
|
+
background: var(--mb-scene-tile-icon-bg);
|
|
135
|
+
color: var(--mb-scene-tile-icon-fg);
|
|
136
|
+
transition:
|
|
137
|
+
background-color var(--mb-duration-base) var(--mb-ease-out),
|
|
138
|
+
color var(--mb-duration-base) var(--mb-ease-out);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.mb-scene-tile-icon > :where(svg:not(.mb-activity-indicator-spokes)) {
|
|
142
|
+
width: var(--mb-scene-tile-glyph-size);
|
|
143
|
+
height: var(--mb-scene-tile-glyph-size);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.mb-scene-tile-name {
|
|
147
|
+
/* Two lines before truncating, as in the Home app. */
|
|
148
|
+
display: -webkit-box;
|
|
149
|
+
-webkit-box-orient: vertical;
|
|
150
|
+
-webkit-line-clamp: 2;
|
|
151
|
+
line-clamp: 2;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
white-space: normal;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.mb-scene-tile::after {
|
|
158
|
+
content: "";
|
|
159
|
+
position: absolute;
|
|
160
|
+
inset: 50% auto auto 50%;
|
|
161
|
+
width: max(100%, var(--mb-hit-target));
|
|
162
|
+
height: max(100%, var(--mb-hit-target));
|
|
163
|
+
translate: -50% -50%;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.mb-scene-tile:focus-visible {
|
|
167
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
168
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.mb-scene-tile[data-disabled] {
|
|
172
|
+
opacity: 0.5;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
@media (hover: hover) and (pointer: fine) {
|
|
176
|
+
.mb-scene-tile:not([data-active], [data-disabled]):hover {
|
|
177
|
+
--mb-scene-tile-bg: light-dark(
|
|
178
|
+
color-mix(in oklch, var(--mb-ink) 4%, rgb(255 255 255 / 0.5)),
|
|
179
|
+
color-mix(in oklch, var(--mb-bg-elevated) 68%, transparent)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media (hover: hover) and (pointer: fine) {
|
|
185
|
+
.mb-scene-tile[data-background]:not([data-active], [data-disabled]):hover {
|
|
186
|
+
--mb-scene-tile-veil: light-dark(rgb(255 255 255 / 0.44), rgb(0 0 0 / 0.16));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
191
|
+
.mb-scene-tile:not([data-disabled]):active {
|
|
192
|
+
scale: 0.96;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@scope ([data-platform="macos"]) to (:scope [data-platform]) {
|
|
197
|
+
.mb-scene-tile:not([data-disabled]):active {
|
|
198
|
+
--mb-scene-tile-bg: light-dark(
|
|
199
|
+
color-mix(in oklch, var(--mb-bg-elevated) 84%, transparent),
|
|
200
|
+
color-mix(in oklch, var(--mb-bg-elevated) 64%, transparent)
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* The row: two tiles abreast that scroll on iPhone; a wrapping grid on iPad and Mac. */
|
|
206
|
+
.mb-scene-row {
|
|
207
|
+
display: grid;
|
|
208
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--mb-scene-tile-min-width), 1fr));
|
|
209
|
+
gap: var(--mb-scene-row-gap);
|
|
210
|
+
min-width: 0;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.mb-scene-row > .mb-scene-tile {
|
|
214
|
+
min-width: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@scope ([data-platform="ios"]) to (:scope [data-platform]) {
|
|
218
|
+
.mb-scene-row {
|
|
219
|
+
grid-auto-flow: column;
|
|
220
|
+
grid-template-columns: none;
|
|
221
|
+
grid-auto-columns: calc((100% - var(--mb-scene-row-gap)) / 2);
|
|
222
|
+
overflow-x: auto;
|
|
223
|
+
overscroll-behavior-x: contain;
|
|
224
|
+
scroll-snap-type: x mandatory;
|
|
225
|
+
scroll-padding-inline: 0;
|
|
226
|
+
scrollbar-width: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.mb-scene-row::-webkit-scrollbar {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.mb-scene-row > .mb-scene-tile {
|
|
234
|
+
scroll-snap-align: start;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
@supports (corner-shape: squircle) {
|
|
239
|
+
.mb-scene-tile {
|
|
240
|
+
corner-shape: var(--mb-corner-shape);
|
|
241
|
+
border-radius: calc(var(--mb-scene-tile-radius) * var(--mb-corner-factor));
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.mb-scene-tile-background {
|
|
245
|
+
corner-shape: inherit;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@media (prefers-contrast: more) {
|
|
250
|
+
.mb-scene-tile {
|
|
251
|
+
--mb-scene-tile-edge: var(--mb-control-border);
|
|
252
|
+
--mb-scene-tile-bg: var(--mb-bg-elevated);
|
|
253
|
+
-webkit-backdrop-filter: none;
|
|
254
|
+
backdrop-filter: none;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.mb-scene-tile[data-active] {
|
|
258
|
+
--mb-scene-tile-bg: rgb(255 255 255);
|
|
259
|
+
box-shadow: inset 0 0 0 2px var(--mb-scene-tile-icon-bg);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
264
|
+
:where(:root:not([data-transparency="full"])) {
|
|
265
|
+
.mb-scene-tile:not([data-active]) {
|
|
266
|
+
background-color: var(--mb-bg-elevated);
|
|
267
|
+
-webkit-backdrop-filter: none;
|
|
268
|
+
backdrop-filter: none;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
@media (prefers-contrast: more) {
|
|
274
|
+
.mb-scene-tile-background {
|
|
275
|
+
display: none;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.mb-scene-tile[data-background] {
|
|
279
|
+
background: var(--mb-scene-tile-bg);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@media (forced-colors: active) {
|
|
284
|
+
.mb-scene-tile-background {
|
|
285
|
+
display: none;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.mb-scene-tile {
|
|
289
|
+
border: 1px solid ButtonText;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.mb-scene-tile[data-active] {
|
|
293
|
+
border: 3px solid Highlight;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/* Scroll View — Apple's overlay scrollbars, and edges that fade while there's more to see. */
|
|
2
|
+
|
|
3
|
+
:where(:root, [data-platform="macos"]) {
|
|
4
|
+
--mb-scroll-view-bar: 14px;
|
|
5
|
+
--mb-scroll-view-thumb: 7px;
|
|
6
|
+
--mb-scroll-view-thumb-hover: 10px;
|
|
7
|
+
--mb-scroll-view-thumb-inset: 2px;
|
|
8
|
+
--mb-scroll-view-fade: 24px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
12
|
+
--mb-scroll-view-bar: 9px;
|
|
13
|
+
--mb-scroll-view-thumb: 3px;
|
|
14
|
+
--mb-scroll-view-thumb-hover: 3px;
|
|
15
|
+
--mb-scroll-view-thumb-inset: 3px;
|
|
16
|
+
--mb-scroll-view-fade: 32px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mb-scroll-view {
|
|
20
|
+
--mb-scroll-view-thumb-color: light-dark(rgb(0 0 0 / 0.42), rgb(255 255 255 / 0.42));
|
|
21
|
+
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
min-height: 0;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mb-scroll-view[data-variant="bordered"] {
|
|
31
|
+
border-radius: var(--mb-radius-md);
|
|
32
|
+
background: var(--mb-bg);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* The frame sits above the content so rows scrolling under it don't cover it. */
|
|
36
|
+
.mb-scroll-view[data-variant="bordered"]::after {
|
|
37
|
+
content: "";
|
|
38
|
+
position: absolute;
|
|
39
|
+
z-index: 2;
|
|
40
|
+
inset: 0;
|
|
41
|
+
border-radius: inherit;
|
|
42
|
+
box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-separator-strong);
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.mb-scroll-view-viewport {
|
|
47
|
+
flex: 1 1 auto;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
min-height: 0;
|
|
50
|
+
max-height: inherit;
|
|
51
|
+
border-radius: inherit;
|
|
52
|
+
scrollbar-width: none;
|
|
53
|
+
overscroll-behavior: contain;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mb-scroll-view-viewport::-webkit-scrollbar {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.mb-scroll-view-viewport:focus-visible {
|
|
61
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
62
|
+
outline-offset: calc(var(--mb-focus-ring-width) * -1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mb-scroll-view:is([data-orientation="horizontal"], [data-orientation="both"]) .mb-scroll-view-content {
|
|
66
|
+
/* ui-sdk sets min-width: fit-content inline, so this fills the viewport and still grows with wide content. */
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.mb-scroll-view-scrollbar {
|
|
71
|
+
z-index: 1;
|
|
72
|
+
display: flex;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
padding: var(--mb-scroll-view-thumb-inset);
|
|
75
|
+
opacity: 0;
|
|
76
|
+
touch-action: none;
|
|
77
|
+
user-select: none;
|
|
78
|
+
-webkit-user-select: none;
|
|
79
|
+
/* Fades out slowly once you stop, like the real one. */
|
|
80
|
+
transition:
|
|
81
|
+
opacity var(--mb-duration-slow) var(--mb-ease-out),
|
|
82
|
+
background-color var(--mb-duration-fast) var(--mb-ease-out);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.mb-scroll-view-scrollbar[data-orientation="vertical"] {
|
|
86
|
+
justify-content: flex-end;
|
|
87
|
+
width: var(--mb-scroll-view-bar);
|
|
88
|
+
margin-block-end: var(--scroll-area-corner-height, 0px);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.mb-scroll-view-scrollbar[data-orientation="horizontal"] {
|
|
92
|
+
align-items: flex-end;
|
|
93
|
+
height: var(--mb-scroll-view-bar);
|
|
94
|
+
margin-inline-end: var(--scroll-area-corner-width, 0px);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.mb-scroll-view-scrollbar[data-visible] {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
transition-duration: var(--mb-duration-fast), var(--mb-duration-fast);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.mb-scroll-view-thumb {
|
|
103
|
+
flex: none;
|
|
104
|
+
border-radius: var(--mb-radius-full);
|
|
105
|
+
background: var(--mb-scroll-view-thumb-color);
|
|
106
|
+
transition:
|
|
107
|
+
width var(--mb-spring-snappy-duration) var(--mb-spring-snappy),
|
|
108
|
+
height var(--mb-spring-snappy-duration) var(--mb-spring-snappy),
|
|
109
|
+
background-color var(--mb-duration-fast) var(--mb-ease-out);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.mb-scroll-view-thumb[data-orientation="vertical"] {
|
|
113
|
+
width: var(--mb-scroll-view-thumb);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.mb-scroll-view-thumb[data-orientation="horizontal"] {
|
|
117
|
+
height: var(--mb-scroll-view-thumb);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Under the pointer, macOS widens the thumb and lays a faint track behind it. */
|
|
121
|
+
@media (hover: hover) and (pointer: fine) {
|
|
122
|
+
.mb-scroll-view-scrollbar[data-visible]:is(:hover, [data-dragging]) {
|
|
123
|
+
background: var(--mb-fill-quaternary);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.mb-scroll-view-scrollbar[data-orientation="vertical"]:is(:hover, [data-dragging]) .mb-scroll-view-thumb {
|
|
127
|
+
width: var(--mb-scroll-view-thumb-hover);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.mb-scroll-view-scrollbar[data-orientation="horizontal"]:is(:hover, [data-dragging]) .mb-scroll-view-thumb {
|
|
131
|
+
height: var(--mb-scroll-view-thumb-hover);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.mb-scroll-view-scrollbar:is(:hover, [data-dragging]) {
|
|
135
|
+
--mb-scroll-view-thumb-color: light-dark(rgb(0 0 0 / 0.55), rgb(255 255 255 / 0.55));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
140
|
+
.mb-scroll-view-scrollbar {
|
|
141
|
+
background: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Fades grow with how far the content reaches past each edge, so they're gone at the ends. */
|
|
146
|
+
.mb-scroll-view[data-fade][data-orientation="vertical"] {
|
|
147
|
+
-webkit-mask-image: linear-gradient(
|
|
148
|
+
to bottom,
|
|
149
|
+
transparent,
|
|
150
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-y-start, 0px)),
|
|
151
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-y-end, 0px))),
|
|
152
|
+
transparent
|
|
153
|
+
);
|
|
154
|
+
mask-image: linear-gradient(
|
|
155
|
+
to bottom,
|
|
156
|
+
transparent,
|
|
157
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-y-start, 0px)),
|
|
158
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-y-end, 0px))),
|
|
159
|
+
transparent
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.mb-scroll-view[data-fade][data-orientation="horizontal"] {
|
|
164
|
+
-webkit-mask-image: linear-gradient(
|
|
165
|
+
to right,
|
|
166
|
+
transparent,
|
|
167
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-start, 0px)),
|
|
168
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-end, 0px))),
|
|
169
|
+
transparent
|
|
170
|
+
);
|
|
171
|
+
mask-image: linear-gradient(
|
|
172
|
+
to right,
|
|
173
|
+
transparent,
|
|
174
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-start, 0px)),
|
|
175
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-end, 0px))),
|
|
176
|
+
transparent
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
:where([dir="rtl"]) .mb-scroll-view[data-fade][data-orientation="horizontal"] {
|
|
181
|
+
-webkit-mask-image: linear-gradient(
|
|
182
|
+
to left,
|
|
183
|
+
transparent,
|
|
184
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-start, 0px)),
|
|
185
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-end, 0px))),
|
|
186
|
+
transparent
|
|
187
|
+
);
|
|
188
|
+
mask-image: linear-gradient(
|
|
189
|
+
to left,
|
|
190
|
+
transparent,
|
|
191
|
+
#000 min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-start, 0px)),
|
|
192
|
+
#000 calc(100% - min(var(--mb-scroll-view-fade), var(--scroll-area-overflow-x-end, 0px))),
|
|
193
|
+
transparent
|
|
194
|
+
);
|
|
195
|
+
}
|