macbetter 0.0.0-stage → 0.1.0-beta.2

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.
Files changed (310) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +92 -2
  3. package/dist/components/accessory-tile.d.ts +50 -0
  4. package/dist/components/accessory-tile.js +46 -0
  5. package/dist/components/activity-indicator.d.ts +15 -0
  6. package/dist/components/activity-indicator.js +15 -0
  7. package/dist/components/alert.d.ts +29 -0
  8. package/dist/components/alert.js +30 -0
  9. package/dist/components/artifact-card.d.ts +41 -0
  10. package/dist/components/artifact-card.js +57 -0
  11. package/dist/components/artwork.d.ts +44 -0
  12. package/dist/components/artwork.js +935 -0
  13. package/dist/components/attachment.d.ts +48 -0
  14. package/dist/components/attachment.js +65 -0
  15. package/dist/components/automation-row.d.ts +24 -0
  16. package/dist/components/automation-row.js +12 -0
  17. package/dist/components/avatar.d.ts +33 -0
  18. package/dist/components/avatar.js +45 -0
  19. package/dist/components/badge.d.ts +24 -0
  20. package/dist/components/badge.js +19 -0
  21. package/dist/components/button.d.ts +20 -0
  22. package/dist/components/button.js +10 -0
  23. package/dist/components/calendar.d.ts +30 -0
  24. package/dist/components/calendar.js +47 -0
  25. package/dist/components/camera-view.d.ts +40 -0
  26. package/dist/components/camera-view.js +44 -0
  27. package/dist/components/card.d.ts +14 -0
  28. package/dist/components/card.js +21 -0
  29. package/dist/components/carousel.d.ts +18 -0
  30. package/dist/components/carousel.js +33 -0
  31. package/dist/components/chat.d.ts +29 -0
  32. package/dist/components/chat.js +29 -0
  33. package/dist/components/checkbox.d.ts +13 -0
  34. package/dist/components/checkbox.js +16 -0
  35. package/dist/components/code-block.d.ts +39 -0
  36. package/dist/components/code-block.js +65 -0
  37. package/dist/components/code-field.d.ts +16 -0
  38. package/dist/components/code-field.js +29 -0
  39. package/dist/components/color-well.d.ts +23 -0
  40. package/dist/components/color-well.js +27 -0
  41. package/dist/components/combo-box.d.ts +42 -0
  42. package/dist/components/combo-box.js +102 -0
  43. package/dist/components/command-palette.d.ts +33 -0
  44. package/dist/components/command-palette.js +55 -0
  45. package/dist/components/confirmation.d.ts +24 -0
  46. package/dist/components/confirmation.js +50 -0
  47. package/dist/components/content-unavailable.d.ts +19 -0
  48. package/dist/components/content-unavailable.js +21 -0
  49. package/dist/components/context-menu.d.ts +9 -0
  50. package/dist/components/context-menu.js +15 -0
  51. package/dist/components/date-picker.d.ts +53 -0
  52. package/dist/components/date-picker.js +86 -0
  53. package/dist/components/description-list.d.ts +18 -0
  54. package/dist/components/description-list.js +17 -0
  55. package/dist/components/device-frame.d.ts +18 -0
  56. package/dist/components/device-frame.js +16 -0
  57. package/dist/components/dialog.d.ts +27 -0
  58. package/dist/components/dialog.js +35 -0
  59. package/dist/components/disclosure.d.ts +32 -0
  60. package/dist/components/disclosure.js +35 -0
  61. package/dist/components/dock.d.ts +28 -0
  62. package/dist/components/dock.js +80 -0
  63. package/dist/components/door-control.d.ts +20 -0
  64. package/dist/components/door-control.js +43 -0
  65. package/dist/components/energy-readout.d.ts +32 -0
  66. package/dist/components/energy-readout.js +27 -0
  67. package/dist/components/field.d.ts +28 -0
  68. package/dist/components/field.js +32 -0
  69. package/dist/components/gauge.d.ts +25 -0
  70. package/dist/components/gauge.js +42 -0
  71. package/dist/components/generated-image.d.ts +39 -0
  72. package/dist/components/generated-image.js +47 -0
  73. package/dist/components/glass.d.ts +34 -0
  74. package/dist/components/glass.js +31 -0
  75. package/dist/components/home-backdrop.d.ts +23 -0
  76. package/dist/components/home-backdrop.js +12 -0
  77. package/dist/components/home-section.d.ts +19 -0
  78. package/dist/components/home-section.js +21 -0
  79. package/dist/components/home-status.d.ts +24 -0
  80. package/dist/components/home-status.js +14 -0
  81. package/dist/components/hover-card.d.ts +14 -0
  82. package/dist/components/hover-card.js +16 -0
  83. package/dist/components/inspector.d.ts +29 -0
  84. package/dist/components/inspector.js +40 -0
  85. package/dist/components/level-control.d.ts +19 -0
  86. package/dist/components/level-control.js +13 -0
  87. package/dist/components/light-color-picker.d.ts +33 -0
  88. package/dist/components/light-color-picker.js +56 -0
  89. package/dist/components/list.d.ts +42 -0
  90. package/dist/components/list.js +42 -0
  91. package/dist/components/listbox.d.ts +16 -0
  92. package/dist/components/listbox.js +28 -0
  93. package/dist/components/lock-control.d.ts +20 -0
  94. package/dist/components/lock-control.js +35 -0
  95. package/dist/components/menu-bar.d.ts +14 -0
  96. package/dist/components/menu-bar.js +16 -0
  97. package/dist/components/menu.d.ts +40 -0
  98. package/dist/components/menu.js +54 -0
  99. package/dist/components/message.d.ts +65 -0
  100. package/dist/components/message.js +69 -0
  101. package/dist/components/model-picker.d.ts +61 -0
  102. package/dist/components/model-picker.js +59 -0
  103. package/dist/components/navigation-bar.d.ts +24 -0
  104. package/dist/components/navigation-bar.js +54 -0
  105. package/dist/components/outline.d.ts +21 -0
  106. package/dist/components/outline.js +40 -0
  107. package/dist/components/page-control.d.ts +10 -0
  108. package/dist/components/page-control.js +8 -0
  109. package/dist/components/plan.d.ts +25 -0
  110. package/dist/components/plan.js +43 -0
  111. package/dist/components/popover.d.ts +16 -0
  112. package/dist/components/popover.js +24 -0
  113. package/dist/components/progress.d.ts +27 -0
  114. package/dist/components/progress.js +27 -0
  115. package/dist/components/prompt-input.d.ts +93 -0
  116. package/dist/components/prompt-input.js +172 -0
  117. package/dist/components/radio.d.ts +16 -0
  118. package/dist/components/radio.js +13 -0
  119. package/dist/components/rating.d.ts +10 -0
  120. package/dist/components/rating.js +12 -0
  121. package/dist/components/reasoning.d.ts +28 -0
  122. package/dist/components/reasoning.js +52 -0
  123. package/dist/components/response.d.ts +14 -0
  124. package/dist/components/response.js +14 -0
  125. package/dist/components/scene-tile.d.ts +22 -0
  126. package/dist/components/scene-tile.js +13 -0
  127. package/dist/components/scroll-view.d.ts +21 -0
  128. package/dist/components/scroll-view.js +13 -0
  129. package/dist/components/search-field.d.ts +16 -0
  130. package/dist/components/search-field.js +12 -0
  131. package/dist/components/secure-field.d.ts +23 -0
  132. package/dist/components/secure-field.js +21 -0
  133. package/dist/components/segmented-control.d.ts +12 -0
  134. package/dist/components/segmented-control.js +10 -0
  135. package/dist/components/select.d.ts +45 -0
  136. package/dist/components/select.js +79 -0
  137. package/dist/components/sensor-readout.d.ts +29 -0
  138. package/dist/components/sensor-readout.js +12 -0
  139. package/dist/components/separator.d.ts +14 -0
  140. package/dist/components/separator.js +11 -0
  141. package/dist/components/setup-code.d.ts +29 -0
  142. package/dist/components/setup-code.js +47 -0
  143. package/dist/components/sheet.d.ts +31 -0
  144. package/dist/components/sheet.js +51 -0
  145. package/dist/components/shimmer.d.ts +18 -0
  146. package/dist/components/shimmer.js +17 -0
  147. package/dist/components/sidebar.d.ts +30 -0
  148. package/dist/components/sidebar.js +26 -0
  149. package/dist/components/slider.d.ts +27 -0
  150. package/dist/components/slider.js +43 -0
  151. package/dist/components/sources.d.ts +51 -0
  152. package/dist/components/sources.js +46 -0
  153. package/dist/components/split-view.d.ts +11 -0
  154. package/dist/components/split-view.js +13 -0
  155. package/dist/components/squircle.d.ts +41 -0
  156. package/dist/components/squircle.js +63 -0
  157. package/dist/components/stepper.d.ts +30 -0
  158. package/dist/components/stepper.js +28 -0
  159. package/dist/components/suggestion.d.ts +23 -0
  160. package/dist/components/suggestion.js +29 -0
  161. package/dist/components/switch.d.ts +10 -0
  162. package/dist/components/switch.js +10 -0
  163. package/dist/components/tab-bar.d.ts +20 -0
  164. package/dist/components/tab-bar.js +17 -0
  165. package/dist/components/table.d.ts +49 -0
  166. package/dist/components/table.js +179 -0
  167. package/dist/components/tabs.d.ts +16 -0
  168. package/dist/components/tabs.js +19 -0
  169. package/dist/components/text-area.d.ts +14 -0
  170. package/dist/components/text-area.js +9 -0
  171. package/dist/components/text-field.d.ts +26 -0
  172. package/dist/components/text-field.js +23 -0
  173. package/dist/components/thermostat-control.d.ts +30 -0
  174. package/dist/components/thermostat-control.js +139 -0
  175. package/dist/components/toast.d.ts +30 -0
  176. package/dist/components/toast.js +114 -0
  177. package/dist/components/toggle.d.ts +21 -0
  178. package/dist/components/toggle.js +19 -0
  179. package/dist/components/token-field.d.ts +31 -0
  180. package/dist/components/token-field.js +78 -0
  181. package/dist/components/tool-call.d.ts +48 -0
  182. package/dist/components/tool-call.js +77 -0
  183. package/dist/components/toolbar.d.ts +27 -0
  184. package/dist/components/toolbar.js +39 -0
  185. package/dist/components/tooltip.d.ts +11 -0
  186. package/dist/components/tooltip.js +18 -0
  187. package/dist/components/window.d.ts +56 -0
  188. package/dist/components/window.js +61 -0
  189. package/dist/index.d.ts +97 -0
  190. package/dist/index.js +98 -0
  191. package/dist/lib/agent-glyphs.d.ts +10 -0
  192. package/dist/lib/agent-glyphs.js +19 -0
  193. package/dist/lib/cx.d.ts +9 -0
  194. package/dist/lib/cx.js +14 -0
  195. package/dist/lib/derive.d.ts +53 -0
  196. package/dist/lib/derive.js +255 -0
  197. package/dist/lib/field-glyphs.d.ts +13 -0
  198. package/dist/lib/field-glyphs.js +28 -0
  199. package/dist/lib/menu-glyphs.d.ts +6 -0
  200. package/dist/lib/menu-glyphs.js +15 -0
  201. package/dist/lib/platform.d.ts +18 -0
  202. package/dist/lib/platform.js +17 -0
  203. package/dist/lib/squircle.d.ts +23 -0
  204. package/dist/lib/squircle.js +69 -0
  205. package/dist/lib/theme.d.ts +42 -0
  206. package/dist/lib/theme.js +62 -0
  207. package/dist/styles/base.css +115 -0
  208. package/dist/styles/components/accessory-tile.css +461 -0
  209. package/dist/styles/components/activity-indicator.css +63 -0
  210. package/dist/styles/components/alert.css +433 -0
  211. package/dist/styles/components/artifact-card.css +238 -0
  212. package/dist/styles/components/artwork.css +380 -0
  213. package/dist/styles/components/attachment.css +540 -0
  214. package/dist/styles/components/automation-row.css +52 -0
  215. package/dist/styles/components/avatar.css +230 -0
  216. package/dist/styles/components/badge.css +204 -0
  217. package/dist/styles/components/button.css +298 -0
  218. package/dist/styles/components/calendar.css +287 -0
  219. package/dist/styles/components/camera-view.css +239 -0
  220. package/dist/styles/components/card.css +100 -0
  221. package/dist/styles/components/carousel.css +210 -0
  222. package/dist/styles/components/chat.css +209 -0
  223. package/dist/styles/components/checkbox.css +212 -0
  224. package/dist/styles/components/code-block.css +162 -0
  225. package/dist/styles/components/code-field.css +163 -0
  226. package/dist/styles/components/color-well.css +452 -0
  227. package/dist/styles/components/combo-box.css +222 -0
  228. package/dist/styles/components/command-palette.css +379 -0
  229. package/dist/styles/components/confirmation.css +189 -0
  230. package/dist/styles/components/content-unavailable.css +105 -0
  231. package/dist/styles/components/context-menu.css +43 -0
  232. package/dist/styles/components/date-picker.css +356 -0
  233. package/dist/styles/components/description-list.css +92 -0
  234. package/dist/styles/components/device-frame.css +202 -0
  235. package/dist/styles/components/dialog.css +366 -0
  236. package/dist/styles/components/disclosure.css +197 -0
  237. package/dist/styles/components/dock.css +404 -0
  238. package/dist/styles/components/door-control.css +187 -0
  239. package/dist/styles/components/energy-readout.css +161 -0
  240. package/dist/styles/components/field.css +175 -0
  241. package/dist/styles/components/gauge.css +239 -0
  242. package/dist/styles/components/generated-image.css +248 -0
  243. package/dist/styles/components/glass.css +113 -0
  244. package/dist/styles/components/home-backdrop.css +81 -0
  245. package/dist/styles/components/home-section.css +100 -0
  246. package/dist/styles/components/home-status.css +215 -0
  247. package/dist/styles/components/hover-card.css +145 -0
  248. package/dist/styles/components/index.css +94 -0
  249. package/dist/styles/components/inspector.css +236 -0
  250. package/dist/styles/components/level-control.css +247 -0
  251. package/dist/styles/components/light-color-picker.css +94 -0
  252. package/dist/styles/components/list.css +411 -0
  253. package/dist/styles/components/listbox.css +168 -0
  254. package/dist/styles/components/lock-control.css +164 -0
  255. package/dist/styles/components/menu-bar.css +94 -0
  256. package/dist/styles/components/menu.css +454 -0
  257. package/dist/styles/components/message.css +236 -0
  258. package/dist/styles/components/model-picker.css +64 -0
  259. package/dist/styles/components/navigation-bar.css +249 -0
  260. package/dist/styles/components/outline.css +248 -0
  261. package/dist/styles/components/page-control.css +127 -0
  262. package/dist/styles/components/plan.css +212 -0
  263. package/dist/styles/components/popover.css +186 -0
  264. package/dist/styles/components/progress.css +228 -0
  265. package/dist/styles/components/prompt-input.css +503 -0
  266. package/dist/styles/components/radio.css +281 -0
  267. package/dist/styles/components/rating.css +122 -0
  268. package/dist/styles/components/reasoning.css +214 -0
  269. package/dist/styles/components/response.css +303 -0
  270. package/dist/styles/components/scene-tile.css +295 -0
  271. package/dist/styles/components/scroll-view.css +195 -0
  272. package/dist/styles/components/search-field.css +128 -0
  273. package/dist/styles/components/secure-field.css +189 -0
  274. package/dist/styles/components/segmented-control.css +183 -0
  275. package/dist/styles/components/select.css +290 -0
  276. package/dist/styles/components/sensor-readout.css +231 -0
  277. package/dist/styles/components/separator.css +62 -0
  278. package/dist/styles/components/setup-code.css +138 -0
  279. package/dist/styles/components/sheet.css +345 -0
  280. package/dist/styles/components/shimmer.css +60 -0
  281. package/dist/styles/components/sidebar.css +261 -0
  282. package/dist/styles/components/slider.css +208 -0
  283. package/dist/styles/components/sources.css +349 -0
  284. package/dist/styles/components/split-view.css +75 -0
  285. package/dist/styles/components/squircle.css +44 -0
  286. package/dist/styles/components/stepper.css +278 -0
  287. package/dist/styles/components/suggestion.css +203 -0
  288. package/dist/styles/components/switch.css +115 -0
  289. package/dist/styles/components/tab-bar.css +223 -0
  290. package/dist/styles/components/table.css +313 -0
  291. package/dist/styles/components/tabs.css +262 -0
  292. package/dist/styles/components/text-area.css +94 -0
  293. package/dist/styles/components/text-field.css +294 -0
  294. package/dist/styles/components/thermostat-control.css +214 -0
  295. package/dist/styles/components/toast.css +418 -0
  296. package/dist/styles/components/toggle.css +312 -0
  297. package/dist/styles/components/token-field.css +193 -0
  298. package/dist/styles/components/tool-call.css +391 -0
  299. package/dist/styles/components/toolbar.css +370 -0
  300. package/dist/styles/components/tooltip.css +69 -0
  301. package/dist/styles/components/window.css +428 -0
  302. package/dist/styles/index.css +17 -0
  303. package/dist/styles/materials.css +263 -0
  304. package/dist/styles/platforms.css +214 -0
  305. package/dist/styles/themes/ember.css +24 -0
  306. package/dist/styles/themes/graphite.css +16 -0
  307. package/dist/styles/themes/nebula.css +16 -0
  308. package/dist/styles/themes/system.css +28 -0
  309. package/dist/styles/tokens.css +299 -0
  310. package/package.json +82 -3
@@ -0,0 +1,92 @@
1
+ /* Description list — label and value pairs, in a label column or stacked. */
2
+
3
+ :where(:root, [data-platform="macos"]) {
4
+ --mb-description-list-font: var(--mb-text-body);
5
+ --mb-description-list-font-sm: var(--mb-text-callout);
6
+ --mb-description-list-mono-font: 400 12px/16px var(--mb-font-mono);
7
+ --mb-description-list-mono-font-sm: 400 11px/15px var(--mb-font-mono);
8
+ --mb-description-list-row-gap: 6px;
9
+ --mb-description-list-row-gap-sm: 4px;
10
+ --mb-description-list-column-gap: 16px;
11
+ }
12
+
13
+ :where([data-platform="ios"], [data-platform="ipados"]) {
14
+ --mb-description-list-font: var(--mb-text-body);
15
+ --mb-description-list-font-sm: var(--mb-text-subheadline);
16
+ --mb-description-list-mono-font: 400 15px/22px var(--mb-font-mono);
17
+ --mb-description-list-mono-font-sm: 400 13px/20px var(--mb-font-mono);
18
+ --mb-description-list-row-gap: 10px;
19
+ --mb-description-list-row-gap-sm: 8px;
20
+ --mb-description-list-column-gap: 16px;
21
+ }
22
+
23
+ .mb-description-list {
24
+ /* The label column: as wide as the widest label, up to 40% of the list. Any track size works. */
25
+ --mb-description-list-term-width: fit-content(40%);
26
+ --mb-description-list-current-font: var(--mb-description-list-font);
27
+ --mb-description-list-current-mono: var(--mb-description-list-mono-font);
28
+ --mb-description-list-gap: var(--mb-description-list-row-gap);
29
+
30
+ display: grid;
31
+ grid-template-columns: var(--mb-description-list-term-width) minmax(0, 1fr);
32
+ column-gap: var(--mb-description-list-column-gap);
33
+ row-gap: var(--mb-description-list-gap);
34
+ min-width: 0;
35
+ margin: 0;
36
+ color: var(--mb-label);
37
+ font: var(--mb-description-list-current-font);
38
+ letter-spacing: var(--mb-tracking-body);
39
+ }
40
+
41
+ .mb-description-list[data-size="sm"] {
42
+ --mb-description-list-current-font: var(--mb-description-list-font-sm);
43
+ --mb-description-list-current-mono: var(--mb-description-list-mono-font-sm);
44
+ --mb-description-list-gap: var(--mb-description-list-row-gap-sm);
45
+ }
46
+
47
+ /* Each item spans both columns and shares them, so every label lines up with the others. */
48
+ .mb-description-item {
49
+ display: grid;
50
+ grid-column: 1 / -1;
51
+ grid-template-columns: subgrid;
52
+ align-items: baseline;
53
+ min-width: 0;
54
+ }
55
+
56
+ .mb-description-term {
57
+ grid-column: 1;
58
+ min-width: 0;
59
+ color: var(--mb-label-secondary);
60
+ overflow-wrap: break-word;
61
+ }
62
+
63
+ .mb-description-details {
64
+ grid-column: 2;
65
+ min-width: 0;
66
+ margin: 0;
67
+ color: var(--mb-label);
68
+ overflow-wrap: break-word;
69
+ }
70
+
71
+ .mb-description-details[data-mono] {
72
+ font: var(--mb-description-list-current-mono);
73
+ /* Ids and hashes have no break points of their own. */
74
+ overflow-wrap: anywhere;
75
+ }
76
+
77
+ /* Stacked: one column, each label above its value. */
78
+ .mb-description-list[data-layout="stacked"] {
79
+ grid-template-columns: minmax(0, 1fr);
80
+ row-gap: calc(var(--mb-description-list-gap) * 2);
81
+ }
82
+
83
+ .mb-description-list[data-layout="stacked"] .mb-description-item {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: var(--mb-space-1);
87
+ }
88
+
89
+ .mb-description-list[data-layout="stacked"] .mb-description-term {
90
+ font: var(--mb-text-subheadline);
91
+ font-weight: 500;
92
+ }
@@ -0,0 +1,202 @@
1
+ /* Device Frame — an iPhone or iPad to present iOS and iPadOS layouts in. */
2
+
3
+ /* An iPhone 16 (393 × 852 points, Dynamic Island) and an 11-inch iPad Air (1180 × 820). */
4
+ .mb-device-frame {
5
+ --mb-device-scale: 1;
6
+ --mb-device-screen-width: 393px;
7
+ --mb-device-screen-height: 852px;
8
+ --mb-device-screen-radius: 55px;
9
+ --mb-device-bezel: 11px;
10
+ --mb-device-safe-top: 59px;
11
+ --mb-device-safe-bottom: 34px;
12
+ --mb-device-status-bar-height: 54px;
13
+
14
+ position: relative;
15
+ display: inline-block;
16
+ flex: none;
17
+ zoom: var(--mb-device-scale);
18
+ padding: var(--mb-device-bezel);
19
+ border-radius: calc(var(--mb-device-screen-radius) + var(--mb-device-bezel));
20
+ background: rgb(0 0 0);
21
+ /* The titanium band, a catch of light on its edge, and the shadow it casts. */
22
+ box-shadow:
23
+ inset 0 0 0 1px rgb(255 255 255 / 0.1),
24
+ inset 0 0 0 3px rgb(0 0 0),
25
+ 0 0 0 1.5px light-dark(rgb(0 0 0 / 0.42), rgb(255 255 255 / 0.2)),
26
+ 0 0 0 3px light-dark(rgb(255 255 255 / 0.55), rgb(0 0 0 / 0.35)),
27
+ 0 0 0 3.5px light-dark(rgb(0 0 0 / 0.16), rgb(255 255 255 / 0.1)),
28
+ var(--mb-shadow-5);
29
+ }
30
+
31
+ .mb-device-frame[data-device="ipad"] {
32
+ --mb-device-screen-width: 1180px;
33
+ --mb-device-screen-height: 820px;
34
+ --mb-device-screen-radius: 18px;
35
+ --mb-device-bezel: 20px;
36
+ --mb-device-safe-top: 24px;
37
+ --mb-device-safe-bottom: 20px;
38
+ --mb-device-status-bar-height: 24px;
39
+ }
40
+
41
+ .mb-device-frame[data-device="ipad"][data-orientation="portrait"] {
42
+ --mb-device-screen-width: 820px;
43
+ --mb-device-screen-height: 1180px;
44
+ }
45
+
46
+ /* The screen publishes the hardware insets as the shared --mb-safe-* tokens, which replace
47
+ env(safe-area-inset-*) inside it. --mb-safe-area-top/-bottom are kept as aliases for older code. */
48
+ .mb-device-frame-screen {
49
+ --mb-safe-top: var(--mb-device-safe-top);
50
+ --mb-safe-bottom: var(--mb-device-safe-bottom);
51
+ --mb-safe-left: 0px;
52
+ --mb-safe-right: 0px;
53
+ --mb-safe-area-top: var(--mb-safe-top);
54
+ --mb-safe-area-bottom: var(--mb-safe-bottom);
55
+
56
+ position: relative;
57
+ isolation: isolate;
58
+ display: flex;
59
+ flex-direction: column;
60
+ width: var(--mb-device-screen-width);
61
+ height: var(--mb-device-screen-height);
62
+ overflow: hidden;
63
+ border-radius: var(--mb-device-screen-radius);
64
+ background: var(--mb-bg);
65
+ color: var(--mb-label);
66
+ /* Keeps the screen's corners clipped while children use backdrop filters. */
67
+ clip-path: inset(0 round var(--mb-device-screen-radius));
68
+ }
69
+
70
+ .mb-device-frame-screen > :not([aria-hidden="true"]) {
71
+ flex: 1 1 auto;
72
+ min-height: 0;
73
+ }
74
+
75
+ /* Status bar */
76
+ .mb-device-frame-status-bar {
77
+ position: absolute;
78
+ z-index: 100;
79
+ inset: 0 0 auto;
80
+ display: grid;
81
+ grid-template-columns: 1fr 126px 1fr;
82
+ align-items: center;
83
+ height: var(--mb-device-status-bar-height);
84
+ padding-inline: 16px;
85
+ padding-top: 6px;
86
+ color: var(--mb-label);
87
+ font: 600 17px/22px var(--mb-font);
88
+ letter-spacing: -0.02em;
89
+ pointer-events: none;
90
+ user-select: none;
91
+ -webkit-user-select: none;
92
+ }
93
+
94
+ .mb-device-frame-time {
95
+ justify-self: center;
96
+ padding-inline-start: 14px;
97
+ font-variant-numeric: tabular-nums;
98
+ }
99
+
100
+ .mb-device-frame-indicators {
101
+ grid-column: 3;
102
+ justify-self: center;
103
+ display: inline-flex;
104
+ align-items: center;
105
+ gap: 6px;
106
+ padding-inline-end: 8px;
107
+ }
108
+
109
+ .mb-device-frame-icon {
110
+ display: block;
111
+ height: 12px;
112
+ width: auto;
113
+ fill: currentColor;
114
+ }
115
+
116
+ .mb-device-frame-icon[data-icon="battery"] {
117
+ height: 13px;
118
+ }
119
+
120
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-status-bar {
121
+ display: flex;
122
+ gap: 8px;
123
+ padding-inline: 22px;
124
+ padding-top: 0;
125
+ font: 600 14px/18px var(--mb-font);
126
+ }
127
+
128
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-time {
129
+ padding: 0;
130
+ }
131
+
132
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-indicators {
133
+ margin-inline-start: auto;
134
+ padding: 0;
135
+ }
136
+
137
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-icon {
138
+ height: 10px;
139
+ }
140
+
141
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-icon[data-icon="battery"] {
142
+ height: 11px;
143
+ }
144
+
145
+ /* Dynamic Island */
146
+ .mb-device-frame-island {
147
+ position: absolute;
148
+ z-index: 101;
149
+ top: 11px;
150
+ left: 50%;
151
+ width: 126px;
152
+ height: 37px;
153
+ translate: -50% 0;
154
+ border-radius: var(--mb-radius-full);
155
+ background: rgb(0 0 0);
156
+ pointer-events: none;
157
+ }
158
+
159
+ /* Home indicator */
160
+ .mb-device-frame-home-indicator {
161
+ position: absolute;
162
+ z-index: 100;
163
+ bottom: 8px;
164
+ left: 50%;
165
+ width: 134px;
166
+ height: 5px;
167
+ translate: -50% 0;
168
+ border-radius: var(--mb-radius-full);
169
+ background: var(--mb-label);
170
+ pointer-events: none;
171
+ }
172
+
173
+ .mb-device-frame[data-device="ipad"] .mb-device-frame-home-indicator {
174
+ width: 200px;
175
+ bottom: 6px;
176
+ }
177
+
178
+ /*
179
+ * Continuous corners on the hardware and the screen, concentric through the
180
+ * bezel. The screen's clip follows the corner-shape through overflow, so the
181
+ * circular clip-path steps aside.
182
+ */
183
+ @supports (corner-shape: squircle) {
184
+ .mb-device-frame {
185
+ corner-shape: var(--mb-corner-shape);
186
+ border-radius: calc((var(--mb-device-screen-radius) + var(--mb-device-bezel)) * var(--mb-corner-factor));
187
+ }
188
+
189
+ .mb-device-frame-screen {
190
+ corner-shape: var(--mb-corner-shape);
191
+ border-radius: calc(var(--mb-device-screen-radius) * var(--mb-corner-factor));
192
+ clip-path: none;
193
+ }
194
+
195
+ /* A backdrop filter isn't clipped to the screen's corner shape, so a bar's material at the top of the
196
+ screen takes the same corners itself. */
197
+ .mb-device-frame-screen .mb-navigation-bar::before {
198
+ corner-shape: var(--mb-corner-shape);
199
+ border-start-start-radius: calc(var(--mb-device-screen-radius) * var(--mb-corner-factor));
200
+ border-start-end-radius: calc(var(--mb-device-screen-radius) * var(--mb-corner-factor));
201
+ }
202
+ }
@@ -0,0 +1,366 @@
1
+ /*
2
+ * Dialog — a modal task. macOS: a centered panel with buttons bottom-right.
3
+ * iPadOS: a form sheet. iOS: a page sheet from the bottom. On touch, the
4
+ * footer's cancel and primary buttons become the navigation bar's.
5
+ */
6
+
7
+ :where(:root, [data-platform="macos"]) {
8
+ --mb-dialog-width-sm: 360px;
9
+ --mb-dialog-width: 480px;
10
+ --mb-dialog-width-lg: 640px;
11
+ --mb-dialog-radius: var(--mb-popup-radius);
12
+ --mb-dialog-padding: 20px;
13
+ --mb-dialog-scrim: color-mix(in oklch, var(--mb-scrim) 55%, transparent);
14
+ }
15
+
16
+ :where([data-platform="ipados"]) {
17
+ --mb-dialog-width-sm: 420px;
18
+ --mb-dialog-width: 540px;
19
+ --mb-dialog-width-lg: 704px;
20
+ --mb-dialog-radius: var(--mb-sheet-radius);
21
+ --mb-dialog-padding: 20px;
22
+ --mb-dialog-height: min(620px, calc(100dvh - 80px));
23
+ }
24
+
25
+ :where([data-platform="ios"]) {
26
+ --mb-dialog-radius: var(--mb-sheet-radius);
27
+ --mb-dialog-padding: 16px;
28
+ /* A page sheet stops just under the status bar, leaving the page peeking above it. */
29
+ --mb-dialog-top-gap: calc(max(env(safe-area-inset-top), 20px) + 10px);
30
+ }
31
+
32
+ .mb-dialog-backdrop {
33
+ position: fixed;
34
+ inset: 0;
35
+ background: var(--mb-dialog-scrim, var(--mb-scrim));
36
+ transition: opacity var(--mb-duration-slow) var(--mb-ease-out);
37
+ }
38
+
39
+ .mb-dialog-backdrop:is([data-starting-style], [data-ending-style]) {
40
+ opacity: 0;
41
+ }
42
+
43
+ .mb-dialog-backdrop[data-ending-style] {
44
+ transition-duration: var(--mb-duration-base);
45
+ }
46
+
47
+ .mb-dialog {
48
+ --mb-dialog-w: var(--mb-dialog-width);
49
+
50
+ position: fixed;
51
+ inset: 0;
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: min(var(--mb-dialog-w), calc(100vw - 32px));
55
+ height: fit-content;
56
+ max-width: none;
57
+ max-height: calc(100dvh - 48px);
58
+ margin: auto;
59
+ padding: 0;
60
+ overflow: hidden;
61
+ border: 0;
62
+ border-radius: var(--mb-dialog-radius);
63
+ background: var(--mb-material-thick);
64
+ -webkit-backdrop-filter: var(--mb-material-filter);
65
+ backdrop-filter: var(--mb-material-filter);
66
+ box-shadow: var(--mb-glass-rim), var(--mb-shadow-window);
67
+ color: var(--mb-label);
68
+ font: var(--mb-text-body);
69
+ letter-spacing: var(--mb-tracking-body);
70
+ outline: none;
71
+ transition:
72
+ opacity var(--mb-duration-base) var(--mb-ease-out),
73
+ scale var(--mb-spring-smooth-duration) var(--mb-spring-smooth),
74
+ translate var(--mb-spring-smooth-duration) var(--mb-spring-smooth);
75
+ }
76
+
77
+ .mb-dialog[data-size="sm"] {
78
+ --mb-dialog-w: var(--mb-dialog-width-sm);
79
+ }
80
+
81
+ .mb-dialog[data-size="lg"] {
82
+ --mb-dialog-w: var(--mb-dialog-width-lg);
83
+ }
84
+
85
+ .mb-dialog:is([data-starting-style], [data-ending-style]) {
86
+ opacity: 0;
87
+ scale: 0.96;
88
+ translate: 0 -8px;
89
+ }
90
+
91
+ .mb-dialog[data-ending-style] {
92
+ transition-duration: var(--mb-duration-fast);
93
+ transition-timing-function: var(--mb-ease-out);
94
+ }
95
+
96
+ .mb-dialog-header {
97
+ display: flex;
98
+ flex-direction: column;
99
+ gap: 4px;
100
+ padding: var(--mb-dialog-padding) var(--mb-dialog-padding) 0;
101
+ }
102
+
103
+ .mb-dialog-title {
104
+ margin: 0;
105
+ font: var(--mb-text-headline);
106
+ letter-spacing: var(--mb-tracking-body);
107
+ }
108
+
109
+ .mb-dialog-description {
110
+ margin: 0;
111
+ color: var(--mb-label-secondary);
112
+ font: var(--mb-text-callout);
113
+ letter-spacing: var(--mb-tracking-body);
114
+ }
115
+
116
+ .mb-dialog-body {
117
+ flex: 1 1 auto;
118
+ min-height: 0;
119
+ padding: 16px var(--mb-dialog-padding);
120
+ overflow-y: auto;
121
+ overscroll-behavior: contain;
122
+ }
123
+
124
+ .mb-dialog-footer {
125
+ display: flex;
126
+ flex-wrap: wrap;
127
+ justify-content: flex-end;
128
+ gap: 8px;
129
+ padding: 0 var(--mb-dialog-padding) var(--mb-dialog-padding);
130
+ }
131
+
132
+ .mb-dialog-close {
133
+ --mb-dialog-close-bg: var(--mb-bg-control);
134
+ --mb-dialog-close-fg: var(--mb-label);
135
+
136
+ position: relative;
137
+ display: inline-flex;
138
+ align-items: center;
139
+ justify-content: center;
140
+ min-width: 72px;
141
+ height: var(--mb-control-height);
142
+ margin: 0;
143
+ padding: 0 var(--mb-control-padding);
144
+ border: 0;
145
+ border-radius: var(--mb-control-radius);
146
+ background: var(--mb-dialog-close-bg);
147
+ color: var(--mb-dialog-close-fg);
148
+ font: var(--mb-control-font);
149
+ letter-spacing: var(--mb-tracking-body);
150
+ white-space: nowrap;
151
+ cursor: default;
152
+ user-select: none;
153
+ -webkit-user-select: none;
154
+ touch-action: manipulation;
155
+ box-shadow:
156
+ 0 0 0 var(--mb-hairline) var(--mb-control-border),
157
+ 0 0.5px 1.5px var(--mb-shadow-color);
158
+ transition:
159
+ background-color var(--mb-duration-fast) var(--mb-ease-out),
160
+ opacity var(--mb-duration-fast) var(--mb-ease-out);
161
+ }
162
+
163
+ /* Footer buttons that are smaller than a fingertip still take one. */
164
+ .mb-dialog-close::after {
165
+ content: "";
166
+ position: absolute;
167
+ inset: 50% auto auto 50%;
168
+ width: max(100%, var(--mb-hit-target));
169
+ height: max(100%, var(--mb-hit-target));
170
+ translate: -50% -50%;
171
+ }
172
+
173
+ .mb-dialog-close[data-tone="destructive"] {
174
+ --mb-dialog-close-fg: var(--mb-destructive-text);
175
+ }
176
+
177
+ .mb-dialog-close[data-variant="primary"] {
178
+ --mb-dialog-close-bg: var(--mb-accent);
179
+ --mb-dialog-close-fg: var(--mb-on-accent);
180
+ font-weight: 600;
181
+ box-shadow:
182
+ inset 0 0.5px 0 rgb(255 255 255 / 0.28),
183
+ 0 0.5px 1.5px var(--mb-shadow-color);
184
+ }
185
+
186
+ .mb-dialog-close[data-variant="primary"][data-tone="destructive"] {
187
+ --mb-dialog-close-bg: var(--mb-destructive);
188
+ --mb-dialog-close-fg: var(--mb-on-destructive);
189
+ }
190
+
191
+ @media (hover: hover) and (pointer: fine) {
192
+ .mb-dialog-close:hover {
193
+ --mb-dialog-close-bg: color-mix(in oklch, var(--mb-bg-control), var(--mb-ink) 5%);
194
+ }
195
+
196
+ .mb-dialog-close[data-variant="primary"]:hover {
197
+ --mb-dialog-close-bg: var(--mb-accent-hover);
198
+ }
199
+ }
200
+
201
+ .mb-dialog-close:active {
202
+ --mb-dialog-close-bg: color-mix(in oklch, var(--mb-bg-control), var(--mb-ink) 12%);
203
+ transition-duration: 0ms;
204
+ }
205
+
206
+ .mb-dialog-close[data-variant="primary"]:active {
207
+ --mb-dialog-close-bg: var(--mb-accent-pressed);
208
+ }
209
+
210
+ .mb-dialog-close[data-pending] {
211
+ opacity: 0.6;
212
+ cursor: progress;
213
+ }
214
+
215
+ /* Touch: a navigation bar of Cancel, title and Done above the content. */
216
+ @scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
217
+ .mb-dialog {
218
+ display: grid;
219
+ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
220
+ grid-template-rows: 56px auto minmax(0, 1fr);
221
+ grid-template-areas:
222
+ "leading title trailing"
223
+ "description description description"
224
+ "body body body";
225
+ height: var(--mb-dialog-height, fit-content);
226
+ /* Form and page sheets are opaque on iOS and iPadOS; a form shouldn't sit on a blur of the page. */
227
+ background: var(--mb-bg-elevated);
228
+ -webkit-backdrop-filter: none;
229
+ backdrop-filter: none;
230
+ }
231
+
232
+ .mb-dialog::before {
233
+ content: "";
234
+ grid-row: 1;
235
+ grid-column: 1 / -1;
236
+ border-block-end: var(--mb-hairline) solid var(--mb-separator);
237
+ pointer-events: none;
238
+ }
239
+
240
+ .mb-dialog-header,
241
+ .mb-dialog-footer {
242
+ display: contents;
243
+ }
244
+
245
+ .mb-dialog-title {
246
+ grid-area: title;
247
+ align-self: center;
248
+ max-width: 100%;
249
+ overflow: hidden;
250
+ text-overflow: ellipsis;
251
+ white-space: nowrap;
252
+ font: var(--mb-text-headline);
253
+ text-align: center;
254
+ }
255
+
256
+ .mb-dialog-description {
257
+ grid-area: description;
258
+ padding: 12px var(--mb-dialog-padding) 0;
259
+ font: var(--mb-text-footnote);
260
+ }
261
+
262
+ .mb-dialog-body {
263
+ grid-area: body;
264
+ padding: 16px var(--mb-dialog-padding) calc(var(--mb-dialog-padding) + env(safe-area-inset-bottom));
265
+ }
266
+
267
+ .mb-dialog-footer > .mb-dialog-close {
268
+ --mb-dialog-close-bg: transparent;
269
+ --mb-dialog-close-fg: var(--mb-accent-text);
270
+
271
+ grid-column: 1 / -1;
272
+ align-self: center;
273
+ min-width: 0;
274
+ height: 44px;
275
+ margin: 0 var(--mb-dialog-padding) var(--mb-dialog-padding);
276
+ padding: 0 8px;
277
+ box-shadow: none;
278
+ font: 400 17px/22px var(--mb-font);
279
+ letter-spacing: var(--mb-tracking-body);
280
+ }
281
+
282
+ .mb-dialog-footer > .mb-dialog-close[data-variant="cancel"] {
283
+ grid-area: leading;
284
+ justify-self: start;
285
+ margin: 0 0 0 calc(var(--mb-dialog-padding) - 8px);
286
+ }
287
+
288
+ .mb-dialog-footer > .mb-dialog-close[data-variant="primary"] {
289
+ grid-area: trailing;
290
+ justify-self: end;
291
+ margin: 0 calc(var(--mb-dialog-padding) - 8px) 0 0;
292
+ font-weight: 600;
293
+ }
294
+
295
+ .mb-dialog-footer > .mb-dialog-close[data-tone="destructive"] {
296
+ --mb-dialog-close-fg: var(--mb-destructive-text);
297
+ }
298
+
299
+ /* An iPad with a pointer has hover; keep the bar buttons plain text. */
300
+ @media (hover: hover) and (pointer: fine) {
301
+ .mb-dialog-footer > .mb-dialog-close:hover,
302
+ .mb-dialog-footer > .mb-dialog-close[data-variant="primary"]:hover {
303
+ --mb-dialog-close-bg: var(--mb-fill-tertiary);
304
+ }
305
+ }
306
+
307
+ .mb-dialog-footer > .mb-dialog-close:active,
308
+ .mb-dialog-footer > .mb-dialog-close[data-variant="primary"]:active {
309
+ --mb-dialog-close-bg: transparent;
310
+ opacity: 0.45;
311
+ }
312
+ }
313
+
314
+ /* iPhone: a page sheet that rises from the bottom edge. */
315
+ @scope ([data-platform="ios"]) to (:scope [data-platform]) {
316
+ .mb-dialog {
317
+ inset: var(--mb-dialog-top-gap) 0 0 0;
318
+ width: min(100vw, 440px);
319
+ height: auto;
320
+ max-height: none;
321
+ margin: 0 auto;
322
+ border-end-start-radius: 0;
323
+ border-end-end-radius: 0;
324
+ transition:
325
+ translate var(--mb-spring-sheet-duration) var(--mb-spring-sheet),
326
+ opacity var(--mb-duration-fast) var(--mb-ease-out);
327
+ }
328
+
329
+ .mb-dialog:is([data-starting-style], [data-ending-style]) {
330
+ opacity: 1;
331
+ scale: none;
332
+ translate: 0 100%;
333
+ }
334
+
335
+ .mb-dialog[data-ending-style] {
336
+ transition-duration: var(--mb-duration-slow);
337
+ transition-timing-function: var(--mb-ease-ios);
338
+ }
339
+
340
+ /* ui-sdk moves a real sheet itself; only its shape is ours. */
341
+ .mb-dialog[data-presentation="sheet"] {
342
+ inset: auto;
343
+ width: 100%;
344
+ height: calc(100dvh - var(--mb-dialog-top-gap));
345
+ translate: none;
346
+ transition: none;
347
+ }
348
+ }
349
+
350
+ @media (prefers-reduced-motion: reduce) {
351
+ :where(:root:not([data-motion="full"])) {
352
+ .mb-dialog:is([data-starting-style], [data-ending-style]) {
353
+ scale: none;
354
+ translate: none;
355
+ opacity: 0;
356
+ }
357
+ }
358
+ }
359
+
360
+ /* Continuous corners. The iOS page sheet's square bottom edge still wins: it's scoped closer. */
361
+ @supports (corner-shape: squircle) {
362
+ .mb-dialog {
363
+ corner-shape: var(--mb-corner-shape);
364
+ border-radius: calc(var(--mb-dialog-radius) * var(--mb-corner-factor));
365
+ }
366
+ }