@zonsh/ui 0.0.0-stage → 0.2.0

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 (388) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -2
  3. package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
  4. package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
  5. package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
  6. package/assets/illustrations/drawing/bracket-construction.svg +77 -0
  7. package/assets/illustrations/drawing/crescent-dark.svg +28 -0
  8. package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
  9. package/assets/illustrations/drawing/crescent-guides.svg +33 -0
  10. package/assets/illustrations/drawing/crescent.svg +28 -0
  11. package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
  12. package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
  13. package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
  14. package/assets/illustrations/drawing/eclipse.svg +187 -0
  15. package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
  16. package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
  17. package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
  18. package/assets/illustrations/drawing/elevation-guides.svg +31 -0
  19. package/assets/illustrations/drawing/horizon-dark.svg +30 -0
  20. package/assets/illustrations/drawing/horizon.svg +30 -0
  21. package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
  22. package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
  23. package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
  24. package/assets/illustrations/drawing/nib-study.svg +107 -0
  25. package/assets/illustrations/editorial/assistant-640.webp +0 -0
  26. package/assets/illustrations/editorial/assistant.webp +0 -0
  27. package/assets/illustrations/editorial/automation-640.webp +0 -0
  28. package/assets/illustrations/editorial/automation.webp +0 -0
  29. package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
  30. package/assets/illustrations/editorial/bracket-left.webp +0 -0
  31. package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
  32. package/assets/illustrations/editorial/bracket-right.webp +0 -0
  33. package/assets/illustrations/editorial/custom-software-640.webp +0 -0
  34. package/assets/illustrations/editorial/custom-software.webp +0 -0
  35. package/assets/illustrations/editorial/digitalization-640.webp +0 -0
  36. package/assets/illustrations/editorial/digitalization.webp +0 -0
  37. package/assets/illustrations/editorial/integration-640.webp +0 -0
  38. package/assets/illustrations/editorial/integration.webp +0 -0
  39. package/assets/illustrations/editorial/problem-640.webp +0 -0
  40. package/assets/illustrations/editorial/problem.webp +0 -0
  41. package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
  42. package/assets/illustrations/editorial/process-analysis.webp +0 -0
  43. package/assets/illustrations/editorial/process-concept-640.webp +0 -0
  44. package/assets/illustrations/editorial/process-concept.webp +0 -0
  45. package/assets/illustrations/editorial/process-development-640.webp +0 -0
  46. package/assets/illustrations/editorial/process-development.webp +0 -0
  47. package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
  48. package/assets/illustrations/editorial/process-discovery.webp +0 -0
  49. package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
  50. package/assets/illustrations/editorial/process-maintenance.webp +0 -0
  51. package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
  52. package/assets/illustrations/editorial/process-prototype.webp +0 -0
  53. package/assets/illustrations/editorial/process-testing-640.webp +0 -0
  54. package/assets/illustrations/editorial/process-testing.webp +0 -0
  55. package/assets/illustrations/iso/automation-dark.svg +6 -0
  56. package/assets/illustrations/iso/automation.svg +6 -0
  57. package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
  58. package/assets/illustrations/iso/bar-chart.svg +6 -0
  59. package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
  60. package/assets/illustrations/iso/brackets-classic.svg +6 -0
  61. package/assets/illustrations/iso/brackets-dark.svg +6 -0
  62. package/assets/illustrations/iso/brackets.svg +6 -0
  63. package/assets/illustrations/iso/city-dark.svg +6 -0
  64. package/assets/illustrations/iso/city.svg +6 -0
  65. package/assets/illustrations/iso/conveyor-dark.svg +6 -0
  66. package/assets/illustrations/iso/conveyor.svg +6 -0
  67. package/assets/illustrations/iso/database-dark.svg +6 -0
  68. package/assets/illustrations/iso/database.svg +6 -0
  69. package/assets/illustrations/iso/documents-dark.svg +6 -0
  70. package/assets/illustrations/iso/documents.svg +6 -0
  71. package/assets/illustrations/iso/inbox-dark.svg +6 -0
  72. package/assets/illustrations/iso/inbox.svg +6 -0
  73. package/assets/illustrations/iso/laptop-dark.svg +6 -0
  74. package/assets/illustrations/iso/laptop.svg +6 -0
  75. package/assets/illustrations/iso/monitor-dark.svg +6 -0
  76. package/assets/illustrations/iso/monitor.svg +6 -0
  77. package/assets/illustrations/iso/pipeline-dark.svg +6 -0
  78. package/assets/illustrations/iso/pipeline.svg +6 -0
  79. package/assets/illustrations/iso/platform-dark.svg +6 -0
  80. package/assets/illustrations/iso/platform.svg +6 -0
  81. package/assets/illustrations/iso/server-dark.svg +6 -0
  82. package/assets/illustrations/iso/server.svg +6 -0
  83. package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
  84. package/assets/illustrations/iso/spreadsheet.svg +6 -0
  85. package/assets/illustrations/iso/timeline-dark.svg +6 -0
  86. package/assets/illustrations/iso/timeline.svg +6 -0
  87. package/assets/illustrations/sheet/construction.svg +115 -0
  88. package/assets/illustrations/sheet/crescent.svg +40 -0
  89. package/assets/illustrations/sheet/limb.svg +42 -0
  90. package/assets/illustrations/sheet/stress-axis.svg +119 -0
  91. package/assets/illustrations/sheet/totality.svg +215 -0
  92. package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
  93. package/assets/logo-left.svg +1 -0
  94. package/assets/logo-right.svg +1 -0
  95. package/assets/logo.svg +1 -0
  96. package/dist/components/_overlay.d.ts +47 -0
  97. package/dist/components/_overlay.js +59 -0
  98. package/dist/components/accordion.d.ts +32 -0
  99. package/dist/components/accordion.js +39 -0
  100. package/dist/components/alert-dialog.d.ts +45 -0
  101. package/dist/components/alert-dialog.js +56 -0
  102. package/dist/components/alert.d.ts +35 -0
  103. package/dist/components/alert.js +42 -0
  104. package/dist/components/ascii-field.d.ts +34 -0
  105. package/dist/components/ascii-field.js +410 -0
  106. package/dist/components/aspect-ratio.d.ts +14 -0
  107. package/dist/components/aspect-ratio.js +17 -0
  108. package/dist/components/avatar.d.ts +42 -0
  109. package/dist/components/avatar.js +55 -0
  110. package/dist/components/badge.d.ts +70 -0
  111. package/dist/components/badge.js +62 -0
  112. package/dist/components/breadcrumb.d.ts +22 -0
  113. package/dist/components/breadcrumb.js +32 -0
  114. package/dist/components/button-group.d.ts +30 -0
  115. package/dist/components/button-group.js +47 -0
  116. package/dist/components/button.d.ts +53 -0
  117. package/dist/components/button.js +130 -0
  118. package/dist/components/calendar.d.ts +26 -0
  119. package/dist/components/calendar.js +164 -0
  120. package/dist/components/card.d.ts +42 -0
  121. package/dist/components/card.js +76 -0
  122. package/dist/components/carousel.d.ts +90 -0
  123. package/dist/components/carousel.js +213 -0
  124. package/dist/components/chart.d.ts +180 -0
  125. package/dist/components/chart.js +286 -0
  126. package/dist/components/checkbox.d.ts +23 -0
  127. package/dist/components/checkbox.js +43 -0
  128. package/dist/components/code-block.d.ts +45 -0
  129. package/dist/components/code-block.js +58 -0
  130. package/dist/components/code-highlight.d.ts +13 -0
  131. package/dist/components/code-highlight.js +107 -0
  132. package/dist/components/collapsible.d.ts +20 -0
  133. package/dist/components/collapsible.js +32 -0
  134. package/dist/components/color-picker.d.ts +85 -0
  135. package/dist/components/color-picker.js +407 -0
  136. package/dist/components/combobox.d.ts +81 -0
  137. package/dist/components/combobox.js +100 -0
  138. package/dist/components/command.d.ts +112 -0
  139. package/dist/components/command.js +212 -0
  140. package/dist/components/context-menu.d.ts +29 -0
  141. package/dist/components/context-menu.js +35 -0
  142. package/dist/components/conversation.d.ts +27 -0
  143. package/dist/components/conversation.js +293 -0
  144. package/dist/components/copy-button.d.ts +46 -0
  145. package/dist/components/copy-button.js +118 -0
  146. package/dist/components/data-table.d.ts +175 -0
  147. package/dist/components/data-table.js +302 -0
  148. package/dist/components/date-picker.d.ts +91 -0
  149. package/dist/components/date-picker.js +207 -0
  150. package/dist/components/dialog.d.ts +48 -0
  151. package/dist/components/dialog.js +92 -0
  152. package/dist/components/direction.d.ts +16 -0
  153. package/dist/components/direction.js +18 -0
  154. package/dist/components/drawer.d.ts +60 -0
  155. package/dist/components/drawer.js +76 -0
  156. package/dist/components/empty.d.ts +31 -0
  157. package/dist/components/empty.js +50 -0
  158. package/dist/components/feature-list.d.ts +54 -0
  159. package/dist/components/feature-list.js +43 -0
  160. package/dist/components/field.d.ts +15 -0
  161. package/dist/components/field.js +36 -0
  162. package/dist/components/file-drop.d.ts +55 -0
  163. package/dist/components/file-drop.js +197 -0
  164. package/dist/components/filter-bar.d.ts +106 -0
  165. package/dist/components/filter-bar.js +296 -0
  166. package/dist/components/form.d.ts +33 -0
  167. package/dist/components/form.js +34 -0
  168. package/dist/components/graph.d.ts +105 -0
  169. package/dist/components/graph.js +786 -0
  170. package/dist/components/illustration.d.ts +85 -0
  171. package/dist/components/illustration.js +165 -0
  172. package/dist/components/input-group.d.ts +127 -0
  173. package/dist/components/input-group.js +292 -0
  174. package/dist/components/input.d.ts +16 -0
  175. package/dist/components/input.js +25 -0
  176. package/dist/components/item.d.ts +64 -0
  177. package/dist/components/item.js +116 -0
  178. package/dist/components/kbd.d.ts +33 -0
  179. package/dist/components/kbd.js +38 -0
  180. package/dist/components/label.d.ts +12 -0
  181. package/dist/components/label.js +24 -0
  182. package/dist/components/layout.d.ts +136 -0
  183. package/dist/components/layout.js +162 -0
  184. package/dist/components/logo.d.ts +54 -0
  185. package/dist/components/logo.js +96 -0
  186. package/dist/components/menu.d.ts +60 -0
  187. package/dist/components/menu.js +138 -0
  188. package/dist/components/menubar.d.ts +62 -0
  189. package/dist/components/menubar.js +223 -0
  190. package/dist/components/message.d.ts +42 -0
  191. package/dist/components/message.js +56 -0
  192. package/dist/components/meter.d.ts +31 -0
  193. package/dist/components/meter.js +25 -0
  194. package/dist/components/native-select.d.ts +26 -0
  195. package/dist/components/native-select.js +35 -0
  196. package/dist/components/navigation-menu.d.ts +42 -0
  197. package/dist/components/navigation-menu.js +97 -0
  198. package/dist/components/number-field.d.ts +36 -0
  199. package/dist/components/number-field.js +153 -0
  200. package/dist/components/otp-field.d.ts +35 -0
  201. package/dist/components/otp-field.js +94 -0
  202. package/dist/components/pagination.d.ts +31 -0
  203. package/dist/components/pagination.js +70 -0
  204. package/dist/components/pdf-viewer.d.ts +69 -0
  205. package/dist/components/pdf-viewer.js +929 -0
  206. package/dist/components/popover.d.ts +33 -0
  207. package/dist/components/popover.js +48 -0
  208. package/dist/components/preview-card.d.ts +25 -0
  209. package/dist/components/preview-card.js +22 -0
  210. package/dist/components/progress.d.ts +27 -0
  211. package/dist/components/progress.js +23 -0
  212. package/dist/components/prompt-input.d.ts +131 -0
  213. package/dist/components/prompt-input.js +403 -0
  214. package/dist/components/quote.d.ts +22 -0
  215. package/dist/components/quote.js +15 -0
  216. package/dist/components/radio-group.d.ts +18 -0
  217. package/dist/components/radio-group.js +34 -0
  218. package/dist/components/reasoning.d.ts +31 -0
  219. package/dist/components/reasoning.js +70 -0
  220. package/dist/components/resizable.d.ts +38 -0
  221. package/dist/components/resizable.js +41 -0
  222. package/dist/components/response.d.ts +30 -0
  223. package/dist/components/response.js +538 -0
  224. package/dist/components/scroll-area.d.ts +33 -0
  225. package/dist/components/scroll-area.js +31 -0
  226. package/dist/components/select.d.ts +35 -0
  227. package/dist/components/select.js +60 -0
  228. package/dist/components/separator.d.ts +14 -0
  229. package/dist/components/separator.js +17 -0
  230. package/dist/components/sidebar.d.ts +147 -0
  231. package/dist/components/sidebar.js +489 -0
  232. package/dist/components/site-header.d.ts +59 -0
  233. package/dist/components/site-header.js +67 -0
  234. package/dist/components/skeleton.d.ts +31 -0
  235. package/dist/components/skeleton.js +29 -0
  236. package/dist/components/slider.d.ts +24 -0
  237. package/dist/components/slider.js +129 -0
  238. package/dist/components/sources.d.ts +25 -0
  239. package/dist/components/sources.js +35 -0
  240. package/dist/components/spinner.d.ts +36 -0
  241. package/dist/components/spinner.js +72 -0
  242. package/dist/components/suggestions.d.ts +20 -0
  243. package/dist/components/suggestions.js +18 -0
  244. package/dist/components/switch.d.ts +14 -0
  245. package/dist/components/switch.js +26 -0
  246. package/dist/components/table.d.ts +162 -0
  247. package/dist/components/table.js +758 -0
  248. package/dist/components/tabs.d.ts +25 -0
  249. package/dist/components/tabs.js +162 -0
  250. package/dist/components/tag.d.ts +41 -0
  251. package/dist/components/tag.js +88 -0
  252. package/dist/components/tags-input.d.ts +40 -0
  253. package/dist/components/tags-input.js +239 -0
  254. package/dist/components/textarea.d.ts +13 -0
  255. package/dist/components/textarea.js +16 -0
  256. package/dist/components/theme.d.ts +41 -0
  257. package/dist/components/theme.js +112 -0
  258. package/dist/components/time-field.d.ts +51 -0
  259. package/dist/components/time-field.js +437 -0
  260. package/dist/components/timeline.d.ts +76 -0
  261. package/dist/components/timeline.js +99 -0
  262. package/dist/components/toast.d.ts +72 -0
  263. package/dist/components/toast.js +196 -0
  264. package/dist/components/toggle-group.d.ts +41 -0
  265. package/dist/components/toggle-group.js +140 -0
  266. package/dist/components/toggle.d.ts +23 -0
  267. package/dist/components/toggle.js +35 -0
  268. package/dist/components/tool-call.d.ts +52 -0
  269. package/dist/components/tool-call.js +57 -0
  270. package/dist/components/toolbar.d.ts +17 -0
  271. package/dist/components/toolbar.js +34 -0
  272. package/dist/components/tooltip.d.ts +42 -0
  273. package/dist/components/tooltip.js +47 -0
  274. package/dist/components/tree.d.ts +75 -0
  275. package/dist/components/tree.js +636 -0
  276. package/dist/components/typography.d.ts +134 -0
  277. package/dist/components/typography.js +176 -0
  278. package/dist/components/video-player.d.ts +276 -0
  279. package/dist/components/video-player.js +1352 -0
  280. package/dist/components/whiteboard.d.ts +80 -0
  281. package/dist/components/whiteboard.js +389 -0
  282. package/dist/index.d.ts +85 -0
  283. package/dist/index.js +86 -0
  284. package/dist/lib/cn.d.ts +20 -0
  285. package/dist/lib/cn.js +38 -0
  286. package/dist/lib/code-highlight.d.ts +31 -0
  287. package/dist/lib/code-highlight.js +24 -0
  288. package/dist/lib/code-theme.d.ts +19 -0
  289. package/dist/lib/code-theme.js +140 -0
  290. package/dist/lib/collapse-row.d.ts +9 -0
  291. package/dist/lib/collapse-row.js +129 -0
  292. package/dist/lib/digit-roll.d.ts +21 -0
  293. package/dist/lib/digit-roll.js +31 -0
  294. package/dist/lib/editorial-assets.d.ts +16 -0
  295. package/dist/lib/editorial-assets.js +56 -0
  296. package/dist/lib/figure/catalog.d.ts +127 -0
  297. package/dist/lib/figure/catalog.js +130 -0
  298. package/dist/lib/figure/figures/automation.d.ts +7 -0
  299. package/dist/lib/figure/figures/automation.js +143 -0
  300. package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
  301. package/dist/lib/figure/figures/bar-chart.js +99 -0
  302. package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
  303. package/dist/lib/figure/figures/brackets-classic.js +170 -0
  304. package/dist/lib/figure/figures/brackets.d.ts +8 -0
  305. package/dist/lib/figure/figures/brackets.js +84 -0
  306. package/dist/lib/figure/figures/city.d.ts +7 -0
  307. package/dist/lib/figure/figures/city.js +93 -0
  308. package/dist/lib/figure/figures/conveyor.d.ts +7 -0
  309. package/dist/lib/figure/figures/conveyor.js +97 -0
  310. package/dist/lib/figure/figures/database.d.ts +7 -0
  311. package/dist/lib/figure/figures/database.js +65 -0
  312. package/dist/lib/figure/figures/documents.d.ts +7 -0
  313. package/dist/lib/figure/figures/documents.js +83 -0
  314. package/dist/lib/figure/figures/inbox.d.ts +7 -0
  315. package/dist/lib/figure/figures/inbox.js +92 -0
  316. package/dist/lib/figure/figures/laptop.d.ts +7 -0
  317. package/dist/lib/figure/figures/laptop.js +67 -0
  318. package/dist/lib/figure/figures/monitor.d.ts +7 -0
  319. package/dist/lib/figure/figures/monitor.js +59 -0
  320. package/dist/lib/figure/figures/pipeline.d.ts +8 -0
  321. package/dist/lib/figure/figures/pipeline.js +117 -0
  322. package/dist/lib/figure/figures/platform.d.ts +7 -0
  323. package/dist/lib/figure/figures/platform.js +117 -0
  324. package/dist/lib/figure/figures/server.d.ts +7 -0
  325. package/dist/lib/figure/figures/server.js +115 -0
  326. package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
  327. package/dist/lib/figure/figures/spreadsheet.js +87 -0
  328. package/dist/lib/figure/figures/timeline.d.ts +7 -0
  329. package/dist/lib/figure/figures/timeline.js +65 -0
  330. package/dist/lib/figure/kernel.d.ts +152 -0
  331. package/dist/lib/figure/kernel.js +576 -0
  332. package/dist/lib/figure/parts.d.ts +42 -0
  333. package/dist/lib/figure/parts.js +126 -0
  334. package/dist/lib/form-reset.d.ts +11 -0
  335. package/dist/lib/form-reset.js +22 -0
  336. package/dist/lib/glide.d.ts +53 -0
  337. package/dist/lib/glide.js +138 -0
  338. package/dist/lib/graph-layout.d.ts +58 -0
  339. package/dist/lib/graph-layout.js +200 -0
  340. package/dist/lib/illustration-drawings.d.ts +89 -0
  341. package/dist/lib/illustration-drawings.js +539 -0
  342. package/dist/lib/illustration-info.d.ts +37 -0
  343. package/dist/lib/illustration-info.js +22 -0
  344. package/dist/lib/illustration-library.d.ts +87 -0
  345. package/dist/lib/illustration-library.js +352 -0
  346. package/dist/lib/logo-geometry.d.ts +29 -0
  347. package/dist/lib/logo-geometry.js +67 -0
  348. package/dist/lib/markdown-guard.d.ts +16 -0
  349. package/dist/lib/markdown-guard.js +123 -0
  350. package/dist/lib/merge-refs.d.ts +10 -0
  351. package/dist/lib/merge-refs.js +26 -0
  352. package/dist/lib/motion.d.ts +6 -0
  353. package/dist/lib/motion.js +12 -0
  354. package/dist/lib/pdf-worker.d.ts +1 -0
  355. package/dist/lib/pdf-worker.js +6 -0
  356. package/dist/lib/pdf.d.ts +19 -0
  357. package/dist/lib/pdf.js +58 -0
  358. package/dist/lib/platform.d.ts +33 -0
  359. package/dist/lib/platform.js +68 -0
  360. package/dist/lib/room.d.ts +25 -0
  361. package/dist/lib/room.js +46 -0
  362. package/dist/lib/table-fit.d.ts +143 -0
  363. package/dist/lib/table-fit.js +577 -0
  364. package/dist/lib/theme-script.d.ts +18 -0
  365. package/dist/lib/theme-script.js +29 -0
  366. package/dist/styles/expressive.css +188 -0
  367. package/dist/styles/fonts.css +145 -0
  368. package/dist/styles/index.css +206 -0
  369. package/dist/styles/material.css +313 -0
  370. package/dist/styles/parts/ai.css +360 -0
  371. package/dist/styles/parts/brand.css +75 -0
  372. package/dist/styles/parts/controls.css +725 -0
  373. package/dist/styles/parts/data.css +222 -0
  374. package/dist/styles/parts/editorial.css +120 -0
  375. package/dist/styles/parts/feedback.css +273 -0
  376. package/dist/styles/parts/foundations.css +166 -0
  377. package/dist/styles/parts/graph.css +214 -0
  378. package/dist/styles/parts/inputs.css +261 -0
  379. package/dist/styles/parts/isometric.css +124 -0
  380. package/dist/styles/parts/navigation.css +232 -0
  381. package/dist/styles/parts/overlays.css +250 -0
  382. package/dist/styles/parts/pdf.css +154 -0
  383. package/dist/styles/parts/react-flow.css +519 -0
  384. package/dist/styles/parts/whiteboard.css +855 -0
  385. package/dist/styles/tokens.css +290 -0
  386. package/dist/vite.d.ts +116 -0
  387. package/dist/vite.js +129 -0
  388. package/package.json +189 -3
@@ -0,0 +1,725 @@
1
+ /* controls components — owned by the controls group. Prefer Tailwind in TSX; use this only for what classes cannot express (keyframes, complex selectors, SVG). */
2
+
3
+ /* The switch thumb's stretch and travel, registered so they can transition as values. */
4
+ @property --thumb-w {
5
+ syntax: "<length>";
6
+ inherits: false;
7
+ initial-value: 18px;
8
+ }
9
+ @property --thumb-on {
10
+ syntax: "<number>";
11
+ inherits: false;
12
+ initial-value: 0;
13
+ }
14
+
15
+ @layer components {
16
+ /* ── Toggle: the pressed ("on") shadow ───────────────────────────────────────
17
+ * The raised-current edge (--control-focus) plus a pressed-in inset. The inset uses
18
+ * --control-edge, which is 18% black in light and 65% black in dark, so the sink reads
19
+ * in both themes. Applied in toggle.tsx with `data-pressed:shadow-(--toggle-shadow-pressed)`. */
20
+ [data-slot="toggle"] {
21
+ --toggle-shadow-pressed:
22
+ 0 0 0 1px var(--control-focus), inset 0 2px 4px var(--control-edge),
23
+ inset 0 0 0 1px var(--control-inner-edge);
24
+ }
25
+
26
+ /* ── Toggle and toggle-group items ──────────────────────────────────────────
27
+ * Hover only brightens the ink — no fill, so hover never reads as "on". A press shows in the
28
+ * material (the pressed inset), not in movement. The inset is inlined: theme shadows exist as
29
+ * variables only when a utility uses them. */
30
+ [data-slot="toggle"],
31
+ [data-slot="toggle-group-item"] {
32
+ transition:
33
+ background-color var(--duration) var(--ease),
34
+ color var(--duration) var(--ease),
35
+ box-shadow var(--duration) var(--ease);
36
+ }
37
+ [data-slot="toggle"]:active:not(:disabled, [data-disabled]) {
38
+ --toggle-shadow-pressed:
39
+ 0 0 0 1px var(--control-edge), inset 0 2px 4px #0000002e, inset 0 0 0 1px var(--control-inner-edge);
40
+ box-shadow: var(--toggle-shadow-pressed);
41
+ }
42
+
43
+ /* ── Checkbox: the check draws in, and undraws the same way out ──────────────
44
+ * Ticking draws the check from its short leg up to the long one; unticking runs it backwards,
45
+ * faster, and the fill clears as it finishes. Base UI keeps the indicator mounted while
46
+ * its own transitions run, so it carries a stepped opacity of the same length. Starting and
47
+ * ending styles exist only on change, so nothing animates on first render. */
48
+ [data-slot="checkbox"],
49
+ [data-slot="menu-checkbox-item"],
50
+ [data-slot="menubar-checkbox-item"] {
51
+ --check-undraw: calc(var(--duration) * 0.72);
52
+ }
53
+ /* A menu's checkbox item draws its check the same way. */
54
+ :is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]) {
55
+ transition: opacity var(--check-undraw) steps(1, end);
56
+ }
57
+ :is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"])[data-ending-style] {
58
+ opacity: 0;
59
+ }
60
+ :is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]) svg {
61
+ stroke-dasharray: 24;
62
+ stroke-dashoffset: 0;
63
+ transition: stroke-dashoffset calc(var(--duration) * 1.6) var(--ease);
64
+ }
65
+ :is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]):is(
66
+ [data-starting-style],
67
+ [data-ending-style]
68
+ )
69
+ svg {
70
+ stroke-dashoffset: -24;
71
+ }
72
+ :is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"])[data-ending-style] svg {
73
+ transition-duration: var(--check-undraw);
74
+ transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
75
+ }
76
+
77
+ /* ── Menu: a trigger's down chevron turns up while its menu is open ───────────────────── */
78
+ [aria-haspopup="menu"] svg.lucide-chevron-down {
79
+ transition: rotate var(--duration) var(--ease);
80
+ }
81
+ [aria-haspopup="menu"][aria-expanded="true"] svg.lucide-chevron-down {
82
+ rotate: 180deg;
83
+ }
84
+
85
+ /* ── Switch: the thumb stretches, then slides ────────────────────────────────
86
+ * Hover stretches the thumb from 18 to 22px, a press to 25px, toward the side it will travel.
87
+ * Checked, it sits against the far edge: the track's inner width (34px) minus its own width,
88
+ * so it stays flush while it stretches.
89
+ *
90
+ * Two registered values move, not width and position: the stretch (--thumb-w) and how far on
91
+ * the switch is (--thumb-on, 0 to 1), each in 2 × --duration. Width and offset are worked out
92
+ * from them every frame, both in layout, so the far edge cannot drift — two separate
93
+ * transitions fell out of step whenever one was reversed mid-way (hover out, release). */
94
+ [data-slot="switch-thumb"] {
95
+ --thumb-w: 18px;
96
+ --thumb-on: 0;
97
+ width: var(--thumb-w);
98
+ height: 18px;
99
+ margin-inline-start: calc((34px - var(--thumb-w)) * var(--thumb-on));
100
+ transition:
101
+ --thumb-w calc(var(--duration) * 2) var(--ease),
102
+ --thumb-on calc(var(--duration) * 2) var(--ease),
103
+ background-color var(--duration) var(--ease),
104
+ box-shadow var(--duration) var(--ease);
105
+ }
106
+ [data-slot="switch-thumb"][data-checked] {
107
+ --thumb-on: 1;
108
+ }
109
+ @media (hover: hover) {
110
+ [data-slot="switch"]:not([data-disabled], [data-readonly]):hover > [data-slot="switch-thumb"] {
111
+ --thumb-w: 22px;
112
+ }
113
+ }
114
+ [data-slot="switch"]:not([data-disabled], [data-readonly]):active > [data-slot="switch-thumb"] {
115
+ --thumb-w: 25px;
116
+ }
117
+
118
+ /* ── Button group: how neighbours meet ───────────────────────────────────────
119
+ * Fields (real borders) overlap by a pixel so their borders merge into one line. Buttons draw
120
+ * their edge as an outer ring plus inner highlights, which doubled up at the join — a heavy bar
121
+ * on a split primary, and the right half seeming to sit on the left. So a joined button trims
122
+ * 1px of its inner side (ring and highlight with it), the two meet exactly, and the later one
123
+ * draws a single 1px seam: the edge colour on raised buttons, a soft line on the primary. A
124
+ * focused or open control drops the trim so its outline and ring show whole. */
125
+ [data-slot="button-group"][data-orientation="horizontal"]
126
+ > :not(
127
+ :nth-child(
128
+ 1
129
+ of
130
+ :not(
131
+ [data-base-ui-focus-guard],
132
+ span[aria-owns],
133
+ [data-slot="button-group-separator"],
134
+ [data-slot="copy-button-status"]
135
+ )
136
+ )
137
+ ) {
138
+ margin-left: -1px;
139
+ }
140
+ [data-slot="button-group"][data-orientation="vertical"]
141
+ > :not(
142
+ :nth-child(
143
+ 1
144
+ of
145
+ :not(
146
+ [data-base-ui-focus-guard],
147
+ span[aria-owns],
148
+ [data-slot="button-group-separator"],
149
+ [data-slot="copy-button-status"]
150
+ )
151
+ )
152
+ ) {
153
+ margin-top: -1px;
154
+ }
155
+ [data-slot="button-group"][data-orientation="horizontal"]
156
+ > [data-variant]:not(
157
+ :nth-child(
158
+ 1
159
+ of
160
+ :not(
161
+ [data-base-ui-focus-guard],
162
+ span[aria-owns],
163
+ [data-slot="button-group-separator"],
164
+ [data-slot="copy-button-status"]
165
+ )
166
+ )
167
+ ) {
168
+ margin-left: -2px;
169
+ }
170
+ [data-slot="button-group"][data-orientation="vertical"]
171
+ > [data-variant]:not(
172
+ :nth-child(
173
+ 1
174
+ of
175
+ :not(
176
+ [data-base-ui-focus-guard],
177
+ span[aria-owns],
178
+ [data-slot="button-group-separator"],
179
+ [data-slot="copy-button-status"]
180
+ )
181
+ )
182
+ ) {
183
+ margin-top: -2px;
184
+ }
185
+ [data-slot="button-group"][data-orientation="horizontal"]
186
+ > [data-variant]:nth-child(
187
+ 1
188
+ of
189
+ :not(
190
+ [data-base-ui-focus-guard],
191
+ span[aria-owns],
192
+ [data-slot="button-group-separator"],
193
+ [data-slot="copy-button-status"]
194
+ )
195
+ ):not(
196
+ :nth-last-child(
197
+ 1
198
+ of
199
+ :not(
200
+ [data-base-ui-focus-guard],
201
+ span[aria-owns],
202
+ [data-slot="button-group-separator"],
203
+ [data-slot="copy-button-status"]
204
+ )
205
+ )
206
+ ) {
207
+ clip-path: inset(-16px 1px -16px -16px);
208
+ }
209
+ [data-slot="button-group"][data-orientation="horizontal"]
210
+ > [data-variant]:nth-last-child(
211
+ 1
212
+ of
213
+ :not(
214
+ [data-base-ui-focus-guard],
215
+ span[aria-owns],
216
+ [data-slot="button-group-separator"],
217
+ [data-slot="copy-button-status"]
218
+ )
219
+ ):not(
220
+ :nth-child(
221
+ 1
222
+ of
223
+ :not(
224
+ [data-base-ui-focus-guard],
225
+ span[aria-owns],
226
+ [data-slot="button-group-separator"],
227
+ [data-slot="copy-button-status"]
228
+ )
229
+ )
230
+ ) {
231
+ clip-path: inset(-16px -16px -16px 1px);
232
+ }
233
+ [data-slot="button-group"][data-orientation="horizontal"]
234
+ > [data-variant]:not(
235
+ :nth-child(
236
+ 1
237
+ of
238
+ :not(
239
+ [data-base-ui-focus-guard],
240
+ span[aria-owns],
241
+ [data-slot="button-group-separator"],
242
+ [data-slot="copy-button-status"]
243
+ )
244
+ )
245
+ ):not(
246
+ :nth-last-child(
247
+ 1
248
+ of
249
+ :not(
250
+ [data-base-ui-focus-guard],
251
+ span[aria-owns],
252
+ [data-slot="button-group-separator"],
253
+ [data-slot="copy-button-status"]
254
+ )
255
+ )
256
+ ) {
257
+ clip-path: inset(-16px 1px);
258
+ }
259
+ [data-slot="button-group"][data-orientation="vertical"]
260
+ > [data-variant]:nth-child(
261
+ 1
262
+ of
263
+ :not(
264
+ [data-base-ui-focus-guard],
265
+ span[aria-owns],
266
+ [data-slot="button-group-separator"],
267
+ [data-slot="copy-button-status"]
268
+ )
269
+ ):not(
270
+ :nth-last-child(
271
+ 1
272
+ of
273
+ :not(
274
+ [data-base-ui-focus-guard],
275
+ span[aria-owns],
276
+ [data-slot="button-group-separator"],
277
+ [data-slot="copy-button-status"]
278
+ )
279
+ )
280
+ ) {
281
+ clip-path: inset(-16px -16px 1px -16px);
282
+ }
283
+ [data-slot="button-group"][data-orientation="vertical"]
284
+ > [data-variant]:nth-last-child(
285
+ 1
286
+ of
287
+ :not(
288
+ [data-base-ui-focus-guard],
289
+ span[aria-owns],
290
+ [data-slot="button-group-separator"],
291
+ [data-slot="copy-button-status"]
292
+ )
293
+ ):not(
294
+ :nth-child(
295
+ 1
296
+ of
297
+ :not(
298
+ [data-base-ui-focus-guard],
299
+ span[aria-owns],
300
+ [data-slot="button-group-separator"],
301
+ [data-slot="copy-button-status"]
302
+ )
303
+ )
304
+ ) {
305
+ clip-path: inset(1px -16px -16px -16px);
306
+ }
307
+ [data-slot="button-group"][data-orientation="vertical"]
308
+ > [data-variant]:not(
309
+ :nth-child(
310
+ 1
311
+ of
312
+ :not(
313
+ [data-base-ui-focus-guard],
314
+ span[aria-owns],
315
+ [data-slot="button-group-separator"],
316
+ [data-slot="copy-button-status"]
317
+ )
318
+ )
319
+ ):not(
320
+ :nth-last-child(
321
+ 1
322
+ of
323
+ :not(
324
+ [data-base-ui-focus-guard],
325
+ span[aria-owns],
326
+ [data-slot="button-group-separator"],
327
+ [data-slot="copy-button-status"]
328
+ )
329
+ )
330
+ ) {
331
+ clip-path: inset(1px -16px);
332
+ }
333
+ [data-slot="button-group"] > [data-variant]:is(:focus-visible, :has(:focus-visible), [data-popup-open]) {
334
+ clip-path: none;
335
+ }
336
+ [data-slot="button-group"]
337
+ > [data-variant]:not(
338
+ :nth-child(
339
+ 1
340
+ of
341
+ :not(
342
+ [data-base-ui-focus-guard],
343
+ span[aria-owns],
344
+ [data-slot="button-group-separator"],
345
+ [data-slot="copy-button-status"]
346
+ )
347
+ )
348
+ )::after {
349
+ content: "";
350
+ position: absolute;
351
+ pointer-events: none;
352
+ background: var(--control-edge);
353
+ }
354
+ [data-slot="button-group"]
355
+ > [data-variant="primary"]:not(
356
+ :nth-child(
357
+ 1
358
+ of
359
+ :not(
360
+ [data-base-ui-focus-guard],
361
+ span[aria-owns],
362
+ [data-slot="button-group-separator"],
363
+ [data-slot="copy-button-status"]
364
+ )
365
+ )
366
+ )::after {
367
+ background: color-mix(in oklab, var(--primary-text) 22%, transparent);
368
+ }
369
+ [data-slot="button-group"][data-orientation="horizontal"]
370
+ > [data-variant]:not(
371
+ :nth-child(
372
+ 1
373
+ of
374
+ :not(
375
+ [data-base-ui-focus-guard],
376
+ span[aria-owns],
377
+ [data-slot="button-group-separator"],
378
+ [data-slot="copy-button-status"]
379
+ )
380
+ )
381
+ )::after {
382
+ top: -1px;
383
+ bottom: -1px;
384
+ left: 0;
385
+ width: 1px;
386
+ }
387
+ [data-slot="button-group"][data-orientation="vertical"]
388
+ > [data-variant]:not(
389
+ :nth-child(
390
+ 1
391
+ of
392
+ :not(
393
+ [data-base-ui-focus-guard],
394
+ span[aria-owns],
395
+ [data-slot="button-group-separator"],
396
+ [data-slot="copy-button-status"]
397
+ )
398
+ )
399
+ )::after {
400
+ left: -1px;
401
+ right: -1px;
402
+ top: 0;
403
+ height: 1px;
404
+ }
405
+
406
+ /* ── Toggle group, reveal: one part of a segment stays hidden until it is pressed ──────────
407
+ * A segment's icon and label each sit in a one-column grid; the hidden one is a 0fr column
408
+ * with its content clipped, and widens to 1fr when the segment is pressed. The width moves on
409
+ * 2 × --duration like the raised surface that follows it; the fade on --duration. */
410
+ [data-slot="toggle-group-item"] > [data-slot="toggle-group-icon"],
411
+ [data-slot="toggle-group-item"] > [data-slot="toggle-group-label"] {
412
+ display: grid;
413
+ grid-template-columns: 1fr;
414
+ align-items: center;
415
+ transition:
416
+ grid-template-columns calc(var(--duration) * 2) var(--ease),
417
+ opacity var(--duration) var(--ease);
418
+ }
419
+ [data-slot="toggle-group-icon"] > span,
420
+ [data-slot="toggle-group-label"] > span {
421
+ display: flex;
422
+ align-items: center;
423
+ min-width: 0;
424
+ overflow: hidden;
425
+ }
426
+ /* The icon–label gap travels inside the part that slides (a pseudo-element, which a 0fr
427
+ track does not count the way it counts padding), so nothing is left of it while hidden. */
428
+ [data-slot="toggle-group"][data-reveal="label"] [data-slot="toggle-group-label"] > span::before,
429
+ [data-slot="toggle-group"][data-reveal="icon"] [data-slot="toggle-group-icon"] > span::after {
430
+ content: "";
431
+ flex: none;
432
+ width: --spacing(1.5);
433
+ }
434
+ [data-slot="toggle-group"][data-reveal="label"]
435
+ > [data-slot="toggle-group-item"]:not([data-pressed])
436
+ > [data-slot="toggle-group-label"],
437
+ [data-slot="toggle-group"][data-reveal="icon"]
438
+ > [data-slot="toggle-group-item"]:not([data-pressed])
439
+ > [data-slot="toggle-group-icon"] {
440
+ grid-template-columns: 0fr;
441
+ opacity: 0;
442
+ }
443
+
444
+ /* ── Button, collapsible: the label folds away to leave the icon ─────────────────────────
445
+ * Like a revealing toggle-group segment: the label is a one-column grid that narrows to 0fr
446
+ * with its text clipped, on 2 × --duration, and fades on --duration. The icon–label gap
447
+ * travels inside it (a pseudo-element on the icon's side), so nothing of it is left. The
448
+ * first decision, before the first paint, is drawn without motion (data-collapse-instant; the
449
+ * button's own transitions are switched off by a utility in Button, above the material). */
450
+ [data-slot="button"] > [data-slot="button-label"] {
451
+ display: grid;
452
+ grid-template-columns: 1fr;
453
+ align-items: center;
454
+ transition:
455
+ grid-template-columns calc(var(--duration) * 2) var(--ease),
456
+ opacity var(--duration) var(--ease);
457
+ }
458
+ [data-slot="button-label"] > span {
459
+ display: flex;
460
+ align-items: center;
461
+ min-width: 0;
462
+ overflow: hidden;
463
+ }
464
+ [data-slot="button-label"][data-after-icon] > span::before,
465
+ [data-slot="button-label"]:not([data-after-icon]) > span::after {
466
+ content: "";
467
+ flex: none;
468
+ width: var(--button-gap);
469
+ }
470
+ [data-slot="button"][data-collapsed] > [data-slot="button-label"] {
471
+ grid-template-columns: 0fr;
472
+ opacity: 0;
473
+ }
474
+ /* An expandable button is the fold in reverse: folded at rest, open on hover or keyboard
475
+ focus. Touch screens have no hover, so there it stays an icon. */
476
+ @media (hover: hover) {
477
+ [data-slot="button"][data-expandable="label"]:hover > [data-slot="button-label"] {
478
+ grid-template-columns: 1fr;
479
+ opacity: 1;
480
+ }
481
+ }
482
+ [data-slot="button"][data-expandable="label"]:focus-visible > [data-slot="button-label"] {
483
+ grid-template-columns: 1fr;
484
+ opacity: 1;
485
+ }
486
+ /* Hover intent: an expandable button opens once the pointer rests on it (70ms), so passing over
487
+ it on the way somewhere does nothing, and stays open a moment after it leaves (140ms), so
488
+ the button the pointer is heading for does not move away under it. Keyboard focus and
489
+ reduced motion are immediate. */
490
+ [data-slot="button"][data-expandable] {
491
+ --expand-delay: 140ms;
492
+ }
493
+ @media (hover: hover) {
494
+ [data-slot="button"][data-expandable]:hover {
495
+ --expand-delay: 70ms;
496
+ }
497
+ }
498
+ [data-slot="button"][data-expandable]:focus-visible {
499
+ --expand-delay: 0s;
500
+ }
501
+ @media (prefers-reduced-motion: reduce) {
502
+ [data-slot="button"][data-expandable] {
503
+ --expand-delay: 0s !important;
504
+ }
505
+ }
506
+ [data-slot="button"][data-expandable] > :is([data-slot="button-label"], [data-slot="button-icon"]) {
507
+ transition-delay: var(--expand-delay);
508
+ }
509
+
510
+ /* expandable="icon" is the other way round: the text stays, and the icon slides in beside it
511
+ on hover or keyboard focus, out of a 0fr column like a revealing toggle-group segment. The
512
+ gap travels inside the icon's column, on the side that faces the text. */
513
+ [data-slot="button"] > [data-slot="button-icon"] {
514
+ display: grid;
515
+ grid-template-columns: 1fr;
516
+ align-items: center;
517
+ transition:
518
+ grid-template-columns calc(var(--duration) * 2) var(--ease),
519
+ opacity var(--duration) var(--ease);
520
+ }
521
+ [data-slot="button-icon"] > span {
522
+ display: flex;
523
+ align-items: center;
524
+ min-width: 0;
525
+ overflow: hidden;
526
+ }
527
+ [data-slot="button-icon"][data-before-label] > span::after,
528
+ [data-slot="button-icon"]:not([data-before-label]) > span::before {
529
+ content: "";
530
+ flex: none;
531
+ width: var(--button-gap);
532
+ }
533
+ [data-slot="button"][data-expandable="icon"] > [data-slot="button-icon"] {
534
+ grid-template-columns: 0fr;
535
+ opacity: 0;
536
+ }
537
+ @media (hover: hover) {
538
+ [data-slot="button"][data-expandable="icon"]:hover > [data-slot="button-icon"] {
539
+ grid-template-columns: 1fr;
540
+ opacity: 1;
541
+ }
542
+ }
543
+ [data-slot="button"][data-expandable="icon"]:focus-visible > [data-slot="button-icon"] {
544
+ grid-template-columns: 1fr;
545
+ opacity: 1;
546
+ }
547
+ [data-slot="button"][data-collapse-instant] > [data-slot="button-label"] {
548
+ transition: none;
549
+ }
550
+
551
+ /* ── Input group: nested radius ──────────────────────────────────────────────
552
+ * A button inside the field is concentric with it: outer radius − inset = inner radius,
553
+ * where the inset is the space between the field's border and the button.
554
+ * default: 10 − ((38 − 30) / 2 − 1) = 7px
555
+ * dense: 10 − ((30 − 24) / 2 − 1) = 8px
556
+ * Applied in input-group.tsx with `rounded-(--input-group-button-radius)`. */
557
+ [data-slot="input-group-button"] {
558
+ --input-group-button-radius: calc(
559
+ var(--radius-control) - ((var(--control-h) - var(--control-inset)) / 2 - 1px)
560
+ );
561
+ }
562
+ [data-slot="input-group"][data-size="sm"] [data-slot="input-group-button"] {
563
+ --input-group-button-radius: calc(
564
+ var(--radius-control) - ((var(--control-h-sm) - var(--control-inset-sm)) / 2 - 1px)
565
+ );
566
+ }
567
+
568
+ /* ── Badge: pinned to the corner of what it marks ────────────────────────────
569
+ * The badge is centred on the anchor point. For a circle that is its 45° point,
570
+ * (1 − 1/√2) / 2 ≈ 14.6% in from the bounding box; for a rect, just inside the corner.
571
+ * The outline is a cut-out in the page colour that separates the badge from the object. */
572
+ [data-slot="badge-anchor"] {
573
+ --badge-inset: 14.6%;
574
+ }
575
+ [data-slot="badge-anchor"][data-shape="rect"] {
576
+ --badge-inset: 2px;
577
+ }
578
+ [data-slot="badge-anchor"] > [data-slot="badge"] {
579
+ position: absolute;
580
+ z-index: 1;
581
+ top: var(--badge-inset);
582
+ inset-inline-end: var(--badge-inset);
583
+ translate: 50% -50%;
584
+ outline: 2px solid var(--badge-cutout, var(--background));
585
+ outline-offset: 0;
586
+ pointer-events: none;
587
+ }
588
+ [data-slot="badge-anchor"][data-placement="bottom-end"] > [data-slot="badge"] {
589
+ top: auto;
590
+ bottom: var(--badge-inset);
591
+ translate: 50% 50%;
592
+ }
593
+ [data-slot="badge-anchor"]:dir(rtl) > [data-slot="badge"] {
594
+ translate: -50% -50%;
595
+ }
596
+ [data-slot="badge-anchor"][data-placement="bottom-end"]:dir(rtl) > [data-slot="badge"] {
597
+ translate: -50% 50%;
598
+ }
599
+ }
600
+
601
+ /* ── Checkbox: the fill clears right behind the undraw ───────────────────────
602
+ * Ticking fills at once and draws the check; unticking is the same in reverse and quicker: the
603
+ * check undraws in ~110ms and the fill clears as it finishes. Unlayered: the field material sets
604
+ * its own `transition`, which a layered rule cannot change. */
605
+ [data-slot="checkbox"] {
606
+ transition:
607
+ border-color var(--duration) var(--ease),
608
+ box-shadow var(--duration) var(--ease),
609
+ background-color var(--duration) var(--ease);
610
+ }
611
+ [data-slot="checkbox"]:not([data-checked], [data-indeterminate]) {
612
+ transition-duration: calc(var(--duration) * 0.72);
613
+ transition-delay: calc(var(--check-undraw) * 0.6);
614
+ }
615
+
616
+ /* ── Button group with a field: one outline for the pair ─────────────────────────────────────
617
+ * A raised button draws its edge 1px outside its box; a field draws it inside its border, plus
618
+ * a 1px highlight under it. Next to a field a secondary button takes the field's geometry and
619
+ * colours: its edge moves inside and becomes --field-edge, it gets the same highlight below,
620
+ * and the seam between them is --field-edge too. In light mode the two edge colours were close;
621
+ * in dark mode the button's near-black edge vanished into the page and the field's light one
622
+ * did not, so the button looked 2px smaller while measuring the same. (A primary button keeps
623
+ * its own shadow.) Unlayered: it must beat the raised material, which is a utility. */
624
+ [data-slot="button-group"]:has(
625
+ [data-slot="input"],
626
+ [data-slot="input-group"],
627
+ [data-slot="select-trigger"],
628
+ [data-slot="native-select"]
629
+ )
630
+ > [data-variant="secondary"] {
631
+ border-color: var(--field-edge);
632
+ box-shadow:
633
+ inset 0 1px 0 var(--control-highlight),
634
+ inset 0 0 0 1px var(--control-inner-edge),
635
+ 0 1px 0 var(--control-highlight);
636
+ }
637
+ [data-slot="button-group"]:has(
638
+ [data-slot="input"],
639
+ [data-slot="input-group"],
640
+ [data-slot="select-trigger"],
641
+ [data-slot="native-select"]
642
+ )
643
+ > [data-variant="secondary"]:active:not(:disabled, [data-disabled]) {
644
+ box-shadow:
645
+ inset 0 2px 4px #0000002e,
646
+ inset 0 0 0 1px var(--control-inner-edge),
647
+ 0 1px 0 var(--control-highlight);
648
+ }
649
+ [data-slot="button-group"]:has(
650
+ [data-slot="input"],
651
+ [data-slot="input-group"],
652
+ [data-slot="select-trigger"],
653
+ [data-slot="native-select"]
654
+ )
655
+ > [data-variant="secondary"]::after {
656
+ background: var(--field-edge);
657
+ }
658
+
659
+ /*
660
+ * A folded collapsible Button is a circle as tall as the button: padding of (height − 16px icon −
661
+ * 2px border) / 2 and corners of half the height. Unlayered on purpose: it has to win over the
662
+ * Button size utilities (px-3, rounded-button), and both move on --material-motion.
663
+ */
664
+ [data-slot="button"][data-collapsed] {
665
+ --collapsed-h: var(--control-h);
666
+ padding-inline: calc((var(--collapsed-h) - 1rem - 2px) / 2);
667
+ border-radius: calc(var(--collapsed-h) / 2);
668
+ }
669
+ [data-slot="button"][data-collapsed][data-size="sm"] {
670
+ --collapsed-h: var(--control-h-sm);
671
+ }
672
+ [data-slot="button"][data-collapsed][data-size="lg"] {
673
+ --collapsed-h: var(--control-h-lg);
674
+ }
675
+
676
+ /* An expandable Button opens to its size's padding and corners on hover or keyboard focus. */
677
+ @media (hover: hover) {
678
+ [data-slot="button"][data-expandable="label"][data-collapsed]:hover {
679
+ padding-inline: var(--expanded-pad, 1rem);
680
+ border-radius: var(--radius-button);
681
+ }
682
+ }
683
+ [data-slot="button"][data-expandable="label"][data-collapsed]:focus-visible {
684
+ padding-inline: var(--expanded-pad, 1rem);
685
+ border-radius: var(--radius-button);
686
+ }
687
+ [data-slot="button"][data-expandable="label"][data-size="sm"] {
688
+ --expanded-pad: 0.75rem;
689
+ }
690
+ [data-slot="button"][data-expandable="label"][data-size="lg"] {
691
+ --expanded-pad: 1.25rem;
692
+ }
693
+
694
+ /* ── Forced colours: on-states drawn with fills ──────────────────────────────
695
+ * A contrast theme (Windows) replaces fills with the page colour and drops shadows, which is how
696
+ * the material draws a chosen radio, an "on" switch, a slider's value, a pressed toggle and a
697
+ * status dot. Those marks take system colours instead; the focusable controls themselves keep
698
+ * the forced colours (and so their focus ring) and show "pressed" with a heavier edge. */
699
+ @media (forced-colors: active) {
700
+ [data-slot="radio-indicator"],
701
+ [data-slot="switch-thumb"],
702
+ [data-slot="slider-indicator"],
703
+ [data-slot="toggle-group-indicator"],
704
+ [data-slot="badge"][data-dot] {
705
+ forced-color-adjust: none;
706
+ }
707
+ [data-slot="radio-indicator"]::before,
708
+ [data-slot="switch-thumb"],
709
+ [data-slot="badge"][data-dot] {
710
+ background: CanvasText;
711
+ }
712
+ [data-slot="switch-thumb"][data-checked],
713
+ [data-slot="slider-indicator"] {
714
+ background: Highlight;
715
+ }
716
+ [data-slot="slider-thumb"] {
717
+ border: 2px solid;
718
+ }
719
+ [data-slot="toggle-group-indicator"] {
720
+ border: 2px solid Highlight;
721
+ }
722
+ :is([data-slot="toggle"], [data-slot="toggle-group-item"])[data-pressed] {
723
+ border-width: 2px;
724
+ }
725
+ }