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,163 @@
1
+ /* Code Field — the verification-code look: separate rounded cells, the active one ringed in the accent, a blinking caret. */
2
+
3
+ :where(:root, [data-platform="macos"]) {
4
+ --mb-code-field-cell-width: 34px;
5
+ --mb-code-field-cell-ratio: 34 / 42;
6
+ --mb-code-field-cell-radius: var(--mb-radius-md);
7
+ --mb-code-field-cell-gap: 6px;
8
+ --mb-code-field-run-gap: 10px;
9
+ --mb-code-field-font: 500 22px/1 var(--mb-font);
10
+ --mb-code-field-cell-bg: var(--mb-bg-field);
11
+ --mb-code-field-cell-edge: inset 0 0 0 var(--mb-hairline) var(--mb-control-border),
12
+ inset 0 0.5px 1px light-dark(rgb(0 0 0 / 0.07), rgb(0 0 0 / 0.2));
13
+ --mb-code-field-active-width: 1.5px;
14
+ --mb-code-field-halo: var(--mb-focus-ring-width);
15
+ }
16
+
17
+ :where([data-platform="ios"], [data-platform="ipados"]) {
18
+ --mb-code-field-cell-width: 46px;
19
+ --mb-code-field-cell-ratio: 46 / 58;
20
+ --mb-code-field-cell-radius: var(--mb-radius-lg);
21
+ --mb-code-field-cell-gap: 8px;
22
+ --mb-code-field-run-gap: 12px;
23
+ --mb-code-field-font: 600 28px/1 var(--mb-font);
24
+ --mb-code-field-cell-bg: var(--mb-fill-tertiary);
25
+ --mb-code-field-cell-edge: inset 0 0 0 0 transparent;
26
+ --mb-code-field-active-width: 2px;
27
+ --mb-code-field-halo: 0px;
28
+ }
29
+
30
+ .mb-code-field {
31
+ --mb-code-field-w: var(--mb-code-field-cell-width);
32
+
33
+ display: inline-flex;
34
+ align-items: center;
35
+ gap: var(--mb-code-field-run-gap);
36
+ max-width: 100%;
37
+ color: var(--mb-label);
38
+ font: var(--mb-code-field-font);
39
+ font-variant-numeric: tabular-nums;
40
+ cursor: text;
41
+ }
42
+
43
+ .mb-code-field[data-size="lg"] {
44
+ --mb-code-field-w: calc(var(--mb-code-field-cell-width) * 1.2);
45
+ font-size: calc(var(--mb-code-field-w) * 0.76);
46
+ }
47
+
48
+ .mb-code-field-group {
49
+ display: flex;
50
+ flex: 0 1 auto;
51
+ align-items: center;
52
+ gap: var(--mb-code-field-cell-gap);
53
+ min-width: 0;
54
+ }
55
+
56
+ .mb-code-field-slot {
57
+ --mb-code-field-edge: var(--mb-code-field-cell-edge);
58
+
59
+ position: relative;
60
+ display: grid;
61
+ place-items: center;
62
+ box-sizing: border-box;
63
+ /* Cells keep their shape and narrow together when the row is wider than its container, as on a phone. */
64
+ flex: 0 1 auto;
65
+ width: var(--mb-code-field-w);
66
+ min-width: 0;
67
+ aspect-ratio: var(--mb-code-field-cell-ratio);
68
+ border-radius: var(--mb-code-field-cell-radius);
69
+ background: var(--mb-code-field-cell-bg);
70
+ box-shadow: var(--mb-code-field-edge);
71
+ text-transform: uppercase;
72
+ outline: var(--mb-code-field-halo) solid transparent;
73
+ outline-offset: 0;
74
+ transition:
75
+ box-shadow var(--mb-duration-fast) var(--mb-ease-out),
76
+ outline-color var(--mb-duration-fast) var(--mb-ease-out),
77
+ background-color var(--mb-duration-fast) var(--mb-ease-out);
78
+ }
79
+
80
+ .mb-code-field-slot[data-active] {
81
+ --mb-code-field-edge: inset 0 0 0 var(--mb-code-field-active-width) var(--mb-accent);
82
+ outline-color: var(--mb-focus-ring);
83
+ }
84
+
85
+ /* The real caret is hidden; this one blinks the way the system's does. */
86
+ .mb-code-field-slot[data-fake-caret]::after {
87
+ content: "";
88
+ width: 2px;
89
+ height: 1.05em;
90
+ border-radius: 1px;
91
+ background: var(--mb-accent);
92
+ animation: mb-code-field-caret 1.06s var(--mb-ease-in-out) infinite;
93
+ }
94
+
95
+ @keyframes mb-code-field-caret {
96
+ 0%,
97
+ 30%,
98
+ 100% {
99
+ opacity: 1;
100
+ }
101
+ 50%,
102
+ 80% {
103
+ opacity: 0;
104
+ }
105
+ }
106
+
107
+ .mb-code-field-slot[data-filled] {
108
+ animation: mb-code-field-enter var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
109
+ }
110
+
111
+ @keyframes mb-code-field-enter {
112
+ from {
113
+ scale: 0.82;
114
+ }
115
+ }
116
+
117
+ .mb-code-field:has([aria-invalid="true"]) .mb-code-field-slot {
118
+ --mb-code-field-edge: inset 0 0 0 var(--mb-code-field-active-width) var(--mb-destructive);
119
+ color: var(--mb-destructive-text);
120
+ }
121
+
122
+ .mb-code-field:has([aria-invalid="true"]) .mb-code-field-slot[data-active] {
123
+ outline-color: color-mix(in oklch, var(--mb-destructive) 80%, transparent);
124
+ }
125
+
126
+ .mb-code-field[data-disabled] {
127
+ opacity: 0.45;
128
+ cursor: default;
129
+ }
130
+
131
+ .mb-code-field-separator {
132
+ display: flex;
133
+ flex: none;
134
+ align-items: center;
135
+ color: var(--mb-label-tertiary);
136
+ }
137
+
138
+ .mb-code-field-dash {
139
+ display: block;
140
+ width: 10px;
141
+ height: 2px;
142
+ border-radius: 1px;
143
+ background: currentColor;
144
+ }
145
+
146
+ /* A label over code cells lines up with the first cell, not with text inside a field. */
147
+ .mb-field:has(> .mb-code-field) > :is(.mb-field-label, .mb-field-description, .mb-field-error) {
148
+ padding-inline: 0;
149
+ }
150
+
151
+ @media (prefers-contrast: more) {
152
+ :where([data-platform="ios"], [data-platform="ipados"]) {
153
+ --mb-code-field-cell-edge: inset 0 0 0 1px var(--mb-control-border);
154
+ }
155
+ }
156
+
157
+ /* Continuous corners on each cell. */
158
+ @supports (corner-shape: squircle) {
159
+ .mb-code-field-slot {
160
+ corner-shape: var(--mb-corner-shape);
161
+ border-radius: calc(var(--mb-code-field-cell-radius) * var(--mb-corner-factor));
162
+ }
163
+ }
@@ -0,0 +1,452 @@
1
+ /* Color Well — a swatch button that opens a color editor. macOS draws a bezeled well around the swatch;
2
+ iPadOS and iOS draw UIColorWell's circle inside a spectrum ring. The editor floats on a translucent popover. */
3
+
4
+ :where(:root, [data-platform="macos"]) {
5
+ --mb-color-well-width: 44px;
6
+ --mb-color-well-height: var(--mb-control-height-sm);
7
+ --mb-color-well-panel-width: 240px;
8
+ }
9
+
10
+ :where([data-platform="ios"], [data-platform="ipados"]) {
11
+ --mb-color-well-width: 30px;
12
+ --mb-color-well-height: 30px;
13
+ --mb-color-well-panel-width: 300px;
14
+ }
15
+
16
+ .mb-color-well {
17
+ --mb-color-well-checker: repeating-conic-gradient(rgb(0 0 0 / 0.14) 0 25%, #ffffff 0 50%) 0 0 / 8px 8px;
18
+ --mb-color-well-edge: light-dark(rgb(0 0 0 / 0.18), rgb(255 255 255 / 0.24));
19
+ --mb-color-well-w: var(--mb-color-well-width);
20
+ --mb-color-well-h: var(--mb-color-well-height);
21
+
22
+ display: inline-flex;
23
+ flex: none;
24
+ }
25
+
26
+ .mb-color-well[data-size="sm"] {
27
+ --mb-color-well-w: calc(var(--mb-color-well-width) * 0.8);
28
+ --mb-color-well-h: calc(var(--mb-color-well-height) * 0.8);
29
+ }
30
+
31
+ .mb-color-well[data-size="lg"] {
32
+ --mb-color-well-w: calc(var(--mb-color-well-width) * 1.3);
33
+ --mb-color-well-h: var(--mb-control-height);
34
+ }
35
+
36
+ /* The well. */
37
+ .mb-color-well-trigger {
38
+ position: relative;
39
+ display: inline-flex;
40
+ flex: none;
41
+ width: var(--mb-color-well-w);
42
+ height: var(--mb-color-well-h);
43
+ margin: 0;
44
+ padding: 3px;
45
+ border: 0;
46
+ border-radius: var(--mb-control-radius-sm);
47
+ background: var(--mb-bg-control);
48
+ box-shadow:
49
+ 0 0 0 var(--mb-hairline) var(--mb-control-border),
50
+ 0 0.5px 1.5px var(--mb-shadow-color);
51
+ cursor: default;
52
+ touch-action: manipulation;
53
+ -webkit-tap-highlight-color: transparent;
54
+ transition:
55
+ background-color var(--mb-duration-fast) var(--mb-ease-out),
56
+ scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
57
+ }
58
+
59
+ .mb-color-well-trigger::after {
60
+ content: "";
61
+ position: absolute;
62
+ inset: 50% auto auto 50%;
63
+ width: max(100%, var(--mb-hit-target));
64
+ height: max(100%, var(--mb-hit-target));
65
+ translate: -50% -50%;
66
+ }
67
+
68
+ .mb-color-well-trigger:active,
69
+ .mb-color-well-trigger[data-open] {
70
+ background: color-mix(in oklch, var(--mb-bg-control), var(--mb-ink) 14%);
71
+ }
72
+
73
+ .mb-color-well-swatch {
74
+ flex: 1;
75
+ border-radius: calc(var(--mb-control-radius-sm) - 3px);
76
+ background:
77
+ linear-gradient(var(--color-picker-color), var(--color-picker-color)),
78
+ var(--mb-color-well-checker);
79
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-color-well-edge);
80
+ }
81
+
82
+ .mb-color-well[data-disabled] .mb-color-well-trigger {
83
+ opacity: 0.4;
84
+ pointer-events: none;
85
+ }
86
+
87
+ /* The editor. */
88
+ .mb-color-well-panel {
89
+ display: flex;
90
+ flex-direction: column;
91
+ gap: var(--mb-space-5);
92
+ width: var(--mb-color-well-panel-width);
93
+ max-width: calc(100vw - 16px);
94
+ margin: 0;
95
+ padding: var(--mb-space-5);
96
+ border: 0;
97
+ border-radius: var(--mb-popup-radius);
98
+ background: var(--mb-material-regular);
99
+ -webkit-backdrop-filter: var(--mb-material-filter);
100
+ backdrop-filter: var(--mb-material-filter);
101
+ box-shadow: var(--mb-glass-rim), var(--mb-shadow-menu);
102
+ color: var(--mb-label);
103
+ font: var(--mb-text-body);
104
+ letter-spacing: var(--mb-tracking-body);
105
+ transform-origin: var(--transform-origin);
106
+ transition:
107
+ opacity var(--mb-duration-fast) var(--mb-ease-out),
108
+ scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
109
+ }
110
+
111
+ .mb-color-well-panel[data-starting-style] {
112
+ opacity: 0;
113
+ scale: 0.94;
114
+ }
115
+
116
+ .mb-color-well-panel[data-ending-style] {
117
+ opacity: 0;
118
+ scale: 0.97;
119
+ transition-duration: var(--mb-duration-fast), var(--mb-duration-fast);
120
+ transition-timing-function: var(--mb-ease-out);
121
+ }
122
+
123
+ .mb-color-well-area {
124
+ position: relative;
125
+ height: 150px;
126
+ border-radius: var(--mb-radius-md);
127
+ background: var(--color-area-background, var(--mb-color-well-checker));
128
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-color-well-edge);
129
+ touch-action: none;
130
+ }
131
+
132
+ .mb-color-well-sliders {
133
+ display: flex;
134
+ flex-direction: column;
135
+ gap: var(--mb-space-4);
136
+ }
137
+
138
+ .mb-color-well-slider {
139
+ position: relative;
140
+ height: 12px;
141
+ border-radius: var(--mb-radius-full);
142
+ background: var(--color-slider-background);
143
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-color-well-edge);
144
+ touch-action: none;
145
+ }
146
+
147
+ /* Hue reads as the full spectrum, as in AppKit's color panel, not at the color's own brightness. */
148
+ .mb-color-well-slider[data-channel="hue"] {
149
+ background: linear-gradient(to right in hsl longer hue, hsl(0 100% 50%), hsl(0 100% 50%));
150
+ }
151
+
152
+ :where([dir="rtl"]) .mb-color-well-slider[data-channel="hue"] {
153
+ background: linear-gradient(to left in hsl longer hue, hsl(0 100% 50%), hsl(0 100% 50%));
154
+ }
155
+
156
+ .mb-color-well-slider[data-channel="alpha"] {
157
+ background: var(--color-slider-background), var(--mb-color-well-checker);
158
+ }
159
+
160
+ .mb-color-well-thumb {
161
+ width: 18px;
162
+ height: 18px;
163
+ border: 3px solid #ffffff;
164
+ border-radius: var(--mb-radius-full);
165
+ background: var(--color-picker-color);
166
+ box-shadow:
167
+ 0 0 0 var(--mb-hairline) rgb(0 0 0 / 0.2),
168
+ 0 1px 4px rgb(0 0 0 / 0.3);
169
+ translate: -50% -50%;
170
+ transition: scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
171
+ }
172
+
173
+ :where([dir="rtl"]) .mb-color-well-thumb {
174
+ translate: 50% -50%;
175
+ }
176
+
177
+ /* A slider's thumb stays inside the track at both ends, so its center travels the inner width. */
178
+ .mb-color-well-slider .mb-color-well-thumb {
179
+ top: 50%;
180
+ translate: calc(var(--color-slider-thumb-position) * -1) -50%;
181
+ }
182
+
183
+ :where([dir="rtl"]) .mb-color-well-slider .mb-color-well-thumb {
184
+ translate: var(--color-slider-thumb-position) -50%;
185
+ }
186
+
187
+ .mb-color-well-thumb:active {
188
+ scale: 1.12;
189
+ }
190
+
191
+ .mb-color-well-thumb:focus-visible {
192
+ outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
193
+ outline-offset: 1px;
194
+ }
195
+
196
+ .mb-color-well-thumb[data-out-of-gamut] {
197
+ border-style: dashed;
198
+ }
199
+
200
+ .mb-color-well-fields {
201
+ display: flex;
202
+ align-items: center;
203
+ gap: var(--mb-space-4);
204
+ }
205
+
206
+ .mb-color-well-preview {
207
+ flex: none;
208
+ width: 28px;
209
+ height: var(--mb-control-height-sm);
210
+ border-radius: var(--mb-radius-xs);
211
+ background:
212
+ linear-gradient(var(--color-picker-color), var(--color-picker-color)),
213
+ var(--mb-color-well-checker);
214
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-color-well-edge);
215
+ }
216
+
217
+ .mb-color-well-input {
218
+ flex: 1;
219
+ min-width: 0;
220
+ height: var(--mb-control-height-sm);
221
+ margin: 0;
222
+ padding: 0 var(--mb-space-4);
223
+ border: 0;
224
+ border-radius: var(--mb-control-radius-sm);
225
+ background: var(--mb-bg-field);
226
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-control-border);
227
+ color: var(--mb-label);
228
+ font: var(--mb-text-body);
229
+ font-family: var(--mb-font-mono);
230
+ letter-spacing: 0;
231
+ text-transform: uppercase;
232
+ /* A hex code reads left to right in every locale; without this RTL shows "EE5700#". */
233
+ direction: ltr;
234
+ outline: none;
235
+ }
236
+
237
+ .mb-color-well-input:focus {
238
+ outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
239
+ outline-offset: 0;
240
+ }
241
+
242
+ .mb-color-well-eyedropper {
243
+ position: relative;
244
+ display: inline-flex;
245
+ flex: none;
246
+ align-items: center;
247
+ justify-content: center;
248
+ width: var(--mb-control-height-sm);
249
+ height: var(--mb-control-height-sm);
250
+ margin: 0;
251
+ padding: 0;
252
+ border: 0;
253
+ border-radius: var(--mb-control-radius-sm);
254
+ background: transparent;
255
+ color: var(--mb-label-secondary);
256
+ cursor: default;
257
+ }
258
+
259
+ .mb-color-well-eyedropper svg {
260
+ width: var(--mb-icon-size);
261
+ height: var(--mb-icon-size);
262
+ fill: none;
263
+ stroke: currentColor;
264
+ stroke-width: 1.75;
265
+ stroke-linecap: round;
266
+ stroke-linejoin: round;
267
+ }
268
+
269
+ .mb-color-well-eyedropper[data-unsupported] {
270
+ display: none;
271
+ }
272
+
273
+ .mb-color-well-eyedropper:active {
274
+ background: var(--mb-fill-secondary);
275
+ }
276
+
277
+ @media (hover: hover) and (pointer: fine) {
278
+ .mb-color-well-trigger:hover:not([data-open]) {
279
+ background: color-mix(in oklch, var(--mb-bg-control), var(--mb-ink) 5%);
280
+ }
281
+
282
+ .mb-color-well-eyedropper:hover {
283
+ background: var(--mb-fill-tertiary);
284
+ color: var(--mb-label);
285
+ }
286
+ }
287
+
288
+ .mb-color-well-presets {
289
+ --mb-color-well-preset: 24px;
290
+ display: grid;
291
+ grid-template-columns: repeat(6, var(--mb-color-well-preset));
292
+ justify-content: space-between;
293
+ row-gap: var(--mb-space-4);
294
+ }
295
+
296
+ .mb-color-well-preset {
297
+ position: relative;
298
+ aspect-ratio: 1;
299
+ margin: 0;
300
+ padding: 0;
301
+ border: 0;
302
+ border-radius: var(--mb-radius-full);
303
+ background:
304
+ linear-gradient(var(--color-picker-color), var(--color-picker-color)),
305
+ var(--mb-color-well-checker);
306
+ box-shadow: inset 0 0 0 var(--mb-hairline) var(--mb-color-well-edge);
307
+ cursor: default;
308
+ transition: scale var(--mb-spring-snappy-duration) var(--mb-spring-snappy);
309
+ }
310
+
311
+ .mb-color-well-preset[data-selected] {
312
+ outline: 2px solid var(--mb-label);
313
+ outline-offset: 2px;
314
+ }
315
+
316
+ .mb-color-well-preset:focus-visible {
317
+ outline: var(--mb-focus-ring-width) solid var(--mb-focus-ring);
318
+ outline-offset: 2px;
319
+ }
320
+
321
+ .mb-color-well-preset:active {
322
+ scale: 0.9;
323
+ }
324
+
325
+ @scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
326
+ /* UIColorWell: the color in a circle, inside a ring of the spectrum. */
327
+ .mb-color-well-trigger {
328
+ --mb-color-well-spectrum: conic-gradient(
329
+ var(--mb-red),
330
+ var(--mb-yellow),
331
+ var(--mb-green),
332
+ var(--mb-teal),
333
+ var(--mb-blue),
334
+ var(--mb-purple),
335
+ var(--mb-pink),
336
+ var(--mb-red)
337
+ );
338
+ padding: 4px;
339
+ border-radius: var(--mb-radius-full);
340
+ background:
341
+ radial-gradient(closest-side, var(--mb-bg) calc(100% - 3px), transparent calc(100% - 2.5px)),
342
+ var(--mb-color-well-spectrum);
343
+ box-shadow: none;
344
+ }
345
+
346
+ .mb-color-well-trigger:active,
347
+ .mb-color-well-trigger[data-open] {
348
+ background:
349
+ radial-gradient(closest-side, var(--mb-bg) calc(100% - 3px), transparent calc(100% - 2.5px)),
350
+ var(--mb-color-well-spectrum);
351
+ scale: 0.92;
352
+ }
353
+
354
+ .mb-color-well-swatch {
355
+ border-radius: var(--mb-radius-full);
356
+ }
357
+
358
+ .mb-color-well-panel {
359
+ gap: var(--mb-space-6);
360
+ padding: var(--mb-space-6);
361
+ }
362
+
363
+ .mb-color-well-panel[data-presentation="sheet"] {
364
+ width: auto;
365
+ max-width: none;
366
+ padding-block-end: max(var(--mb-space-8), env(safe-area-inset-bottom));
367
+ border-radius: var(--mb-sheet-radius) var(--mb-sheet-radius) 0 0;
368
+ background: var(--mb-material-thick);
369
+ }
370
+
371
+ .mb-color-well-area {
372
+ height: 180px;
373
+ border-radius: var(--mb-radius-lg);
374
+ }
375
+
376
+ .mb-color-well-slider {
377
+ height: 28px;
378
+ }
379
+
380
+ .mb-color-well-thumb {
381
+ width: 28px;
382
+ height: 28px;
383
+ border-width: 4px;
384
+ }
385
+
386
+ .mb-color-well-preview,
387
+ .mb-color-well-input,
388
+ .mb-color-well-eyedropper {
389
+ height: 36px;
390
+ }
391
+
392
+ .mb-color-well-preview {
393
+ width: 36px;
394
+ border-radius: var(--mb-radius-sm);
395
+ }
396
+
397
+ .mb-color-well-input {
398
+ border-radius: var(--mb-radius-md);
399
+ background: var(--mb-fill-tertiary);
400
+ box-shadow: none;
401
+ }
402
+
403
+ .mb-color-well-eyedropper {
404
+ width: 36px;
405
+ color: var(--mb-accent-text);
406
+ }
407
+
408
+ .mb-color-well-presets {
409
+ --mb-color-well-preset: 34px;
410
+ row-gap: var(--mb-space-5);
411
+ }
412
+
413
+ /* The sheet's grabber. */
414
+ .mb-color-well-panel[data-presentation="sheet"]::before {
415
+ content: "";
416
+ align-self: center;
417
+ width: 36px;
418
+ height: 5px;
419
+ margin-block: calc(var(--mb-space-3) * -1) var(--mb-space-1);
420
+ border-radius: var(--mb-radius-full);
421
+ background: var(--mb-label-quaternary);
422
+ }
423
+ }
424
+
425
+ @media (prefers-reduced-motion: reduce) {
426
+ :where(:root:not([data-motion="full"])) {
427
+ .mb-color-well-panel[data-starting-style],
428
+ .mb-color-well-panel[data-ending-style] {
429
+ scale: 1 !important;
430
+ }
431
+
432
+ .mb-color-well-trigger:active,
433
+ .mb-color-well-thumb:active,
434
+ .mb-color-well-preset:active {
435
+ scale: 1 !important;
436
+ }
437
+ }
438
+ }
439
+
440
+ /* Continuous corners on the panel and the sheet it becomes on touch. */
441
+ @supports (corner-shape: squircle) {
442
+ .mb-color-well-panel {
443
+ corner-shape: var(--mb-corner-shape);
444
+ border-radius: calc(var(--mb-popup-radius) * var(--mb-corner-factor));
445
+ }
446
+
447
+ @scope ([data-platform="ios"], [data-platform="ipados"]) to (:scope [data-platform]) {
448
+ .mb-color-well-panel[data-presentation="sheet"] {
449
+ border-radius: calc(var(--mb-sheet-radius) * var(--mb-corner-factor)) calc(var(--mb-sheet-radius) * var(--mb-corner-factor)) 0 0;
450
+ }
451
+ }
452
+ }