@dxos/ui-theme 0.8.4-main.fbb7a13 → 0.8.4-staging.ac66bdf99f

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 (384) hide show
  1. package/dist/lib/browser/index.mjs +766 -2802
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +766 -2802
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/plugin/node-cjs/main.css +1529 -0
  8. package/dist/plugin/node-cjs/main.css.map +7 -0
  9. package/dist/plugin/node-cjs/meta.json +1 -1
  10. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs +137 -0
  11. package/dist/plugin/node-cjs/plugins/ThemePlugin.cjs.map +7 -0
  12. package/dist/plugin/node-esm/main.css +1529 -0
  13. package/dist/plugin/node-esm/main.css.map +7 -0
  14. package/dist/plugin/node-esm/meta.json +1 -1
  15. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs +105 -0
  16. package/dist/plugin/node-esm/plugins/ThemePlugin.mjs.map +7 -0
  17. package/dist/types/src/Theme.stories.d.ts +27 -0
  18. package/dist/types/src/Theme.stories.d.ts.map +1 -0
  19. package/dist/types/src/defs.d.ts +21 -0
  20. package/dist/types/src/defs.d.ts.map +1 -0
  21. package/dist/types/src/fragments/density.d.ts +4 -0
  22. package/dist/types/src/fragments/density.d.ts.map +1 -0
  23. package/dist/types/src/fragments/disabled.d.ts.map +1 -0
  24. package/dist/types/src/fragments/hover.d.ts +10 -0
  25. package/dist/types/src/fragments/hover.d.ts.map +1 -0
  26. package/dist/types/src/fragments/index.d.ts +5 -0
  27. package/dist/types/src/fragments/index.d.ts.map +1 -0
  28. package/dist/types/src/fragments/text.d.ts +2 -0
  29. package/dist/types/src/fragments/text.d.ts.map +1 -0
  30. package/dist/types/src/index.d.ts +3 -10
  31. package/dist/types/src/index.d.ts.map +1 -1
  32. package/dist/types/src/plugins/ThemePlugin.d.ts +16 -0
  33. package/dist/types/src/plugins/ThemePlugin.d.ts.map +1 -0
  34. package/dist/types/src/plugins/dark-mode.d.ts +1 -0
  35. package/dist/types/src/plugins/dark-mode.d.ts.map +1 -0
  36. package/dist/types/src/theme/components/avatar.d.ts.map +1 -0
  37. package/dist/types/src/theme/components/breadcrumb.d.ts.map +1 -0
  38. package/dist/types/src/theme/components/button.d.ts +15 -0
  39. package/dist/types/src/theme/components/button.d.ts.map +1 -0
  40. package/dist/types/src/theme/components/card.d.ts +12 -0
  41. package/dist/types/src/theme/components/card.d.ts.map +1 -0
  42. package/dist/types/src/{styles → theme}/components/dialog.d.ts +2 -0
  43. package/dist/types/src/theme/components/dialog.d.ts.map +1 -0
  44. package/dist/types/src/theme/components/focus.d.ts +6 -0
  45. package/dist/types/src/theme/components/focus.d.ts.map +1 -0
  46. package/dist/types/src/theme/components/icon-button.d.ts.map +1 -0
  47. package/dist/types/src/{styles → theme}/components/icon.d.ts +3 -0
  48. package/dist/types/src/theme/components/icon.d.ts.map +1 -0
  49. package/dist/types/src/{styles → theme}/components/index.d.ts +4 -1
  50. package/dist/types/src/theme/components/index.d.ts.map +1 -0
  51. package/dist/types/src/{styles → theme}/components/input.d.ts +25 -21
  52. package/dist/types/src/theme/components/input.d.ts.map +1 -0
  53. package/dist/types/src/theme/components/link.d.ts.map +1 -0
  54. package/dist/types/src/theme/components/list.d.ts.map +1 -0
  55. package/dist/types/src/{styles → theme}/components/main.d.ts +2 -7
  56. package/dist/types/src/theme/components/main.d.ts.map +1 -0
  57. package/dist/types/src/{styles → theme}/components/menu.d.ts +1 -1
  58. package/dist/types/src/theme/components/menu.d.ts.map +1 -0
  59. package/dist/types/src/{styles → theme}/components/message.d.ts +1 -0
  60. package/dist/types/src/theme/components/message.d.ts.map +1 -0
  61. package/dist/types/src/{styles → theme}/components/popover.d.ts +1 -1
  62. package/dist/types/src/theme/components/popover.d.ts.map +1 -0
  63. package/dist/types/src/theme/components/scroll-area.d.ts +32 -0
  64. package/dist/types/src/theme/components/scroll-area.d.ts.map +1 -0
  65. package/dist/types/src/theme/components/select.d.ts.map +1 -0
  66. package/dist/types/src/theme/components/separator.d.ts.map +1 -0
  67. package/dist/types/src/theme/components/skeleton.d.ts +7 -0
  68. package/dist/types/src/theme/components/skeleton.d.ts.map +1 -0
  69. package/dist/types/src/theme/components/splitter.d.ts +4 -0
  70. package/dist/types/src/theme/components/splitter.d.ts.map +1 -0
  71. package/dist/types/src/{styles → theme}/components/status.d.ts +1 -1
  72. package/dist/types/src/theme/components/status.d.ts.map +1 -0
  73. package/dist/types/src/theme/components/tag.d.ts.map +1 -0
  74. package/dist/types/src/theme/components/toast.d.ts.map +1 -0
  75. package/dist/types/src/theme/components/toolbar.d.ts +11 -0
  76. package/dist/types/src/theme/components/toolbar.d.ts.map +1 -0
  77. package/dist/types/src/theme/components/tooltip.d.ts.map +1 -0
  78. package/dist/types/src/theme/components/treegrid.d.ts.map +1 -0
  79. package/dist/types/src/theme/index.d.ts +4 -0
  80. package/dist/types/src/theme/index.d.ts.map +1 -0
  81. package/dist/types/src/theme/primitives/column.d.ts +29 -0
  82. package/dist/types/src/theme/primitives/column.d.ts.map +1 -0
  83. package/dist/types/src/theme/primitives/index.d.ts +3 -0
  84. package/dist/types/src/theme/primitives/index.d.ts.map +1 -0
  85. package/dist/types/src/theme/primitives/panel.d.ts +13 -0
  86. package/dist/types/src/theme/primitives/panel.d.ts.map +1 -0
  87. package/dist/types/src/theme/theme.d.ts +5 -0
  88. package/dist/types/src/theme/theme.d.ts.map +1 -0
  89. package/dist/types/src/{styles/fragments → util}/elevation.d.ts +0 -6
  90. package/dist/types/src/util/elevation.d.ts.map +1 -0
  91. package/dist/types/src/util/hash-styles.d.ts +8 -5
  92. package/dist/types/src/util/hash-styles.d.ts.map +1 -1
  93. package/dist/types/src/util/index.d.ts +3 -0
  94. package/dist/types/src/util/index.d.ts.map +1 -1
  95. package/dist/types/src/util/mx.d.ts +36 -0
  96. package/dist/types/src/util/mx.d.ts.map +1 -1
  97. package/dist/types/src/util/size.d.ts +27 -0
  98. package/dist/types/src/util/size.d.ts.map +1 -0
  99. package/dist/types/src/util/valence.d.ts +4 -0
  100. package/dist/types/src/util/valence.d.ts.map +1 -0
  101. package/dist/types/tsconfig.tsbuildinfo +1 -1
  102. package/package.json +24 -27
  103. package/src/Theme.stories.tsx +224 -0
  104. package/src/css/base/base.css +43 -0
  105. package/src/{styles/layers → css/base}/typography.css +3 -5
  106. package/src/{styles/layers → css/components}/button.css +23 -14
  107. package/src/{styles/layers → css/components}/checkbox.css +12 -8
  108. package/src/{styles/layers → css/components}/dialog.css +16 -15
  109. package/src/{styles/layers/focus-ring.css → css/components/focus.css} +60 -41
  110. package/src/css/components/icon.css +9 -0
  111. package/src/css/components/link.css +9 -0
  112. package/src/css/components/panel.css +117 -0
  113. package/src/css/components/scrollbar.css +24 -0
  114. package/src/css/components/selected.css +30 -0
  115. package/src/css/components/surface.css +34 -0
  116. package/src/css/components/tag.css +130 -0
  117. package/src/css/components/text.css +124 -0
  118. package/src/css/integrations/codemirror.css +34 -0
  119. package/src/css/integrations/tldraw.css +14 -0
  120. package/src/css/layout/main.css +205 -0
  121. package/src/{styles/layers → css/layout}/native.css +6 -4
  122. package/src/css/layout/positioning.css +19 -0
  123. package/src/{styles/layers → css/layout}/size.css +117 -109
  124. package/src/css/theme/animation.css +229 -0
  125. package/src/css/theme/border.css +23 -0
  126. package/src/css/theme/palette.css +36 -0
  127. package/src/css/theme/semantic.css +116 -0
  128. package/src/css/theme/spacing.css +147 -0
  129. package/src/css/theme/styles.css +145 -0
  130. package/src/css/theme/text.css +37 -0
  131. package/src/css/utilities.css +76 -0
  132. package/src/defs.ts +48 -0
  133. package/src/fragments/AUDIT.md +57 -0
  134. package/src/fragments/density.ts +16 -0
  135. package/src/fragments/hover.ts +18 -0
  136. package/src/fragments/index.ts +10 -0
  137. package/src/fragments/text.ts +6 -0
  138. package/src/index.ts +3 -14
  139. package/src/main.css +87 -0
  140. package/src/plugins/ThemePlugin.ts +125 -0
  141. package/src/plugins/dark-mode.ts +22 -0
  142. package/src/plugins/main.css +45 -0
  143. package/src/{styles → theme}/components/avatar.ts +12 -13
  144. package/src/theme/components/button.ts +48 -0
  145. package/src/theme/components/card.ts +102 -0
  146. package/src/{styles → theme}/components/dialog.ts +19 -10
  147. package/src/theme/components/focus.ts +33 -0
  148. package/src/{styles → theme}/components/icon-button.ts +1 -3
  149. package/src/theme/components/icon.ts +28 -0
  150. package/src/{styles → theme}/components/index.ts +4 -1
  151. package/src/theme/components/input.ts +171 -0
  152. package/src/{styles → theme}/components/link.ts +3 -4
  153. package/src/{styles → theme}/components/list.ts +5 -5
  154. package/src/{styles → theme}/components/main.ts +2 -6
  155. package/src/{styles → theme}/components/menu.ts +11 -21
  156. package/src/{styles → theme}/components/message.ts +11 -7
  157. package/src/{styles → theme}/components/popover.ts +13 -12
  158. package/src/theme/components/scroll-area.ts +115 -0
  159. package/src/{styles → theme}/components/select.ts +8 -16
  160. package/src/{styles → theme}/components/separator.ts +3 -3
  161. package/src/theme/components/skeleton.ts +23 -0
  162. package/src/theme/components/splitter.ts +20 -0
  163. package/src/{styles → theme}/components/status.ts +7 -7
  164. package/src/{styles → theme}/components/tag.ts +1 -1
  165. package/src/{styles → theme}/components/toast.ts +6 -8
  166. package/src/theme/components/toolbar.ts +35 -0
  167. package/src/{styles → theme}/components/tooltip.ts +4 -6
  168. package/src/{styles → theme}/components/treegrid.ts +9 -9
  169. package/src/{styles → theme}/index.ts +2 -2
  170. package/src/theme/primitives/column.ts +71 -0
  171. package/src/theme/primitives/index.ts +6 -0
  172. package/src/theme/primitives/panel.ts +43 -0
  173. package/src/{styles → theme}/theme.ts +27 -9
  174. package/src/typings.d.ts +3 -1
  175. package/src/{styles/fragments → util}/elevation.ts +6 -8
  176. package/src/util/hash-styles.ts +118 -98
  177. package/src/util/index.ts +3 -0
  178. package/src/util/mx.ts +165 -43
  179. package/src/util/size.ts +103 -0
  180. package/src/util/valence.ts +33 -0
  181. package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs +0 -79
  182. package/dist/plugin/node-cjs/chunk-UUMDOU7E.cjs.map +0 -7
  183. package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs +0 -1619
  184. package/dist/plugin/node-cjs/chunk-ZVALPM6U.cjs.map +0 -7
  185. package/dist/plugin/node-cjs/config/tailwind.cjs +0 -29
  186. package/dist/plugin/node-cjs/config/tailwind.cjs.map +0 -7
  187. package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs +0 -90
  188. package/dist/plugin/node-cjs/plugins/esbuild-plugin.cjs.map +0 -7
  189. package/dist/plugin/node-cjs/plugins/plugin.cjs +0 -124
  190. package/dist/plugin/node-cjs/plugins/plugin.cjs.map +0 -7
  191. package/dist/plugin/node-cjs/theme.css +0 -1418
  192. package/dist/plugin/node-cjs/theme.css.map +0 -7
  193. package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs +0 -49
  194. package/dist/plugin/node-esm/chunk-AFRHJHP4.mjs.map +0 -7
  195. package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs +0 -1614
  196. package/dist/plugin/node-esm/chunk-HJE6EZWE.mjs.map +0 -7
  197. package/dist/plugin/node-esm/config/tailwind.mjs +0 -8
  198. package/dist/plugin/node-esm/config/tailwind.mjs.map +0 -7
  199. package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs +0 -63
  200. package/dist/plugin/node-esm/plugins/esbuild-plugin.mjs.map +0 -7
  201. package/dist/plugin/node-esm/plugins/plugin.mjs +0 -98
  202. package/dist/plugin/node-esm/plugins/plugin.mjs.map +0 -7
  203. package/dist/plugin/node-esm/theme.css +0 -1418
  204. package/dist/plugin/node-esm/theme.css.map +0 -7
  205. package/dist/types/src/Tokens.stories.d.ts +0 -10
  206. package/dist/types/src/Tokens.stories.d.ts.map +0 -1
  207. package/dist/types/src/config/index.d.ts +0 -3
  208. package/dist/types/src/config/index.d.ts.map +0 -1
  209. package/dist/types/src/config/tailwind.d.ts +0 -9
  210. package/dist/types/src/config/tailwind.d.ts.map +0 -1
  211. package/dist/types/src/config/tokens/alias-colors.d.ts +0 -21
  212. package/dist/types/src/config/tokens/alias-colors.d.ts.map +0 -1
  213. package/dist/types/src/config/tokens/index.d.ts +0 -486
  214. package/dist/types/src/config/tokens/index.d.ts.map +0 -1
  215. package/dist/types/src/config/tokens/lengths.d.ts +0 -139
  216. package/dist/types/src/config/tokens/lengths.d.ts.map +0 -1
  217. package/dist/types/src/config/tokens/physical-colors.d.ts +0 -23
  218. package/dist/types/src/config/tokens/physical-colors.d.ts.map +0 -1
  219. package/dist/types/src/config/tokens/semantic-colors.d.ts +0 -187
  220. package/dist/types/src/config/tokens/semantic-colors.d.ts.map +0 -1
  221. package/dist/types/src/config/tokens/sememes-calls.d.ts +0 -3
  222. package/dist/types/src/config/tokens/sememes-calls.d.ts.map +0 -1
  223. package/dist/types/src/config/tokens/sememes-codemirror.d.ts +0 -43
  224. package/dist/types/src/config/tokens/sememes-codemirror.d.ts.map +0 -1
  225. package/dist/types/src/config/tokens/sememes-hue.d.ts +0 -4
  226. package/dist/types/src/config/tokens/sememes-hue.d.ts.map +0 -1
  227. package/dist/types/src/config/tokens/sememes-sheet.d.ts +0 -58
  228. package/dist/types/src/config/tokens/sememes-sheet.d.ts.map +0 -1
  229. package/dist/types/src/config/tokens/sememes-system.d.ts +0 -99
  230. package/dist/types/src/config/tokens/sememes-system.d.ts.map +0 -1
  231. package/dist/types/src/config/tokens/sizes.d.ts +0 -7
  232. package/dist/types/src/config/tokens/sizes.d.ts.map +0 -1
  233. package/dist/types/src/config/tokens/types.d.ts +0 -5
  234. package/dist/types/src/config/tokens/types.d.ts.map +0 -1
  235. package/dist/types/src/plugins/esbuild-plugin.d.ts +0 -9
  236. package/dist/types/src/plugins/esbuild-plugin.d.ts.map +0 -1
  237. package/dist/types/src/plugins/plugin.d.ts +0 -20
  238. package/dist/types/src/plugins/plugin.d.ts.map +0 -1
  239. package/dist/types/src/plugins/resolveContent.d.ts +0 -2
  240. package/dist/types/src/plugins/resolveContent.d.ts.map +0 -1
  241. package/dist/types/src/styles/components/anchored-overflow.d.ts +0 -6
  242. package/dist/types/src/styles/components/anchored-overflow.d.ts.map +0 -1
  243. package/dist/types/src/styles/components/avatar.d.ts.map +0 -1
  244. package/dist/types/src/styles/components/breadcrumb.d.ts.map +0 -1
  245. package/dist/types/src/styles/components/button.d.ts +0 -19
  246. package/dist/types/src/styles/components/button.d.ts.map +0 -1
  247. package/dist/types/src/styles/components/dialog.d.ts.map +0 -1
  248. package/dist/types/src/styles/components/icon-button.d.ts.map +0 -1
  249. package/dist/types/src/styles/components/icon.d.ts.map +0 -1
  250. package/dist/types/src/styles/components/index.d.ts.map +0 -1
  251. package/dist/types/src/styles/components/input.d.ts.map +0 -1
  252. package/dist/types/src/styles/components/link.d.ts.map +0 -1
  253. package/dist/types/src/styles/components/list.d.ts.map +0 -1
  254. package/dist/types/src/styles/components/main.d.ts.map +0 -1
  255. package/dist/types/src/styles/components/menu.d.ts.map +0 -1
  256. package/dist/types/src/styles/components/message.d.ts.map +0 -1
  257. package/dist/types/src/styles/components/popover.d.ts.map +0 -1
  258. package/dist/types/src/styles/components/scroll-area.d.ts +0 -9
  259. package/dist/types/src/styles/components/scroll-area.d.ts.map +0 -1
  260. package/dist/types/src/styles/components/select.d.ts.map +0 -1
  261. package/dist/types/src/styles/components/separator.d.ts.map +0 -1
  262. package/dist/types/src/styles/components/status.d.ts.map +0 -1
  263. package/dist/types/src/styles/components/tag.d.ts.map +0 -1
  264. package/dist/types/src/styles/components/toast.d.ts.map +0 -1
  265. package/dist/types/src/styles/components/toolbar.d.ts +0 -11
  266. package/dist/types/src/styles/components/toolbar.d.ts.map +0 -1
  267. package/dist/types/src/styles/components/tooltip.d.ts.map +0 -1
  268. package/dist/types/src/styles/components/treegrid.d.ts.map +0 -1
  269. package/dist/types/src/styles/fragments/density.d.ts +0 -13
  270. package/dist/types/src/styles/fragments/density.d.ts.map +0 -1
  271. package/dist/types/src/styles/fragments/dimension.d.ts +0 -5
  272. package/dist/types/src/styles/fragments/dimension.d.ts.map +0 -1
  273. package/dist/types/src/styles/fragments/disabled.d.ts.map +0 -1
  274. package/dist/types/src/styles/fragments/elevation.d.ts.map +0 -1
  275. package/dist/types/src/styles/fragments/focus.d.ts +0 -6
  276. package/dist/types/src/styles/fragments/focus.d.ts.map +0 -1
  277. package/dist/types/src/styles/fragments/group.d.ts +0 -5
  278. package/dist/types/src/styles/fragments/group.d.ts.map +0 -1
  279. package/dist/types/src/styles/fragments/hover.d.ts +0 -17
  280. package/dist/types/src/styles/fragments/hover.d.ts.map +0 -1
  281. package/dist/types/src/styles/fragments/index.d.ts +0 -17
  282. package/dist/types/src/styles/fragments/index.d.ts.map +0 -1
  283. package/dist/types/src/styles/fragments/layout.d.ts +0 -3
  284. package/dist/types/src/styles/fragments/layout.d.ts.map +0 -1
  285. package/dist/types/src/styles/fragments/motion.d.ts +0 -2
  286. package/dist/types/src/styles/fragments/motion.d.ts.map +0 -1
  287. package/dist/types/src/styles/fragments/ornament.d.ts +0 -5
  288. package/dist/types/src/styles/fragments/ornament.d.ts.map +0 -1
  289. package/dist/types/src/styles/fragments/selected.d.ts +0 -13
  290. package/dist/types/src/styles/fragments/selected.d.ts.map +0 -1
  291. package/dist/types/src/styles/fragments/shimmer.d.ts +0 -3
  292. package/dist/types/src/styles/fragments/shimmer.d.ts.map +0 -1
  293. package/dist/types/src/styles/fragments/size.d.ts +0 -9
  294. package/dist/types/src/styles/fragments/size.d.ts.map +0 -1
  295. package/dist/types/src/styles/fragments/surface.d.ts +0 -9
  296. package/dist/types/src/styles/fragments/surface.d.ts.map +0 -1
  297. package/dist/types/src/styles/fragments/text.d.ts +0 -7
  298. package/dist/types/src/styles/fragments/text.d.ts.map +0 -1
  299. package/dist/types/src/styles/fragments/valence.d.ts +0 -13
  300. package/dist/types/src/styles/fragments/valence.d.ts.map +0 -1
  301. package/dist/types/src/styles/index.d.ts +0 -4
  302. package/dist/types/src/styles/index.d.ts.map +0 -1
  303. package/dist/types/src/styles/theme.d.ts +0 -5
  304. package/dist/types/src/styles/theme.d.ts.map +0 -1
  305. package/dist/types/src/tailwind.d.ts +0 -3
  306. package/dist/types/src/tailwind.d.ts.map +0 -1
  307. package/dist/types/src/types.d.ts +0 -3
  308. package/dist/types/src/types.d.ts.map +0 -1
  309. package/dist/types/src/util/withLogical.d.ts +0 -164
  310. package/dist/types/src/util/withLogical.d.ts.map +0 -1
  311. package/src/Tokens.stories.tsx +0 -88
  312. package/src/config/index.ts +0 -6
  313. package/src/config/tailwind.ts +0 -264
  314. package/src/config/tokens/alias-colors.ts +0 -39
  315. package/src/config/tokens/index.ts +0 -92
  316. package/src/config/tokens/lengths.ts +0 -97
  317. package/src/config/tokens/physical-colors.ts +0 -125
  318. package/src/config/tokens/semantic-colors.ts +0 -27
  319. package/src/config/tokens/sememes-calls.ts +0 -17
  320. package/src/config/tokens/sememes-codemirror.ts +0 -50
  321. package/src/config/tokens/sememes-hue.ts +0 -54
  322. package/src/config/tokens/sememes-sheet.ts +0 -62
  323. package/src/config/tokens/sememes-system.ts +0 -302
  324. package/src/config/tokens/sizes.ts +0 -10
  325. package/src/config/tokens/types.ts +0 -9
  326. package/src/docs/theme.drawio.svg +0 -635
  327. package/src/plugins/esbuild-plugin.ts +0 -65
  328. package/src/plugins/plugin.ts +0 -130
  329. package/src/plugins/resolveContent.ts +0 -51
  330. package/src/styles/components/README.md +0 -6
  331. package/src/styles/components/anchored-overflow.ts +0 -20
  332. package/src/styles/components/button.ts +0 -48
  333. package/src/styles/components/icon.ts +0 -19
  334. package/src/styles/components/input.ts +0 -177
  335. package/src/styles/components/scroll-area.ts +0 -43
  336. package/src/styles/components/toolbar.ts +0 -29
  337. package/src/styles/fragments/density.ts +0 -17
  338. package/src/styles/fragments/dimension.ts +0 -8
  339. package/src/styles/fragments/focus.ts +0 -16
  340. package/src/styles/fragments/group.ts +0 -12
  341. package/src/styles/fragments/hover.ts +0 -25
  342. package/src/styles/fragments/index.ts +0 -20
  343. package/src/styles/fragments/layout.ts +0 -7
  344. package/src/styles/fragments/motion.ts +0 -6
  345. package/src/styles/fragments/ornament.ts +0 -10
  346. package/src/styles/fragments/selected.ts +0 -45
  347. package/src/styles/fragments/shimmer.ts +0 -9
  348. package/src/styles/fragments/size.ts +0 -117
  349. package/src/styles/fragments/surface.ts +0 -29
  350. package/src/styles/fragments/text.ts +0 -12
  351. package/src/styles/fragments/valence.ts +0 -46
  352. package/src/styles/layers/README.md +0 -15
  353. package/src/styles/layers/anchored-overflow.css +0 -9
  354. package/src/styles/layers/animation.css +0 -17
  355. package/src/styles/layers/attention.css +0 -8
  356. package/src/styles/layers/base.css +0 -25
  357. package/src/styles/layers/can-scroll.css +0 -26
  358. package/src/styles/layers/drag-preview.css +0 -18
  359. package/src/styles/layers/hues.css +0 -110
  360. package/src/styles/layers/index.css +0 -26
  361. package/src/styles/layers/main.css +0 -227
  362. package/src/styles/layers/positioning.css +0 -23
  363. package/src/styles/layers/surfaces.css +0 -31
  364. package/src/styles/layers/tag.css +0 -132
  365. package/src/styles/layers/tldraw.css +0 -91
  366. package/src/styles/layers/tokens.css +0 -46
  367. package/src/tailwind.ts +0 -7
  368. package/src/theme.css +0 -9
  369. package/src/types.ts +0 -7
  370. package/src/util/withLogical.ts +0 -114
  371. /package/dist/types/src/{styles/fragments → fragments}/disabled.d.ts +0 -0
  372. /package/dist/types/src/{styles → theme}/components/avatar.d.ts +0 -0
  373. /package/dist/types/src/{styles → theme}/components/breadcrumb.d.ts +0 -0
  374. /package/dist/types/src/{styles → theme}/components/icon-button.d.ts +0 -0
  375. /package/dist/types/src/{styles → theme}/components/link.d.ts +0 -0
  376. /package/dist/types/src/{styles → theme}/components/list.d.ts +0 -0
  377. /package/dist/types/src/{styles → theme}/components/select.d.ts +0 -0
  378. /package/dist/types/src/{styles → theme}/components/separator.d.ts +0 -0
  379. /package/dist/types/src/{styles → theme}/components/tag.d.ts +0 -0
  380. /package/dist/types/src/{styles → theme}/components/toast.d.ts +0 -0
  381. /package/dist/types/src/{styles → theme}/components/tooltip.d.ts +0 -0
  382. /package/dist/types/src/{styles → theme}/components/treegrid.d.ts +0 -0
  383. /package/src/{styles/fragments → fragments}/disabled.ts +0 -0
  384. /package/src/{styles → theme}/components/breadcrumb.ts +0 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Text
3
+ */
4
+
5
+ @theme {
6
+ /* Font families */
7
+ --font-body: 'Inter Variable', ui-sans-serif, system-ui, sans-serif;
8
+ --font-mono: 'JetBrains Mono Variable', ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
9
+
10
+ /* Font size scale (Tailwind v4 defaults — clean rem/px values) */
11
+ --text-xs: 0.75rem;
12
+ --text-xs--line-height: 1rem;
13
+ --text-sm: 0.875rem;
14
+ --text-sm--line-height: 1.25rem;
15
+ --text-base: 1rem;
16
+ --text-base--line-height: 1.5rem;
17
+ --text-lg: 1.125rem;
18
+ --text-lg--line-height: 1.75rem;
19
+ --text-xl: 1.25rem;
20
+ --text-xl--line-height: 1.75rem;
21
+ --text-2xl: 1.5rem;
22
+ --text-2xl--line-height: 2rem;
23
+ --text-3xl: 1.875rem;
24
+ --text-3xl--line-height: 2.25rem;
25
+ --text-4xl: 2.25rem;
26
+ --text-4xl--line-height: 2.5rem;
27
+ --text-5xl: 3rem;
28
+ --text-5xl--line-height: 1;
29
+ --text-6xl: 3.75rem;
30
+ --text-6xl--line-height: 1;
31
+ --text-7xl: 4.5rem;
32
+ --text-7xl--line-height: 1;
33
+ --text-8xl: 6rem;
34
+ --text-8xl--line-height: 1;
35
+ --text-9xl: 8rem;
36
+ --text-9xl--line-height: 1;
37
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Tailwind utility classes.
3
+ */
4
+
5
+ /**
6
+ * Layout rules for flex-based scroll containment:
7
+ * `flex flex-col`
8
+ * On a container: makes it a flex column so children stack and can use `flex-1`.
9
+ * `flex-1`
10
+ * On a child: grows to fill the flex parent. Requires the parent to be `flex`.
11
+ * `min-h-0` (alongside `flex-1`):
12
+ * Overrides default flex children: `min-height:auto` (sized to content), which prevents shrinking.
13
+ * Allows element to shrink and trigger overflow/scrolling.
14
+ * Always pair with `flex-1` when scroll is needed.
15
+ * `h-full`:
16
+ * Fills 100% of the parent's *computed* height.
17
+ * Use when the parent has a definite height but is not a flex container (e.g. `overflow:hidden` wrapper).
18
+ * Unlike `flex-1`, does not require the parent to be flex.
19
+ *
20
+ * Pattern for a scrollable region inside a flex ancestor:
21
+ * ancestor → `flex flex-col` (or `flex flex-row`)
22
+ * scroll root → `flex-1 min-h-0` (fills ancestor, can shrink)
23
+ * scroll viewport → `h-full overflow-y-scroll` (fills root, scrolls)
24
+ */
25
+
26
+ /**
27
+ * Fills the available space.
28
+ */
29
+ @utility dx-expander {
30
+ @apply flex-1 min-h-0 min-w-0 h-full w-full;
31
+ }
32
+
33
+ /**
34
+ * Container that fills the available space (extends dx-expander with overflow clipping).
35
+ */
36
+ @utility dx-container {
37
+ @apply dx-expander overflow-hidden;
38
+ }
39
+
40
+ /**
41
+ * Column that fills the available space (extends dx-expander with overflow clipping).
42
+ */
43
+ @utility dx-column {
44
+ @apply flex-1 min-w-0 w-full;
45
+ }
46
+
47
+ /**
48
+ * Fullscreen
49
+ */
50
+ @utility dx-fullscreen {
51
+ @apply absolute inset-0;
52
+ }
53
+
54
+ /**
55
+ * Visual warning to indicate incorrect usage of `slottable`.
56
+ */
57
+ @utility dx-slot-warning {
58
+ @apply border border-rose-500 border-dashed;
59
+ }
60
+
61
+ /**
62
+ * Pseudo-element overlay for ring indicators (focus, current, etc.).
63
+ *
64
+ * A standard CSS `box-shadow` ring is painted behind child content, so children with
65
+ * opaque backgrounds (e.g., cards, avatars) obscure it. By painting the ring on an
66
+ * absolutely-positioned `::after` pseudo-element that sits above the element's children
67
+ * in stacking order, the ring is always visible regardless of child backgrounds.
68
+ *
69
+ * The pseudo-element inherits `border-radius` from its parent and is `pointer-events-none`
70
+ * so it doesn't interfere with interactions. The ring starts transparent; consumers
71
+ * activate it conditionally (e.g., `focus:after:ring-*`, `aria-[current=true]:after:ring-*`).
72
+ */
73
+ @utility dx-ring-pseudo {
74
+ @apply relative after:content-[""] after:absolute after:inset-0 after:rounded-[inherit]
75
+ after:pointer-events-none after:ring after:ring-inset after:ring-transparent;
76
+ }
package/src/defs.ts ADDED
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ import { type ChromaticPalette } from '@dxos/ui-types';
6
+
7
+ /**
8
+ * Translation namespace for OS-level translations.
9
+ */
10
+ export const osTranslations = 'org.dxos.i18n.os';
11
+
12
+ /**
13
+ * Available color hues for UI components.
14
+ */
15
+ export const hues: ChromaticPalette[] = [
16
+ 'red',
17
+ 'orange',
18
+ 'amber',
19
+ 'yellow',
20
+ 'lime',
21
+ 'green',
22
+ 'emerald',
23
+ 'teal',
24
+ 'cyan',
25
+ 'sky',
26
+ 'blue',
27
+ 'indigo',
28
+ 'violet',
29
+ 'purple',
30
+ 'fuchsia',
31
+ 'pink',
32
+ 'rose',
33
+ ] as const;
34
+
35
+ export const hueShades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const;
36
+
37
+ export const roles = ['fill', 'surface', 'surface-text', 'text', 'border'] as const;
38
+
39
+ /**
40
+ * Card size constants (Tailwind spacing units).
41
+ * Cards should be no larger than 320px per WCAG 2.1 SC 1.4.10.
42
+ */
43
+ // TODO(burdon): Replace usage of these with semantic tokens.
44
+ export const cardMinInlineSize = 18;
45
+ export const cardDefaultInlineSize = 20; // 320px
46
+ export const cardMaxInlineSize = 22;
47
+ export const cardMinBlockSize = 18;
48
+ export const cardMaxBlockSize = 30;
@@ -0,0 +1,57 @@
1
+ # Fragment Definitions Audit
2
+
3
+ External packages importing fragment definitions from `ui-theme/src/fragments`.
4
+
5
+ ## Current Fragment Exports
6
+
7
+ | File | Definition | External | Internal |
8
+ | ------------- | ------------------------------------- | -------- | -------- |
9
+ | `density.ts` | `densityBlockSize` | - | 1 |
10
+ | `density.ts` | `coarseBlockSize` | - | 1 |
11
+ | `density.ts` | `coarseDimensions` | - | 1 |
12
+ | `density.ts` | `fineBlockSize` | - | 1 |
13
+ | `density.ts` | `fineDimensions` | - | 1 |
14
+ | `disabled.ts` | `staticDisabled` | - | 1 |
15
+ | `disabled.ts` | `dataDisabled` | - | 1 |
16
+ | `focus.ts` | `focusRing` | 2 | 5 |
17
+ | `focus.ts` | `subduedFocus` | - | 2 |
18
+ | `focus.ts` | `staticFocusRing` | - | 1 |
19
+ | `hover.ts` | `subtleHover` | 4 | - |
20
+ | `hover.ts` | `ghostHover` | 8 | 2 |
21
+ | `hover.ts` | `ghostFocusWithin` | 1 | - |
22
+ | `hover.ts` | `hoverableControls` | 9 | - |
23
+ | `hover.ts` | `groupHoverControlItemWithTransition` | 2 | - |
24
+ | `hover.ts` | `hoverableFocusedKeyboardControls` | 1 | - |
25
+ | `hover.ts` | `hoverableFocusedWithinControls` | 9 | - |
26
+ | `hover.ts` | `hoverableOpenControlItem` | 3 | - |
27
+ | `hover.ts` | `hoverableControlItem` | 7 | - |
28
+ | `text.ts` | `descriptionTextPrimary` | 1 | - |
29
+ | `text.ts` | `descriptionMessage` | 5 | - |
30
+
31
+ ## Summary
32
+
33
+ **Total fragments:** 21
34
+ **Total imports (external + internal):** 96
35
+
36
+ - **External:** 63
37
+ - **Internal:** 33
38
+
39
+ **Most imported overall:**
40
+
41
+ - `hoverableControls` (9 external)
42
+ - `hoverableFocusedWithinControls` (9 external)
43
+ - `ghostHover` (8 external + 2 internal = 10 total)
44
+ - `hoverableControlItem` (7 external)
45
+ - `focusRing` (2 external + 5 internal = 7 total)
46
+
47
+ **Internal imports by file:**
48
+
49
+ - `input.ts`: 8 definitions (coarseBlockSize, coarseDimensions, fineBlockSize, fineDimensions, focusRing, staticDisabled, staticFocusRing, subduedFocus)
50
+ - `list.ts`: 3 definitions (densityBlockSize, focusRing, ghostHover)
51
+ - `menu.ts`: 2 definitions (dataDisabled, subduedFocus)
52
+ - `button.ts`, `link.ts`, `popover.ts`, `toast.ts`: 1 definition each (ghostHover, focusRing, focusRing, focusRing)
53
+
54
+ **Completely unused:** 7 fragments
55
+
56
+ - `subtleHover` from `hover.ts`
57
+ - `hoverableOpenControlItem`, `groupHoverControlItemWithTransition` from `hover.ts` (only 2-3 uses)
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { type Density } from '@dxos/ui-types';
6
+
7
+ const fineBlockSize = 'min-h-[2.5rem] pointer-fine:min-h-[2rem]';
8
+ const coarseBlockSize = 'min-h-[2.5rem]';
9
+
10
+ const fineDimensions = `${fineBlockSize} px-2`;
11
+ const coarseDimensions = `${coarseBlockSize} px-3`;
12
+
13
+ export const densityDimensions = (density: Density = 'fine') =>
14
+ density === 'fine' ? fineDimensions : coarseDimensions;
15
+
16
+ export const densityBlockSize = (density: Density = 'fine') => (density === 'fine' ? fineBlockSize : coarseBlockSize);
@@ -0,0 +1,18 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ export const subtleHover = 'hover:bg-hover-overlay';
6
+
7
+ export const ghostHover = 'hover:bg-hover-surface';
8
+ export const ghostFocusWithin = 'focus-within:bg-hover-surface';
9
+
10
+ export const hoverableControls =
11
+ '[--controls-opacity:1] hover-hover:[--controls-opacity:0] hover-hover:hover:[--controls-opacity:1]';
12
+
13
+ export const groupHoverControlItemWithTransition = 'transition-opacity duration-200 opacity-0 group-hover:opacity-100';
14
+
15
+ export const hoverableFocusedKeyboardControls = 'focus-visible:[--controls-opacity:1]';
16
+ export const hoverableFocusedWithinControls = 'focus-within:[--controls-opacity:1]';
17
+ export const hoverableOpenControlItem = 'hover-hover:aria-[expanded=true]:[--controls-opacity:1]';
18
+ export const hoverableControlItem = 'opacity-(--controls-opacity)';
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ // TODO(burdon): Remove export of fragments.
6
+
7
+ export * from './density';
8
+ export * from './disabled';
9
+ export * from './hover';
10
+ export * from './text';
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ // TODO(burdon): Replace with Message component.
6
+ export const descriptionMessage = 'text-description border border-dashed border-separator rounded-sm p-4';
package/src/index.ts CHANGED
@@ -2,18 +2,7 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import { type TailwindConfig, tailwindConfig } from './config';
6
-
7
- export { cardDefaultInlineSize, cardMinInlineSize, cardMaxInlineSize, hues, userDefaultTokenSet } from './config';
8
- export * from './styles';
9
- export * from './types';
5
+ export * from './defs';
6
+ export * from './fragments';
7
+ export * from './theme';
10
8
  export * from './util';
11
-
12
- const tokens: TailwindConfig['theme'] = tailwindConfig({}).theme;
13
-
14
- export { tokens };
15
-
16
- /**
17
- * Translation namespace for OS-level translations.
18
- */
19
- export const osTranslations = 'dxos.org/i18n/os';
package/src/main.css ADDED
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Main theme.
3
+ */
4
+
5
+ /**
6
+ * Establish CSS cascade layer order before Tailwind sets its own.
7
+ * First mention of a layer name wins its position in the order.
8
+ *
9
+ * NOTE: `utilities` must be last so it overrides all base and component layers.
10
+ * NOTE: This must be in sync with the `transformIndexHtml` function in `packages/ui/ui-theme/src/plugins/plugin.ts`.
11
+ */
12
+ @layer properties, theme, dx-tokens, user-tokens, base, tw-base, dx-base, components, tw-components, dx-components, utilities;
13
+
14
+ @import 'tailwindcss';
15
+
16
+ /* @theme extensions */
17
+ @import './css/theme/animation.css';
18
+ @import './css/theme/border.css';
19
+ @import './css/theme/palette.css';
20
+ @import './css/theme/semantic.css';
21
+ @import './css/theme/spacing.css';
22
+ @import './css/theme/styles.css';
23
+ @import './css/theme/text.css';
24
+
25
+ /* @layer dx-base, dx-tokens */
26
+ @import './css/base/base.css';
27
+ @import './css/base/typography.css';
28
+
29
+ /* @layer dx-components (components) */
30
+ @import './css/components/button.css';
31
+ @import './css/components/checkbox.css';
32
+ @import './css/components/dialog.css';
33
+ @import './css/components/focus.css';
34
+ @import './css/components/icon.css';
35
+ @import './css/components/panel.css';
36
+ @import './css/components/link.css';
37
+ @import './css/components/scrollbar.css';
38
+ @import './css/components/selected.css';
39
+ @import './css/components/surface.css';
40
+ @import './css/components/tag.css';
41
+ @import './css/components/text.css';
42
+
43
+ /* @layer dx-components (layout) */
44
+ @import './css/layout/main.css';
45
+ @import './css/layout/native.css';
46
+ @import './css/layout/positioning.css';
47
+ @import './css/layout/size.css';
48
+
49
+ /* @layer dx-utilities */
50
+ @import './css/utilities.css';
51
+
52
+ /* Third-party integrations */
53
+ @import './css/integrations/codemirror.css';
54
+ @import './css/integrations/tldraw.css';
55
+
56
+ /**
57
+ * Force-emit CSS variables for the full color palette for all:
58
+ * --color-{hue}-{shade}
59
+ * --color-{hue}-{style}
60
+ */
61
+ @source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{50,100,200,300,400,500,600,700,800,900,950}");
62
+ @source inline("bg-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{fill,surface,surface-text,text,border}");
63
+ @source inline("border-{neutral,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-border");
64
+ @source inline("bg-{info,success,warning,error}-{fill,surface,surface-text,text,border}");
65
+ @source inline("border-{info,success,warning,error}-border");
66
+
67
+ /**
68
+ * Plugins must come after all imports.
69
+ */
70
+ @plugin '@tailwindcss/forms';
71
+ @plugin 'tailwind-scrollbar';
72
+ @plugin 'tailwindcss-radix';
73
+
74
+ /**
75
+ * Class-based dark mode.
76
+ * The `.dark` class on an ancestor toggles `dark:` utilities.
77
+ */
78
+ @variant dark (&:where(.dark, .dark *));
79
+
80
+ /** Mobile */
81
+ @custom-variant pointer-coarse (@media (pointer: coarse));
82
+ /** Web */
83
+ @custom-variant pointer-fine (@media (pointer: fine));
84
+ /** Supports mouse/trackpad (Web) */
85
+ @custom-variant hover-hover (@media (hover: hover));
86
+ /** Active navigation */
87
+ @custom-variant is-current (&[aria-current]:not([aria-current="false"]));
@@ -0,0 +1,125 @@
1
+ //
2
+ // Copyright 2022 DXOS.org
3
+ //
4
+
5
+ /* eslint-disable no-console */
6
+
7
+ import tailwindcss from '@tailwindcss/postcss';
8
+ import autoprefixer from 'autoprefixer';
9
+ import { existsSync, readFileSync } from 'node:fs';
10
+ import { dirname, resolve } from 'node:path';
11
+ import postcssImport from 'postcss-import';
12
+ import postcssNesting from 'postcss-nesting';
13
+ import { type HtmlTagDescriptor, type Plugin, type UserConfig } from 'vite';
14
+
15
+ /**
16
+ * CSS cascade layer order.
17
+ * Must be established before any stylesheets load so that Tailwind's own @layer declarations don't override our ordering. Exported so consuming
18
+ */
19
+ export const LAYER_ORDER = [
20
+ 'properties',
21
+ 'theme',
22
+ 'dx-tokens',
23
+ 'user-tokens',
24
+ 'base',
25
+ 'tw-base',
26
+ 'dx-base',
27
+ 'components',
28
+ 'tw-components',
29
+ 'dx-components',
30
+ 'utilities',
31
+ ] as const;
32
+
33
+ const ROOT = '../../../../';
34
+
35
+ export type ThemePluginOptions = {
36
+ srcCssPath?: string;
37
+ virtualFileId?: string;
38
+ verbose?: boolean;
39
+ };
40
+
41
+ /**
42
+ * Vite plugin to configure theme.
43
+ */
44
+ export const ThemePlugin = (options: ThemePluginOptions): Plugin => {
45
+ // Prefer source CSS if available (monorepo dev), fall back to dist for installed package.
46
+ const srcThemePath = resolve(import.meta.dirname, ROOT, 'src/main.css');
47
+ const distThemePath = resolve(import.meta.dirname, '../main.css');
48
+ const isMonorepo = existsSync(srcThemePath);
49
+
50
+ // Static assets shipped via "files": ["src"] in package.json.
51
+ // Both monorepo and installed package resolve to the same src/plugins/ directory.
52
+ const pluginsDir = resolve(import.meta.dirname, ROOT, 'src/plugins');
53
+ const darkModeScriptPath = resolve(pluginsDir, 'dark-mode.ts');
54
+ const mainCssPath = resolve(pluginsDir, 'main.css');
55
+
56
+ const config: ThemePluginOptions = {
57
+ srcCssPath: isMonorepo ? srcThemePath : distThemePath,
58
+ virtualFileId: '@dxos-theme',
59
+ ...options,
60
+ };
61
+
62
+ // Derive project root from the source location so Tailwind scans all packages.
63
+ const base = isMonorepo ? resolve(dirname(srcThemePath), ROOT) : undefined;
64
+
65
+ if (process.env.DEBUG || options.verbose) {
66
+ console.log('ThemePlugin:\n', JSON.stringify(config, null, 2));
67
+ }
68
+
69
+ return {
70
+ name: 'vite-plugin-dxos-ui-theme',
71
+ config: (): UserConfig => {
72
+ return {
73
+ css: {
74
+ postcss: {
75
+ plugins: [
76
+ // Handles @import statements in CSS.
77
+ postcssImport(),
78
+ // Processes CSS nesting syntax.
79
+ postcssNesting(),
80
+ // Processes Tailwind directives and generates utilities from scanned content.
81
+ // base points to project root so all packages are scanned (not just ui-theme).
82
+ tailwindcss(base !== undefined ? { base } : {}),
83
+ // Adds vendor prefixes.
84
+ autoprefixer,
85
+ ],
86
+ },
87
+ },
88
+ };
89
+ },
90
+ resolveId: (id) => {
91
+ if (id === config.virtualFileId) {
92
+ return config.srcCssPath;
93
+ }
94
+ },
95
+ transformIndexHtml: () => {
96
+ // Apply .dark class to <html> synchronously before any scripts run, so that
97
+ // the critical CSS html.dark rules apply on the very first paint.
98
+ const darkModeTag: HtmlTagDescriptor = {
99
+ tag: 'script',
100
+ attrs: { 'data-dxos-theme': '' },
101
+ injectTo: 'head-prepend',
102
+ children: readFileSync(darkModeScriptPath, 'utf-8'),
103
+ };
104
+
105
+ // Establish cascade layer order before any stylesheet loads.
106
+ const layersTag: HtmlTagDescriptor = {
107
+ tag: 'style',
108
+ attrs: { 'data-dxos-layers': '' },
109
+ children: `@layer ${LAYER_ORDER.join(', ')};`,
110
+ injectTo: 'head-prepend',
111
+ };
112
+
113
+ // Critical styles: font sizing, overscroll, color fallbacks.
114
+ // Loaded from critical.css to keep styles maintainable and out of index.html.
115
+ const criticalTag: HtmlTagDescriptor = {
116
+ tag: 'style',
117
+ attrs: { 'data-dxos-critical': '' },
118
+ injectTo: 'head-prepend',
119
+ children: readFileSync(mainCssPath, 'utf-8'),
120
+ };
121
+
122
+ return [darkModeTag, layersTag, criticalTag];
123
+ },
124
+ };
125
+ };
@@ -0,0 +1,22 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ // @ts-nocheck - This file is injected as a raw JS string into <head> by ThemePlugin (readFileSync).
6
+ // It runs in the browser, not Node.js — browser globals (window, document) are intentional.
7
+ // Must remain valid JavaScript (no TypeScript-specific syntax).
8
+
9
+ // Applies the .dark class to <html> synchronously before any other scripts run so that the
10
+ // critical CSS html.dark rules take effect on the very first paint. Continues to track changes.
11
+ // NOTE: Theme switching may be overridden in Chrome via:
12
+ // chrome://settings/appearance and chrome://flags/#enable-force-dark
13
+ (() => {
14
+ const query = window.matchMedia('(prefers-color-scheme: dark)');
15
+ const applyTheme = (dark) => {
16
+ document.documentElement.classList[dark ? 'add' : 'remove']('dark');
17
+ };
18
+ applyTheme(query.matches);
19
+ query.addEventListener('change', (event) => {
20
+ applyTheme(event.matches);
21
+ });
22
+ })();
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Critical styles injected into <head> by the Vite ThemePlugin before any stylesheets load.
3
+ * Ensures text is readable and layout is stable on the very first paint.
4
+ */
5
+
6
+ /* Base font size: larger default for touch devices, smaller for precision pointers. */
7
+ html {
8
+ font-size: 20px;
9
+ }
10
+ @media (pointer: fine) {
11
+ html {
12
+ font-size: 16px;
13
+ }
14
+ }
15
+
16
+ /* Prevent overscroll bounce and ensure full viewport height. */
17
+ html,
18
+ body {
19
+ overscroll-behavior: none;
20
+ -webkit-overflow-scrolling: touch;
21
+ }
22
+ body {
23
+ height: 100vh;
24
+ }
25
+
26
+ /* Pre-CSS color fallbacks so text is readable before and during Vite HMR. */
27
+ /* Values are intentionally kept in sync with @theme tokens in semantic.css. */
28
+ :root {
29
+ color-scheme: light;
30
+ }
31
+ html {
32
+ color: oklch(0.145 0 0);
33
+ background-color: oklch(0.985 0 0);
34
+ }
35
+ html.dark {
36
+ color-scheme: dark;
37
+ color: oklch(0.985 0 0);
38
+ background-color: oklch(0.145 0 0);
39
+ }
40
+ @media (prefers-color-scheme: dark) {
41
+ html:not(.dark) {
42
+ color: oklch(0.985 0 0);
43
+ background-color: oklch(0.145 0 0);
44
+ }
45
+ }
@@ -4,8 +4,7 @@
4
4
 
5
5
  import { type ComponentFunction, type Size, type Theme } from '@dxos/ui-types';
6
6
 
7
- import { mx } from '../../util';
8
- import { descriptionText, getSize, getSizeHeight } from '../fragments';
7
+ import { mx, getSize, getHeight } from '../../util';
9
8
 
10
9
  export type AvatarStyleProps = Partial<{
11
10
  size: Size;
@@ -20,34 +19,34 @@ export const avatarRoot: ComponentFunction<AvatarStyleProps> = ({ size = 10, inG
20
19
  mx(
21
20
  'relative inline-flex shrink-0',
22
21
  getSize(size),
23
- inGroup && (size === 'px' || size <= 3 ? '-mie-1' : '-mie-2'),
22
+ inGroup && (size === 'px' || size <= 3 ? '-mr-1' : '-mr-2'),
24
23
  ...etc,
25
24
  );
26
25
 
27
26
  export const avatarLabel: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) => mx(srOnly && 'sr-only', ...etc);
28
27
 
29
28
  export const avatarDescription: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) =>
30
- mx(descriptionText, srOnly && 'sr-only', ...etc);
29
+ mx('text-description', srOnly && 'sr-only', ...etc);
31
30
 
32
31
  export const avatarFrame: ComponentFunction<AvatarStyleProps> = ({ variant }, ...etc) =>
33
- mx('is-full bs-full bg-[--surface-bg]', variant === 'circle' ? 'rounded-full' : 'rounded', ...etc);
32
+ mx('h-full w-full bg-(--surface-bg)', variant === 'circle' ? 'rounded-full' : 'rounded-sm', ...etc);
34
33
 
35
34
  export const avatarStatusIcon: ComponentFunction<AvatarStyleProps> = ({ status, size = 3 }, ...etc) =>
36
35
  mx(
37
- 'absolute block-end-0 inline-end-0',
36
+ 'absolute bottom-0 end-0',
38
37
  getSize(size),
39
38
  status === 'inactive'
40
- ? 'text-amber-350 dark:text-amber-250'
39
+ ? 'text-amber-400 dark:text-amber-300'
41
40
  : status === 'active'
42
- ? 'text-emerald-350 dark:text-emerald-250'
43
- : 'text-neutral-350 dark:text-neutral-250',
41
+ ? 'text-emerald-400 dark:text-emerald-300'
42
+ : 'text-neutral-400 dark:text-neutral-300',
44
43
  ...etc,
45
44
  );
46
45
 
47
46
  export const avatarRing: ComponentFunction<AvatarStyleProps> = ({ status, variant, animation }, ...etc) =>
48
47
  mx(
49
48
  'absolute inset-0 border-2',
50
- variant === 'circle' ? 'rounded-full' : 'rounded',
49
+ variant === 'circle' ? 'rounded-full' : 'rounded-sm',
51
50
  status === 'current'
52
51
  ? 'border-primary-400 dark:border-primary-500'
53
52
  : status === 'active'
@@ -74,13 +73,13 @@ export const avatarGroupLabel: ComponentFunction<AvatarStyleProps> = ({ size, sr
74
73
  mx(
75
74
  srOnly
76
75
  ? 'sr-only'
77
- : 'rounded-full truncate text-sm leading-none plb-1 pli-2 relative z-[1] flex items-center justify-center',
78
- size && getSizeHeight(size),
76
+ : 'rounded-full truncate text-sm leading-none py-1 px-2 relative z-[1] flex items-center justify-center',
77
+ size && getHeight(size),
79
78
  ...etc,
80
79
  );
81
80
 
82
81
  export const avatarGroupDescription: ComponentFunction<AvatarStyleProps> = ({ srOnly }, ...etc) =>
83
- mx(srOnly ? 'sr-only' : descriptionText, ...etc);
82
+ mx(srOnly ? 'sr-only' : 'text-description', ...etc);
84
83
 
85
84
  export const avatarTheme: Theme<AvatarStyleProps> = {
86
85
  root: avatarRoot,