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,208 @@
|
|
|
1
|
+
/* Slider — a thin track filled with the accent on the minimum side, and a white knob.
|
|
2
|
+
macOS keeps both small and crisp; touch gives a thicker track and a 28pt thumb that swells under the finger. */
|
|
3
|
+
|
|
4
|
+
:where(:root, [data-platform="macos"]) {
|
|
5
|
+
--mb-slider-track: 4px;
|
|
6
|
+
--mb-slider-thumb: 20px;
|
|
7
|
+
--mb-slider-track-sm: 3px;
|
|
8
|
+
--mb-slider-thumb-sm: 14px;
|
|
9
|
+
--mb-slider-thumb-grow: 1;
|
|
10
|
+
--mb-slider-tick: 6px;
|
|
11
|
+
--mb-slider-value-font: var(--mb-text-callout);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
15
|
+
--mb-slider-track: 6px;
|
|
16
|
+
--mb-slider-thumb: 28px;
|
|
17
|
+
--mb-slider-track-sm: 4px;
|
|
18
|
+
--mb-slider-thumb-sm: 22px;
|
|
19
|
+
--mb-slider-thumb-grow: 1.12;
|
|
20
|
+
--mb-slider-tick: 8px;
|
|
21
|
+
--mb-slider-value-font: var(--mb-text-footnote);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.mb-slider {
|
|
25
|
+
--mb-slider-t: var(--mb-slider-track);
|
|
26
|
+
--mb-slider-k: var(--mb-slider-thumb);
|
|
27
|
+
--mb-slider-band: max(var(--mb-slider-k), var(--mb-hit-target));
|
|
28
|
+
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--mb-space-3);
|
|
32
|
+
width: 100%;
|
|
33
|
+
min-width: 160px;
|
|
34
|
+
color: var(--mb-label);
|
|
35
|
+
font: var(--mb-text-body);
|
|
36
|
+
letter-spacing: var(--mb-tracking-body);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.mb-slider[data-size="sm"] {
|
|
40
|
+
--mb-slider-t: var(--mb-slider-track-sm);
|
|
41
|
+
--mb-slider-k: var(--mb-slider-thumb-sm);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The control insets the track by half a knob, so the knob never leaves the control at either end. */
|
|
45
|
+
.mb-slider-control {
|
|
46
|
+
position: relative;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
width: 100%;
|
|
51
|
+
min-height: var(--mb-slider-band);
|
|
52
|
+
padding-inline: calc(var(--mb-slider-k) / 2);
|
|
53
|
+
touch-action: none;
|
|
54
|
+
-webkit-tap-highlight-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.mb-slider-track {
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: var(--mb-slider-t);
|
|
60
|
+
border-radius: var(--mb-radius-full);
|
|
61
|
+
background: var(--mb-fill);
|
|
62
|
+
box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-separator);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mb-slider-indicator {
|
|
66
|
+
border-radius: inherit;
|
|
67
|
+
background: var(--mb-accent);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.mb-slider-thumb {
|
|
71
|
+
width: var(--mb-slider-k);
|
|
72
|
+
height: var(--mb-slider-k);
|
|
73
|
+
border-radius: var(--mb-radius-full);
|
|
74
|
+
background: #ffffff;
|
|
75
|
+
box-shadow: var(--mb-shadow-thumb);
|
|
76
|
+
cursor: default;
|
|
77
|
+
transition:
|
|
78
|
+
scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy),
|
|
79
|
+
background-color var(--mb-duration-fast) var(--mb-ease-out),
|
|
80
|
+
box-shadow var(--mb-duration-fast) var(--mb-ease-out);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* The knob dims as macOS's does while it's held. */
|
|
84
|
+
.mb-slider-thumb:active,
|
|
85
|
+
.mb-slider-thumb[data-dragging] {
|
|
86
|
+
background: light-dark(#f1f1f1, #e6e6e6);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.mb-slider-thumb:has(:focus-visible) {
|
|
90
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
91
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.mb-slider-value {
|
|
95
|
+
color: var(--mb-label-secondary);
|
|
96
|
+
font: var(--mb-slider-value-font);
|
|
97
|
+
font-variant-numeric: tabular-nums;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Tick marks: evenly spaced from the minimum to the maximum, under the track. */
|
|
101
|
+
.mb-slider-ticks {
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: space-between;
|
|
104
|
+
margin-block-start: var(--mb-space-2);
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.mb-slider-tick {
|
|
109
|
+
width: 1px;
|
|
110
|
+
height: var(--mb-slider-tick);
|
|
111
|
+
margin-inline: -0.5px;
|
|
112
|
+
border-radius: 0.5px;
|
|
113
|
+
background: var(--mb-label-tertiary);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.mb-slider-control:has(.mb-slider-ticks) {
|
|
117
|
+
justify-content: flex-start;
|
|
118
|
+
padding-block-start: calc((var(--mb-slider-band) - var(--mb-slider-t)) / 2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Vertical: the minimum is at the bottom. */
|
|
122
|
+
.mb-slider[data-orientation="vertical"] {
|
|
123
|
+
flex-direction: column-reverse;
|
|
124
|
+
align-items: center;
|
|
125
|
+
width: auto;
|
|
126
|
+
min-width: 0;
|
|
127
|
+
height: 160px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.mb-slider-control[data-orientation="vertical"] {
|
|
131
|
+
flex: 1;
|
|
132
|
+
flex-direction: row;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
width: auto;
|
|
135
|
+
min-width: var(--mb-slider-band);
|
|
136
|
+
min-height: 0;
|
|
137
|
+
padding: calc(var(--mb-slider-k) / 2) 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.mb-slider-track[data-orientation="vertical"] {
|
|
141
|
+
width: var(--mb-slider-t);
|
|
142
|
+
height: 100%;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.mb-slider-control[data-orientation="vertical"] .mb-slider-ticks {
|
|
146
|
+
flex-direction: column-reverse;
|
|
147
|
+
margin: 0 0 0 var(--mb-space-2);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.mb-slider-control[data-orientation="vertical"] .mb-slider-tick {
|
|
151
|
+
width: var(--mb-slider-tick);
|
|
152
|
+
height: 1px;
|
|
153
|
+
margin: -0.5px 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.mb-slider-control[data-orientation="vertical"]:has(.mb-slider-ticks) {
|
|
157
|
+
justify-content: flex-start;
|
|
158
|
+
padding-inline-start: calc((var(--mb-slider-band) - var(--mb-slider-t)) / 2);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.mb-slider[data-disabled] {
|
|
162
|
+
opacity: 0.4;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.mb-slider[data-disabled] .mb-slider-indicator {
|
|
166
|
+
background: var(--mb-label-tertiary);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
170
|
+
.mb-slider-track {
|
|
171
|
+
box-shadow: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.mb-slider-thumb {
|
|
175
|
+
box-shadow:
|
|
176
|
+
0 0.5px 4px rgb(0 0 0 / 0.12),
|
|
177
|
+
0 6px 13px rgb(0 0 0 / 0.12),
|
|
178
|
+
0 0 0 0.5px rgb(0 0 0 / 0.04);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.mb-slider-thumb:active,
|
|
182
|
+
.mb-slider-thumb[data-dragging] {
|
|
183
|
+
background: #ffffff;
|
|
184
|
+
scale: var(--mb-slider-thumb-grow);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@media (prefers-reduced-motion: reduce) {
|
|
189
|
+
:where(:root:not([data-motion="full"])) {
|
|
190
|
+
.mb-slider-thumb:active,
|
|
191
|
+
.mb-slider-thumb[data-dragging] {
|
|
192
|
+
scale: 1 !important;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/* The native look leans on a soft shadow for the knob and a faint track (about 1.3:1).
|
|
198
|
+
Increase Contrast gives both a real edge. */
|
|
199
|
+
/* Two classes so the rule beats the scoped touch rules, which win on proximity. */
|
|
200
|
+
@media (prefers-contrast: more) {
|
|
201
|
+
.mb-slider .mb-slider-track {
|
|
202
|
+
box-shadow: inset 0 0 0 1px var(--mb-control-border);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.mb-slider .mb-slider-thumb {
|
|
206
|
+
box-shadow: var(--mb-shadow-thumb), 0 0 0 1px var(--mb-control-border);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* Split View — side-by-side panes with thin dividers, like NSSplitView and UISplitViewController. */
|
|
2
|
+
|
|
3
|
+
.mb-split-view {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
min-height: 0;
|
|
8
|
+
color: var(--mb-label);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mb-split-view-pane {
|
|
12
|
+
position: relative;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
min-height: 0;
|
|
15
|
+
overflow: auto;
|
|
16
|
+
background: var(--mb-bg);
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* A Sidebar inside drops its own material, so glass never sits on glass. */
|
|
21
|
+
.mb-split-view-pane[data-variant="sidebar"] {
|
|
22
|
+
--mb-sidebar-bg: transparent;
|
|
23
|
+
--mb-sidebar-filter: none;
|
|
24
|
+
background: var(--mb-material-sidebar);
|
|
25
|
+
-webkit-backdrop-filter: var(--mb-material-filter);
|
|
26
|
+
backdrop-filter: var(--mb-material-filter);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mb-split-view-pane[data-variant="inspector"] {
|
|
30
|
+
background: var(--mb-bg-secondary);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mb-split-view-pane[data-collapsed] {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* The line is a hairline; ui-sdk widens the hit area around it on its own. */
|
|
38
|
+
.mb-split-view-divider {
|
|
39
|
+
position: relative;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
flex: none;
|
|
42
|
+
background: var(--mb-separator-opaque);
|
|
43
|
+
outline: none;
|
|
44
|
+
transition: background-color var(--mb-duration-fast) var(--mb-ease-out);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.mb-split-view-divider[data-orientation="horizontal"] {
|
|
48
|
+
width: 1px;
|
|
49
|
+
cursor: col-resize;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mb-split-view-divider[data-orientation="vertical"] {
|
|
53
|
+
height: 1px;
|
|
54
|
+
cursor: row-resize;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.mb-split-view-divider:focus-visible,
|
|
58
|
+
.mb-split-view-divider[data-dragging] {
|
|
59
|
+
background: var(--mb-accent);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mb-split-view-divider:focus-visible {
|
|
63
|
+
box-shadow: 0 0 0 1px var(--mb-focus-ring);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mb-split-view-divider[data-disabled] {
|
|
67
|
+
cursor: default;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
71
|
+
.mb-split-view-divider[data-orientation="horizontal"] {
|
|
72
|
+
width: var(--mb-hairline);
|
|
73
|
+
background: var(--mb-separator);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* Squircle — a box with Apple's continuous corners. The mechanism is in base.css. */
|
|
2
|
+
|
|
3
|
+
.mb-squircle {
|
|
4
|
+
--mb-squircle-radius: var(--mb-squircle-radius-icon);
|
|
5
|
+
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
border-radius: var(--mb-squircle-radius);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@supports (corner-shape: squircle) {
|
|
12
|
+
.mb-squircle {
|
|
13
|
+
corner-shape: var(--mb-corner-shape);
|
|
14
|
+
border-radius: calc(var(--mb-squircle-radius) * var(--mb-corner-factor));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* A smoothing of its own: only where superellipse() exists, or the factor would apply to a round corner. */
|
|
19
|
+
@supports (corner-shape: superellipse(2)) {
|
|
20
|
+
.mb-squircle[data-smoothing] {
|
|
21
|
+
--mb-corner-shape: superellipse(var(--mb-squircle-k));
|
|
22
|
+
--mb-corner-smoothing: var(--mb-squircle-m);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Exact: the clip-path is the shape, so the radius only has to stay out of its way. */
|
|
27
|
+
.mb-squircle[data-exact] {
|
|
28
|
+
border-radius: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.mb-squircle[data-shadow] {
|
|
32
|
+
box-shadow: var(--mb-squircle-shadow);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.mb-squircle-shadow {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
flex: none;
|
|
38
|
+
vertical-align: top;
|
|
39
|
+
filter: drop-shadow(var(--mb-squircle-shadow));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:where(.mb-squircle, .mb-squircle-shadow) {
|
|
43
|
+
--mb-squircle-shadow: 0 2px 6px rgb(0 0 0 / 0.22);
|
|
44
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/* Stepper and NumberField — macOS's text field with a small up/down stepper attached,
|
|
2
|
+
and the − / + capsule stepper of iPadOS and iOS. */
|
|
3
|
+
|
|
4
|
+
:where(:root, [data-platform="macos"]) {
|
|
5
|
+
--mb-stepper-width: 15px;
|
|
6
|
+
--mb-stepper-height: var(--mb-control-height);
|
|
7
|
+
--mb-stepper-height-sm: var(--mb-control-height-sm);
|
|
8
|
+
--mb-stepper-glyph: 9px;
|
|
9
|
+
--mb-number-field-width: 64px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
13
|
+
--mb-stepper-width: 94px;
|
|
14
|
+
--mb-stepper-height: 32px;
|
|
15
|
+
--mb-stepper-height-sm: 28px;
|
|
16
|
+
--mb-stepper-glyph: 16px;
|
|
17
|
+
--mb-number-field-width: 5ch;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mb-number-field,
|
|
21
|
+
.mb-stepper {
|
|
22
|
+
--mb-stepper-h: var(--mb-stepper-height);
|
|
23
|
+
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex: none;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--mb-space-3);
|
|
28
|
+
color: var(--mb-label);
|
|
29
|
+
font: var(--mb-text-body);
|
|
30
|
+
letter-spacing: var(--mb-tracking-body);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:is(.mb-number-field, .mb-stepper)[data-size="sm"] {
|
|
34
|
+
--mb-stepper-h: var(--mb-stepper-height-sm);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mb-number-field-group {
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: var(--mb-space-2);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* The text field. */
|
|
44
|
+
.mb-number-field-input {
|
|
45
|
+
width: var(--mb-number-field-width);
|
|
46
|
+
height: var(--mb-stepper-h);
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: 0 var(--mb-space-3);
|
|
49
|
+
border: 0;
|
|
50
|
+
border-radius: var(--mb-control-radius-sm);
|
|
51
|
+
background: var(--mb-bg-field);
|
|
52
|
+
box-shadow:
|
|
53
|
+
inset 0 0 0 var(--mb-hairline) var(--mb-control-border),
|
|
54
|
+
inset 0 0.5px 1px var(--mb-shadow-color);
|
|
55
|
+
color: var(--mb-label);
|
|
56
|
+
font: inherit;
|
|
57
|
+
font-variant-numeric: tabular-nums;
|
|
58
|
+
letter-spacing: inherit;
|
|
59
|
+
text-align: end;
|
|
60
|
+
outline: none;
|
|
61
|
+
transition: box-shadow var(--mb-duration-fast) var(--mb-ease-out);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.mb-number-field-input::placeholder {
|
|
65
|
+
color: var(--mb-placeholder);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.mb-number-field-input:focus {
|
|
69
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
70
|
+
outline-offset: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.mb-number-field-input[data-invalid] {
|
|
74
|
+
box-shadow: inset 0 0 0 1.5px var(--mb-destructive);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* The stepper: a narrow raised control split into up and down. */
|
|
78
|
+
.mb-stepper-buttons {
|
|
79
|
+
position: relative;
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
flex: none;
|
|
82
|
+
flex-direction: column-reverse;
|
|
83
|
+
width: var(--mb-stepper-width);
|
|
84
|
+
height: var(--mb-stepper-h);
|
|
85
|
+
border-radius: var(--mb-radius-xs);
|
|
86
|
+
background: var(--mb-bg-control);
|
|
87
|
+
box-shadow:
|
|
88
|
+
0 0 0 var(--mb-hairline) var(--mb-control-border),
|
|
89
|
+
0 0.5px 1.5px var(--mb-shadow-color);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.mb-stepper-button {
|
|
93
|
+
position: relative;
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
flex: 1 1 0;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
min-height: 0;
|
|
100
|
+
margin: 0;
|
|
101
|
+
padding: 0;
|
|
102
|
+
border: 0;
|
|
103
|
+
border-radius: 0;
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: var(--mb-label);
|
|
106
|
+
cursor: default;
|
|
107
|
+
touch-action: manipulation;
|
|
108
|
+
-webkit-tap-highlight-color: transparent;
|
|
109
|
+
transition: background-color var(--mb-duration-fast) var(--mb-ease-out);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Each half is 15×14 on macOS: grow the hit area outward (up for increment, down for
|
|
113
|
+
decrement, and to the sides) so the arrows are as easy to hit as NSStepper's. */
|
|
114
|
+
.mb-stepper-button::after {
|
|
115
|
+
content: "";
|
|
116
|
+
position: absolute;
|
|
117
|
+
inset-block: 0;
|
|
118
|
+
inset-inline: calc(var(--mb-space-2) * -1) calc(var(--mb-space-3) * -1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mb-stepper-button[data-step="increment"]::after {
|
|
122
|
+
inset-block-start: calc(var(--mb-space-3) * -1);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.mb-stepper-button[data-step="decrement"]::after {
|
|
126
|
+
inset-block-end: calc(var(--mb-space-3) * -1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.mb-stepper-button[data-step="increment"] {
|
|
130
|
+
border-start-start-radius: inherit;
|
|
131
|
+
border-start-end-radius: inherit;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.mb-stepper-button[data-step="decrement"] {
|
|
135
|
+
border-end-start-radius: inherit;
|
|
136
|
+
border-end-end-radius: inherit;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.mb-stepper-button:active:not([data-disabled]) {
|
|
140
|
+
background: color-mix(in oklch, transparent, var(--mb-ink) 14%);
|
|
141
|
+
transition-duration: 0ms;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.mb-stepper-button[data-disabled] {
|
|
145
|
+
color: var(--mb-label-quaternary);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.mb-stepper-glyph {
|
|
149
|
+
flex: none;
|
|
150
|
+
width: var(--mb-stepper-glyph);
|
|
151
|
+
fill: none;
|
|
152
|
+
stroke: currentColor;
|
|
153
|
+
stroke-width: 1.5;
|
|
154
|
+
stroke-linecap: round;
|
|
155
|
+
stroke-linejoin: round;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.mb-stepper-glyph[data-glyph="sign"] {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* The standalone stepper's field is hidden but focusable, so the ring goes on the buttons. */
|
|
163
|
+
.mb-stepper-input {
|
|
164
|
+
position: absolute;
|
|
165
|
+
width: 1px;
|
|
166
|
+
height: 1px;
|
|
167
|
+
margin: -1px;
|
|
168
|
+
padding: 0;
|
|
169
|
+
overflow: hidden;
|
|
170
|
+
clip-path: inset(50%);
|
|
171
|
+
border: 0;
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
opacity: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mb-stepper-buttons:has(.mb-stepper-input:focus-visible) {
|
|
177
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
178
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:is(.mb-number-field, .mb-stepper)[data-disabled] {
|
|
182
|
+
opacity: 0.4;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
|
|
186
|
+
/* A full touch-height row, so the capsule centers on a neighbouring label. */
|
|
187
|
+
.mb-number-field,
|
|
188
|
+
.mb-stepper {
|
|
189
|
+
min-height: var(--mb-hit-target);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.mb-number-field-group {
|
|
193
|
+
gap: var(--mb-space-5);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.mb-number-field-input {
|
|
197
|
+
width: var(--mb-number-field-width);
|
|
198
|
+
height: auto;
|
|
199
|
+
padding: 0;
|
|
200
|
+
border-radius: var(--mb-radius-xs);
|
|
201
|
+
background: transparent;
|
|
202
|
+
box-shadow: none;
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.mb-number-field-input:focus {
|
|
207
|
+
outline: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.mb-number-field-input:focus-visible {
|
|
211
|
+
outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
|
|
212
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.mb-stepper-buttons {
|
|
216
|
+
flex-direction: row;
|
|
217
|
+
border-radius: var(--mb-radius-full);
|
|
218
|
+
background: var(--mb-fill-tertiary);
|
|
219
|
+
box-shadow: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* The hairline between − and +. */
|
|
223
|
+
.mb-stepper-buttons::before {
|
|
224
|
+
content: "";
|
|
225
|
+
position: absolute;
|
|
226
|
+
inset: 25% auto 25% 50%;
|
|
227
|
+
width: 1px;
|
|
228
|
+
margin-inline-start: -0.5px;
|
|
229
|
+
background: var(--mb-separator-strong);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.mb-stepper-button[data-step="decrement"] {
|
|
233
|
+
border-start-start-radius: inherit;
|
|
234
|
+
border-end-start-radius: inherit;
|
|
235
|
+
border-start-end-radius: 0;
|
|
236
|
+
border-end-end-radius: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.mb-stepper-button[data-step="increment"] {
|
|
240
|
+
border-start-start-radius: 0;
|
|
241
|
+
border-end-start-radius: 0;
|
|
242
|
+
border-start-end-radius: inherit;
|
|
243
|
+
border-end-end-radius: inherit;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.mb-stepper-button:active:not([data-disabled]) {
|
|
247
|
+
background: var(--mb-fill);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* 47×32 halves reach 44pt tall. */
|
|
251
|
+
.mb-stepper-button::after,
|
|
252
|
+
.mb-stepper-button[data-step]::after {
|
|
253
|
+
inset: calc((var(--mb-stepper-h) - var(--mb-hit-target)) / 2) 0;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.mb-stepper-glyph {
|
|
257
|
+
stroke-width: 1.8;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.mb-stepper-glyph[data-glyph="chevron"] {
|
|
261
|
+
display: none;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.mb-stepper-glyph[data-glyph="sign"] {
|
|
265
|
+
display: block;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.mb-stepper-buttons:has(.mb-stepper-input:focus-visible) {
|
|
269
|
+
outline-offset: var(--mb-focus-ring-offset);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/* UIStepper's capsule is a faint fill (about 1.2:1); Increase Contrast gives it a real edge. */
|
|
274
|
+
@media (prefers-contrast: more) {
|
|
275
|
+
:is(.mb-number-field, .mb-stepper) .mb-stepper-buttons {
|
|
276
|
+
box-shadow: inset 0 0 0 1px var(--mb-control-border);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/* Switch — a capsule track with a thumb that slides. On is green, as on every Apple platform. */
|
|
2
|
+
|
|
3
|
+
:where(:root, [data-platform="macos"]) {
|
|
4
|
+
--mb-switch-width: 38px;
|
|
5
|
+
--mb-switch-height: 22px;
|
|
6
|
+
--mb-switch-width-sm: 26px;
|
|
7
|
+
--mb-switch-height-sm: 15px;
|
|
8
|
+
--mb-switch-thumb-stretch: 3px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:where([data-platform="ios"], [data-platform="ipados"]) {
|
|
12
|
+
--mb-switch-width: 51px;
|
|
13
|
+
--mb-switch-height: 31px;
|
|
14
|
+
--mb-switch-width-sm: 42px;
|
|
15
|
+
--mb-switch-height-sm: 26px;
|
|
16
|
+
--mb-switch-thumb-stretch: 6px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.mb-switch {
|
|
20
|
+
--mb-switch-w: var(--mb-switch-width);
|
|
21
|
+
--mb-switch-h: var(--mb-switch-height);
|
|
22
|
+
--mb-switch-inset: 2px;
|
|
23
|
+
--mb-switch-thumb: calc(var(--mb-switch-h) - var(--mb-switch-inset) * 2);
|
|
24
|
+
--mb-switch-on: var(--mb-green);
|
|
25
|
+
|
|
26
|
+
position: relative;
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex: none;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: var(--mb-switch-w);
|
|
31
|
+
height: var(--mb-switch-h);
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: var(--mb-switch-inset);
|
|
34
|
+
border: 0;
|
|
35
|
+
border-radius: var(--mb-radius-full);
|
|
36
|
+
background: var(--mb-fill);
|
|
37
|
+
box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-control-border);
|
|
38
|
+
cursor: default;
|
|
39
|
+
touch-action: manipulation;
|
|
40
|
+
-webkit-tap-highlight-color: transparent;
|
|
41
|
+
transition:
|
|
42
|
+
background-color var(--mb-duration-base) var(--mb-ease-out),
|
|
43
|
+
box-shadow var(--mb-duration-base) var(--mb-ease-out);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.mb-switch[data-size="sm"] {
|
|
47
|
+
--mb-switch-w: var(--mb-switch-width-sm);
|
|
48
|
+
--mb-switch-h: var(--mb-switch-height-sm);
|
|
49
|
+
--mb-switch-inset: 1.5px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mb-switch::after {
|
|
53
|
+
content: "";
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 50% auto auto 50%;
|
|
56
|
+
width: max(100%, var(--mb-hit-target));
|
|
57
|
+
height: max(100%, var(--mb-hit-target));
|
|
58
|
+
translate: -50% -50%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.mb-switch[data-checked] {
|
|
62
|
+
background: var(--mb-switch-on);
|
|
63
|
+
box-shadow: inset 0 0 0 var(--mb-hairline) transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.mb-switch-thumb {
|
|
67
|
+
display: block;
|
|
68
|
+
width: var(--mb-switch-thumb);
|
|
69
|
+
height: var(--mb-switch-thumb);
|
|
70
|
+
border-radius: var(--mb-radius-full);
|
|
71
|
+
background: #ffffff;
|
|
72
|
+
box-shadow: var(--mb-shadow-thumb);
|
|
73
|
+
transition:
|
|
74
|
+
translate var(--mb-spring-snappy-duration) var(--mb-spring-snappy),
|
|
75
|
+
width var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.mb-switch[data-checked] .mb-switch-thumb {
|
|
79
|
+
translate: calc(var(--mb-switch-w) - var(--mb-switch-thumb) - var(--mb-switch-inset) * 2) 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* The thumb stretches toward where it's about to go while it's held. */
|
|
83
|
+
.mb-switch:active:not([data-disabled], [data-readonly]) .mb-switch-thumb {
|
|
84
|
+
width: calc(var(--mb-switch-thumb) + var(--mb-switch-thumb-stretch));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.mb-switch[data-checked]:active:not([data-disabled], [data-readonly]) .mb-switch-thumb {
|
|
88
|
+
translate: calc(
|
|
89
|
+
var(--mb-switch-w) - var(--mb-switch-thumb) - var(--mb-switch-inset) * 2 -
|
|
90
|
+
var(--mb-switch-thumb-stretch)
|
|
91
|
+
)
|
|
92
|
+
0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:where([dir="rtl"]) .mb-switch[data-checked] .mb-switch-thumb {
|
|
96
|
+
translate: calc((var(--mb-switch-w) - var(--mb-switch-thumb) - var(--mb-switch-inset) * 2) * -1) 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:where([dir="rtl"]) .mb-switch[data-checked]:active:not([data-disabled], [data-readonly]) .mb-switch-thumb {
|
|
100
|
+
translate: calc(
|
|
101
|
+
(
|
|
102
|
+
var(--mb-switch-w) - var(--mb-switch-thumb) - var(--mb-switch-inset) * 2 -
|
|
103
|
+
var(--mb-switch-thumb-stretch)
|
|
104
|
+
) * -1
|
|
105
|
+
)
|
|
106
|
+
0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mb-switch[data-disabled] {
|
|
110
|
+
opacity: 0.45;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.mb-switch[data-invalid] {
|
|
114
|
+
box-shadow: inset 0 0 0 1.5px var(--mb-destructive);
|
|
115
|
+
}
|