@esportsplus/ui 0.59.0 → 0.61.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 (586) hide show
  1. package/.audit/audit.json +2810 -0
  2. package/.audit/check-scss.mjs +20 -0
  3. package/.audit/rules-audit.md +542 -0
  4. package/README.md +42 -31
  5. package/RULES.md +115 -0
  6. package/build/components/accordion/index.d.ts +12 -2175
  7. package/build/components/accordion/index.js +3 -4
  8. package/build/components/accordion/scss/index.scss +1 -1
  9. package/build/components/announcement/scss/index.scss +1 -1
  10. package/build/components/breadcrumb/index.js +47 -64
  11. package/build/components/breadcrumb/scss/index.scss +1 -1
  12. package/build/components/button/copy.d.ts +6 -4
  13. package/build/components/button/copy.js +24 -20
  14. package/build/components/button/faces.d.ts +0 -1
  15. package/build/components/button/faces.js +5 -6
  16. package/build/components/button/index.d.ts +3 -7
  17. package/build/components/button/index.js +3 -5
  18. package/build/components/button/kbd.d.ts +12 -8
  19. package/build/components/button/kbd.js +59 -74
  20. package/build/components/button/morph/index.d.ts +2169 -0
  21. package/build/components/button/morph/index.js +4 -0
  22. package/build/components/button/morph/save.d.ts +19 -0
  23. package/build/components/button/morph/save.js +57 -0
  24. package/build/components/button/morph/template.d.ts +22 -0
  25. package/build/components/button/morph/template.js +90 -0
  26. package/build/components/button/scss/index.scss +1 -1
  27. package/build/components/button/sidebar.js +2 -2
  28. package/build/components/button/split.d.ts +1 -1
  29. package/build/components/button/split.js +11 -15
  30. package/build/components/capslock/index.js +6 -5
  31. package/build/components/capslock/scss/index.scss +1 -1
  32. package/build/components/card/scss/index.scss +1 -1
  33. package/build/components/cc/index.js +103 -111
  34. package/build/components/cc/scss/index.scss +1 -1
  35. package/build/components/chat/index.d.ts +6 -0
  36. package/build/components/chat/index.js +3 -0
  37. package/build/components/chat/minimap/index.d.ts +52 -0
  38. package/build/components/chat/minimap/index.js +248 -0
  39. package/build/components/{chat-minimap/range.js → chat/minimap/model.js} +1 -1
  40. package/build/components/{chat-minimap → chat/minimap}/spy.d.ts +1 -1
  41. package/build/components/{chat-minimap → chat/minimap}/spy.js +1 -1
  42. package/build/components/checkbox/index.d.ts +1 -0
  43. package/build/components/checkbox/index.js +1 -0
  44. package/build/components/checkbox/options.d.ts +0 -1
  45. package/build/components/checkbox/options.js +0 -1
  46. package/build/components/checkbox/scss/index.scss +1 -1
  47. package/build/components/clipboard/index.d.ts +3 -2181
  48. package/build/components/clipboard/index.js +2 -3
  49. package/build/components/color-picker/index.d.ts +21 -0
  50. package/build/components/color-picker/index.js +153 -138
  51. package/build/components/color-picker/scss/index.scss +1 -1
  52. package/build/components/command/index.d.ts +6 -93
  53. package/build/components/command/index.js +4 -601
  54. package/build/components/command/palette.d.ts +103 -0
  55. package/build/components/command/palette.js +595 -0
  56. package/build/components/command/scss/index.scss +1 -1
  57. package/build/components/command/search.d.ts +37 -0
  58. package/build/components/command/search.js +67 -0
  59. package/build/components/counter/index.d.ts +15 -4
  60. package/build/components/counter/index.js +3 -2
  61. package/build/components/counter/scss/index.scss +1 -1
  62. package/build/components/datalist/scss/index.scss +1 -1
  63. package/build/components/dock/index.d.ts +24 -5
  64. package/build/components/dock/index.js +389 -51
  65. package/build/components/dock/scss/index.scss +1 -1
  66. package/build/components/editor/markdown/index.d.ts +3 -22
  67. package/build/components/editor/markdown/index.js +3 -30
  68. package/build/components/editor/markdown/render.js +3 -5
  69. package/build/components/editor/markdown/template.d.ts +22 -0
  70. package/build/components/editor/markdown/template.js +30 -0
  71. package/build/components/editor/tree/find.js +3 -3
  72. package/build/components/editor/tree/index.d.ts +3 -116
  73. package/build/components/editor/tree/index.js +3 -2225
  74. package/build/components/editor/tree/template.d.ts +116 -0
  75. package/build/components/editor/tree/template.js +2225 -0
  76. package/build/components/editor/viewer/index.d.ts +3 -26
  77. package/build/components/editor/viewer/index.js +3 -249
  78. package/build/components/editor/viewer/template.d.ts +26 -0
  79. package/build/components/editor/viewer/template.js +249 -0
  80. package/build/components/editor/workspace/index.d.ts +4 -65
  81. package/build/components/editor/workspace/index.js +4 -1228
  82. package/build/components/editor/workspace/model.d.ts +29 -37
  83. package/build/components/editor/workspace/model.js +186 -155
  84. package/build/components/editor/workspace/session.d.ts +3 -0
  85. package/build/components/editor/workspace/session.js +61 -34
  86. package/build/components/editor/workspace/shortcuts.d.ts +0 -2
  87. package/build/components/editor/workspace/shortcuts.js +0 -2
  88. package/build/components/editor/workspace/status.d.ts +4 -5
  89. package/build/components/editor/workspace/status.js +79 -61
  90. package/build/components/editor/workspace/statusbar.d.ts +5 -3
  91. package/build/components/editor/workspace/statusbar.js +66 -80
  92. package/build/components/editor/workspace/strip.d.ts +1 -2
  93. package/build/components/editor/workspace/strip.js +4 -3
  94. package/build/components/editor/workspace/tabs.d.ts +35 -3
  95. package/build/components/editor/workspace/tabs.js +75 -13
  96. package/build/components/editor/workspace/template.d.ts +65 -0
  97. package/build/components/editor/workspace/template.js +1145 -0
  98. package/build/components/error/scss/index.scss +1 -1
  99. package/build/components/filter/index.js +0 -3
  100. package/build/components/filter/scss/index.scss +1 -1
  101. package/build/components/form/index.d.ts +6 -32
  102. package/build/components/form/index.js +2 -1
  103. package/build/components/frame/scss/index.scss +1 -1
  104. package/build/components/grid/scss/index.scss +1 -1
  105. package/build/components/group/index.d.ts +12 -0
  106. package/build/components/group/index.js +15 -0
  107. package/build/components/group/scss/index.scss +2 -0
  108. package/build/components/heatmap/index.js +10 -32
  109. package/build/components/heatmap/scss/index.scss +1 -1
  110. package/build/components/highlight/index.d.ts +2 -3
  111. package/build/components/highlight/index.js +79 -78
  112. package/build/components/highlight/scss/index.scss +1 -1
  113. package/build/components/icon/index.d.ts +4 -3
  114. package/build/components/icon/index.js +2 -1
  115. package/build/components/icon/scss/index.scss +1 -1
  116. package/build/components/image/index.d.ts +3 -16
  117. package/build/components/image/index.js +2 -2
  118. package/build/components/image/scss/index.scss +1 -1
  119. package/build/components/index.d.ts +6 -4
  120. package/build/components/index.js +6 -4
  121. package/build/components/inline-edit/index.js +5 -4
  122. package/build/components/inline-edit/rich.js +79 -82
  123. package/build/components/inline-edit/scss/index.scss +1 -1
  124. package/build/components/inline-edit/status.js +4 -3
  125. package/build/components/input/scss/index.scss +1 -1
  126. package/build/components/input/tag.js +84 -67
  127. package/build/components/json/index.d.ts +4 -3
  128. package/build/components/json/index.js +2 -1
  129. package/build/components/link/scss/index.scss +1 -1
  130. package/build/components/loading/scss/index.scss +1 -1
  131. package/build/components/marquee/index.js +74 -71
  132. package/build/components/marquee/scss/index.scss +1 -1
  133. package/build/components/metric/flash.js +12 -11
  134. package/build/components/metric/scss/index.scss +1 -1
  135. package/build/components/nav/index.d.ts +1 -1
  136. package/build/components/nav/scss/index.scss +1 -1
  137. package/build/components/nav/toc.d.ts +8 -13
  138. package/build/components/nav/toc.js +9 -21
  139. package/build/components/nav/tree.d.ts +13 -14
  140. package/build/components/nav/tree.js +32 -19
  141. package/build/components/notification/index.d.ts +14 -3
  142. package/build/components/notification/index.js +4 -3
  143. package/build/components/notification/scss/index.scss +1 -1
  144. package/build/components/overlay/scss/index.scss +1 -1
  145. package/build/components/page/scss/index.scss +1 -1
  146. package/build/components/pagination/cards.d.ts +1 -0
  147. package/build/components/pagination/cards.js +4 -6
  148. package/build/components/pagination/scss/index.scss +1 -1
  149. package/build/components/panels/dnd.d.ts +47 -0
  150. package/build/components/panels/dnd.js +106 -0
  151. package/build/components/panels/group.d.ts +35 -0
  152. package/build/components/panels/group.js +319 -0
  153. package/build/components/panels/index.d.ts +25 -0
  154. package/build/components/panels/index.js +520 -0
  155. package/build/components/panels/model.d.ts +64 -0
  156. package/build/components/panels/model.js +446 -0
  157. package/build/components/panels/resize.d.ts +9 -0
  158. package/build/components/panels/resize.js +87 -0
  159. package/build/components/panels/scss/index.scss +2 -0
  160. package/build/components/panels/subtree.d.ts +3 -0
  161. package/build/components/panels/subtree.js +43 -0
  162. package/build/components/preview/buttons.d.ts +20 -0
  163. package/build/components/preview/buttons.js +26 -0
  164. package/build/components/{copy/index.d.ts → preview/code.d.ts} +3 -9
  165. package/build/components/preview/code.js +18 -0
  166. package/build/components/preview/header.d.ts +16 -0
  167. package/build/components/preview/header.js +18 -0
  168. package/build/components/preview/index.d.ts +8704 -0
  169. package/build/components/preview/index.js +123 -0
  170. package/build/components/preview/scss/index.scss +2 -0
  171. package/build/components/preview/source.d.ts +21 -0
  172. package/build/components/preview/source.js +76 -0
  173. package/build/components/preview/stage.d.ts +16 -0
  174. package/build/components/preview/stage.js +24 -0
  175. package/build/components/progress/scss/index.scss +1 -1
  176. package/build/components/progress/text.js +9 -11
  177. package/build/components/radio/index.d.ts +3 -2
  178. package/build/components/radio/index.js +2 -2
  179. package/build/components/range/filter.js +8 -9
  180. package/build/components/range/scss/index.scss +1 -1
  181. package/build/components/relative-time/index.js +4 -7
  182. package/build/components/relative-time/scss/index.scss +1 -1
  183. package/build/components/root/scss/index.scss +1 -1
  184. package/build/components/select/index.d.ts +1 -1
  185. package/build/components/select/index.js +72 -59
  186. package/build/components/select/scss/index.scss +1 -1
  187. package/build/components/shell/index.d.ts +22 -0
  188. package/build/components/shell/index.js +272 -0
  189. package/build/components/shell/scss/index.scss +2 -0
  190. package/build/components/shortcut-recorder/index.d.ts +2 -3
  191. package/build/components/shortcut-recorder/index.js +3 -1
  192. package/build/components/shortcut-recorder/scss/index.scss +1 -1
  193. package/build/components/sortable/scss/index.scss +1 -1
  194. package/build/components/sticky-header/scss/index.scss +1 -1
  195. package/build/components/story/index.d.ts +10 -6
  196. package/build/components/story/index.js +27 -47
  197. package/build/components/story/scss/index.scss +1 -1
  198. package/build/components/surface-field/index.js +13 -16
  199. package/build/components/surface-field/scss/index.scss +1 -1
  200. package/build/components/switch/index.d.ts +3 -2
  201. package/build/components/switch/index.js +2 -2
  202. package/build/components/tasklist/index.js +3 -1
  203. package/build/components/tasklist/scss/index.scss +1 -1
  204. package/build/components/textarea/scss/index.scss +1 -1
  205. package/build/components/theme/index.d.ts +6 -2
  206. package/build/components/theme/index.js +4 -3
  207. package/build/components/theme/scss/index.scss +1 -1
  208. package/build/components/theme-picker/cards.d.ts +13 -0
  209. package/build/components/theme-picker/cards.js +17 -0
  210. package/build/components/theme-picker/index.d.ts +9 -49
  211. package/build/components/theme-picker/index.js +5 -165
  212. package/build/components/theme-picker/scss/index.scss +1 -1
  213. package/build/components/theme-picker/shared.d.ts +26 -0
  214. package/build/components/theme-picker/shared.js +24 -0
  215. package/build/components/theme-picker/swatches.d.ts +13 -0
  216. package/build/components/theme-picker/swatches.js +17 -0
  217. package/build/components/theme-picker/toggle.d.ts +19 -0
  218. package/build/components/theme-picker/toggle.js +109 -0
  219. package/build/components/toast/index.js +10 -10
  220. package/build/components/toast/scss/index.scss +1 -1
  221. package/build/components/tooltip/menu.d.ts +2 -0
  222. package/build/components/tooltip/menu.js +88 -45
  223. package/build/components/tooltip/scss/index.scss +1 -1
  224. package/build/components/tooltip/shared.js +2 -2
  225. package/build/components/typewriter/rotate.js +7 -16
  226. package/build/components/typewriter/scss/index.scss +1 -1
  227. package/build/components/uptime/index.js +26 -33
  228. package/build/components/uptime/scss/index.scss +1 -1
  229. package/build/components/usage-meter/scss/index.scss +1 -1
  230. package/build/modifiers/background/scss/index.scss +2 -0
  231. package/build/modifiers/border/scss/index.scss +2 -0
  232. package/build/modifiers/box-shadow/scss/index.scss +2 -0
  233. package/build/modifiers/color/scss/index.scss +2 -0
  234. package/build/modifiers/scrollbar/scss/index.scss +1 -1
  235. package/build/shared/animation.js +1 -1
  236. package/build/shared/drag.d.ts +2 -1
  237. package/build/shared/drag.js +4 -3
  238. package/package.json +8 -8
  239. package/scripts/code-editor-services.test.mjs +1 -1
  240. package/scripts/code-editor-workspace.test.mjs +28 -18
  241. package/scripts/panels.test.mjs +262 -0
  242. package/scripts/workspace-keybindings.test.mjs +1 -1
  243. package/scripts/workspace-session.test.mjs +8 -6
  244. package/scripts/workspace-status.test.mjs +9 -1
  245. package/scripts/workspace-tabs.test.mjs +5 -5
  246. package/src/components/accordion/index.ts +11 -8
  247. package/src/components/accordion/scss/index.scss +15 -15
  248. package/src/components/accordion/scss/variables.scss +11 -7
  249. package/src/components/announcement/scss/index.scss +21 -24
  250. package/src/components/announcement/scss/variables.scss +13 -7
  251. package/src/components/breadcrumb/index.ts +8 -10
  252. package/src/components/breadcrumb/scss/index.scss +48 -122
  253. package/src/components/breadcrumb/scss/variables.scss +73 -55
  254. package/src/components/button/copy.ts +34 -27
  255. package/src/components/button/faces.ts +2 -4
  256. package/src/components/button/index.ts +3 -7
  257. package/src/components/button/kbd.ts +37 -95
  258. package/src/components/button/morph/index.ts +6 -0
  259. package/src/components/button/morph/save.ts +55 -0
  260. package/src/components/button/morph/template.ts +135 -0
  261. package/src/components/button/scss/index.scss +218 -99
  262. package/src/components/button/scss/variables.scss +160 -115
  263. package/src/components/button/sidebar.ts +6 -6
  264. package/src/components/button/split.ts +5 -6
  265. package/src/components/capslock/index.ts +9 -8
  266. package/src/components/capslock/scss/index.scss +21 -25
  267. package/src/components/capslock/scss/variables.scss +31 -12
  268. package/src/components/card/scss/index.scss +9 -24
  269. package/src/components/card/scss/variables.scss +29 -76
  270. package/src/components/cc/index.ts +15 -10
  271. package/src/components/cc/scss/index.scss +110 -153
  272. package/src/components/cc/scss/variables.scss +231 -44
  273. package/src/components/chat/index.ts +10 -0
  274. package/src/components/{chat-minimap → chat/minimap}/index.ts +66 -21
  275. package/src/components/{chat-minimap → chat/minimap}/scss/index.scss +26 -54
  276. package/src/components/chat/minimap/scss/variables.scss +178 -0
  277. package/src/components/{chat-minimap → chat/minimap}/spy.ts +1 -1
  278. package/src/components/checkbox/index.ts +1 -0
  279. package/src/components/checkbox/options.ts +0 -1
  280. package/src/components/checkbox/scss/index.scss +25 -31
  281. package/src/components/checkbox/scss/variables.scss +50 -19
  282. package/src/components/clipboard/index.ts +4 -3
  283. package/src/components/color-picker/index.ts +131 -67
  284. package/src/components/color-picker/scss/index.scss +138 -221
  285. package/src/components/color-picker/scss/variables.scss +228 -81
  286. package/src/components/command/index.ts +5 -860
  287. package/src/components/command/palette.ts +879 -0
  288. package/src/components/command/scss/index.scss +82 -99
  289. package/src/components/command/scss/variables.scss +129 -50
  290. package/src/components/command/search.ts +67 -0
  291. package/src/components/counter/index.ts +90 -85
  292. package/src/components/counter/scss/index.scss +32 -41
  293. package/src/components/counter/scss/variables.scss +44 -16
  294. package/src/components/datalist/scss/index.scss +25 -25
  295. package/src/components/datalist/scss/variables.scss +21 -11
  296. package/src/components/dock/index.ts +505 -42
  297. package/src/components/dock/scss/index.scss +318 -73
  298. package/src/components/dock/scss/variables.scss +310 -39
  299. package/src/components/editor/code/features.ts +0 -1
  300. package/src/components/editor/code/find.ts +0 -1
  301. package/src/components/editor/code/keymap.ts +0 -1
  302. package/src/components/editor/code/scss/_editor.scss +12 -31
  303. package/src/components/editor/code/scss/_features.scss +12 -45
  304. package/src/components/editor/code/scss/_services.scss +15 -23
  305. package/src/components/editor/code/scss/index.scss +1 -1
  306. package/src/components/editor/code/scss/variables.scss +195 -42
  307. package/src/components/editor/code/view.ts +0 -1
  308. package/src/components/editor/diffs/scss/_diffs.scss +24 -77
  309. package/src/components/editor/diffs/scss/_merge.scss +5 -16
  310. package/src/components/editor/diffs/scss/index.scss +1 -1
  311. package/src/components/editor/diffs/scss/variables.scss +148 -11
  312. package/src/components/editor/markdown/index.ts +3 -67
  313. package/src/components/editor/markdown/render.ts +3 -6
  314. package/src/components/editor/markdown/scss/index.scss +30 -48
  315. package/src/components/editor/markdown/scss/variables.scss +117 -32
  316. package/src/components/editor/markdown/template.ts +69 -0
  317. package/src/components/editor/tree/drag.ts +5 -2
  318. package/src/components/editor/tree/find.ts +5 -4
  319. package/src/components/editor/tree/index.ts +3 -3434
  320. package/src/components/editor/tree/scss/index.scss +204 -262
  321. package/src/components/editor/tree/scss/variables.scss +198 -31
  322. package/src/components/editor/tree/template.ts +3436 -0
  323. package/src/components/editor/viewer/index.ts +3 -318
  324. package/src/components/editor/viewer/scss/_viewer.scss +15 -31
  325. package/src/components/editor/viewer/scss/index.scss +1 -1
  326. package/src/components/editor/viewer/scss/variables.scss +56 -14
  327. package/src/components/editor/viewer/template.ts +321 -0
  328. package/src/components/editor/workspace/index.ts +4 -1480
  329. package/src/components/editor/workspace/model.ts +225 -185
  330. package/src/components/editor/workspace/scss/_keybindings.scss +163 -0
  331. package/src/components/editor/workspace/scss/{status.scss → _status.scss} +11 -44
  332. package/src/components/editor/workspace/scss/_tabs.scss +57 -0
  333. package/src/components/editor/workspace/scss/index.scss +82 -312
  334. package/src/components/editor/workspace/scss/variables.scss +427 -0
  335. package/src/components/editor/workspace/session.ts +80 -44
  336. package/src/components/editor/workspace/shortcuts.ts +0 -2
  337. package/src/components/editor/workspace/status.ts +110 -80
  338. package/src/components/editor/workspace/statusbar.ts +38 -35
  339. package/src/components/editor/workspace/strip.ts +6 -5
  340. package/src/components/editor/workspace/tabs.ts +115 -15
  341. package/src/components/editor/workspace/template.ts +1486 -0
  342. package/src/components/error/index.ts +3 -0
  343. package/src/components/error/scss/index.scss +34 -65
  344. package/src/components/error/scss/variables.scss +28 -9
  345. package/src/components/filter/index.ts +2 -6
  346. package/src/components/filter/scss/index.scss +9 -2
  347. package/src/components/filter/scss/variables.scss +6 -6
  348. package/src/components/form/index.ts +4 -1
  349. package/src/components/frame/scss/index.scss +31 -42
  350. package/src/components/frame/scss/variables.scss +25 -18
  351. package/src/components/grid/scss/index.scss +2 -1
  352. package/src/components/group/index.ts +24 -0
  353. package/src/components/group/scss/index.scss +6 -0
  354. package/src/components/group/scss/variables.scss +4 -0
  355. package/src/components/heatmap/index.ts +14 -44
  356. package/src/components/heatmap/scss/index.scss +38 -44
  357. package/src/components/heatmap/scss/variables.scss +100 -59
  358. package/src/components/highlight/index.ts +133 -119
  359. package/src/components/highlight/scss/index.scss +49 -43
  360. package/src/components/highlight/scss/variables.scss +71 -30
  361. package/src/components/icon/index.ts +7 -5
  362. package/src/components/icon/scss/index.scss +7 -2
  363. package/src/components/icon/scss/variables.scss +2 -0
  364. package/src/components/image/index.ts +4 -2
  365. package/src/components/image/scss/index.scss +14 -22
  366. package/src/components/image/scss/variables.scss +30 -15
  367. package/src/components/index.ts +6 -4
  368. package/src/components/inline-edit/index.ts +3 -2
  369. package/src/components/inline-edit/rich.ts +17 -15
  370. package/src/components/inline-edit/scss/index.scss +165 -254
  371. package/src/components/inline-edit/scss/variables.scss +311 -83
  372. package/src/components/inline-edit/status.ts +2 -1
  373. package/src/components/input/scrub.ts +1 -1
  374. package/src/components/input/scss/_field.scss +1 -1
  375. package/src/components/input/scss/_scrub.scss +14 -25
  376. package/src/components/input/scss/_tag.scss +26 -46
  377. package/src/components/input/scss/variables.scss +167 -77
  378. package/src/components/input/tag.ts +59 -49
  379. package/src/components/json/index.ts +4 -1
  380. package/src/components/link/scss/index.scss +1 -4
  381. package/src/components/link/scss/variables.scss +5 -1
  382. package/src/components/loading/scss/index.scss +3 -23
  383. package/src/components/loading/scss/variables.scss +3 -6
  384. package/src/components/marquee/index.ts +33 -28
  385. package/src/components/marquee/scss/index.scss +32 -26
  386. package/src/components/marquee/scss/variables.scss +35 -23
  387. package/src/components/metric/flash.ts +2 -1
  388. package/src/components/metric/scss/_flash.scss +125 -145
  389. package/src/components/metric/scss/index.scss +31 -43
  390. package/src/components/metric/scss/variables.scss +192 -98
  391. package/src/components/nav/index.ts +1 -1
  392. package/src/components/nav/scss/index.scss +46 -49
  393. package/src/components/nav/scss/variables.scss +61 -64
  394. package/src/components/nav/spy.ts +2 -0
  395. package/src/components/nav/toc.ts +11 -31
  396. package/src/components/nav/tree.ts +56 -24
  397. package/src/components/notification/index.ts +94 -89
  398. package/src/components/notification/scss/index.scss +77 -76
  399. package/src/components/notification/scss/variables.scss +55 -38
  400. package/src/components/overlay/index.ts +3 -1
  401. package/src/components/overlay/scss/index.scss +94 -114
  402. package/src/components/overlay/scss/variables.scss +46 -18
  403. package/src/components/page/scss/variables.scss +1 -1
  404. package/src/components/pagination/cards.ts +2 -1
  405. package/src/components/pagination/scss/index.scss +191 -7
  406. package/src/components/pagination/scss/variables.scss +112 -36
  407. package/src/components/panels/dnd.ts +184 -0
  408. package/src/components/panels/group.ts +437 -0
  409. package/src/components/panels/index.ts +678 -0
  410. package/src/components/panels/model.ts +675 -0
  411. package/src/components/panels/resize.ts +131 -0
  412. package/src/components/panels/scss/index.scss +394 -0
  413. package/src/components/panels/scss/variables.scss +197 -0
  414. package/src/components/panels/subtree.ts +65 -0
  415. package/src/components/preview/buttons.ts +48 -0
  416. package/src/components/preview/code.ts +28 -0
  417. package/src/components/preview/header.ts +23 -0
  418. package/src/components/preview/index.ts +144 -0
  419. package/src/components/preview/scss/index.scss +143 -0
  420. package/src/components/preview/scss/variables.scss +127 -0
  421. package/src/components/preview/source.ts +73 -0
  422. package/src/components/preview/stage.ts +33 -0
  423. package/src/components/progress/scss/index.scss +117 -15
  424. package/src/components/progress/scss/variables.scss +140 -40
  425. package/src/components/progress/text.ts +5 -4
  426. package/src/components/radio/index.ts +2 -4
  427. package/src/components/range/filter.ts +7 -11
  428. package/src/components/range/scss/_filter.scss +301 -327
  429. package/src/components/range/scss/_slider.scss +31 -110
  430. package/src/components/range/scss/_vertical.scss +8 -20
  431. package/src/components/range/scss/index.scss +1 -4
  432. package/src/components/range/scss/variables.scss +374 -70
  433. package/src/components/relative-time/index.ts +9 -14
  434. package/src/components/relative-time/scss/index.scss +13 -21
  435. package/src/components/relative-time/scss/variables.scss +46 -29
  436. package/src/components/root/scss/index.scss +11 -20
  437. package/src/components/root/scss/variables.scss +17 -15
  438. package/src/components/select/index.ts +37 -15
  439. package/src/components/select/scss/index.scss +24 -51
  440. package/src/components/select/scss/variables.scss +77 -19
  441. package/src/components/shell/index.ts +321 -0
  442. package/src/components/shell/scss/index.scss +214 -0
  443. package/src/components/shell/scss/variables.scss +89 -0
  444. package/src/components/shortcut-recorder/index.ts +6 -3
  445. package/src/components/shortcut-recorder/scss/index.scss +71 -56
  446. package/src/components/shortcut-recorder/scss/variables.scss +47 -21
  447. package/src/components/sortable/index.ts +1 -0
  448. package/src/components/sortable/scss/index.scss +37 -42
  449. package/src/components/sortable/scss/variables.scss +76 -52
  450. package/src/components/sticky-header/scss/index.scss +11 -10
  451. package/src/components/sticky-header/scss/variables.scss +36 -4
  452. package/src/components/story/index.ts +1 -36
  453. package/src/components/story/scss/index.scss +22 -98
  454. package/src/components/story/scss/variables.scss +57 -15
  455. package/src/components/surface-field/index.ts +18 -20
  456. package/src/components/surface-field/scss/index.scss +32 -46
  457. package/src/components/surface-field/scss/variables.scss +92 -23
  458. package/src/components/switch/index.ts +2 -4
  459. package/src/components/tasklist/index.ts +8 -2
  460. package/src/components/tasklist/scss/index.scss +7 -7
  461. package/src/components/tasklist/scss/variables.scss +18 -13
  462. package/src/components/textarea/index.ts +1 -0
  463. package/src/components/textarea/scss/index.scss +9 -7
  464. package/src/components/textarea/scss/variables.scss +2 -2
  465. package/src/components/theme/index.ts +12 -4
  466. package/src/components/theme/scss/index.scss +13 -0
  467. package/src/components/theme/scss/variables.scss +5 -16
  468. package/src/components/theme-picker/cards.ts +19 -0
  469. package/src/components/theme-picker/index.ts +6 -225
  470. package/src/components/theme-picker/scss/index.scss +77 -167
  471. package/src/components/theme-picker/scss/variables.scss +220 -0
  472. package/src/components/theme-picker/shared.ts +54 -0
  473. package/src/components/theme-picker/swatches.ts +15 -0
  474. package/src/components/theme-picker/toggle.ts +150 -0
  475. package/src/components/toast/index.ts +14 -14
  476. package/src/components/toast/scss/index.scss +130 -155
  477. package/src/components/toast/scss/variables.scss +89 -52
  478. package/src/components/tooltip/menu.ts +77 -10
  479. package/src/components/tooltip/scss/_menu.scss +96 -138
  480. package/src/components/tooltip/scss/_shared.scss +93 -90
  481. package/src/components/tooltip/scss/index.scss +52 -54
  482. package/src/components/tooltip/scss/variables.scss +187 -67
  483. package/src/components/tooltip/shared.ts +8 -6
  484. package/src/components/typewriter/rotate.ts +15 -24
  485. package/src/components/typewriter/scss/index.scss +131 -3
  486. package/src/components/typewriter/scss/variables.scss +56 -44
  487. package/src/components/uptime/index.ts +1 -13
  488. package/src/components/uptime/scss/index.scss +28 -66
  489. package/src/components/uptime/scss/variables.scss +63 -48
  490. package/src/components/usage-meter/scss/index.scss +19 -19
  491. package/src/components/usage-meter/scss/variables.scss +80 -35
  492. package/src/css-utilities/absolute.scss +54 -52
  493. package/src/css-utilities/background.scss +22 -24
  494. package/src/css-utilities/border.scss +21 -21
  495. package/src/css-utilities/box-shadow.scss +32 -21
  496. package/src/css-utilities/color.scss +23 -21
  497. package/src/css-utilities/flex.scss +55 -53
  498. package/src/css-utilities/group.scss +7 -0
  499. package/src/css-utilities/hidden.scss +22 -20
  500. package/src/css-utilities/icon.scss +32 -30
  501. package/src/css-utilities/layer.scss +10 -10
  502. package/src/css-utilities/reset.scss +27 -16
  503. package/src/css-utilities/surface.scss +206 -128
  504. package/src/css-utilities/text.scss +114 -114
  505. package/src/modifiers/background/scss/index.scss +1 -0
  506. package/src/modifiers/background/scss/variables.scss +24 -0
  507. package/src/modifiers/border/scss/index.scss +1 -0
  508. package/src/modifiers/border/scss/variables.scss +21 -0
  509. package/src/modifiers/box-shadow/scss/index.scss +1 -0
  510. package/src/modifiers/box-shadow/scss/variables.scss +12 -0
  511. package/src/modifiers/color/scss/index.scss +1 -0
  512. package/src/modifiers/color/scss/variables.scss +10 -0
  513. package/src/modifiers/scrollbar/scss/index.scss +3 -2
  514. package/src/modifiers/scrollbar/scss/variables.scss +4 -3
  515. package/src/shared/animation.ts +3 -3
  516. package/src/shared/drag.ts +8 -3
  517. package/src/tokens/scss/color.scss +53 -37
  518. package/src/tokens/scss/index.scss +0 -1
  519. package/src/tokens/scss/state.scss +16 -1
  520. package/storage/svg/code.svg +1 -1
  521. package/storage/svg/collapse.svg +1 -0
  522. package/storage/svg/grid.svg +1 -0
  523. package/storage/svg/stack.svg +1 -0
  524. package/build/components/banner/scss/index.scss +0 -2
  525. package/build/components/button/fan.d.ts +0 -24
  526. package/build/components/button/fan.js +0 -118
  527. package/build/components/button/hold.d.ts +0 -31
  528. package/build/components/button/hold.js +0 -115
  529. package/build/components/button/icons.d.ts +0 -6
  530. package/build/components/button/icons.js +0 -35
  531. package/build/components/button/loading.d.ts +0 -22
  532. package/build/components/button/loading.js +0 -60
  533. package/build/components/button/morph.d.ts +0 -22
  534. package/build/components/button/morph.js +0 -115
  535. package/build/components/card/expand.d.ts +0 -22
  536. package/build/components/card/expand.js +0 -118
  537. package/build/components/card/index.d.ts +0 -6
  538. package/build/components/card/index.js +0 -4
  539. package/build/components/chat-minimap/index.d.ts +0 -28
  540. package/build/components/chat-minimap/index.js +0 -223
  541. package/build/components/chat-minimap/scss/index.scss +0 -2
  542. package/build/components/clipboard/copy.d.ts +0 -27
  543. package/build/components/clipboard/copy.js +0 -48
  544. package/build/components/copy/index.js +0 -61
  545. package/build/components/copy/scss/index.scss +0 -2
  546. package/build/components/highlight/easing.d.ts +0 -2
  547. package/build/components/highlight/easing.js +0 -19
  548. package/build/components/pull-to-refresh/index.d.ts +0 -18
  549. package/build/components/pull-to-refresh/index.js +0 -222
  550. package/build/components/pull-to-refresh/scss/index.scss +0 -2
  551. package/src/components/banner/scss/index.scss +0 -37
  552. package/src/components/banner/scss/variables.scss +0 -16
  553. package/src/components/button/fan.ts +0 -170
  554. package/src/components/button/hold.ts +0 -154
  555. package/src/components/button/icons.ts +0 -21
  556. package/src/components/button/loading.ts +0 -77
  557. package/src/components/button/morph.ts +0 -153
  558. package/src/components/button/scss/_fan.scss +0 -121
  559. package/src/components/button/scss/_kbd.scss +0 -11
  560. package/src/components/button/scss/_morph.scss +0 -107
  561. package/src/components/button/scss/_sidebar.scss +0 -61
  562. package/src/components/button/scss/_split.scss +0 -53
  563. package/src/components/card/expand.ts +0 -141
  564. package/src/components/card/index.ts +0 -8
  565. package/src/components/card/scss/_expand.scss +0 -234
  566. package/src/components/chat-minimap/scss/variables.scss +0 -97
  567. package/src/components/clipboard/copy.ts +0 -49
  568. package/src/components/copy/index.ts +0 -69
  569. package/src/components/copy/scss/index.scss +0 -52
  570. package/src/components/copy/scss/variables.scss +0 -19
  571. package/src/components/editor/workspace/scss/keybindings.scss +0 -190
  572. package/src/components/editor/workspace/scss/tabs.scss +0 -56
  573. package/src/components/highlight/easing.ts +0 -33
  574. package/src/components/pagination/scss/_arrows.scss +0 -69
  575. package/src/components/pagination/scss/_cards.scss +0 -121
  576. package/src/components/pagination/scss/_dots.scss +0 -64
  577. package/src/components/progress/scss/_text.scss +0 -135
  578. package/src/components/pull-to-refresh/index.ts +0 -316
  579. package/src/components/pull-to-refresh/scss/index.scss +0 -128
  580. package/src/components/pull-to-refresh/scss/variables.scss +0 -38
  581. package/src/components/typewriter/scss/_caret.scss +0 -34
  582. package/src/components/typewriter/scss/_retype.scss +0 -68
  583. package/src/components/typewriter/scss/_rotate.scss +0 -29
  584. package/src/tokens/scss/transition.scss +0 -21
  585. /package/build/components/{chat-minimap/range.d.ts → chat/minimap/model.d.ts} +0 -0
  586. /package/src/components/{chat-minimap/range.ts → chat/minimap/model.ts} +0 -0
package/README.md CHANGED
@@ -63,30 +63,27 @@ html`
63
63
  | `tasklist` | Checklist that strikes through checked tasks and moves them below the open ones; `ordered` keeps both groups in task order, `sortable` lets rows be dragged within their group | `tasklist.checkbox`, `tasklist.content`, `tasklist.description`, `tasklist.item`, `tasklist.label`, `tasklist.row` |
64
64
  | `form` | Form wrapper | `form.action`, `form.input` |
65
65
  | `cc` | Payment card form (`input` fields) with a live card preview that flips for the CVC, brand detection, caret-safe formatting and Luhn/expiry validation; `onvalid` receives brand, last 4, expiry and name | `cc.field`, `cc.submit` |
66
- | `colorPicker` | Saturation pad, hue/opacity sliders (`range`), hex field (`input`) with a `copy` button, and an animated recent-colors row (hidden while empty; `recent: false` leaves it out entirely); `value` is required, no surface of its own, so place it in a `card` | `colorPicker.swatch` |
66
+ | `colorPicker` | Saturation pad, hue/opacity sliders (`range`), hex field (`input`) with a `button.copy`, and an animated recent-colors row (hidden while empty; `recent: false` leaves it out entirely); `value` is required, no surface of its own, so place it in a `card` | `colorPicker.swatch` |
67
67
  | `inlineEdit` | Click-to-edit text that swaps in an `input` (or `textarea` with `multiline`) without moving a glyph; Enter/blur saves, Escape cancels, `onsave` fires. `inlineEdit.rich` edits markdown in place as a controlled editor: the text is a document of blocks and marks rendered by the template, every input (typing, deleting, Enter, formatting, paste, drop, an input method's composition) changes that document rather than the DOM, and it keeps its own undo/redo (Mod+Z, Mod+Shift+Z/Mod+Y). `features` whitelists what each field allows (bold, italic, strike, code, highlight, link, heading, quote, codeblock, bullet, ordered, task, clear, copy), and only those appear in its selection toolbar, shortcuts, pastes and saved markdown. `status: true` (or a `{ phase, savedAt }` object to read or drive it) shows the save status under either field: unsaved while the edit differs, saving while a promise returned by `onsave` is pending, then saved, rolling to "Saved 3 min ago" | `inlineEdit.display`, `inlineEdit.field`, `inlineEdit.status`, `inlineEdit.rich.editor`, `inlineEdit.rich.status`, `inlineEdit.rich.toolbar`, `inline-edit--seamless` |
68
68
 
69
69
  ### Interactive
70
70
  | Component | Description | Variants |
71
71
  |-----------|-------------|----------|
72
- | `button` | Standard button; `button.hold` confirms on a press-and-hold, inverting the whole button as it fills, or only the label with `button--hold-text` (`--fill-color`); `button.morph` is an async save (`onsave`) that morphs into a spinner circle, confirms with a check and shakes on failure, with `--morph-background` for its colour | `button.fan`, `button.hold`, `button.morph`, `button--hold-text` |
73
- | `tooltip` | Popup content; `tooltip.onhover` also opens on keyboard focus and closes on Escape, and `tooltip.onhover.trigger({ delay, state })` is the same behaviour to spread on your own `.tooltip` element; `delay: { open?, close? }` (ms, on `tooltip.onhover` and `tooltip.shared`; each left out is instant) holds the pointer before opening and after leaving, and for 500ms after a delayed tooltip closes the next opens at once, without its entrance; `tooltip.menu` is a keyboard menu (arrows, Home/End, Escape returns focus, Tab closes) that closes once an option is chosen; `tooltip.nestedMenu({ animate, items, onnavigate, state })` is a drill-down menu whose `items` nest to any depth: a branch's panel grows out of its row over the dimmed parent, and its header or the parent's scrim goes back; arrows/Home/End move, Right/Left drill and return, Escape goes back a level then closes (`animate: false` skips the motion, `tooltip.nestedMenu.trigger` styles the button); `tooltip.shared({ delay, direction, dismiss, interactive, keep, state })` is one tooltip for any number of triggers: spread `tip.bind(content)` on a trigger (a string, or a function returning a template, rendered on every open unless `keep`), or `tip.delegate({ content, edge, selector })` on a container to make every matching descendant a trigger (default `[data-tooltip]`, its value the content; `edge` lines the tooltip up past the container's edge), and place `tip.render(attributes)` once; it opens in the top layer beside the trigger, flips when out of room, and glides between triggers while its content slides in the direction of travel; `interactive` makes it a card the pointer can enter, toggled by taps and keys, with Tab carried into it; `keep` mounts each bound trigger's content on its first open and keeps it for reopening until that trigger unmounts; `dismiss` is a selector whose clicks inside close it (`'a[href]'` for navigation); `state.active` is whether it is open and `state.index` which bound trigger, numbered in `bind()` order (-1 for none), and setting it opens that trigger | `tooltip.context`, `tooltip.menu`, `tooltip.nestedMenu`, `tooltip.onclick`, `tooltip.onhover`, `tooltip.onhover.trigger`, `tooltip.shared` |
72
+ | `button` | Standard button, filled by `button--black`, `button--primary` (the theme's ink, lettered in the page color), `button--surface` (its raised surface), `button--surface-primary` or `button--white`; `button.copy` is an icon button copying `value` (a string or a function read on click) whose copy icon turns into a check that draws in, then back after `timeout` ms (default `3000`), with `label`, `success` and `error` as its accessible name per state; `button.faces(status, faces)` stacks keyed faces in one grid cell and shows the one whose `key` matches `status()`; `button.morph` runs an async `onaction` through idle, loading, success and error, carrying the status as a `button--morph-{status}` class (also readable through a passed `state`), collapsing to a circle while `compact(status)` holds (default: loading and success), shaking on error and announcing `announce[status]`; its content is yours, layered with `button-morph-text` (mark the shown one `--active`) and `button-morph-icon--loading` / `--success`; `button.morph.save` is the ready-made save (`onsave`, `label`, `retryLabel`) that morphs into a spinner circle and confirms with a check, coloured by its `--background-default` | `button.copy`, `button.faces`, `button.morph`, `button.morph.save`, `button--black`, `button--primary`, `button--surface`, `button--surface-primary`, `button--white` |
73
+ | `tooltip` | Popup content; `tooltip.onhover` also opens on keyboard focus and closes on Escape, and `tooltip.onhover.trigger({ delay, state })` is the same behaviour to spread on your own `.tooltip` element; `delay: { open?, close? }` (ms, on `tooltip.onhover` and `tooltip.shared`; each left out is instant) holds the pointer before opening and after leaving, and for 500ms after a delayed tooltip closes the next opens at once, without its entrance; `tooltip.menu` is a keyboard menu (arrows, Home/End, Escape returns focus, Tab closes) that opens in the top layer, above every stacking context around it, and closes once an option is chosen, `highlight` (default `false`; `true` or the highlight's own attributes) glides a layer between its rows on hover and keyboard focus in place of each item's own fill, its panels a surface whose item hover and pressed fills and highlight are surface primary, `tooltip-menu--surface` restoring that fill on the menu or any ancestor (such as a `button.split`); `tooltip.nestedMenu({ animate, items, onnavigate, state })` is a drill-down menu whose `items` nest to any depth: a branch's panel grows out of its row over the dimmed parent, and its header or the parent's scrim goes back; arrows/Home/End move, Right/Left drill and return, Escape goes back a level then closes (`animate: false` skips the motion, `tooltip.nestedMenu.trigger` styles the button); `tooltip.shared({ delay, direction, dismiss, interactive, keep, state })` is one tooltip for any number of triggers: spread `tip.bind(content)` on a trigger (a string, or a function returning a template, rendered on every open unless `keep`), or `tip.delegate({ content, edge, selector })` on a container to make every matching descendant a trigger (default `[data-tooltip]`, its value the content; `edge` lines the tooltip up past the container's edge), and place `tip.render(attributes)` once; it opens in the top layer beside the trigger, flips when out of room, and glides between triggers while its content slides in the direction of travel; `interactive` makes it a card the pointer can enter, toggled by taps and keys, with Tab carried into it; `keep` mounts each bound trigger's content on its first open and keeps it for reopening until that trigger unmounts; `dismiss` is a selector whose clicks inside close it (`'a[href]'` for navigation); `state.active` is whether it is open and `state.index` which bound trigger, numbered in `bind()` order (-1 for none), and setting it opens that trigger | `tooltip.context`, `tooltip.menu`, `tooltip.nestedMenu`, `tooltip.onclick`, `tooltip.onhover`, `tooltip.onhover.trigger`, `tooltip.shared`, `tooltip-menu--surface` |
74
74
  | `accordion` | Collapsible sections driven by `state.active`; `group` (from `accordion.group()`) keeps at most one member open, closing the rest when one opens, and `accordion.group({ required: true })` keeps exactly one open, reopening a member closed while nothing else is. Several opened at once leave the last to join or open; a required group opens its first member when none starts open. Members join while mounted | `accordion.group` |
75
- | `clipboard` | Copy to clipboard | `clipboard.copy`, `clipboard.write` |
76
- | `copy` | Icon button copying `value` (a string or a function read on click); the copy icon turns into a check that draws in, then back after `timeout` ms (default `3000`); `label`, `success` and `error` set its accessible name per state | - |
75
+ | `clipboard` | `clipboard.write(value)` copies text, resolving `true` once it lands and `false` if the browser refuses | `clipboard.write` |
77
76
  | `command` | ⌘K/Ctrl+K command palette on `overlay` + `input`: substring-then-subsequence matching with highlighted runs, grouped results, arrow/Enter keys, `onrun`; `tabs` adds a row of tabs under the search, marked by `highlight`, whose views are `frame--swap`s, drifting in from their side, and cycle with Tab/Shift+Tab (All leads with recent commands, persisted through any `store` implementing `get`/`set`, then lists every command; each command group gets its own tab; a Shortcuts tab lists `shortcuts`); setting `state.tab` (`'all'`, `'shortcuts'` or a group name) switches views and clears the search. `render(groups)` supplies custom result markup: each item exposes its `label`, highlighted `content`, command `id`, and `attributes` to spread onto the option element so selection and keyboard navigation keep working. Icons are sprite ids; `.command-trigger` also styles standalone search buttons | `command.dialog` (e.g. `overlay--blur`), `command.input`, `command.option`, `command.trigger`, `command--centered` |
78
77
  | `editor` | Editor family under one namespace. `editor.code` is a source editor on a persistent native textarea editing an `EditorDocument` that keeps its own undo history: syntax colors (TypeScript/TSX, JavaScript, CSS/SCSS, HTML, JSON, Python, Markdown), line numbers, multiple and rectangular selections, find/replace, go to line, folding, wrap, visible whitespace and a minimap; `options.services` adds completion, hover and diagnostics from a language-server `transport` (or completes from the document's own words); `editor.markdown` renders Markdown in place and edits one block at a time; `editor.code` adds sticky scroll, color swatches, links, unicode warnings, rulers, a git gutter (`baseline`), keybinding overrides (`keybindings`, exported `commands`) and merge-conflict lenses; `editor.tree` is the file tree, with drops from the desktop (`operations.import`), dragging files out (`export`) and next/previous change or problem; `editor.diffs` is a split or unified diff viewer and `editor.diffs.merge` a three-way merge editor; `editor.workspace` combines them with an explorer, tabs, quick open and file operations over a host you supply; `editor.viewer` shows source read-only with syntax colors, line numbers, folding, wrap, visible whitespace, a minimap and an optional copy button, without the editor (import `@esportsplus/ui/editor/viewer` directly to leave the rest of the family out of the bundle) | `editor.code`, `editor.diffs`, `editor.diffs.merge`, `editor.markdown`, `editor.tree`, `editor.viewer`, `editor.workspace` |
79
78
  | `alert` | Notifications | error, info, success types |
80
- | `chatMinimap` | Rail of lines mapping a conversation, one per turn: the hovered line swells its two neighbours either side, one gliding `tooltip.shared` card previews each turn's `title` and `description`, previous/next buttons step through the thread, and `state` (`start`/`end`) lights the turns in view. `turns` may be a `ReactiveArray` so the rail grows with the chat; `chatMinimap.spy({ state, turns })` drives `state` from an `IntersectionObserver` on the thread and its `scrollTo` is the `onnavigate` | `chatMinimap.item`, `side: 'left'` |
81
- | `dock` | macOS-style `card` shelf whose icons swell toward the cursor on a spring, with delayed `tooltip` labels (`group` shares one gliding `tooltip.shared` label) and a hop-and-squash launch that lights a running dot (per-item `state.running`, `onlaunch`) | `dock.button`, `dock--square` |
82
- | `card.expand` | List of `card--expand` cards that each morph into their own `card` `overlay` and fly back into their slot through a view transition (a plain `overlay` fade where unsupported, a cross-fade under reduced motion); `state.open` is two-way | `card.expand.trigger` |
79
+ | `chatMinimap` | Rail of lines mapping a conversation, one per turn: the hovered line swells its two neighbours either side, one gliding `tooltip.shared` card previews each turn's `title` and `description`, previous/next buttons step through the thread, and `state` (`start`/`end`) lights the turns in view. `turns` may be a `ReactiveArray` so the rail grows with the chat; `chatMinimap.spy({ state, turns })` drives `state` from an `IntersectionObserver` on the thread and its `scrollTo` is the `onnavigate` | `chatMinimap.card`, `chatMinimap.description`, `chatMinimap.item`, `chatMinimap.items`, `chatMinimap.label`, `chatMinimap.line`, `chatMinimap.nav`, `chatMinimap.preview`, `chatMinimap.title`, `side: 'left'` |
80
+ | `dock` | macOS-style shelf, unpainted so it is themed where it is placed, whose icons swell toward the cursor on a spring, with one delayed `tooltip.shared` label gliding between its items, items showing an `icon` (a sprite id or a function rendering it) or a `thumbnail` image covering the button, each optionally shaped by its own `modifier` (`plain` for the icon alone, `square`, `squircle`), sortable by drag, with `arrows` paging through whole icons once they outgrow the room the dock has; `direction` (`n`, `s`, `e`, `w`) sets the side the launcher and labels open toward and the way icons swell, east and west standing the dock upright; given `apps`, an 'All apps' button opens a launcher on that side, centered on the dock as a `tooltip-content`, laid out like `command`: a search (an `input`), the apps in a grid the arrow keys walk and Enter opens, and a legend of its keys; the dock and the launcher sort into each other, so dragging moves apps in and out of `items` (`state.active` opens it, `onsort` reports each move), and a hop-and-squash launch that lights a running dot (per-item `state.running`, `onlaunch`) | `dock.button`, `dock.launcher`, `dock--plain`, `dock--square`, `dock--squircle` |
83
81
  | `pagination.dots` | Page indicator driven by a continuous `state.progress`; the pill stretches between dots like a worm, with an optional autoplay countdown | `pagination.dots.dot`, `pagination--dots-large` |
84
82
  | `pagination.cards` | Previous and next links as two cards, each a small `label` (default 'Previous'/'Next'), a `title` and an optional `description`; the chevron nudges the way it points on hover and focus, and a lone next card keeps the right column | `{ next, previous }`, each `{ description?, href, label?, title }` |
85
83
  | `pagination.arrows` | The same links as two square arrow buttons; a missing side stays in place, disabled, so the pair never shifts | `{ next, previous }` |
86
- | `nav` | `nav.tree` link tree whose highlight glides between links, solid (`current: 'page'`) or soft over a rule down their edge (`'location'`), marking the active link with a background, a border or both (`indicator: 'background' | 'border' | 'both'`); `nav.toc` table of contents; `nav.spy(ids)` marks the section in view within whichever ancestor scrolls it | `nav.tree`, `nav.toc`, `nav.spy` |
87
- | `pullToRefresh` | Rubber-band pull gesture (touch and mouse) with a stepped tick spinner; new items above the old first one slide in | - |
84
+ | `nav` | `nav.tree` link tree marking the active link with a gliding `highlight`: given its attributes as `[nav.tree.highlight]`, left out for none: a pill, or with a `border` a `highlight--rail` along a rail on that edge; `nav.toc` table of contents, a `nav.tree` of one group with `{ border: 'left', fill: false }`; `nav.spy(ids)` marks the section in view within whichever ancestor scrolls it | `nav.tree`, `nav.toc`, `nav.spy` |
88
85
  | `sortable` | Drag-and-drop reordering of a reactive list's items, across lists with `group` | `sortable--{effect}` modifiers |
89
- | `story` | Auto-advancing stories, each any `Renderable`, on a `frame--slide` track with segmented progress bars whose CSS fill is the timer (`--duration`, or `duration` in ms); tap the left third to go back (replaying the first story) and the rest to advance, drag or flick between stories (rubber-banding at the ends), press-and-hold or Space to pause; links and controls inside a story keep their own clicks | `story.toggle` |
86
+ | `story` | Auto-advancing stories, each any `Renderable`, on a `frame--slide` track filling the card, with segmented progress bars overlaid on top whose CSS fill is the timer (`--duration`, or `duration` in ms); tap the left third to go back (replaying the first story) and the rest to advance, drag or flick between stories (rubber-banding at the ends), press-and-hold or Space to pause; links and controls inside a story keep their own clicks | |
90
87
 
91
88
  ### Display
92
89
  | Component | Description |
@@ -95,14 +92,17 @@ html`
95
92
  | `loader` | Loading spinner |
96
93
  | `loading` | Border loading indicator |
97
94
  | `typewriter` | Animated typing effect; `typewriter.retype` is a headline word that is selected and typed over with a jittered, human rhythm, landing whole words under reduced motion. Both share the caret variables and `--block`/`--hard`/`--underscore` modifiers. `typewriter.rotate` is a rotating word (`state.index`, `state.paused`) whose shared letters glide into place while the others blur out and in; `typewriter-rotate--accent` |
98
- | `highlight` | Layer that glides behind its parent's children on hover and focus and rests on the `--active` one (`target` for nested items, `hover: false` for the active layer only); `line: 'bottom' \| 'left' \| 'right' \| 'top'` adds an edge line to the active layer with both fills kept `--line-inset` clear of it, `fill: false` drops the active background, `--glide-tail-duration-active` longer than `--glide-duration-active` stretches it toward the next item, `--inset-block` / `--inset-inline` pull the fill in from the item |
95
+ | `group` | Row of items on `%group`, spaced by `--gap-horizontal` / `--gap-vertical` (a quarter of `--size-100`); attributes under `[group.highlight]` add a `highlight` behind the items, none without them; `button--group` items make a segmented control, medium weight while `--active` | `group.highlight` |
96
+ | `preview` | An example's card that mounts its content once near the viewport and answers its hash (and its `anchors`) by revealing itself; its parts compose inside it, sharing one `preview.state()`: `preview.header` (numbered title plus controls), `preview.stage` (renders the example untracked, hidden while the source shows), `preview.source` (loads, caches and retries a source on the code view) and `preview.code` (a flush `editor.viewer` with a copy button). `preview.buttons` sits just above the card, a `group` of view buttons from `{ content, view }` items | `preview.buttons`, `preview.code`, `preview.header`, `preview.source`, `preview.stage`, `preview.state` |
97
+ | `panels` | Tabbed groups of surfaces in resizable splits, from a `catalog` of kinds (`title`, `render`, optional `icon`, `description`, `shortcut`, `multiple`) and a `panels.state()` holding the layout (`root`, optional `storage` key to persist it); `icons: true` shows tabs as their kind's icon alone, closed from their menu. Tabs drag to reorder, into another group, onto a group's half to split it, or onto the bottom strip to dock a full-width bottom group; separators resize, a double-clicked header maximizes, groups clicked with Ctrl (⌘ on Apple platforms) held fill the layout together once it is let go (Esc cancels) until a double click steps back out, and tabs carry a close menu. `+` and an empty group's launcher open a kind. Each surface renders once and moves between slots, keeping its state until its tab closes | `panels.state` |
98
+ | `highlight` | Layer that glides behind its parent's children on hover and focus and rests on the `--active` one (`target` for nested items, `hover: false` for the active layer only); `border: 'bottom' \| 'left' \| 'right' \| 'top'` adds an edge border to the active layer with both fills kept `--border-inset-horizontal` / `--border-inset-vertical` clear of it, `fill: false` drops the active background, `--glide-tail-duration-active` longer than `--glide-duration-active` stretches it toward the next item, `--inset-horizontal` / `--inset-vertical` pull the fill in from the item; `highlight--rail` on the highlight and `highlight-rail` with `highlight-rail--{bottom,left,right,top}` on its container make tabs along a rail at `--rail-width`, the border on the same edge lying over it |
99
99
  | `ellipsis` | Animated dots |
100
- | `icon` | SVG sprite wrapper; `icon--rotate` turns it by `--rotate` (default `0deg`) with an eased transition, skipped under reduced motion |
100
+ | `icon` | SVG sprite wrapper, `icon(attributes, href)`: the sized box (`--size`, or `--width`/`--height`) colored by `--color`, whose `fill` the `<svg>` inherits, so a stroked icon sets `fill: none` on the box; attributes under `[icon.svg]` go on the `<svg>` itself, `class` included; `icon--rotate` turns it by `--rotate` (default `0deg`) with an eased transition, skipped under reduced motion | `icon.svg` |
101
101
  | `number` | Number formatting |
102
102
  | `truncate` | Text truncation |
103
103
  | `json` | JSON display |
104
104
  | `announcement` | Animated top-of-page container (`state.active`) built on a non-modal `overlay` in the page flow; slides its content in and collapses the space it held, with overlay's drag dismissal and background fill when pulled away from its top edge; the content and close control are the consumer's |
105
- | `toaster` | `toaster(attributes)` returns `{ content, toast }`: place `content` on the page, and `toast(attributes, (state) => content)` queues into that toaster alone, so separate toasters can differ in placement and style. Placed with overlay's own placement modifiers and variables (`toaster--{n,ne,e,se,s,sw,w,nw}`, `--margin-*`, `--translate`, `--stack-peek`, `--stack-scale`); side stacks recede sideways like overlay's; collapsed it shows `limit` toasts (default 3) and an overflow card counting the rest (`overflow: (count) => content`, `toaster.overflow` attributes), and hovering fans all of them out. Content renders lazily with the toast's `state`: `state.active = false` dismisses it and changing `state.duration` keeps the time already spent; pass `state` to hold it from outside, `toast.dismiss()` clears the toaster. The timer is a CSS animation, exposed as `--toast-progress` (0 to 1) and `--toast-seconds`, that runs only on the front toast and stops while the stack is hovered. The toast is only the stacking container, so its surface is the consumer's class; it keeps a close button (`toast.close` attributes) around its content (`toast.content` attributes) |
105
+ | `toaster` | `toaster(attributes)` returns `{ content, toast }`: place `content` on the page, and `toast(attributes, (state) => content)` queues into that toaster alone, so separate toasters can differ in placement and style. Placed with overlay's own placement modifiers and variables (`toaster--{n,ne,e,se,s,sw,w,nw}`, `--margin-*`, `--translate`, `--stack-peek`, `--stack-scale`); side stacks recede sideways like overlay's; collapsed it shows `limit` toasts (default 3) and an overflow card counting the rest (`overflow: (count) => content`, `toaster.overflow` attributes), and hovering fans all of them out. Content renders lazily with the toast's `state`: `state.active = false` dismisses it and changing `state.duration` keeps the time already spent; pass `state` to hold it from outside, `toast.dismiss()` clears the toaster. The timer is a CSS animation, exposed as `--progress` (0 to 1) and `--seconds`, that runs only on the front toast and stops while the stack is hovered. The toast is only the stacking container, so its surface is the consumer's class; it keeps a close button (`toast.close` attributes) around its content (`toast.content` attributes) |
106
106
  | `progress` | Progress bar (`state.value`) with an optional label, percentage and a `status` line derived from the value; `progress.text` is a `progressbar` whose label fills with ink on a spring (`state.value`), with rolling digits and a drawn check on done |
107
107
  | `heatmap` | Calendar of daily values that sweeps in by column; one `tooltip.shared` delegated across the cells renders each day through your `tooltip(day, index)` template (`describe(day)` names the cell), drag-to-scroll via `scrollbar.drag`, roving-tabindex grid keys and `heatmap.legend`; `heatmap--blue` |
108
108
  | `relativeTime` | Self-updating `<time>` ("4 min ago") that wakes once per visible change and rolls its digits; full date in a `tooltip` on hover/focus; `state.now` pins the clock |
@@ -117,6 +117,7 @@ html`
117
117
  | `frame.scss` | Sibling frames sharing one spot, the `--active` one shown: instant by default, `frame--slide` / `frame--scroll` move them like a horizontal / vertical track, `frame--swap` crossfades in place with a directional drift and blur (the `tooltip.shared` swap); shared by `command`, `tooltip.shared` and `card--morph` |
118
118
  | `overlay` | Native `<dialog>` driven by `state.active` (Esc and backdrop click close it), placed by `overlay--c` (default), an edge (`overlay--n`, `overlay--s`, `overlay--w`, `overlay--e`) or a corner (`overlay--ne`, `overlay--se`, `overlay--sw`, `overlay--nw`, which enter and drag off by their top or bottom edge); placements slide in from their side on the iOS drawer curve and square the corners they touch unless `overlay--floating`. Every overlay but a rail drags to dismiss (toward its edge, or downward when centered) past 25% or on a flick, rubber-bands inward and fades the backdrop with the drag; when its own content scrolls, touch drags only from `overlay.handle`. Overlays opened over one another stack: each covered layer shrinks, dims and peeks out from under the one above (`--stack-scale`, `--stack-dim`, `--stack-peek`) and follows the top layer back as it is dragged away; an `overlay-page` direct child of `<body>` (or of a non-modal overlay's container) recedes the same way; `modal: false` opens without a backdrop, leaves the page interactive and sits in its positioned container; `flow: true` keeps it non-modal in the page layout, preserves focus, skips layer stacking, and collapses its parent row during vertical drag dismissal (used by `announcement`); `rail: true` keeps it open non-modal and widens it while a mouse hovers or keyboard focus is inside (or `state.active` is set) from `--width-closed` to `--max-width`, clipping rows rather than reflowing them. Motion: `overlay--fade`, `overlay--scale`, `overlay--spring`, `overlay--alert`, `overlay--blur` |
119
119
  | `breadcrumb` | Path trail that folds middle segments into a `tooltip.menu` as space runs out, the rest sliding over as each one closes; `onnavigate` intercepts links; `separator: 'chevron' \| 'slash'` (default `'slash'`) |
120
+ | `shell` | App frame `shell({ left, right }, content)`: a sidebar on either edge (`Side`: `id`, `label`, `state.active`, optional `content`, `class` and `hover` to peek while the pointer rests on its edge), each with a mirrored `button.sidebar` toggle in its top corner, around a root-surface `card` the page scrolls in. A closed side's edge holds a handle that follows the pointer; dragging from the edge opens the sidebar and dragging a sidebar toward its edge closes it. Below 1024px one sidebar opens at a time; `shell.close(side)` closes one, returning focus to its toggle. `--gap-horizontal` / `--gap-vertical` inset the card from the window, `--space` sizes an open sidebar, `--slide-duration` / `--slide-easing` time the motion |
120
121
 
121
122
  ### Utility
122
123
  | Component | Description |
@@ -157,11 +158,12 @@ frames in one grid cell so the tallest sets the height:
157
158
  - `.frame--slide` / `.frame--scroll` move the frames together like a
158
159
  horizontal / vertical track.
159
160
  - `.frame--swap` crossfades in place, like `tooltip.shared` content: a waiting
160
- frame sits one `--swap-shift` off to its side, faded and blurred, so the
161
+ frame sits one `--shift` off to its side, faded and blurred, so the
161
162
  incoming frame drifts in while the outgoing one carries on out the other way.
162
- Frames without an index set the direction themselves through `--travel-x` /
163
- `--travel-y` and mark the outgoing frame `frame--leaving`. `--swap-*` variables
164
- tune it, with `--swap-exit-*` for the outgoing frame.
163
+ Frames without an index set the direction themselves through `--translate-x` /
164
+ `--translate-y` and mark the outgoing frame `frame--swap-leaving`.
165
+ `--transition-duration`, `--fade-duration` and `--blur` tune it; the outgoing
166
+ frame takes `--fade-duration` throughout.
165
167
 
166
168
  ```html
167
169
  <div style="overflow: hidden; --i: 1;">
@@ -332,7 +334,7 @@ plugin. `check.svg` carries no stroke styling, so set `fill: none` and a `stroke
332
334
 
333
335
  Located in `tokens.scss`:
334
336
 
335
- - **Colors**: `--color-{name}` (black, blue, green, grey, purple, red, white, yellow), each written once and weighted at the root as `--color-{name}-{300|400|500}`: 400 itself, 300 and 500 the mode's `color` step (in `$themes` `surface`) lightness points lighter and darker
337
+ - **Colors**: `--color-{name}` (black, blue, green, grey, purple, red, white, yellow), each written once and weighted at the root as `--color-{name}-{300|400|500}`: 400 itself, 300 and 500 the mode's `color` weight (in `$themes` `weights`) lightness points lighter and darker
336
338
  - **Theme colors**: `--color-surface`, `--color-primary-{300|400|500}` and `--color-text-{300|400|500}`, the only colors that change with the mode, declared by the theme stylesheet (see Theming)
337
339
  - **Sizing**: `--size-{300-800}` (12px-80px)
338
340
  - **Spacing**: `--spacing-{0-600}`
@@ -376,7 +378,8 @@ family is its own stylesheet, used where it is extended, so a stylesheet only em
376
378
  `--gap-vertical` to space children.
377
379
  - **text**: `%text`, `%text-crop` (`-top`, `-bottom`, `-first-child`, `-last-child`), `%text-gradient`,
378
380
  `%text-line-shadow`, `%text-shiny` and `%text-truncate`.
379
- - **surface**: `%surface-raised` / `%surface-sunken` (painted) and their `-level` forms (counted).
381
+ - **surface**: `%surface-raise` / `%surface-lower` (one level up or down), `%surface` (its parent's level) and
382
+ `%surface-root`; all count and color without painting, and `--surface-level` pins any of them.
380
383
  - **font/geist**, **font/montserrat**: see Fonts.
381
384
  - **drag**, **hidden**, **icon**, **inline** and **skeleton** (painted from `--from` to `--to`).
382
385
 
@@ -402,15 +405,18 @@ Each component exposes CSS custom properties:
402
405
  ```typescript
403
406
  import theme from '@esportsplus/ui/theme';
404
407
 
405
- let mode = theme();
408
+ let mode = theme({ fallback: 'dark', store });
406
409
 
407
- mode.set('dark'); // 'dark' | 'light' | 'system'
410
+ mode.set('light'); // 'dark' | 'light' | 'system'
408
411
  ```
409
412
 
413
+ `fallback` (default `'system'`) is the mode shown until the user picks one; `store` keeps their pick across reloads.
414
+ Picking the fallback clears the stored pick, so the page follows the site's default again.
415
+
410
416
  `theme.scss` declares the only colors that change with the mode once on `:root`, as a `light-dark()` of their light and
411
417
  dark values: `--color-surface` (the page, a 99% neutral in light and `black-400` in dark), `--color-primary-*` (its
412
418
  opposite, `black-*` in light and `white-*` in dark), `--color-text` (text, one color, which is `--color-text-400`;
413
- `--color-text-300` and `-500` derive from it in CSS, each holding the mode's `text` contrast in `$themes` against it, so
419
+ `--color-text-300` and `-500` derive from it in CSS, each holding the mode's `text` weight, a contrast ratio in `$themes` `weights`, against it, so
414
420
  setting `--color-text` on `:root` moves all three). It also sets `--background`, `--color` and `color-scheme: light dark`, so with no script at all the page
415
421
  follows the operating system.
416
422
 
@@ -425,19 +431,24 @@ the `--surface-level` custom property, and reads its colors from that level inst
425
431
  parent's level with a container style query, so it counts up even set directly inside another surface; levels stop at 6.
426
432
  Its tokens follow the state names components use, `default`, `hover`, `active` and `pressed`:
427
433
  `--surface-background-*` steps the default from `--color-surface` by the lightness points in each mode's `$themes`
428
- `surface` map, raised levels lighter and sunken ones darker (in light mode raised levels climb to white, leaving further
434
+ `surface` map, raised levels lighter and lowered ones darker (in light mode raised levels climb to white, leaving further
429
435
  elevation to the shadow), then moves it for each state, active and hover lighter and pressed darker in both modes;
430
436
  `--surface-border-*` moves the matching `--surface-background-*` by the mode's `border` step, darker in light and
431
437
  lighter in dark, for lines, rings and small marks; and `--surface-shadow-*` is the
432
- shadow at the layer's `--surface-shadow-weight`, a step on Tailwind v4's `shadow-2xs` to `shadow-2xl` ladder (1 to 7),
433
- a step heavier on hover and a step lighter when pressed. The weight follows the level (sunken layers 0, dialogs 7);
434
- set it on a surface to pick another step, a fraction landing between two. A shadow takes the color of what it falls
438
+ shadow at the layer's weight, a step on Tailwind v4's `shadow-2xs` to `shadow-2xl` ladder (1 to 7), a step heavier on
439
+ hover and a step lighter when pressed. The weight follows the level (lowered layers 0, dialogs 7), written out as fixed
440
+ shadows for each level; include `surface.surface-shadow($weight)` on a surface to pick another step. A shadow takes the color of what it falls
435
441
  on, that background deepened in its own hue, at the mode's shadow `opacity`; `--surface-shadow-
436
- color` is that color for whatever casts onto a layer, for component shadows and scrims. A quiet fill, such as a track
442
+ color` is that color for whatever casts onto a layer, for component shadows and scrims. `--surface-primary-{state}` is a
443
+ primary fill on a layer, the mode's `primary` levels below it in light and above it in dark, its states stepped from it as
444
+ the layer's own are. A quiet fill, such as a track
437
445
  or an inline code chip, is a surface of its own a level below what holds it. Dialogs reset the stack to level 1 wherever they open. Another level is never a color to paint: a
438
- component reaches it by extending `%surface-raised` or `%surface-sunken` (painted), or `%surface-raised-level` or
439
- `%surface-sunken-level` (counted, for components that route background and shadow through their own variables), so
440
- whatever sits in it reads its states from the level it shows; sunken layers cast no shadow. Style queries on custom
446
+ component reaches it by extending `%surface-raise` or `%surface-lower` (one level up or down), `%surface` (its
447
+ parent's level) or `%surface-root`, or by setting `--surface-level` on one to pin it, so whatever sits in it reads its
448
+ states from the level it shows; only a layer moved up casts a shadow. None of them paint: set
449
+ `background`/`box-shadow` from `--surface-background-default`/`--surface-shadow-default`, or extend
450
+ `%background-surface`, `%border-surface` and `%box-shadow-surface` with their state placeholders for fills that step with
451
+ the state. Style queries on custom
441
452
  properties need Chrome and Edge 111, Safari 18 or Firefox 151; elsewhere every surface keeps its parent's level. The
442
453
  ladder and shadows live in each mode's `surface` map in `$themes` (`tokens/scss/color.scss`), with `shadow` holding its
443
454
  `depth` and `opacity`; the Tailwind shadow ladder itself sits with the surface utilities, and `surface.shadow($weight)`
package/RULES.md ADDED
@@ -0,0 +1,115 @@
1
+ # Rules
2
+
3
+ Component conventions. Reference implementation: `src/components/button`.
4
+
5
+
6
+ ## Directory structure
7
+
8
+ ```
9
+ src/components/{component}/
10
+ ├── index.ts barrel; imports './scss/index.scss' and exports the default object
11
+ ├── {variant}.ts one file per sub-component (copy.ts, kbd.ts, split.ts, ...)
12
+ ├── {variant}/ a sub-component spanning several files (index.ts, template.ts, save.ts, ...)
13
+ └── scss/
14
+ ├── index.scss logic, rules, structure
15
+ ├── variables.scss css variables only
16
+ └── _{partial}.scss optional partials when index.scss grows too large (see tooltip)
17
+ ```
18
+
19
+ - SCSS always lives in `{component}/scss/`; CSS-only components may have nothing but `scss/`.
20
+ - `index.ts` imports sub-components alphabetically, then `./scss/index.scss`, and exports a typed object of them:
21
+ `const button: { copy: typeof copy, ... } = { copy, ... }; export default button;`
22
+
23
+
24
+ ## TypeScript
25
+
26
+ - Use CSS whenever it can do the job, so the browser does the work instead of the script. States (`:hover`, `:active`,
27
+ `:focus-visible`, `:has()`), transitions, `@starting-style`, layout and `@media` preferences belong in SCSS. Keep TS
28
+ for what CSS can't express, such as measuring layout or state CSS can't see.
29
+ - Build components with `@esportsplus/template` (`component`, `html`, attribute objects) and
30
+ `@esportsplus/reactivity` (`reactive`, ...). We own both libraries; use them for as much as possible.
31
+ - Don't manipulate the DOM directly (`addEventListener`, `classList`, `setAttribute`, `appendChild`, manual `window`
32
+ listeners, ...) when template has a way to do it. Template handles cleanup and lifecycle. For example, bind
33
+ `onwindowkeydown` / `onpointerdown` and reactive `class: () => ...` in the attribute object, as `button/kbd.ts` does.
34
+ - Optimize with fine-grained reactivity: keep state in `reactive(...)` and bind functions only where a value changes,
35
+ so updates touch only the affected node or attribute. Never re-render whole templates for a small change.
36
+ - Drop to raw DOM only when neither library covers the case (e.g. measuring layout). Keep it minimal and say why in a
37
+ comment.
38
+
39
+
40
+ ## index.scss vs variables.scss
41
+
42
+ - `index.scss` holds the logic: layout, properties, selectors, transitions, keyframes. Values come from `var(--*)`, not literals.
43
+ - `variables.scss` holds only css variables (plus themed `%placeholder` extends such as `%background-primary`). They act as
44
+ arguments: every tunable value is a variable so variants and consumers can finely control the component without
45
+ touching the logic.
46
+ - `index.scss` `@use`s `variables`; both `@use '/tokens'` and any `css-utilities/*` they need, alphabetically.
47
+ - Variants (`&--primary`, `&--kbd`, ...) should mostly be variable overrides in `variables.scss`; only add rules to
48
+ `index.scss` when the structure actually changes.
49
+
50
+
51
+ ## Variables
52
+
53
+ - Split multi-value properties into one variable per axis/side so the logic can compute with each part:
54
+ `--padding-horizontal` / `--padding-vertical`, `--gap-horizontal` / `--gap-vertical`. A single `--padding` would need
55
+ parsing of 1/2/4-value shorthands. Example from button:
56
+ ```scss
57
+ padding-block: max(0px, calc(var(--padding-vertical) - var(--border-width)));
58
+ padding-inline: max(0px, calc(var(--padding-horizontal) - var(--border-width)));
59
+ ```
60
+ - Variables live on the selector that consumes them, not on a parent with a prefix. The icon's size is `--size` set on
61
+ `.button-icon` / `&-kbd-icon.icon`, not `--icon-size` on `.button` that reaches down into the child. Prefixes are
62
+ only for distinct concerns of the same selector that would otherwise collide, e.g. `card--morph`'s `--morph-duration`,
63
+ `--morph-fade-duration` alongside its own `--transition-duration`.
64
+ - Stateful values use a `-default` / `-hover` / `-active` / `-pressed` family, with the bare variable resolving to the
65
+ current state: `--background: var(--background-default)`.
66
+ - Timing is always a pair: `--transition-duration` + `--transition-timing-function` (likewise `--{name}-duration` /
67
+ `--{name}-timing-function` for animations, e.g. `--shake-duration`).
68
+ - Prefer tokens (`--size-*`, `--border-radius-*`, `--font-size-*`, `--color-*`) over raw values.
69
+ - Reduced motion is handled by zeroing durations or removing transitions/animations under
70
+ `@media (prefers-reduced-motion: reduce)`.
71
+
72
+
73
+ ## Naming (BEM-like)
74
+
75
+ - Block: `.button`
76
+ - Modifier: `.button--kbd`, `.button--processing` (double dash)
77
+ - Element: `.button-face`, `.button-split-chevron` (single dash, not `__`)
78
+ - Element modifier: `.button-face--error`, `.button-icon--draw`
79
+ - Modifier element/sub-state: `.button--morph-error`, `.button--sidebar-right`
80
+ - States use the `tokens.state(...)` mixin (`--active`, `pressed`, ...), not hand-written state classes.
81
+ - Always build names with `&--` / `&-` nesting rather than repeating the block name.
82
+ - Nested/chained selectors are fine when composing components or winning specificity regardless of load order
83
+ (`& > &-menu > &-trigger`, `&-kbd-icon.icon`, `> .tooltip-menu-layer > .tooltip-menu-panel`). Use `:where()` for
84
+ zero-specificity defaults that the other component should be able to override.
85
+
86
+
87
+ ## Keyframes
88
+
89
+ - Name keyframes after the class that uses them when possible: `.button--processing` → `button--processing`. When a
90
+ name describes the motion rather than a single class, prefix it with the block/element path (`button-icon-draw`,
91
+ `button-morph-shake`).
92
+ - Place them either nested inside the class using them or at the bottom of `index.scss`.
93
+
94
+
95
+ ## Ordering
96
+
97
+ Alphabetize everything: `@use` statements, selectors, properties, variables, transition lists, `@extend` lists.
98
+
99
+ Within a block, in this order. Two blank lines separate each group; one blank line separates rules within a group:
100
+
101
+ 1. `@extend`s, then variables (`--*`), then properties — each alphabetical
102
+ 2. Pseudo elements (`&::after`), nested `:where()` / descendant rules, `@media` for the block itself
103
+ 3. Modifiers `&--*`, alphabetical
104
+ 4. Elements `&-*`, alphabetical
105
+ 5. State / relational selectors (`&:has(...)`, `&:not(...)`) and descendant selectors (`.button-check`, `svg`)
106
+
107
+
108
+ ## SCSS style
109
+
110
+ - Use nesting wherever possible: `&--`, `&-`, `&::before`, `&:focus-visible`, `@media` and `@include tokens.state()`
111
+ nested inside the selector they affect.
112
+ - Reuse `css-utilities` placeholders via `@extend` (`%absolute-center`, `%hidden-visually`, `%icon-stroke`, ...) instead
113
+ of rewriting their rules.
114
+ - Use `@each` loops for symmetric variants (`left`/`right`) instead of duplicating rules.
115
+ - Comments only for a non-obvious why (specificity tricks, timing choices, math); never restate the code.